TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I vertically center the text on a page?

share|improve this question
up vote 31 down vote accepted

The memoir document class provides, among a lot of other excellent things, the vplace environment.

Try:

\begin{vplace}[0.7]
This is some text to be centred vertically.
\end{vplace}

[0.7] is an optional parameter specifying the ratio of space above to space below. The default value is [1].

share|improve this answer
    
This is great! I am using memoir, so I prefer this solution. – Neil G Aug 27 '10 at 7:05
2  
Fantastic! I think we ought to start a memoir fanclub... – Brent.Longborough Aug 27 '10 at 11:49
1  
I haven't tried your code above. But I am not sure your code will produce an exact vertically-centered object since I notice your code does not specify \topskip0pt right before \begin{vplace}[1]. For more details, see tex.stackexchange.com/questions/7286/… – xport Dec 23 '10 at 2:30
    
@JoeCorneli Thanks for your suggested edit. I've left the brackets, simply to emphasise that it's an optional parameter, and reworded to clarify the rest. – Brent.Longborough Mar 7 '13 at 9:52
1  
Perhaps the anonymous down-voter would care to share his/her reasons here, so that I, and others, can learn and improve? – Brent.Longborough Oct 19 '14 at 12:37

This is what I found:

\begin{document}
\topskip0pt
\vspace*{\fill}
text
\vspace*{\fill}
%
\end{document}
share|improve this answer
1  
Very useful for stuff that does not take the placement modifiers, like equations. thanks – rll Jan 8 at 11:17
1  
With this suggestion, I get a perfect vertically center text on a page, but I get several blank pages in other areas of the document. – Jh0an1 Uzca73gu1 Jan 21 at 11:12
    
How do you solve the problem with extra blank pages like @Jh0an1Uzca73gu1 mentioned? – Daves Broadley Jan 21 at 15:24
    
@DavesBroadley Sorry, but I have no idea, I used the other solution. – Neil G Jan 21 at 16:09
    
I use the following code, suggestion of other tex.stackexchange.com thread: \clearpage \vspace*{\fill} \begin{center} \begin{minipage}{\textwidth} \centering{This is some text to be centred vertically.} \end{minipage} \end{center} \vfill % equivalent to \vspace{\fill} \clearpage – Jh0an1 Uzca73gu1 Jan 22 at 11:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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