TeX - LaTeX Asked on March 20, 2021
If I have subequations (1a) and (1b), then when I reference them using cref
I would like them to be typeset as (1a,b), but by default they appear as (1a) and (1b). How do I change this?
MWE:
documentclass{article}
usepackage{amsmath}
usepackage[hidelinks]{hyperref}
usepackage[compress]{cleveref}
crefrangelabelformat{equation}{(#3#1#4--#5crefstripprefix{#1}#2#6)}
begin{document}
begin{subequations}
begin{align}
a&=b label{eqn:1a}
c&=d label{eqn:1b}
e&=f label{eqn:1c}
end{align}
end{subequations}
begin{equation}
x=y label{eqn:2}
end{equation}
Reference to the trio of equations works correctly as a range: `cref{eqn:1a,eqn:1b,eqn:1c}',
but reference to a pair yields `cref{eqn:1a,eqn:1b}' when I want `eqs. (1a,b)'. In addition,
I would like `cref{eqn:1a,eqn:1b,eqn:2}' to appear as 'eqs. (1a,b) and (2)'.
end{document}
The cleveref
package offers a low-level macro called crefrangelabelformat
, but it doesn't offer a macro called crefpairlabelformat
. Hence, as you've discovered, cref{eqn:1a,eqn:1b}
uses the simple conjunction "and".
Short of contacting the author and maintainer of the cleveref
package and asking him to create a macro called crefpairlabelformat
for you, you could (almost -- with an en-dash in place of a comma) obtain the desired output format when cross-referencing a pair of (sub)equations by typing
crefrange{eqn:1a}{eqn:1b}
Similarly, you could input crefrange{eqn:1a}{eqn:1b} and labelcref{eqn:2}
to obtain eqs. (1a--b) and (2)
.
Answered by Mico on March 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP