cgnieder / acro

acronyms for LaTeX
LaTeX Project Public License v1.3c
42 stars 9 forks source link

\printacronyms provides unexpected page numbering #212

Closed jadenecke closed 2 years ago

jadenecke commented 3 years ago

Issue:

The page numbering provided by \printacronyms does not correspond with the actual page number where the acronym appears. Instead, the page number of the beginning of the paragraph is given.

Expected Behavior:

\printacronyms should provide the page number where the acronym actually appears.

REPREX:

Both acronyms occur on page 3, albeit one being listed as occurring on page 2

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}

    \usepackage{lipsum}
    \usepackage{acro}
    \acsetup{
        pages/display = all,
        pages/seq/use = true
    }

    \DeclareAcronym{test}{
        short=TEST,
        long=THIS IS A TEST
    }
    \DeclareAcronym{test2}{
        short=AT,
        long=Another TEST
    }

\begin{document}
    \printacronyms
    \newpage
    \lipsum[1-5]
    \ac{test}

    Something
    \ac{test2}
\end{document}
cgnieder commented 2 years ago

This will only be resolved through a mechanism similar to \label and \ref as the page number only ever is known reliably when a page is shipped out. One could imagine adding a unique label each time an acronym is used and reference it with \pageref...