0

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}
6
  • Add \usepackage[showframe]{geometry} and see that it is almost centered. Are you aware that the (top/bottom) margins are not automatically symmetric? May 1, 2017 at 17:29
  • Yes, but do they have to be? I thought \geometry{a4paper} does not need any modifications, does it?
    – cara
    May 1, 2017 at 17:44
  • 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. May 1, 2017 at 17:49
  • 1
    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.
    – Skillmon
    May 1, 2017 at 19:33
  • Please have a look at title creation and maybe tex.stackexchange.com/a/210280/37907
    – Johannes_B
    May 2, 2017 at 5:16

1 Answer 1

1

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .