-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dir-locals.el
139 lines (136 loc) · 5.65 KB
/
.dir-locals.el
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
134
135
136
137
138
139
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((org-mode
;; This is our master-thesis class that defines the mapping of org-levels to latex-sections
(eval . (add-to-list 'org-latex-classes '("master-thesis"
"\\documentclass{report}"
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
)
;; A function to remove bbl files. This is only needed if you compile with latexmk
(eval . (progn
(defun remove-bbl-file (args) (progn
(if (file-exists-p "README.bbl")
(delete-file "README.bbl"))
))
(require 'ox-extra)
(ox-extras-activate ' (ignore-headlines))
;; Add Easy Templates
(eval-after-load "org"
'(progn
(add-to-list 'org-structure-template-alist
'("A" "#+AUTHOR: ?"))
(add-to-list 'org-structure-template-alist
'("~" "\nbsp{}"))
(add-to-list 'org-structure-template-alist
'("al" "#+ATTR_LATEX: ?"))
(add-to-list 'org-structure-template-alist
'("t" "#+TITLE: ?"))
(add-to-list 'org-structure-template-alist
'("n" "#+NAME: ?"))
(add-to-list 'org-structure-template-alist
'("cap" "#+NAME: ?\n#+CAPTION: "))
(add-to-list 'org-structure-template-alist
'("d" "#+DATE: \\today?"))
(add-to-list 'org-structure-template-alist
'("t" "#+TITLE: ?\n#+AUTHOR: Remko van Wagensveld\n#+DATE: \\today"))
(add-to-list 'org-structure-template-alist
'("de" "#+LANGUAGE: de\n#+LaTeX_HEADER: \\usepackage[ngerman]{babel}\n?"))
(add-to-list 'org-structure-template-alist
'("pb" "#+BEGIN_EXPORT latex\n\pagebreak\n#+END_EXPORT\n?"))
(add-to-list 'org-structure-template-alist
'("geo" "#+LaTeX_HEADER: \\usepackage[a4paper, margin=2cm?]{geometry}\n"))
(add-to-list 'org-structure-template-alist
'("toc" "#+TOC: headlines\n#+TOC: tables\n#+TOC: listings\n?"))
)
)
;; Use Minted for Listings. Not neccessary.
(setq org-latex-listings 'minted
org-latex-packages-alist '(("" "minted")))
;; Use latexmk to compile the Source
(setq org-latex-pdf-process
;; Uncomment the line below to use latexmk
;; '("latexmk -pdflatex='pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f' -pdf -bibtex -gg"))
;; If using latexmk comment out this line
'("arara %f")
)
;; Load languages to execute from Org
(org-babel-do-load-languages
'org-babel-load-languages
'((shell . t)
(python . t)
(plantuml . t)
(ditaa .t)))
(setq org-plantuml-jar-path '"/opt/plantuml/plantuml.jar")
;; Activate RefTeX in Org Mode
(defun org-mode-reftex-setup ()
(load-library "reftex")
(and (buffer-file-name)
(file-exists-p (buffer-file-name))
(reftex-parse-all))
(define-key org-mode-map (kbd "C-c R") 'reftex-citation)) ;; Use C-C R to start a citation
(add-hook 'org-mode-hook 'org-mode-reftex-setup)
)
)
;; Our projects that we have in README.org
(org-publish-project-alist
("thesis"
:base-directory "."
:base-extension "org"
:publishing-directory "./output/thesis/"
:publishing-function org-latex-publish-to-pdf
:select-tags ("thesis")
:title "Thesis Document"
:include ("./README.org")
:exclude "\\.org$"
:latex-class "master-thesis"
:latex-title-command "\\mytitle" ;; Overwrite the title-command
:latex-tables-booktabs t
:with-footnotes t
)
("notes"
:base-directory "."
:base-extension "org"
:publishing-directory "./output/notes"
:publishing-function org-latex-publish-to-pdf
:select-tags ("notes")
:title "Notes for the Masterthesis"
:include ("README.org")
:exclude "\\.org$"
:latex-class "article"
:latex-tables-booktabs t
)
("expose"
:base-directory "."
:base-extension "org"
:publishing-directory "./output/expose"
:publishing-function org-latex-publish-to-pdf
:preparation-function remove-bbl-file
:select-tags ("expose")
:title "Expose"
:include ("README.org")
:exclude "\\.org$"
:latex-class "article"
)
("schedule"
:base-directory "."
:base-extension "org"
:publishing-directory "./output/schedule"
:publishing-function org-latex-publish-to-pdf
:select-tags ("schedule")
:title "Schedule for the Masterthesis"
:include ("README.org")
:exclude "\\.org$"
:latex-class "article"
:with-planning t
:with-priority t
:with-tasks t
:with-timestamps t
:with-clocks t
)
)
))