Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am happy with the great majority of what unicode-math does. But at times I find that I prefer a symbol the way it was before. With \varnothing and \complement, for example. In those cases I was able to save them under a different name before loading unicode-math, but this doesn't always work.

Right now I'm trying to access the \mathcal alphabet from plain LaTeX. How might I accomplish this?


Additional Question

I've been looking through unicode-math, trying to figure out where exactly the original \mathcal alphabet gets discarded, but I eventually gave up.

It would be interesting if someone could explain:

  • how/where the original \mathcal font is defined anyway, and
  • what kind of 'switch' is thrown by unicode-math that makes it unavailable.
share|improve this question
1  
You can't, unless you are using CM Math (then it will be default) See also this question: tex.stackexchange.com/questions/120065/… –  Henri Menke Aug 7 '13 at 21:33
    
@HenriMenke Hm... But the comments there imply that you cannot use Computer Modern at all if you use unicode-math. So what do you mean by "unless"? --- Anyway, the notion that there's no way to do it is so silly I reject it. Even if I cannot just load it as a font, I could patch unicode-math to leave \mathcal alone or, as a last resort, I could typeset the alphabet in a box before loading unicode-math and then use the box. --- But I have to believe there are more elegant solutions than that. –  mhelvens Aug 7 '13 at 21:46
    
Let me cite the following comment from the linked question: »You can't use Computer Modern with unicode-math, the last example you get it from Latin Modern Math which is the closest you can get. – Khaled Hosny« Please note, that Khaled Hosny is one of the original developers of unicode-math. Saving the alphabet to a box might indeed be possible, but will for sure bring several downsides. –  Henri Menke Aug 8 '13 at 10:35
    
I read those comments. And I have no doubt Khaled is right in that there is no standard option through the unicode-math interface by which the original font can be retrieved (perhaps there should be). But I would even be happy with a patch or 'hack' – one which is more elegant than using boxes. --- Indeed, storing those characters in boxes has downsides. I mention some in my answer below. --- Anyway, thanks for your help! –  mhelvens Aug 8 '13 at 12:45
    
@mhelvens The problem is that the entire math font mechanism is altered to deal with Unicode math fonts. For 'traditional' TeX, you simply change the family (\mathcal boils down to \fam2, at least 'out of the box'). That simply doesn't work once you switch to the Unicode mechanism, which doesn't use families at all. –  Joseph Wright Aug 8 '13 at 12:56

1 Answer 1

up vote 2 down vote accepted

I'll just share the solution I'm using at the moment. It's far from ideal, but it's fine if you only need a few letters of the calligraphic alphabet. For example, I need only D, F, I and P throughout my document:

\documentclass{article}

\makeatletter
\newcommand\preserveCal[2]{
    \expandafter\newsavebox\csname box@\string#1\endcsname
    \expandafter\savebox\csname box@\string#1\endcsname{\ensuremath{\mathcal{#2}}}
    \expandafter\def\expandafter#1\expandafter
        {\expandafter\usebox\csname box@\string#1\endcsname}
}
\preserveCal{\calD}{D}
\preserveCal{\calF}{F}
\preserveCal{\calI}{I}
\preserveCal{\calP}{P}
\makeatother

\usepackage{unicode-math}

\begin{document}
    \noindent$\mathcal{DFIP}$\par
    \noindent$\calD\calF\calI\calP$
\end{document}

enter image description here

This is a generally applicable 'last resort' way to preserve symbols that are destroyed by a package. The problem is that these don't scale with the font. Also, each symbol takes up a whole box register, and I believe there are only 256 box registers available.

share|improve this answer
    
I generally don't like to accept my own answers on SE, especially not this one. But since it is the only answer I've found that actually works, I will. If someone else shares a more elegant answer in the future, I'll happily surrender the green tick. –  mhelvens Aug 11 '13 at 13:09

Your Answer

 
discard

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.