2

I'm having problems with vertical spacing above and under equations and I don't know what to do anymore. Here's a MWE that reproduces my problem (I wasn't able to make a simpler version in English, so sorry for the French stuff but that's irrelevant!):

\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage[nodisplayskipstretch]{setspace}
\setstretch{1.1}
\raggedbottom
\usepackage{microtype}

\begin{document}

%\setlength{\abovedisplayskip}{11pt}
%\setlength{\abovedisplayshortskip}{0pt}
%\setlength{\belowdisplayskip}{\abovedisplayskip}
%\setlength{\belowdisplayshortskip}{\abovedisplayskip}
\setlength{\jot}{3ex}

Sans chercher à être rigoureux, il vaut la peine de montrer que l'égalité entre les deux potentiels a lieu sous la limite thermodynamique (nombre très grand).  Pour les systèmes possédant un très grand nombre de particules, la série doit être dominée par un terme beaucoup plus grand que les autres, que l'on peut supposer centré (ceci n'est justifié que si l'écart relatif est suffisamment faible).  Le maximum de la fonction
    \begin{equation}
        \mu = \frac{\partial \Phi}{\partial N} = -\, x.
    \end{equation}
est obtenu en annulant sa dérivée par rapport à la variable évaluée en $N = \bar{N}$ (cette variable discrète peut être considérée comme une variable continue pour ses très grandes valeurs).  Ceci donne
    \begin{equation}
        \mu = \frac{\partial \Phi}{\partial N} = -\, x.
    \end{equation}
Puisque le nombre est susceptible de fluctuer autour de sa valeur moyenne, on peut développer la fonction en une série de puissance.  Au second ordre, on obtient bla blabla blaaaaa!

\end{document}

Here's a preview of my vertical spacing problem:

enter image description here

As you can see on this picture, the vertical spacing above and under equations is variable. I hate that! I want a perfectly constant spacing for all equations, above and under the text. When I comment out the \setlength commands in this MWE, I could get a much better display, but still it isn't perfect. Depending on the text and equations, I may get some variable spacing. So I have two questions:

  1. How can I absolutly fix the vertical spacing above and under each equation?

  2. What should be a natural spacing value? I used 8pt in that MWE example, but it needs to be scalable if I decide to change the global font size. I don't know what should be the proper space.

Please, take note that I'm not asking about the shortskip of equation (2) in this example, which is fine. Just see the three thin vertical red lines I've draw on the picture.

Cham
  • 2,304
  • 1
    You forget there are optical illusions. Your equation (2) use \abovedisplayshortskip because the line above the equation is very short, so that it is the last but one line above which is important to the eye. If you use \abovedisplay skip w.r.t. the last line, the spacing w.r.t. the previous line will be too large. – Bernard Dec 09 '19 at 23:06
  • @Bernard, I'm not talking about the shortskip, which is natural here. This isn't what I want to change. Just see the vertical red lines I've drawn in my preview picture. – Cham Dec 09 '19 at 23:08
  • Sorry wrong question. Did you not ask a question about this with extensive discussion in the comments involving David Carlisle and barbara beeton? – cfr Dec 09 '19 at 23:09
  • @cfr, it wasn't about the same thing! This discussion was about the vertical spacing inside the math environments, especially the align and gather environments. The question above isn't about that at all. – Cham Dec 09 '19 at 23:11
  • 1
    @Schrödinger'scat, I've understood the meow. +1 there! Purr purr! – Cham Dec 09 '19 at 23:21
  • @Bernard, thanks for letting me know about \abovedisplayshortskip. – Sigur Dec 09 '19 at 23:45
  • your lines are highlighting spaces that tex doesn't usually track at all, base of one row of text to top of the next, tex tries to maintain baseline to baseline spacing mostly. You are marking the x-height of a run of letters that happen not to have any capitals on the line below the equation, tex has no information at all about that internally, it bases the spacing on the hbox that contains the entire line – David Carlisle Dec 10 '19 at 00:48
  • this seems to be exactly the same question as before to be honest, the previous question was all about \abovedisplayshortskip and this is the same – David Carlisle Dec 10 '19 at 00:50
  • see the discussion here https://tex.stackexchange.com/questions/519424/how-to-make-a-simple-macro-from-this-grouping – David Carlisle Dec 10 '19 at 00:52
  • @DavidCarlisle, I don't see how the discussion you point out is related, even if there are some similarities (vertical spacing), since it was about the short skip (too much space for some eq under short text line). This problem was solved. In the case I'm interested here, I want to fix the other spacing above and under equations. – Cham Dec 10 '19 at 01:14
  • it is identical, why do you say it was about internal spacing within align and gather, the examples there use equation same as this and here it is the same issue, the first equation uses abovedisplayskip and the second uses abovedisplayshortskip. – David Carlisle Dec 10 '19 at 01:16
  • I think there are some misunderstanding here. Lets go to chat (I don't know how to start a chat here). – Cham Dec 10 '19 at 01:17
  • the spacings under the equations differ just because belowdisplayskip is not equal to belowdisplayshortskip. There isn't really anything else that can be said that was not said in the previous question. – David Carlisle Dec 10 '19 at 01:18
  • Again, I'm not interested on the above short skip. This case was solved on another question. – Cham Dec 10 '19 at 01:19

1 Answers1

5

With the new uploaded image the two lengths marked by the arrow differ because of user settings. The first is based on \belowdisplayskip and the second (as the line above the display is short) uses \belowdisplayshortskip. If you want the spaces to be equal just set these to the same value, eg

\setlength\belowdisplayshortskip{\belowdisplayskip}

would make them both use the value from the first equation.

David Carlisle
  • 757,742
  • This appears to work. Maybe this is unrelated, but I'm still having too large vertical space between small equations under the align environment. How can I reduce localy the spacing (i.e from withinn an environment), without changing the global \jot defined in the preamble ? Is \[negative space] the only option? – Cham Dec 10 '19 at 15:02
  • @Cham align always uses \abovedisplayskip not \abovedisplayshortskip (one package I forget nccmath or mathtools I think) has a user-level command to switch one equation to use the short setting – David Carlisle Dec 10 '19 at 15:06
  • I consulted the nccmath and mathtools documentation to find the vertical commands in maths environments and din't found the one that let the user to change the inter equations spacing. I still don't see how to change the spacing without using a negative space with \[...]. – Cham Dec 10 '19 at 15:21
  • Ha! I think I've found it. Using \begingroup\setlength{\jot}{2ex} ... \endgroup solves my spacing issue for the few cases where I need to reduce the space. Do you confirm this is a proper solution? – Cham Dec 10 '19 at 17:29