Reference with entire number in enumerate
up vote
2
down vote
favorite
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
New contributor
add a comment |
up vote
2
down vote
favorite
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
New contributor
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
3 hours ago
In general it's probably better to usethechapter
rather thanarabic{chapter}
.
– Werner
1 hour ago
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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
New contributor
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
New contributor
New contributor
New contributor
asked 4 hours ago
JSchoone
1133
1133
New contributor
New contributor
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
3 hours ago
In general it's probably better to usethechapter
rather thanarabic{chapter}
.
– Werner
1 hour ago
add a comment |
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
3 hours ago
In general it's probably better to usethechapter
rather thanarabic{chapter}
.
– Werner
1 hour ago
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
3 hours ago
Welcome to TeX.SX. See this question: tex.stackexchange.com/q/464119/28557 , might be related.
– nidhin
3 hours ago
In general it's probably better to use
thechapter
rather than arabic{chapter}
.– Werner
1 hour ago
In general it's probably better to use
thechapter
rather than arabic{chapter}
.– Werner
1 hour ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
6
down vote
accepted
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
1 hour ago
@JSchoone if you loadenumitem
with theshortlabels
option, then it covers all of the syntax features from theenumerate
package.
– daleif
23 mins ago
add a comment |
up vote
3
down vote
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
1 hour ago
The approach is global but you can make it local of course for example by wrapping the two lines in azut
macro (add a%
at end of first line) and the usebegin{enumerate}zut
... or better define some other environment wrappingenumerate
and insert there the two lines.
– jfbu
54 mins ago
Butenumitem
is a useful package and I trust (although I never really looked) you can get with it most if not all ofenumerate
functionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– jfbu
51 mins 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',
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
});
}
});
JSchoone is a new contributor. Be nice, and check out our Code of Conduct.
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
up vote
6
down vote
accepted
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
1 hour ago
@JSchoone if you loadenumitem
with theshortlabels
option, then it covers all of the syntax features from theenumerate
package.
– daleif
23 mins ago
add a comment |
up vote
6
down vote
accepted
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
1 hour ago
@JSchoone if you loadenumitem
with theshortlabels
option, then it covers all of the syntax features from theenumerate
package.
– daleif
23 mins ago
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
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 2 hours ago
Ulrike Fischer
184k7289666
184k7289666
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
1 hour ago
@JSchoone if you loadenumitem
with theshortlabels
option, then it covers all of the syntax features from theenumerate
package.
– daleif
23 mins ago
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
1 hour ago
@JSchoone if you loadenumitem
with theshortlabels
option, then it covers all of the syntax features from theenumerate
package.
– daleif
23 mins ago
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
1 hour ago
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
1 hour ago
@JSchoone if you load
enumitem
with the shortlabels
option, then it covers all of the syntax features from the enumerate
package.– daleif
23 mins ago
@JSchoone if you load
enumitem
with the shortlabels
option, then it covers all of the syntax features from the enumerate
package.– daleif
23 mins ago
add a comment |
up vote
3
down vote
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
1 hour ago
The approach is global but you can make it local of course for example by wrapping the two lines in azut
macro (add a%
at end of first line) and the usebegin{enumerate}zut
... or better define some other environment wrappingenumerate
and insert there the two lines.
– jfbu
54 mins ago
Butenumitem
is a useful package and I trust (although I never really looked) you can get with it most if not all ofenumerate
functionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– jfbu
51 mins ago
add a comment |
up vote
3
down vote
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
1 hour ago
The approach is global but you can make it local of course for example by wrapping the two lines in azut
macro (add a%
at end of first line) and the usebegin{enumerate}zut
... or better define some other environment wrappingenumerate
and insert there the two lines.
– jfbu
54 mins ago
Butenumitem
is a useful package and I trust (although I never really looked) you can get with it most if not all ofenumerate
functionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– jfbu
51 mins ago
add a comment |
up vote
3
down vote
up vote
3
down vote
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 1 hour ago
jfbu
45.8k65147
45.8k65147
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
1 hour ago
The approach is global but you can make it local of course for example by wrapping the two lines in azut
macro (add a%
at end of first line) and the usebegin{enumerate}zut
... or better define some other environment wrappingenumerate
and insert there the two lines.
– jfbu
54 mins ago
Butenumitem
is a useful package and I trust (although I never really looked) you can get with it most if not all ofenumerate
functionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– jfbu
51 mins ago
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
1 hour ago
The approach is global but you can make it local of course for example by wrapping the two lines in azut
macro (add a%
at end of first line) and the usebegin{enumerate}zut
... or better define some other environment wrappingenumerate
and insert there the two lines.
– jfbu
54 mins ago
Butenumitem
is a useful package and I trust (although I never really looked) you can get with it most if not all ofenumerate
functionality. (hence I of course +1ed Ulrike's answer and find it the better one)
– jfbu
51 mins ago
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
1 hour ago
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
1 hour ago
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.– jfbu
54 mins ago
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.– jfbu
54 mins ago
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)– jfbu
51 mins ago
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)– jfbu
51 mins ago
add a comment |
JSchoone is a new contributor. Be nice, and check out our Code of Conduct.
JSchoone is a new contributor. Be nice, and check out our Code of Conduct.
JSchoone is a new contributor. Be nice, and check out our Code of Conduct.
JSchoone is a new contributor. Be nice, and check out our Code of Conduct.
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%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
3 hours ago
In general it's probably better to use
thechapter
rather thanarabic{chapter}
.– Werner
1 hour ago