Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am preparing a book with memoir. The book has three parts. I would like to have the Part title raised and to insert an image directly below the title. I am able to raise the Part title to the upper portion of the page, and to add an image, but the image falls on the following (normally blank) page (see minimum example, below).

How can I get the image to appear on the same page as the Part title, directly under it?

Here is the minimum example:

\documentclass[12pt,letterpaper]{memoir} %
\usepackage[T1]{fontenc}
\usepackage{eso-pic}
\usepackage[english]{babel}
\usepackage[demo]{graphicx}


\makeatletter
\renewcommand*{\beforepartskip}{\null\vskip-2cm}
\renewcommand*{\afterpartskip}{\par\vskip-5cm%
\@afterindentfalse\@afterheading}
\makeatother


\begin{document}

% \frontmatter
%
%
% \mainmatter

\part{This is the first part}
\AddToShipoutPicture*{%
% By default, eso-pic's zero coordinate is in the lower left corner
\put(\LenToUnit{3.5in},\LenToUnit{5.5in}){%
\includegraphics[height=25mm,keepaspectratio]{figs/PA-500942}%
}
}

\part{This is the second part}

\end{document}
share|improve this question

1 Answer 1

Using the same technique as in this question Adding a figure to a Part Page it's much easier to do with memoir:

First we define a command to set the image name for each part. This command takes the same arguments as the \includegraphics command from the graphicx package. Then we add the image to the memoir class \printparttitle command. You can play with the \vfil commands to change the vertical spacing as you require it.

\documentclass{memoir}
\usepackage[demo]{graphicx}
\makeatletter
% define a user command to choose the image
% this command also creates an internal command to insert the image
\newcommand{\partimage}[2][]{\gdef\@partimage{\includegraphics[#1]{#2}}}
\renewcommand{\printparttitle}[1]{\parttitlefont #1\vfil\@partimage\vfil}
\makeatother
\begin{document}
\partimage{foo.png}
\part{A part}
\partimage[width=\textwidth]{bar.png}
\part{Another part}
\end{document}

output of first part page

share|improve this answer
    
This is wonderful. Thanks very much for this answer! –  David Jan 10 '12 at 14:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.