Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greek math letters are not printed in the list of todo notes #47

Open
ghost opened this issue Jun 17, 2020 · 2 comments
Open

Greek math letters are not printed in the list of todo notes #47

ghost opened this issue Jun 17, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 17, 2020

Feeding

\documentclass{article}
\pagestyle{empty}
\usepackage[math-style=ISO]{unicode-math}
\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
\setsansfont{TeX Gyre Heros}[Scale=0.88]
\setmonofont{TeX Gyre Cursor}
\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}
\usepackage{todonotes}
%%% Simplified http://tex.stackexchange.com/a/549106 :
\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}\c{beta}\c{gamma}]+)
}
\ExplSyntaxOff
\begin{document}
\listoftodos
\clearpage
\noindent\(\myMacro{\alpha}\)\\
\(\myMacro{Finite\_word\_with\_\alpha}\)
\todo[inline]{\(\myMacro{\alpha}\)\\
\(\myMacro{Finite\_word\_with\_\alpha}\)}
\end{document}

to xelatex results in the correct second page

p2

but in the list of todo notes on the first page, the \alphas are missing:

p1

Any idea of what goes on here and how to repair this bug? Crosspost: http://latex.org/forum/viewtopic.php?p=113104.

@henrikmidtiby
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented Jun 19, 2020

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

p2

on the second page, as expected, but

p1

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant