Reference with entire number in enumerate
So I have made this file where I list my exercises as 1.A, 1.B,... for the exercises in Chapter 1, and 2.A,2.B,... for the exercises in Chapter 2.
documentclass{book}
usepackage{enumerate}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[arabic{chapter}.A]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}
Now the reference prints only the letter A, I would like it to print 1.A instead. When using hyperref, this does not matter unless the material is printed of course.
cross-referencing lists enumerate
add a comment |
So I have made this file where I list my exercises as 1.A, 1.B,... for the exercises in Chapter 1, and 2.A,2.B,... for the exercises in Chapter 2.
documentclass{book}
usepackage{enumerate}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[arabic{chapter}.A]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}
Now the reference prints only the letter A, I would like it to print 1.A instead. When using hyperref, this does not matter unless the material is printed of course.
cross-referencing lists enumerate
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
Dec 13 '18 at 14:07
In general it's probably better to usethechapterrather thanarabic{chapter}.
– Werner
Dec 13 '18 at 16:16
add a comment |
So I have made this file where I list my exercises as 1.A, 1.B,... for the exercises in Chapter 1, and 2.A,2.B,... for the exercises in Chapter 2.
documentclass{book}
usepackage{enumerate}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[arabic{chapter}.A]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}
Now the reference prints only the letter A, I would like it to print 1.A instead. When using hyperref, this does not matter unless the material is printed of course.
cross-referencing lists enumerate
So I have made this file where I list my exercises as 1.A, 1.B,... for the exercises in Chapter 1, and 2.A,2.B,... for the exercises in Chapter 2.
documentclass{book}
usepackage{enumerate}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[arabic{chapter}.A]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}
Now the reference prints only the letter A, I would like it to print 1.A instead. When using hyperref, this does not matter unless the material is printed of course.
cross-referencing lists enumerate
cross-referencing lists enumerate
asked Dec 13 '18 at 12:44
JSchooneJSchoone
1233
1233
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
Dec 13 '18 at 14:07
In general it's probably better to usethechapterrather thanarabic{chapter}.
– Werner
Dec 13 '18 at 16:16
add a comment |
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
Dec 13 '18 at 14:07
In general it's probably better to usethechapterrather thanarabic{chapter}.
– Werner
Dec 13 '18 at 16:16
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
Dec 13 '18 at 14:07
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
Dec 13 '18 at 14:07
In general it's probably better to use
thechapter rather than arabic{chapter}.– Werner
Dec 13 '18 at 16:16
In general it's probably better to use
thechapter rather than arabic{chapter}.– Werner
Dec 13 '18 at 16:16
add a comment |
2 Answers
2
active
oldest
votes
Use the enumitem package:
documentclass{book}
usepackage{enumitem}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[label=arabic{chapter}.Alph*]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
@JSchoone if you loadenumitemwith theshortlabelsoption, then it covers all of the syntax features from theenumeratepackage.
– daleif
Dec 13 '18 at 17:18
add a comment |
A no package solution
documentclass{book}
renewcommand{theenumi}{arabic{chapter}.Alph{enumi}}
renewcommand{labelenumi}{theenumi}
usepackage{hyperref}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
The approach is global but you can make it local of course for example by wrapping the two lines in azutmacro (add a%at end of first line) and the usebegin{enumerate}zut... or better define some other environment wrappingenumerateand insert there the two lines.
– user4686
Dec 13 '18 at 16:47
Butenumitemis a useful package and I trust (although I never really looked) you can get with it most if not all ofenumeratefunctionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– user4686
Dec 13 '18 at 16:50
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%2f464692%2freference-with-entire-number-in-enumerate%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
Use the enumitem package:
documentclass{book}
usepackage{enumitem}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[label=arabic{chapter}.Alph*]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
@JSchoone if you loadenumitemwith theshortlabelsoption, then it covers all of the syntax features from theenumeratepackage.
– daleif
Dec 13 '18 at 17:18
add a comment |
Use the enumitem package:
documentclass{book}
usepackage{enumitem}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[label=arabic{chapter}.Alph*]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
@JSchoone if you loadenumitemwith theshortlabelsoption, then it covers all of the syntax features from theenumeratepackage.
– daleif
Dec 13 '18 at 17:18
add a comment |
Use the enumitem package:
documentclass{book}
usepackage{enumitem}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[label=arabic{chapter}.Alph*]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

Use the enumitem package:
documentclass{book}
usepackage{enumitem}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}[label=arabic{chapter}.Alph*]
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

