xkeyval 包在最近更新 ltxbase 后引发错误

xkeyval 包在最近更新 ltxbase 后引发错误

我正在为我的书使用自定义类。在miktex2020 年 10 月 28 日进行的最新更新后,本书的编译引发了一个错误。简短的调查显示,miktex 包中更改的文件是ltxbaseunicode-data。错误是由xkeyval包引发的,它错误地检测到它在 之前被调用\documentclass,但事实并非如此。以下 MWE 显示book来自包的标准类ltxbase不会引发此类错误:

%\documentclass[a4paper,11pt,openany,twoside,unicode]{Common/PlasmaBook2}
\documentclass{book}

\usepackage{xkeyval}

\begin{document}
    Something to say\ldots 
\end{document}

但是使用自定义类最终会出现错误消息:

! Package xkeyval Error: xkeyval loaded before \documentclass.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.62 ...yval loaded before \protect\documentclass}

xkeyval以下是包中检测错误的行:

\ifx\XKV@documentclass\@undefined
  \XKV@err{xkeyval loaded before \protect\documentclass}%
  \let\XKV@documentclass\@empty
  \let\XKV@classoptionslist\@empty
\else
  \let\XKV@classoptionslist\@classoptionslist
  \def\XKV@tempa#1{%
    \let\@classoptionslist\@empty
    \XKV@for@n{#1}\XKV@tempa{%
      \expandafter\in@\expandafter=\expandafter{\XKV@tempa}%
      \ifin@\else\XKV@addtolist@o\@classoptionslist\XKV@tempa\fi
    }%
  }
  \expandafter\XKV@tempa\expandafter{\@classoptionslist}
\fi

可以看出,xkeyval由于未能定义\XKV@documentclass前几行,因此引发了错误:

\XKV@whilist\@filelist\XKV@tempa\ifx\XKV@documentclass\@undefined\fi{%
  \filename@parse\XKV@tempa
  \ifx\filename@ext\@clsextension
    \XKV@ifundefined{opt@\filename@area\filename@base.\filename@ext
    }{}{%
      \edef\XKV@documentclass{%
        \filename@area\filename@base.\filename@ext
      }%
    }%
  \fi
}

我的假设是,最近的更新ltxbase改变了一些工作方式\documentclass。我的自定义类中应该检查什么?据我记得,它基于book类的一些旧版本。

更新:这里是减少的自定义类:

\NeedsTeXFormat{LaTeX2e}[1998/06/01]
\ProvidesClass{Common/PlasmaBook2}[2020/06/27 v0.99j LaTeX document class]
%<KIA>
\RequirePackage[dvipsnames,svgnames]{xcolor}
\definecolor{titleColor}{named}{Brown}
\let\@afterindentfalse\@afterindenttrue
\@afterindenttrue
%</KIA>
\newcommand\@ptsize{}
\newif\if@restonecol
\newif\if@titlepage
\@titlepagetrue
\newif\if@openright
\newif\if@mainmatter \@mainmattertrue
%IAK>
\newif\if@makechanges
\newif\if@unicode \@unicodefalse
\newif\if@binom \@binomfalse
%IAK<
\if@compatibility\else
\DeclareOption{a4paper}
   {\setlength\paperheight {297mm}%
    \setlength\paperwidth  {210mm}}
\DeclareOption{a5paper}
   {\setlength\paperheight {210mm}%
    \setlength\paperwidth  {148mm}}
\DeclareOption{b5paper}
   {\setlength\paperheight {250mm}%
    \setlength\paperwidth  {176mm}}
\DeclareOption{letterpaper}
   {\setlength\paperheight {11in}%
    \setlength\paperwidth  {8.5in}}
\DeclareOption{legalpaper}
   {\setlength\paperheight {14in}%
    \setlength\paperwidth  {8.5in}}
\DeclareOption{executivepaper}
   {\setlength\paperheight {10.5in}%
    \setlength\paperwidth  {7.25in}}
\DeclareOption{landscape}
   {\setlength\@tempdima   {\paperheight}%
    \setlength\paperheight {\paperwidth}%
    \setlength\paperwidth  {\@tempdima}}
\fi
\if@compatibility
  \renewcommand\@ptsize{0}
