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

subequations, exstra white space before

901 views
Skip to first unread message

Žarko Čučej

unread,
Nov 13, 2002, 6:01:05 PM11/13/02
to
Hi!
For my math I use amsmath and amssymb package. In case like
... some text ...
\begin{subequations}
\begin{align}
... lines of equations ...
\end{align}
\end{subequations}
... some text ...
the equations aren't vertically centered between text. Above equations
arise extra white space, which thickness varies (probably how TeX glues
the content of page) from one to two baselines. If I omit the
subequations environment, extra white space disappear, so I concluded
that it is somewhat linked with subequations environment. Because it
task (to my understanding of it purpose) should be only to change the
numbering rules, I don't know how to solve this problem. Momentary I
minimize this space by putting some negative vertical skip, like
\begin{subequations}\vskip -1em
but this is very annoying solution.

For documentclass I use memoir.

Any tips how to (systematically) eliminate this extra white space would
be
appreciated.

Regards, Zarko

Michael J Downes

unread,
Nov 14, 2002, 8:54:40 AM11/14/02
to
<zarko...@uni-mb.si> writes:

> ... some text ...
> \begin{subequations}
> \begin{align}
> ... lines of equations ...
> \end{align}
> \end{subequations}
> ... some text ...
> the equations aren't vertically centered between text. Above equations
> arise extra white space, which thickness varies (probably how TeX glues
> the content of page) from one to two baselines. If I omit the
> subequations environment, extra white space disappear, so I concluded
> that it is somewhat linked with subequations environment.

The following test file does not show any extra space for me (neither
with article class nor with memoir class). If you are using some extra
packages (perhaps hyperref?) that you did not mention, they might be
causing some kind of interaction problem. Otherwise I think you didn't
include enough information to diagnose the problem. Try posting a
complete example file (taking out any extra material that can be removed
without eliminating the problem).

------------------------------------------------------------------------
\documentclass{article}
\listfiles
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\section*{Subequations test}
One line before the equations:
\begin{subequations}
\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}
And one line after the equations.

\end{document}

Žarko Čučej

unread,
Nov 14, 2002, 12:53:22 PM11/14/02
to

Thank you very much for your answer. I do not use hyperef package. In my
document I use only the following packages:

\documentclass[a4paper,openbib]{memoir}
\usepackage{memfixc}
\usepackage{ifthen,calc,xspace,
amsmath,amssymb,nicefrac,
tabularx,rotating,afterpage,
varioref}
\usepackage[tight]{subfigure}
\usepackage[squaren,textstyle]{SIunits}
\usepackage[outercaption,wide]{sidecap}
\ifpdf
\usepackage[pdftex]{color,colortbl}
\else
\usepackage[dvips]{color,colortbl}
\fi
\usepackage{graphicx}
\usepackage[multiple]{footmisc}
%
\usepackage[amsmath,thref,thmmarks]{ntheorem}
\theoremsymbol{\ensuremath{\scriptstyle\blacksquare}}
\theoremstyle{break}
\theoremseparator{\hfill}
\theoremheaderfont{\bfseries\sffamily}
\theorembodyfont{\sffamily\small}
\newtheorem{theorem}{IZREK}[chapter]
\newtheorem{definition}{DEFINICIJA}[chapter]
\theoremsymbol{\ensuremath{\scriptstyle\square}}
\newtheorem{proof}{DOKAZ}[chapter]
\theoremsymbol{\ensuremath{\scriptstyle\lozenge}}
\newcounter{primer}
\newtheorem{example}{ZGLED}[chapter]

I repeat your test with all my packaes listed above and see that with
this simple test I cannot reproduce the problem of extra white space.
Well, in my document in preamble I also costumize memoir package for my
needs -- I determine paper triming size, headers layout, chapter and
section headers layout, captions, ... I tested your simple test again
with all those my layout definition I can't reproduce the problem.

But in my document described behaviour regualarly persist. Only
differences between this simple test and my document I see in fact, that
my document (book) has lot of equations, figures, minipages and also
sideway table. I guess now, that maybe this relative complicated
construction of book have a some influence on occurence of extra space.

What to do?

Regards, Zarko

Michael J Downes

unread,
Nov 15, 2002, 2:31:55 PM11/15/02
to
<zarko...@uni-mb.si> writes:

