答案1
答案2
這是一個更改文字樣式和顯示樣式大小的實作:
\documentclass{article}
\usepackage{amsmath,mathtools,xparse}
\NewDocumentCommand{\hyper}{mommmm}{%
\IfValueTF{#2}{\prescript{}{#2}{#1}^{}_{#3}}{#2^{}_{#3}}%
\innerhyper{{#4}{#5}{#6}}
}
\makeatletter
\newcommand{\innerhyper}[1]{\mathpalette\inner@hyper{#1}}
\newcommand{\inner@hyper}[2]{\inner@@hyper{#1}#2}
\newcommand{\inner@@hyper}[4]{%
\ifx#1\displaystyle\!\left(\else\bigl(\fi
\begin{\ifx#1\displaystyle\else small\fi matrix}
#2 \\ #3
\end{\ifx#1\displaystyle\else small\fi matrix}
\ifx#1\displaystyle\;\middle|\;\else\bigm|\fi
#4
\ifx#1\displaystyle\right)\else\bigr)\fi
}
\makeatother
\begin{document}
$\hyper{\phi}[2]{1}{az,a/z}{ab}{q,\frac{bt}{a}}$
\[
\hyper{\phi}[2]{1}{az,a/z}{ab}{q,\frac{bt}{a}}
\]
\end{document}