# Text following subequations is slightly indented if a label is used

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

-
The * in gather was a mistake. It was in the minimal test code – mjr May 2 '12 at 0:16

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{...}%

-
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 May 2 '12 at 11:20

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.

-

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.

-