2

I am relatively new to LaTeX (using Overleaf compiler). I am using someone's code to build an acronym section and I get errors (while his document shows none). I have done my best comparing and trouble shooting but I don't find anything. Here is a example of the code:

\documentclass{report}
\usepackage[printonlyused]{acronym}
\usepackage{hyperref}

\title{Test} \author{} \date{}

\begin{document}

\section{Introduction to hyper ref errors}

\begin{acronym}[Acronyms] \acro{eii}[EII]{electron impact ionization} \end{acronym}

The \acs{eii} is a strong laser field effect.

\end{document}

Running this code gives "Hyper reference `acro:eii' on page 1 undefined on input line 14." But it does what it is supposed to do.

Thank you for your input :)

JamesT
  • 3,169
None
  • 23
  • 2
    do not show only code snippets. Always make a small but complete document that demonstrates your issue and can be used for a test. – Ulrike Fischer Apr 01 '23 at 14:19
  • 1
    sorry no. I won't debug an external project. Put your code here. – Ulrike Fischer Apr 01 '23 at 16:49
  • @UlrikeFischer, i misunderstood your instructions. I modified the code section in the question! – None Apr 02 '23 at 08:21
  • well it is a bug in acronym. It mixes up target names like "acro:eii" and "eii", and uses \hyperref without having set the corresponding label (it seems the author doesn't understand the difference between \hyperref and \hyperlink, see https://tex.stackexchange.com/a/553769/2388). Report this to the author. – Ulrike Fischer Apr 02 '23 at 10:37
  • if the author would be anywhere near i would have asked him. Do you know what exactly is wrong is this code? I have read further documentation about the {acronym} package available here: link - but i still can't debug. – None Apr 02 '23 at 21:46
  • well ensure that you use at least once the long version, \ac{eii}. – Ulrike Fischer Apr 02 '23 at 22:04
  • The issue could be fixed on the document by setting \acro{EII}{def} (for some reason still not with \acro{eii}[EII]{def}) and calling it with \acs or \ac, or any of the options, indeed after calling first \ac{}. Thank you @UlrikeFischer! – None Apr 03 '23 at 08:36

0 Answers0