\else
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\fi
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
\if@compatibility\else
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\fi
\DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\if@compatibility\else
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\fi
\DeclareOption{titlepage}{\@titlepagetrue}
\if@compatibility\else
\DeclareOption{notitlepage}{\@titlepagefalse}
\fi
\if@compatibility
\@openrighttrue
\else
\DeclareOption{openright}{\@openrighttrue}
\DeclareOption{openany}{\@openrightfalse}
\fi
\if@compatibility\else
\DeclareOption{onecolumn}{\@twocolumnfalse}
\fi
\DeclareOption{twocolumn}{\@twocolumntrue}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\DeclareOption{openbib}{%
  \AtEndOfPackage{%
   \renewcommand\@openbib@code{%
      \advance\leftmargin\bibindent
      \itemindent -\bibindent
      \listparindent \itemindent
      \parsep \z@
      }%
   \renewcommand\newblock{\par}}%
}
%IAK>
\DeclareOption{adoptchanges}{\@makechangestrue}
\DeclareOption{rejectchanges}{\@makechangesfalse}
\DeclareOption{unicode}{\@unicodetrue}
\DeclareOption{binom}{\@binomtrue}

%IAK<
\ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright,adoptchanges}
\ProcessOptions
\input{bk1\@ptsize.clo}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{0\p@ \@plus \p@}
\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301
\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{3}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}
\if@twoside
  \def\ps@headings{%
      \let\@oddfoot\@empty\let\@evenfoot\@empty
      \def\@evenhead{\thepage\hfil\slshape\leftmark}%
      \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
      \let\@mkboth\markboth
    \def\chaptermark##1{%
      %\markboth {\MakeUppercase{%
      \markboth {{%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \@chapapp\ \thechapter. \ %
          \fi
        \fi
        ##1}}{}}%
    \def\sectionmark##1{%
      %\markright {\MakeUppercase{%
      \markright {{%
        \ifnum \c@secnumdepth >\z@
          \thesection. \ %
        \fi
        ##1}}}}
\else
  \def\ps@headings{%
    \let\@oddfoot\@empty
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \let\@mkboth\markboth
    \def\chaptermark##1{%
      %\markright {\MakeUppercase{%
      \markright {{%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \@chapapp\ \thechapter. \ %
          \fi
        \fi
        ##1}}}}
\fi
\def\ps@myheadings{%
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\thepage\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \let\@mkboth\@gobbletwo
    \let\chaptermark\@gobble
    \let\sectionmark\@gobble
    }
%%%IAK>
\def\series#1{\gdef\@series{#1}}
\def\@series{\@latex@warning@no@line{No \noexpand\series given}}
\def\referee#1{\gdef\@referee{#1}}
\def\@referee{\@latex@warning@no@line{No \noexpand\referee given}}
\long\def\abstract#1{\long\gdef\@abstract{#1}}
\def\@abstract{\@latex@warning@no@line{No \noexpand\abstract given}}
\def\UDK#1{\gdef\@UDK{#1}}
\def\@UDK{\@latex@warning@no@line{No \noexpand\UDK given}}
%%%IAK<
\newcommand*\chaptermark[1]{}
%% KIA вторник, Сентябрь 6, 2005@10:41
%\setcounter{secnumdepth}{2}
\setcounter{secnumdepth}{1}
\newcounter {part}
\newcounter {chapter}
%%
%% Вводим счетчик полного числа глав, может использоваться в \sref, \seqref
%%
%%%%%\newcounter {chaptertotal}% пятница, Август 14, 2020  12:57
%%
%% Вводим счетчик раздела для другой версии команд \sref, \seqref
%% предполагается, что \appendix вызывает \refstepcounter{mattercnt}
%%
\newcounter {mattercnt}% пятница, Август 14, 2020  12:57
%IAK:
\newcounter {section}[chapter]
%\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
\renewcommand \thepart {\@Roman\c@part}
\renewcommand \thechapter {\@arabic\c@chapter}
\renewcommand \thesection {\S\thechapter.\@arabic\c@section}
%IAK: \renewcommand \thesection {\S\@arabic\c@section}
%IAK: \renewcommand \thesection {\S\@arabic\c@section}
\renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
\newcommand\@chapapp{\chaptername}
\newcommand\frontmatter{%
    \cleardoublepage
  \@mainmatterfalse
  \pagenumbering{roman}}
\newcommand\mainmatter{%
    \cleardoublepage
  \@mainmattertrue
  \pagenumbering{arabic}}
\newcommand\backmatter{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \@mainmatterfalse}
\newcommand\part{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \if@binom
    \thispagestyle{empty}
  \else
    \thispagestyle{plain}
  \fi
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \null\vfil
  \secdef\@part\@spart}

\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    \markboth{}{}%
    {\centering
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >-2\relax
       \huge\bfseries \partname~\thepart
       \par
       \vskip 20\p@
     \fi
     \Huge \bfseries #2\par}%
    \@endpart}
\def\@spart#1{%
    {\centering
     \interlinepenalty \@M
     \normalfont
     \Huge \bfseries #1\par}%
    \@endpart}
\def\@endpart{\vfil\newpage
              \if@twoside
                \null
                \thispagestyle{empty}%
                \newpage
              \fi
              \if@tempswa
                \twocolumn
              \fi}
\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \if@binom
                        \thispagestyle{empty}
                    \else
                        \thispagestyle{plain}
                    \fi
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         %%%%%\refstepcounter{chaptertotal}% пятница, Август 14, 2020  12:58
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   %% среда, Сентябрь 23, 2020  11:22
                                   %% со стандартным \tableofcontenrs
                                   %{\protect\numberline{\thechapter}#1}%
                                   %% только с titletoc-v1
                                   {\protect\numberline{\chaptername~\thechapter}#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \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}%
                      \@makechapterhead[#1]{#2}%
                      \@afterheading
                    \fi}
%%% ===================================================
%%\def\@makechapterhead#1{%
%%  \vspace*{50\p@}%
%%  {\parindent \z@ \raggedright \normalfont
%%    \ifnum \c@secnumdepth >\m@ne
%%      \if@mainmatter
%%        \huge\bfseries \@chapapp\space \thechapter
%%        \par\nobreak
%%        \vskip 20\p@
%%      \fi
%%    \fi
%%    \interlinepenalty\@M
%%    \Huge \bfseries #1\par\nobreak
%%    \vskip 40\p@
%%  }}
%%% ===================================================
\def\@makechapterhead[#1]#2{%
  \vspace*{40\p@}%
  {\parindent \z@ \raggedright \titlefont\color{titleColor}
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \Large \bfseries \@chapapp{} \thechapter
        \par\nobreak
        \vskip 10\p@
      \fi
    \fi
    \interlinepenalty\@M % <- what is it?
    \huge \bfseries
    \sbox\@tempboxa{#1}%
    %%\the\hsize=\the\columnwidth ?<? \the\wd\@tempboxa
    %% Allow 2 lines of huge size title@most
    \ifdim \wd\@tempboxa < 2\hsize
        #1 \\[-0.5em]
        \hrulefill
        \par\nobreak
        \vskip 10\p@
        % Don't type #2 if #2=#1
        \def\@tempa{#1}
        \def\@tempb{#2}
        \ifx\@tempa\@tempb
        \else
            %\hangindent=15pt\hangafter=0
            \hangindent=17pt\hangafter=0
            \large \parbox{0.95\columnwidth}{\raggedright #2}\par\nobreak
        \fi
    \else
        \large #2\par\nobreak
    \fi
    \vskip 20\p@
  }}
%%% ===================================================
\def\@schapter#1{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}%
                   \@afterheading
                 \fi}
\def\@makeschapterhead#1{%
%IAK:  \vspace*{50\p@}%
  \vspace*{40\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
%IAK:    \Huge \bfseries  #1\par\nobreak
    \Huge\titlefont\color{titleColor} \bfseries  #1\par\nobreak
%IAK:    \vskip 40\p@
    \vskip 20\p@
  }}
% =========================================================
\newcommand\section{\@startsection {section}{1}{\z@}% #1#2#3
                                   {-3.5ex \@plus -1ex \@minus -.2ex}% #4
                                   {2.3ex \@plus.2ex}% #5
%IAK:                                   {\normalfont\Large\bfseries}} #6
                        {\indent\normalfont\titlefont\large\bfseries\color{titleColor}\raggedright}}
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
%IAK:                                {\normalfont\large\bfseries}}
                        {\indent\normalfont\titlefont\bfseries\color{titleColor}\raggedright}}
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
%IAK:                               {\normalfont\normalsize\bfseries}}
                {\indent\normalfont\titlefont\normalsize\bfseries\color{titleColor}\raggedright}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {-1em}%
%IAK:                               {\normalfont\normalsize\bfseries}}
                {\indent\normalfont\titlefont\normalsize\bfseries\color{titleColor}\raggedright}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                                       {3.25ex \@plus1ex \@minus .2ex}%
                                       {-1em}%
%IAK:                                 {\normalfont\normalsize\bfseries}}
                {\indent\normalfont\titlefont\normalsize\bfseries\color{titleColor}\raggedright}}
\if@twocolumn
  \setlength\leftmargini  {2em}
\else
  \setlength\leftmargini  {2.5em}
\fi
\leftmargin  \leftmargini
\setlength\leftmarginii  {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv  {1.7em}
\if@twocolumn
  \setlength\leftmarginv  {.5em}
  \setlength\leftmarginvi {.5em}
\else
  \setlength\leftmarginv  {1em}
  \setlength\leftmarginvi {1em}
\fi
\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}
\newenvironment{description}
               {\list{}{\labelwidth\z@ \itemindent-\leftmargin
                        \let\makelabel\descriptionlabel}}
               {\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries #1}
\newenvironment{verse}
               {\let\\\@centercr
                \list{}{\itemsep      \z@
                        \itemindent   -1.5em%
                        \listparindent\itemindent
                        \rightmargin  \leftmargin
                        \advance\leftmargin 1.5em}%
                \item\relax}
               {\endlist}
\newenvironment{quotation}
               {\list{}{\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
\newenvironment{quote}
               {\list{}{\rightmargin\leftmargin}%
                \item\relax}
               {\endlist}
\if@compatibility
\newenvironment{titlepage}
    {%
      \cleardoublepage
      \if@twocolumn
        \@restonecoltrue\onecolumn
      \else
        \@restonecolfalse\newpage
      \fi
      \thispagestyle{empty}%
      \setcounter{page}\z@
    }%
    {\if@restonecol\twocolumn \else \newpage \fi
    }
\else
\newenvironment{titlepage}
    {%
      \cleardoublepage
      \if@twocolumn
        \@restonecoltrue\onecolumn
      \else
        \@restonecolfalse\newpage
      \fi
      \thispagestyle{empty}%
      \setcounter{page}\@ne
    }%
    {\if@restonecol\twocolumn \else \newpage \fi
     \if@twoside\else
        \setcounter{page}\@ne
     \fi
    }
\fi
\newcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \refstepcounter{mattercnt}% пятница, Август 14, 2020  13:49
  \renewcommand\@chapapp{\appendixname}%
  \renewcommand\thechapter{\@Alph\c@chapter}}
%  \renewcommand\thechapter{\Asbuk{chapter}}}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
%% ==============================================
\@addtoreset {equation}{chapter}
\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}


\newcounter{figure}[chapter]
\renewcommand \thefigure
% KIA пятница, Декабрь 23, 2005@17:02
    {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
    %{\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
\newenvironment{figure}
               {\@float{figure}}
               {\end@float}
\newenvironment{figure*}
               {\@dblfloat{figure}}
               {\end@dblfloat}
\newcounter{table}[chapter]
\renewcommand \thetable
     % KIA понедельник, Май 21, 2012  09:42
     {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
     %{\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\newenvironment{table}
               {\@float{table}}
               {\end@float}
\newenvironment{table*}
               {\@dblfloat{table}}
               {\end@dblfloat}
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
%%<KIA>
%\setlength\belowcaptionskip{0\p@}
\setlength\belowcaptionskip{10\p@}
\long\def\@makecaption#1#2{%
%  \vskip\abovecaptionskip
  \vskip\abovecaptionskip\small
%  \sbox\@tempboxa{#1: #2}%
  %\sbox\@tempboxa{\textcolor{\titleColor}{\itshape\bfseries #1.} #2}%
  \sbox\@tempboxa{\textcolor{titleColor}{\bfseries #1.} #2}%
  \ifdim \wd\@tempboxa >\hsize
%    #1: #2\par
    %\textcolor{\titleColor}{\itshape\bfseries #1.} #2\par
    \textcolor{titleColor}{\bfseries #1.} #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
%%</KIA>
\newcommand\@pnumwidth{1.55em}
\newcommand\@tocrmarg{2.55em}
\newcommand\@dotsep{4.5}
\setcounter{tocdepth}{2}
\newcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{%
           %\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
           \contentsname}{\contentsname}}%
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }
\newcommand*\l@part[2]{%
  \ifnum \c@tocdepth >-2\relax
    \addpenalty{-\@highpenalty}%
    \addvspace{2.25em \@plus\p@}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      {\leavevmode
       %\large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
       % НГУ
       \large \bfseries #1\hfil\mdseries \hb@xt@\@pnumwidth{\hss #2}}\par
       \nobreak
         \global\@nobreaktrue
         \everypar{\global\@nobreakfalse\everypar{}}%
    \endgroup
  \fi}
\newcommand*\l@chapter[2]{%
  \ifnum \c@tocdepth >\m@ne
    \addpenalty{-\@highpenalty}%
    \vskip 1.0em \@plus\p@
    \setlength\@tempdima{1.5em}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \advance\leftskip\@tempdima
      \hskip -\leftskip
      %#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
      % НГУ
      #1\nobreak\hfil \nobreak\mdseries\hb@xt@\@pnumwidth{\hss #2}\par
      \penalty\@highpenalty
    \endgroup
  \fi}
\newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
\newcommand\listoffigures{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      %\@mkboth{\MakeUppercase\listfigurename}%
      %        {\MakeUppercase\listfigurename}}%
      \@mkboth{\listfigurename}%
              {\listfigurename}}%
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    }
\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand\listoftables{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{%
          %\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}%
          \listtablename}{\listtablename}}%
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
    }
\let\l@table\l@figure
\newdimen\bibindent
\setlength\bibindent{1.5em}
\newenvironment{thebibliography}[1]
     {\chapter*{\bibname
        %\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
        \@mkboth{\bibname}{\bibname}}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty
\newenvironment{theindex}
               {\if@twocolumn
                  \@restonecolfalse
                \else
                  \@restonecoltrue
                \fi
                \columnseprule \z@
                \columnsep 35\p@
                \twocolumn[\@makeschapterhead{\indexname}]%
%                \@mkboth{\MakeUppercase\indexname}%
%                        {\MakeUppercase\indexname}%
                \@mkboth{\indexname}%
                        {\indexname}%
                %\thispagestyle{plain}\parindent\z@
                \if@binom
                    \thispagestyle{empty}\parindent\z@
                \else
                    \thispagestyle{plain}\parindent\z@
                \fi
                \parskip\z@ \@plus .3\p@\relax
                \let\item\@idxitem}
               {\if@restonecol\onecolumn\else\clearpage\fi}
\newcommand\@idxitem{\par\hangindent 40\p@}
\newcommand\subitem{\@idxitem \hspace*{20\p@}}
\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
\renewcommand\footnoterule{%
  \kern-3\p@
  \hrule\@width.4\columnwidth
  \kern2.6\p@}
\@addtoreset{footnote}{chapter}
\newcommand\@makefntext[1]{%
    \parindent 1em%
    \noindent
    \hb@[email protected]{\hss\@makefnmark}#1}
\newcommand\contentsname{Contents}
\newcommand\listfigurename{List of Figures}
\newcommand\listtablename{List of Tables}
\newcommand\bibname{Bibliography}
\newcommand\indexname{Index}
\newcommand\figurename{Figure}
\newcommand\tablename{Table}
\newcommand\partname{Part}
\newcommand\chaptername{Chapter}
\newcommand\appendixname{Appendix}
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
%% ------------------------------------------------------------------
\endinput

答案1

不喜欢这个问题得不到回答...Phelype's建议对我有用。

解决方法是将类.cls文件放在 Latex 项目的根目录中,而不是子文件夹中。也就是说,\documentclass[...]{Common/PlasmaBook2}需要\documentclass[...]{PlasmaBook2}PlasmaBook2.cls位于同一目录中main.tex。我在类方面遇到了同样的问题IEEEtran

这显然是一个错误,但直到它被修复https://github.com/latex3/latex2e,这个修复是可行的方法之一。

相关内容