我定义了\rightbrace
产生所需右括号的方法,如下所示。有什么方法可以改进命令吗?
\documentclass{amsart}
\makeatletter
\DeclareRobustCommand\udots{%
\mathinner{\mkern1mu\raise\p@
\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise7\p@\hbox{.}\mkern1mu}}
\newcommand*\rightbrace[3]{\raisebox{#1em}{$\left.\makebox(0em,#2em){}\right\}{\scriptsize#3}$}}
\makeatother
\begin{document}
\[
2^{2^{\udots^2}}\rightbrace{0.5}{1}{n+1}=2^{2^n}.
\]
\end{document}
答案1
我的建议:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\NewDocumentCommand{\tower}{mo}{%
\mathord{%
\sbox\z@{$\m@th #1^{#1^{\scriptstyle\cdot^{\scriptstyle\cdot^{\scriptstyle\cdot^{\scriptstyle#1\mathstrut}}}}}$}%
\copy\z@
\IfValueT{#2}{%
\sbox\tw@{%
$\m@th\left.\kern-\nulldelimiterspace
\vcenter to \ht\z@{}\right\rbrace\vcenter{\hbox{$\scriptstyle #2$}}$%
}%
\raisebox{\dimeval{\depth-0.5\delimitershortfall}}{\box\tw@}%
}%
}%
}
\makeatother
\begin{document}
$\tower{2}$
$\tower{2}[n]$
$\tower{2}[n+1]=2^{2^n}$
$\tower{y}$
$\tower{f}$
\end{document}