LaTeX forum ⇒ Math & ScienceWhat should be the natural spacement between equations?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

What should be the natural spacement between equations?

Postby Cham » Thu Nov 28, 2019 5:56 am

I wrote a large document full of equations that I vertically separated using commands like \\[12pt], \\[18pt] (see the example below). The document was written with a 12pts font size.

Then, I decided that 12pts font was too big and reduced it to 11pts. The spacements between equations need to be adjusted, and I guess that I shouldn't have used commands like \\[12pt] and \\[18pt].

Here's a MWE example showing the issue:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[11pt,letterpaper,twoside]{book}
  2. \usepackage{lmodern}
  3. \usepackage{amsmath}
  4.  
  5. \begin{document}
  6.  
  7. Blablabla:
  8. \begin{gather*}
  9. x^2 - 3 y = 2, \\[12pt]
  10. \frac{1}{2} \, x y - z^3 = 2, \\[12pt]
  11. \frac{3}{4} \, x - y = z^2. \\[12pt]
  12. z + x - y = 1. \\[12pt]
  13. z^2 - y^2 = 0.
  14. \end{gather*}
  15. Blabla
  16. \begin{align*}
  17. x+ 3 y &= 2, \\[12pt]
  18. \frac{1}{2} \, x^2 - z &= 2, \\[12pt]
  19. \frac{2}{5} \, z + z^2 &= y. \\[12pt]
  20. z + x - y &= 1. \\[12pt]
  21. x^2 - y^2 &= -1.
  22. \end{align*}
  23.  
  24. \end{document}


I want all the equations to be equally spaced, no variable vertical spacings.

What should be the proper commands to vertically dispose the equations, in a font size independant way, and so that the spacings stay constant for any set of equations in any environment (array, align, aligned, gather, gathered, ...)?

User avatar
Johannes_B
Site Moderator
Posts: 4098
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Nov 28, 2019 7:27 am

Well, the simple way would be to not use manual spacing and let TeX do its job. Knuth designed it to prepare beautiful books.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Thu Nov 28, 2019 4:31 pm

Well, that's not very specific. I'm already asking how to do this properly!

Do you have a suggestion code? I tried using \\, but the spacing is way to short (and variable). Using \\ \\ gives some spacing troubles too.

User avatar
Johannes_B
Site Moderator
Posts: 4098
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Nov 28, 2019 6:37 pm

I would suggest to use a single \\ at the end of an equation line. The spacing will be different, as very equation needs a bit of variable space.

Your constriction of exact space, isn't what I would enforce.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9513
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Nov 28, 2019 8:13 pm

Hi Cham,

take a look at this topic. Instead of 0pt as there, you can choose any you want for all equations with multiple lines at one. And for interline space in multiple eqautions, as above, you can globally adjust \jot, such as

\settolength{\jot}{12pt}

Stefan
Site admin

User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Thu Nov 28, 2019 8:37 pm

I guess you mean \setlength{\jot}{12pt} ?

User avatar
Stefan Kottwitz
Site Admin
Posts: 9513
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Nov 28, 2019 9:30 pm

Yes, mixed it with \addtolength,

Stefan
Site admin

User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Sat Nov 30, 2019 12:32 am

Well, I now have another point of view that I would like to try.

Before, I was using fixed spaces like \\[6pt], \\[12pt], \\[18pt] and even \\[24pt] (depending on the size and "type" of equations), for equations in a 12pts font document.

I hate it when LaTeX change the spacements to adapt vertical spaces to the equations. I prefer to get nice looking constant vertical spacings, even if I have to do it myself.

Now I'm writing my docs with 11pts font. I want the vertical spacings of equations to be constant and stay nice with this font size (and even if I change the font size!), without having to use some multiple of 11pts (which is a prime number, so can't use \\[5.5pts], for example)!

So are there vertical spacing commands for math mode that would do the equivalent of what I was doing before (i.e half and multiples of 12pts), instead of using something like \\[11pts], \\[16.5pts] or \\[22pts] ? For example, something like \medskip, \bigskip made for the math mode and the align, gather and other math environments?

rais
Posts: 250
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Sat Nov 30, 2019 12:42 am

0.5\baselineskip, perhaps?

KR
Rainer

User avatar
Cham
Posts: 926
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Sat Nov 30, 2019 9:29 pm

Here's a MWE showing my troubles:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[11pt,letterpaper,twoside]{book}
  2. \usepackage{lmodern}
  3. \usepackage{amsmath}
  4. %\setlength{\jot}{\baselineskip}
  5.  
  6. \begin{document}
  7.  
  8. Blabla:
  9. \begin{gather}
  10. x^2 - \frac{1}{2} \, x = 3, \\
  11. \frac{a^2}{b^3} \, y + 2 x \, y = y^2, \\
  12. a - b = c.
  13. \end{gather}
  14. Bla:
  15. \begin{gather}
  16. x^2 - \frac{1}{2} \, x = 3, \\[11pt]
  17. \frac{a^2}{b^3} \, y + 2 x \, y = y^2, \\[11pt]
  18. a - b = c.
  19. \end{gather}
  20. Blabla:
  21. \begin{gather}
  22. \setlength{\jot}{12ex}
  23. x^2 - \frac{1}{2} \, x = 3, \\[1ex]
  24. \frac{a^2}{b^3} \, y + 2 x \, y = y^2, \\[1ex]
  25. a - b = c.
  26. \end{gather}
  27.  
  28. \end{document}


Here's a preview:
vspacements.jpg
vspacements.jpg (26.38 KiB) Viewed 79 times


As you can see from the equation numbers on this preview, the vertical spacing is variable, and I hate that!

I would like to define some small macros to replace \\ and \\[11pt] and the likes to something that would adjust with the font size (11pts here), and that makes the vertical spacing between "=" to be the same. I don't want LaTeX to make variable vertical spacings between equations. Is that possible?**

** To solve the issue, I was using an ugly hack: smash the fractions and summation signs in equations and use \\[11pt], or \\[22pts] to adjust the spacing according to the equations. This is certainly not a good way of doing things!


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 9 guests