18.11.12

Adding a figure to a Part Page


Using the definition from the amsbook class, you can insert an image in the following way:
\documentclass{amsbook}
\usepackage[demo]{graphicx} % remove the demo for actual use
\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}}}
% redefine the amsbook part code to include the \@partimage insertion command
\def\@part[#1]#2{%
  \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}%
    \addcontentsline{toc}{part}{\partname\ \thepart.
        \protect\enspace\protect\noindent#1}%
  \else
    \addcontentsline{toc}{part}{#1}\fi
  \begingroup\centering
  \ifnum \c@secnumdepth >-2\relax
       {\fontsize{\@xviipt}{22}\bfseries
         \partname\ \thepart} \vskip 20\p@ \fi
  \fontsize{\@xxpt}{25}\bfseries
      #1\vfil\@partimage\vfil\endgroup \newpage\thispagestyle{empty}}
\makeatother
\usepackage{lipsum}

\begin{document}
\partimage{myimage} % \partimage behaves just like \includegraphics (same arguments)
\lipsum[1-2]
\part{Part Title (Figure Below)}   
\lipsum[1-2]

\end{document}
To add a different image for each part, issue a new \partimage{} command before each\part{} command.

output of code

No hay comentarios:

Publicar un comentario