Replace \maketitle with a image in Latex

#latex, #software

Latex is a great tool if you are writing anything; from a simple article to a complex book. I wrote my last CV in Latex. But sometimes it is hard to configure… sometimes it is just too automatic.

Initial file

If you have this very minimal Latex file:

\documentclass{book}

\title{This is a \LaTeX file}
\author{Dmitry Rocha \and John Doe}
\date{Jan 2017}

\begin{document}
\maketitle

\chapter{Test}

This is a test.

\end{document}

The default output of \maketitle is:

Default render of \maketitle

But what if you have a good cover? Maybe you have hired someone to only create a cover page for your book, article, …

Instead of calling \maketitle you can add a image or other PDF file as a full page.

Using an image

First you need to add a package called pdfpages and after that you will have to use \includepdf{otherfile.pdf}. For our very minimal example it will something like:

\documentclass{book}

\usepackage{pdfpages}

\title{This is a \LaTeX file}
\author{Dmitry Rocha \and John Doe}
\date{Jan 2017}

\begin{document}

\includepdf{cover.pdf}

\chapter{Test}

This is a test.

\end{document}

Some notes:

  • Don’t forget that this new pdf file must have the same size (or at least the same aspect ratio);
  • You can use a png/jpg if you have one.

References

Post cover by: Designed by Freepik