RenewDocummentCommand와 newdocument 명령의 사소한 실수(syntac)

RenewDocummentCommand와 newdocument 명령의 사소한 실수(syntac)

나는 이것을 가지고 있었다 :

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

잘 작동했고 다음과 같이 수정했습니다(xparse).

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

선택적 매개변수 및 기타 xparse 기능을 추가하려고 시도했지만 실제로는 오류가 발생했습니다.

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

이전에는 잘 작동했습니다. RenewDocumentCommand의 구문을 이해했다고 생각하시나요?

답변1

\title강력한 명령이며 \let이러한 명령을 올바르게 복사하지 않습니다. 당신이 사용할 수있는 \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}

다음 LaTeX 릴리스에는 다음 \NewCommandCopy과 같은 명령도 사용할 수 있습니다.

\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}

관련 정보