Error trivial (syntac) con RenewDocummentCommand vs comando newdocument

Error trivial (syntac) con RenewDocummentCommand vs comando newdocument

Tuve esto:

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

funcionó bien, lo modifiqué a esto (xparse):

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

Con la intención de agregar parámetros opcionales y otras funciones de xparse, sin embargo, en realidad se produce un error

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

que funcionó bien anteriormente. ¿Pensé que entendía la sintaxis de RenewDocumentCommand?

Respuesta1

\titlees un comando robusto y \letno copia dichos comandos correctamente. Puedes 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}

En la próxima versión de LaTeX habrá un \NewCommandCopycomando que también podrás 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}

información relacionada