0

I try to place an array of figures (logos) on top of my titlepage by using \pretitle:

\documentclass[a4paper]{article}
\title{\textbf{Title\vspace{0.4cm}}}
\author{Name \\\\ \textit{Institution}}
\date{\vspace{-2ex}}

\usepackage{graphicx}
\usepackage{subfig}
\usepackage[
top    = 2.2cm,
bottom = 2.35cm,
left   = 2.35cm,
right  = 2.35cm]{geometry}
\setlength{\skip\footins}{0.8cm}
\setlength{\footnotesep}{0.5cm}
\usepackage{titling}

\pretitle{%
\begin{center}
\LARGE
\vspace*{-2cm}
\hspace{-0.3cm}
\begin{figure}
\begin{minipage}[t][3cm]{0.25\linewidth}
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\subfloat{\includegraphics[width=3cm,height=3cm]{logo1.png}}}
\end{minipage}%
\begin{minipage}[t][3cm]{0.25\linewidth}
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\subfloat{\includegraphics[width=3cm,height=3cm]{logo2.png}}}
\end{minipage}
\begin{minipage}[t][3cm]{0.25\linewidth}
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\subfloat{\includegraphics[width=3cm,height=1.45cm]{logo3.png}}}
\vfill
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\subfloat{\includegraphics[width=3cm,height=1.45cm]{logo4.png}}}
\end{minipage}%
\begin{minipage}[t][3cm]{0.25\linewidth}
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\subfloat{\includegraphics[width=3cm,height=3cm]{logo5.png}}}
\end{minipage}
\end{figure}
\hspace{0.4cm}
}
\posttitle{\end{center}}

\begin{document}
\maketitle
\end{document}

However, the logos appear at the bottom and not at the top. How can I fix this?

Edit in response to the comment: The logos appear at the top if I use

\begin{minipage}[t]{0.2\textwidth}
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\includegraphics[width=\textwidth]{logo1.png}}
\end{minipage}
\begin{minipage}[t]{0.2\textwidth}
\raisebox{\dimexpr \ht\strutbox-\totalheight}{
\includegraphics[width=\textwidth]{logo2.png}}
\end{minipage}

in the \pretitle environment instead of \begin{figure}. Therefore, this should in principle also work in the article class, not only in report.

Thomas
  • 435
  • They appear at the bottom because of the definition of article. If you use the report-class for example, they appear at the top of page. You can build your custom titlepage utilizing the titlepage environment. – Skillmon Aug 25 '17 at 12:55
  • My comment wasn't about the use of \begin{figure} (I wanted to write this comment just now...) – Skillmon Aug 25 '17 at 13:04
  • 1
    Never use a figure environment within the definition of a title. NEVER. – Johannes_B Aug 25 '17 at 13:07
  • By the way, have you seen https://tex.stackexchange.com/questions/209993/how-to-customize-my-titlepage/210280#210280? – Johannes_B Aug 25 '17 at 13:15

2 Answers2

2

How about that titlepage:

\documentclass[a4paper]{article}
\title{\textbf{Title}}
\author{Name}
\newcommand*{\institution}{\textit{Institution}}
\date{\vspace{-2ex}}


\usepackage{graphicx}
\usepackage{subfig}
\usepackage[
top    = 2.2cm,
bottom = 2.35cm,
left   = 2.35cm,
right  = 2.35cm]{geometry}
\setlength{\skip\footins}{0.8cm}
\setlength{\footnotesep}{0.5cm}


\begin{document}
\begin{titlepage}
    \centering%
        \LARGE%
        \vspace*{-2cm}%
        \begin{minipage}[t][3cm]{0.25\linewidth}%
        \raisebox{\dimexpr \ht\strutbox-\totalheight}{%
        {\includegraphics[width=3cm,height=3cm]{example-image}}}%
        \end{minipage}%
        \begin{minipage}[t][3cm]{0.25\linewidth}%
        \raisebox{\dimexpr \ht\strutbox-\totalheight}{%
        {\includegraphics[width=3cm,height=3cm]{example-image-a}}}%
        \end{minipage}%
        \begin{minipage}[t][3cm]{0.25\linewidth}%
        \raisebox{\dimexpr \ht\strutbox-\totalheight}{%
        {\includegraphics[width=3cm,height=1.45cm]{example-image-b}}}%
        \vfill%
        \raisebox{\dimexpr \ht\strutbox-\totalheight}{%
        {\includegraphics[width=3cm,height=1.45cm]{example-image-c}}}%
        \end{minipage}%
        \begin{minipage}[t][3cm]{0.25\linewidth}%
        \raisebox{\dimexpr \ht\strutbox-\totalheight}{%
        {\includegraphics[width=3cm,height=3cm]{example-image}}}%
        \end{minipage}%
    \vfill
    \makeatletter
    {\Huge\@title}
    \vskip0.6cm
    {\LARGE\@author}
    \vskip0.4cm
    {\LARGE\institution}
    \vfill
    \@date
    \vfill
    \vfill
    \makeatother
\end{titlepage}
\end{document}

enter image description here

Skillmon
  • 60,462
  • Why are you defining a new command for institution instrad of using the replacement text directly? Same fir @author. – Johannes_B Aug 25 '17 at 13:13
  • @Johannes_B well, \@author because this is close to standard behavior, and \institution to provide a similar interface for that. Same for \@title and \@date... – Skillmon Aug 25 '17 at 13:16
1

Since you use a figure environment, TeX will place it where best fitted inthe page. And that is at the bottom. Below I removed all the float stuff and used one \raisebox for all the minipages (I also removed the logo files):

\pretitle{%
  \begin{center}
    \LARGE
    \vspace*{-2cm}
    \hspace{-0.3cm}
    \raisebox{\dimexpr \ht\strutbox-\totalheight}{%
      \begin{minipage}[b][3cm]{0.25\linewidth}
        \centering\includegraphics[width=3cm,height=3cm]{example-image}
      \end{minipage}%
      \begin{minipage}[b][3cm]{0.25\linewidth}
        \centering\includegraphics[width=3cm,height=3cm]{example-image}
      \end{minipage}%
      \begin{minipage}[b][3cm]{0.25\linewidth}
        \centering\includegraphics[width=3cm,height=1.45cm]{example-image}
        \vfill
        \includegraphics[width=3cm,height=1.45cm]{example-image}
      \end{minipage}%
      \begin{minipage}[b][3cm]{0.25\linewidth}
        \centering\includegraphics[width=3cm,height=3cm]{example-image}
      \end{minipage}}
    \rule{0pt}{4cm}
  }
  \posttitle{\end{center}}

enter image description here

StefanH
  • 13,823