这是最小代码
\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}