输入另一个文件时,LaTeX 无法使用 nomencl 包和自定义 .sty 文件进行编译

输入另一个文件时,LaTeX 无法使用 nomencl 包和自定义 .sty 文件进行编译

我正在使用我所在大学的自定义 .sty 文件 (cuthesis.sty) 来撰写论文。到目前为止,它一直运行良好,但当我最近尝试开始使用“nomencl”包时,它就是无法编译。我想我已经将问题缩小到 \newchapter 命令。如果我在下面的 MWE 中输入 \input{chap_filename},它会编译。如果我有 \newchapter{chap_filename},它就不会编译。任何帮助都将不胜感激。

这是产生的致命错误:

nomenTEST.tex 129 TeX 容量超出,抱歉 [输入堆栈大小=10000]。 \curr@fontshape ->\f@encoding /\f@family /\f@series /\f@shape l.129 \newchapter{ch1Introduction}

控制台输出显示:

!TeX 容量超出,抱歉 [输入堆栈大小=10000]。 \curr@fontshape ->\f@encoding /\f@family /\f@series /\f@shape l.129 \newchapter{ch1Introduction}

! ==> 发生致命错误,未生成输出 PDF 文件!记录写在 nomenTEST.log 上。

抱歉,但“MiKTeX 编译器驱动程序”没有成功。

希望日志文件包含让 MiKTeX 再次运行的信息

我不知道是否应该将整个日志文件粘贴到我的问题中 - 这样做似乎太长了。日志文件的末尾写着:

!TeX 容量超出,抱歉 [输入堆栈大小=10000]。 \curr@fontshape ->\f@encoding /\f@family /\f@series /\f@shape l.129 \newchapter{ch1Introduction}

如果您确实需要更多容量,您可以请一位巫师来扩大我。

这里列出了您使用的 TeX 内存量: 478582 个字符串中的 17126 个 2843400 个字符串字符中的 338568 个 3000000 个内存字中的 1020820 个字 15000+600000 个多字母控制序列中的 35070 个 多字母控制序列 9000 个字体中的 8000000 个,共 50 种字体的 475807 个字 8191 个连字异常中的 1141 个 10000i、1000n、20000p、200000b、80000s 中的 10000i、22n、19981p、489b、884s 堆栈位置!==> 发生致命错误,未生成输出 PDF 文件!

这是一个最小工作示例。

\documentclass[12pt,letterpaper]{report}
\usepackage[1committee,phd,nonsequential]{cuthesis}

\usepackage{array}
\usepackage{graphicx}
\usepackage{color}
\usepackage{cite}
\usepackage{subfigure}
\usepackage{amsmath} %needed to split equations (and probably other things)
\usepackage[indent,bf]{caption}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{longtable} %needed for nomenclature (and other?) tables
\usepackage[hidelinks,pdftex,bookmarks=true,bookmarksnumbered=true,breaklinks=true]{hyperref}
%\usepackage[colorlinks=true,pdftex,bookmarks=true,bookmarksnumbered=true,breaklinks=true]{hyperref}
\usepackage{pdfsync}
\usepackage{enumitem} %to create an enumerated list with custom prefixes
\usepackage{gensymb} %I added this package for the degree sign:
\usepackage{tabulary} %I added this package for text wrapping in tables:
\usepackage{float} %I added this package for placing tables in specific locations in the text:  https://stackoverflow.com/questions/1673942/latex-table-positioning
\usepackage{booktabs} %needed for tables that don't have bounding lines on the sides
\usepackage{multirow} %needed for multirow table
\usepackage[round]{natbib}
%I added this package to put notes inside tables
\usepackage{threeparttable}
%Added to get "Registered" sign, like copyright
\usepackage{textcomp}


\reffile{../references}

% Defines relative path to folder containing your figures
\graphicspath{{../figures/}}

%I added this package for the nomenclature:
%https://tex.stackexchange.com/questions/166556/how-to-make-a-clean-and-grouped-nomenclature-list
\usepackage{siunitx}%for writing SI units easily
\sisetup{%
  inter-unit-product=\ensuremath{{}\cdot{}},
  per-mode=symbol
  }
