0

I am confused about spacing around equations.

Perhaps I misread it but my understanding is the following \abovedisplayskip and \abovedisplayshortskip would control vertical spacing/glue around equations. The first is supposed to apply when the last line of a paragraph overlaps the equation underneath the line. Otherwise, the second would apply.

In this MWE below, I expected the second equation would move upwards due to -X\baselineskip as the line does not overlap the equation but it is not applied.

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[onehalfspacing]{setspace}
\newcommand\mathexpr{%
    \begin{align*}f(x) = \sqrt{A^2 + B^2 + C^2} \end{align*}}
\setlength{\parindent}{0pt}
\AtBeginDocument{%
    \setlength\abovedisplayskip{\baselineskip}
    \setlength\abovedisplayshortskip{-10\baselineskip}}

\begin{document}
As any dedicated reader can clearly see, the Ideal of practical reason of things.
\mathexpr

As any dedicated reader can clearly see, the Ideal of practical reason is a representation.
\mathexpr

As any dedicated reader can clearly see, the Ideal of practical reason of things.
\end{document}

enter image description here

1 Answer 1

1

AMS alignments are always full width, so the shortskip is never used.

If you try it with \[\] then you see the effect:

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage[onehalfspacing]{setspace}
\newcommand\mathexpr{\[x=y\]}
\setlength{\parindent}{0pt}
\AtBeginDocument{%
    \setlength\lineskiplimit{-100pt}
    \setlength\abovedisplayskip{\baselineskip}
    \setlength\abovedisplayshortskip{-10\baselineskip}}

\begin{document}
As any dedicated reader can clearly see, the Ideal of practical reason of things.
\mathexpr

As any dedicated reader can clearly see, the Ideal of practical reason is a representation.
\mathexpr

As any dedicated reader can clearly see, the Ideal of practical reason of things.


\end{document}

enter image description here

4
  • Is \[...\] the equivalence of equation environment? I have a lot of equations inside align, some of them are long and only particular equation lines are numbered. I guess I would insert aligned in \[\] but how can I number particular equations-lines, then?
    – Celdor
    Commented Mar 13, 2022 at 13:56
  • If it's cannot work using simple solution then I'd probably better of accepting the default spacing. Thanks
    – Celdor
    Commented Mar 13, 2022 at 13:57
  • Just one more question. By any chance, do you know of any workaround to obtain similar effects?
    – Celdor
    Commented Mar 13, 2022 at 14:05
  • \[ isthe standard latex environment for an unnumbered equation, with amsmath you can also access it as \begin{equation*} you should always use this and not align for single line equations with (therefore) no alignment, ie equations as in your example. Commented Mar 13, 2022 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .