Text Formattingunicode-math, glyphs disappear

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

unicode-math, glyphs disappear

Post by Laurentius »

After loading a font with unicode-math's \setmathfont, I can't access all glyphs in math mode. Why not?

Code: Select all

\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{Cambria Math}
\setmainfont{Cambria Math}
\usepackage{multicol}
\setlength{\columnseprule}{0.4pt}
\usepackage{multido}
\setlength{\parindent}{0pt}
\begin{document}

\begin{multicols}{6}
\multido{\i=0+1}{"03FF}{
  \iffontchar\font\i
    \makebox[3em][l]{\i}%
%    $\symbol{\i}$\endgraf		% shows fewer glyphs
    \symbol{\i}\endgraf			% shows more glyphs
  \fi
}
\end{multicols}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: unicode-math, glyphs disappear

Post by Johannes_B »

As you can see, the latin letters are italiziced in math mode. It would be very unusual to have the letter à in a variable, hence letters like that (and more that are not to be seen in an equation) are missing in math mode.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Re: unicode-math, glyphs disappear

Post by Laurentius »

Is there no way to get them back?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: unicode-math, glyphs disappear

Post by Johannes_B »

Do you need them in mathmode, or in text within an equation?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Laurentius
Posts: 132
Joined: Wed Feb 11, 2009 11:38 pm

Re: unicode-math, glyphs disappear

Post by Laurentius »

The thing is I want a prettier prime. The one returned by ' or ^\prime is a bit big, so I thought I might replace it with the Greek numeral mark ʹ, but this is not accessible in math mode.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

unicode-math, glyphs disappear

Post by Johannes_B »

To be honest, i don't think this is a good idea. Better ask the font maintainers for a suggestion. They thought about the symbol and implemented it that way.

Code: Select all

\documentclass[border=5pt]{standalone}
\usepackage{fontspec}
\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{Cambria Math}
\setmainfont{Cambria Math}
\begin{document}
$A' A^\prime A\text{ʹ}$
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply