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: 937
Joined: Sat Apr 02, 2011 4:06 pm

What should be the natural spacement between equations?

Post by Cham »

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

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}

\begin{document}
 
Blablabla:
	\begin{gather*}
		x^2 - 3 y = 2, \\[12pt]
		\frac{1}{2} \, x y - z^3 = 2, \\[12pt]
		\frac{3}{4} \, x - y = z^2. \\[12pt]
		z + x - y = 1. \\[12pt]
		z^2 - y^2 = 0.
	\end{gather*}
Blabla
	\begin{align*}
		x+ 3 y &= 2, \\[12pt]
		\frac{1}{2} \, x^2 - z &= 2, \\[12pt]
		\frac{2}{5} \, z + z^2 &= y. \\[12pt]
		z + x - y &= 1. \\[12pt]
		x^2 - y^2 &= -1.
	\end{align*}

\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, ...)?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

What should be the natural spacement between equations?

Post by Johannes_B »

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: 937
Joined: Sat Apr 02, 2011 4:06 pm

What should be the natural spacement between equations?

Post by Cham »

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: 4182
Joined: Thu Nov 01, 2012 4:08 pm

What should be the natural spacement between equations?

Post by Johannes_B »

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: 10320
Joined: Mon Mar 10, 2008 9:44 pm

What should be the natural spacement between equations?

Post by Stefan Kottwitz »

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
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What should be the natural spacement between equations?

Post by Cham »

I guess you mean \setlength{\jot}{12pt} ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

What should be the natural spacement between equations?

Post by Stefan Kottwitz »

Yes, mixed it with \addtolength,

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What should be the natural spacement between equations?

Post by Cham »

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: 419
Joined: Sun Nov 16, 2014 8:51 pm

What should be the natural spacement between equations?

Post by rais »

0.5\baselineskip, perhaps?

KR
Rainer
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

What should be the natural spacement between equations?

Post by Cham »

Here's a MWE showing my troubles:

Code: Select all

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
%\setlength{\jot}{\baselineskip}

\begin{document}
 
Blabla:
	\begin{gather}
		x^2 - \frac{1}{2} \, x = 3, \\
		\frac{a^2}{b^3} \, y + 2 x \, y = y^2, \\
		a - b = c.		
	\end{gather}
Bla:
	\begin{gather}
		x^2 - \frac{1}{2} \, x = 3, \\[11pt]
		\frac{a^2}{b^3} \, y + 2 x \, y = y^2, \\[11pt]
		a - b = c.		
	\end{gather}
Blabla:
	\begin{gather}
		\setlength{\jot}{12ex}
		x^2 - \frac{1}{2} \, x = 3, \\[1ex]
		\frac{a^2}{b^3} \, y + 2 x \, y = y^2, \\[1ex]
		a - b = c.		
	\end{gather}

\end{document}
Here's a preview:
vspacements.jpg
vspacements.jpg (26.38 KiB) Viewed 9341 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!
Post Reply