Tell me more ×
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.

I have a document using subequations and the parskip package. If the paragraph before a subequations environment is completely filled up to the last line, then additional vertical whitespace is introduced between this paragraph and the following subequations. I guess this is a bug, but I'm not sure, nor do I have enough TeX knowledge to try and fix it. How can I fix this whitespace issue?

Below is a MWE which shows the behaviour, at least on LaTeX2e <2003/12/01> with pdfeTeX 3.141592-1.21a-2.2 (unfortunately on this machine only an old tetex distribution is installed).

\documentclass[a4paper,11pt]{article}

\usepackage{parskip}
\usepackage{amsmath}

\begin{document}

The subequations environment provides a convenient way to number a foos
\begin{subequations}\label{foo}
  \begin{align}
    x^2 + y^2 &= z^2\\
    a &= b + c
  \end{align}
\end{subequations}

\end{document}
share|improve this question
parskip does not seem to have anything to do with it. Remove it and insert a \noindent before the first line and you will get the same result. – daleif Aug 31 '11 at 8:11

3 Answers

up vote 2 down vote accepted

The problem is that the space after foos does not disappear at the line break, because of the \begin{subequations} that follows (I don't know exactly why).

Use \begin{subequations} between paragraphs, or say

\usepackage{etoolbox}
\preto\subequations{\ifhmode\unskip\fi}

In daleif's example the problem is the same: a space remains and makes a new line in the paragraph. However a \label there is only for \pageref usage, so it must be attached to a word, otherwise the reference can be off by one.

share|improve this answer
Thanks, this at least fixes the problem. – eldering Aug 31 '11 at 13:51

No idea what on earth is going on here. But here is a simpler example

\documentclass[a4paper,11pt]{article}
\usepackage{amsmath}
\begin{document}
\noindent The subequations environment provides a convenient way to
number a foos%
\label{foo}
\begin{align}
  x^2 + y^2 &= z^2\\
  a &= b + c
\end{align}
\end{document}

remove the % and we are back at your problem.

share|improve this answer
On closer inspection, the problem even occurs without the \noindent as long as the text fills the line. But you were right that it wasn't specific to the parskip package. – eldering Aug 31 '11 at 8:56

Here is an example which shows that the \mbox is in a new line and we get the same vertical space as with no space before the \mbox

\documentclass[a4paper,11pt]{article}
\usepackage{amsmath}
%\usepackage{microtype}
\begin{document}
\noindent The subequations environment provides a convenient way to
number a foos
\mbox{}\rlap{\rule{1pt}{2ex}\rule{0.6\linewidth}{1pt}}
\begin{align}
  x^2 + y^2 &= z^2\\
  a &= b + c
\end{align}
\end{document}

enter image description here

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.