TeX - LaTeX Asked by GioMott on January 25, 2021
I have a list of equations that I want to reference all grouped together in the same pair of parentheses (…). How should I proceed? I am aware of the cleveref
package, which does indeed group equations together, but (as far as I can tell) not within the same parentheses.
Minimum working example:
documentclass{article}
usepackage{amsmath}
usepackage{cleveref}
usepackage[parfill]{parskip}
begin{document}
First equation:
begin{equation}
label{1}
E=mc^2
end{equation}
Second equation:
begin{equation}
label{2}
e^{i pi}+1=0
end{equation}
Third equation:
begin{equation}
label{3}
a^n+b^n=c^n
end{equation}
Reference with texttt{eqref}: Eqs. eqref{1}, eqref{2}, eqref{3}
Reference with texttt{cleveref}: cref{1,2,3}
Again with texttt{cleveref}: labelcref{1,2,3}
What I actually want: Eqs. (1,2,3)
end{document}
I am also interested in how to obtain "Eqs (1-5)" ...
Here's how to generate "Eqs (1-5)" with the help of the machinery of the cleveref
package. I'm afraid I don't know how to generate "Eqs (1,2,3,4,5)".
documentclass{article}
usepackage{cleveref}
crefname{equation}{Eq}{Eqs} % capitalize "E", no period
crefrangelabelformat{equation}{(#3#1#4--#5#2#6)}
begin{document}
cref{eq1,eq2,eq3,eq4,eq5}. crefrange{eq1}{eq5}.
% Five equation-related label directives:
refstepcounter{equation} label{eq1}
refstepcounter{equation} label{eq2}
refstepcounter{equation} label{eq3}
refstepcounter{equation} label{eq4}
refstepcounter{equation} label{eq5}
end{document}
Correct answer by Mico on January 25, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP