我正在居中一段文字:
\documentclass{memoir}
\renewcommand{\partpageend}{} %% can write after part title
\usepackage{graphicx}
\renewcommand{\beforepartskip}{% added <<<<<<<<<<<<<<<<<
\centering
\includegraphics[width=0.4\linewidth]{example-image}
\par\vfill
}
\begin{document}
\part{This is a title}
\begin{center}
\textbf{This text is being centered and that's what I want.}
\vfill
\end{center}
\newpage
This text should not be centered anymore.
This text should not be centered anymore.
This text should not be centered anymore.
This text should not be centered anymore.
This text should not be centered anymore.
This text should not be centered anymore.
This text should not be centered anymore.
This text should not be centered anymore.
\end{document}
但\end{center}
其他一切仍处于中心地位。
先感谢您。
答案1
正如@HeikoTheißen 在评论中指出的那样,您遇到的居中问题是因为\centering
定义中的命令\beforepartskip
不在 (TeX) 组中,因此仍然存在。事实上,该文档还单独介绍了center
环境,并不重要。
解决此问题的一种方法是更换
\renewcommand{\beforepartskip}{% added <<<<<<<<<<<<<<<<<
\centering
\includegraphics[width=0.4\linewidth]{example-image}
\par}\vfill
}
和
\renewcommand{\beforepartskip}{{% added <<<<<<<<<<<<<<<<<
\centering
\includegraphics[width=0.4\linewidth]{example-image}
\par}\vfill
}
{
您能发现和的额外实例}
吗?