2

This is a follow-up question regarding the extra vertical space in amsmath's align environment. Why when in use align uses so much vertical space in contrast with other environments like for example tabular or itemize?

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}


\usepackage[fleqn]{amsmath}
\usepackage{unicode-math}

\setlength{\mathindent}{0cm}
\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}

\begin{document}

70

\begin{align*}
&e^{jz}=\cos z+j\sin z\\
&\cos z=(1/2)(2\cos z)=\\
&=(1/2)(2\cos z+j\sin z-j\sin z)=\\
&=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
&=(1/2)(e^{jz}+e^{-jz})
\end{align*}

80

\begin{itemize}
\item Item 1

\item Item 2

\end{itemize}

90

\begin{tabular}{c|c}
 Entry 1& Entry 2  \\
 Entry 3& Entry 4
\end{tabular}

\end{document}

enter image description here

Also another image of the huge space between two align environments. Even without the blank lines the space is a lot.

enter image description here

\begin{document}

\begin{multicols*}{2}


\begin{align*}
&\text{70}\\
&e^{jz}=\cos z+j\sin z\\
&\cos z=(1/2)(2\cos z)=\\
&=(1/2)(2\cos z+j\sin z-j\sin z)=\\
&=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
&=(1/2)(e^{jz}+e^{-jz})
\end{align*}



\begin{align*}
&\text{207}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\phi(t)=K_{p}m(t)\\
&x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
\end{align*}

Edit I:

As I mention in a comment I have tried the following code and there is no difference between two align environments, only between text and an align environment. Why doesn't work in the case of the two environments and how can I fix it so to work? Also what is the reason that this space exists?

\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt} 
Adam
  • 4,684
  • There is no extra space if you don't leave a blank line after 70, which is wrong, because an alignment should never start a paragraph. – egreg Apr 18 '14 at 23:00
  • tabular is a simple table, different from the float table. You tabular is just below the line 90 since you left a blank line it was inserted just after, like a new paragraph. – Sigur Apr 18 '14 at 23:00
  • @egreg even if there is no blank line there is still a lot of vertical space. I used the blank line here so to empasize what I meant. – Adam Apr 18 '14 at 23:02
  • @Sigur it is logical about the tabular but not for the other environments. I used tabular as a comparison because I think is the right output. – Adam Apr 18 '14 at 23:04
  • You should do tests with a full page since some vertical spaces are stretchable. Use the lipsum package and \lipsum[1] to produce dummy texts. – Sigur Apr 18 '14 at 23:06
  • @Adam I can't see this “lot of space”. – egreg Apr 18 '14 at 23:11
  • @egreg look the vertical space of align in contrast with tabular or itemize. – Adam Apr 18 '14 at 23:23
  • @Adam, you should use blank line before align since it is a display environment and automatically insert vertical spaces above and below it. So you don't need the paragraph (which makes the space above bigger). – Sigur Apr 18 '14 at 23:25
  • @Sigur I aggree and in my code I don't use blank line between the text and the align (as I said I used it here to empasize) but even with it there is a big difference if you compare it to the other environments. – Adam Apr 18 '14 at 23:28
  • Ops, sorry. I was saying shouldn't use. – Sigur Apr 19 '14 at 00:03
  • The vertical space before mathematical environments is governed by the abovedisplayskip length that you can modify if needed: http://tex.stackexchange.com/questions/30909/abovedisplayskip-vs-abovedisplayshortskip – pluton Apr 19 '14 at 02:26
  • @pluton I have tried it and there is no difference between two align environments, only between text and an align environment. – Adam Apr 19 '14 at 02:30
  • @Adam A blank line before a display environment is wrong; two consecutive display environments are wronger. – egreg Apr 19 '14 at 08:41

1 Answers1

7

the documentation for the 'amsmath' package says that there should be no blank lines between consecutive displays. instead, "subsidiary" environments should be used within another more inclusive environment.

for example:

text
\begin{gather*}
 \begin{aligned}
  a &= b + c\\
    &= d + e
 \end{aligned}\\
 \begin{aligned}
  fgh &= ijk + lmn\\
      &= opq
 \end{aligned}
\end{gather*}

please read the manual (texdoc amsmath) -- it's quite short, and has useful examples.

  • Thank you I have read it but I missed that. So the space was a wrong behaviour because I didn't use gather? Also sorry but is there a way to break the equations in a new page or in a new column? Because with that way it creates a badbox if I write a lot of equations one under the other. – Adam Apr 19 '14 at 06:14
  • check the documentation for \allowbreak and \allowdisplaybreaks. (i'm away from home, and unable to get access to my usual resources, so i'm answering from memory, which sometimes goes fuzzy.) – barbara beeton Apr 19 '14 at 18:38
  • I have a question regarding your answer though. In my code the align environments are not consecutive as there is text between them. If I was writting a bigger documents with a lot of text in which I would like an align then the text and an align again what would happen then? – Adam Apr 21 '14 at 20:49
  • @Adam -- only if your alignments are consecutive do they need to be kept within the same display structure. if text following an align starts a new paragraph, end the display environment and leave a blank line. if it does not start a new paragraph, still end the display environment, but start the text without leaving a blank line. only if two different display environments directly follow one another do they need to be "grouped" within a more comprehensive environment such as gather. – barbara beeton Apr 22 '14 at 05:51
  • Ok i will try some cases. – Adam Apr 22 '14 at 14:15