[Tex/LaTex] Importing a Single Symbol From a Different Font

fontssymbols

Is there a general way to change the font of a particular symbol without switching packages?

For example, suppose I'm using Computer Modern for my entire document, but I want the "subset" operator to look as it does in mathabx. How can I redefine it to appear in this way?

Best Answer

There's sort of a general way, but it involves knowing your way around the various bits of the other font packages. You can then take just the bits you need. So for your particular example, you could do the following:

\documentclass{article}
% Setup the matha font (from mathabx.sty)
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * matha
      <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12
      }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}

% Define a subset character from that font (from mathabx.dcl)
% to completely replace the \subset character, you can replace
% \varsubset with \subset

\DeclareMathSymbol{\varsubset}{3}{matha}{"80}
\begin{document}

Computer Modern subset
\[
A \subset B
\]

\texttt{mathabx} subset

\[
A \varsubset B
\]

\end{document}

This code is copied from the mathabx package.

sample

Related Question