1

how can I include an image undernearth the title on the same page as the part title in report class?

For example, the code

\documentclass{report}
\usepackage{graphicx}

\begin{document}
\part{Space and time}
\includegraphics{the_cosmos.pdf}
\end{document}

produces the image on the page after the part title. I would like it directly underneath.

I have found quite a few posts related to this, but none of them seem to implement for me when using report class.

  • \part always takes up an entire page.. – John Kormylo Aug 9 at 19:27
  • The memoir class (superset of book and report) provides methods for including extra things on a part page. – Peter Wilson Aug 10 at 16:35
3

You can add the image as part of the title argument to \part. This requires that you also use the optional first argument to \part, which is used for the table of contents (which is normally used for shorter titles, i.e., \part[short title]{long title}). If you don't do this then \part will try to write the image to the table of contents, which gives an error, and even if it would succeed it would not be desired. Of course you can choose to use the same text as 'short' and 'long' title.

Other elements can be added in the same way, by using a line break and the additional contents. However, because it is part of the argument to the \part command, the contents cannot contain a paragraph break, a float, or similar elements that influence page layout. If you want a caption this means that it should be added as a regular line of text. In the MWE below there is a linebreak, the font size and style (bold/regular) is adjusted, and the caption text is added.

MWE:

\documentclass{report}
\usepackage{graphicx}

\begin{document}
\tableofcontents
\part[Space and time]{Space and time\\[1cm]\includegraphics{example-image}\\\normalsize\normalfont The beauty of the universe. Image from Hubble telescope.}

\end{document}

Result:

enter image description here

Note that a newline is added (\\) with a bit of extra space as optional argument ([1cm]). You can remove the optional extra space if you want the image to be directly below the title.

  • Thanks for your answer @Marjin! Could you tell me how to add a caption at the bottom? For example: \part[Space and time]{Space and time\[1cm]\includegraphics[width=.6\textwidth]{example-image} \caption{The beauty of the universe. Image from Hubble telescope.}} does not run – Aerinmund Fagelson Aug 9 at 19:49
  • @AerinmundFagelson I've edited the answer to include a caption. – Marijn Aug 10 at 7:36
  • Thanks @Marijn! This does seem like a bit of a hack, but works a treat for my purposes :) – Aerinmund Fagelson Aug 10 at 13:13
  • 1
    @AerinmundFagelson let's call it a workaround :) the report class is not intended for this kind of usage, so the 'proper' way would be to rewrite the relevant portions of the class to accomodate custom title pages. But that would be a lot of work, so I opted for this solution instead. – Marijn Aug 10 at 13:23

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.