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
\documentclass[11pt]{article}
\usepackage{amssymb,amsmath,mathtools}
\newcommand{\MeijerG}[7]{G \begin{smallmatrix} #1 & #2 \\ #3 & #4 \end{smallmatrix} \left( \begin{smallmatrix} #5 \\ #6 \end{smallmatrix} \middle\vert #7 \right) }
\begin{document}
\begin{equation}
\MeijerG{m}{n}{p}{q}{a_1,\ldots,a_p}{b_1,\ldots,b_q}{z}
\end{equation}
\end{document}
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
\documentclass[11pt]{article}
\usepackage{amssymb,amsmath,mathtools}
\DeclarePairedDelimiter{\average}{\langle}{\rangle}
\begin{document}
\begin{equation}
\average*{\sum_k \delta(x-x_k)} \neq
\average[\Big]{\sum_k \delta(x-x_k)} \neq
\average{\sum_k \delta(x-x_k)}
\end{equation}
\end{document}
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?
Best Answer
One possibility: I used
\DeclarePairedDelimiterX
from themathtools
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 thesuffix
package to provide the starred version\MeijerG*
: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.