> But in my document described behaviour regualarly persist. Only
> differences between this simple test and my document I see in fact, that
> my document (book) has lot of equations, figures, minipages and also
> sideway table. I guess now, that maybe this relative complicated
> construction of book have a some influence on occurence of extra space.
>
> What to do?

What comes before the \begin{subequations}?

If you send some selected material (three or four paragraphs) to
tech-s...@ams.org we could take a look and see if there's anything
that appears to be a likely suspect. Try to take the material from the
first instance where the problem occurs.

Did you know that some puzzling problems of vertical spacing can be
eliminated by using the \raggedbottom command? But I don't know if that
is relevant in this case.

Žarko Čučej

unread,
Nov 18, 2002, 7:46:22 AM11/18/02
to


I think that I found the cause of my problems. After carefully
inspection of my book, I discover that this extra white space arises
regularly in the case, if subequations environment is labeled, like in
following example:

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}

\section*{Subequations test}
One line before the equations:

\begin{subequations}\label{subequations1}


\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}
And one line after the equations.

\end{document}
In the case, when I omit the label, extra white space disappears, as
both of us have been confirmed. I also discover, if exist some text
between \begin{subequation} and \begin{align}, extra space between this
text and math expressions also disappear, but before this text is
asserted about half of baselineskip thick white space. This text is also
appearing intended.

I know for \raggedbottom command. I also try to use it, but it doesn't
give any improvement, so I'm pretty sure that this behavior of labeled
subequations environment probably is a bug. Since it is now clearly
encounter, I thing that now is not necessary anymore to send a part of
my files to see what going on. Anyway, thank you very much for your
offer for help.

Because in many cases I need labels for referencing a whole subequations
environment, some solution would be much appreciated.

I like to apologue myself, if I wasn't clear enough in the first
message. Simply I didn't expect, that labeling my have any influence on
Tex formatting rules.


Regards, Zarko

Donald Arseneau

unread,
Nov 18, 2002, 11:39:54 PM11/18/02
to
®arko Čučej <zarko...@uni-mb.si> writes:

> I think that I found the cause of my problems. After carefully
> inspection of my book, I discover that this extra white space arises
> regularly in the case, if subequations environment is labeled, like in
> following example:
>

> One line before the equations:
> \begin{subequations}\label{subequations1}
> \begin{align}

I see just a slight visual asymmetry, but it is the same for the case
without subequations.

I have a theory that it may happen *irregularly* and only when the
line of text above is full, un which case the label might end up
on a (blank) line by itself.

Donald Arseneau as...@triumf.ca

Žarko Čučej

unread,
Nov 19, 2002, 5:05:42 AM11/19/02
to

Donald Arseneau wrote:

>
> Žarko Čučej <zarko...@uni-mb.si> writes:
>
> > I think that I found the cause of my problems. After carefully
> > inspection of my book, I discover that this extra white space arises
> > regularly in the case, if subequations environment is labeled, like in
> > following example:
> >
> > One line before the equations:
> > \begin{subequations}\label{subequations1}
> > \begin{align}
>
> I see just a slight visual asymmetry, but it is the same for the case
> without subequations.


Sorry, sorry! In the my last e-mail I rush too much and I was not
carefully enough. Actually, my minimal example at home contain in
preamble the ntheorem package (my test file is listed below). With it
the extra vertical space arises ''regularly''. Meaning, that some my
previous conclusion should be corrected. It seems, that described
problem doesn't appear in the all cases, but it is somewhat connected
with the package ntheorem.


> I have a theory that it may happen *irregularly* and only when the
> line of text above is full, un which case the label might end up
> on a (blank) line by itself.

This is also happen in my experiments even if the ntheorem package was
not in use.

> Donald Arseneau as...@triumf.ca

I like to apologize again. Regards Zarko

my test file (now litle longer):

\documentclass{article}% the same result is obtained with memoir
documentclass
\usepackage{ifthen,calc,xspace,
amsmath,amssymb,nicefrac,
tabularx,rotating,afterpage,varioref}

\usepackage[amsmath,thref,thmmarks]{ntheorem}
\theoremsymbol{\ensuremath{\scriptstyle\blacksquare}}
\theoremstyle{break}
\theoremseparator{\hfill}
\theoremheaderfont{\bfseries\sffamily}
\theorembodyfont{\sffamily\small}

\newtheorem{theorem}{IZREK}[section]
\newtheorem{definition}{DEFINICIJA}[section]
\theoremsymbol{\ensuremath{\scriptstyle\square}}
\newtheorem{proof}{DOKAZ}[section]


