Cleveref and pdf Bookmark
I'm making pdf bookmarks with hyperref and cleveref packages. However, the pdf bookmarks show the label I defined, rather than the theorem name the label refers to. Here's the code:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some label}
This is a theorem.
end{theorem}
section{Proof to Cref{some label}}
end{document}
And here's the pdf:
Any idea how to change the label to "Proof to Theorem 1" instead of "Proof to some label"?
hyperref pdf cleveref bookmarks
add a comment |
I'm making pdf bookmarks with hyperref and cleveref packages. However, the pdf bookmarks show the label I defined, rather than the theorem name the label refers to. Here's the code:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some label}
This is a theorem.
end{theorem}
section{Proof to Cref{some label}}
end{document}
And here's the pdf:
Any idea how to change the label to "Proof to Theorem 1" instead of "Proof to some label"?
hyperref pdf cleveref bookmarks
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– karlkoeller
Mar 28 '15 at 6:40
Cref
is not really expandable, I fear, since it's defined to be a robust command
– Christian Hupfer
Mar 28 '15 at 6:47
add a comment |
I'm making pdf bookmarks with hyperref and cleveref packages. However, the pdf bookmarks show the label I defined, rather than the theorem name the label refers to. Here's the code:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some label}
This is a theorem.
end{theorem}
section{Proof to Cref{some label}}
end{document}
And here's the pdf:
Any idea how to change the label to "Proof to Theorem 1" instead of "Proof to some label"?
hyperref pdf cleveref bookmarks
I'm making pdf bookmarks with hyperref and cleveref packages. However, the pdf bookmarks show the label I defined, rather than the theorem name the label refers to. Here's the code:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some label}
This is a theorem.
end{theorem}
section{Proof to Cref{some label}}
end{document}
And here's the pdf:
Any idea how to change the label to "Proof to Theorem 1" instead of "Proof to some label"?
hyperref pdf cleveref bookmarks
hyperref pdf cleveref bookmarks
edited Mar 28 '15 at 20:17
Erika L
asked Mar 28 '15 at 6:26
Erika LErika L
504
504
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– karlkoeller
Mar 28 '15 at 6:40
Cref
is not really expandable, I fear, since it's defined to be a robust command
– Christian Hupfer
Mar 28 '15 at 6:47
add a comment |
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– karlkoeller
Mar 28 '15 at 6:40
Cref
is not really expandable, I fear, since it's defined to be a robust command
– Christian Hupfer
Mar 28 '15 at 6:47
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– karlkoeller
Mar 28 '15 at 6:40
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– karlkoeller
Mar 28 '15 at 6:40
Cref
is not really expandable, I fear, since it's defined to be a robust command– Christian Hupfer
Mar 28 '15 at 6:47
Cref
is not really expandable, I fear, since it's defined to be a robust command– Christian Hupfer
Mar 28 '15 at 6:47
add a comment |
2 Answers
2
active
oldest
votes
I'm afraid there is no solution for this, apart from using the command texorpdfstring
, that is you have to specify what has to go in the text and what has to go in the bookmarks.
Hence, substitute
section{Proof to Cref{some label}}
with
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
Note that it isn't a good idea to have label names with spaces, so I've substituted some label
with some_label
.
MWE:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
end{document}
Output:
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
add a comment |
The Cref
command cannot be used in section
when bookmarks are being produced; however, autoref
works (it's less powerful, though). For a simple application like this you can do as follows:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
pdfstringdefDisableCommands{letCrefautoref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to Cref{some_label}}
end{document}
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
@ErikaL Yes, but as you see, I letCref
toautoref
only in bookmarks where super precision is not really necessary.
– egreg
Mar 28 '15 at 20:44
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
add a comment |
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%2f235516%2fcleveref-and-pdf-bookmark%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I'm afraid there is no solution for this, apart from using the command texorpdfstring
, that is you have to specify what has to go in the text and what has to go in the bookmarks.
Hence, substitute
section{Proof to Cref{some label}}
with
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
Note that it isn't a good idea to have label names with spaces, so I've substituted some label
with some_label
.
MWE:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
end{document}
Output:
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
add a comment |
I'm afraid there is no solution for this, apart from using the command texorpdfstring
, that is you have to specify what has to go in the text and what has to go in the bookmarks.
Hence, substitute
section{Proof to Cref{some label}}
with
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
Note that it isn't a good idea to have label names with spaces, so I've substituted some label
with some_label
.
MWE:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
end{document}
Output:
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
add a comment |
I'm afraid there is no solution for this, apart from using the command texorpdfstring
, that is you have to specify what has to go in the text and what has to go in the bookmarks.
Hence, substitute
section{Proof to Cref{some label}}
with
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
Note that it isn't a good idea to have label names with spaces, so I've substituted some label
with some_label
.
MWE:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
end{document}
Output:
I'm afraid there is no solution for this, apart from using the command texorpdfstring
, that is you have to specify what has to go in the text and what has to go in the bookmarks.
Hence, substitute
section{Proof to Cref{some label}}
with
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
Note that it isn't a good idea to have label names with spaces, so I've substituted some label
with some_label
.
MWE:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to texorpdfstring{Cref{some_label}}{Theorem ref{some_label}}}
end{document}
Output:
edited Mar 28 '15 at 6:55
answered Mar 28 '15 at 6:47
karlkoellerkarlkoeller
106k9193356
106k9193356
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
add a comment |
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
That solves the problem (with a bit more work), thank you!
– Erika L
Mar 28 '15 at 16:01
add a comment |
The Cref
command cannot be used in section
when bookmarks are being produced; however, autoref
works (it's less powerful, though). For a simple application like this you can do as follows:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
pdfstringdefDisableCommands{letCrefautoref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to Cref{some_label}}
end{document}
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
@ErikaL Yes, but as you see, I letCref
toautoref
only in bookmarks where super precision is not really necessary.
– egreg
Mar 28 '15 at 20:44
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
add a comment |
The Cref
command cannot be used in section
when bookmarks are being produced; however, autoref
works (it's less powerful, though). For a simple application like this you can do as follows:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
pdfstringdefDisableCommands{letCrefautoref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to Cref{some_label}}
end{document}
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
@ErikaL Yes, but as you see, I letCref
toautoref
only in bookmarks where super precision is not really necessary.
– egreg
Mar 28 '15 at 20:44
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
add a comment |
The Cref
command cannot be used in section
when bookmarks are being produced; however, autoref
works (it's less powerful, though). For a simple application like this you can do as follows:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
pdfstringdefDisableCommands{letCrefautoref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to Cref{some_label}}
end{document}
The Cref
command cannot be used in section
when bookmarks are being produced; however, autoref
works (it's less powerful, though). For a simple application like this you can do as follows:
documentclass{article}
usepackage{hyperref}
usepackage{cleveref}
pdfstringdefDisableCommands{letCrefautoref}
newtheorem{theorem}{Theorem}
begin{document}
section{Section 1}
begin{theorem}label{some_label}
This is a theorem.
end{theorem}
section{Proof to Cref{some_label}}
end{document}
answered Mar 28 '15 at 20:34
egregegreg
710k8618893173
710k8618893173
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
@ErikaL Yes, but as you see, I letCref
toautoref
only in bookmarks where super precision is not really necessary.
– egreg
Mar 28 '15 at 20:44
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
add a comment |
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
@ErikaL Yes, but as you see, I letCref
toautoref
only in bookmarks where super precision is not really necessary.
– egreg
Mar 28 '15 at 20:44
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
Thanks. I did try autoref, but I do have a bunch of lemmas/propositions/corollaries which makes cleveref more suitable.
– Erika L
Mar 28 '15 at 20:43
@ErikaL Yes, but as you see, I let
Cref
to autoref
only in bookmarks where super precision is not really necessary.– egreg
Mar 28 '15 at 20:44
@ErikaL Yes, but as you see, I let
Cref
to autoref
only in bookmarks where super precision is not really necessary.– egreg
Mar 28 '15 at 20:44
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
It does work for the MWE. However I found another strange behavior using this method, see [tex.stackexchange.com/questions/235634/…
– Erika L
Mar 28 '15 at 21:12
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
This answer deserves to be upvoted more. It is an automatic solution relative to the manual solution that the accepted answer proposes. The virtues are obvious. If a figure number being referred to in the bookmark/section heading changes, then hand-coding a string quickly becomes dangerously out of date & misleading.
– Krishna
6 hours ago
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f235516%2fcleveref-and-pdf-bookmark%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
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– karlkoeller
Mar 28 '15 at 6:40
Cref
is not really expandable, I fear, since it's defined to be a robust command– Christian Hupfer
Mar 28 '15 at 6:47