Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I decided to look if the solution Caramdir gave in this question would work as well for my attempts to use a new notation for hypergeometric functions. However, trying

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

resulted in the arguments before the semicolon being too widely spaced. I could of course just give up on the "staggered array notation" and align by columns what can be aligned by columns, or just use a two row, one column matrix and then use commas as delimiters, but I kind of like to see how to do a staggered array in LaTeX, and reserve matrix for the case of the number of parameters in both rows being equal.

So, how does one do a tighter looking (but still nicely spaced) staggered array?

share|improve this question
I am not sure a staggered array is a way to go here, what if you need to do something like {}_3 F_2\left(\begin{matrix}a-b+1& &b+a-1& &c+d-1\\&d-a+1& &e+d-b-1&\end{matrix}\middle;z\right), even if you make the the array tighter, there will still be a lot of space left. How about something like this: {}_3 F_2\left(\begin{matrix}a\quad b\quad c\\d\quad e\end{matrix}\middle;z\right)? –  Jan Hlavacek Aug 29 '10 at 4:34
That doesn't compile for me because ; isn't a math delimiter. –  TH. Aug 29 '10 at 5:08
I've seen it with both semicolons and bars delimiting the argument from the parameters. I guess any of the two would work for me. –  user914 Aug 29 '10 at 7:29
To get prepended subscripts, you may also consider using the tensor package, see tex.stackexchange.com/questions/334/non-kludgey-left-subscripts –  Willie Wong Aug 29 '10 at 15:08
Interesting question there, thanks Willie. –  user914 Aug 30 '10 at 0:50
add comment

4 Answers

up vote 5 down vote accepted
{}_3 F_2\left(\begin{matrix}a& &b& &c\\&d&

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


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?

        \def ,{\mskip\pFqskip\relax}%

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

share|improve this answer
wow, I guess I'll swing with your macro instead. Thanks a lot! I guess with a little tinkering I could get it to render the Meijer G function and other multivariate hypergeometrics as well! –  user914 Aug 29 '10 at 7:27
Hmm, wait... I see you use \Bigl and \Bigr here; I'm still confused when to use these instead of \left and \right. Mind explaining why? –  user914 Aug 29 '10 at 10:03
It was a mistake. It should be \biggl and \biggr. I'll edit my answer. But the reason was that I wanted it to behave the same way \binom does. I find that most of the time \left and \right produce brackets that are too large. Most of the time, \bigX, \BigX, \biggX, \BiggX suffice. –  TH. Aug 29 '10 at 10:18
A more efficient definition of \pFq appears here –  egreg Mar 7 '12 at 8:41
add comment

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


  \begingroup % only local assignments
  % make the comma math active
  % and define it to be \pFqcomma
  % typeset the formula


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

share|improve this answer
add comment

Mathematica gave me the folowing when I asked it to give the TeXForm of a generalized hypergeometric function


and it seems to work. Simple and general !

share|improve this answer
add comment

Although it doesn't use "matrix" notation you can adapt from one of the COOL package solutions. Check out page 30 of the COOL package manual. http://www.ctan.org/tex-archive/macros/latex/contrib/cool.


share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.