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
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
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: 9201
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}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
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