diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-13 16:06:41 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-09-13 16:06:41 +0200 |
commit | cbd1673e680c2f55eb60458dd4ecbb5c2060838f (patch) | |
tree | 88eb0f7127e3e84a5a895fe319b856405a5ba939 | |
parent | 3ab79306d2a880546c68ed3682b59c98920ef3a8 (diff) |
hide glossary if no glossary entries used
-rw-r--r-- | projdoc.cls | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/projdoc.cls b/projdoc.cls index 388f901..cc25e67 100644 --- a/projdoc.cls +++ b/projdoc.cls @@ -206,19 +206,23 @@ \thispagestyle{empty} \end{titlepage} } -\newbool{projdoc@cited} -\apptocmd{\abx@aux@cite}{\global\booltrue{projdoc@cited}}{}{} +\newbool{projdoc@used@cite} +\newbool{projdoc@used@gls} +\apptocmd{\abx@aux@cite}{\global\booltrue{projdoc@used@cite}}{}{} +\apptocmd{\glsxtr@record}{\global\booltrue{projdoc@used@gls}}{}{} \def\projdoc@trailer{ % bibliography (if citations used) - \ifbool{projdoc@cited}{\printbibliography}{}% + \ifbool{projdoc@used@cite}{% + \printbibliography% + }{}% % glossary - \ifcsundef{printunsrtglossary}{}{% + \ifbool{projdoc@used@cite}{% \section*{Glossary}% \begin{multicols}{2}% \renewcommand{\glossarysection}[2][]{}% \printunsrtglossary% \end{multicols}% - }% + }{}% } \AtBeginDocument{\projdoc@header} \AtEndDocument{\projdoc@trailer} |