Center Text Vertically in A Page in LaTeX Using \vspace* Command

May. 27, 2024 • Updated Nov. 10, 2025

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}

\usepackage{lipsum}

\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{showframe}

\begin{document}

\vspace*{\fill}
\lipsum[1-2]
\vspace*{\fill}

\end{document}

png-1

Note that, we should use \vspace* command rather than \vspace, otherwise we can’t get expected results. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}

\usepackage{lipsum}

\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{showframe}

\begin{document}
	
\vspace{\fill}
\lipsum[1-2]
\vspace{\fill}

\end{document}

png-1

This is because1:

The command \vspace is used to add vertical space between lines, paragraphs, or sections. It works well in the middle of a page, but at the start or end of a page, LaTeX may ignore it.

The command \vspace* is a stronger version. Unlike \vspace, it does not get ignored at the top or bottom of a page. This makes it perfect when you must ensure extra space stays visible in all positions.

References