# What is a good practice to achieve vertical placement? (e.g. a Titlepage)

My titlepage looks right now like this:

using this code:

\documentclass[a4paper,11pt,oneside,titlepage,german,final]{scrreprt}
\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{stfloats}
\begin{document}

\begin{titlepage}

\begin{flushright}
\textbf{\textsc{University XY}}\\
{\small{\textsf{Department Z\\}}}
\end{flushright}

\begin{center}
\bigskip
{\huge{Masterthesis}}\\
\bigskip
{\huge{\textbf{How to vertical align in Latex}}}\\
\bigskip
{\today}\\
\end{center}

\textbf{Author}
\smallskip
\hrule
\smallskip
\begin{tabular}{ll}
Some: & texts \\
\end{tabular}
\end{titlepage}
\end{document}


What I would like to know is, how I should define the placements of the text-elements properly and not as some gross, linebreak, lineskip disaster.

Where I would like to place the elemets:

1. the Univerity should stay at the top-right corner, right aligned
2. the author and following, should be at the bottom, left aligned, and in any case stay on this page
3. the title should be at the center between the University and the author
4. Masterthesis should be at between University and title
5. the date should be between title and author
6. I would like to be able to easily move Title, Masterthesis and date (to change their relative vertical distance)

Of course I could hack something, so that the output would met these requirements, but I am looking for a sound, a nice and dynamic solution - lacking of that much experience, I hope someone else has it. Many thanks in advance!

-
I'm sure your university has a design guide. Has your university also templates for masterthesis (maybe in Word, better LaTeX?). For eample classicthesis could be a solution, but it depends on the given rules of your university. For German language I knew a few templates. –  Kurt Oct 1 '12 at 17:53
Well, I found some templates, but not exactly from my University, which seems to have different style/design requirements even through the different workgroups of my department. However there seems not to be anything in Tex, at least not officially, so I am adapting to what is required and what I have seen in other works, but the Tex is up to me right now. Many thanks for the tip though! I looked up classicthesis - it looks very nice, this will surely help too. –  Jook Oct 2 '12 at 8:21

Here's a proposal:

\documentclass[a4paper,11pt,oneside,titlepage,final]{scrreprt}

\newcommand{\centeredelement}[2][]{\begingroup\centering#1#2\par\endgroup}

\begin{document}

\begin{titlepage}
\setlength{\parindent}{0pt}

\begin{flushright}
{\bfseries\scshape University XY}\\
{\small\sffamily Department Z\par}
\end{flushright}

\vspace{\stretch{.25}}

\centeredelement[\huge]{%
Masterthesis
}

\vspace{\stretch{.25}}

\centeredelement[\huge\bfseries]{%
How to vertical align in \LaTeX
}

\vspace{\stretch{.25}}

\centeredelement{\today}

\vspace{\stretch{.25}}

\textbf{Author}
\par
\smallskip
\hrule
\smallskip
\begin{tabular}{@{}ll@{}}
Some: & texts \\
\end{tabular}
\end{titlepage}
\end{document}


With \centeredelement we set something to the center; the optional argument consists of the font changes to be made.

You can play with the arguments to \stretch; here they are all equal, but you can set them to the fraction of space you prefer between the two elements.

-
Nice! Is \stretch provided by koma, or is it "available everywhere"? –  Brent.Longborough Oct 1 '12 at 18:13
@Brent.Longborough It's a standard command in the LaTeX kernel. –  egreg Oct 1 '12 at 19:12
Nice indeed! Works like a charm, but could you explain, why you created the centeredelement command? Because using \begin{center} works too - so what is the advantage? –  Jook Oct 2 '12 at 8:14
@Jook Actually center adds vertical space (as does flushright, to be honest). A personal command has the biggest advantage in being redefinable at will; so, if you finally opt for left aligned elements, you'd have only to act on the definition only. –  egreg Oct 2 '12 at 8:19
@egreg: Is \stretch equivalent to using \hfills? –  ℝaphink Oct 2 '12 at 10:04