LyXThe distance bewteen a line and a formula?

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
lyxrocks
Posts: 91
Joined: Sat Oct 23, 2010 5:59 pm

The distance bewteen a line and a formula?

Post by lyxrocks »

There are three kinds of distance between "lines":

1, distance between consecutive lines in the same paragraph.
2, distance between consecutive paragraphs.
3, distance between a line and a displayed formula.

it seems that, under default settings, 3 is always slightly greater than 1. i am interested in knowing how to modify number 3 to make it smaller.

thanks in advance!

edit: notice that i made sure that i am not making the same mistake this time! i made sure that there is no extra lines in between. even so, 3 is still slightly greater than 1!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

The distance bewteen a line and a formula?

Post by Stefan Kottwitz »

Similar to what I wrote in this post, you can adjust those distances in the document's LaTeX preamble. With an example value of 10pt, which you may adjust:

Code: Select all

\expandafter\def\expandafter\normalsize\expandafter{%
    \normalsize
    \setlength\abovedisplayskip{10pt}
    \setlength\belowdisplayskip{10pt}
    \setlength\abovedisplayshortskip{10pt}
    \setlength\belowdisplayshortskip{10pt}
}
It redefines the \normalsize command, which is provided by base classes, and adds the distance modification. Instead of just using \setlength, I modified \normalsize because this originally modifies those lenghts which would change them after \begin{document} and each time the font's size is reset to the normal size by this macro.

Stefan
LaTeX.org admin
lyxrocks
Posts: 91
Joined: Sat Oct 23, 2010 5:59 pm

Re: The distance bewteen a line and a formula?

Post by lyxrocks »

thank you for the quick and effective reply!
Post Reply