6

In my LaTeX document (report) I would like to insert two graphics on top of the title page. Here is a code which already worked in a beamer document:

\titlegraphic{\begin{columns}
\begin{column}{0.5\textwidth}
    \begin{figure}%
    \includegraphics[width=\columnwidth]{pictures/pic1.jpg}%
    \end{figure}
\end{column}
\begin{column}{0.5\textwidth}
    \begin{figure}%
    \includegraphics[width=\columnwidth]{pictures/pic2.jpg}%
    \end{figure}
\end{column}\end{columns}}

In \documentclass{report} 14 errors are returned. The first one is

undefined control sequence \titlegraphic
{\begin{columns}
LaTeX Error: Environment columns undefined`.

2 Answers 2

5

The beamer class defines the columns and column environments, which are really just like the minipage environment, except that they know all about beamers clever tricks; they are overlay aware.

The other document classes don't know about the columns or column environment unless you tell them. A simple fix would be to load the titlepic package, for example, and then use something like the following code:

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{report}
\usepackage{titlepic}
\usepackage{graphicx}
\title{Graphics in report}
\author{me}
\begin{document}


%\titlegraphic{\begin{columns} <!-- old
\titlepic{%\begin{columns} %    <!-- new
    \begin{minipage}{0.5\textwidth}
        %\begin{figure}%            <!-- new
        \includegraphics[width=\textwidth]{example-image-a}%
        %\end{figure}               <!-- new
    \end{minipage}%
    \begin{minipage}{0.5\textwidth}
        %\begin{figure}%
        \includegraphics[width=\textwidth]{example-image-b}%
        %\end{figure}
    \end{minipage}
    %\end{columns}
}

\maketitle

\end{document}

You'll want to change the images back to the ones you were using before :)

2

A "quick'n dirty" method without loading additional packages could be the direct use of \includegraphics inside \title{}

\documentclass{report}
\usepackage{graphicx}
\title{
\includegraphics[width=0.3\textwidth]{image-a} \\
Fancy title \\
\includegraphics[width=0.4\textwidth]{image-b} 
}
\author{Someone}
\begin{document}

\maketitle

Text

\end{document}

Works also fine together with \minipage{} if you need to group them side by side.

You must log in to answer this question.

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