Open ghost opened 4 years ago
Thanks for the bug report. I have a hard time deciphering the code, especially the \myMacro part. Can you try to make a minimal working example of the issue, that is to remove all elements from the example that does not contribute directly to the issue. https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that
Can you try to make a minimal working example of the issue
It is already smaller than what egreg produced. I'm not into LaTeX3, but I'll undertake one more attempt:
\documentclass{article}
\usepackage{unicode-math}
\usepackage{todonotes}
\ExplSyntaxOn
\NewDocumentCommand{\myMacro}{m}{
\tl_set:Nn \l_tmpa_tl { #1 }
\regex_replace_all:NnN
\c_justaman_mymacro_greek_regex % search
{ \c{symit}\cB\{\1\cE\} } % replace
\l_tmpa_tl % token list to massage
\mathit{\tl_use:N \l_tmpa_tl}
}
\regex_const:Nn \c_justaman_mymacro_greek_regex
{% one or more Greek letters; fill up
([\c{alpha}]+)
}
\ExplSyntaxOff
\begin{document}
\listoftodos
\clearpage
\noindent\(\myMacro{\alpha}\)\\
\(\myMacro{Finite\_word\_with\_\alpha}\)
\todo[inline]{\(\myMacro{\alpha}\)\\
\(\myMacro{Finite\_word\_with\_\alpha}\)}
\end{document}
produces
on the second page, as expected, but
on the first page, where 𝛼s are missing.
You asked me to simplify the expl3 code. That's where I find myself in special difficulty: I know very little expl3.
That has nothing to do with a todonotes bug. Your alpha would also disappear in the table of contents if you used it e.g. in a section heading as it expands when written into a list. You would have to protect it:
\todo[inline]{\(\myMacro{\protect\alpha}\)\\
\(\myMacro{Finite\_word\_with\_\protect\alpha}\)}
Feeding
to
xelatex
results in the correct second pagebut in the list of todo notes on the first page, the
\alpha
s are missing:Any idea of what goes on here and how to repair this bug? Crosspost: http://latex.org/forum/viewtopic.php?p=113104.