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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the moment I'm working on a paper, where I use Meijer's G function. The problem is that I don't like the way my G functions look. Let me first tell how I'm typesetting the function at present, and then what I don't like about it. At present I use



\newcommand{\MeijerG}[7]{G \begin{smallmatrix} #1 & #2 \\ #3 & #4 \end{smallmatrix} \left( \begin{smallmatrix} #5 \\ #6 \end{smallmatrix} \middle\vert #7 \right) }




There are several things I would like to change. First, I would like to have a functionality similar to that of commands defined using \DeclarePairedDelimiter from the package mathtools. The following example should illustrate what I mean





\average*{\sum_k \delta(x-x_k)}      \neq
\average[\Big]{\sum_k \delta(x-x_k)} \neq
\average{\sum_k \delta(x-x_k)}


The second problem is that I don't like the spacing around the m,n,p,q. This can to some extent be improved by using \!:

\newcommand{\MeijerG}[7]{G \begin{smallmatrix} #1\! & #2 \\ #3\! & #4 \end{smallmatrix}\!\! \left( \begin{smallmatrix} #5 \\ #6 \end{smallmatrix} \middle\vert #7 \right) }

But I don't know if there is better way to fix this.

If you have any suggestions on how to improve the above defined \MeijerG or if you would define the Meijer's G function in a completely different way, then please write an answer.

Actually I have an additional question: Do you think that any effort (regarding the typesetting of Meijer's G function) will be eliminated when the manuscript is summited to a journal?

share|improve this question
As to your additional question: it depends very much on the journal in question. – Andrew Uzzell Oct 16 '12 at 13:19
up vote 4 down vote accepted

One possibility: I used \DeclarePairedDelimiterX from the mathtools package to define a \MeijerM command with three arguments which is responsible to typeset the delimited matrix; then I defined \MeijerG having eight arguments (the first one is optional and will be passed as the optional argument to \MeijerM); using the \WithSuffix command from the suffix package to provide the starred version \MeijerG*:


{\begin{smallmatrix}#1 \\ #2\end{smallmatrix}\delimsize\vert\,#3}




\MeijerG*{m}{n}{p}{q}{a_1, \dots, a_p}{b_1, \dots, b_q}{z}\quad
\MeijerG[\big]{m}{n}{p}{q}{a_1, \dots, a_p}{b_1, \dots, b_q}{z}\quad
\MeijerG[\Bigg]{m}{n}{p}{q}{a_1, \dots, a_p}{b_1, \dots, b_q}{z}


enter image description here

The size of delimiters in the second and third examples is obviously wrong, but I just included them to test the functionality of the defined commands. Also, I used simple sub/superscripts to typeset the first four arguments, but of course you can use one of your proposed variants instead.

share|improve this answer
I didn't know about the suffix package. I must say your solution works perfect. Thank you for the nice solution. – Jesper Ipsen Oct 17 '12 at 7:06

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.