# How I can get bold, italic and dotless i and j in XeLaTeX?

In pdfLaTeX, I can get them by \bm{\hat{\imath}} and \bm{\hat{\jmath}}.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{bm}
\usepackage{amsmath}

\begin{document}

$\bm{\hat{\imath}} \quad \bm{\hat{\jmath}}$

$\hat{\bm{\imath}} \quad \hat{\bm{\jmath}}$

\end{document}


This produces the following output:

How can I get the above results in XeLaTeX? I tried this but this doesn't work.

\documentclass{article}

\usepackage{bm}
\usepackage{amsmath}
\usepackage{unicode-math}
\setmathfont[math-style=ISO, bold-style=ISO]{latinmodern-math.otf}

\begin{document}

$\symbf{\hat{\imath}} \quad \symbf{\hat{\jmath}}$

$\hat{\symbf{\imath}} \quad \hat{\symbf{\jmath}}$

\end{document}


This produces the following output:

Using \bm in XeLaTeX is producing compile error. How can I get the first output? I also desire the carets or caps as in the first output.

EDIT:

This(in comments by Taiki) says that there are no bold, italic dotless i and j in Unicode. Isn't there any way to import the pdfLaTeX symbol in XeLaTeX?

• Did you try \boldsymbol? – user121799 Jan 29 '18 at 17:10
• @marmot Yes. That too does not work. – Apoorv Potnis Jan 29 '18 at 17:12
• tex.stackexchange.com/a/329895/29127 – Taiki Jan 29 '18 at 17:19
• @Taiki Isn't there any way to get/import the pdfLaTeX symbol here? – Apoorv Potnis Jan 29 '18 at 17:23
• @barbarabeeton Versors that ISO norms prescribe to be in bold italic, like all vectors. Some like to denote versors with a hat. There should be dotless i and j for every math alphabet, in my opinion. – egreg Jan 29 '18 at 21:05

You can borrow the symbols from a text font that has them, e.g. Latin Modern Roman:

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\newcommand{\ii}{\hat{\textbf{\itshape\i}}}
\newcommand{\jj}{\hat{\textbf{\itshape\j}}}
\begin{document}

Unit vectors $\ii$ and $\jj$

\end{document}


(Adjust the hat position as appropriate.)

• Can you suggest how to adjust the position of hat? I searched on TeX.SX but could not find how to do it. – Apoorv Potnis Jan 31 '18 at 7:59
• @ApoorvPotnis For example, \newcommand{\ii}{\skew{3}\hat{\textbf{\itshape\i}}} – Taiki Jan 31 '18 at 8:21

You can use the legacy glyphs.

\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{unicode-math}
\setmathfont[math-style=ISO, bold-style=ISO]{Latin Modern Math}

\DeclareSymbolFont{legacyletters}{OML}{cmm}{m}{it}
\SetSymbolFont{legacyletters}{bold}{OML}{cmm}{b}{it}

\AtBeginDocument{%
\let\imath\relax\let\jmath\relax
\DeclareMathSymbol{\imath}{\mathord}{legacyletters}{"7B}%
\DeclareMathSymbol{\jmath}{\mathord}{legacyletters}{"7C}%
}
\newcommand{\imathb}{\bm{\imath}}
\newcommand{\jmathb}{\bm{\jmath}}

\begin{document}

$\imath\jmath$

$\hat{\imathb}+\hat{\jmathb}$

\end{document}


• Is there any way to change the position of hat on j? – Apoorv Potnis Jan 31 '18 at 7:52