I've been searching how to center a piece of text vertically on a page, since I wanted to create a cover for my reports with the Title centered both vertically and horizontally. I first tried the following code:
\vfil
\centerline{Title}
\vfil
\eject\end
But this isn't centered vertically. So I found
this answer, and so I added \leavevmode to the beginning of the file. And it worked! I also tried putting instead \indentat the beginning of the original. And it also worked!
So my question is: Why do you need to start a paragraph or "leave vertical mode" before the first \vfil in order for the glue to work in centering the text veertically on the page? It all seems very odd, indeed.
\nullor\hbox{}or... many other options. The reason/idea of discarding glue at the top of a page is similar to discarding glue at the start of a line: after a line/page break, you don't want “leftover” glue from the previous line/page to affect the current one. – ShreevatsaR Jan 21 '19 at 18:46\vspaceis latex only. – barbara beeton Apr 10 '19 at 01:07