3

I was reading an article I wrote and I noticed unwanted spaced between lines. One such example is:

enter image description here

I have highlighted the relevant section in red. As you can see, there is a bigger space between the first and second equation than there is between the second and third.

The code for that portion of the paper is:

So form the polynomial
\[X^3-(x+y+z)X^2+(xy+yz+zx)X-xyz,\]
clearly (Vieta's formulas) with roots $x,y,z$. Substituting in the roots we get
\[x^3-(x+y+z)x^2+(xy+yz+zx)x-xyz=0,\]
\[y^3-(x+y+z)y^2+(xy+yz+zx)y-xyz=0,\]
\[z^3-(x+y+z)z^2+(xy+yz+zx)z-xyz=0,\]
and reducing this system mod $p$ we have
\[x^3\equiv y^3\equiv z^3\equiv xyz\pmod p,\]

I cannot see anything in the code that should make the spacing bigger between the first and second equations.

  • 2
    By a first glance, better use gather* or align* from amsmath there. – Johannes_B Mar 20 '15 at 19:53
  • @Johannes_B: Thanks, it worked! (I'm new to tex and don't usually use \begin{align*} on forums, hence why I didn't think of it.) – user45220 Mar 20 '15 at 19:58
6

As this is one system,, you should treat it like one in the input as well. amsmath provides environments like gather (and a starred variant for unnumbered equation) as well as align (and starred for unnumbered) to additionally align the equations in the system. Since all equations have the same length here ...

\documentclass{article}
\usepackage{mathtools}
\begin{document}
So form the polynomial \[X^3-(x+y+z)X^2+(xy+yz+zx)X-xyz,\]
clearly (Vieta's formulas) with roots $x,y,z$. Substituting in
the roots we get
\begin{gather*}
x^3-(x+y+z)x^2+(xy+yz+zx)x-xyz=0,\\
y^3-(x+y+z)y^2+(xy+yz+zx)y-xyz=0,\\
z^3-(x+y+z)z^2+(xy+yz+zx)z-xyz=0,
\end{gather*} 
and reducing this system
mod $p$ we have \[x^3\equiv y^3\equiv z^3\equiv xyz\pmod p,\]
\end{document}

texsxGatherWhitspace

  • Thanks a lot. See also my reply to your comment. All sorted. – user45220 Mar 20 '15 at 19:59
  • @user45220 maybe a better answer will come along. I am pretty sure as well, that this is a duplicate. – Johannes_B Mar 20 '15 at 20:01
  • Yours was the simplest and most effective. Thank you very much! – user45220 Mar 20 '15 at 20:18
2

The problem is that the \belowdisplayskip and \belowdisplayshortskip registers have different values of skip amount. You can try to remove the text "(Vieta's formulas) with roots $x,y,z$. Substituting in the roots we get". Then the line before fist display math will be short, so \belowdisplayshortskip is used below the first display and the same below second display. The lines will be equidistant. But your real line before display is longer, so this looks like:

(Vieta's formulas) with roots $x,y,z$. Substituting in the roots we get
... \abovedisplayskip
$$ first display $$
... \belowdisplayskip
... \abovedisplayshortskip
$$ second display $$
... \belowdisplayshortskip
... \abovedisplayshortskip
$$ third display $$
... \belowdisplayshortskip
and reducing this system mod $p$ we have ...

You can see, that there is different sum of spaces between first and second display and between second and third display.

Solution: use multi-display environment. If you are using LaTeX then I don't advice you what environmnet. But if you are using plain TeX then you can use \displaylines macro.

0

You have entered the three equations independently, not in a system so it does not treat them as related. Maybe it has some unused space on the page it has to put some where and it is putting it between these unrelated equations. Maybe by putting the three equations inside an environment like \centered{ } it may keep the space between equations the same

  • 3
    Hi and welcome, can you extend your answer a bit? Maybe giving an example. – Johannes_B Mar 20 '15 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.