[Tex/LaTex] Import mathcal symbols from txfonts

fontsmath-mode

I would like to use the "\mathcal symbols" from txfonts, but otherwise use the standard symbols. Including the package txfonts changes all fonts, which I would like to avoid. The command

\DeclareSymbolFont{symbols}{OMS}{txsy}{m}{n}

uses all math symbols from txfonts, but I think that they are too thick (and the quantors look ugly), especially compared to the usual text font computer modern. Probably

\DeclareMathAlphabet{\mathcal}{T1}{TX}{m}{n}

should work, where TX has to be replaced by the correct family name of txfonts. Which is the correct one? I've already tried some names, but so far none has worked.

Best Answer

It's as easy as this:

\documentclass{article}

\DeclareMathAlphabet{\mathcal}{OMS}{ntxsy}{m}{n}   % or txsy
\SetMathAlphabet{\mathcal}{bold}{OMS}{ntxsy}{b}{n} % or txsy

\begin{document}
$x\mathcal{ABCDEF}y$

\boldmath$x\mathcal{ABCDEF}y$
\end{document}

enter image description here

Explanation. The TX/NewTX packages do no change to the basic math font setup, where \mathcal is defined by

\DeclareSymbolFontAlphabet{\mathcal}{symbols}

in order not to waste a math group. For your purpose a new math group is obviously necessary, so we just need to look in newtxmath.sty what's the definition of the symbols math symbol font and we find

178 \DeclareSymbolFont{symbols}{OMS}{ntxsy}{m}{n}
179 \SetSymbolFont{symbols}{bold}{OMS}{ntxsy}{b}{n}

(line numbers added for reference). So it's sufficient to change \DeclareSymbolFont{symbols} with \DeclareMathAlphabet{\mathcal} and \SetSymbolFont{symbols} with \SetMathAlphabet{\mathcal}.

It's better to use the fonts provided by NewTX that have refined metrics with respect to the older TX package and also is actively maintained, contrary to the old package.

Related Question