Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

amsmath's gather, fleqn, leqno, and chapter produce unwanted newline

21 views
Skip to first unread message

Joshua Taylor

unread,
Nov 10, 2010, 11:28:34 AM11/10/10
to
Hello all, I'm using the amsmath package's gather environment in a
document using the report document class along with the fleqn and leqno
options. By default, the equations are numbered within the chapter (so
the first equation in chapter 1 is numbered 1.1, &c). It appears that
these equation numbers are too wide for the gather environment, and so
equations are pushed onto the line after their number. E.g., before the
first \chapter, the an equation and and a gather environment produce
output like the following.

(1) a = b % \begin{gather} a = b \end{gather}
(2) a = b % \begin{eqnarray} a = b \end{eqnarray}

After the first \chapter, though, I get this:

(1.1) % \begin{gather} a = b \end{gather}
a = b
(1.2) a = b % \begin{equation} a = b \end{equation}

I imagine there's probably some value I can set so this won't happen,
but I don't know what it is. Has anyone else run into this and found a
solution? I think someone may have run into this before [1], but the OP
in that thread didn't provide an example, and it doesn't appear any
solution was found. Here's an MWE that demonstrates this issue:

\documentclass[leqno,fleqn]{report}
\usepackage{amsmath}
\begin{document}
% (1) a = b
% (2) a = b
\begin{gather} a = b \end{gather}
\begin{eqnarray} a = b \end{eqnarray}
\chapter{X}
% (1.1)
% a = b
% (1.2) a = b
\begin{gather} a = b \end{gather}
\begin{equation} a = b \end{equation}
\end{document}

Many thanks,
Joshua Taylor

[1]
http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2006-02/msg00043.html

Enrico Gregorio

unread,
Nov 10, 2010, 12:05:43 PM11/10/10
to
Joshua Taylor <tay...@cs.rpi.edu> wrote:

Never use eqnarray, nor equation just after gather, which doesn't
make sense.

In order to solve your problem, set \mathindent to a more sensible
value, such as

\setlength{\mathindent}{3em minus 2em}

Do this in the preamble.

Ciao
Enrico

Joshua Taylor

unread,
Nov 10, 2010, 12:28:43 PM11/10/10
to
On 2010.11.10 12:05 PM, Enrico Gregorio wrote:
> Never use eqnarray, nor equation just after gather, which doesn't
> make sense.

The eqnarray was an accidentally worked its way in, while I was trying
to determine what environments were affected; good catch. I normally
wouldn't be juxtaposing these sorts of environments, except that I was
trying to produce a /minimal/ portion of code. But I agree on both counts.

> In order to solve your problem, set \mathindent to a more sensible
> value, such as
>
> \setlength{\mathindent}{3em minus 2em}

This is exactly what I needed. Many thanks!

Joshua Taylor

P.S., For the same of anyone finding this thread in the archives,
\mathindent isn't defined when the fleqn option isn't used. I ran into
this when I the solution `broke' my working document. What actually
happened is that I'd removed fleqn from my working document for the time
being, and needed to add it back, too.

0 new messages