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

Using Unicode characters in \newcommand is limited to one character. #585

Closed quantenzitrone closed 2 years ago

quantenzitrone commented 2 years ago

Description

Using Unicode characters in \newcommand is limited to one character.

Add info or delete as appropriate:

Minimal example demonstrating the issue

\newcommand{\Σ}{\sum}
\newcommand{\Π}{\prod}
\newcommand{\∫}{\int} % i know ∫ is already \int

works, but

\newcommand{\∫∫}{\iint}
\newcommand{\∫∫∫}{\iiint}
\newcommand{\o∫}{\oint}
\newcommand{\∫o}{\oint}

doesn't work.

davidcarlisle commented 2 years ago

that is just standard tex syntax: you can have multiple characters of catcode 11 (letter) or a single characer. You can define \= but not \== It is not related to Unicode.

quantenzitrone commented 2 years ago

Oh, ok thanks.

quantenzitrone commented 2 years ago

This works:

\catcode`∫=11
\newcommand{\∫}{\int}
\newcommand{\∫∫}{\iint}
\newcommand{\∫∫∫}{\iiint}
\newcommand{\o∫}{\oint}

\begin{document}
    \catcode`∫=11
    $$ \∫_{i=1}^{5} x^2 $$
    $$ \o∫_{i=1}^{5} x^2 $$
    $$ \∫∫_{i=1}^{5} x^2 $$
    $$ \∫∫∫_{i=1}^{5} x^2 $$
\end{document}

thanks again!

ArchangeGabriel commented 2 years ago

Another option is to use a keyboard that has these symbols: ∑∫∮∬ for instance are available in the BÉPO keyboard on the “scientific deadkey” + all 4 standard combinations with the “s” key. ;)