0

I am trying to make a book in LaTeX. To the table of contents I want to add a image to the title. The problem is that the image is so long, that it reaches until almost half of the page. Is there a way to resize the image (just the lenght)?

My MWE is the following:

\documentclass[11pt,fleqn]{book}
\usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,letterpaper]{geometry}
\usepackage{xcolor}
\begin{document}
\chapterimage{image1.png} 
\pagestyle{empty}
\tableofcontent
\end{document}
4
  • 1
    Your MWE does not compile. What does the \chapterimage macro do? Please try to make your MWE compile. Mar 10, 2018 at 20:08
  • 1
    @PhelypeOleinik: \chapterimage is a command of the dreadful Legrand Orange Book template, which requires the inclusion of a structure.tex file, which isn't done here ... there might be other templates/packages/classes that have \chapterimage as well, but you're right: this 'MWE' can't be compiled
    – user31729
    Mar 10, 2018 at 20:11
  • 1
    Here is the Orange Book
    – user31729
    Mar 10, 2018 at 20:15
  • @ChristianHupfer Thanks! It's quite pretty :) Mar 10, 2018 at 20:25

1 Answer 1

1

If you are, as Christian Hupfer said, using the Dreadful Legrand Orange Book template then adding this to your preamble should do what you want:

\usepackage{etoolbox}
\makeatletter
\patchcmd\@makeschapterhead
  {\includegraphics[width=\paperwidth]{\thechapterimage}}
  {\includegraphics[width=\paperwidth,height=4.13333in]{\thechapterimage}}
  {}{}
\makeatother

The height=4.13333in was taken from the chapter_head_1.pdf, which is included in the template zip. Adjust it at your will.

3
  • The title isn't Dreadful .... -- that's only my name for it :D
    – user31729
    Mar 10, 2018 at 20:31
  • 1
    @ChristianHupfer I know. But I think it has more... Impact with the Dreadful :P Mar 10, 2018 at 20:35
  • Yes, I forgot the structure.tex code. Thank you, worked perfectly :)
    – user151562
    Mar 10, 2018 at 20:35

You must log in to answer this question.

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