-
Notifications
You must be signed in to change notification settings - Fork 0
/
step05-org-class.el
215 lines (206 loc) · 7.31 KB
/
step05-org-class.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
;;; package to export by default
(setq org-latex-packages-alist
'(;;;; font/encoding
("utf8" "inputenc") ;; [default orgmode]
("T1" "fontenc") ;; [default orgmode]
("" "lmodern") ;; Police LatinModern
("" "textcomp") ;; [default orgmode]
;; ("normalem" "ulem") ;; [default orgmode but clash with the changes packages]
;;;; color
("" "color")
;;;; figures
("" "graphicx") ;; [default orgmode]
("" "grffile") ;; [default orgmode]
("" "wrapfig") ;; [default orgmode]
;; ("" "capt-of") ;; [default orgmode] - NOT COMPATIBLE WITH biometrical
;; ("" "caption") ;; newlines in graphics - NOT COMPATIBLE WITH biometrical
("" "rotating") ;; rotate figures
;;;; titles
;; ("" "titlesec") ;; modify titles - NOT COMPATIBLE WITH BEAMER
;;;; tables
("" "longtable") ;; default orgmode
("" "multirow") ;; merge rows in table
("" "multicol") ;; merge columns in table
;;;; track change
("" "changes") ;; NOTE: must be loaded before ulem
;;;; display
("" "pdflscape") ;; switch to landscape
("" "geometry") ;; define margin of the document
("normalem" "ulem") ;; _xx_ in orgmode (underline)
;;;; math
("" "amssymb") ;; [default orgmode]
("" "amsmath") ;; [default orgmode]
("" "amsfonts")
("" "dsfont")
("" "array")
;;;; to define macro
("" "ifthen")
;;;; link
("" "hyperref") ;; [default orgmode]
;;;; bibliography
("" "natbib")
))
;;; additionnal information in the header
(setq brice-org-latex-listing-options-string
(concat "\\lstdefinestyle{code-small}{
backgroundcolor=\\color{white}, % background color for the code block
basicstyle=\\ttfamily\\small, % font used to display the code
commentstyle=\\color[rgb]{0.5,0,0.5}, % color used to display comments in the code
keywordstyle=\\color{black}, % color used to highlight certain words in the code
numberstyle=\\ttfamily\\tiny\\color{gray}, % color used to display the line numbers
rulecolor=\\color{black}, % color of the frame
stringstyle=\\color[rgb]{0,.5,0}, % color used to display strings in the code
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
columns=fullflexible,
frame=single, % adds a frame around the code (non,leftline,topline,bottomline,lines,single,shadowbox)
keepspaces=true, % % keeps spaces in text, useful for keeping indentation of code
literate={~}{$\\sim$}{1}, % symbol properly display via latex
numbers=none, % where to put the line-numbers; possible values are (none, left, right)
numbersep=10pt, % how far the line-numbers are from the code
showspaces=false,
showstringspaces=false,
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
tabsize=1,
xleftmargin=0cm,
emph={anova,apply,class,coef,colnames,colNames,colSums,dim,dcast,for,ggplot,head,if,ifelse,is.na,lapply,list.files,library,logLik,melt,plot,require,rowSums,sapply,setcolorder,setkey,str,summary,tapply},
aboveskip = \\medskipamount, % define the space above displayed listings.
belowskip = \\medskipamount, % define the space above displayed listings.
lineskip = 0pt} % specifies additional space between lines in listings
\\lstset{style=code-small}"))
(setq brice-org-latex-common-header-string
(concat brice-org-latex-listing-options-string)
)
;; set-up of hyperref
(setq org-latex-hyperref-template
"\\hypersetup{
colorlinks=true,
pdfauthor={%a},
pdftitle={%t},
pdfkeywords={%k},
pdfsubject={%d},
pdfcreator={%c},
pdflang={%L}
}\n"
)
;;; document class
;;;; org-article
(add-to-list 'org-latex-classes
`("org-article"
,(concat "\\documentclass{article}\n\n"
"[NO-DEFAULT-PACKAGES]"
"%%%% settings when exporting code %%%% \n\n"
"\\usepackage{listings}\n"
brice-org-latex-common-header-string
"\n"
"%%%% packages %%%%%"
)
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
))
;;;; image
(add-to-list 'org-latex-classes
`("standalone"
,(concat "\\documentclass{standalone}\n\n"
"[NO-DEFAULT-PACKAGES]"
)
))
;;;; report
(add-to-list 'org-latex-classes
`("org-report"
,(concat "\\documentclass{report}\n\n"
"[NO-DEFAULT-PACKAGES]"
"%%%% settings when exporting code %%%% \n\n"
"\\usepackage{listings}\n"
brice-org-latex-common-header-string
"\n"
"%%%% packages %%%%%"
)
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
))
;;;; biometrical
(add-to-list 'org-latex-classes
`("biometrical-journal"
,(concat "\\documentclass[bimj,fleqn]{w-art}\n\n"
"[NO-DEFAULT-PACKAGES]"
"%%%% settings when exporting code %%%% \n\n"
"\\usepackage{listings}\n"
"%%%% packages %%%%%"
)
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
))
;;;; jrssc
(add-to-list 'org-latex-classes
`("jrssc-journal"
,(concat "\\documentclass[mathtime]{statsoc}\n\n"
"[NO-DEFAULT-PACKAGES]"
"%%%% settings when exporting code %%%% \n\n"
"\\usepackage{listings}\n"
"%%%% packages %%%%%"
)
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
))
;;;; Rnew-article
(add-to-list 'org-latex-classes
`("Rnews-article"
,(concat "\\documentclass{report}\n\n"
"[NO-PACKAGES]
[NO-DEFAULT-PACKAGES]"
"%%%% settings when exporting code %%%% \n\n"
"\\usepackage{listings}\n"
brice-org-latex-common-header-string
"\n"
"%%%% packages %%%%%"
)
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
))
;;;; jss article
(add-to-list 'org-latex-classes
`("jss-article"
,(concat
"\\documentclass[article]{jss}\n\n"
"[NO-DEFAULT-PACKAGES]"
"[NO-PACKAGES]"
"%%%% packages %%%%%"
)
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
))
;;;; beamer
(add-to-list 'org-latex-classes
`("beamer"
,(concat "\\documentclass{beamer}\n\n"
"[NO-DEFAULT-PACKAGES]"
"%%%% settings when exporting code %%%% \n\n"
"\\usepackage{listings}\n"
brice-org-latex-common-header-string
"\n"
"%%%% packages %%%%%"
)
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")
))