默认章节如下:
“第1章”
我需要它
“1章”
我如何更改号码位置?我正在使用\documentclass[a4paper]{report}
答案1
使用默认report
文档类,您可以通过更新来切换这些条目\@makechapterhead
- 负责在编号章节中设置章节标题的宏。其默认定义是
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
插入。\@chapapp\space \thechapter
使用Chapter <num>
etoolbox
,我们可以修补这个并交换它们:
\documentclass{report}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\@makechapterhead}% <cmd>
{\@chapapp\space \thechapter}% <search>
{\thechapter\space \@chapapp}% <replace>
{}{}% <success><failure>
%\renewcommand{\@chapapp}{chapter}% Chapter > chapter
\makeatother
\begin{document}
\chapter{A chapter}
\end{document}
为了写入<num> chapter
(而不是<num> Chapter
),请取消注释\renewcommand
更改\@chapapp
为的chapter
。
答案2
不清楚您想在哪些地方进行更改:只在开头还是在其他地方(页眉、目录等)也进行更改。如果您还不想更改内部章节名称,解决方案可能如下(提取代码的两个片段,更改一部分):
\documentclass[a4paper]{report}
\begin{document}
%\chapter{First}
\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
% \huge\bfseries \@chapapp\space \thechapter
\huge\bfseries \thechapter\space\MakeLowercase{\@chapapp} % PS
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\makeatother
\chapter{Second}
\end{document}