3

I am using the Acro v3.5 package for my LaTeX file to create a list of abbreviations at the beginning of my document. In this list, I include the first occurrence of every abbreviation (with included hyperlinks). Instead of the first occurrence, however, I want to change the page that's shown in the list to be the page where the abbreviation is explained.

I could not find any option to override the page shown in the package's manual, and instead only found the available options for pages/display to be first, all or none (section 10.2 in the manual). Does anyone know if there is a way to override the page that's shown in the list of abbreviations generated by Acro?

I've included an MWE shown below. Here, you can see that a file is generated in which page 1 is referred to in the acronym list, however, I hope to change this to page 2. It should be noted that I use Overleaf though, so I am not sure if this will run in the current state through any compiler. Thank you in advance!

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{acro}
\usepackage{lipsum}
\usepackage[hidelinks]{hyperref} 

%acro setup
\acsetup{
    make-links = true ,
    pages / display = first ,
    pages / name = true ,
    short-plural-ending = {}
    }

%Assigning the acronym to be used with \ac
\DeclareAcronym{DLS}{
    short = DLS ,
    long = Dynamic Light Scattering
    }

\begin{document}

\chapter*{List of Abbreviations}
The following lists define the various abbreviations and symbols used throughout the thesis. The page where the acronym is first used or defined is provided as well.

\printacronyms[name=Abbreviations , heading=section* ,   template=toc]

\setcounter{page}{0}
\chapter{Introduction}
\textbf{\Ac{DLS} is a very useful technique. Its properties are further explained in section 1.1.}
\lipsum

\section{DLS}
\textbf{\Acf{DLS} works as following:} \lipsum[2]


\end{document}

1 Answer 1

1

You can define the list template to use a specific label instead of the first page by something like the following which checks if a label ac:<ID> exists and if yes uses \pageref for the marked page – of course you have to place the label `ac: on the page you want referenced:

\ifcsname r@ac:\AcronymID\endcsname
  \pageref{ac:\AcronymID}%
\else
  \acropages{}{}%
\fi

If the label is not present the template still uses the first page where the acronym was used.

Here is a complete example:

\documentclass{report}
\usepackage{acro}
\usepackage{lipsum}

\DeclareAcronym{DLS}{
  short = DLS ,
  long = Dynamic Light Scattering
}

\RenewAcroTemplate[list]{toc}{%
  \acroheading
  \acropreamble
  \acronopagerange
  \acroneedpages
  \acronymsmapF{%
    \contentsline{chapter}{\acrowrite{short}}{}{}
    \contentsline{section}{%
      \acrowrite{list}%
      \acroifanyT{foreign,extra}{ (}%
      \acrowrite{foreign}%
      \acroifallT{foreign,extra}{, }%
      \acrowrite{extra}%
      \acroifanyT{foreign,extra}{)}%
    }{%
      \ifcsname r@ac:\AcronymID\endcsname
        \pageref{ac:\AcronymID}%
      \else
        \acropages{}{}%
      \fi
    }{}%
  }{\AcroRerun}%
}

\begin{document}

\chapter*{List of Abbreviations}
The following lists define the various abbreviations and symbols used
throughout the thesis. The page where the acronym is first used or defined is
provided as well.

\printacronyms[name=Abbreviations , heading=section* ,   template=toc]

\setcounter{page}{0}
\chapter{Introduction}
\textbf{\Ac{DLS} is a very useful technique. Its properties are further
  explained in section~\ref{sec:dls}.}
\lipsum

\section{DLS}\label{sec:dls}
\textbf{\Acf{DLS} works as following:}\label{ac:DLS} \lipsum[2]

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .