unicode-math icon indicating copy to clipboard operation
unicode-math copied to clipboard

\setmathfont sets the catcode of text combining diacritics to 12

Open davidcarlisle opened this issue 4 years ago • 0 comments

Description

As came up on stackexchange

https://tex.stackexchange.com/questions/592080/lualatex-why-is-textbar%cc%88-working-but-not-textbar%cc%99/592085#592085.

\setmathfont is setting the catcode of diacritics to 12 meaning that accented letters using them can not be used in commandnames.

Specifically it's this

\cs_set:Nn \__um_set_mathsymbol:nNNn
 {
  \bool_lazy_and:nnT
   {
    \int_compare_p:nNn {#4} > {127}
   }
   {
    \int_compare_p:nNn { \char_value_catcode:n {#4} } = {11}
   }
   { \char_set_catcode_other:n {#4} }

But I lost the thread of where/when exactly this is called.

Add info or delete as appropriate:

\documentclass{article}

\RequirePackage{unicode-math}
\showthe\catcode"0308
\setmathfont{TeXGyreDejaVuMath-Regular}
\showthe\catcode"0308
\begin{document}

\end{document}

davidcarlisle avatar Apr 09 '21 09:04 davidcarlisle