Using LaTeX to render hypergeometric function notation

\setlength\arraycolsep{1pt}
{}_3 F_2\left(\begin{matrix}a& &b& &c\\&d&
&e&\end{matrix};z\right)

That tightens up the spacing quite a bit. I made a hypergeometric macro previously, but it doesn't support the ;z, unfortunately.

\newcommand*\pFq[2]{{}_{#1}F_{#2}\genfrac[]{0pt}{}}

Then you use \pFq{3}{2}{a,b,c}{d,e}. (Or replace the commas with any other sort of spacing you want.) I was fairly happy with that.

Edit: Actually, how about something like this?

\newcommand*\pFqskip{8mu}
\catcode`,\active
\newcommand*\pFq{\begingroup
        \catcode`\,\active
        \def ,{\mskip\pFqskip\relax}%
        \dopFq
}
\catcode`\,12
\def\dopFq#1#2#3#4#5{%
        {}_{#1}F_{#2}\biggl[\genfrac..{0pt}{}{#3}{#4};#5\biggr]%
        \endgroup
}

Change \pFqskip to whatever spacing you want between the elements. You use it like

\pFq{3}{2}{a,b,c}{d,e}{z}

A modification of TH's answer that allows \pFq to be in the argument of other commands.

\documentclass{article}
\usepackage{amsmath}
\newmuskip\pFqmuskip

\newcommand*\pFq[6][8]{%
  \begingroup % only local assignments
  \pFqmuskip=#1mu\relax
  % make the comma math active
  \mathcode`\,=\string"8000
  % and define it to be \pFqcomma
  \begingroup\lccode`\~=`\,
  \lowercase{\endgroup\let~}\pFqcomma
  % typeset the formula
  {}_{#2}F_{#3}{\left[\genfrac..{0pt}{}{#4}{#5};#6\right]}%
  \endgroup
}
\newcommand{\pFqcomma}{\mskip\pFqmuskip}

\begin{document}
\[
\pFq{3}{2}{a,b,c}{d,e}{z}
\qquad
\pFq[4]{3}{2}{a,b,c}{d,e}{z}
\qquad
\textstyle\pFq{3}{2}{a,b,c}{d,e}{z}
\]
\end{document}

The trick is using math activation, rather than activation tout court. There's also an optional argument for changing the default spacing between the coefficients.

enter image description here

A modification for keeping the comma:

\documentclass{article}
\usepackage{amsmath}
\newmuskip\pFqmuskip

\newcommand*\pFq[6][8]{%
  \begingroup % only local assignments
  \pFqmuskip=#1mu\relax
  \mathchardef\normalcomma=\mathcode`,
  % make the comma math active
  \mathcode`\,=\string"8000
  % and define it to be \pFqcomma
  \begingroup\lccode`\~=`\,
  \lowercase{\endgroup\let~}\pFqcomma
  % typeset the formula
  {}_{#2}F_{#3}{\left[\genfrac..{0pt}{}{#4}{#5};#6\right]}%
  \endgroup
}
\newcommand{\pFqcomma}{{\normalcomma}\mskip\pFqmuskip}

\begin{document}
\[
\pFq{3}{2}{a,b,c}{d,e}{z}
\qquad
\pFq[4]{3}{2}{a,b,c}{d,e}{z}
\qquad
\textstyle\pFq{3}{2}{a,b,c}{d,e}{z}
\]
\end{document}

enter image description here

Tags:

Math Mode