diff --git a/.dir-locals.el b/.dir-locals.el index 6530c0f..6cb69b3 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -11,7 +11,6 @@ (org-latex-prefer-user-labels . t) (org-latex-pdf-process . ("latexmk -f -pdf -%latex -shell-escape -interaction=nonstopmode -output-directory=%o %f")) (org-html-prefer-user-labels . t) - (org-latex-toc-command . "\\frontmatter\n\\addchap{Table of Contents}\n\\label{chap:toc}\n\\listoftoc*{toc}\n\n") (flycheck-languagetool-language . "en-GB") (fill-column . 200))) (org-mode . ((eval . (progn (visual-line-mode) diff --git a/book.org b/book.org index b7e5721..3db5dfe 100644 --- a/book.org +++ b/book.org @@ -40,9 +40,11 @@ #+LATEX_HEADER: Prof.\ Dr.\ Bram De Wever #+LATEX_HEADER: } #+LATEX_HEADER: \addtokomafont{caption}{\small} +#+LATEX_HEADER: \setuptoc{toc}{numbered} +#+LATEX_HEADER: \addto\captionsenglish{\renewcommand{\contentsname}{Table of Contents}} #+OPTIONS: ':t #+OPTIONS: H:4 -#+OPTIONS: toc:3 +#+OPTIONS: toc:nil #+OPTIONS: broken-links:mark #+MACRO: num_commits 16 thousand #+MACRO: num_prs 3\thinsp{}800 @@ -55,10 +57,8 @@ #+cite_export: csl citation-style.csl #+bibliography: bibliography.bib -#+BEGIN_COMMENT -There should be a `#+LATEX: \frontmatter` here, but I want to still be able to export to HTML, have the TOC show up in itself, change its heading and have the TOC be part of the frontmatter. -Because of this the `\frontmatter` statement needs to be part of the `org-latex-toc-command` (which is set in the =.dir-locals.el=/=build.el= file). -#+END_COMMENT +#+LATEX: \frontmatter +#+TOC: headlines 2 * To-dos :PROPERTIES: diff --git a/build.el b/build.el index ae72c2a..fe2bc8f 100644 --- a/build.el +++ b/build.el @@ -17,8 +17,7 @@ org-latex-caption-above nil org-latex-src-block-backend 'minted org-latex-minted-options '(("linenos" . "true")) - org-latex-prefer-user-labels t - org-latex-toc-command "\\frontmatter\n\\addchap{Table of Contents}\n\\label{chap:toc}\n\\listoftoc*{toc}\n\n") + org-latex-prefer-user-labels t) (add-to-list 'org-export-smart-quotes-alist