latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
245 stars 29 forks source link

\setmathfont sets the catcode of text combining diacritics to 12 #566

Open davidcarlisle opened 3 years ago

davidcarlisle commented 3 years ago

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}