Reference with entire number in enumerate











up vote
2
down vote

favorite
2












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.










share|improve this question







New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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















up vote
2
down vote

favorite
2












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.










share|improve this question







New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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













up vote
2
down vote

favorite
2









up vote
2
down vote

favorite
2






2





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.










share|improve this question







New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question







New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









JSchoone

1133




1133




New contributor




JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






JSchoone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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


















  • 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
















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










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}


enter image description here






share|improve this answer





















  • 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


















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}


enter image description here






share|improve this answer





















  • 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










  • 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













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.










draft saved

draft discarded


















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}


enter image description here






share|improve this answer





















  • 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















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}


enter image description here






share|improve this answer





















  • 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













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}


enter image description here






share|improve this answer












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}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










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 load enumitem with the shortlabels option, then it covers all of the syntax features from the enumerate 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












  • @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
















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










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}


enter image description here






share|improve this answer





















  • 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










  • 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

















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}


enter image description here






share|improve this answer





















  • 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










  • 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















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}


enter image description here






share|improve this answer












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}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










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 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




















  • 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










  • 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


















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












JSchoone is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

What visual should I use to simply compare current year value vs last year in Power BI desktop

How to ignore python UserWarning in pytest?

Alexandru Averescu