-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorgmode-custom.el
More file actions
134 lines (118 loc) · 4.53 KB
/
orgmode-custom.el
File metadata and controls
134 lines (118 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
;; org-mode
(add-to-list 'load-path (concat elisp_path "/org-mode/lisp"))
(add-to-list 'load-path (concat elisp_path "/org-mode/contrib/lisp"))
(setq org-root "~/org")
(add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode))
(require 'org-install)
(require 'org-habit)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(transient-mark-mode 1)
;; org-mode experimental stuffs
;; http://lists.gnu.org/archive/html/emacs-orgmode/2013-10/msg00466.html
(setenv "TMP" ".") ;; a work-around for bibtex2html and inline LaTeX display
;; http://orgmode.org/worg/org-tutorials/org-latex-preview.html
;;(setq org-latex-create-formula-image-program 'imagemagick)
;; http://www.gnu.org/software/auctex/manual/auctex/index.html
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;;(require 'ox-bibtex)
(require 'ox-beamer)
(require 'ox-md)
(require 'ox-gfm)
;; Bibliography: org-bibnote-exp
(require 'org-bibnote-exp)
;; On the new Macbook pro with retina display and SSD, this works fast enough
(setq org-latex-create-formula-image-program 'imagemagick)
;; org babel: display source code for different languages
;; https://github.com/syl20bnr/spacemacs/issues/3314
(org-babel-do-load-languages
(quote org-babel-load-languages)
(quote ((emacs-lisp . t)
(dot . t)
(ditaa . t)
(R . t)
(python . t)
(scala . t)
(sh . t)
(org . t)
(latex . t))))
; Do not prompt to confirm evaluation
; This may be dangerous - make sure you understand the consequences
; of setting this -- see the docstring for details
(setq org-confirm-babel-evaluate nil)
(defun org-insert-src-block (src-code-type)
"Insert a `SRC-CODE-TYPE` type source code block in org-mode"
(interactive
(let ((src-code-types '("emacs-lisp" "python" "C" "sh" "js" "C++" "css"
"dot" "matlab" "sql" "ditaa" "haskell" "latex"
"scala" "ocaml" "org" "perl" "ruby")))
(list (ido-completing-read "Source code type: " src-code-types))))
(progn
(newline-and-indent)
(insert (format "#+BEGIN_SRC %s\n" src-code-type))
(newline-and-indent)
(insert "#+END_SRC\n")
(previous-line 2)
(org-edit-src-code)))
;; http://wenshanren.org/?p=334
(add-hook 'org-mode-hook '(lambda ()
;; turn on flyspell-mode by default
(flyspell-mode 1)
;; key-bindings for inserting code blocks
(local-set-key (kbd "C-c s i") 'org-insert-src-block) ))
(setq org-src-fontify-natively t) ;; syntax highlighting in the source block
;;--------------------------------------------------------------------
;; LaTeX options
(require 'ox-latex)
(setq org-latex-listings 'minted)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(add-to-list 'org-latex-packages-alist '("" "xcolor"))
(setq org-latex-minted-options
'(
;;("bgcolor" "LightGray")
("frame" "lines")
))
(add-to-list 'org-latex-classes
'("org-bare-metal"
"\\documentclass{article}[letterpaper,11pt]
[NO-DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(add-to-list 'org-latex-classes
'("llncs"
"\\documentclass{llncs}
[NO-DEFAULT-PACKAGES]
\\usepackage{computastica}
[PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
;; VLDB mode, kinda tricky
(add-to-list 'org-latex-classes
'("vldb"
"\\documentclass{vldb}
[NO-DEFAULT-PACKAGES]
[PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
;;--------------------------------------------------------------------
(setq org-todo-keywords
'((sequence "TODO" "SKIMMED" "2e-PASS" "|" "DONE" "SKIP")
(sequence "|" "CANCELED(c)")))