|
色k
发表于 2019-5-16 23:36
回复 2# kuing
这个链接中我那设计的格式太固定,无法灵活使用,重新设计如下:- \documentclass{article}
- \newsavebox\jjbox
- \newcommand\ubrc[3][]{%
- \sbox\jjbox{\phantom{$\displaystyle#1$}}%
- \hspace{-\wd\jjbox}%
- {\underbrace{\usebox\jjbox#2}_{#3}}%
- }
- \newcommand\obrc[3][]{%
- \sbox\jjbox{\phantom{$\displaystyle#1$}}%
- \hspace{-\wd\jjbox}%
- {\overbrace{\usebox\jjbox#2}^{#3}}%
- }
- \begin{document}
- \[
- \obrc{1+9+4}{14}
- \ubrc[4]{+8+2}{14}
- \obrc[2]{+7+5}{14}
- \ubrc[5]{+6+3}{14}
- \obrc[3]{+10+1}{14}
- \]
- \[
- \ubrc{a+b+c+d}m
- \obrc[c+d]{+e+f}n
- \ubrc[e+f]{+g+h}p
- \]
- \[
- \ubrc{\frac12+\frac23+\cdots+\sum_{i=1}^nx_i}m
- \obrc[\sum_{i=1}^nx_i]{+e+f}n
- \]
- \end{document}
复制代码 效果:
|
|