我想在零件页面上的零件标题下方添加一个图形。如何使用类来实现这一点amsbook
?
\documentclass{amsbook}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\part{Part Title (Figure Below)}
\lipsum[1-2]
\end{document}
答案1
使用类中的定义amsbook
,您可以按以下方式插入图像:
\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}
要为每个部分添加不同的图像,请\partimage{}
在每个\part{}
命令之前发出一个新命令。