\theoremsymbol{\ensuremath{\scriptstyle\lozenge}}
\newcounter{primer}

\newtheorem{primer}{ZGLED}[section]


\begin{document}

\section*{Subequations test}
One line before the equations without labeling subequations
environment:
\begin{subequations}


\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}

And some lines after the equations. And some lines after the
equations. And some lines after the equations.

The problem arise, if you put a label to subequations environment:
\begin{subequations}\label{test1}


\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}

And one line after the equations with referencing above
subequations \eqref{test1}...

One line before the equations without labeling subequations
environment:
\begin{subequations}


\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}

And one line after the equations without referencing ...

The problem arise again , if you put a label to subequations
environment:
\begin{subequations}\label{test2}


\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}

And one line after the equations with referencing above
subequations \eqref{test2}...

One line before the equations without labeling subequations
environment:
\begin{subequations}


\begin{align}
a&=b+c-d\\
y&=f(x)+\gamma\sqrt{c^e+1}
\end{align}
\end{subequations}

And one line after the equations without referencing ...

\end{document}

Dan Luecking

unread,
Nov 19, 2002, 2:39:51 PM11/19/02
to
On Tue, 19 Nov 2002 11:05:42 +0100, ®arko Čučej <zarko...@uni-mb.si>
wrote:

>
>Donald Arseneau wrote:


>>
>> ®arko Čučej <zarko...@uni-mb.si> writes:
>>
>> > I think that I found the cause of my problems. After carefully
>> > inspection of my book, I discover that this extra white space arises
>> > regularly in the case, if subequations environment is labeled, like in
>> > following example:
>> >
>> > One line before the equations:
>> > \begin{subequations}\label{subequations1}
>> > \begin{align}
>>
>> I see just a slight visual asymmetry, but it is the same for the case
>> without subequations.
>
>
>Sorry, sorry! In the my last e-mail I rush too much and I was not
>carefully enough. Actually, my minimal example at home contain in
>preamble the ntheorem package (my test file is listed below). With it
>the extra vertical space arises ''regularly''.

ntheorem redefines \label, giving it an optional argument. I don't know
what the redefinition is supposed to do, but supplying an optional
argument corrects this problem. For example, \label{test1}[none]

Perhaps an expert can comment on what this code is supposed to do.
When \label has no optional argument, it executes these commands before
an after the rest of its code:
\gdef\@bbsphack{%
\ifvmode\else\mysavskip\lastskip
\unskip\fi}
\gdef\@eesphack{%
\ifdim\mysavskip>\z@
\vskip\mysavskip \else\fi}
This would seem to save (and remove the preceeding horizontal
space and replace it with the corresponding vertical space. The
primitive command \vskip starts a new paragraph. This seems like
an error to me, and changing the \vskip to \hskip works in simple
tests. But why were LaTeX's \@bsphack and \@esphack rejected in
the first place?


Dan

--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701

Žarko Čučej

unread,
Nov 19, 2002, 5:45:26 PM11/19/02
to
Dan Luecking wrote:
>
> On Tue, 19 Nov 2002 11:05:42 +0100, Žarko Čučej <zarko...@uni-mb.si>

Thank you very much. I fix my problem with puting your code (with
changed \vskip to \hskip) in preamble after ntheorem package. First test
shows, that it eliminate the problem with extra space. Thank you again!

Regards, Zarko

Donald Arseneau

unread,
Nov 21, 2002, 5:23:42 AM11/21/02
to
Dan Luecking <luec...@uark.edu> writes:
> \gdef\@bbsphack{%
> \ifvmode\else\mysavskip\lastskip
> \unskip\fi}
> \gdef\@eesphack{%
> \ifdim\mysavskip>\z@
> \vskip\mysavskip \else\fi}

Yes, clearly a bug. I don't know the intent. And why is ntheorem
changing the usage of \label anyway?

Donald Arseneau as...@triumf.ca

Dan Luecking

unread,
Nov 21, 2002, 1:49:37 PM11/21/02
to

It adds an optional argument so that after
\label{xx}[Gedanke]
you can say \thref{xx} and get "Gedanke~2.718" instead of just "2.718".

Though why the code without the optional argument (the buggy one)
is different from the code with one, I cannot say. One would
think the only difference should be purely in the difference between
that argument and the default.

0 new messages