我正在使用大学提供的 .sty 文件撰写论文。如果我尝试使用非常简单的案例(例如下面的文件)添加附录(省略不相关的数据),我会收到错误缺失数字,视为零
\documentclass[12pt]{book}
\usepackage[titletoc]{appendix}
\begin{document}
\maketitle
\tableofcontents
\chapter{1}
\chapter{2}
\begin{appendices}
\chapter{a1}
\end{appendices}
\end{document}
我确信问题出在 .sty 文件的以下几行(如果我对它们进行注释,我不会收到错误消息,但我会丢失大部分格式):
\makeatletter
\iffalse % ancien template utilité par coralie
\definecolor{gris_chap}{gray}{0.85}
\def\@makechapterhead#1{%
\vspace*{20\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\raggedleft\scalebox{7}{\huge\bfseries\textsf{\textcolor{gray}{\thechapter~}}} %\textsc{}
\par\nobreak
\vskip 30\p@
\vspace{-3cm}
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries \textsf{ #1}\par\nobreak
\vskip 40\p@
}}
\makeatother
\makeatletter
\def\@makeschapterhead#1{%
\vspace*{20\p@}%
{\if@mainmatter
\parindent \z@ \raggedleft
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 30\p@
\else
\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
\fi
}}
\makeatother
\fi
% fin Alex chapitres
% nouveau templace chapitre
\def\thickhrule{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\position{\centering}
%% Note the difference between the commands the one is
%% make and the other one is makes
\renewcommand{\@makechapterhead}[1]{%
\vspace*{10\p@}%
{\parindent \z@ \position \reset@font
{\HUGE \scshape \romannumeral \thechapter }
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\thickhrule
\par\nobreak
\vspace*{2\p@}%
{\Huge \bfseries #1\par\nobreak}
\par\nobreak
\vspace*{2\p@}%
\thickhrule
\vskip 40\p@
\vskip 40\p@
}}
%% This uses makes
\iffalse
\def\@makeschapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \position \reset@font
{\Huge \scshape \vphantom{\thechapter}}
\par\nobreak
\vspace*{10\p@}%
\interlinepenalty\@M
\thickhrule
\par\nobreak
\vspace*{2\p@}%
{\Huge \bfseries #1\par\nobreak}
\par\nobreak
\vspace*{2\p@}%
\thickhrule
\vskip 100\p@
}}
\fi
% Pour avoir des pages réellement vides entre les chapitres
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
% En-tête et pieds de page avec fancyhdr
\headheight=14.85pt
% pour récupérer les noms de section en minuscule
\renewcommand{\chaptermark}[1]{\Makelowercase \markboth{\thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[RO]{\bfseries\rightmark}
\fancyhead[LE]{\bfseries\leftmark}
\fancyfoot[LE,RO]{\bfseries\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\addtolength{\headheight}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}
%%% mode: latex
%%% TeX-master: "main"
%% End:
有人知道这些行中有什么问题吗? 非常感谢您的帮助!