Fonts & Character SetsUnicode in Math Mode

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
yuri-v
Posts: 2
Joined: Wed Feb 08, 2012 10:52 pm

Unicode in Math Mode

Post by yuri-v »

Is there any way to use non-latin unicode characters in math mode?

XeTeX allows specifying unicode fonts for both text and math modes, so it is possible to use any cyrillic unicode character in text mode directly and without any additional packages. But not in math mode, where you still have to use \text{} command. For example, the following code results in printing "A, , A" instead of "A, A, A":

Code: Select all

% UTF8
\documentclass{article}

\usepackage{amsmath}
\usepackage{xltxtra}
\usepackage{unicode-math}

\setmainfont{XITS}
\setmathfont{XITS Math}

\begin{document}
А, $А$, $\text{А}$  % <- Cyrillic capital letter A (U+0410)
\end{document}
Frequent using of \text{} is inconvenient and makes formulas less readable.

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

Post Reply