\DeclareRobustCommand + 参数的参数

\DeclareRobustCommand + 参数的参数

不可能做出这样的事情吗?

\documentclass[a4paper]{memoir}

\usepackage{microtype}

\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}%

\microtypesetup{expansion=false}%

\DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\MakeTextUppercase{#1}}}%

\DeclareRobustCommand{\spacedallcapsB}{\spacedallcaps{\Large}}%

\begin{document}
{\spacedallcapsB Hallo}
\end{document}

答案1

对于预期结果,这只是一个大胆的猜测。

在此处输入图片描述

\documentclass[a4paper]{memoir}
\usepackage{textcase}
\usepackage{microtype}

\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}%

\microtypesetup{expansion=false}%

\DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\MakeTextUppercase{#1}}}%

\DeclareRobustCommand\spacedallcapsB{\afterassignment\xspacedallcapsB\toks0\bgroup}
\def\xspacedallcapsB{\Large\spacedallcaps{\the\toks0}\egroup}

\begin{document}
{\spacedallcapsB Hallo}
\end{document}

相关内容