GeneralReduce the space between the text and equation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Reduce the space between the text and equation

Post by curiouslearn »

The denizens of this great forum,

I want to reduce the space between text and a multiline equation following it. I am using the setspace package and I need doublespacing for the text. It seems that with the \doublespacing command, the \vspace{-2ex} or so does not work. The following is a minimum working example.

Thanks for your help.

Code: Select all

\documentclass[12pt]{article}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mdwlist}
\usepackage{natbib}
\usepackage{showkeys} %To see labels (of equations, proof and lemma numbers) when working on a draft.
\usepackage{paralist}% Package that allows different types of lists such as in paragraph lists.
\usepackage{pdfsync}
\usepackage{setspace}
\usepackage[margin=1in,left=1.2in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[charter]{mathdesign}
\def\sm{\scriptscriptstyle}
\usepackage{tikz}

\begin{document}
 \doublespacing    

	We need to decrease the space between this line and the one below. With the doublespacing in the text it seems the vspace command is ineffective.
	\begin{multline}
		\Pr(\text{D appeal|D loss})  = \\ \frac{ r t_{10} F_{\sm D}(EG_{\sm D}^{\sm 0} + (a_{00} - a_{01}) \delta_{0} (\Delta H) ) + (1-r) t_{11} F_{\sm D}(EG_{\sm D}^{\sm 1} + (a_{00} - a_{01}) \delta_{1} (\Delta H)) }{ r t_{10} + (1-r) t_{11} }  
	\end{multline}
  This is the text following the equation. The space here is okay. It is the one before the  equation that I want to reduce.

\end{document}             
When I insert \vspace{-1ex} between the line ending with the word "ineffective." and the line starting with "\begin{multline}", the spacing does not change.

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Reduce the space between the text and equation

Post by gmedina »

Hi,

the rubber lengths \abovedisplayskip and \belowdisplayskip control the vertical spaces before and after a display environment, resp. For your document settings they both have a value of 12.0pt plus 3.0pt minus 7.0pt.

You could try something like

Code: Select all

\setlength\abovedisplayskip{0pt}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Reduce the space between the text and equation

Post by curiouslearn »

Thanks gmedina. That worked very well. I have two questions:

(1) If I write the \setlength{\abovedisplayskip}{xpt}, does that give me the space between two text lines plus xpts? With 0pt, there is some space, and visually it seems that the space is the same as that between two text lines.
(2) If I enter the \setlength{\abovedisplayskip}{xpt} command in the middle of the document, but then want to change back again to the default, after a few lines, do I have to manually enter the measurements, 12.0pt plus 3.0pt minus 7.0pt, in a new \setlength command or is there another option?

gmedina, how did you figure out what the settings were in my document?

Thanks again. I appreciate it.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Reduce the space between the text and equation

Post by gmedina »

Hi curiouslearn,
curiouslearn wrote:...
(1) If I write the \setlength{\abovedisplayskip}{xpt}, does that give me the space between two text lines plus xpts?
Yes. You can find a description of those lengths and their similar ones (\abovedisplayshortskip, \belowdisplayshortskip) as well as of the mechanism that TeX uses to build displayed expressions in the excellent book TeX by topic by Victor Eijkhout.

In fact, since those lengths are rubber lengths, I think that using something like 0pt plus 2pt can be a better choice than just a rigid 0pt.
curiouslearn wrote:...(2) If I enter the \setlength{\abovedisplayskip}{xpt} command in the middle of the document, but then want to change back again to the default, after a few lines, do I have to manually enter the measurements, 12.0pt plus 3.0pt minus 7.0pt, in a new \setlength command or is there another option?
That could be an option; however, you can confine the change to a particular locality using the grouping mechanism (also explained in the mentioned book). This can be done, for example, in the following way:

Code: Select all

\begingroup
\setlength\abovedisplayskip{0pt}
   \begin{multline}
  \Pr(\text{D appeal|D loss})  = \\ \frac{ r t_{10} F_{\sm D}(EG_{\sm D}^{\sm 0} + (a_{00} - a_{01}) \delta_{0} (\Delta H) ) + (1-r) t_{11} F_{\sm D}(EG_{\sm D}^{\sm 1} + (a_{00} - a_{01}) \delta_{1} (\Delta H)) }{ r t_{10} + (1-r) t_{11} } 
   \end{multline}
\endgroup
curiouslearn wrote:...
gmedina, how did you figure out what the settings were in my document?
By using the TeX primitive \the. I wrote

Code: Select all

\the\abovedisplayskip \the\abovedisplayskip

in the body of your code to get the values after compilation.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Reduce the space between the text and equation

Post by curiouslearn »

Thanks very much gmedina. This is all new and useful information for me.
Post Reply