对齐未编号章节和编号章节

对齐未编号章节和编号章节

我正在使用 ERDC 模板,当我创建未编号章节 (\chapter*) 时,它与下一页上的编号章节不一致。无法在 ERDC cls 代码中识别任何自定义格式。

erdc 包:

https://www.ctan.org/tex-archive/macros/latex/contrib/erdc

PDF 预览

答案1

这是一个解决方案

\documentclass{erdc}
\usepackage{lipsum,url}

\usepackage{etoolbox}

\makeatletter
 % ajust horizontal alignement
\let\@makeschapterhead\@makechapterhead   
%this for table of contents 
\patchcmd{\specialchapter}{\@makeschapterhead{#1}}{% 
\@makeschapterhead{\makebox[35\p@]{\mbox{}\hfill}#1}}{}{}
 %for preface ...(\frontmatter)
\patchcmd{\@chapter}{\@makechapterhead{#2}}{% 
\@makechapterhead{\makebox[35\p@]{\mbox{}\hfill}#2}}{}{}
% for numbered appendix
\patchcmd{\@chapter}{\@makechapterhead{\@chapapp\space\thechapter: #2}}{%
\@makechapterhead{\makebox[35\p@]{\mbox{}\hfill}\@chapapp\space\thechapter: #2}}{}{}
% for unnumbered chapters
\patchcmd{\@schapter}{\@makeschapterhead{#1}}{%
\@makeschapterhead{\makebox[35\p@]{\mbox{}\hfill}#1}}{}{}
 % for unnumbered appendix
\patchcmd{\@schapter}{\@makeschapterhead{\@chapapp: #1}}{%
\@makeschapterhead{\makebox[35\p@]{\mbox{}\hfill}\@chapapp: #1}}{}{}
\makeatother
\begin{document}

相关内容