GeneralPlacing text and a graphic dead center on a page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

Placing text and a graphic dead center on a page

Post by tripwire45 »

I can center text using /centering or alternately:

Code: Select all

\begin{center}
Some stuff
\end{center}
but I need to center a three-line block of text dead center in a page...both horizontally and vertically. Is there a way to do this in percentages rather than absolute values? Also, I need to place a logo dead center on a page (the final page of a document). I imagine it's a similar task, but perhaps not. The image can't "float" since I don't want it to be "pushed around" just because I edit another page of the document.

Sorry for the pesky questions. I've really been working Google hard today, but alas, it doesn't always produce the answers I need (however, it has saved this forum from quite a few more questions, so it's not a total loss). ;)

-Trip

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Placing text and a graphic dead center on a page

Post by Stefan Kottwitz »

Hi Trip,

try the vertical spacing with \vspace*{\fill}:

Code: Select all

\documentclass[a4paper,10pt]{article}
\begin{document}
\vspace*{\fill}
\begingroup
\centering
one

two

three

\endgroup
\vspace*{\fill}
\end{document}
Stefan
User avatar
tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

Re: Placing text and a graphic dead center on a page

Post by tripwire45 »

Works great. Thanks. I'll have to wait until I'm at work tomorrow to test it out with the document's logo. :)
User avatar
tripwire45
Posts: 129
Joined: Thu Apr 10, 2008 4:35 am

Re: Placing text and a graphic dead center on a page

Post by tripwire45 »

Just wanted to get back to you, Stefan. It works great with both text and graphics. Thanks for the tip. :)

-Trip
Post Reply