1

I am trying to set up working backlinks using the acro package and hyperref package. I set make-links in my AC setup and I get a link to first-use page. My document uses \pagenumbering{roman} prior to my table of contents, and then my document switches to use \pagenumbering{arabic}. I place all my acronyms in the chapters that use arabic numbering, and get the hyperref to appear as I expect. However when clicking it, the backlink for the acronym refers back to the roman page 1 at the start of my document, instead of to the arabic page 1 which actually contains the acronym.

How can I change which \pagenumbering style the \acro backlinks refer to so my backlinks refer to the correct pages?

appreciate any tips or tricks to work around this.

Here is a MWE using the same structure as the document I am working in.

\documentclass[11pt]{report}

%%%%% Preamble %%%%%% \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[norsk]{babel} \usepackage{graphicx,color,boxedminipage} \usepackage{lipsum} \usepackage[margin=3cm]{geometry} \usepackage{hyperref} \setlength{\headheight}{13.6pt} %Endret margin/setheight \usepackage{fancyhdr,fancyvrb, etoc, fancyhdr, titling, tikz} \usepackage{fancybox} \usepackage{acro} \acsetup{make-links, link-only-first = true , pdfcomments/use = true , pages / display = first , pages / fill = {\hfill} , list/locale/display = true }

\DeclareAcronym{ROV}{ short = ROV, long = Fjernstyrt undervannsfartøy, foreign = Remotely Operated Vehicle, foreign-babel = english, foreign-locale = engelsk, }

%%%%% Document %%%%%% \begin{document} \newgeometry{margin=4cm} \setlength{\parskip}{0.5cm} \selectlanguage{norsk} % topptext \newcommand\myheaderfooterfont{\normalfont\bfseries\sffamily} \newlength\FHoffset \setlength\FHoffset{1cm} \addtolength\headwidth{2\FHoffset} \pagestyle{fancyplain} \renewcommand{\chaptermark}[1]{\markboth{#1}{#1}} \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \lhead[\fancyplain{}{\myheaderfooterfont \bfseries\thepage}]{\fancyplain{}{\myheaderfooterfont \bfseries\rightmark}} \rhead{\fancyplain{}{\myheaderfooterfont \bfseries text}} \chead{} \cfoot{\bfseries\thepage} \lfoot{} \rfoot{} \begin{center} \textbf{Titlepage} \end{center} \thispagestyle{empty} \newpage \restoregeometry \pagenumbering{roman} \chapter{Dummy 1} \lipsum[1-1] \newpage \chapter*{Acronym list} \printacronyms[heading=none] \tableofcontents \chapter{Dummy 3} \pagenumbering{arabic} \section{Introduction} Dummy text \ac{ROV} dummy text.

\end{document}```

  • Welcome to TEX StackExchange! Could you provide a MWE? – Tom Feb 26 '24 at 01:59
  • @Tom Hello, thanks for the reply! I have updated my question with a MWE now. edit: it might also be worth noting that when I was constructing this example, it actually worked as I wanted with only the \acro and \hyperref packages active; the problem seems to start with everything in my document combined. – zerkculture Feb 26 '24 at 05:58
  • Relevant: log shows pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used, duplicate ignored – Willie Wong Feb 26 '24 at 06:23
  • @WillieWong Thanks, that seems to be the problem I expect, as hovering over the hyperref also shows a page.1 link in the status bar, so I suppose the issue I am unsure of is resolving these identifier issues within the hyperref links created by the \acro package (edit: while also still maintaining the relevant page numbers in roman style for listing in the table of contents). – zerkculture Feb 26 '24 at 06:33
  • @zerkculture I guess this shows MWE is really important. Remember to provide one next time. – Tom Feb 26 '24 at 14:34

1 Answers1

1

Your MWE can be significantly simplified. (In the future, please go through your packages and remove them one by one and see which would impact the problem.) After a few minutes of work, the following much smaller document still shows the issue:

\documentclass[11pt]{report}

%%%%% Preamble %%%%%% \usepackage[T1]{fontenc} \usepackage{lipsum} \usepackage{acro} \acsetup{make-links, link-only-first = true , pdfcomments/use = true , pages / display = first , pages / fill = {\hfill} , list/locale/display = true }

\DeclareAcronym{ROV}{ short = ROV, long = Fjernstyrt undervannsfartøy, foreign = Remotely Operated Vehicle, foreign-babel = english, foreign-locale = engelsk, }

\usepackage{hyperref}

%%%%% Document %%%%%% \begin{document} \begin{center} \textbf{Titlepage} \end{center} \thispagestyle{empty} \newpage \pagenumbering{roman} \chapter{Dummy 1} \lipsum[1-1] \newpage \chapter{Acronym list} \printacronyms[heading=none] \tableofcontents \chapter{Dummy 3} \pagenumbering{arabic} \section{Introduction} Dummy text \ac{ROV} dummy text.

\end{document}

Now, if you actually comment out the directive \thispagestyle{empty}, you would see that your title page is numbered in arabic numerals, and has page number 1. And this is in fact the source of your woes.

To resolve this, the following is an option (with the same preamble as above)

%%%%% Document %%%%%%
\begin{document}
\pagenumbering{roman}
\setcounter{page}{0}
\begin{center}
    \textbf{Titlepage}
\end{center}
\thispagestyle{empty}
\newpage
\chapter*{Dummy 1}
\lipsum[1-1]
\newpage
\chapter*{Acronym list}
\printacronyms[heading=none]
\tableofcontents
\newpage
\pagenumbering{arabic}
\chapter{Dummy 3}
\section{Introduction}
Dummy text \ac{ROV} dummy text.

\end{document}

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
  • Thank you. I did understand somewhat that it was related to my formatting and pagenumbering, especially when sorting the working example here, but I still couldn't think of a possible solution. Setting it to 0 and making sure I had the \pagenumbering command immediately after.

    It works as I wanted to now.

    – zerkculture Feb 26 '24 at 08:38