diff --git a/.dir-locals.el b/.dir-locals.el index 90c6ce1..358e6ac 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -15,4 +15,5 @@ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) (org-latex-src-block-backend . 'listings) (org-latex-prefer-user-labels . t) + (org-latex-toc-command . "\\frontmatter\n\\addchap{Table of Contents}\n\\listoftoc*{toc}\n\n") (fill-column . 200)))) diff --git a/book.org b/book.org index c19efc2..20fd197 100644 --- a/book.org +++ b/book.org @@ -18,21 +18,14 @@ #+LATEX_HEADER: Prof.\ Dr.\ Ir.\ Bart Mesuere\\ #+LATEX_HEADER: Prof.\ Dr.\ Bram De Wever #+LATEX_HEADER: } -#+OPTIONS: toc:nil #+OPTIONS: ':t #+OPTIONS: H:4 #+cite_export: csl citation-style.csl #+bibliography: bibliography.bib -#+LATEX: \frontmatter - -* Table of Contents -:PROPERTIES: -:CREATED: [2023-10-23 Mon 14:10] -:CUSTOM_ID: chap:toc -:UNNUMBERED: t -:END: -#+LATEX: \listoftoc*{toc} +#+BEGIN_COMMENT +There should be a `#+LATEX: \frontmatter` here, but if 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 front matter, the `\frontmatter` statement needs to be part of the `org-latex-toc-command`. +#+END_COMMENT * Acknowledgements :PROPERTIES: diff --git a/build.el b/build.el index df4ac96..953ea58 100644 --- a/build.el +++ b/build.el @@ -14,7 +14,8 @@ ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) org-latex-src-block-backend 'listings - org-latex-prefer-user-labels t) + org-latex-prefer-user-labels t + org-latex-toc-command "\\frontmatter\n\\addchap{Table of Contents}\n\\listoftoc*{toc}\n\n") (find-file "book.org") (org-latex-export-to-latex)