5

I was playing with this answer by Steven B. Segletes, and in it, it uses the character \mathchar"0362. How did (or, could) he find that 0362 is the right number to use?

I found this related answer which explains that (a) the 4 numbers are hexadecimal, and (b) are grouped into 3 groups, but I still don't know how to find the characters other than manually typing into my .tex file.

I know how to code so I could automate a .tex file using for loops, and then compile that, but I was wondering if there was another (better?) way.

2
  • The first hexadecimal digit tells TeX the kind of symbol (ordinary, operator, relation, binary relation, etc.); the second digit specifies the math font family; the last two digits specify the slot in the font. There can be no “list”, because the assignments of fonts to familes are not fixed and may depend on the document.
    – egreg
    Apr 8 '20 at 7:47
  • 1
    Are you by chance looking for the fonttable package that allows you to create tables of these characters?
    – user194703
    Apr 8 '20 at 8:50
6

As explained in https://tex.stackexchange.com/a/229705/, the four hexadecimal digits specify the mathematical type of the symbol, the math font family and the slot in the font.

There is no “list of mathchars”. The LaTeX kernel sets up font families 0, 1, 2 and 3, which are mandatory in order that math can be typeset. However, font packages can change the assignments, adding new families or symbols, or even changing slots.

For instance, the LaTeX kernel defines

\DeclareMathSymbol{\parallel}{\mathrel}{symbols}{"6B}

whereas fourier.sty defines

\DeclareMathSymbol{\parallel}{\mathrel}{symbols}{141}

In both cases, symbols refers to math family 2, and the result is that \parallel in the LaTeX kernel is essentially equivalent to \mathchar"326B, but with fourier it becomes \mathchar"328D.

The stmaryrd package provides additional symbols, for instance

\DeclareMathSymbol\shortleftarrow\mathrel{stmry}{"00}

and we can't even translate this directly into \mathchar syntax, because what font family number is assigned to stmry is not known in advance, depending on several different factors. This will be equivalent to

\mathchar"3<stmry>00

where <stmry> is some integer from 4 to 15 (translated into a hexadecimal digit).

1
  • @frougon Yes, you're right
    – egreg
    Apr 8 '20 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.