How to fix a cpageref link that's drives me to a wrong page?
I'm using hyperref
and cleveref
packages for to create link in my document. However, when I use cpageref
to reference a page, the link created drives me to a wrong page.
In the following MWE, the labeled paragraph is on page 3. The cpageref
is on page 6. When I click the link, it drives me to the page 1. Any help?
documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage[%
noabbrev,
nameinlink,
sort
]{cleveref}
begin{document}
Blindtextpar%
%
Blindtextpar%
%
label{Here}textbf{Referenced paragraph}par%<- is on page 3
%
Blindtextpar%
%
Blindtext Page of the referenced paragraph cpageref{Here}%<- Drives me to page 1
end{document}%
hyperref cleveref hyperlink
add a comment |
I'm using hyperref
and cleveref
packages for to create link in my document. However, when I use cpageref
to reference a page, the link created drives me to a wrong page.
In the following MWE, the labeled paragraph is on page 3. The cpageref
is on page 6. When I click the link, it drives me to the page 1. Any help?
documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage[%
noabbrev,
nameinlink,
sort
]{cleveref}
begin{document}
Blindtextpar%
%
Blindtextpar%
%
label{Here}textbf{Referenced paragraph}par%<- is on page 3
%
Blindtextpar%
%
Blindtext Page of the referenced paragraph cpageref{Here}%<- Drives me to page 1
end{document}%
hyperref cleveref hyperlink
3
Alabel
in LaTeX usually attaches to the last counter that was stepped up with a special command so thatlabel
can see it (this happens for example insection
, in numbered theorems, infigure
andtable
, ...). In your example no such counters are stepped up and so thelabel
has nothing to latch on to. You could tryphantomsectionlabel{Here}
, but depending on your actual use case there might be more elegant methods like a theorem environment orhypertarget
+hyperlink
(cf. tex.stackexchange.com/q/63895/35864).
– moewe
Feb 13 at 19:15
add a comment |
I'm using hyperref
and cleveref
packages for to create link in my document. However, when I use cpageref
to reference a page, the link created drives me to a wrong page.
In the following MWE, the labeled paragraph is on page 3. The cpageref
is on page 6. When I click the link, it drives me to the page 1. Any help?
documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage[%
noabbrev,
nameinlink,
sort
]{cleveref}
begin{document}
Blindtextpar%
%
Blindtextpar%
%
label{Here}textbf{Referenced paragraph}par%<- is on page 3
%
Blindtextpar%
%
Blindtext Page of the referenced paragraph cpageref{Here}%<- Drives me to page 1
end{document}%
hyperref cleveref hyperlink
I'm using hyperref
and cleveref
packages for to create link in my document. However, when I use cpageref
to reference a page, the link created drives me to a wrong page.
In the following MWE, the labeled paragraph is on page 3. The cpageref
is on page 6. When I click the link, it drives me to the page 1. Any help?
documentclass[12pt,a4paper]{article}
usepackage{blindtext}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage[%
noabbrev,
nameinlink,
sort
]{cleveref}
begin{document}
Blindtextpar%
%
Blindtextpar%
%
label{Here}textbf{Referenced paragraph}par%<- is on page 3
%
Blindtextpar%
%
Blindtext Page of the referenced paragraph cpageref{Here}%<- Drives me to page 1
end{document}%
hyperref cleveref hyperlink
hyperref cleveref hyperlink
edited Feb 17 at 23:43
Henri Menke
74.9k8164276
74.9k8164276
asked Feb 13 at 18:47
Daniel Valencia C.Daniel Valencia C.
1,108618
1,108618
3
Alabel
in LaTeX usually attaches to the last counter that was stepped up with a special command so thatlabel
can see it (this happens for example insection
, in numbered theorems, infigure
andtable
, ...). In your example no such counters are stepped up and so thelabel
has nothing to latch on to. You could tryphantomsectionlabel{Here}
, but depending on your actual use case there might be more elegant methods like a theorem environment orhypertarget
+hyperlink
(cf. tex.stackexchange.com/q/63895/35864).
– moewe
Feb 13 at 19:15
add a comment |
3
Alabel
in LaTeX usually attaches to the last counter that was stepped up with a special command so thatlabel
can see it (this happens for example insection
, in numbered theorems, infigure
andtable
, ...). In your example no such counters are stepped up and so thelabel
has nothing to latch on to. You could tryphantomsectionlabel{Here}
, but depending on your actual use case there might be more elegant methods like a theorem environment orhypertarget
+hyperlink
(cf. tex.stackexchange.com/q/63895/35864).
– moewe
Feb 13 at 19:15
3
3
A
label
in LaTeX usually attaches to the last counter that was stepped up with a special command so that label
can see it (this happens for example in section
, in numbered theorems, in figure
and table
, ...). In your example no such counters are stepped up and so the label
has nothing to latch on to. You could try phantomsectionlabel{Here}
, but depending on your actual use case there might be more elegant methods like a theorem environment or hypertarget
+hyperlink
(cf. tex.stackexchange.com/q/63895/35864).– moewe
Feb 13 at 19:15
A
label
in LaTeX usually attaches to the last counter that was stepped up with a special command so that label
can see it (this happens for example in section
, in numbered theorems, in figure
and table
, ...). In your example no such counters are stepped up and so the label
has nothing to latch on to. You could try phantomsectionlabel{Here}
, but depending on your actual use case there might be more elegant methods like a theorem environment or hypertarget
+hyperlink
(cf. tex.stackexchange.com/q/63895/35864).– moewe
Feb 13 at 19:15
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f474746%2fhow-to-fix-a-cpageref-link-thats-drives-me-to-a-wrong-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f474746%2fhow-to-fix-a-cpageref-link-thats-drives-me-to-a-wrong-page%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
3
A
label
in LaTeX usually attaches to the last counter that was stepped up with a special command so thatlabel
can see it (this happens for example insection
, in numbered theorems, infigure
andtable
, ...). In your example no such counters are stepped up and so thelabel
has nothing to latch on to. You could tryphantomsectionlabel{Here}
, but depending on your actual use case there might be more elegant methods like a theorem environment orhypertarget
+hyperlink
(cf. tex.stackexchange.com/q/63895/35864).– moewe
Feb 13 at 19:15