
引数を受け入れ、(入力文字の大文字小文字に関係なく)最初の文字を除くすべての文字を小文字に設定する新しいコマンドを定義したい。
\documentclass{book}
\ExplSyntaxOn
\NewDocumentCommand{\LowerCase}{m}
{
\group_begin:
\cs_set_protected:Npx \\ { \exp_not:o \\ }
\text_lowercase:n {#1}
\group_end:
}
\ExplSyntaxOff
\begin{document}
\LowerCase{TestinG}
\end{document}
答え1
LaTeX 2022-11-01より:
\documentclass{book}
\begin{document}
\MakeTitlecase{TestinG}
\end{document}
見るltnews36.pdf
詳細については。
答え2
すでに存在します:
\documentclass{book}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\TitleCase}{m}
{
\text_titlecase:n {#1}
}
\ExplSyntaxOff
\begin{document}
\TitleCase{TestinG}
\end{document}