2

I want to vertically align the text to the middle of the page, if the text is not long enough to fill out the page.

For example if I write 1,5 pages: The first page is full and therefore the text is automatically aligned to the middle in a sense. This is because there is no more space above or below it within the text area. It is full. The second page is half full, and I want that page to align to the middle of the page, with the distance between the top and the bottom being equal (or there abouts)

I have tried vplace but it only works, if the text is confined to one page. I want it to work, regardless of whether there are one or more pages in the document.

Mininal example that works (with one page):

\documentclass[12pt,a4paper,onecolumn,oneside,final]{memoir}
\usepackage{lipsum}
\begin{document}
\begin{vplace}
\lipsum[1]
\lipsum[1]
\end{vplace}
\end{document}

Mininal example that does not work (with one and a half page):

\documentclass[12pt,a4paper,onecolumn,oneside,final]{memoir}
\usepackage{lipsum}
\begin{document}
\begin{vplace}
\lipsum[1]
\lipsum[1]
\lipsum[1]
\lipsum[1]
\end{vplace}
\end{document}

I have also tried \makeatletter \let\@texttop\@textbottom \makeatother which doesn't seem to do anything.

  • 1
    I'm unclear as what you want to happen. Assume that there is some text before your middle text and there is some after it. and the middle text crosses the page. Presumably the middle text on the first page will just be in its regular position. On the second page where is the after text located? Is there a lot of whitespace above the remains of the middle text? I'm not sure that what you want is automatically possible as TeX sets text paragraph by paragraph, taking no notice of page breaks. – Peter Wilson Jun 5 '19 at 18:53
  • 1
    Hmmm, \advance\topskip by 0pt plus 1fil ? – John Kormylo Jun 5 '19 at 19:13
  • John Kormylo: I have no idea what that means. – Faergen Jun 6 '19 at 4:17
  • Peter Wilson: I want the text to align to the vertical middle of the page. If there is a line of text, I want that line to be as far away from the top as it is from the bottom. fx if I write 1,5 pages. The first page is full and therefore the text is o automatically aligned to the middle in a sense. This is because there is no more space above or below it, within the text area. It is full. The second page is half full, and I want that page to align to the middle of the page, the distance between the top and the bottom being equal (or there abouts) – Faergen Jun 6 '19 at 4:22
  • 1
    Have you tried John Kormylo's suggestion? Put it into your preamble and remove the vplace environment, that should work. – schtandard Jun 6 '19 at 8:39
0

Put \advance\topskip by 0pt plus 1fil in the preamble and delete vplace as suggested in the comment by John Kormylo.

| improve this answer | |

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.