5

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:

Output1

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:

Output2

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?

11
  • Did you try \boldsymbol? Commented Jan 29, 2018 at 17:10
  • @marmot Yes. That too does not work. Commented Jan 29, 2018 at 17:12
  • tex.stackexchange.com/a/329895/29127 Commented Jan 29, 2018 at 17:19
  • @Taiki Isn't there any way to get/import the pdfLaTeX symbol here? Commented Jan 29, 2018 at 17:23
  • 1
    @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. Commented Jan 29, 2018 at 21:05

2 Answers 2

1

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}

Unit vectors i and j

(Adjust the hat position as appropriate.)

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

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}

enter image description here

1
  • Is there any way to change the position of hat on j? Commented Jan 31, 2018 at 7:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.