-
Notifications
You must be signed in to change notification settings - Fork 1
/
.org2tex.el
69 lines (63 loc) · 2.45 KB
/
.org2tex.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
(require 'package)
(package-initialize)
(unless package-archive-contents
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-refresh-contents))
(dolist (pkg '(org))
(unless (package-installed-p pkg)
(package-install pkg)))
(require 'org)
;; (require 'oc-csl)
(require 'ox-publish)
;; (require 'projectile)
(require 'ox-latex)
(add-to-list 'org-latex-classes
'("ltxdoc"
"\\documentclass{ltxdoc}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(setq
org-latex-hyperref-template ""
;; org-confirm-babel-evaluate nil
org-hide-emphasis-markers t
org-latex-listings 'minted
org-latex-packages-alist '(("" "minted"))
)
;; (defun publish-html-and-patch (plist filename pub-dir)
;; "Export a html file then patch it by reversing lines"
;; (let ((outfile (org-html-publish-to-html plist filename pub-dir)))
;; (shell-command
;; (format "sed -i 's/Wang, H\\./<strong>Wang, H.<\\/strong>/' %s"
;; outfile (file-name-sans-extension outfile)))))
;; (defvar OS--publish-project-alist
;; (list
;; (list "myweb"
;; :base-directory "./"
;; :exclude (regexp-opt '("others" "style/others"))
;; :base-extension "org"
;; :recursive t
;; :publishing-directory "./public"
;; ;; :publishing-function 'org-html-publish-to-html
;; :publishing-function 'publish-html-and-patch)
;; (list "attachments"
;; :base-directory "./"
;; :exclude (regexp-opt '("public" "others" "style/others"))
;; ;; :include '("CNAME" "keybase.txt" "LICENSE" ".nojekyll" "publish.el")
;; :recursive t
;; :base-extension (regexp-opt '("jpg" "gif" "png" "svg" "css" "pdf" "html"))
;; :publishing-directory "./public"
;; :publishing-function 'org-publish-attachment)
;; ))
;; (defun OS-publish-all ()
;; (interactive)
;; (let ((make-backup-files nil)
;; (org-publish-project-alist OS--publish-project-alist)
;; (org-html-htmlize-output-type 'css)
;; (org-cite-csl-styles-dir (expand-file-name "style/" (projectile-project-root))))
;; (org-publish-all)
;; ))