Text FormattingOne line too much

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

One line too much

Post by Cham »

I need to remove an empty line after an equation, as shown on the picture below. The vertical space is way too much in this case.

I can't give a minimal compilable code example here, since this is occuring in some rare instances only and is unpredictable.

What command should I use to tell LaTeX to remove that empty line ?

Is there an inverse of the \newline command ?
space.jpg
space.jpg (27.66 KiB) Viewed 24630 times

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

One line too much

Post by Stefan Kottwitz »

Cham wrote:Is there an inverse of the \newline command ?
Something like \vspace{-\baselineskip} perhaps. But I would rather fix the actual problem. Do you have an empty line after the formula? Before and after displayed math environments, empty lines, which mean paragraph breaks, should not be used, because the displayed environment already adds its own space.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

One line too much

Post by Cham »

I'm not sure to understand. The code is like this (this is a non-compilable example) :

Code: Select all

Bla bla bla bla bla bla bla :
	\begin{align}
		A &= B \nonumber \\ \nonumber \\
		&= C \nonumber \\ \nonumber \\
		&= D.
	\end{align} % then follows an empty line after compilation
Bla bla bla bla bla bla
	\begin{equation*}
		A = B.
	\end{equation*}
Bla bla bla bla bla bla
EDIT : When a say "empty line", I mean a vertical space which is too large and which looks like an empty line. I just want to reduce it. The \vspace command doesn't remove it, its removing the space after the next line only :(
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

One line too much

Post by Cham »

Here's a compilable example. The spacing problem isn't obvious in this case, though :

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath}
\begin{document}

Bla bla bla bla bla bla bla bla bla :
	\begin{align}
		Axyztuv &= B + x + y \nonumber \\ \nonumber \\
		&\equiv C - 2 + 12 \nonumber \\ \nonumber \\
		&= Dx - y - z.
	\end{align}
Bla bla bla bla
	\begin{equation*}
		Axyz + 3 - y = Buvw.
	\end{equation*}
Bla bla bla bla bla

\end{document}
Now, how can I reduce the vertical space immediately after equation (1), just before the following text line ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

One line too much

Post by Stefan Kottwitz »

You could modify \belowdisplayskip. To keep the change local, use a group or braces. For example:

Code: Select all

\begingroup
\setlength{\belowdisplayskip}{\belowdisplayshortskip}
\begin{align}
...
\end{align}
\endgroup
You could even set it to 0pt or any other value.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: One line too much

Post by Cham »

It doesn't do anything ! Am I missing something ? What about the space parameter ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

One line too much

Post by Stefan Kottwitz »

It works for me with your code:

Code: Select all

\documentclass[12pt,letterpaper]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amsmath}
\begin{document}
Bla bla bla bla bla bla bla bla bla :
\begingroup
\setlength{\belowdisplayskip}{0pt}
        \begin{align}
                Axyztuv &= B + x + y \nonumber \\ \nonumber \\
                &\equiv C - 2 + 12 \nonumber \\ \nonumber \\
                &= Dx - y - z.
        \end{align}
\endgroup
Bla bla bla bla
        \begin{equation*}
                Axyz + 3 - y = Buvw.
        \end{equation*}
Bla bla bla bla bla
\end{document}
Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: One line too much

Post by Cham »

Aah ! Now it's working. I missed the 0pt parameter...

Thanks Stefan.
Post Reply