“destination with the same identifier” error with a custom appendix
up vote
0
down vote
favorite
I am working with a slightly modified version of the answer provided by @StevenBSegletes to achieve a custom appendix structure.
(disclaimer: I left out my own modifications here to make the example more minimal, as this issue arises even with the bare original code by Steven. if you deem that I need to show my full set-up, I will be more than happy to do so.)
When you run the MWE below, all of the labelling of the page numbers, equation numbers etc. work as per normal. But under the hood, eq1
and eq2
in the appendices throw up warnings in the log file that look like:
{C:/Users/user/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]pdfTeX warnin
g (ext4): destination with the same identifier (name{equation.0.2.1}) has been
already used, duplicate ignored
<to be read again>
relax
l.56 begin{equation}
label{eq1}pdfTeX warning (ext4): destination with the sam
e identifier (name{equation.0.2.1}) has been already used, duplicate ignored
<to be read again>
relax
and clicking the hyperlinks from Appendix B (see MWE) brings me to the "first" equation in the main text, not the appropriate ones in Appendix A and B. Presumably because of the above stated warning.
How can I fix Steven's code so that my references will work as expected? I am using cleveref
, hypcap
, bookmark
and hyperref
in my actual document.
MWE
documentclass[12pt]{scrreprt}
usepackage{hyperref}
usepackage{cleveref}
% code taken from: https://tex.stackexchange.com/a/132988
makeatletter
renewcommandappendix{@ifstar{loneappendix}{anappendix}}
newcounter{appndx}
setcounter{appndx}{0}
newcommand loneappendix [1]{
clearpage
setcounter{appndx}{1}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
setcounter{equation}{0}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommand anappendix[1]{
clearpage
refstepcounter{appndx}
setcounter{equation}{0}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname~Alph{appndx}. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommandtheappendix[1]{
section*{#1}
}
makeatother
begin{document}
section{First section}
Hello world
section{Second Section}
Hello world, this is the offending equation.
begin{equation}
y =x^2
end{equation}
appendix{First}
I will want to reference this equation later.
begin{equation}label{eq1}
y =x^2
end{equation}
appendix{Second}
begin{equation}label{eq2}
y =x^2
end{equation}
I want to reference first equation from appendix A: cref{eq1}.
I also want to reference the first equation from appendix B: cref{eq2}
But both bring me back to the ``first'' first equation (in the main text).
end{document}
EDIT:
I think I can solve the problem if I introduce new custom counters for the appendix instead of re-using the equation
, figure
etc. counters. Then there wouldn't be a clash with the main text hyper-labels. But how can I implement this idea, especially with refstepcounter
?
hyperref cross-referencing appendices
add a comment |
up vote
0
down vote
favorite
I am working with a slightly modified version of the answer provided by @StevenBSegletes to achieve a custom appendix structure.
(disclaimer: I left out my own modifications here to make the example more minimal, as this issue arises even with the bare original code by Steven. if you deem that I need to show my full set-up, I will be more than happy to do so.)
When you run the MWE below, all of the labelling of the page numbers, equation numbers etc. work as per normal. But under the hood, eq1
and eq2
in the appendices throw up warnings in the log file that look like:
{C:/Users/user/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]pdfTeX warnin
g (ext4): destination with the same identifier (name{equation.0.2.1}) has been
already used, duplicate ignored
<to be read again>
relax
l.56 begin{equation}
label{eq1}pdfTeX warning (ext4): destination with the sam
e identifier (name{equation.0.2.1}) has been already used, duplicate ignored
<to be read again>
relax
and clicking the hyperlinks from Appendix B (see MWE) brings me to the "first" equation in the main text, not the appropriate ones in Appendix A and B. Presumably because of the above stated warning.
How can I fix Steven's code so that my references will work as expected? I am using cleveref
, hypcap
, bookmark
and hyperref
in my actual document.
MWE
documentclass[12pt]{scrreprt}
usepackage{hyperref}
usepackage{cleveref}
% code taken from: https://tex.stackexchange.com/a/132988
makeatletter
renewcommandappendix{@ifstar{loneappendix}{anappendix}}
newcounter{appndx}
setcounter{appndx}{0}
newcommand loneappendix [1]{
clearpage
setcounter{appndx}{1}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
setcounter{equation}{0}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommand anappendix[1]{
clearpage
refstepcounter{appndx}
setcounter{equation}{0}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname~Alph{appndx}. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommandtheappendix[1]{
section*{#1}
}
makeatother
begin{document}
section{First section}
Hello world
section{Second Section}
Hello world, this is the offending equation.
begin{equation}
y =x^2
end{equation}
appendix{First}
I will want to reference this equation later.
begin{equation}label{eq1}
y =x^2
end{equation}
appendix{Second}
begin{equation}label{eq2}
y =x^2
end{equation}
I want to reference first equation from appendix A: cref{eq1}.
I also want to reference the first equation from appendix B: cref{eq2}
But both bring me back to the ``first'' first equation (in the main text).
end{document}
EDIT:
I think I can solve the problem if I introduce new custom counters for the appendix instead of re-using the equation
, figure
etc. counters. Then there wouldn't be a clash with the main text hyper-labels. But how can I implement this idea, especially with refstepcounter
?
hyperref cross-referencing appendices
1
Optionhypertexnames=false
should help:usepackage[hypertexnames=false]{hyperref}
.
– esdd
Nov 16 at 21:29
@esdd yeah that works, thank you.
– ksgj1
Nov 16 at 23:28
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am working with a slightly modified version of the answer provided by @StevenBSegletes to achieve a custom appendix structure.
(disclaimer: I left out my own modifications here to make the example more minimal, as this issue arises even with the bare original code by Steven. if you deem that I need to show my full set-up, I will be more than happy to do so.)
When you run the MWE below, all of the labelling of the page numbers, equation numbers etc. work as per normal. But under the hood, eq1
and eq2
in the appendices throw up warnings in the log file that look like:
{C:/Users/user/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]pdfTeX warnin
g (ext4): destination with the same identifier (name{equation.0.2.1}) has been
already used, duplicate ignored
<to be read again>
relax
l.56 begin{equation}
label{eq1}pdfTeX warning (ext4): destination with the sam
e identifier (name{equation.0.2.1}) has been already used, duplicate ignored
<to be read again>
relax
and clicking the hyperlinks from Appendix B (see MWE) brings me to the "first" equation in the main text, not the appropriate ones in Appendix A and B. Presumably because of the above stated warning.
How can I fix Steven's code so that my references will work as expected? I am using cleveref
, hypcap
, bookmark
and hyperref
in my actual document.
MWE
documentclass[12pt]{scrreprt}
usepackage{hyperref}
usepackage{cleveref}
% code taken from: https://tex.stackexchange.com/a/132988
makeatletter
renewcommandappendix{@ifstar{loneappendix}{anappendix}}
newcounter{appndx}
setcounter{appndx}{0}
newcommand loneappendix [1]{
clearpage
setcounter{appndx}{1}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
setcounter{equation}{0}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommand anappendix[1]{
clearpage
refstepcounter{appndx}
setcounter{equation}{0}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname~Alph{appndx}. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommandtheappendix[1]{
section*{#1}
}
makeatother
begin{document}
section{First section}
Hello world
section{Second Section}
Hello world, this is the offending equation.
begin{equation}
y =x^2
end{equation}
appendix{First}
I will want to reference this equation later.
begin{equation}label{eq1}
y =x^2
end{equation}
appendix{Second}
begin{equation}label{eq2}
y =x^2
end{equation}
I want to reference first equation from appendix A: cref{eq1}.
I also want to reference the first equation from appendix B: cref{eq2}
But both bring me back to the ``first'' first equation (in the main text).
end{document}
EDIT:
I think I can solve the problem if I introduce new custom counters for the appendix instead of re-using the equation
, figure
etc. counters. Then there wouldn't be a clash with the main text hyper-labels. But how can I implement this idea, especially with refstepcounter
?
hyperref cross-referencing appendices
I am working with a slightly modified version of the answer provided by @StevenBSegletes to achieve a custom appendix structure.
(disclaimer: I left out my own modifications here to make the example more minimal, as this issue arises even with the bare original code by Steven. if you deem that I need to show my full set-up, I will be more than happy to do so.)
When you run the MWE below, all of the labelling of the page numbers, equation numbers etc. work as per normal. But under the hood, eq1
and eq2
in the appendices throw up warnings in the log file that look like:
{C:/Users/user/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]pdfTeX warnin
g (ext4): destination with the same identifier (name{equation.0.2.1}) has been
already used, duplicate ignored
<to be read again>
relax
l.56 begin{equation}
label{eq1}pdfTeX warning (ext4): destination with the sam
e identifier (name{equation.0.2.1}) has been already used, duplicate ignored
<to be read again>
relax
and clicking the hyperlinks from Appendix B (see MWE) brings me to the "first" equation in the main text, not the appropriate ones in Appendix A and B. Presumably because of the above stated warning.
How can I fix Steven's code so that my references will work as expected? I am using cleveref
, hypcap
, bookmark
and hyperref
in my actual document.
MWE
documentclass[12pt]{scrreprt}
usepackage{hyperref}
usepackage{cleveref}
% code taken from: https://tex.stackexchange.com/a/132988
makeatletter
renewcommandappendix{@ifstar{loneappendix}{anappendix}}
newcounter{appndx}
setcounter{appndx}{0}
newcommand loneappendix [1]{
clearpage
setcounter{appndx}{1}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
setcounter{equation}{0}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommand anappendix[1]{
clearpage
refstepcounter{appndx}
setcounter{equation}{0}
setcounter{figure}{0}
renewcommandthefigure{Alph{appndx}-@arabicc@figure}
setcounter{table}{0}
renewcommandthetable{Alph{appndx}-arabic{table}}
renewcommandtheequation {Alph{appndx}-arabic{equation}}
defappendixtitle{appendixname~Alph{appndx}. #1}
addcontentsline{toc}{section}appendixtitle
theappendixappendixtitle
setcounter{page}{1}
renewcommandthepage{Alph{appndx}.arabic{page}}
}
newcommandtheappendix[1]{
section*{#1}
}
makeatother
begin{document}
section{First section}
Hello world
section{Second Section}
Hello world, this is the offending equation.
begin{equation}
y =x^2
end{equation}
appendix{First}
I will want to reference this equation later.
begin{equation}label{eq1}
y =x^2
end{equation}
appendix{Second}
begin{equation}label{eq2}
y =x^2
end{equation}
I want to reference first equation from appendix A: cref{eq1}.
I also want to reference the first equation from appendix B: cref{eq2}
But both bring me back to the ``first'' first equation (in the main text).
end{document}
EDIT:
I think I can solve the problem if I introduce new custom counters for the appendix instead of re-using the equation
, figure
etc. counters. Then there wouldn't be a clash with the main text hyper-labels. But how can I implement this idea, especially with refstepcounter
?
hyperref cross-referencing appendices
hyperref cross-referencing appendices
edited Nov 16 at 21:19
asked Nov 16 at 20:33
ksgj1
321114
321114
1
Optionhypertexnames=false
should help:usepackage[hypertexnames=false]{hyperref}
.
– esdd
Nov 16 at 21:29
@esdd yeah that works, thank you.
– ksgj1
Nov 16 at 23:28
add a comment |
1
Optionhypertexnames=false
should help:usepackage[hypertexnames=false]{hyperref}
.
– esdd
Nov 16 at 21:29
@esdd yeah that works, thank you.
– ksgj1
Nov 16 at 23:28
1
1
Option
hypertexnames=false
should help: usepackage[hypertexnames=false]{hyperref}
.– esdd
Nov 16 at 21:29
Option
hypertexnames=false
should help: usepackage[hypertexnames=false]{hyperref}
.– esdd
Nov 16 at 21:29
@esdd yeah that works, thank you.
– ksgj1
Nov 16 at 23:28
@esdd yeah that works, thank you.
– ksgj1
Nov 16 at 23:28
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460375%2fdestination-with-the-same-identifier-error-with-a-custom-appendix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Option
hypertexnames=false
should help:usepackage[hypertexnames=false]{hyperref}
.– esdd
Nov 16 at 21:29
@esdd yeah that works, thank you.
– ksgj1
Nov 16 at 23:28