General\acro - Hyper reference undefined - but not everywhere

LaTeX specific issues not fitting into one of the other forums of this category.
TomWrite
Posts: 8
Joined: Sun Oct 17, 2021 7:49 pm

\acro - Hyper reference undefined - but not everywhere

Post by TomWrite »

Hi Stefan,
thanks for the hint. I will dig into overleaf.com to see where I can properly export it.

However, in the meantime I think I found the "issue". I don't know how to replicate it here, but I try to explain it and maybe someone recognises it.

My document is structured in individual files. Therefore my documents looks like this:

Code: Select all

\documentclass[article]
\usepackage{hyperref} % Clickable links
%\usepackage[pdfpagelabels]{hyperref} 
\usepackage[printonlyused]{acronym} %Abbreviations
\usepackage{graphicx}
\usepackage{array}
\usepackage{pdfpages}
\usepackage[ngerman]{babel}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{float}

\begin{document}
    
\pagestyle{plain}
\title[Datenschutz- und Informationssicherheitsmanagement für kritische Infrastruktur]{Datenschutz- und Informationssicherheitsmanagement im Bereich kritischer Infrastruktur}
\maketitle

\newpage
\tableofcontents
\newpage

\section*{Abkürzungsverzeichnis}

\begin{acronym}
\acro{BABS}{Bundesamt für Bevölkerungsschutz}
\acro{BfE}{Bundesamt für Energie}
\acro{BÜPF}{Bundesgesetz betreffend die Überwachung des Post- und Fernmeldeverkehrs}
\acro{ISG}{Informationssicherheitsgesetz}
\acro{ISMS}{Informationssicherheitsmanagementsystem}
\end{acronym}

\listoffigures
\listoftables

\newpage

\input{chapters/allg_ausgangslage}

\section{Hauptteil 1}

\include{sections/hauptteil_1/begriffsdefinition}
\include{sections/hauptteil_1/analyse}
\include{sections/hauptteil_1/handlungsfelder}
\include{sections/hauptteil_1/zusammenfassung_teil1}

\appendix
\section{Anhang Hauptteil 1}\label{secA1}

\include{sections/hauptteil_1/appendix1}
\end{document}

If I use for example \ac{ISG} in an earlier file, like allg_ausgangslage.tex, then it works like a charm. The warning note of the undefined ref disappears and the hyperref for the acronym is shown in the list of acronyms.
However, if I remove \ac{ISG} from the allg_ausgangslage.tex and move it to a later file, like sections/hauptteil_1/analyse, I have the same "problem" again. The warning note appears again and the entry in the list of acronyms is not a link anymore.

So apparently the warning depends on where the first usage of \ac{ISG} appears.

In both cases \ac{ISG} creates the correct entry in the text of the respective page.

Not sure if this makes sense. But I hope I could explain it a bit.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply