# Using prime symbol from non-mathematical font in math mode

Can I get the prime from Junicode (second and fourth line) to be used in math mode without having to use \text{′} every time? That is, can I get the first line in the code (with an ascii apostrophe for prime) to produce the output of the 2nd and 4th?

After including the glyph with setmathfont, the prime is too small and high.

\documentclass{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage[math-style=upright]{unicode-math}

\setmainfont{Junicode}
\setmathfont{Asana-Math.otf}
\setmathfont[
range={"0370-"03FF,   % greek
"0000-"003C,"003E-"007F},  % ascii range minus =
] {Junicode}

\begin{document}
$p'$\par
p′\par
$p′$\par
$p\text{′}$

\bigskip

\setmathfont[ range={"2032} ] {Junicode}

$p'$\par
p′\par
$p′$\par
$p\text{′}$
\end{document}

• Are willing to type ′ instead of '? – egreg Feb 27 '16 at 22:40
• @egreg, yes, it wouldn't be ideal, but if it produced the right output and there were no other way, then yes. – Toothrot Feb 27 '16 at 22:45

## 1 Answer

Not really portable, because it requires knowing that Junicode corresponds to mathgroup 4. However, p'' will not give a very pretty double prime.

\documentclass{article}
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage[math-style=upright]{unicode-math}

\setmainfont{Junicode}
\setmathfont{Asana-Math.otf}
\setmathfont[
range={"0370-"03FF,   % greek
"0000-"003C,"003E-"007F},  % ascii range minus =
] {Junicode}

\AtBeginDocument{%
\Umathcode'="0 "4 "2032
\Umathcode′="0 "4 "2032
}

\begin{document}

$p'$\par
p′\par
$p′$\par
$p\text{′}$

\end{document}