17

The following minimal code causes a small indentation at the beginning of the line of text, smaller than the usual indentation at the start of a paragraph. It disappears if the label in subequations is removed.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{subequations}
    \begin{gather}
        a = b\\
        b = c
    \end{gather}
    \label{eqn:test}
\end{subequations}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua \ref{eqn:test}.
\end{document}

I haven't noticed this effect in any other maths environments - is this a bug in subequations?

EDIT: replace gather* with gather

1
  • The * in gather was a mistake. It was in the minimal test code
    – mjr
    Commented May 2, 2012 at 0:16

3 Answers 3

19

subequations only plays around with the equation number and does nothing else. Therefore, placing it as the surrounding environment for gather actually sets it in text mode and leaves a spurious space if you don't end a line with %.

Solution: Insert % at the end of the \label: \label{...}%

1
  • All the answers were essentially the same, except you called my attention to the fact about subequations and it working in text mode. Thanks
    – mjr
    Commented May 2, 2012 at 11:20
10

Put a % after \label{eqn:test}.

\begin{subequations}
    \begin{gather*}
        a = b\\
        b = c
    \end{gather*}
    \label{eqn:test}%             %%<---here
\end{subequations}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua \ref{eqn:test}.

Actually the label should be written before the begin{gather*}. Then the Lorem... will start as a new para as in

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{subequations}
    \label{eqn:test}%
    \begin{gather*}
        a = b\\
        b = c
    \end{gather*}
\end{subequations}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua \ref{eqn:test}.
\end{document}

Note: Using \label to a un-numbered equations doesn't mean anything (starred version does not produce equation number and hence referring to that equation!.....). Use gather instead.

5

The \label is to subequations, so

\begin{subequations}\label{eqn:test}
    \begin{gather}
        a = b\\
        b = c
    \end{gather}
\end{subequations}

won't have spurious spaces. Notice that using subequations with gather* is meaningless: there will be no equation number to reference. You probably mean gather, without *, so each equation in the alignment will receive a subnumber.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .