Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I try to refer to the parent number of subequations with \cref from the cleveref package. However, I would like to change the output "eq. (...)" into "eqs. (...)" when I refer to parent numbers instead of individual equation numbers. Unfortunately, this does not seem to be implemented by default, or at least there is no \crefformat{parentequation} or \crefformat{subequation} available.

A short example:

\documentclass{article}

\usepackage{amsmath}
\usepackage{cleveref}

\crefformat{equation}{#2eq.~(#1)#3}
\Crefformat{equation}{#2Eq.~(#1)#3}

\begin{document}

\begin{subequations} \label{parenteq}
\begin{align}
  x + y = z \label{subeq1} \\
  a + b = c \label{subeq2} 
\end{align}
\end{subequations}

\Cref{parenteq} consist of \cref{subeq1} and \cref{subeq2}.

\end{document}

I would like to see the output

Eqs. (1) consist of eq. (1a) and eq. (1b).

instead of

Eq. (1) consist of eq. (1a) and eq. (1b).

share|improve this question
    
Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code as I did in my edit. –  doncherry Nov 22 '11 at 14:20

1 Answer 1

As a workaround you may define a plural equation label:

\documentclass{article}

\usepackage{amsmath}
\usepackage{cleveref}

\crefname{pluralequation}{eqs.}{eqs.}
\Crefname{pluralequation}{Eqs.}{Eqs.}

\crefformat{equation}{#2eq.~(#1)#3}
\Crefformat{equation}{#2Eq.~(#1)#3}

\begin{document}

\begin{subequations} \label{parenteq}\label[pluralequation]{parenteqs}
\begin{align}
  x + y = z \label{subeq1} \\
  a + b = c \label{subeq2} 
\end{align}
\end{subequations}

\Cref{parenteqs} consist of \cref{subeq1} and \cref{subeq2}.

\end{document}

If \crefname is not enough, you may use \crefformat and \Crefformat to define a pluralequation format in the same kind you've done with equation, e.g.;

\crefformat{pluralequation}{#2eqs.~(#1)#3}
\Crefformat{pluralequation}{#2Eqs.~(#1)#3}
share|improve this answer
    
Is it also possible to include the parenthesis '( )' into the output? \crefname does not seem to accept arguments like \crefformat does. –  Patrick G. Nov 22 '11 at 17:36
    
@Patrick G.: You may use \crefformat to define a format of pluralequation, e.g. \Crefformat{pluralequation}{#2Eqs. (#1)#3}. See my change above. –  Schweinebacke Nov 22 '11 at 17:45
    
This works. Do you use the label \label{parenteq} twice on purpose? I think I dont understand how your workaround is supposed to function. –  Patrick G. Nov 22 '11 at 18:14
    
@Patrick G.: If used two different labels parenteq and parenteqs. So you can still reference the singular with \cref{parenteq}. BTW: Using a plural format has been described at the cleveref manual even. –  Schweinebacke Nov 22 '11 at 18:36
    
Oh well, it seems to work anyway! –  Patrick G. Nov 22 '11 at 19:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.