Guest User

Untitled

a guest
Nov 20th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.67 KB | None | 0 0
  1. (require 'ox-latex)
  2. (add-to-list 'org-latex-classes
  3. '("phd"
  4. "\\documentclass[twoside]{iitbreport}"
  5. ("\\chapter{%s}" . "\\chapter*{%s}")
  6. ("\\section{%s}" . "\\section*{%s}")
  7. ("\\subsection{%s}" . "\\subsection*{%s}")
  8. ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  9. ("\\paragraph{%s}" . "\\paragraph*{%s}")
  10. ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
  11. (eval-after-load "org"
  12. '(progn
  13. ;; .txt files aren't in the list initially, but in case that changes
  14. ;; in a future version of org, use if to avoid errors
  15. (if (assoc "\\.txt\\'" org-file-apps)
  16. (setcdr (assoc "\\.txt\\'" org-file-apps) "notepad.exe %s")
  17. (add-to-list 'org-file-apps '("\\.txt\\'" . "notepad.exe %s") t))
  18. ;; Change .pdf association directly within the alist
  19. (setcdr (assoc "\\.pdf\\'" org-file-apps) "evince %s")))
  20.  
  21. (use-package org-ref
  22. :ensure t
  23. :defer t)
  24.  
  25. (setq org-ref-completion-library 'org-ref-ivy-cite)
  26. (use-package org-ref
  27. :after org
  28. :init
  29. (setq reftex-default-bibliography '("~/Dropbox/Research/references.bib"))
  30. (setq org-ref-bibliography-notes "~/Dropbox/Research/notes/notes.org"
  31. org-ref-default-bibliography '("~/Dropbox/Research/references.bib")
  32. org-ref-pdf-directory "~/Dropbox/papers/")
  33.  
  34. (setq helm-bibtex-bibliography "~/Dropbox/Research/references.bib")
  35. (setq helm-bibtex-library-path "~/Dropbox/papers/")
  36.  
  37. (setq helm-bibtex-pdf-open-function
  38. (lambda (fpath)
  39. (start-process "open" "*open*" "open" fpath)))
  40.  
  41. (setq helm-bibtex-notes-path "~/Dropbox/Research/notes/notes.org")
  42. :config
  43. (key-chord-define-global "uu" 'org-ref-cite-hydra/body)
  44. ;; variables that control bibtex key format for auto-generation
  45. ;; I want firstauthor-year-title-words
  46. ;; this usually makes a legitimate filename to store pdfs under.
  47. (setq bibtex-autokey-year-length 4
  48. bibtex-autokey-name-year-separator "-"
  49. bibtex-autokey-year-title-separator "-"
  50. bibtex-autokey-titleword-separator "-"
  51. bibtex-autokey-titlewords 2
  52. bibtex-autokey-titlewords-stretch 1
  53. bibtex-autokey-titleword-length 5))
  54.  
  55. (use-package org-autolist
  56. :after org
  57. :config
  58. (org-autolist-mode +1))
  59.  
  60. (use-package doi-utils
  61. :after org)
  62.  
  63. (use-package org-ref-bibtex
  64. :after org
  65. :init
  66. (setq org-ref-bibtex-hydra-key-binding "\C-cj"))
  67.  
  68. (use-package org
  69. :defer t
  70. :bind (("C-c a" . org-agenda)
  71. ("C-c c" . org-capture)
  72. ("C-c l" . org-store-link))
  73. :config
  74. (require 'ox-md)
  75. (unbind-key "C-c ;" org-mode-map)
  76.  
  77. ;;file to save todo items
  78. (setq org-agenda-files (quote ("~/Dropbox/Research/todo.org")))
  79.  
  80.  
  81. ;;set priority range from A to C with default A
  82. (setq org-highest-priority ?A)
  83. (setq org-lowest-priority ?C)
  84. (setq org-default-priority ?A)
  85.  
  86.  
  87. ;;set colours for priorities
  88. (setq org-priority-faces '((?A . (:foreground "OliveDrab" :weight bold))
  89. (?B . (:foreground "LightSteelBlue"))
  90. (?C . (:foreground "#F0DFAF"))))
  91.  
  92.  
  93. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  94. ;; org-mode agenda options ;;
  95. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  96. ;;open agenda in current window
  97. (setq org-agenda-window-setup (quote current-window))
  98. ;;warn me of any deadlines in next 7 days
  99. (setq org-deadline-warning-days 7)
  100.  
  101. ;;don't show tasks as scheduled if they are already shown as a deadline
  102. (setq org-agenda-skip-scheduled-if-deadline-is-shown t)
  103. ;;don't give awarning colour to tasks with impending deadlines
  104. ;;if they are scheduled to be done
  105. (setq org-agenda-skip-deadline-prewarning-if-scheduled (quote pre-scheduled))
  106. ;;don't show tasks that are scheduled or have deadlines in the
  107. ;;normal todo list
  108. (setq org-agenda-todo-ignore-deadlines (quote all))
  109. (setq org-agenda-todo-ignore-scheduled (quote all))
  110.  
  111. ;;sort tasks in order of when they are due and then by priority
  112.  
  113. (setq org-agenda-sorting-strategy
  114. (quote
  115. ((agenda deadline-up priority-down)
  116. (todo priority-down category-keep)
  117. (tags priority-down category-keep)
  118. (search category-keep))))
  119.  
  120. (setq org-capture-templates
  121. '(("t" "todo" entry (file+headline "~/Dropbox/Research/todo.org" "Tasks")
  122. "* TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n")))
  123.  
  124.  
  125. (defun my/org-mode-defaults ()
  126. (turn-on-org-cdlatex)
  127. ;; (diminish 'org-cdlatex-mode "")
  128. (turn-on-auto-fill)
  129.  
  130. ;; make `company-backends' local is critcal
  131. ;; or else, you will have completion in every major mode, that's very annoying!
  132. (make-local-variable 'company-backends)
  133. ;; company-ispell is the plugin to complete words
  134. (add-to-list 'company-backends 'company-ispell))
  135.  
  136. (add-hook 'org-mode-hook 'my/org-mode-defaults)
  137.  
  138. ;; Fontify org-mode code blocks
  139. (setq org-src-fontify-natively t)
  140.  
  141. (setq org-todo-keywords
  142. (quote ((sequence "TODO(t)" "|" "CANCELLED(c@/!)" "DONE(d)"))))
  143.  
  144. (setq org-use-fast-todo-selection t)
  145. (setq org-treat-S-cursor-todo-selection-as-state-change nil)
  146.  
  147. (setq org-todo-keyword-faces
  148. '(("TODO" . (:foreground "green" :weight bold))
  149. ("NEXT" :foreground "blue" :weight bold)
  150. ("WAITING" :foreground "orange" :weight bold)
  151. ("HOLD" :foreground "magenta" :weight bold)
  152. ("CANCELLED" :foreground "forest green" :weight bold)))
  153.  
  154. (setq org-enforce-todo-dependencies t)
  155. (setq org-src-tab-acts-natively t)
  156.  
  157. (setq org-latex-pdf-process
  158. (quote ("pdflatex -interaction nonstopmode -shell-escape -output-directory %o %f"
  159. "bibtex $(basename %b)"
  160. "pdflatex -interaction nonstopmode -shell-escape -output-directory %o %f"
  161. "pdflatex -interaction nonstopmode -shell-escape -output-directory %o %f")))
  162.  
  163. (setq org-latex-create-formula-image-program 'imagemagick)
  164.  
  165. ;; Tell the latex export to use the minted package for source
  166. ;; code coloration.
  167. (add-to-list 'org-latex-packages-alist '("" "minted"))
  168. (require 'ox-latex)
  169. (setq org-latex-listings 'minted)
  170.  
  171. ;; (setq org-latex-minted-options
  172. ;; '(("frame" "lines") ("framesep" "6pt")
  173. ;; ("mathescape" "true") ("fontsize" "\\small")))
  174.  
  175. (setq org-confirm-babel-evaluate nil)
  176.  
  177. ;; execute external programs.
  178. (org-babel-do-load-languages
  179. (quote org-babel-load-languages)
  180. (quote ((emacs-lisp . t)
  181. (dot . t)
  182. (ditaa . t)
  183. (python . t)
  184. (ruby . t)
  185. (gnuplot . t)
  186. (clojure . t)
  187. (sh . t)
  188. (haskell . t)
  189. (octave . t)
  190. (org . t)
  191. (plantuml . t)
  192. (scala . t)
  193. (sql . t)
  194. (latex . t))))
  195.  
  196. (eval-after-load 'org-src
  197. '(define-key org-src-mode-map
  198. "\C-x\C-s" #'org-edit-src-exit)))
  199.  
  200. (setq org-src-fontify-natively t
  201. org-confirm-babel-evaluate nil
  202. org-src-preserve-indentation t)
  203.  
  204. (org-babel-do-load-languages
  205. 'org-babel-load-languages '((python . t)))
  206.  
  207. (setq org-latex-pdf-process
  208. '("pdflatex -interaction nonstopmode -output-directory %o %f"
  209. "bibtex %b"
  210. "pdflatex -interaction nonstopmode -output-directory %o %f"
  211. "pdflatex -interaction nonstopmode -output-directory %o %f"))
  212.  
  213. (require 'org-ref)
  214. (require 'org-ref-pdf)
  215. (require 'org-ref-url-utils)
  216. (require 'org-ref-latex)
  217. (setq org-latex-prefer-user-labels t)
  218. ;; (setq org-latex-pdf-process '("latexmk -pdflatex='%latex -shell-escape -interaction nonstopmode' -pdf -output-directory=%o -f %f"))
Add Comment
Please, Sign In to add comment