# Center a title when left and right margins are not the same

I am using different margins for the left and right side :

 \usepackage[
a4paper,
top=2cm,
bottom=2.5cm,
left=4cm,
right=3cm,
]{geometry} % Page margins


Here is how I generate my title :

\author{Me}
\title{Rapport}
\date{today}

\begin{document}
\maketitle


When I use the maketitle command, the title is not centered on the page. How to center it relatively to the page ?

• Are you using the titlepage environment? Can you show a minimal example? May 23, 2015 at 21:08
• I don't know if it is what you asked but I edited my post. May 23, 2015 at 21:13
• @Babajaga: What \documentclass are you using?
– Werner
May 23, 2015 at 21:15
• @Babajaga It doesn't make much sense to center the title if the text block is shifted to the right. May 23, 2015 at 21:17
• I am using extreport I need to center it because I have an image as backgroud and the text is not fiting well when it is shiofted. May 23, 2015 at 21:34

Probably, this is one of those rare cases in which it is preferable to add another answer, rather then editing the one I already gave; indeed, I dislike my previous answer so much that I’ll probably remove it. The following, obvious solution is much neater:

\documentclass[a4paper,twoside,titlepage]{article}
\usepackage[T1]{fontenc}
\usepackage[
a4paper,
top=2cm,
bottom=2.5cm,
left=4cm,
right=3cm,
]{geometry} % Page margins
\usepackage{mwe}

\begin{document}

\newgeometry{
top=2cm,
bottom=2.5cm,
left=3cm,
right=3cm,
}
\begin{titlepage}
\centering
\null\vfil
{\LARGE My Not-so-beautiful document\par}
\vspace{2pc}
{\large Etc.\ etc.\par}
\vfil
\includegraphics{image}
\vfil\null
\end{titlepage}

\restoregeometry

\lipsum[1-20]

\end{document}
`

The first page looks like this:

• The new geometry and restore geometry fixed it, thank you. May 24, 2015 at 7:41
• I have deleted my previous answer, as announced.
– GuM
May 24, 2015 at 11:48