答案1
答案2
这似乎很好地重现了第 9 页的公式https://arxiv.org/pdf/1309.0155.pdf
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\makeatletter
\newcommand{\around}[5]{%
% first is the center, then the letters from bottom in clockwise fashion
\setbox\z@=\vbox{
\hbox{\around@sss{#2}}
\hbox{\around@sss{#3}$\m@th#1$\around@sss{#5}}
\hbox{\around@sss{#4}}
}%
\hbox to \wd\z@{%
\hss
\vbox{\offinterlineskip\m@th\scriptspace=0pt
\ialign{%
\hfil##\hfil\cr
\hidewidth\around@sss{#4}\hidewidth\cr
\noalign{\kern1pt}
\vtop{\ialign{\hfil##\hfil\cr
\raisebox{\fontdimen22\textfont2}{\around@sss{#3}}%
$#1$%
\raisebox{\fontdimen22\textfont2}{\around@sss{#5}}%
\cr
\noalign{\kern1pt}
\hidewidth\around@sss{#2}\hidewidth\cr
}}\cr
}%
}\hss
}%
}
\newcommand{\around@sss}[1]{$\m@th\scriptscriptstyle#1$}
\makeatother
\begin{document}
$\around{\mathfrak{A}}{m}{n}{p}{q}\otimes\around{\mathfrak{A}}{m'}{q}{p'}{n'}
\to\around{\mathfrak{A}}{m+m'}{n}{p+p'}{n'}$
\end{document}
实际上,本文使用 Ti钾Z 代表工作。比较结果,顶线是我的宏,底线是论文的。
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\newcommand{\putaround}[5]{
\begin{tikzpicture}[baseline=(A.base),inner sep=0ex]
\node [label={[label distance=.15ex]below:$\scriptscriptstyle #2$},
label={[label distance=-.1ex, text depth=0pt, text height=0.5ex]left:$\scriptscriptstyle #3$},
label={[label distance=.15ex]above:$\scriptscriptstyle #4$},
label={[label distance=-.1ex, text depth=0pt, text height=0.5ex]right:$\scriptscriptstyle #5$}] (A)
{$#1$};
\end{tikzpicture}
}
\makeatletter
\newcommand{\around}[5]{%
% first is the center, then the letters from bottom in clockwise fashion
\setbox\z@=\vbox{
\hbox{\around@sss{#2}}
\hbox{\around@sss{#3}$\m@th#1$\around@sss{#5}}
\hbox{\around@sss{#4}}
}%
\hbox to \wd\z@{%
\hss
\vbox{\offinterlineskip\m@th\scriptspace=0pt
\ialign{%
\hfil##\hfil\cr
\hidewidth\around@sss{#4}\hidewidth\cr
\noalign{\kern1pt}
\vtop{\ialign{\hfil##\hfil\cr
\raisebox{\fontdimen22\textfont2}{\around@sss{#3}}%
$#1$%
\raisebox{\fontdimen22\textfont2}{\around@sss{#5}}%
\cr
\noalign{\kern1pt}
\hidewidth\around@sss{#2}\hidewidth\cr
}}\cr
}%
}\hss
}%
}
\newcommand{\around@sss}[1]{$\m@th\scriptscriptstyle#1$}
\makeatother
\begin{document}
\begin{gather}
\around{\mathfrak{A}}{m}{n}{p}{q}\otimes\around{\mathfrak{A}}{m'}{q}{p'}{n'}
\to\around{\mathfrak{A}}{m+m'}{n}{p+p'}{n'}
\\
\putaround{\mathfrak{A}}{m}{n}{p}{q}\otimes\around{\mathfrak{A}}{m'}{q}{p'}{n'}
\to\putaround{\mathfrak{A}}{m+m'}{n}{p+p'}{n'}
\end{gather}
\end{document}
答案3
使用stackrel
包+\stackbin
选项,您可以获得:
n
注意:此代码仅适用于这些字符的组合,因为每个其他字母都可以改变和的位置q
。
\documentclass{article}
\usepackage{amsfonts}
\usepackage{stackrel}
\begin{document}
$\stackbin[m]{p}{\mathfrak{A}}\mkern-22mu{\scriptstyle n}{\phantom{aa}}\mkern-6mu{\scriptstyle q}$
\end{document}
因此,有了这个 MWE,您将不会遇到任何字符位置问题。
\documentclass{article}
\usepackage{amsfonts}
\usepackage{stackrel}
\begin{document}
${\scriptstyle n}\stackbin[m]{p}{\mathfrak{A}}{\scriptstyle q}$
\end{document}
答案4
这也是使用 TikZ,但 egreg 的答案更简单。TikZ 控制一切:中心和周围的符号及其缩放和距离,以及与其他文本或公式的水平对齐(通过选项baseline=(A.mid)
)。
\documentclass{article}
\usepackage{amsfonts,tikz}
\newcommand{\putaround}[8]{%
% #1 center char
% #2 scale rate of center char
% #3,4,5,6 around chars
% #7 scale rate of around char
% #8 distance from center to around
\begin{tikzpicture}[baseline=(A.mid)]
\path
(0,0) node[scale=#2] (A) {#1}
+(0:#8) node[scale=#7] {#3}
+(90:#8) node[scale=#7] {#4}
+(180:#8) node[scale=#7] {#5}
+(270:#8) node[scale=#7] {#6};
\end{tikzpicture}
}%
\begin{document}
This is inline symbol \putaround{$\mathfrak{A}$}{1}{$q$}{$p$}{$m$}{$n$}{.8}{.3}
that TikZ controls everything: the center and around symbol with their scaling and distance, as well as horizontal alignment with other texts or formulars. And below is around symbol with display style
\[
\putaround{$\mathfrak{A}$}{2}{$q$}{$p$}{$m$}{$n$}{1}{.6}
=\int_0^1 f(x) dx.
\]
\end{document}