1

I'm using the align environment and now I have the problem that one of my formulas is the first object on a page with some vspace before it. But this looks a bit odd, because it isn't in line with the text of the previous page. Trying to use \vspace{-xcm} seems to have no effect. The same holds true for the equation environment, but there with not so much vspace.

How could I delete this unnecessary vspace and align the formula on top of the page where normal text would be?

MWE

\documentclass[12pt,a4paper,twoside]{scrbook} 

\usepackage{amsmath} 
\usepackage{amsfonts} 
\usepackage{lipsum}
    \usepackage{mathtools}

\begin{document}
    \lipsum[1-3]
    \newpage
    \lipsum[1-3]
    \newpage
    \begin{align}
                \intertext{Objective function}
                \min x \\
                \intertext{s.t.} 
        x < 5 \\
        x > 2 
    \end{align}
\end{document}
  • 1
    \vspace*{-\baselineskip}\vspace*{-\abovedisplayskip}; but it's better not starting a paragraph (or a page) with a display. – egreg Feb 15 '15 at 19:09
  • 1
    A page hardly ever start with a formula. So why are you doing this in the first place? – daleif Feb 15 '15 at 19:23
  • @daleif I shortened my question. The long version is a mathematical program with an align environment starting with a \shorttext{} command. So the page doesn't really start with a formula but with that text followed by the objective function. I could have exclude that text from the align environment, but I wanted to keep them together in one environment. – user2653422 Feb 15 '15 at 23:06
  • Please update the mwe to reflect this. I still do not see what the problem is. – daleif Feb 16 '15 at 7:55
  • 1
    Drop Objective... outside. \intertext is meant to be between lines, thus there is spacing above and below. Besides, generally a displayed equation should not start a page, which is why LaTeX goes to great length for that not to happen. – daleif Feb 16 '15 at 9:09
2

You shouldn't be using \intertext to start the display. And you're better using \shortintertext in the second case, in order to reduce the vertical spacing.

\documentclass[12pt,a4paper,twoside]{scrbook}

\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{lipsum}

\begin{document}
\lipsum[1-3]
\newpage
\lipsum[1-3]
\newpage
Objective function
\begin{align}
\min x \\
\shortintertext{s.t.}
x < 5 \\
x > 2
\end{align}
\end{document}

enter image description here

A display should never start a paragraph (nor be the first thing on a page).

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.