[Tex/LaTex] How to write the LaTeX code of this Meijer G function

math-modemathtools

Hi, I need some help on the LaTeX code of the Meijer G function on the right side of below equation. I want to know what is the LaTeX command for the function shown in the following image.

enter image description here


For the general Meijer G function, the following LaTeX codes work:

\DeclarePairedDelimiterX\MeijerM[3]{\lparen}{\rparen}%
{\,#3\delimsize\vert\begin{smallmatrix}#1 \\ #2\end{smallmatrix}}

\newcommand\MeijerG[8][]{%
  G^{\,#2,#3}_{#4,#5}\MeijerM[#1]{#6}{#7}{#8}}

\WithSuffix\newcommand\MeijerG*[7]{%
  G^{\,#1,#2}_{#3,#4}\MeijerM*{#5}{#6}{#7}}

For instance, the LaTeX code \MeijerG*{1}{1}{1}{1}{0 }{0}{x} will generate the Meijer G function like : enter image description here

Thanks a lot in advance.

Best Answer

With a handier syntax:

\documentclass{article}
\usepackage{geometry} % more generous width
\usepackage{amsmath}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\MeijerG}{smmmm}
 {
  \IfBooleanTF{#1}
   {
    \vic_meijerg:nnnnnn { #2 } { #3 } { #4 } { #5 } { small } { }
   }
   {
    \vic_meijerg:nnnnnn { #2 } { #3 } { #4 } { #5 } { } { \; }
   }
 }

\seq_new:N \l__vic_meijerg_args_in_seq
\seq_new:N \l__vic_meijerg_args_out_seq

\cs_new_protected:Nn \vic_meijerg:nnnnnn
 {
  \seq_set_split:Nnn \l__vic_meijerg_args_in_seq { | } { #3 }
  \seq_clear:N \l__vic_meijerg_args_out_seq  
  \seq_map_inline:Nn \l__vic_meijerg_args_in_seq
   {
    \seq_put_right:Nn \l__vic_meijerg_args_out_seq
     {
      \begin{#5matrix} ##1 \end{#5matrix}
     }
   }
  G\sp{#1}\sb{#2}
  \left(
  \seq_use:Nn \l__vic_meijerg_args_out_seq { #6\middle|#6 }
  #6\middle|#6
  #4
  \right)
 }
\ExplSyntaxOff

\begin{document}

In line
$
\MeijerG*
  {n,m:m_1,n_1:m_2,n_2} % superscript
  {q,p:p_1,q_1:p_2,q_2} % subscript
  {
   1-\alpha-b_1,\ldots,1-\alpha-b_q\\
   1-\alpha-a_1,\ldots,1-\alpha-a_p
   |
   a_{11},\ldots,a_{1p_1} \\
   b_{11},\ldots,b_{1q_1}
   |
   a_{21},\ldots,a_{2p_1}\\
   b_{21},\ldots,b_{2q_1}
  }
  {\frac{x}{z},\frac{y}{z}}
$
and $\MeijerG*{1,1}{1,1}{ 0 \\ 0 } { x }$. Display:
\begin{gather}
\MeijerG
  {n,m:m_1,n_1:m_2,n_2} % superscript
  {q,p:p_1,q_1:p_2,q_2} % subscript
  {
   1-\alpha-b_1,\ldots,1-\alpha-b_q\\
   1-\alpha-a_1,\ldots,1-\alpha-a_p
   |
   a_{11},\ldots,a_{1p_1} \\
   b_{11},\ldots,b_{1q_1}
   |
   a_{21},\ldots,a_{2p_1}\\
   b_{21},\ldots,b_{2q_1}
  }
  {\frac{x}{z},\frac{y}{z}}
\\
\MeijerG{1,1}{1,1}{ 0 \\ 0 } { x }
\end{gather}

\end{document}

The *-version is for printing the formula inline.

enter image description here