titlepage is not vertically centered

1,881

When you have markup such as

Submitted on Date \\
\vspace{1cm}
name 

the vertical space is added after the line that contains name which is, I would guess, not what is intended.

Avoid all use of \\ outside tables, and always put a blank line before \vspace

Submitted on Date

\vspace{1cm}
name 

produces an output with the space between the two lines of text.

If you have a size change such as \huge always leave a blank line before the end of the group, or you will get huge text set on a normal size baseline.

Don't use figure inside a titlepage, just include the graphic.

You can vertically centre with \vspace*{\fill}

enter image description here

\documentclass[12pt, oneside]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{float}
\usepackage[american]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[onehalfspacing]{setspace}
\usepackage{graphicx}
\begin{document}

\begin{titlepage}
\vspace*{\fill}
\begin{center}

\begin{huge}
name of university

\end{huge}


\includegraphics[width=0.5\textwidth]{example-image}


\vspace{1cm}
{\Large name of institute

}

\vspace{5mm}
Research focus \textit{research name} \\
Project \textit{project name}

\vspace{1.5cm}

\begin{large}
\textbf{title of thesis}

\end{large}

\vspace{5mm}
Master thesis in Biomedical Sciences \\
Submitted on Date 

\vspace{1cm}
name \\
Matriculation number:

\vspace{1.5cm}
\begin{tabular}{rl}
{\bfseries Supervisors} & name and name\\
{\bfseries Examiners} & name and name \\
\end{tabular}

\end{center}
\vspace*{\fill}
\end{titlepage}

\end{document}
Share:
1,881

Related videos on Youtube

cara
Author by

cara

Updated on May 04, 2020

Comments

  • cara
    cara over 3 years

    I noticed that my titlepage is not vertically centered. I tried \vfill, \vspace{\fill}, \vspace*, and \usepackage{titling}.

    \documentclass[12pt, oneside]{article}
    
             \usepackage{graphicx}
    
    \usepackage{geometry}
    \geometry{a4paper}
    \usepackage{float}
    \usepackage[american]{babel}
    \usepackage[T1]{fontenc}
    \usepackage[latin1]{inputenc}
    \usepackage[onehalfspacing]{setspace}
    
    \begin{document}
    
    \begin{titlepage}
    \begin{center}
    
    \begin{huge}
    name of university \\
    \end{huge}
    
    \begin{figure}[H]
    \centering
    \includegraphics[width=0.5\textwidth]{Unilogo}
    \end{figure}
    
    \vspace{1cm}
    {\Large name of institute} \\
    \vspace{5mm}
    Research focus \textit{research name} \\
    Project \textit{project name} \\
    \vspace{2cm}
    \begin{large}
    \textbf{title of thesis} \\
    \end{large}
    \vspace{5mm}
    Master thesis in Biomedical Sciences \\
    Submitted on Date \\
    \vspace{1cm}
    name \\
    Matriculation number: \\
    \vspace{2.5cm}
    \begin{tabular}{rl}
    {\bfseries Supervisors} & name and name\\
    {\bfseries Examiners} & name and name \\
    \end{tabular}
    
    \end{center}
    \end{titlepage}
    
    \end{document}
    
    • Dr. Manuel Kuehner
      Dr. Manuel Kuehner over 6 years
      Add \usepackage[showframe]{geometry} and see that it is almost centered. Are you aware that the (top/bottom) margins are not automatically symmetric?
    • cara
      cara over 6 years
      Yes, but do they have to be? I thought \geometry{a4paper} does not need any modifications, does it?
    • Dr. Manuel Kuehner
      Dr. Manuel Kuehner over 6 years
      I suggest that you have a look at the geometry documentation (ctan.org/pkg/geometry). Try \usepackage[showframe,margin=10mm]{geometry} as a start so see the effect.
    • Skillmon
      Skillmon over 6 years
      Just a side note: DON'T USE FLOATS!!! You want the image to be placed exactly where you put it in your code? Then get rid of the figure-environment and just use \includegraphics.
    • Johannes_B
      Johannes_B over 6 years
      Please have a look at title creation and maybe tex.stackexchange.com/a/210280/37907
    • David Carlisle
      David Carlisle over 6 years
      Your example document produces ! Undefined control sequence. l.21 \includegraphics