diff options
Diffstat (limited to 'tw/home/files/emacs-init.el')
-rw-r--r-- | tw/home/files/emacs-init.el | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el index 5fc2c135..d415484b 100644 --- a/tw/home/files/emacs-init.el +++ b/tw/home/files/emacs-init.el @@ -364,6 +364,37 @@ (python . t)) "Load bindings for more languages for use in #+begin_src blocks.")) +(defun tw/latex-section-commands (name) + "Create a pair of section commands like (\"\\NAME{%s}\" . \"\\NAME*{%s}\"). +For use in `org-latex-classes'." + (cons (format "\\%s{%%s}" name) (format "\\%s*{%%s}" name))) +(defconst tw/latex-part (tw/latex-section-commands "part") + "Part LaTeX commands for `org-latex-classes'.") +(defconst tw/latex-chapter (tw/latex-section-commands "chapter") + "Chapter LaTeX commands for `org-latex-classes'.") +(defconst tw/latex-section-and-below + (mapcar #'tw/latex-section-commands + '("section" "subsection" "subsubsection" "paragraph" "subparagraph")) + "Section to subparagraph LaTeX commands for `org-latex-classes'.") + +(use-package ox-latex ; org-export-latex + :after (org) + :custom + (org-latex-classes + `(("paperlike" "\\documentclass{paperlike}" . ,tw/latex-section-and-below) + ("examtext" "\\documentclass{examtext}" . ,tw/latex-section-and-below) + ("minutes" "\\documentclass{minutes}" . ,tw/latex-section-and-below) + ("mapreport" "\\documentclass{mapreport}" ,tw/latex-chapter . ,tw/latex-section-and-below) + ("pt3report" "\\documentclass{pt3report}" ,tw/latex-chapter . ,tw/latex-section-and-below) + ("article" "\\documentclass{article}" . ,tw/latex-section-and-below) + ("scrartcl" "\\documentclass{scrartcl}" . ,tw/latex-section-and-below) + ("report" "\\documentclass{report}" ,tw/latex-part ,tw/latex-chapter . ,tw/latex-section-and-below) + ("report-noparts" "\\documentclass{report}" ,tw/latex-chapter . ,tw/latex-section-and-below) + ("book" "\\documentclass{book}" ,tw/latex-part ,tw/latex-chapter . ,tw/latex-section-and-below) + ("book-noparts" "\\documentclass{book}" ,tw/latex-chapter . ,tw/latex-section-and-below) + ("checklist" "\\documentclass{checklist}" . ,tw/latex-section-and-below)) + "Define more documentclasses for org-latex.")) + (use-package outline :commands (outline-mode outline-minor-mode) :custom @@ -399,10 +430,6 @@ (: ".environment.d/" (1+ (not ?\/)) ".conf")) eos)) -(use-package org-latex-classes - :after (ox-latex) - :load-path "include/") - (use-package ob-rec ;; `org-babel' hooks for `rec-mode' :after (org ob rec-mode) |