![无法在 \titlecap 中使用 \MakeLowercase?](https://linux22.com/image/354117/%E6%97%A0%E6%B3%95%E5%9C%A8%20%5Ctitlecap%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20%5CMakeLowercase%EF%BC%9F.png)
这是最小代码
\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{xparse}
\usepackage{titlecaps}
\begin{document}
\MakeLowercase{LAtex foR doCumenT seTTing} \\
\titlecap{LAtex foR doCumenT seTTing}\\
\titlecap{\MakeLowercase{LAtex foR doCumenT seTTing}}
\end{document}
答案1
一种可能性是……这里,\caselower
将其结果保存到 中\thestring
。您可以使用 悄悄地完成此操作\caselower[q]{<string to process>}
。
\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
%\usepackage{xparse}
\usepackage{titlecaps, stringstrings}
\begin{document}
\caselower{LAtex foR doCumenT seTTing} \\
\titlecap{LAtex foR doCumenT seTTing}\\
\expandafter\titlecap\expandafter{\thestring}
\end{document}
因此,直接得到结果
\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
%\usepackage{xparse}
\usepackage{titlecaps, stringstrings}
\begin{document}
\caselower[q]{LAtex foR doCumenT seTTing}
\expandafter\titlecap\expandafter{\thestring}
\end{document}
答案2
你可以这样做
\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{xparse}
\usepackage{titlecaps}
\ExplSyntaxOn
\NewDocumentCommand{\xtitlecap}{O{}m}
{
\teron_xtitlecap:nf { #1 } { \tl_lower_case:n { #2 } }
}
\cs_new_protected:Nn \teron_xtitlecap:nn
{
\titlecap[#1]{#2}
}
\cs_generate_variant:Nn \teron_xtitlecap:nn { nf }
\ExplSyntaxOff
\begin{document}
\MakeLowercase{LAtex foR doCumenT seTTing}
\xtitlecap{LAtex foR doCumenT seTTing}
\end{document}