![这个 cls 有什么问题?](https://linux22.com/image/441197/%E8%BF%99%E4%B8%AA%20cls%20%E6%9C%89%E4%BB%80%E4%B9%88%E9%97%AE%E9%A2%98%EF%BC%9F.png)
我已经使用以下.cls
文件很长时间了。
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\ProvidesExplClass{syuartl3}{2021/08/29}{}{Gau Syu Note Class}
\RequirePackage{xparse,l3keys2e}
\keys_define:nn { syu / options }
{
secnum .code:n =
{ \AtEndOfClass { \setsecnum{#1} } },
secdep .code:n =
{ \AtEndOfClass { \setsecdep{#1} } },
color .choice:,
color .default:n = bm,
color / bm .code:n = { \AtEndOfClass { \__syu_color_bm: } },
color / gray .code:n = { \AtEndOfClass { \__syu_color_gray: } },
color / unknown .code:n =
\msg_error:nnxxx { syu / options } { unknown-choice }
{ color } { bm, gray } { \exp_not:n {#1} },
swap .bool_set:N = \g__syu_swapnumbers,
numin .default:n = section,
numin .tl_gset:N = \g__syu_numin
}
\clist_new:N \g__syu_std_clist
\keys_define:nn { syu / options }
{
unknown .code:n =
{ \clist_gput_right:No \g__syu_std_clist { \CurrentOption } }
}
\ProcessKeysOptions{ syu / options }
\PassOptionsToClass { \g__syu_std_clist } { article }
\LoadClass { article }
\RequirePackage{secnum}
\DeclareDocumentCommand{\setsecdep}{m}
{ \setcounter{secnumdepth}{#1} }
\DeclareDocumentCommand{\settocdep}{m}
{ \setcounter{tocdepth}{#1} }
\RequirePackage{xcolor}
\DeclareDocumentCommand{\termcolor}{m}
{ \tl_gset:Nn \g__syu_termcolor_tl {#1} }
\NewDocumentCommand \blue {} { \color{blue} }
\NewDocumentCommand \magenta {} { \color{magenta} }
\NewDocumentCommand \red {} { \color{red} }
\tl_gset:Nn \g__syu_termcolor_tl { black }
\cs_new_protected:Nn \__syu_color_bm:
{
\tl_gset:Nn \g__syu_termcolor_tl { blue }
\hypersetup
{
colorlinks=true,
linkcolor=blue,
citecolor=magenta,
urlcolor=magenta
}
}
\cs_new_protected:Nn \__syu_color_gray:
{
\tl_gset:Nn \g__syu_termcolor_tl { black }
\hypersetup
{
colorlinks=true,
linkcolor=black,
citecolor=gray,
urlcolor=gray
}
}
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
{\csname the#1\endcsname\quad}% default
{\csname #1@cntformat\endcsname}}% enable indiv. control
\newcommand\section@cntformat{\S\,\thesection\quad}
\makeatother
\RequirePackage{imakeidx}%Make index
\makeindex
\DeclareDocumentCommand \term { m O{#1} }
{ \textbf{\color{\g__syu_termcolor_tl}{#1}}\index{#2} }
\RequirePackage{indentfirst}
\RequirePackage[shortlabels]{enumitem}
\RequirePackage{marginnote}
\RequirePackage[leqno]{amsmath}%The amsmath pkg, with leqno option
\RequirePackage{amsthm}%Define theorem-like envs
\RequirePackage{thmtools}%Tools for theorem-like envs
\RequirePackage{amssymb}%Some math symbols
\RequirePackage[scr=rsfso,cal=cm]{mathalpha}%Math fonts
\RequirePackage{hyperref}%Enable in-text refs
\RequirePackage[capitalize,nameinlink]{cleveref}
\crefname{section}{\S}{\S}
\makeatletter
\newcommand{\appsec}[2]{%
\phantomsection
\refstepcounter{section}%
\section*{#1}%
\addtocounter{section}{-1}%
\def\@currentlabelname{#1}%
\def\@currentlabel{\thesection}%
\label{#2}%
\addcontentsline{toc}{section}{#1}%
}
\makeatother
\bool_if:NT \g__syu_swapnumbers { \swapnumbers }
\tl_if_empty:NF \g__syu_numin
{ \numberwithin{equation}{ \g__syu_numin } }
\theoremstyle{plain}
\newtheorem{theorem}[equation]{Theorem}
\newtheorem{lemma}[equation]{Lemma}
\newtheorem{proposition}[equation]{Proposition}
\newtheorem{corollary}[equation]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[equation]{Definition}
\newtheorem{example}[equation]{Example}
\newtheorem{para}[equation]{}
\theoremstyle{remark}
\newtheorem*{remark}{Remark}
\newcommand{\crefrangeconjunction}{--}
\Crefname{equation}{}{}
\Crefname{para}{}{}
\newlist{thmlist}{enumerate}{1}
\setlist[thmlist]
{label=\textup{(\roman{thmlisti})},ref={(\roman{thmlisti})}}
\addtotheorempostheadhook[theorem]
{\crefalias{thmlisti}{theorem}}
\addtotheorempostheadhook[lemma]
{\crefalias{thmlisti}{lemma}}
\addtotheorempostheadhook[proposition]
{\crefalias{thmlisti}{proposition}}
\addtotheorempostheadhook[corollary]
{\crefalias{thmlisti}{corollary}}
\addtotheorempostheadhook[para]
{\crefalias{thmlisti}{para}}
\newlist{eglist}{enumerate}{1}
\setlist[eglist]
{label=\textup{(\alph{eglisti})},ref={(\alph{eglisti})}}
\addtotheorempostheadhook[example]
{\crefalias{eglisti}{example}}
\newlist{paralist}{enumerate}{1}
\setlist[paralist]
{label=\textup{(\alph{paralisti})},ref={(\alph{paralisti})}}
\addtotheorempostheadhook[para]
{\crefalias{paralisti}{para}}
\makeatletter
\renewcommand{\p@thmlisti}{\perh@ps{\thetheorem}}
\renewcommand{\p@eglisti}{\perh@ps{\theexample}}
\renewcommand{\p@paralisti}{\perh@ps{\thepara}}
\protected\def\perh@ps#1#2{\textup{#1#2}}
\newcommand{\itemrefperh@ps}[2]{\textup{#2}}
\newcommand{\itemref}[1]{\begingroup\let\perh@ps\itemrefperh@ps\ref{#1}\endgroup}
\makeatother
\endinput
然而,自从我昨天更新了我的 Tex live 以来,我一直面临错误信息
Undefined control sequence.
\secnum.sty-h@@k ->\__syu_color_bm:
但这没有意义!secnum
它由我维护,我没有更改它。所以这个包不可能引起问题!
问题: 我的 出了什么问题.cls
!
更新:MWE:
\documentclass[color]{syuartl3}
\begin{document}hello world!\end{document}