0

Problem

I have inconsistent spacing between text and equation (not ending paragraph). It doesn't seem to be related to large symbols like integrals or indexed sums. (see edit 2.) When using default (Computer Modern) font, the problem disappears. In this example, the first equation looks too far from the text above. Equation 2 looks fine. Third one is clearly not correctly spaced.

This is a short snippet from my thesis stripped from a lot of packages, but I am not sure all the remaining packages of the MWE are relevant to the question. (For example, I don't think the geometry package plays a role here, but it provides a layout where I was easily able to fit three clear examples inside a page.)

I marked on the image my perceived unbalanced baseline of the equations.

Minimal working example

\documentclass[a4paper,oneside,12pt]{book}

\usepackage[no-math]{fontspec} \usepackage{ebgaramond} \usepackage[cmintegrals,cmbraces]{newtxmath} \usepackage{ebgaramond-maths} \setmainfont{EB Garamond}[ Ligatures=TeX, SmallCapsFeatures={% %LetterSpace=4, }, Numbers=OldStyle%, %Kerning=Uppercase% ]

\renewcommand{\baselinestretch}{1.2} %\usepackage[french]{babel}

\usepackage[headheight=15pt]{geometry} \geometry{hmargin=2.5cm, tmargin=3.5cm, bmargin=3cm} % oneside

\let\vec\mathbf \newcommand*{\dl}{\mathrm{d}}

%\usepackage{lipsum}

\begin{document}

%\mainmatter

De façon plus rigoureuse, en posant l'angle solide $\Phi = (\theta_{{r,j}}, \phi_{{r,j}})$ en omettant l'indice du vecteur, on peut écrire que la probabilité de trouver un vecteur dans la région définie par $\Phi + \Delta \Phi$% est \begin{equation} P_{\theta}(\Phi, \Phi + \Delta \Phi) \propto \iint_{\Phi}^{\Phi + \Delta \Phi}!! Q(\Phi; \theta), \dl \Phi, \end{equation} pour un angle de diffusion $\theta$ donné, avec $\dl \Phi = \sin \phi_{{r,j}} \dl \theta_{{r,j}} \dl \phi_{{r,j}}$. La ... présente un exemple de coupe de portrait, sur laquelle figure deux valeurs de $Q_r$ pour des angles $\phi_{r1}$ et $\phi_{r2}$ choisis, à $\theta_{r1}$ et $\theta_{r2}$ fixés. Sur cet exemple, la longueur du vecteur $Q_r(\phi_r)$ est d'autant plus grande que $\vec{r}$ est parallèle à $x$ ($\phi_r \simeq 0$ ou $180$) et d'autant plus courte lorsque $\vec{r}$ est aligné selon $y$ ($\phi_r \simeq \pm 90$).

Nous effectuons dans cette partie l'analyse stéréodynamique de la réaction d'échange isotopique \begin{equation} %\ch{^{18}O + ^{16}O ^{16}O}(v=0,j=1)\ch{-> ^{16}O^{18}O}(v'=0,j')\ch{ + ^{16}O} A + BC \to AB + C \iiint_W \end{equation} pour différents $j'$, et différentes énergies de collision. Nous commencerons l'analyse par l'étude des paramètres de polarisation totaux --- c'est-à-dire par l'aspect le plus global de l'orientation préférentielle des réactifs ---, puis nous mettrons en valeurs les variations en fonction des paramètres de la réaction, tels que l'état interne de la diatomique des produits, l'énergie de collision ou l'angle de diffusion.

L'amplitude de diffusion est calculée à partir des éléments de la matrice $\vec{S}$ par \begin{equation} f_{\Omega' \Omega}(\theta) = \sum_J (2 J + 1), d_{\Omega' \Omega}^{,J}, S_{v'j'\Omega',vj\Omega}^{,J},, \end{equation} où $d_{\Omega' \Omega}^{,J}$ est un élément de la matrice de rotation réduite filler text filler text

\end{document}

Lualatex pdf rendering of the MWE

I am unable to further pinpoint the problem. Any idea on how to fix this? I would like to avoid manually fixing spacing around problematic equations, even if I would consider the possibility at the ultimate phase of typesetting.

Adressing comments

Edit 1: Surrounding the sum (and J index) in equation (3) and $d_{\Omega' \Omega}^{\,J}$ the line after by \smash{} does not alter in any way the spacing around equations, which seems to be independent of the content of the equation environments. Smashing the integral seems to work for equation (1).

Edit 2: Surrounding the whole content of the equation with smash works, but not always. Is it safe to patch the equation environment to always smash its content?

  • 1
    Welcome to tex.sx. I haven't experimented or tested anything, but I would try applying \smash to the lower limit on the sum. This font has longer descenders than most fonts used for setting math, and the italic f is an effective example of this, especially when placed under a sum that's also taller than what I'm used to. – barbara beeton Feb 09 '21 at 04:24

1 Answers1

2

Your problem is the superscript J of d_{\Omega' \Omega}^{\,J} rising above the baseline. Changing it to \smash{d_{\Omega' \Omega}^{\,J}} fixes it for me.

You’re also mixing legacy and OpenType font packages in a way that might be causing you problems. Since you’re loading fontspec, and therefore can use OpenType, you might try this instead:

\documentclass[a4paper,oneside,12pt]{book}
\usepackage{unicode-math}
\usepackage[oldstyle]{ebgaramond}

\setmathfont{Garamond-Math.otf}

\renewcommand{\baselinestretch}{1.2} %\usepackage[french]{babel}

\usepackage[headheight=15pt]{geometry} \geometry{hmargin=2.5cm, tmargin=3.5cm, bmargin=3cm} % oneside

\let\vec\mathbf \newcommand*{\dl}{\mathrm{d}}

%\usepackage{lipsum}

\begin{document}

%\mainmatter

De façon plus rigoureuse, en posant l'angle solide $\Phi = (\theta_{{r,j}}, \phi_{{r,j}})$ en omettant l'indice du vecteur, on peut écrire que la probabilité de trouver un vecteur dans la région définie par $\Phi + \Delta \Phi$% est \begin{equation} P_{\theta}(\Phi, \Phi + \Delta \Phi) \propto \iint_{\Phi}^{\Phi + \Delta \Phi}!! Q(\Phi; \theta), \dl \Phi, \end{equation} pour un angle de diffusion $\theta$ donné, avec $\dl \Phi = \sin \phi_{{r,j}} \dl \theta_{{r,j}} \dl \phi_{{r,j}}$. La ... présente un exemple de coupe de portrait, sur laquelle figure deux valeurs de $Q_r$ pour des angles $\phi_{r1}$ et $\phi_{r2}$ choisis, à $\theta_{r1}$ et $\theta_{r2}$ fixés. Sur cet exemple, la longueur du vecteur $Q_r(\phi_r)$ est d'autant plus grande que $\vec{r}$ est parallèle à $x$ ($\phi_r \simeq 0$ ou $180$) et d'autant plus courte lorsque $\vec{r}$ est aligné selon $y$ ($\phi_r \simeq \pm 90$).

Nous effectuons dans cette partie l'analyse stéréodynamique de la réaction d'échange isotopique \begin{equation} %\ch{^{18}O + ^{16}O ^{16}O}(v=0,j=1)\ch{-> ^{16}O^{18}O}(v'=0,j')\ch{ + ^{16}O} A + BC \to AB + C \iiint_W \end{equation} pour différents $j'$, et différentes énergies de collision. Nous commencerons l'analyse par l'étude des paramètres de polarisation totaux --- c'est-à-dire par l'aspect le plus global de l'orientation préférentielle des réactifs ---, puis nous mettrons en valeurs les variations en fonction des paramètres de la réaction, tels que l'état interne de la diatomique des produits, l'énergie de collision ou l'angle de diffusion.

L'amplitude de diffusion est calculée à partir des éléments de la matrice $\vec{S}$ par \begin{equation} f_{\Omega' \Omega}(\theta) = \sum_J (2 J + 1), d_{\Omega' \Omega}^{,J}, S_{v'j'\Omega',vj\Omega}^{,J},, \end{equation} où $\smash{d_{\Omega' \Omega}^{,J}}$ est un élément de la matrice de rotation réduite filler text filler text

\end{document}

That preamble loads the OpenType fonts EB Garamond and Garamond Math. You could also use \usepackage[ebgaramondot]{fontsetup}, but that has no support for options such as old-style numerals.

Davislor
  • 44,045
  • You (and @barbara) are right. I could confirm this with the use of \usepackage{lua-visual-debug}. I do still have the problem, but it might be caused by the chemformula package. I'll post another question. Thank you for the font advice, I have actually a 20 lines long config in the preamble to make the font behave as I wish, I'll try your solution out. – EPrivat Feb 09 '21 at 05:56
  • After further testing, my issue is still not resolved, but is caused by different packages in different conditions. I've posted another question which shows spacing problems with the geometry package. – EPrivat Feb 09 '21 at 06:48