LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

expansion of \title argument may happen too early

Open xworld21 opened this issue 3 years ago • 2 comments
trafficstars

Discovered while trying to compile the LaTeX News https://www.latex-project.org/news/latex2e-news/: the argument of \title is expanded immediately, but it contains a macro that is only defined later, and so it fails.

MWE:

\documentclass{article}
\title{\mytitle}
\newcommand{\mytitle}{Title}
\begin{document}
\maketitle
\end{document}

causes

Error:undefined:\mytitle The token T_CS[\mytitle] is not defined. at String; line 2 col 0

xworld21 avatar Aug 18 '22 18:08 xworld21

We may want to bundle the fix here with a fix for ar5iv#174 which has a sibling issue in how we handle \title currently.

dginev avatar Aug 18 '22 18:08 dginev

We had a follow-up discussion in PR #1937 which somewhat firmly established we will defer a proper fix for this issue till 0.8.8, refocusing the frontmatter implementation around the original LaTeX internals (such as \@author, \@title, \@date).

dginev avatar Dec 13 '22 20:12 dginev