5

I've been able to vertically align some text with \vspace*{\fill} but below the aligned line is some more text and a figure which causes the aligned line to be above the middle of the page. How can I make sure it's at the center (horizontally and vertically aligned) while keeping the text below it?

MWE:

\documentclass[11pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{titlepage}
\topskip0pt
\vspace*{\fill}
\centering
\resizebox{\linewidth}{!}{\parbox{5cm}{\centering \textsc{Metafysica \\ \& \\Natuurfilosofie}}} \\
\vspace*{\fill}
\begin{figure}[H]
\includegraphics[trim={0, 0.65cm, 0, 0},clip,width=0.30\linewidth]{logozw}
\end{figure}
\vspace{-3ex}
Universiteit Gent \\
Faculteit Letteren en Wijsbegeerte \\
Vakgroep Wijsbegeerte en Moraalwetenschap \\
Notities bij de lessen van professor V. D.
\end{titlepage}
\end{document}
5

You can build a zero height box with the standard LaTeX commands; you want a box that sits on the baseline with respect to the last line in it and has zero height:

\parbox[b][0pt]{\textwidth}{...}

does what you want.

I'd avoid \resizebox for the title: you better control the size with explicit font size changing commands.

\documentclass[11pt]{article}
\usepackage[demo]{graphicx} % demo is just for the example
\usepackage[pass,showframe]{geometry} % just to show the page frame

\begin{document}
\begin{titlepage}
\topskip0pt

\vspace*{\fill}

\centering

{\LARGE
  \textsc{Metafysica}\par
  \&\par
  \textsc{Natuurfilosofie}\par
}

\vspace*{\fill}

\parbox[b][0pt]{\textwidth}{
  \centering
  \includegraphics[trim={0, 0.65cm, 0, 0},clip,width=0.30\linewidth]{logozw}

  %\vspace{-3ex} % possibly useful, depending on the picture

  Universiteit Gent \\
  Faculteit Letteren en Wijsbegeerte \\
  Vakgroep Wijsbegeerte en Moraalwetenschap \\
  Notities bij de lessen van professor V. D.\par
  \vspace{-\prevdepth} % the descenders go under the baseline
}

\end{titlepage}
\end{document}

enter image description here

  • Why avoid the resizebox? What is a good way to increase the font size above \Huge? (Perhaps I'd better ask that last question somewhere else.) – Johannes Jun 26 '13 at 13:17
  • 1
    @Johannes You can also say \fontsize{24}{32}\selectfont or similar (the first argument is the font size, the second is the baselineskip). Assuming your font is freely scalable, it's more flexible and predictable. – egreg Jun 26 '13 at 13:25
5

Here's a different take on what you might be after:

enter image description here

\documentclass[11pt]{article}
\usepackage{array,graphicx}% http://ctan.org/pkg/{array,graphicx}
\begin{document}
\begin{titlepage}
  \centering\strut

  \vfill

  \scalebox{3}{\begin{tabular}{c}
    \textsc{Metafysica} \\ \& \\ \textsc{Natuurfilosofie}
  \end{tabular}}

  \vfill

  \noindent\strut\smash{\begin{tabular}[b]{@{}>{\centering\arraybackslash}p{\linewidth}@{}}
    \includegraphics[width=0.3\linewidth]{example-image-a} \\
    Universiteit Gent \\
    Faculteit Letteren en Wijsbegeerte \\
    Vakgroep Wijsbegeerte en Moraalwetenschap \\
    Notities bij de lessen van professor V.~D.
  \end{tabular}}
\end{titlepage}
\end{document}

The main approach is to \smash the contents of the lower portion of your titlepage. That way it takes up no vertical space on the page. For centering content, I've used a \linewidth-spanning tabular. You could also consider using the tikzpagenodes package to identify specific locations on the page for placement.

The frames added to the output is as a result of the showframe package.

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.