Erro trivial (syntac) com RenewDocummentCommand vs newdocument command

Erro trivial (syntac) com RenewDocummentCommand vs newdocument command

Eu tive isso:

\let\otitle\title
\renewcommand\title[2] {\otitle{#1 \\ \bigskip \large #2\\ \bigskip}}

funcionou bem, modifiquei para isto (xparse):

\RenewDocumentCommand\title{m m} {\otitle{#1 \\ \bigskip \large #2\\ \bigskip}}

Pretendendo adicionar parâmetros opcionais e outras funcionalidades do xparse, mas na verdade ocorre um erro

\title{Notes for Grade 7 Math, 2020}
{
   Complied from the 2013 Curriculum Guide
  \thanks{Thanks to Gereina Skanes for presentation and formatting review} 
}

que funcionou bem anteriormente. Achei que entendi a sintaxe do RenewDocumentCommand?

Responder1

\titleé um comando robusto e \letnão copia esses comandos corretamente. Você pode usar \LetLtxMacro:

\documentclass{article}

\usepackage{letltxmacro}
\LetLtxMacro\otitle\title

\RenewDocumentCommand\title{m m} {\otitle{#1 \\ \bigskip \large #2\endgraf \bigskip}}

\title{abc}{cde}

\begin{document}
\maketitle
\end{document}

Na próxima versão do LaTeX haverá um \NewCommandCopycomando que você também poderá usar:

\documentclass{article}
\NewCommandCopy\otitle\title %new in the next latex ...
\RenewDocumentCommand\title{m m} {\otitle{#1 \\ \bigskip \large #2\endgraf \bigskip}}

\title{abc}{cde}

\begin{document}
\maketitle
\end{document}

informação relacionada