![使用 LaTeX 呈现超几何函数符号](https://linux22.com/image/231983/%E4%BD%BF%E7%94%A8%20LaTeX%20%E5%91%88%E7%8E%B0%E8%B6%85%E5%87%A0%E4%BD%95%E5%87%BD%E6%95%B0%E7%AC%A6%E5%8F%B7.png)
答案1
\setlength\arraycolsep{1pt}
{}_3 F_2\left(\begin{matrix}a& &b& &c\\&d&
&e&\end{matrix};z\right)
这会使间距缩小很多。我之前制作了一个超几何宏,但;z
不幸的是它不支持。
\newcommand*\pFq[2]{{}_{#1}F_{#2}\genfrac[]{0pt}{}}
然后使用\pFq{3}{2}{a,b,c}{d,e}
。(或者用您想要的任何其他类型的间距替换逗号。)我对此非常满意。
编辑:实际上,像这样的事情怎么样?
\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
}
更改\pFqskip
为元素之间的任意间距。你可以像
\pFq{3}{2}{a,b,c}{d,e}{z}
答案2
更新,更多功能
的可选参数\pFq
是一组键值设置,但也可以使用 全局指定设置\hypergeometricsetup
。
可以设置symbol
(默认 F)、fences
(默认括号)、separator
参数之间(默认无)、skip
参数之间(以 mu 为单位,默认 8)和divider
(默认 a semicolon
,但可以是bar
)。
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
\NewDocumentCommand{\pFq}{O{}mmmmm}
{
% #2 = left subscript, #3 = right subscript
% #4 = top, #5 = bottom, #6 = right
\group_begin:
\keys_set:nn { hypergeometric } { #1 }
\hypergeometric_print:nnnnn { #2 } { #3 } { #4 } { #5 } { #6 }
\group_end:
}
\NewDocumentCommand{\hypergeometricsetup}{m}
{
\keys_set:nn { hypergeometric } { #1 }
}
\tl_new:N \l_hypergeometric_divider_tl
\tl_new:N \l_hypergeometric_left_tl
\tl_new:N \l_hypergeometric_right_tl
\keys_define:nn { hypergeometric }
{
symbol .tl_set:N = \l_hypergeometric_symbol_tl,
symbol .initial:n = F,
separator .tl_set:N = \l_hypergeometric_separator_tl,
separator .initial:n = {},
skip .tl_set:N = \l_hypergeometric_skip_tl,
skip .initial:n = 8,
divider .choice:,
divider/semicolon .code:n = \tl_set:Nn \l_hypergeometric_divider_tl { \;; },
divider/bar .code:n = \tl_set:Nn \l_hypergeometric_divider_tl { \;\middle|\; },
divider .initial:n = semicolon,
fences .choice:,
fences/brack .code:n =
\tl_set:Nn \l_hypergeometric_left_tl {[}
\tl_set:Nn \l_hypergeometric_right_tl {]},
fences/parens .code:n =
\tl_set:Nn \l_hypergeometric_left_tl {(}
\tl_set:Nn \l_hypergeometric_right_tl {)},
fences .initial:n = brack,
}
\cs_new_protected:Nn \hypergeometric_print:nnnnn
{
% the main symbol
{} \sb {#1} \l_hypergeometric_symbol_tl \sb { #2 }
% the parameters
\left\l_hypergeometric_left_tl
\genfrac .. % no delimiters
{0pt} % no line
{} % default style
{ \__hypergeometric_process:n { #3 } } % numerator
{ \__hypergeometric_process:n { #4 } } % denominator
\l_hypergeometric_divider_tl
#5
\right\l_hypergeometric_right_tl
}
\cs_new_protected:Nn \__hypergeometric_process:n
{
\clist_use:nn { #1 }
{
{\l_hypergeometric_separator_tl}
\mspace { \l_hypergeometric_skip_tl mu }
}
}
\ExplSyntaxOff
\begin{document}
\[
\pFq{3}{2}{a,b,c}{d,e}{z}
\qquad
\pFq[skip=4]{3}{2}{a,b,c}{d,e}{z}
\qquad
\textstyle\pFq{3}{2}{a,b,c}{d,e}{z}
\]
\hypergeometricsetup{
fences=parens,
separator={,},
divider=bar,
}
\[
\pFq{3}{2}{a,b,c}{d,e}{z}
\qquad
\pFq[skip=4]{3}{2}{a,b,c}{d,e}{z}
\qquad
\textstyle\pFq{3}{2}{a,b,c}{d,e}{z}
\]
\[
\pFq{1}{1}{\nu+\frac{1}{2}}{2\nu+1}{2iz}
\]
\end{document}
原始答案
对 TH 答案的修改允许\pFq
其成为其他命令的参数。
\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}
诀窍是使用数学激活,而不是激活一概而论。还有一个可选参数用于更改系数之间的默认间距。
保留逗号的修改:
\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}
答案3
当我要求 Mathematica 给出广义超几何函数的 TeXForm 时,它给出了以下内容
_2F_2\left(\frac{1}{2},\frac{1}{2};\frac{3}{2},\frac{3}{2};-c^2\right)
看起来确实有效。简单又通用!
答案4
如果你问 Mathematica;
Hypergeometric2F1[2 a, b, c, d]
TeXForm[%]
然后你得到
\, _2F_1(2 a,b;c;d)
这在 Latex 中有效