TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the following example i labeled each subeqnation.

\begin{subequations}
  \begin{gather}
    R_0 = 0 \label{subeqn:ini-cond-r}  \\
    N_0 = 0 \label{subeqn:ini-cond-n}
  \end{gather}
\end{subequations}

then i could give as reference each equation separately.

What i would like to have, assuming the subequation numbers are 1.1a and 1.1b, is a reference to 1.1 or somehow that LaTeX will show the number 1.1 (It would be nice a solution with hyperref, since i already use it in my work)

share|improve this question

You can set an extra label inside the environment subequations but outside the inner math environment. So you will get reference to the parent counter.

\listfiles
\documentclass{report}
\usepackage{amsmath}
\begin{document}
\chapter{foo}
\begin{equation}
A_0=1
\end{equation}

\begin{subequations}
  \label{foo}
  \begin{gather}
    R_0 = 0 \label{subeqn:ini-cond-r}  \\
    N_0 = 0 \label{subeqn:ini-cond-n}
  \end{gather}
\end{subequations}

\begin{equation}
A_0=1
\end{equation}

\eqref{subeqn:ini-cond-r} and \eqref{subeqn:ini-cond-n} and \eqref{foo}
\end{document}

enter image description here

share|improve this answer
    
This method does not work if I want to reference only the main equation without ever referencing sub equations when using hyperref package. – Vlad Mar 10 at 11:54

You can put another label to subequations environment.

\begin{subequations}\label{refertothis}
  \begin{gather}
    R_0 = 0 \label{subeqn:ini-cond-r}  \\
    N_0 = 0 \label{subeqn:ini-cond-n}
  \end{gather}
\end{subequations}

Then, you can refer to the equation set via \eqref{refertothis}.

share|improve this answer
    
This method does not work if I want to reference only the main equation without ever referencing sub equations when using hyperref package. – Vlad Mar 10 at 11:55
    
@Vlad What do you mean by hyperref package? Did you try \eqref{refertothis} ? – percusse Mar 10 at 13:17

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.