[Tex/LaTex] How to add a vertical line and figures on the titlepage

titles

I'm styling a titlepage for the first time and I'm having some problems. I'd like to achieve something like this:

Titlepage

The blue rectangles are logos. I've been trying to get it right for hours, but couldn't do any better than the code underneath.

\documentclass{article}

\usepackage{parskip}
\usepackage[export]{adjustbox}
\usepackage{float}

\textwidth 16cm \textheight 23cm
\evensidemargin 0cm \oddsidemargin 0cm

\begin{document}
\begin{titlepage}
    \begin{figure}[h]
        \includegraphics[width=5cm]{../my_image1.jpg}
    \end{figure}
    \hspace*{2cm} % Whitespace to the left of the title page
    \rule{1pt}{\vfill} % Vertical line
    \hspace*{1cm} % Whitespace between the vertical line and title page text
    \parbox[b]{13cm}{
        {\Huge\bfseries My title}
    }
    \begin{figure}[h]
        \includegraphics[width=5cm]{../my_image2.jpg}
    \end{figure}
\end{titlepage}

\end{document}

The problems are obvious:

  • The \vfill doesn't work. I'm trying to draw the line from beneath the upper logo to the end of the page.

  • The lower logo doesn't appear at the desired place.

I tried using minipages, but that didn't work out, as I don't have any experience with them. Would you like to tell me how to move on or give me some hints?

Best Answer

Indeed you can do it with minipage!
This is the closest i could get, it fits an a4 format, anyway. Just hard-coded:

titlepage latex

Here comes a brief explanation (code is following):

  • geometry helps to define margins and paper formats

  • adjustbox is one of the most useful package to do operation with boxes, here it is an extremely simple usage. \includegraphics comes from graphicx, invoked by adjustbox. The demo option puts black rectangles instead of the argument of \includegraphics

  • xcolor provides the command \color

  • as it's already being said, figure can cause some problems because it generates "mobile" images, whose position is determined by the engine

  • the command \vfill is used to put stretchable vertical distance between consecutive objects, it is not a dimension, so it doesn't work inside rule. \vfill is a replacement for \vskip\fill, and \fill is the dimension (apparently it doesn't work as argument of \rule either, this I cannot explain...)

I suggest you see more documentation about minipage, which is extremely useful to give a structure to the page. It allows to create custom boxes quite easily, they are extremely useful to house images and text.
Here lies a useful minimal overview on minipage at page 3:
http://www.ncl.ac.uk/maths/students/teaching/latex/session5.pdf

\documentclass{article}

\usepackage[demo]{adjustbox}
\usepackage{xcolor}

\usepackage[a4paper,top=25mm,left=20mm,textwidth=170mm,textheight=249.7mm]{geometry}

\begin{document}
\begin{titlepage}
    \color[rgb]{.4,.4,1}
    \hspace{5mm}
    \includegraphics[width=5cm,height=15mm]{../my_image1.jpg}

    \bigskip

    \hspace{20mm}
    \begin{minipage}{10mm}
        \color[rgb]{.7,.7,1}
        \rule{1pt}{226mm}
    \end{minipage}
    \begin{minipage}{133mm}
        \vspace{10mm}        
        \color{black}
        \sffamily
        \Huge\bfseries My title

        \vspace{30mm}

        Some more text
        \large

        \vspace{140mm}

        Some more text
        \hspace{30mm} % or \hfill, if you want the square sticked
        \color[rgb]{.4,.4,1} %                        to the right margin
        \includegraphics[width=3cm,height=3cm]{../my_image2.jpg}        
    \end{minipage}
\end{titlepage}
\end{document}
Related Question