2

I'd like to see all the characters from Latin Modern Math. Running xelatex on the following gives error "Running mktexmf Latin...I can't find file 'Latin'".

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{fonttable}

\begin{document}
\fonttable{Latin Modern Math}
\end{document}

Using lm-math instead of Latin Modern Math gives the same kind of error.

How can it be done?

murray
  • 7,944

2 Answers2

4

Compile with XeLaTeX:

\documentclass{article}
\usepackage[
  a4paper,
  left=1.5cm,
  right=1.5cm,
  top=2cm,
  bottom=2cm,
  heightrounded,
]{geometry}
\usepackage{fontspec}
\usepackage{multicol}

\ExplSyntaxOn

\NewDocumentCommand{\Ufonttable}{mO{}}
 {
  \begin{multicols}{8}[\section*{#1}]
  \setlength{\parindent}{0pt}
  \newfontface\test{#1}[#2]
  \test
  \int_step_inline:nnn { \xetex_firstfontchar:D \font } { \xetex_lastfontchar:D \font }
  {
   \iffontchar\font##1\scan_stop:
    \makebox[32pt][l]{ \scriptsize \ttfamily U+\ufonttable_number:n { ##1 } }
    \symbol{##1}\par
   \fi
  }
  \end{multicols}
 }

\cs_new:Nn \ufonttable_number:n
 {
  \prg_replicate:nn { \int_max:nn { 0 } { 4 - \tl_count:e { \int_to_Hex:n { #1 } } } } { 0 }
  \int_to_Hex:n { #1 }
 }
\cs_generate_variant:Nn \tl_count:n { e }

\ExplSyntaxOff

\begin{document}

\Ufonttable{Latin Modern Roman}

\end{document}

enter image description here

egreg
  • 1,121,712
3

Enclose the font name in double-quotes:

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{fonttable}

\begin{document}
\fonttable{"Latin Modern Math"}
\end{document}
  • OK, but it seems the table is not showing all available symbols, such as are listed in http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/unicode-math/unimath-symbols.pdf. (I'm asking about specifics in a separate post.) – murray Aug 29 '19 at 15:40
  • This shows only 256 chars. – Ulrike Fischer Aug 29 '19 at 15:50