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.

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

share|improve this question
    
The * in gather was a mistake. It was in the minimal test code –  mjrussell May 2 '12 at 0:16

3 Answers 3

up vote 8 down vote accepted

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

share|improve this answer
    
All the answers were essentially the same, except you called my attention to the fact about subequations and it working in text mode. Thanks –  mjrussell 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.

share|improve this answer

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.

share|improve this answer

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.