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 273 times
-
- ch2.tex
- (673 Bytes) Downloaded 231 times
-
- ch1.tex
- (683 Bytes) Downloaded 242 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
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 249 times
-
- ch2.tex
- (694 Bytes) Downloaded 220 times
-
- ch1.tex
- (704 Bytes) Downloaded 230 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 245 times
-
- ch1.tex
- (361 Bytes) Downloaded 244 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}}