detiuaveiro / ua-thesis-template

📖 A thesis LaTeX template that complies with the University of Aveiro's guidelines and provides a simple CLI workflow around make and compatibility with Overleaf.
MIT License
103 stars 36 forks source link

Fix hyperref page references #39

Closed ruilvo closed 9 months ago

ruilvo commented 1 year ago

When you use any kind of page referencing, eg. when using backref=true, on the biblatex package, the PDF links to the wrong place.

What currently happens:

Reference says "(cit. on p. 1)." When clicking the "1", the PDF goes to the first page, instead of page 1.

Why?

The document starts with arab page numbering. \includepdf[pages=-]{cover.pdf} actually increments this counter, which is then reset after the ToCs. While the page numbering looks correct on the typeset document, the references are wrong.

The fix

The workaround works by setting \pagenumbering{Alph} first thing in the document. This makes so the cover pages are numbered in the Alph style (A, B, C, D, etc), preventing the "corruption" on the arabic-style counter. This does show in the PDF document as "A (1/50)", but nothing is displayed cosmetically.

ruilvo commented 1 year ago

PS: Seems like that my editor trimmed trailing space. If you don't want to accept as-is, I can revert that, I think.

jpbarraca commented 9 months ago

Please remove the changes related to the trimmed trailing space.

ruilvo commented 9 months ago

Please remove the changes related to the trimmed trailing space.

It's fixed now.

ruilvo commented 9 months ago

Rebased from latest upstream/HEAD to ease merge.