Page Layout ⇒ pdflatex duplicate problem with hyperref package
pdflatex duplicate problem with hyperref package
I have done some research into the particular problem I'm having, but so far I haven't been able to solve it. I have an 11 chapter Master document with equations, figures, tables, etc. in each chapter. All equations, tables, and figures are reset for each chapter. However, the resulting pdf using pdflatex and the hyperref package have problems when an equation, as one example, is linked (it happens with tables and figures as well, but sections and chapters are linked correctly). For example, Equation 1 in Chapter 5 will link to Equation 1 in Chapter 4.
I've made an MWE trying to show you my problem. I searched the error I receive and a solution was to use \pagenumbering and \setcounter{page} to ensure the page is unique. However, this does not seem to solve my problem.
I've attached my MWE files. I look forward to hopefully hearing some replies.
-Beth
- Attachments
-
- master.tex
- (3.85 KiB) Downloaded 254 times
-
- ch2.tex
- (673 Bytes) Downloaded 211 times
-
- ch1.tex
- (683 Bytes) Downloaded 222 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
pdflatex duplicate problem with hyperref package
Moreover, and more significantly, your sample code, at least for me, does not duplicate the problem. I compiled the document and opened it in both evince and Adobe Reader, and as far as I could, both the equation links worked just as one would expect.
It's generally considered good practice to avoid numbers in labels, so instead of:
Code: Select all
\label{eq:ch1-first-eq}
Code: Select all
\label{eq:ch-one-first-eq}
Re: pdflatex duplicate problem with hyperref package
I will keep searching for an answer. Thanks for your time.
pdflatex duplicate problem with hyperref package
After playing with the code more, I found a workaround for myself regarding the pdflatex warning
I placed! pdfTeX warning (ext4): destination with the same identifier (name{equation.1} ) has been already used, duplicate ignored <to be read again>
Code: Select all
\renewcommand{\theequation}{\thechapter.\arabic{equation}}
I am not completely satisfied my solution is the best one, and as was already pointed out, the problem cannot be duplicated. Has anyone encountered an issue like this? I am using pdfTeX 3.14159... on a Redhat Enterprise Linux system.
- Attachments
-
- master.tex
- (434 Bytes) Downloaded 229 times
-
- ch2.tex
- (694 Bytes) Downloaded 201 times
-
- ch1.tex
- (704 Bytes) Downloaded 210 times
Re: pdflatex duplicate problem with hyperref package
But how come you play around with \setcounter and all these counters?
Maybe you should also use the Koma class report, meaning in the end your master file could look like in the attachments.
When one uses the article-class, the numbering does not have the form "section.equation" by default, but that is editable.
- Attachments
-
- master.tex
- (407 Bytes) Downloaded 224 times
-
- ch1.tex
- (361 Bytes) Downloaded 226 times
Re: pdflatex duplicate problem with hyperref package
I think article class was chosen for a reason, and since I am working on the document with others, I cannot change it to be a report. I get the name or page duplication warning from pdfTeX for tables and figures, but not equations now. I am not sure if \autoref will solve that problem.
I am inclined to not use \hyperref at all since it is causing too many problems. Thanks for offering some help.
pdflatex duplicate problem with hyperref package
Code: Select all
\renewcommand{\thetable}{\thechapter.\arabic{table}}
\renewcommand{\theHtable}{\thechapter.\arabic{table}}
\renewcommand{\thefigure}{\thechapter.\arabic{figure}}
\renewcommand{\theHfigure}{\thechapter.\arabic{figure}}