\usepackage{nomencl}
\usepackage{ifthen}
\renewcommand\nomgroup[1]{%
  \ifthenelse{\equal{#1}{A}}{%
    \item[\textbf{Acronyms}]}{%                A - Acronyms
  \ifthenelse{\equal{#1}{R}}{%
    \item[\textbf{Roman Symbols}]}{%           R - Roman
  \ifthenelse{\equal{#1}{G}}{%
    \item[\textbf{Greek Symbols}]}{%           G - Greek
  \ifthenelse{\equal{#1}{S}}{%
    \item[\textbf{Superscripts}]}{%            S - Superscripts
  \ifthenelse{\equal{#1}{U}}{%
    \item[\textbf{Subscripts}]}{%              U - Subscripts
  \ifthenelse{\equal{#1}{X}}{%
    \item[\textbf{Other Symbols}]}{%           X - Other Symbols
  {}}}}}}}}
\renewcommand*{\nompreamble}{\markboth{\nomname}{\nomname}}

%The following makes units right-aligned with the command \nomunit
%\newcommand{\nomunit}[1]{%
%  \renewcommand{\nomentryend}{\hspace*{\fill}#1}%
%  }
\makenomenclature

\doublespacing

% Some definitions that could be useful
\newcommand{\Sec}[1]{Sec.~\ref{#1}}
\newcommand{\Ch}[1]{Chap.~\ref{#1}}
%\newcommand{\App}[1]{\appendixname~\ref{#1}}
\newcommand{\App}[1]{Appendix~\ref{#1}}
\newcommand{\Fig}[1]{Fig.~\ref{#1}}
\newcommand{\Figure}[1]{Figure~\ref{#1}}
\newcommand{\Eq}[1]{(\ref{#1})}
\setcounter{page}{1}
\newcommand{\ie}{i.e.}
\newcommand{\eg}{e.g.}

%\newcommand{\Comment}[1]{{\textbf{\underline{[#1]}}}}
\newcommand{\Comment}[1]{{\color{green} [#1]}}

\begin{document}

\printnomenclature

\newchapter{ch1}

$\textrm{CFD}$ and $v$ and $\phi$

\nomenclature[a]{CFD}{Computational Fluid Dynamics}
\nomenclature[r]{$v$}{Fluid velocity\si{\metre\per\second}}
\nomenclature[g]{$\phi$}{Coefficient of viscosity\si{\pascal\second}}


\end{document}

关联文件 ch1.tex 中只包含一些用于 MWE 的文本。如果您愿意,可以使用此文本并将其保存为 ch1.tex:

     each chapter (nonsequential), or if you want the numbers to
     be sequential throughout the whole document.  The default is
     nonsequential for Manuscript format and sequential for
     Standard format.

这是 cuthesis.sty 文件:

\@ifundefined{DeclareOption}{}{% LaTeX2e option
\ProvidesPackage{cuthesis}[2008/08/24 \space  v 1.2]

\DeclareOption{manuscript}{\def\@wantmanuscript{true}}
\DeclareOption{standard}{}

\DeclareOption{phd}{\def\@phddissertation{true}}
\DeclareOption{masters}{}

\DeclareOption{nocopy}{\def\@nolibraryrights{true}}
\DeclareOption{copy}{}

\DeclareOption{noleadpages}{\def\@noleadpages{true}}
\DeclareOption{leadpages}{}

\DeclareOption{norefbib}{\def\@norefbib{true}}
\DeclareOption{refbib}{}

\DeclareOption{noextrapages}{\def\@noleadpages{true}\def\@norefbib{true}}
\DeclareOption{extrapages}{}

\DeclareOption{nonsequential}{\def\@wantnonsequential{true}}
\DeclareOption{sequential}{\def\@wantsequential{true}}

\DeclareOption{4committee}{\def\@fourcommittee{true}}
\DeclareOption{5committee}{\def\@fivecommittee{true}}
\DeclareOption{3committee}{\def\@threecommittee{true}}
\DeclareOption{2committee}{\def\@twocommittee{true}}
\DeclareOption{1committee}{\def\@onecommittee{true}}
\DeclareOption{6committee}{\def\@sixcommittee{true}}

\ProcessOptions
}

\@ifundefined{@wantmanuscript}{
  % standard
  \@ifundefined{@wantnonsequential}{}{\def\@nonsequential{true}}
}{
  % manuscript
  \@ifundefined{@wantsequential}{\def\@nonsequential{true}}{}
}

\def\bibliocite#1{%
  \if@filesw\immediate\write12{\string\citation{#1}}\fi}

\@ifundefined{@wantmanuscript}{

\@ifundefined{@extra@b@citeb}{
% this is for use without the cite package
\def\@citex[#1]#2{%
  \let\@citea\@empty
  \@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \if@filesw\immediate\write12{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}
}
{
% this is for use with the cite package
\def\@nocite#1{\xdef\@no@sparg{\@ignsp#1 \! }% remove *ALL* spaces
 \if@filesw \immediate\write\@auxout {\string\citation {\@no@sparg}}\fi
 \if@filesw \immediate\write12{\string\citation{\@no@sparg}}\fi}
}

}
{

% this section is basically chapterbib

\newenvironment{cbunit}%
{\global\advance\c@inputfile\@ne \xdef\the@ipfilectr{@-\the\c@inputfile}%
  \immediate\write\@auxout{\string\gdef\string\@extra@binfo{\@exele@b@citeb}}}%
{\gdef\the@ipfilectr{}%
  \immediate\write\@auxout{\string\gdef\string\@extra@binfo{\@exele@b@citeb}}%
  }

\let\cb@include\include
\def\include#1{\clearpage \cbunit \xdef\@currentipfile{#1}%
  \cb@include{#1}%
\refsforcb%
\global\let\@currentipfile\@savedjobname\endcbunit}

\newcommand\cbinput[1]{\cbunit \xdef\@currentipfile{#1}%
  \input{#1}\global\let\@currentipfile\@savedjobname\endcbunit}

\@ifundefined{@extra@binfo}{%
  \def\bibcite#1#2{\global\@namedef{b@#1\@extra@binfo}{#2}}%
}{}

\@ifundefined{@exele@b@citeb}{%
 \def\@citex[#1]#2{%
   \let\@citea\@empty%
   \@cite{\@for\@citeb:=#2\do%
     {\@citea\let\@citea\citepunct%
      \edef\@citeb{\expandafter\@iden\@citeb}%
      \ifnum0=\value{mychapcitecount}%
      \if@filesw\immediate\write\@auxout{\string\bibstyle{abbrvnat}}\fi%
      \if@filesw\immediate\write\@auxout{\string\bibdata{\@reffile}}\fi%
      \setcounter{mychapcitecount}{1}%
      \fi%
      \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi%
      \if@filesw\immediate\write12{\string\citation{\@citeb}}\fi%
      \@ifundefined{b@\@citeb \@exele@b@citeb}{\mbox{\reset@font\bf ?}%
         \@warning{Citation `\@citeb' in file `\@currentipfile'
             on page \thepage \space undefined}\G@refundefinedtrue}%
      {\hbox{\citeform{\csname b@\@citeb \@exele@b@citeb\endcsname}}}}}{#1}}
}{}% 2nd arg of \@ifundefined{@exele@b@citeb}

\def\@iden#1{#1}

\@ifundefined{citeform}{\let\citeform=\relax}{}
\@ifundefined{citepunct}{\def\citepunct{,\penalty\@m\ }}{}

\xdef\@savedjobname{\jobname}% save root file name as a macro
\let\@currentipfile\@savedjobname
\gdef\the@ipfilectr{}
\def\@exele@b@citeb{\the@ipfilectr}
\newcount\c@inputfile \global\c@inputfile=0

\gdef\@extra@binfo{}  % in case .aux files are left from old run.

\@ifundefined{reset@font}{\let\reset@font\relax}{}
\@ifundefined{G@refundefinedtrue}{\let\G@refundefinedtrue\relax}{}

\let\cb@bibliographystyle\bibliographystyle
\def\cb@roottest{2\ifx\the@ipfilectr\@empty 1\else2\fi}

\def\bibliographystyle#1{\if\cb@roottest\cb@bibliographystyle{#1}\fi}

\def\bibliography#1{\if\cb@roottest%
   \if@filesw\immediate\write\@auxout{\string\bibdata{#1}}\fi%
   \fi \@input{\@currentipfile.bbl}}

\@ifundefined{PackageWarning}{\def\cb@warning{\@warning}}%
 {\def\cb@warning{\PackageWarning{chapterbib}}}

\let\@test@defiii\@testdef

\def\@testdef#1#2#3{%
  \if#1b\relax\@test@defiii b{#2\@extra@binfo}{#3}%
  \else \@test@defiii #1{#2}{#3}\fi%
}

\@ifundefined{bibname}{\def\bibname{Bibliography}}{}

% end of chapterbib section
}

\renewcommand\contentsname{Table of Contents}

\newcounter{myfigcount}
\newcounter{mytablecount}
\newcounter{myeqncount}
\newcounter{mychapcitecount}
\newcounter{mychaptercount}
\newcounter{myappendixcount}

\def\myusefigurespage{%
  \gdef\@myusefigurespage{true}
}

\def\myusetablespage{%
  \gdef\@myusetablespage{true}
}

\makeatletter

\setlength{\oddsidemargin}{.20in}
\setlength{\textwidth}{6.05in}
\setlength{\marginparsep}{.2in}
\setlength{\marginparwidth}{0.5in}

\setlength{\topmargin}{-0.6in}
\setlength{\headheight}{0.25in}
\setlength{\headsep}{0.25in}
\setlength{\textheight}{9.5in}
\setlength{\footskip}{.5in}

\brokenpenalty=10000

\renewcommand{\baselinestretch}{1.6}
\renewcommand{\arraystretch}{1.4} % 1.3 spacing for tables and arrays

\def\myps@plain{%
  \let\@mkboth\@gobbletwo
  \let\@oddfoot\@empty\let\@evenfoot\@empty
  \def\@evenhead{\thepage\hfil\slshape\leftmark}%
  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
}

\def\ele@chapapp{}

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \Large\bfseries  \@chapapp\space \thechapter %this allows the chapter # to be displayed
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \LARGE \bfseries #1\par\nobreak
    \vskip 40\p@
  }}


\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \LARGE \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}

\def\cl@chapter{%
  \setcounter{mychapcitecount}{0}%
  \@ifundefined{@nonsequential}{%
    \@elt{section}\@elt{footnote}%
  }{%
    \@elt{equation}\@elt{figure}\@elt{footnote}\@elt{section}\@elt{table}%
  }}
\def\thefigure{%
  \addtocounter{myfigcount}{\value{figure}}%
  \@ifundefined{@nonsequential}{%
    \@arabic\c@figure%
  }{%
    \thechapter.\@arabic\c@figure%
  }}
\def\thetable{%
  \addtocounter{mytablecount}{\value{table}}%
  \@ifundefined{@nonsequential}{%
    \@arabic\c@table%
  }{%
    \thechapter.\@arabic\c@table%
  }}
\def\theequation{%
  \@ifundefined{@nonsequential}{%
    \@arabic\c@equation%
  }{%
    \thechapter.\arabic{equation}%
  }}

\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
    {\rule{\z@}{\footnotesep}\ignorespaces
      #1\strut}}}

\def\thebibliography#1{\chapter*{List of References
\@mkboth{}{}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin
\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \setlength{\baselineskip}{0.70\baselineskip}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist

\def\thesisbib{\chapter*{Bibliography
\@mkboth{}{}}\trivlist
 \setlength{\baselineskip}{0.70\baselineskip}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthesisbib=\endtrivlist

\def\dept#1{\gdef\@dept{#1}}
\def\pastdegrees#1{\gdef\@pastdegrees{#1}}
\def\degreename#1{\gdef\@degreename{#1}}
\def\supervisor#1{\gdef\@supervisor{#1}}
\def\firstcommittee#1{\gdef\@firstcommittee{#1}}
\def\secondcommittee#1{\gdef\@secondcommittee{#1}}
\def\thirdcommittee#1{\gdef\@thirdcommittee{#1}}
\def\fourthcommittee#1{\gdef\@fourthcommittee{#1}}
\def\fifthcommittee#1{\gdef\@fifthcommittee{#1}}
\def\departmentchair#1{\gdef\@departmentchair{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\copyrightmonth#1{\gdef\@copyrightmonth{#1}}
\def\@title{}\def\@author{}\def\@dept{Systems and Computer Engineering}
\def\@supervisor{} \def\@firstcommittee{} \def\@secondcommittee{}
\def\@thirdcommittee{} \def\@fourthcommittee{} \def\@fifthcommittee{} \def\@departmentchair{}
\def\@copyrightyear{\number\the\year}
\def\submitdate#1{\gdef\submitdate{#1}}

\def\@reffile{references}

\def\reffile#1{%
  \def\@reffile{#1}
}

\def\abstract#1{%
  \def\@abstract{#1}
}

\def\acknowledgements#1{%
  \def\@acknowledgements{#1}
}

\def\preface#1{%
  \def\@preface{#1}
}

\def\dedication#1{%
  \def\@dedication{#1}
}

\def\nomenclature#1{%
  \def\@nomenclature{#1}
}


\def\@bibliofileext{bib}
\def\@bibliofile{\jobname\@bibliofileext}

\def\@awork{%
\@ifundefined{@phddissertation}{
  thesis
}{
  dissertation
}}

% Print title page
\def\titlep{%
    \thispagestyle{empty}%
    \begin{center}
        {\Large\bf\@title}\\
        \mbox{}\\
        \mbox{}\\
        by\\
        \mbox{}\\
        \mbox{}\\
       {\textbf{\@author}\@ifundefined{@pastdegrees}{}{, \textbf{\@pastdegrees}}}\\
    \end{center}
    \mbox{}
    \begin{center}
%        A \@ifundefined{@phddissertation}{thesis}{dissertation} submitted to the\\
        A dissertation submitted to the\\
    Faculty of Graduate and Postdoctoral Affairs\\
    in partial fulfillment of the requirements for the degree of:\\
    \mbox{}\\
    \mbox{}\\
    \bf{\@degreename}\\
    \end{center}
    \mbox{}\\
    \mbox{}\\
    \begin{center}
        Ottawa, Ontario\\
        \submitdate\\
    \end{center}
    \mbox{}
    \begin{center}
        \copyright Copyright \\
        \@author, \@copyrightyear
    \end{center}\clearpage}


%--------------------------------------------------------------------------------------------
\long\def\signature#1{%
  \begin{minipage}[t]{7in}
    \vspace{.4in}
    \hbox{\hfil\shortstack{\vrule width 4in height 0.4pt \\#1}}
  \end{minipage}}

\def\comprof{%
\begin{minipage}[t]{1.5in}
  \begin{flushright}
    \@ifundefined{@phddissertation}{
      Thesis
    }{
       Dissertation
    }
    Committee\\
    Supervisor
  \end{flushright}
\end{minipage}}

% Print signature approval page
\def\signaturepage{%
\thispagestyle{plain}%
\begin{center}
    The undersigned hereby recommends to the\\
    Faculty of Graduate and Postdoctoral Affairs\\
    acceptance of the \@ifundefined{@phddissertation}{thesis}{dissertation}\\
\end{center}
\mbox{}
\begin{center}
    {\large\bf\@title}
\end{center}
\mbox{}
\begin{center}
    submitted by \textbf{\@author}\@ifundefined{@pastdegrees}{}{, \textbf{\@pastdegrees}}\\
    \mbox{}\\
    in partial fulfillment of the requirements for the degree of\\
    \mbox{}\\
    \bf{\@degreename}\\
\end{center}
\vfill
\begin{center}
  \begin{tabular}{rl}
    \@ifundefined{@twocommittee}{}
    {
      & \signature\@firstcommittee\\
    }
    \@ifundefined{@threecommittee}{}
    {
      & \signature\@firstcommittee\\
      & \signature\@secondcommittee\\
    }
    \@ifundefined{@fourcommittee}{}
    {
      & \signature\@firstcommittee\\
      & \signature\@secondcommittee\\
      & \signature\@thirdcommittee\\
    }
    \@ifundefined{@fivecommittee}{}
    {
      & \signature\@firstcommittee\\
      & \signature\@secondcommittee\\
      & \signature\@thirdcommittee\\
      & \signature\@fourthcommittee\\
    }
     & \signature{\@departmentchair}
\\
\end{tabular}
\end{center}
\vfill
\begin{center}{
  \@copyrightmonth, \@copyrightyear}
\end{center}}
%--------------------------------------------------------------------------------------------

\def\startingpages{%
  \setcounter{page}{0}
  \pagestyle{plain}
  \pagenumbering{roman}
  \titlep
  \signaturepage
  \immediate\openout12=\@bibliofile.aux
  \immediate\write12{\string\bibstyle{cubiblio}}
  \immediate\write12{\string\bibdata{\@reffile}}
  \@ifundefined{@abstract}{}{
    \doourabstract{\@abstract}
  }
  \@ifundefined{@dedication}{}{
    \doourdedication{\@dedication}
  }
  \@ifundefined{@acknowledgements}{}{
    \doouracknowledgements{\@acknowledgements}
  }
  \@ifundefined{@preface}{}{
    \doourpreface{\@preface}
  }
  \contentspages
  \@ifundefined{@nomenclature}{}{
    \doournomenclature{\@nomenclature}
  }
  \pagenumbering{arabic}
  \pagestyle{myheadings}
}

\def\doourabstract#1{%
  \sloppy
  \chapter*{Abstract}
  \phantomsection
  \addcontentsline{toc}{chapter}{Abstract}
  \@ifundefined{@phddissertation}{
    \thispagestyle{plain}
    %\thispagestyle{empty}
    \pagestyle{plain}
  }{
    \thispagestyle{plain}
    \pagestyle{plain}
  }
  \input{#1}
  \newpage
  \pagestyle{plain}
}

\def\doouracknowledgements#1{%
  \chapter*{Acknowledgments}
  \phantomsection  
  \addcontentsline{toc}{chapter}{Acknowledgments}
  \input{#1}
}

\def\doourdedication#1{%
  \newpage
  \thispagestyle{plain}
  \include{#1}
}

\def\doourpreface#1{%
  \chapter*{Preface}
  \phantomsection  
  \addcontentsline{toc}{chapter}{Preface}
  \input{#1}
}

\def\doournomenclature#1{%
  \chapter*{Nomenclature}
  \phantomsection  
  \addcontentsline{toc}{chapter}{Nomenclature}
  \input{#1}
  \newpage
}

\def\contentspages{\newpage
  \phantomsection
  \addcontentsline{toc}{chapter}{Table of Contents}
  \tableofcontents
  \newpage
      \@ifundefined{@myusetablespage}{}{
    {\addvspace{10pt}
    \let\saveaddvspace=\addvspace
    \def\addvspace##1{}
    \phantomsection    
    \addcontentsline{toc}{chapter}{List of Tables}
    \listoftables
    \let\addvspace=\saveaddvspace}
  \newpage
  }
  \@ifundefined{@myusefigurespage}{}{
    {\addvspace{10pt}
    \let\saveaddvspace=\addvspace
    \def\addvspace##1{}
    \phantomsection    
    \addcontentsline{toc}{chapter}{List of Figures}
    \listoffigures
    \let\addvspace=\saveaddvspace}
  \newpage
  }
}

\def\newchapter#1{%
  \ifnum0=\value{mychaptercount}
    \@ifundefined{@noleadpages}{
      \startingpages
    }{}
    \setcounter{mychaptercount}{1}
  \fi
  \include{#1}
}

\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \phantomsection
                         \addcontentsline{toc}{chapter}%
                                   {\ele@chapapp\space \protect\numberline{\thechapter}#1}%
                    \else
                      \phantomsection
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%           This adds ``Chapter N. Chapter Name'' to each non-heading page
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}


\def\newappendix#1{%
  \ifnum0=\value{myappendixcount}
    \startappendix
    \setcounter{myappendixcount}{1}
  \fi
  \include{#1}
}

\def\startappendix{%
  \def\ele@chapapp{Appendix}
  \@ifundefined{@wantmanuscript}{
    \phantomsection
    \addcontentsline{toc}{chapter}{List of References}
     \bibliographystyle{abbrvnat}
    \@ifundefined{@norefbib}{
      \bibliography{\@reffile}
    }{}
    \newpage
  }{}

  \appendix
  % This causes latex to number equations, tables, figures with
  % A-1, A-2, ...
%  \renewcommand{\theequation}{\Alph{chapter}.\arabic{equation}}
%  \renewcommand{\thetable}{\Alph{chapter}.\arabic{table}}
%  \renewcommand{\thefigure}{\Alph{chapter}.\arabic{figure}}
}

% used for manuscript form chapter references
\def\refsforcb{%
  \@ifundefined{@wantmanuscript}{
  }{
    \ifnum0=\value{mychapcitecount}
      \relax
    \else
      \newpage
      \phantomsection
      \addcontentsline{toc}{section}{List of References}
%      \addcontentsline{toc}{chapter}{List of References}
      \bibliography{\@reffile}
      \bibliographystyle{abbrvnat}
      \newpage
    \fi
  }
}

\def\biblio{%
  \ifnum0=\value{myappendixcount}
    \startappendix
  \fi
  \ifnum0=\value{myfigcount}
    \relax
  \else
    \if@filesw\immediate\write\@auxout{\string\myusefigurespage}\fi
  \fi
  \ifnum0=\value{mytablecount}
    \relax
  \else
    \if@filesw\immediate\write\@auxout{\string\myusetablespage}\fi
  \fi
  \phantomsection
  \addcontentsline{toc}{chapter}{Bibliography}
  \@input{\@bibliofile.bbl}
}

\def\bibliox{\bibliography{\@reffile}}

\@ifundefined{@norefbib}{
  \let\@enddocumenthook\biblio
}{
  \let\@enddocumenthook\bibliox
}

编辑:创建自定义 .sty 文件的人帮助我解决了这个问题。我仍然不知道问题到底是什么,但我将在下面的一个答案中粘贴新的 .sty 文件,希望这对某人有帮助。

答案1

这是新的 .sty 文件,它已生效,不再与 nomencl 包发生冲突。请参阅上面我的问题中的编辑。


\@ifundefined{DeclareOption}{}{% LaTeX2e option
\ProvidesPackage{cuthesis}[2008/08/24 \space  v 1.2]

\DeclareOption{manuscript}{\def\@wantmanuscript{true}}
\DeclareOption{standard}{}

\DeclareOption{phd}{\def\@phddissertation{true}}
\DeclareOption{masters}{}

\DeclareOption{nocopy}{\def\@nolibraryrights{true}}
\DeclareOption{copy}{}

\DeclareOption{noleadpages}{\def\@noleadpages{true}}
\DeclareOption{leadpages}{}

\DeclareOption{norefbib}{\def\@norefbib{true}}
\DeclareOption{refbib}{}

\DeclareOption{noextrapages}{\def\@noleadpages{true}\def\@norefbib{true}}
\DeclareOption{extrapages}{}

\DeclareOption{nonsequential}{\def\@wantnonsequential{true}}
\DeclareOption{sequential}{\def\@wantsequential{true}}

\DeclareOption{4committee}{\def\@fourcommittee{true}}
\DeclareOption{5committee}{\def\@fivecommittee{true}}
\DeclareOption{3committee}{\def\@threecommittee{true}}
\DeclareOption{2committee}{\def\@twocommittee{true}}
\DeclareOption{1committee}{\def\@onecommittee{true}}

\ProcessOptions
}

\@ifundefined{@wantmanuscript}{
  % standard
  \@ifundefined{@wantnonsequential}{}{\def\@nonsequential{true}}
}{
  % manuscript
  \@ifundefined{@wantsequential}{\def\@nonsequential{true}}{}
}

\def\bibliocite#1{%
  \if@filesw\immediate\write12{\string\citation{#1}}\fi}

\@ifundefined{@wantmanuscript}{

\@ifundefined{@extra@b@citeb}{
% this is for use without the cite package
\def\@citex[#1]#2{%
  \let\@citea\@empty
  \@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \if@filesw\immediate\write12{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}
}
{
% this is for use with the cite package
\def\@nocite#1{\xdef\@no@sparg{\@ignsp#1 \! }% remove *ALL* spaces
 \if@filesw \immediate\write\@auxout {\string\citation {\@no@sparg}}\fi
 \if@filesw \immediate\write12{\string\citation{\@no@sparg}}\fi}
}

}
{

% this section is basically chapterbib

\newenvironment{cbunit}%
{\global\advance\c@inputfile\@ne \xdef\the@ipfilectr{@-\the\c@inputfile}%
  \immediate\write\@auxout{\string\gdef\string\@extra@binfo{\@exele@b@citeb}}}%
{\gdef\the@ipfilectr{}%
  \immediate\write\@auxout{\string\gdef\string\@extra@binfo{\@exele@b@citeb}}%
  }

\let\cb@include\include
\def\include#1{\clearpage \cbunit \xdef\@currentipfile{#1}%
  \cb@include{#1}%
\refsforcb%
\global\let\@currentipfile\@savedjobname\endcbunit}

\newcommand\cbinput[1]{\cbunit \xdef\@currentipfile{#1}%
  \input{#1}\global\let\@currentipfile\@savedjobname\endcbunit}

\@ifundefined{@extra@binfo}{%
  \def\bibcite#1#2{\global\@namedef{b@#1\@extra@binfo}{#2}}%
}{}

\@ifundefined{@exele@b@citeb}{%
 \def\@citex[#1]#2{%
   \let\@citea\@empty%
   \@cite{\@for\@citeb:=#2\do%
     {\@citea\let\@citea\citepunct%
      \edef\@citeb{\expandafter\@iden\@citeb}%
      \ifnum0=\value{mychapcitecount}%
      \if@filesw\immediate\write\@auxout{\string\bibstyle{abbrvnat}}\fi%
      \if@filesw\immediate\write\@auxout{\string\bibdata{\@reffile}}\fi%
      \setcounter{mychapcitecount}{1}%
      \fi%
      \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi%
      \if@filesw\immediate\write12{\string\citation{\@citeb}}\fi%
      \@ifundefined{b@\@citeb \@exele@b@citeb}{\mbox{\reset@font\bf ?}%
         \@warning{Citation `\@citeb' in file `\@currentipfile'
             on page \thepage \space undefined}\G@refundefinedtrue}%
      {\hbox{\citeform{\csname b@\@citeb \@exele@b@citeb\endcsname}}}}}{#1}}
}{}% 2nd arg of \@ifundefined{@exele@b@citeb}

\def\@iden#1{#1}

\@ifundefined{citeform}{\let\citeform=\relax}{}
\@ifundefined{citepunct}{\def\citepunct{,\penalty\@m\ }}{}

\xdef\@savedjobname{\jobname}% save root file name as a macro
\let\@currentipfile\@savedjobname
\gdef\the@ipfilectr{}
\def\@exele@b@citeb{\the@ipfilectr}
\newcount\c@inputfile \global\c@inputfile=0

\gdef\@extra@binfo{}  % in case .aux files are left from old run.

\@ifundefined{reset@font}{\let\reset@font\relax}{}
\@ifundefined{G@refundefinedtrue}{\let\G@refundefinedtrue\relax}{}

\let\cb@bibliographystyle\bibliographystyle
\def\cb@roottest{2\ifx\the@ipfilectr\@empty 1\else2\fi}

\def\bibliographystyle#1{\if\cb@roottest\cb@bibliographystyle{#1}\fi}

\def\bibliography#1{\if\cb@roottest%
   \if@filesw\immediate\write\@auxout{\string\bibdata{#1}}\fi%
   \fi \@input{\@currentipfile.bbl}}

\@ifundefined{PackageWarning}{\def\cb@warning{\@warning}}%
 {\def\cb@warning{\PackageWarning{chapterbib}}}

\let\@test@defiii\@testdef

\def\@testdef#1#2#3{%
  \if#1b\relax\@test@defiii b{#2\@extra@binfo}{#3}%
  \else \@test@defiii #1{#2}{#3}\fi%
}

\@ifundefined{bibname}{\def\bibname{Bibliography}}{}

% end of chapterbib section
}

\renewcommand\contentsname{Table of Contents}

\newcounter{myfigcount}
\newcounter{mytablecount}
\newcounter{myeqncount}
\newcounter{mychapcitecount}
\newcounter{mychaptercount}
\newcounter{myappendixcount}

\def\myusefigurespage{%
  \gdef\@myusefigurespage{true}
}

\def\myusetablespage{%
  \gdef\@myusetablespage{true}
}


\makeatletter

\setlength{\oddsidemargin}{.20in}
\setlength{\textwidth}{6.05in}
\setlength{\marginparsep}{.2in}
\setlength{\marginparwidth}{0.5in}

\setlength{\topmargin}{-0.3in}
\setlength{\headheight}{0.25in}
\setlength{\headsep}{0.25in}
\setlength{\textheight}{8.8in}
\setlength{\footskip}{.5in}

\brokenpenalty=10000

\renewcommand{\baselinestretch}{1.6}
\renewcommand{\arraystretch}{1.4} % 1.3 spacing for tables and arrays

\def\myps@plain{%
  \let\@mkboth\@gobbletwo
  \let\@oddfoot\@empty\let\@evenfoot\@empty
  \def\@evenhead{\thepage\hfil\slshape\leftmark}%
  \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
}

\def\ele@chapapp{}

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \Large\bfseries \@chapapp\space \thechapter %this allows the chapter # to be displayed
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \LARGE \bfseries #1\par\nobreak
    \vskip 40\p@
  }}


\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \LARGE \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}

\def\cl@chapter{%
  \setcounter{mychapcitecount}{0}%
  \@ifundefined{@nonsequential}{%
    \@elt{section}\@elt{footnote}%
  }{%
    \@elt{equation}\@elt{figure}\@elt{footnote}\@elt{section}\@elt{table}%
  }}
\def\thefigure{%
  \addtocounter{myfigcount}{\value{figure}}%
  \@ifundefined{@nonsequential}{%
    \@arabic\c@figure%
  }{%
    \thechapter.\@arabic\c@figure%
  }}
\def\thetable{%
  \addtocounter{mytablecount}{\value{table}}%
  \@ifundefined{@nonsequential}{%
    \@arabic\c@table%
  }{%
    \thechapter.\@arabic\c@table%
  }}
\def\theequation{%
  \@ifundefined{@nonsequential}{%
    \@arabic\c@equation%
  }{%
    \thechapter.\arabic{equation}%
  }}

% This xfloat definition was apparently originally created to allow single spacing
% within floats such as figures and tables.  Also, this was originally written for
% LaTeX2.09 and not updated for LaTeX2e.  Hence, with the setspace package now
% available, I'm commenting this definition out since there are known conflicts
% with this and using the color package.
%\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
%   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
%      \@parmoderr\@floatpenalty\z@
%    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
%       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
%       \@tfor \@tempa :=#2\do
%                        {\if\@tempa h\advance\@tempcnta \@ne\fi
%                         \if\@tempa t\advance\@tempcnta \tw@\fi
%                         \if\@tempa b\advance\@tempcnta 4\relax\fi
%                         \if\@tempa p\advance\@tempcnta 8\relax\fi
%         }\global\count\@currbox\@tempcnta}\@fltovf\fi
%    \global\setbox\@currbox\vbox\bgroup
%    \def\baselinestretch{1}\@normalsize
%    \boxmaxdepth\z@
%    \hsize\columnwidth \@parboxrestore}

\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
    {\rule{\z@}{\footnotesep}\ignorespaces
      #1\strut}}}

\def\thebibliography#1{\chapter*{List of References
\@mkboth{}{}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin
\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \setlength{\baselineskip}{0.70\baselineskip}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist

\def\thesisbib{\chapter*{Bibliography
\@mkboth{}{}}\trivlist
 \setlength{\baselineskip}{0.70\baselineskip}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthesisbib=\endtrivlist

\def\dept#1{\gdef\@dept{#1}}
\def\pastdegrees#1{\gdef\@pastdegrees{#1}}
\def\degreename#1{\gdef\@degreename{#1}}
\def\supervisor#1{\gdef\@supervisor{#1}}
\def\firstcommittee#1{\gdef\@firstcommittee{#1}}
\def\secondcommittee#1{\gdef\@secondcommittee{#1}}
\def\thirdcommittee#1{\gdef\@thirdcommittee{#1}}
\def\fourthcommittee#1{\gdef\@fourthcommittee{#1}}
\def\departmentchair#1{\gdef\@departmentchair{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\copyrightmonth#1{\gdef\@copyrightmonth{#1}}
\def\@title{}\def\@author{}\def\@dept{Systems and Computer Engineering}
\def\@supervisor{} \def\@firstcommittee{} \def\@secondcommittee{}
\def\@thirdcommittee{} \def\@fourthcommittee{} \def\@departmentchair{}
\def\@copyrightyear{\number\the\year}
\def\submitdate#1{\gdef\submitdate{#1}}

\def\@reffile{references}

\def\reffile#1{%
  \def\@reffile{#1}
}

\def\abstract#1{%
  \def\@abstract{#1}
}

\def\acknowledgements#1{%
  \def\@acknowledgements{#1}
}

\def\preface#1{%
  \def\@preface{#1}
}

\def\dedication#1{%
  \def\@dedication{#1}
}

\def\nomenclatureOld#1{%
  \def\@nomenclatureOld{#1}
}


\def\@bibliofileext{bib}
\def\@bibliofile{\jobname\@bibliofileext}

\def\@awork{%
\@ifundefined{@phddissertation}{
  thesis
}{
  dissertation
}}

% Print title page
\def\titlep{%
    \thispagestyle{empty}%
    \begin{center}
        {\Large\bf\@title}\\
        \mbox{}\\
        \mbox{}\\
        by\\
        \mbox{}\\
        \mbox{}\\
        {\textbf{\@author}\@ifundefined{@pastdegrees}{}{, \textbf{\@pastdegrees}}}\\
    \end{center}
    \mbox{}
    \begin{center}
        A \@ifundefined{@phddissertation}{thesis}{dissertation} submitted to the\\% A dissertation submitted to the\\    
        Faculty of Graduate and Postdoctoral Affairs\\
    in partial fulfillment of the requirements for the degree of\\
    \mbox{}\\
    \mbox{}\\
    \bf{\@degreename}\\
    \end{center}
    \mbox{}\\
    \mbox{}\\
    \begin{center}
        Ottawa, Ontario\\
        \submitdate\\
    \end{center}
    \mbox{}
    \begin{center}
        \copyright Copyright \\
        \@author, \@copyrightyear
    \end{center}\clearpage}


%--------------------------------------------------------------------------------------------
\long\def\signature#1{%
  \begin{minipage}[t]{7in}
    \vspace{.4in}
    \hbox{\hfil\shortstack{\vrule width 4in height 0.4pt \\#1}}
  \end{minipage}}

\def\comprof{%
\begin{minipage}[t]{1.5in}
  \begin{flushright}
    \@ifundefined{@phddissertation}{
      Thesis
    }{
       Dissertation
    }
    Committee\\
    Supervisor
  \end{flushright}
\end{minipage}}

% Print signature approval page
\def\signaturepage{%
\thispagestyle{plain}%
\begin{onepointfivespacing}
\begin{center}
    The undersigned hereby recommends to the\\
    Faculty of Graduate and Postdoctoral Affairs\\
    acceptance of the \@ifundefined{@phddissertation}{thesis}{dissertation}\\
\end{center}
\mbox{}
\begin{center}
    {\large\bf\@title}
\end{center}
\mbox{}
\begin{center}
    submitted by \textbf{\@author}\@ifundefined{@pastdegrees}{}{, \textbf{\@pastdegrees}}\\
    \mbox{}\\
    in partial fulfillment of the requirements for the degree of\\
    \mbox{}\\
    \bf{\@degreename}\\
\end{center}
\vfill
\begin{center}
  \begin{tabular}{rl}
    \@ifundefined{@twocommittee}{}
    {
      & \signature\@firstcommittee\\
    }
    \@ifundefined{@threecom mittee}{}
    {
      & \signature\@firstcommittee\\
      & \signature\@secondcommittee\\
    }
    \@ifundefined{@fourcommittee}{}
    {
      & \signature\@firstcommittee\\
      & \signature\@secondcommittee\\
      & \signature\@thirdcommittee\\
    }
    \@ifundefined{@fivecommittee}{}
    {
      & \signature\@firstcommittee\\
      & \signature\@secondcommittee\\
      & \signature\@thirdcommittee\\
      & \signature\@fourthcommittee\\
    }
     & \signature{\@departmentchair}
\\
\end{tabular}
\end{center}
\vfill
\begin{center}{
  \@copyrightmonth, \@copyrightyear}
\end{center}
\end{onepointfivespacing}}
%--------------------------------------------------------------------------------------------

\def\startingpages{%
  \setcounter{page}{0}
  \pagestyle{plain}
  \pagenumbering{roman}
  \titlep
  \signaturepage
  \immediate\openout12=\@bibliofile.aux
  \immediate\write12{\string\bibstyle{cubiblio}}
  \immediate\write12{\string\bibdata{\@reffile}}
  \@ifundefined{@abstract}{}{
    \doourabstract{\@abstract}
  }
  \@ifundefined{@dedication}{}{
    \doourdedication{\@dedication}
  }
  \@ifundefined{@acknowledgements}{}{
    \doouracknowledgements{\@acknowledgements}
  }
  \@ifundefined{@preface}{}{
    \doourpreface{\@preface}
  }
  \contentspages
  \@ifundefined{@nomenclatureOld}{}{
    \doournomenclature{\@nomenclatureOld}
  }
  \pagenumbering{arabic}
  \pagestyle{myheadings}
}

\def\doourabstract#1{%
  \sloppy
  \chapter*{Abstract}
  \phantomsection
  \addcontentsline{toc}{chapter}{Abstract}
  \@ifundefined{@phddissertation}{
    \thispagestyle{plain}
    %\thispagestyle{empty}
    \pagestyle{plain}
  }{
    \thispagestyle{plain}
    \pagestyle{plain}
  }
  \input{#1}
  \newpage
  \pagestyle{plain}
}

\def\doouracknowledgements#1{%
  \chapter*{Acknowledgments}
  \phantomsection  
  \addcontentsline{toc}{chapter}{Acknowledgments}
  \input{#1}
}

\def\doourdedication#1{%
  \newpage
  \thispagestyle{plain}
  \include{#1}
}

\def\doourpreface#1{%
  \chapter*{Preface}
  \phantomsection  
  \addcontentsline{toc}{chapter}{Preface}
  \input{#1}
}

\def\doournomenclature#1{%
%  \chapter*{Nomenclature}
%  \phantomsection  
%  \addcontentsline{toc}{chapter}{Nomenclature}
  \input{#1}
  \newpage
}

\def\contentspages{\newpage
  \phantomsection
  \addcontentsline{toc}{chapter}{Table of Contents}
  \tableofcontents
  \newpage
      \@ifundefined{@myusetablespage}{}{
    {\addvspace{10pt}
    \let\saveaddvspace=\addvspace
    \def\addvspace##1{}
    \phantomsection    
    \addcontentsline{toc}{chapter}{List of Tables}
    \listoftables
    \let\addvspace=\saveaddvspace}
  \newpage
  }
  \@ifundefined{@myusefigurespage}{}{
    {\addvspace{10pt}
    \let\saveaddvspace=\addvspace
    \def\addvspace##1{}
    \phantomsection    
    \addcontentsline{toc}{chapter}{List of Figures}
    \listoffigures
    \let\addvspace=\saveaddvspace}
  \newpage
  }
}

\def\newchapter#1{%
  \ifnum0=\value{mychaptercount}
    \@ifundefined{@noleadpages}{
      \startingpages
    }{}
    \setcounter{mychaptercount}{1}
  \fi
  \include{#1}
}

\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \phantomsection
                         \addcontentsline{toc}{chapter}%
                                   {\ele@chapapp\space \protect\numberline{\thechapter}#1}%
                    \else
                      \phantomsection
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%           This adds ``Chapter N. Chapter Name'' to each non-heading page
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}


\def\newappendix#1{%
  \ifnum0=\value{myappendixcount}
    \startappendix
    \setcounter{myappendixcount}{1}
  \fi
  \include{#1}
}

\def\startappendix{%
  \def\ele@chapapp{Appendix}
  \@ifundefined{@wantmanuscript}{
    \phantomsection
    \addcontentsline{toc}{chapter}{List of References}
%     \bibliographystyle{ieeetr}
      \bibliographystyle{abbrvnat}
    \@ifundefined{@norefbib}{
      \bibliography{\@reffile}
    }{}
    \newpage
  }{}

  \appendix
  % This causes latex to number equations, tables, figures with
  % A-1, A-2, ...
%  \renewcommand{\theequation}{\Alph{chapter}.\arabic{equation}}
%  \renewcommand{\thetable}{\Alph{chapter}.\arabic{table}}
%  \renewcommand{\thefigure}{\Alph{chapter}.\arabic{figure}}
}

% used for manuscript form chapter references
\def\refsforcb{%
  \@ifundefined{@wantmanuscript}{
  }{
%    \ifnum0=\value{mychapcitecount}
%      \relax
%    \else
      \newpage
      \phantomsection
      \addcontentsline{toc}{section}{List of References}
%      \addcontentsline{toc}{chapter}{Bibliography}
%      \addcontentsline{toc}{chapter}{List of References}
%      \bibliography{\@reffile}
%      \bibliographystyle{abbrvnat}
%      \bibliographystyle{ieeetr}      
     \newpage
%    \fi
  }
}

\def\biblio{%
  \ifnum0=\value{myappendixcount}
    \startappendix
  \fi
  \ifnum0=\value{myfigcount}
    \relax
  \else
    \if@filesw\immediate\write\@auxout{\string\myusefigurespage}\fi
  \fi
  \ifnum0=\value{mytablecount}
    \relax
  \else
    \if@filesw\immediate\write\@auxout{\string\myusetablespage}\fi
  \fi
  \phantomsection
  \addcontentsline{toc}{chapter}{Bibliography}
  \@input{\@bibliofile.bbl}
}

\def\bibliox{\bibliography{\@reffile}}

\@ifundefined{@norefbib}{
  \let\@enddocumenthook\biblio
}{
  \let\@enddocumenthook\bibliox
}

相关内容