LaTeX forum ⇒ Page LayoutLess Space between equations and text

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
eggmanneo
Posts: 10
Joined: Wed Apr 21, 2010 9:03 pm

Less Space between equations and text

Postby eggmanneo » Thu Sep 29, 2011 5:06 pm

I'm trying to reduce the space between my text and equations. I mainly use the align environment. I tried using the commands
  1. \setlength\abovedisplayskip{0pt}
  2. \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

  1. \documentclass[12pt]{article}
  2. \usepackage{setspace}
  3. \usepackage{lmodern}
  4. \usepackage{amsmath}
  5. \usepackage{amsfonts}
  6. \usepackage{hyperref}
  7. \usepackage[hmargin=1in,vmargin=1in]{geometry}
  8. \doublespacing
  9. \usepackage{times}
  10. \setlength\abovedisplayskip{0pt}
  11. \setlength\belowdisplayskip{0pt}
  12. \DeclareMathOperator* {\Max}{max} %in equation mode, this lets you write max wrt choice variables
  13. \usepackage{graphicx}
  14. \def\inputGnumericTable{} %spreadsheet program I use to make tables for latex
  15. \usepackage[latin1]{inputenc}
  16. \usepackage{color}
  17. \usepackage{array}
  18. \usepackage{longtable}
  19. \usepackage{calc}
  20. \usepackage{multirow}
  21. \usepackage{hhline}
  22. \usepackage{ifthen}
  23.  
  24. \usepackage{harvard}
  25.  
  26. \begin{document}
  27.  
  28. \begin{align} \label{eq:budget}
  29. 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.
  30. \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 29, 2011 7:11 pm, edited 1 time in total.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Sep 29, 2011 5:58 pm

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:

  1. \AtBeginDocument{%
  2. \setlength\abovedisplayskip{0pt}
  3. \setlength\belowdisplayskip{0pt}}


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

  1. \renewcommand\normalsize{%
  2. \@setfontsize\normalsize\@xiipt{14.5}%
  3. \setlength{\abovedisplayskip}{0pt}
  4. \setlength{\abovedisplayshortskip}{0pt}
  5. \setlength{\belowdisplayskip}{0pt}
  6. \setlength{\belowdisplayshortskip}{0pt}
  7. \let\@listi\@listI}
  8. \makeatother


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

  1. \makeatletter
  2. \g@addto@macro{\normalsize}{%
  3. \setlength{\abovedisplayskip}{0pt}
  4. \setlength{\abovedisplayshortskip}{0pt}
  5. \setlength{\belowdisplayskip}{0pt}
  6. \setlength{\belowdisplayshortskip}{0pt}}
  7. \makeatother


Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

eggmanneo
Posts: 10
Joined: Wed Apr 21, 2010 9:03 pm

Postby eggmanneo » Thu Sep 29, 2011 7:11 pm

This works, thanks!

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests