Trouble with fontspec/unicode-math and bold upright dotless i
\symbfup
(and the other \sym..
commands) maps its argument to the Mathematical Alphanumeric Symbols
unicode block http://unicode.org/charts/PDF/U1D400.pdf. It will only work for symbols which have a target there. You can't use it for arbitrary input.
If you want to use a bold unicode character which is not in the mathematical unicode block you will have to resort to a text font. The various \mathXX
fonts can be used for this:
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman} %to force \mathtextbf to use EU-encoding
\begin{document}
%\mathbf is possible too, but \mathtextbf is ihmo clearer
Unit vector $\mathtextbf{\symup{ı}}$; compare $\textbf{ı}$.
\end{document}
There is no Unicode specification for a mathematical bold dotless i, so unicode-math
cannot provide an automatic substitution: there is nothing to point at. The character seems to have its uses (with a hat or arrow for denoting a vector/versor), but until Unicode doesn't add it and fonts are updated, \symbfup
cannot reach it.
So, for now, \textbf{\i}
seems the only solution, albeit ugly.
Here's a search for “mathematical dotless” in Unicode points (courtesy of UnicodeChecker)
Contrast it with a search for “mathematical small i”
Neither the Latin Modern Math
nor the XITS Math
math fonts feature a bold version of \imath
("dotless i").
It looks like ı
("text-mode dotless i") is correctly mapped into \imath
if it is encountered in math mode. And, as there is no bold version of \imath
, ı
and \symbfup{ı}
both produce the same non-bold output.
\documentclass{article}
\usepackage{amsmath} % for "\boldsymbol" macro
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
%or: \setmainfont{XITS}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
%or: \setmathfont{XITS Math}
\begin{document}
\Huge
$\imath$, $ı$,
$\boldsymbol{\imath}$, $\boldsymbol{ı}$,
$\symbfup{\imath}$, $\symbfup{ı}$.
\textbf{\i} \textbf{ı} % two forms of text-mode "dotless i"
\end{document}
If you load the unicode-math
package with the options math-style=upright
and bold-style=upright
, you'll get the following results instead:
The characters are now upright (unsurprisingly), but the math-mode characters still are not in bold.
\documentclass{article}
\usepackage{amsmath} % for "\boldsymbol" macro
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
%or: \setmainfont{XITS}
\usepackage[math-style=upright,bold-style=upright]{unicode-math}
\setmathfont{Latin Modern Math}
%or: \setmathfont{XITS Math}
\begin{document}
\Huge
$\imath$, $ı$,
$\boldsymbol{\imath}$, $\boldsymbol{ı}$,
$\symbfup{\imath}$, $\symbfup{ı}$.
\textbf{\i} \textbf{ı} % two forms of text-mode "dotless i"
\end{document}