173

How can I get the 'real number' sign (something like \mathbb{R} with the amssymb package in LaTeX) in XeTeX?

Jonas Stein
  • 8,909
lvaneesbeeck
  • 3,095

5 Answers5

203

How about this?

\documentclass{article}
\usepackage{amssymb}
\begin{document}
\begin{tabular}{ll}
Plain-\TeX{}:   & ${\rm I\!R}$\\
amssymb:        & $\mathbb{R}$
\end{tabular}
\end{document}

enter image description here

Moriambar
  • 11,466
jub0bs
  • 58,916
15

You should put your symbol format definitions in another TeX file; publications tend to have their own styles, and some may use bold Roman for fields like R instead of blackboard bold. You can swap nams.tex with aom.tex. I know, this is more common with LaTeX, but the principle still applies.

For example:

% paper.tex
\input nams.tex
$\realnumbers$ is connected.

% nams.tex
\def\realnumbers{\mathbb{R}}
% more definitions for the Notices.

% aom.tex
\def\realnumbers{\mathbf{R}}
% more definitions for the Annals.

Just change one line in paper.tex to submit to the Annals instead of the Notices.

12

With lualatex

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\begin{document}
$ℝ$
\end{document}

real symbol

PatrickT
  • 2,923
alfC
  • 14,350
10

Auto-answer:

\input amssym.tex
${\Bbb R}$
\bye

works fine

Henri Menke
  • 109,596
lvaneesbeeck
  • 3,095
8

There's a couple of ways to go about this:

  1. Using the default Computer Modern -font (which, as you've already found out, can be extended with the amssym to have access to BlackBoardBold.)
  2. Using Unicode OpenType math fonts. Now this is a bit tricky because the glyph locations need to be (re-)told to TeX. This step can further be split into two different approaches:
    1. Use just one family and change the active range by re-telling TeX the glyph positions every time the style changes (i.e. script, fraktur, etc. This is the way I've understood the unicode-math -package does it). For plain-xetex, you could do something along these lines.
    2. Fix the styles to their own \families using mapping-files created with teckit_compile from SIL. See: Changing math font to OTF in XeTeX using plaintex-format.
morbusg
  • 25,490
  • 4
  • 81
  • 162