GeneralEmpty line with align*

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Empty line with align*

Post by avp3000 »

Hello,

I have noticed that when I replace equation* with align* an empty line appears between the last text row and the actual equation. With equation*-environment, the equation is displayed right after the text. Is there a way to suppress the empty line with align*?

Thank you,
Alexander

P.S. I could provide an example as well, but if you know a general rule, I don't want to waste your time with the a long mathematical equation.

Recommended reading 2024:

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

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

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

Re: Empty line with align*

Post by Stefan Kottwitz »

Hi Alexander,

probably that's caused by a paragraph break before the math environment. Don't leave an empty line before or after displayed math environments, that would result in bad spacing. With align* it's good to see, but also with equation* you could notice a different spacing before/after if you set empty lines before/after the environment or not.

Stefan
LaTeX.org admin
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Re: Empty line with align*

Post by avp3000 »

Hello Stefan,

Thank you for the advice. I would like to reformulate my question now - How can I omit an empty line before and after an align* environment or say the center environment. I very often don't need this extra line before and after it.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Empty line with align*

Post by Stefan Kottwitz »

Hi Alexander,

what I meant was suppressing the additional empty "line" before align* that's caused by an empty source code line before \begin{align*}. Some spacing is common, also before and after equation*. You can remove this space by setting lengths like \abovedisplayskip etc. to 0pt. Have a look at this example:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{amsmath}
\begin{document}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\blindtext
\begin{equation*}
   x + y = z
\end{equation*}
\blindtext
\begin{align*}
   x + x = z
\end{align*}
\blindtext
\end{document}
The center environment is a different issue. It creates a list internally. You can avoid the additional space by using \centering like

Code: Select all

{\centering text\par}
Stefan
LaTeX.org admin
Post Reply