0

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

 \usepackage[
  a4paper,
  top=2cm,
  bottom=2.5cm,
  left=4cm,
  right=3cm,
  headsep=25pt,
  headheight=14.5pt
]{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 ?

6
  • Are you using the `titlepage environment? Can you show a minimal example?
    – egreg
    May 23, 2015 at 21:08
  • I don't know if it is what you asked but I edited my post.
    – Babajaga
    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.
    – egreg
    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.
    – Babajaga
    May 23, 2015 at 21:34

1 Answer 1

1

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,
  headsep=25pt,
  headheight=14.5pt
]{geometry} % Page margins
\usepackage{mwe}

\begin{document}

\newgeometry{
  top=2cm,
  bottom=2.5cm,
  left=3cm,
  right=3cm,
  headsep=25pt,
  headheight=14.5pt
}
\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:

Output of sample code

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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