ref should use enumerate label name
I have done this:
begin{enumerate}
renewcommand{labelenumi}{textbf{S.theenumi}}
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
The ref just uses the enumerate number. But I want it to be the full enumerate label.
I also could just type S.ref{l} but that has the two disadvantages that
- if I update the enumerate label, I also have to update this reference,
- together with
hyperref, this doesn't look so nice.
How would be a clean/nice way to solve this?
hyperref cross-referencing enumerate
add a comment |
I have done this:
begin{enumerate}
renewcommand{labelenumi}{textbf{S.theenumi}}
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
The ref just uses the enumerate number. But I want it to be the full enumerate label.
I also could just type S.ref{l} but that has the two disadvantages that
- if I update the enumerate label, I also have to update this reference,
- together with
hyperref, this doesn't look so nice.
How would be a clean/nice way to solve this?
hyperref cross-referencing enumerate
add a comment |
I have done this:
begin{enumerate}
renewcommand{labelenumi}{textbf{S.theenumi}}
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
The ref just uses the enumerate number. But I want it to be the full enumerate label.
I also could just type S.ref{l} but that has the two disadvantages that
- if I update the enumerate label, I also have to update this reference,
- together with
hyperref, this doesn't look so nice.
How would be a clean/nice way to solve this?
hyperref cross-referencing enumerate
I have done this:
begin{enumerate}
renewcommand{labelenumi}{textbf{S.theenumi}}
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
The ref just uses the enumerate number. But I want it to be the full enumerate label.
I also could just type S.ref{l} but that has the two disadvantages that
- if I update the enumerate label, I also have to update this reference,
- together with
hyperref, this doesn't look so nice.
How would be a clean/nice way to solve this?
hyperref cross-referencing enumerate
hyperref cross-referencing enumerate
edited Jun 6 '12 at 0:30
Werner
442k679741669
442k679741669
asked Jun 6 '12 at 0:11
AlbertAlbert
1,01631524
1,01631524
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can use the enumitem package:
documentclass{article}
usepackage{enumitem}
begin{document}
begin{enumerate}[label=textbf{S.arabic*}]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}

or
begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
if you don't want the reference to be boldfaced.
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
add a comment |
For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:

documentclass{article}
begin{document}
begin{enumerate}
renewcommand{labelenumi}{textbf{theenumi}}
renewcommand{theenumi}{S.arabic{enumi}}
item a
makeatletter
show@currentlabel
makeatother
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}
This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.
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%2f58713%2fref-should-use-enumerate-label-name%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
You can use the enumitem package:
documentclass{article}
usepackage{enumitem}
begin{document}
begin{enumerate}[label=textbf{S.arabic*}]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}

or
begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
if you don't want the reference to be boldfaced.
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
add a comment |
You can use the enumitem package:
documentclass{article}
usepackage{enumitem}
begin{document}
begin{enumerate}[label=textbf{S.arabic*}]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}

or
begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
if you don't want the reference to be boldfaced.
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
add a comment |
You can use the enumitem package:
documentclass{article}
usepackage{enumitem}
begin{document}
begin{enumerate}[label=textbf{S.arabic*}]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}

or
begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
if you don't want the reference to be boldfaced.
You can use the enumitem package:
documentclass{article}
usepackage{enumitem}
begin{document}
begin{enumerate}[label=textbf{S.arabic*}]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}

or
begin{enumerate}[label=textbf{S.arabic*},ref=S.arabic*]
item a
item label{l} b
item c. goto ref{l}
end{enumerate}
if you don't want the reference to be boldfaced.
answered Jun 6 '12 at 0:13
Gonzalo MedinaGonzalo Medina
398k4113021571
398k4113021571
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
add a comment |
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
This is nice. I would like to add that it does not work together with usepackage{paralist} ... if you need to use that package.
– peschü
Mar 12 '17 at 20:19
add a comment |
For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:

documentclass{article}
begin{document}
begin{enumerate}
renewcommand{labelenumi}{textbf{theenumi}}
renewcommand{theenumi}{S.arabic{enumi}}
item a
makeatletter
show@currentlabel
makeatother
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}
This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.
add a comment |
For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:

documentclass{article}
begin{document}
begin{enumerate}
renewcommand{labelenumi}{textbf{theenumi}}
renewcommand{theenumi}{S.arabic{enumi}}
item a
makeatletter
show@currentlabel
makeatother
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}
This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.
add a comment |
For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:

documentclass{article}
begin{document}
begin{enumerate}
renewcommand{labelenumi}{textbf{theenumi}}
renewcommand{theenumi}{S.arabic{enumi}}
item a
makeatletter
show@currentlabel
makeatother
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}
This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.
For your attempt properly work, you need redefine the counter representation (theenumi) as well as the label associated with it (labelenumi). This separates the formatting from the counter when you're using ref:

documentclass{article}
begin{document}
begin{enumerate}
renewcommand{labelenumi}{textbf{theenumi}}
renewcommand{theenumi}{S.arabic{enumi}}
item a
makeatletter
show@currentlabel
makeatother
item label{l} b
item c. goto ref{l}
end{enumerate}
end{document}
This also works nicely with hyperref. However, in general, it is much easier to use enumitem since it can be used in a global or localized setting using a key-value approach; very convenient.
answered Jun 6 '12 at 0:27
WernerWerner
442k679741669
442k679741669
add a comment |
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.
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%2f58713%2fref-should-use-enumerate-label-name%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