From aad894236177c9c2a91cfc12ad80b44d92c31c69 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 3 Jul 2026 00:43:14 +0200 Subject: [PATCH] Only compile necessary frontmatter/backmatter additions (e.g., bib) for single subfiles --- preamble.tex | 73 ++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/preamble.tex b/preamble.tex index 479daf3..673e89d 100644 --- a/preamble.tex +++ b/preamble.tex @@ -166,26 +166,28 @@ pdfcreator={LuaLaTeX} } - % Starting pages - \pagestyle{empty} - \pagenumbering{gobble} - \input{titlepage} - \cleardoublepage% + % Only compile title/glossaries/toc with the main document + \ifSubfilesClassLoaded{}{% + \pagestyle{empty} + \pagenumbering{gobble} + \input{titlepage} + \cleardoublepage% - \frontmatter% - \pagestyle{plain} - \pagenumbering{Roman} - \tableofcontents% - \cleardoublepage% + \frontmatter% + \pagestyle{plain} + \pagenumbering{Roman} + \tableofcontents% + \cleardoublepage% - \todototoc\listoftodos% - \cleardoublepage% + \todototoc\listoftodos% + \cleardoublepage% - \setacronymstyle{long-short} - \printacronyms% - \cleardoublepage% - \printglossary% - \cleardoublepage% + \setacronymstyle{long-short} + \printacronyms% + \cleardoublepage% + \printglossary% + \cleardoublepage% + } \mainmatter% \pagestyle{headings} @@ -205,28 +207,31 @@ % \printbibliography% \cleardoublepage% - \phantomsection% - \addcontentsline{toc}{chapter}{Lists} + % Only compile lists/declaration with the main document + \ifSubfilesClassLoaded{}{% + \phantomsection% + \addcontentsline{toc}{chapter}{Lists} - \listoffigures% - \addcontentsline{toc}{section}{List of Figures} - \cleardoublepage% + \listoffigures% + \addcontentsline{toc}{section}{List of Figures} + \cleardoublepage% - \listofalgorithms% - \addcontentsline{toc}{section}{List of Algorithms} - \cleardoublepage% + \listofalgorithms% + \addcontentsline{toc}{section}{List of Algorithms} + \cleardoublepage% - \tcblistof[\chapter*]{listings}{List of Listings} - \addcontentsline{toc}{section}{List of Listings} - \cleardoublepage% + \tcblistof[\chapter*]{listings}{List of Listings} + \addcontentsline{toc}{section}{List of Listings} + \cleardoublepage% - \listoftables% - \addcontentsline{toc}{section}{List of Tables} - \cleardoublepage% + \listoftables% + \addcontentsline{toc}{section}{List of Tables} + \cleardoublepage% - \phantomsection% - \addcontentsline{toc}{chapter}{Statutory Declaration} - \includepdf[pages=-]{declaration_signed.pdf} + \phantomsection% + \addcontentsline{toc}{chapter}{Statutory Declaration} + \includepdf[pages=-]{declaration_signed.pdf} + } } % Colors