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?


6 Answers 6


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:

% Setup the matha font (from mathabx.sty)
      <5> <6> <7> <8> <9> <10> gen * matha
      <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12

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


Computer Modern subset
A \subset B

\texttt{mathabx} subset

A \varsubset B


This code is copied from the mathabx package.


  • 1
    This is exactly what I'm looking for; I can infer the general way from here, since there is a pretty good guide: latex-project.org/guides/fntguide.pdf. Just a couple of questions: where can I find the "loading-settings" for mathabx, i.e., where did you get \hyphenchar\font45 (in the \DeclareFontFamily command) from? How about the loading-settings used in the \DeclareFontShape command? Thanks a lot. Commented Mar 28, 2011 at 1:45
  • 2
    I mention this in the commented code: the first part is from mathabx.sty and the second from mathabx.dcl. These files are located in TeXLive in /usr/local/texlive/2010/texmf-dist/tex/generic/mathabx/. (I assume somewhere similar in MikTeX.)
    – Alan Munn
    Commented Mar 28, 2011 at 2:00
  • 1
    For the record, the command-line tool kpsewhich helps to locate TeX-related files once you know their name: run kpsewhich mathabx.sty. Commented Aug 12, 2016 at 18:36
  • 1
    @AlanMunn how did you find "80? I want to import the \mathabx symbols for \lefttorightarrow and \righttoleftarrow. Thanks!
    – Arrow
    Commented Oct 31, 2016 at 18:39
  • 1
    @Arrow All the declarations are found in the file mathabx.dcl (which is \input by mathabx.sty).
    – Alan Munn
    Commented Oct 31, 2016 at 18:43

There's another way to cope with a single symbol without wasting a precious math alphabet resource (there are only 16 of them).


After these one can choose a particular symbol and give it a sensible name, for example


The optional argument gives the type of the symbol, in this case a binary operation symbol; the first mandatory argument is the name of the font family and the second one the number of the symbol's slot in the font.

Unfortunately, mathabx doesn't provide .fd files, so one has also to declare the family as explained in Alan's answer, but, since now the mathabx are also in Type1 format, one may scale them:

  <-6> matha5 <6-7> matha6 <7-8> matha7
  <8-9> matha8 <9-10> matha9
  <10-12> matha10 <12-> matha12

Any symbol in any font may be used in math and it will scale properly in subscripts and superscripts.

  • How about accents? Could this be adapted to use the wide bar accent from mathx without "wasting" a math alphabet as in this answer: tex.stackexchange.com/questions/16337/…
    – kahen
    Commented May 3, 2012 at 8:58
  • 1
    @kahen I'm afraid it's not possible, as the growing accents are used only in math fonts.
    – egreg
    Commented May 3, 2012 at 9:02
  • I'm a bit confused by this. Mostly, I'm not clear why you can't load mathabx.sty rather than declaring the family yourself. Not that doing so is bad. Just I take it from your answer that you are saying that doing so is required. (Is this just to avoid using up a maths family or is there some other reason?) Second, just to clarify that 'Any symbol in any font...' means roughly in any raw font. You couldn't use a symbol from a virtual font directly (or use a symbol from a truetype font at all). [99 to 1 I've misunderstood.]
    – cfr
    Commented Apr 22, 2014 at 23:03
  • 1
    @cfr Loading mathabx changes all symbols and in several cases the change is not really good.
    – egreg
    Commented Apr 22, 2014 at 23:11

With unicode-math

Unicode math fonts support a wide range of symbols. Among these are a lot of symbols which were only available using supplemental package when not using Unicode fonts.

The unicode-math package enables you to load these Unicode math fonts. Some are available in TeXlive, such as Latin Modern Math, a Unicode port of the popular lmodern package.

A list of symbols, defined by some of these fonts can be found in the document Every symbol (most symbols) defined by unicode-math by the developer of unicode-math and TeX.SX user Will Robertson.

Let's take for example, the \llangle and \rrangle symbols. These are not available in Latin Modern Math but they are in XITS Math. To import these when using Latin Modern Math as the main math font, one has to use the range option. The range option accepts Unicode slots or alternatively, for easier understanding, the mnemonic names of the symbols. Be sure to load the custom range after setting the main math font. Otherwise your hand-crafted set of symbols will be overwritten.

\setmathfont{Latin Modern Math}
\setmathfont[range={\llangle,\rrangle}]{XITS Math}
$\llangle a \rrangle$

enter image description here

  • 1
    I wonder why this symbol was given that name, since the rough semantics of the xxdelimiter symbols is to double them in some way.
    – Alan Munn
    Commented Aug 10, 2016 at 15:29
  • @AlanMunn, it seems to fit in with the other STIX xxdelimiter names, which seem to mean "delimiter with an extra stroke" rather than "doubled delimiter". I guess this comes from viewing, for example, llbracket as a bracket with an extra stroke, rather than superposed and slightly offset (pmb-style) brackets.
    – LSpice
    Commented Feb 13, 2020 at 4:04

This is an answer to Making asterisk look like a Kleene star which was closed as a duplicate before I could submit an answer.

The problem is that the MnSymbol package not only replaces macros like \ast, it also clobbers the corresponding \mathchar. You can, however, get \ast from the mathabx package.

\usepackage{amsmath}% needed before mathabx
\usepackage{mathabx}% needed to prevent \ast getting clobbered
$\ast$ and $\mnast$ and $\amsast$


You have to admit the above code is a lot less intimidating than the other solutions.


ConTeXt MkIV

In ConTeXt you use the \definefontfallback to load symbols from a different font. You can either give Unicode slots or whole character ranges, like lowercasescript. Mnemonic character names are not possible, unfortunately.

In the example we load the moustache brackets from XITS Math because they are not available in Latin Modern Math, which is the default math font.

\definefontfallback [xits-fallback] [file:xits-math.otf] [023B0,023B1]

\definefontsynonym [MathRoman] [modern] [fallbacks=xits-fallback]


$\lmoustache a \rmoustache$


enter image description here


A rewriting of the existing answers, plus some small modifications to demonstrate a way to not use up a symbol font using \text instead of \mathchoice (and a few other things).

For example with the \subset symbol here:

output image

Another example, \rightlsquigarrow (example taken from https://tex.stackexchange.com/a/36088/250119):

output image

You can also run the above with your own math package/symbol.

I made a solution that works "mostly" automatically -- given a symbol and math font package, it determines the commands needed to define the symbol standalone.


In order to run it with your own symbol you would need to

  • fork the Overleaf project
  • edit the preamble to load the appropriate math font package
  • modify the symbol to be searched
  • recompile the PDF.

Be careful while copy-pasting code from output PDF.

For now, it may not work with everything e.g. delimiter/radical etc. will not work. Unicode math font will also not work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .