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.

Suppose I have the following code

\begin{subequations} 
\begin{align}
a+b = c \label{eq.1}\\ 
d+e = f \label{eq.2}
\end{align}
\end{subequations}

I want now that upon giving the reference, it should appear as (1a-b). \eqref{eq.1} and \eqref{eq.2} will give output as 1a and 1b not what I want, which is (1a-b).

share|improve this question
1  
Is this a convention you need to observe? Because it goes very much against the customs of scientific publications, AFAIK, and makes the document very hard to read. –  Stephan Lehmke Aug 31 '12 at 16:52
add comment

1 Answer

I don't think it's a very good idea. However, this is how you can do it:

\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\globallabel}[1]{%
  \protected@edef\@currentlabel{\theparentequation a--\alph{equation}}\label{#1}%
}
\makeatother
\begin{document}
\begin{subequations}
\begin{align}
a+b = c \label{eq.1}\\
d+e = f \label{eq.2}
\end{align}
\globallabel{eq}
\end{subequations}

\eqref{eq}

\end{document}

The \eqref command will print

(1a-b)

share|improve this answer
add comment

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.