我正试图将我的文档部件显示为:
A.叙述%\部分
正文..。
B.附录%\部分{附录}
附录正文..。
我见过其他人用:
\renewcommand{\thepart}{\Alph{part}} 然而,由于某种原因,这对我没有用。我的角色表现为:
A部分
叙述性
正文..。
B部分
附录
附录正文..。
有人有什么想法吗?
发布于 2017-03-18 03:07:05
下面的最小示例更新\part以不同地设置其编号。更具体地说,它移除\partname - Part -前缀,并将标题保留在同一行中。字体也会被更新,以便在\part和\part*中使用\part*设置部件。上述所有更新都是使用etoolbox的\patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}宏完成的,该宏在<cmd>中执行<search>和-<replace>。

\documentclass{article}
\usepackage{lipsum,etoolbox}
\renewcommand{\thepart}{\Alph{part}}
\makeatletter
% Change part display; also uniform size of \LARGE\bfseries
\patchcmd{\@part}% <cmd>
{\Large\bfseries \partname\nobreakspace\thepart \par\nobreak}% <search>
{\LARGE\bfseries \thepart.\quad}% <replace>
{}{}% <success><failure>
\patchcmd{\@part}{\huge}{\LARGE}{}{}
\patchcmd{\@spart}{\huge}{\LARGE}{}{}
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}
% \@addtoreset{section}{part} % Reset section counter with every part
\makeatother
\begin{document}
\part{Narrative}
\section{Intro}
\lipsum[1]
\part{Appendix}
\section{Derivations}
\lipsum[2]
\end{document}如果您希望用每一个新的\section重新设置\part数字,请取消对序言中引用该数字的行的注释。
发布于 2017-03-15 14:43:05
你的想法是正确的,但你也重新定义了标题格式。
来自下面的link
\usepackage{titlesec}
\renewcommand{\thepart}{\Alph{part}}
\makeatletter
\titleformat{\part}[display]
{\Huge\scshape\filright}
{\thepart~\partname}
{20pt}
{\thispagestyle{plain}}
\makeatotherhttps://stackoverflow.com/questions/42796032
复制相似问题