[NTG-context] Math letters in commands

Hans Åberg haberg-1 at telia.com
Mon Sep 12 20:25:17 CEST 2016


Found a workaround: The idea is to use \csname …\endcsname with two delimiters not likely to be used in math mode, below chosen to ‘…’.

But then there seems to be a bug in the LuaTex \letcharcode command: There must be a character between “$” and the first occurring \activecatcode letter. Possibly this also causes a bug in \startformula, as discussed before.


\setupbodyfont[xits,10pt]

\setupmathematics[lcgreek=normal, default=normal]

\def\usemathcommand#1’{\csname #1\endcsname}

\appendtoks
  \catcode`‘=\activecatcode
  \letcharcode `‘ \usemathcommand
\to \everymathematics

\definemathcommand[𝐝𝐢𝐦][nolop]{\mfunction{𝐝𝐢𝐦}}

\starttext

Note that $ ‘𝐝𝐢𝐦’ 𝑉 = 𝖫$, although $\dim 𝑉 = 4$.

And a bug: $‘𝐝𝐢𝐦’ 𝑉$.

\stoptext




More information about the ntg-context mailing list