0

I am trying to typeset some content to the top of the page and some to the bottom of the page and both should be centered. Initially I tried this:

\documentclass{scrbook}
\usepackage{showframe}
\begin{document}
\begin{center}
    Top
    \vfill
    Bottom
\end{center}
\end{document}

However this leaves whitespace between the word Bottom and the actual bottom of the page:

enter image description here

If I am using \centering instead I acheive my result, but I don't understand why and I thin the environment would be the more logic approach, then the \centering switch.

\documentclass{scrbook}
\usepackage{showframe}
\begin{document}
{\centering
    Top
    \vfill
    Bottom

}
\end{document}

Result as expected:

enter image description here

The same is true for flushleft and I therefore think it might be expected behaviour, but would like to understand how to prevent it and use the correct approach.

  • 3
    because adding that white space is the main purpose of center as it is a "display" environemnt intended to offset an item from the surrounding text. There is an answer already on site, I'll find... – David Carlisle May 26 at 11:30
  • OK, so I defined my own environments which just call \centering and \raggedright and \par at the end. Do you want to mark this as a duplicate, or shall I answer what I did based on your comment? – TobiBS May 26 at 13:24
  • question is a bit different but answer is same, I'll mark it as dup I think. – David Carlisle May 26 at 13:31