Featured Book

LaTeX Beginners Guide

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 6 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Less Space between equations and text

Add tags Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).

Less Space between equations and text

Postby eggmanneo on Thu Sep 29th, 2011

I'm trying to reduce the space between my text and equations. I mainly use the align environment. I tried using the commands
Code: Select all  •  Open in writeLaTeX
\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt
}


In the preamble of my document, but these commands didn't seem to change anything. Below is an outline of my code

Code: Select all  •  Open in writeLaTeX
\documentclass[12pt]{article}
\usepackage{setspace}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{hyperref}
\usepackage[hmargin=1in,vmargin=1in]{geometry}
\doublespacing
\usepackage{times}
\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt}
\DeclareMathOperator* {\Max}{max
}  %in equation mode, this lets you write max wrt choice variables
\usepackage{graphicx}
\def\inputGnumericTable{
}  %spreadsheet program I use to make tables for latex
       \usepackage[latin1]{inputenc}
        \usepackage{color}
       \usepackage{array}
        \usepackage{longtable}
       \usepackage{calc}
       \usepackage{multirow}
       \usepackage{hhline}
       \usepackage{ifthen}

\usepackage{harvard}

\begin{document}

\begin{align} \label{eq:budget}
C_t \leq W_{K,m,t}H_{K,m,t}+W_{K,f,t}H_{K,f,t}+T_{m,t}B_{m,t}+T_{f,t}B_{f,t}+Y_t.
\end{align
}


the \vspace command seemed to work, but I would have to do this for every equation, and sometimes it can be hard to get the spacing exactly right with this command
Last edited by eggmanneo on Thu Sep 29th, 2011, edited 1 time in total.
eggmanneo
 
Posts: 10
Joined: Wed Apr 21st, 2010

Re: Less Space between equations and text

Postby Stefan_K on Thu Sep 29th, 2011

Hi,

\normalsize resets those values, that's why they don't have effect in the preamble. A quick way to force the lengths at the beginning of the document:

Code: Select all  •  Open in writeLaTeX
\AtBeginDocument{%
  \setlength\abovedisplayskip{0pt}
  \setlength\belowdisplayskip{0pt}
}


Or redefine \normalsize, such as for article with base font size 12pt:

Code: Select all  •  Open in writeLaTeX
\renewcommand\normalsize{%
   \@setfontsize\normalsize\@xiipt{14.5}%
   \setlength{\abovedisplayskip}{0pt}
   \setlength{\abovedisplayshortskip}{0pt}
   \setlength{\belowdisplayskip}{0pt}
   \setlength{\belowdisplayshortskip}{0pt}
   \let\@listi\@listI
}
\makeatother


Or if you don't know that macro or the base font size, you could add to \normalsize:

Code: Select all  •  Open in writeLaTeX
\makeatletter
\g@addto@macro{\normalsize}{%
   \setlength{\abovedisplayskip}{0pt}
   \setlength{\abovedisplayshortskip}{0pt}
   \setlength{\belowdisplayskip}{0pt}
   \setlength{\belowdisplayshortskip}{0pt}
}
\makeatother


Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6449
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Less Space between equations and text

Postby eggmanneo on Thu Sep 29th, 2011

This works, thanks!
eggmanneo
 
Posts: 10
Joined: Wed Apr 21st, 2010


Return to Page Layout

Who is online

Users browsing this forum: No registered users and 6 guests