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.

I try to decrease the \abovedisplayskip and \belowdisplayskip to 3pt for save paper while equation including "large" math formulas has less sep between surrounding text than "normal" math formulas, see pic. Is it impossible to set the vertical sep to be equal?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\setlength\abovedisplayskip{3pt}
\setlength\belowdisplayskip{3pt}
Some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text
\begin{euqation*}
\sum_{n=1}^{\infty}a_n+\sum_{n=1}^{\infty}b_n=\sum_{n=1}^{\infty}c_n
\end{euqation*}
some text some text some text some text some text some text some text
\begin{euqation*}a_n+b_n=c_n\end{euqation*}
some text some text some text some text some text
\end{document}

maybe related to A equation skip problem (amsmath package and \above/belowdisplayskip)

Example

share|improve this question
1  
Welcome to TeX.sx! Please make sure that all images are uploaded using the official stackexchange interface, i.e. the image icon on top of the text field (shortcut: CTRL+G). This ensures that all images are always accessible and do not expire. I reuploaded the image for you now. –  Martin Scharrer Jun 28 '11 at 9:35

2 Answers 2

up vote 1 down vote accepted

Use my macro \constskip every time after \end{equation*}

\def\constskip{\par\hrule height 0pt \vskip -\ht\strutbox \vskip 1ex \noindent\strut}


\hsize = .7\textwidth
Some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text
\begin{equation*}
\sum_{n=1}^{\infty}a_n+\sum_{n=1}^{\infty}b_n=\sum_{n=1}^{\infty}c_n
\end{equation*}\constskip
some text some text some text some text some text
\begin{equation*}
a_n+b_n=c_n
\end{equation*}\constskip
some text some text some text some text some text
\begin{equation*}
a + b + w + e + t + u = c
\end{equation*}\constskip
some text some text some text some text some text

Const skip

Edit: double const skip

Add \aconstskip everywhere before equation.

\def\constskip{\par\hrule height 0pt \vskip -\ht\strutbox \vskip 1ex 
    \noindent\vrule width 0pt height \ht\strutbox}

\def\aconstskip{\par\hrule height 0pt \nobreak\vskip -\baselineskip
   \noindent \hbox to \hsize{\hfill \vrule width 0pt depth \baselineskip}}

\abovedisplayskip = 4pt
\belowdisplayskip = 5pt


\hsize = .7\textwidth
Some text some text some text some text some text
some text some text some text some text some text
some text some text some text some text
\aconstskip\begin{equation*}
\sum_{n=1}^{\infty}a_n+\sum_{n=1}^{\infty}b_n=\sum_{n=1}^{\infty}c_n
\end{equation*}\constskip
some text some text some text some text some text
\aconstskip\begin{equation*}
a_n+b_n=c_n
\end{equation*}\constskip
some text some text some text some text some text
\aconstskip\begin{equation*}
a + c + w + e + s + u = c
\end{equation*}\constskip
some text some text some text some text some text

enter image description here

share|improve this answer
    
Thank you. But, how to deal with the sep between the formula and the text above? –  gerx348 Jun 28 '11 at 15:55
    
@gerx348. Done. Look my additions. –  Alexey Malistov Jun 29 '11 at 12:56
    
Great! Thanks a lot! –  gerx348 Jun 29 '11 at 13:32

In this case, if you use \showboxbreadth=\maxdimen \showboxdepth=3 \tracingoutput=1 \tracingonline=1 and look at the output from LaTeX, you'll see

\vbox(633.0+0.0)x407.0
    ........elided.............
..\glue(\lineskip) 0.0
..\vbox(550.0+0.0)x345.0, glue set 453.92645fil
...\write-{}
    .........elided............
...\glue(\abovedisplayskip) 0.0
...\glue(\lineskip) 1.0
...\hbox(16.51393+12.67783)x105.99545, shifted 119.50227, display [] **first equation**
...\penalty 0
...\glue(\belowdisplayskip) 0.0
...\glue(\lineskip) 1.0
     .............elided.........
...\glue(\abovedisplayskip) 0.0
...\glue(\baselineskip) 1.49994
...\hbox(10.50006+5.50006)x71.90155, shifted 136.54922, display [] **second equation**
...\penalty 0
...\glue(\belowdisplayskip) 0.0
...\glue(\baselineskip) 0.34915
     .........elided...........

And you can see that for the first equation, TeX inserts a \lineskip before and after the equation, but for the second equation, it inserts a \baselineskip. I'm not 100% sure about the difference between \lineskip and \baselineskip, but this message says

If TeX determines that the bottom of one line and the top of the next would come closer than \lineskiplimit (default in Plain TeX: 0pt), then it abandons \baselineskip and instead inserts \lineskip between the adjacent lines (not their baselines, but between the bottom of one and the top of the next).

Since your first equation contains a \sum that's taller than \baselineskip, the top of the equation and the bottom of the previous line will touch, so TeX inserts a \lineskip. Below the equation, the top of the next line of text and the bottom of the equation will touch, so again TeX inserts a \lineskip.

Since your second equation is short, the top of its contents and the bottom of the previous line do not touch, so TeX inserts \baselineskip. Likewise, below the equation, the top of the next line and the bottom of the equation do not touch, so again TeX inserts a \baselineskip.

I'm not quite sure how to fix this robustly (@Alexey's answer is a start), but it helps explain why you're seeing different behavior between the two equations.

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.