# \hookrightarrow with ebgaramond-math

I'm using the font EB Garamond for a document I'm typesetting, but it seems that \hookrightarrow only renders a normal arrow. Here's the code I'm using:

\documentclass{article}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond,newtxmath,ebgaramond-maths}
\begin{document}

Let $i: A \hookrightarrow B$ be an embedding.

\end{document}


It seems that the documentation does not mention that this symbol is not supported. So why doesn't it show up in the output file? Or if I misunderstood and it is indeed not supported, then how should I import a symbol from another font? I'm aware of this post but I'm still not quite sure how to proceed...

You can restore the newtx definition. But looking at the font tables, I would say you are in for a few more surprises with ebgaramond math

\documentclass{article}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond}
\usepackage{ebgaramond-maths}
\DeclareSymbolFont{ntxletters}{OML}{ntxmi}{m}{it}
\DeclareMathSymbol{\lhook}{\mathrel}{ntxletters}{"2C}
\usepackage{fonttable}
\begin{document}
Let $i: A \hookrightarrow B$ be an embedding.

\newpage
\xfonttable{OML}{EBGaramond-Maths}{m}{it}
\newpage

\xfonttable{OML}{ntxmi}{m}{it}

\end{document}


• I was trying to figure this (better) way out when you posted (+1). One question, why does the \xfonttable{OML}{ntxmi}{m}{it} (from which it seems you extracted \lhook) not show the hooked arrow in the fonttable? – Steven B. Segletes Apr 18 '19 at 12:18
• What do you mean by not showing up? The hook is at "2C" (44). – Ulrike Fischer Apr 18 '19 at 12:20
• When I run your MWE, the hook shows up properly on page 1, but on the page 3 fonttable, I get a thing that looks like a \circ, truncated to look like a "c" in slot 44. – Steven B. Segletes Apr 18 '19 at 12:22
• \lhook is not \hookrightarrow, and \hookrightarrow is not a single glyph, but a hook with an rightarrow. try \lhook \rightarrow to see it. – Ulrike Fischer Apr 18 '19 at 12:25
• Son of a gun! I could have been looking all day! Thank you for that retrospectively obvious clarification. – Steven B. Segletes Apr 18 '19 at 12:26

Fixed...with a sledgehammer!

Before loading ebgaramond-maths, I save all mathstyles of \hookrightarrow in their own \savebox. Then, after loading ebgaramond-maths, I redefine \hookrightarrow to use a \mathchoice to decide which of the boxes to employ with a surrounding \mathrel.

\documentclass{article}
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond}
\usepackage{newtxmath}
\newsavebox\svhookrightarrow
\newsavebox\svscripthookrightarrow
\newsavebox\svscriptscripthookrightarrow
\savebox\svhookrightarrow{$\hookrightarrow$}
\savebox\svscripthookrightarrow{$\scriptstyle\hookrightarrow$}
\savebox\svscriptscripthookrightarrow{$\scriptscriptstyle\hookrightarrow$}
\usepackage{ebgaramond-maths}
\renewcommand\hookrightarrow{\mathchoice
{\mathrel{\usebox{\svhookrightarrow}}}
{\mathrel{\usebox{\svhookrightarrow}}}
{\mathrel{\usebox{\svscripthookrightarrow}}}
{\mathrel{\usebox{\svscriptscripthookrightarrow}}}
}

\begin{document}

Let $i: A \hookrightarrow B$ be an embedding.

$\scriptstyle i: A \hookrightarrow B$

$\scriptscriptstyle i: A \hookrightarrow B$

\end{document}