多个 \str_case_e 的问题

多个 \str_case_e 的问题

如果我想使用多个,我会遇到问题\str_case_e:nnTF。你能帮我解决这个问题吗?定义有问题吗\str_case_e:nnTF?谢谢。

我在 Mac OS 上使用 pdflatex:

pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

测试.cls

\ProvidesClass{test}[2023/02/26 TEST LaTeX class 1.0.00]
\NeedsTeXFormat{LaTeX2e}

% options
\newcommand{\project@option@language}{}
\newcommand{\project@option@type}{}

\DeclareOption{english}{\renewcommand{\project@option@language}{english}}
\DeclareOption{portuguese}{\renewcommand{\project@option@language}{portuguese}}
\DeclareOption{czech}{\renewcommand{\project@option@language}{czech}}
\DeclareOption{slovak}{\renewcommand{\project@option@language}{slovak}}

\DeclareOption{report}{\renewcommand{\project@option@type}{report}}

\DeclareOption*{\PackageError{test}{Unknown option `\CurrentOption'}}

% default options
\ExecuteOptions{report,english}
\ProcessOptions\relax

% language settings
\newcommand{\project@language@english}{english}
\newcommand{\project@language@portuguese}{portuguese}
\newcommand{\project@language@czech}{czech}

% document type settings
\newcommand{\project@type@report}{report}

\ifx\project@option@type\project@type@report
    \LoadClass[a4paper,twoside,onecolumn]{article}
\fi

\RequirePackage[T1]{fontenc}
\ifx\project@option@language\project@language@portuguese
    \RequirePackage[brazil]{babel}
\fi
\ifx\project@option@language\project@language@czech
    \RequirePackage[czech]{babel}
\fi
\RequirePackage[utf8]{inputenc}

\RequirePackage{expl3}

\ExplSyntaxOn

\newcommand{\project@authors@label}{
  \str_case_e:nnTF {\project@option@language} {
    {\project@language@portuguese} {Autores}
    {\project@language@czech} {Auto\v{r}i}
  }{
    \relax
  }{
    Authors
  }
}

\newcommand{\project@update@label}{
  \str_case_e:nnTF {\project@option@language} {
    {\project@language@portuguese} {Histórico~de~atualizações}
    {\project@language@czech} {Historie~aktualizací}
  }{
  }{
    Updates
  }
}   

\ExplSyntaxOff

\newcommand{\test}{%
    \project@update@label
    \project@authors@label
}

测试.tex

\documentclass[report,czech]{test} 

\begin{document}

\section{Template overview}

\test

\end{document}

错误日志:

pdflatex  -halt-on-error test.tex -o test.pdf
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24> (./test.cls
Document Class: test 2023/02/26 TEST LaTeX class 1.0.00
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel/txtbabel.def)
(/usr/local/texlive/2022/texmf-dist/tex/generic/babel-czech/czech.ldf))
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)))
 (./test.aux)
! Undefined control sequence.
\project@authors@label ->\str_case__e:nnTF 
                                           {\project@option@language }{{\pro...
l.7 \test
         
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.

相关内容