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.

  • 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

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$.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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