1

I was looking for more fonts like mathcal, mathbb to use them in math mode, so I can distinguish different quantities, and I found this answer on TeX.SE to the question

What are all the font styles I can use in math mode?

In the first answer there is a list of all usable fonts in math mode which can be found at the end of the mathalfa documentation and it's like

enter image description here

Now, I read the poor documentation on the mathalfa package, without understanding enough to get those fonts. My question is: how do I use those fonts in math mode? Which package do I need to use them? What are the commands with which I can choose between fonts?

Basically what I would like is something like (just to make an example)

Text [...] $\esstix{A} = \euler{A}$ 

What do I have to do? Even a more complete documentation with some examples would be good...

5

mathalfa allows you to map fonts to the four standard command \mathcal, \mathscr, \mathfrak, \mathbb:

\documentclass{report}
\usepackage[cal=esstix,frak=euler,scr=boondox,bb= pazo]{mathalfa}
\begin{document}
$\mathcal{Esstix ABC}=\mathfrak{Euler ABC}= \mathscr{Boondox ABC}=\mathbb{Pazo ABC}$
\end{document}

enter image description here

  • Is it possible to have more than one style with newcommand or something like that, in addiction to \mathcal, \mathscr, \mathfrak, \mathbb? – GiuTeX Aug 5 '17 at 13:46
  • Yes, with \DeclareMathAlphabet or with \newcommand. You only need to find out the needed nfss-declarations. Look in the code of mathalfa. – Ulrike Fischer Aug 5 '17 at 14:05
  • Could you provide an example for defining a single letter in a certain font, even with a new command? – GiuTeX Aug 5 '17 at 14:08
4

I'll post my own answer as I found a pretty simple way to achieve the resut I was looking for. With the command \DeclareMathAlphabet, which syntax is

\DeclareMathAlphabet{<math-alph>}{<encoding>}{<family>}{<series>}{<shape>}

you can define <math-alph> to be a new math alphabet.

The arguments <encoding>, <family>, <series>, <shape> are the default values for this math alphabet in all math versions; these can be reset later for a particular math version by a \SetMathAlphabet command. If is empty then the is declared to be invalid in all versions, unless it is set by a later \SetMathAlphabet command.

Checks that <math-alph> can be used and that <encoding> is a valid encoding scheme.

In these examples, \foo is defined everywhere but \baz, by default, is defined nowhere.

\DeclareMathAlphabet{\foo}{OT1}{cmtt}{m}{n}
\DeclareMathAlphabet{\baz}{OT1}{}{}{}

(from Index of /ctan-doc/macros/latex/doc/html/fntguide)

All the combination available with the mathalfa package are available in the source code of mathalfa.sty on GitHub. Another list, with all the font abbreviation can be found on the mathalfa documentation (at the end of the pdf).

I found particularly illuminating the answer to this question provided by the user cfr, which I thank for the illustration of the use of command \DeclareMathAlphabet.

I'll provide a simple example for future visitors:

%PREAMBLE
\DeclareMathAlphabet\mathzapf{T1}{pzc}{mb}{it}
\DeclareMathAlphabet{\mathchorus}{OT1}{cmtt}{m}{n}
\DeclareMathAlphabet\mathrsfso{U}{rsfso}{m}{n}
% ...

%DOCUMENT
\[
    \mathzapf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\]
\[
    \mathchorus{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\]
\[ 
    \mathrsfso{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
\]

which output is

enter image description here

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.