TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm experimenting with Unicode-Math. I am using Neo-Euler with Concrete so I am generating my document with xelatex. I want \Re to give me the AMS-style double-lined \mathbb{R} but I am having trouble redefining \Re in my .cls.

That is, using test.cls at the bottom of this question I run this sample document and it works great; I see the double-lined R in all three places.

% If \def here then it does not work. 
Hello.  $x=4\mathbb{R}$. Give me a $\Re$ and a $\R$.

However, if I move the \def to above the \begin{document} then I only see the double-lined R in two places and in the middle I get Knuth's \Re, the somewhat-fractur single-lined shape. In particular, putting my redefinition inside the .cls below has no effect. I expect there is some \AtBeginDocument at work, but I was unable to make it out. Is there some way to not have the \def inside the \begin{document}?

% test.cls

% --- Class structure: identification part
% ---
\ProvidesClass{ltest}[2012/09/10 version 0.01 Test unicode-math]

% --- Class structure: initial code part
% ---

% --- Class structure: declaration of options part
% ---
% This class extends the article class
% Read all the documentclass options; pass them to article
%    \PassOptionsToClass{\CurrentOption}{report}}

% --- Class structure: execution of options part
% ---
\ProcessOptions \relax

% --- Class structure: declaration of options part
% ---

% --- Class structure: main code part
% ---

% Set the fonts
\setmainfont[Ligatures=TeX,  % CM-Super Concrete
             Path = /usr/local/texlive/2012/texmf-dist/fonts/type1/public/cm-super/,
             ItalicFont = sfoti10.pfb,
             SmallCapsFont = sfocc10]{sform10.pfb}

\usepackage[math-style=upright]{unicode-math} % see http://tex.stackexchange.com/questions/50995/font-mixup-with-neo-euler-and-fontspec
% \AtBeginDocument{\DeclareMathAlphabet\mathbf{U}{eur}{b}{n}} % fontspec manual p. 11; doesn't seem to do anything.

share|improve this question
Not related to the issue, but normally I would not hard-code the font paths into a class file. – Joseph Wright Sep 10 '12 at 14:14
up vote 4 down vote accepted

unicode-math does many of its workings \AtBeginDocument.

Just put the redefinition of \Re in \AtBeginDocument after loading unicode-math (also in the class, if you so wish).



Hello.  $x=4\mathbb{R}$. Give me a $\Re$ and a $\R$.
share|improve this answer
Ah, nice. Thank you. – Jim Hefferon Sep 10 '12 at 14:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.