2

I am compiling my thesis using Latex, which eventually generates a PDF file. In addition to its textual content, I want to insert a graphical image (.png) as its cover page. This is what I am doing with the help of titlepic, pdfpages Latex packages.

In my permeable:

\usepackage{titlepic}
\usepackage{pdfpages}

In my document class:

\begin{document}
\includepdf[pages=1]{./figures/ThesisCover.png}
\end{document}

Now this brings the following Latex error:

! Undefined control sequence. l.31 \if@titlepage The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

Can anybody shed a light on how to solve this problem ?

Thanks

3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented 17 hours ago
  • 1
    Please reduce your code to a concise MWE, which compiles and shows your problem and post it here. Use example-image or provide yours. This process of reducing code is an important step: it may reveal the mis-take to you AND activates the skilled community here. Thank you Commented 17 hours ago
  • With \includepdf[pages=1]{./figures/ThesisCover.png} you try to include page 1 of the PDF compile of your cover, which doesn't exist. pdfpages doesn't do that, see manual at ctan.org/pkg/pdfpages ; use package graphicx instead, see also tex.stackexchange.com/a/755844/245790 Commented 14 hours ago

1 Answer 1

4

I suggest reading carefully the titlepic-manual.

If you don't like the limited way of covers, create your own titlepage. This .pdf provides many examples how to do that. See also these questions for more code examples. E.g. this answer uses the titlepage environment and might catch your attention. // Also, get your inspiration here. And with some patience find some gems here, too (Showcases: showcase-of-beautiful-typography-done-in-tex-friends).

\documentclass[titlepage]{article}  % see titlepic-manual !
\usepackage[tt]{titlepic}           % see titlepic-manual !

\usepackage{lipsum}         % for blindtext
\usepackage{graphicx}       % provides example images


\title{Testtitle}
\author{Test, Author}

\titlepic{\includegraphics[width=\textwidth]{example-image-duck}}

% ~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}

\maketitle
\tableofcontents

\section{Some section}
\lipsum[1-2]

\section{Other section}
\lipsum[4-5]

\end{document}

result

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.