The following is taken from amsmath
and uses \genfrac
- a generic fraction function:
\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\DeclareRobustCommand{\stirling}{\genfrac\{\}{0pt}{}}
\begin{document}
% Source: http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind
In mathematics, particularly in combinatorics, a Stirling number of the second kind
is the number of ways to partition a set of $n$~objects into $k$~non-empty subsets and
is denoted by~$S(n,k)$ or~$\stirling{a}{b}$. Stirling numbers of the second kind occur
in the field of mathematics called combinatorics and the study of partitions.
\end{document}
How does this work? \genfrac
takes five arguments to create a structure (from the amsmath
documentation; section 4.11.3 The \genfrac
command, p 14):
The last two correspond to \frac
’s numerator and denominator; the
first two are optional delimiters [...]; the third is a line thickness
override [0 implies an invisible rule]; and the fourth argument is a
mathstyle override: integer values 0-3 select respectively
\displaystyle
, \textstyle
, \scriptstyle
, and
\scriptscriptstyle
. If the third argument is left empty, the line
thickness defaults to ‘normal’.
So \genfrac\{\}{0pt}{}
creates a fraction with an invisible horizontal rule (third argument is 0pt
), left and right delimiter given by \{
and \}
, respectively and no specific math style (an empty {}
fourth argument). \stirling
doesn't include a fifth and sixth argument for \genfrac
(numerator and denominator), because this is implicitly supplied by the user as the two "arguments" to \stirling
.
In a similar manner (perhaps for reference), amsmath
defines
\newcommand{\frac}[2]{\genfrac{}{}{}{}{#1}{#2}}
\newcommand{\tfrac}[2]{\genfrac{}{}{}{1}{#1}{#2}}
\newcommand{\binom}[2]{\genfrac{(}{)}{0pt}{}{#1}{#2}}
using \genfrac
.
Here are 3 more script fonts for which there exists a LaTeX package (in math mode): Dutchcal
(from the esstix 13 font), Boondox (from the stix fonts) (two variants) and Adobe's Bickham. All exist in regular and boldface. The following code allows to test them, commenting and uncommenting the relevant lines:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{dutchcal}
%\usepackage{boondox-cal}
%\usepackage{boondox-calo}
%\usepackage{bickham}
\pagestyle{empty}
\begin{document}%
\textbf{Dutchcal: }
%\textbf{boondox-cal}
%\textbf{boondox-calo}
%\textbf{bickham}
$ \begin{array}[t]{c@{\quad}c}
\verb+ \mathcal + & \verb+ \mathbcal + \\[6pt]
\mathcal{E} & \mathbcal{E}
\end{array} $
\end{document}
Best Answer
The following will work nicely: