2

The result of the following code is strange: vertical space before align environment is smaller than displayed math. What is the problem with align environment?

Edit: I want the same vertical space before and after align environments, just like other displayed formulas.

\documentclass{article}

\usepackage[14pt]{extsizes}
\usepackage{amsmath}

\setlength{\lineskiplimit}{4pt}
\setlength{\lineskip}{4pt plus 1pt minus 1pt}

\AtBeginDocument{%
  \setlength{\baselineskip}{19pt plus 1pt minus 1pt}%
}

\begin{document}

\setlength{\fboxsep}{0pt}

\noindent
\fbox{\makebox[\textwidth]{lazy dog}}
\begin{align*}
  \boxed{f(x) = \sin x + 1}
\end{align*}
\fbox{\makebox[\textwidth]{lazy dog}}
$$\boxed{f(x) = \sin x + 1}$$
\fbox{\makebox[\textwidth]{lazy dog}}
\[\boxed{f(x) = \sin x + 1}\]
\fbox{\makebox[\textwidth]{lazy dog}}

\end{document}

enter image description here

13
  • 1
    There isn't is a problem here, per se. \begin{align}...\end{align} do some things different than does \[...\] (see Why is \[ ... \] preferable to $$ ... $$?). What are you after? Should they be the same? If so, which one do you prefer?
    – Werner
    Nov 29, 2018 at 1:52
  • 1
    align is intended to be used for multi-line, not single line, displays. Nov 29, 2018 at 2:31
  • @Werner I want the same vertical space before and after align environments, just like other displayed formulas.
    – Z.H.
    Nov 29, 2018 at 5:31
  • @Z.H.: Then you should not adjust \lineskiplimit.
    – Werner
    Nov 29, 2018 at 5:36
  • 1
    you may want to adjust \normallineskiplimit but having such a large value for \lineskiplimit seems very odd Nov 29, 2018 at 9:48

1 Answer 1

3

According to @DavidCarlisle's comment, the problem could be fixed with

\normallineskiplimit=\lineskiplimit

enter image description here

2
  • it have been nice if ask David first, if he would extend his comment to the answer ...
    – Zarko
    Dec 7, 2018 at 12:08
  • @Zarko I have waited for the answer for one week. Apparently he is not interested in answering this question.
    – Z.H.
    Dec 7, 2018 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.