4

Could you please explain how to read the LaTeX font encoding charts? What is the meaning of the coordinates, and how can one use them while working with (La)TeX?

enter image description here

  • 1
    They show the slots in which each glyph resides, using octal and hexideximal notations. For example "n" is in slot (hex) "6E which is the same as (octal) '156. Octal notation shown on left and top for rows/columns, hex notation on right and bottom for rows/columns. – Steven B. Segletes Oct 17 at 10:28
  • 1
    For example \documentclass{article} \begin{document} \char'156 \char"6E \char110 \end{document} will produce 3 "n" glyphs, by calling on that slot 3 times, once in octal, once in hex, and once in decimal. – Steven B. Segletes Oct 17 at 10:39
  • @StevenB.Segletes How do you discriminate between 'n' and 'f' for \char"6E? – Nepumuk Oct 17 at 10:50
  • 2
    Note that you wouldn't usually use these when writing a LaTeX document. The exception would be if you needed to know which encoding provided a particular character. Even then, the best way to access that character probably isn't to find it in an encoding. These tables are sometimes useful when installing TeX fonts, though and producing them is one way to check whether you've grabbed everything available from a font. – cfr Oct 18 at 1:40
  • 1
    @StevenB.Segletes Thanks for the explanation. – Mad Hatter Oct 22 at 6:36
4

I am converting my comments into an answer, since the OP seemed appreciative of them.

In standard LaTeX encodings (not Unicode), there are 128 slots available in which to store glyph representations of letters and symbols.

The table show the slots in which each glyph resides, using octal and hexadecimal notations. For example n is in slot (hex) "6E which is the same as (octal) '156. Octal notation shown on left and top for rows/columns, hex notation on right and bottom (and top) for rows/columns.

The hex rows are double tall. The top row of "6x are "60 through "67...the bottom row is "68 through "6F. The hex notation uses both the top and the bottom, depending. Each hex digit can represent 16 values, 0-F.

For example

\documentclass{article} 
\begin{document} 
\char'156 \char"6E \char110 
\end{document} 

will produce 3 "n" glyphs, by calling on that slot 3 times, once in octal, once in hex, and once in decimal.

enter image description here

The table is, perhaps better represented by the output of the fonttable package, in which the decimal slot number is actually added inside the glyph box itself.

\documentclass{article}
\usepackage{fonttable}
\begin{document}
\fonttable{cmr10}
\end{document}

enter image description here

It is easier to see here, that n is slot 110 decimal, which is the same as '156 octal which is the same as "6E.

Slots are important because each font encoding assigns glyphs to slots. In order to know what slot a glyph resides in, one must also know the font encoding.

  • 1
    Everything's clear now. Thank you. – Mad Hatter Oct 23 at 6:45

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.