Page LayoutImage on Part Page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Moruk
Posts: 18
Joined: Sun Jun 12, 2011 2:00 pm

Image on Part Page

Post by Moruk »

Hi,

How can I use an image on the same page as the part (\part{Test}) is?

lg

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Image on Part Page

Post by localghost »

A combination of the epigraph and titlesec package will do.

Code: Select all

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}
\usepackage{titlesec}
\usepackage{epigraph}

\setlength{\epigraphwidth}{\textwidth}
\titleformat{\part}[display]
{\normalfont\huge\filcenter\bfseries\thispagestyle{epigraph}}
{\partname\ \thepart}
{20pt}
{\Huge}
\titlespacing*{\part}{0pt}{0pt}{40pt}

\begin{document}
  \epigraphhead[200]{\hfil\rule{6.4cm}{3.6cm}\hfil}   % replace \rule command with the image
  \part{Foo}
\end{document}

Thorsten
Moruk
Posts: 18
Joined: Sun Jun 12, 2011 2:00 pm

Re: Image on Part Page

Post by Moruk »

Ok, this works. But if I include the image, it appears on the part-page and on the tableofcontents-page.

And how can I assign the whole width of the page (= no margin) to the image?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Image on Part Page

Post by localghost »

Forget the last example I provided. It is much easier without any package. Instead you can use the optional argument for the \part command to get a proper entry in the ToC.

Code: Select all

\documentclass[11pt]{report}
\usepackage[T1]{fontenc}

\begin{document}
  \tableofcontents

  \part[Foo]{Foo\\[2ex]\makebox[0pt]{\rule{\paperwidth}{0.25\paperwidth}}}
\end{document}
For an external graphics file replace the \rule command with your image scaled to the paper width.

Code: Select all

\includegraphics[width=\paperwidth]{filename}
Moruk
Posts: 18
Joined: Sun Jun 12, 2011 2:00 pm

Image on Part Page

Post by Moruk »

hmmm... Is it possible like that http://kofler.info/uploads/pdf/userver2-sample.pdf, Page 15/19?
Post Reply