answered Dec 13 '18 at 15:41
Ulrike FischerUlrike Fischer
191k8298681
191k8298681
Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
@JSchoone if you loadenumitemwith theshortlabelsoption, then it covers all of the syntax features from theenumeratepackage.
– daleif
Dec 13 '18 at 17:18
add a comment |
Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
@JSchoone if you loadenumitemwith theshortlabelsoption, then it covers all of the syntax features from theenumeratepackage.
– daleif
Dec 13 '18 at 17:18
Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
Thank you for this solution. I've removed the enumerate package and used enumitem, as they are known not to work together. At first glance, I am not missing out on features of enumerate right now.
– JSchoone
Dec 13 '18 at 16:27
@JSchoone if you load
enumitem with the shortlabels option, then it covers all of the syntax features from the enumerate package.– daleif
Dec 13 '18 at 17:18
@JSchoone if you load
enumitem with the shortlabels option, then it covers all of the syntax features from the enumerate package.– daleif
Dec 13 '18 at 17:18
add a comment |
A no package solution
documentclass{book}
renewcommand{theenumi}{arabic{chapter}.Alph{enumi}}
renewcommand{labelenumi}{theenumi}
usepackage{hyperref}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
The approach is global but you can make it local of course for example by wrapping the two lines in azutmacro (add a%at end of first line) and the usebegin{enumerate}zut... or better define some other environment wrappingenumerateand insert there the two lines.
– user4686
Dec 13 '18 at 16:47
Butenumitemis a useful package and I trust (although I never really looked) you can get with it most if not all ofenumeratefunctionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– user4686
Dec 13 '18 at 16:50
add a comment |
A no package solution
documentclass{book}
renewcommand{theenumi}{arabic{chapter}.Alph{enumi}}
renewcommand{labelenumi}{theenumi}
usepackage{hyperref}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
The approach is global but you can make it local of course for example by wrapping the two lines in azutmacro (add a%at end of first line) and the usebegin{enumerate}zut... or better define some other environment wrappingenumerateand insert there the two lines.
– user4686
Dec 13 '18 at 16:47
Butenumitemis a useful package and I trust (although I never really looked) you can get with it most if not all ofenumeratefunctionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– user4686
Dec 13 '18 at 16:50
add a comment |
A no package solution
documentclass{book}
renewcommand{theenumi}{arabic{chapter}.Alph{enumi}}
renewcommand{labelenumi}{theenumi}
usepackage{hyperref}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

A no package solution
documentclass{book}
renewcommand{theenumi}{arabic{chapter}.Alph{enumi}}
renewcommand{labelenumi}{theenumi}
usepackage{hyperref}
begin{document}
chapter{Chapter 1}
Text
section{Exercises}
begin{enumerate}
item Bla. label{thislabel}
item bla. Hint: use Exercise ref{thislabel}.
end{enumerate}
end{document}

answered Dec 13 '18 at 16:03
user4686
I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
The approach is global but you can make it local of course for example by wrapping the two lines in azutmacro (add a%at end of first line) and the usebegin{enumerate}zut... or better define some other environment wrappingenumerateand insert there the two lines.
– user4686
Dec 13 '18 at 16:47
Butenumitemis a useful package and I trust (although I never really looked) you can get with it most if not all ofenumeratefunctionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– user4686
Dec 13 '18 at 16:50
add a comment |
I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
The approach is global but you can make it local of course for example by wrapping the two lines in azutmacro (add a%at end of first line) and the usebegin{enumerate}zut... or better define some other environment wrappingenumerateand insert there the two lines.
– user4686
Dec 13 '18 at 16:47
Butenumitemis a useful package and I trust (although I never really looked) you can get with it most if not all ofenumeratefunctionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– user4686
Dec 13 '18 at 16:50
I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
I've decided not to use your solution, but in the future I might, when my co-authors need enumerate instead of enumitem. But your solution seems to be global, am I wrong in that? I need enumerate environments elsewhere and don't want the numbering to be the same as the exercises. But thank you for your solution, which most surely will help others. (:
– JSchoone
Dec 13 '18 at 16:29
The approach is global but you can make it local of course for example by wrapping the two lines in a
zut macro (add a % at end of first line) and the use begin{enumerate}zut ... or better define some other environment wrapping enumerate and insert there the two lines.– user4686
Dec 13 '18 at 16:47
The approach is global but you can make it local of course for example by wrapping the two lines in a
zut macro (add a % at end of first line) and the use begin{enumerate}zut ... or better define some other environment wrapping enumerate and insert there the two lines.– user4686
Dec 13 '18 at 16:47
But
enumitem is a useful package and I trust (although I never really looked) you can get with it most if not all of enumerate functionality. (hence I of course +1ed Ulrike's answer and find it the better one)– user4686
Dec 13 '18 at 16:50
But
enumitem is a useful package and I trust (although I never really looked) you can get with it most if not all of enumerate functionality. (hence I of course +1ed Ulrike's answer and find it the better one)– user4686
Dec 13 '18 at 16:50
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%2f464692%2freference-with-entire-number-in-enumerate%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. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
Dec 13 '18 at 14:07
In general it's probably better to use
thechapterrather thanarabic{chapter}.– Werner
Dec 13 '18 at 16:16