有没有办法使下支撑符号变细并减少其(垂直)距离以实现这一点:
我试过一种 tikz 版的较薄牙套。放大后可以看到,那只是权宜之计,看起来不太好看。
\documentclass[15pt, a4paper]{scrartcl}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\makeatletter
\def\Underbrace#1{%
\@ifnextchar_{\tikz@@underbrace{#1}}{\tikz@@underbrace{#1}_{}}}
\def\tikz@@underbrace#1_#2{%
\tikz[baseline=(a.base)] {\node[inner sep=2] (a) {\(#1\)};
\draw[line cap=round,decorate,decoration={brace,amplitude=4pt}]
(a.south east) -- node[pos=0.5,below,inner sep=7pt] {\(\scriptstyle #2\)} (a.south west);}}
\begin{document}
\[ p(x) \cdot x - \underbrace{r \cdot \Underbrace{\eta}_{\equiv 1} \cdot x}_{\text{variable costs}} \]
\end{document}
目前的结果是:
谢谢
答案1
您可以使用包MnSymbol
,这样可以使用较小的括号。此外,您还可以使用,\smash
这样较小的括号更靠近 eta 符号。最后,您可以使用包mathtools
和,\clap
以避免减号后有太多空格。
这里有展示我描述的 3 个连续改进的代码/图片:
\documentclass[15pt, a4paper]{scrartcl}
\usepackage{amsmath,mathtools}
\usepackage{MnSymbol}
\begin{document}
\begin{align*}
p(x)\cdot x-\underbrace{r\cdot\underbrace{\eta}_{\equiv1}
\cdot x}_{\text{variable costs}}\\[5pt]
%
p(x)\cdot x-\underbrace{r\cdot\underbrace{\smash{\eta}}_{\equiv1}
\cdot x}_{\text{variable costs}}\\[5pt]
%
p(x)\cdot x-\underbrace{r\cdot\underbrace{\smash{\eta}}_{\equiv1}
\cdot x}_{\clap{\scriptsize variable costs}}
\end{align*}
\end{document}
您甚至可以使用第二次猛击来抬起更大的支架:
p(x)\cdot x-\underbrace{\smash{r\cdot\underbrace{\smash{\eta}}_{\equiv1}
\cdot x}\vspace{6mm}}_{\clap{\scriptsize variable costs}}
您可以在其中使用“6mm”值。
答案2
基于其他答案,我导入了来自的内容来MnSymbol
定义\underbrace
和\overbrace
。
然后我将它们一起使用\mathclap
。
代码:
\documentclass{scrartcl}
\usepackage{mathtools}
%------------------ MnSymbol stuff ------------------%
\DeclareFontFamily{OMX}{MnSymbolE}{}
\DeclareSymbolFont{largesymbolsX}{OMX}{MnSymbolE}{m}{n}
\DeclareFontShape{OMX}{MnSymbolE}{m}{n}{
<-6> MnSymbolE5
<6-7> MnSymbolE6
<7-8> MnSymbolE7
<8-9> MnSymbolE8
<9-10> MnSymbolE9
<10-12> MnSymbolE10
<12-> MnSymbolE12}{}
\DeclareMathSymbol{\downbrace} {\mathord}{largesymbolsX}{'251}
\DeclareMathSymbol{\downbraceg} {\mathord}{largesymbolsX}{'252}
\DeclareMathSymbol{\downbracegg} {\mathord}{largesymbolsX}{'253}
\DeclareMathSymbol{\downbraceggg} {\mathord}{largesymbolsX}{'254}
\DeclareMathSymbol{\downbracegggg}{\mathord}{largesymbolsX}{'255}
\DeclareMathSymbol{\upbrace} {\mathord}{largesymbolsX}{'256}
\DeclareMathSymbol{\upbraceg} {\mathord}{largesymbolsX}{'257}
\DeclareMathSymbol{\upbracegg} {\mathord}{largesymbolsX}{'260}
\DeclareMathSymbol{\upbraceggg} {\mathord}{largesymbolsX}{'261}
\DeclareMathSymbol{\upbracegggg} {\mathord}{largesymbolsX}{'262}
\DeclareMathSymbol{\braceld} {\mathord}{largesymbolsX}{'263}
\DeclareMathSymbol{\bracelu} {\mathord}{largesymbolsX}{'264}
\DeclareMathSymbol{\bracerd} {\mathord}{largesymbolsX}{'265}
\DeclareMathSymbol{\braceru} {\mathord}{largesymbolsX}{'266}
\DeclareMathSymbol{\bracemd} {\mathord}{largesymbolsX}{'267}
\DeclareMathSymbol{\bracemu} {\mathord}{largesymbolsX}{'270}
\DeclareMathSymbol{\bracemid} {\mathord}{largesymbolsX}{'271}
\makeatletter
\def\horiz@expandable#1#2#3#4#5#6#7#8{%
\@mathmeasure\z@#7{#8}%
\@tempdima=\wd\z@
\@mathmeasure\z@#7{#1}%
\ifdim\noexpand\wd\z@>\@tempdima
$\m@th#7#1$%
\else
\@mathmeasure\z@#7{#2}%
\ifdim\noexpand\wd\z@>\@tempdima
$\m@th#7#2$%
\else
\@mathmeasure\z@#7{#3}%
\ifdim\noexpand\wd\z@>\@tempdima
$\m@th#7#3$%
\else
\@mathmeasure\z@#7{#4}%
\ifdim\noexpand\wd\z@>\@tempdima
$\m@th#7#4$%
\else
\@mathmeasure\z@#7{#5}%
\ifdim\noexpand\wd\z@>\@tempdima
$\m@th#7#5$%
\else
#6#7%
\fi
\fi
\fi
\fi
\fi}
\def\overbrace@expandable#1#2#3{\vbox{\m@th\ialign{##\crcr
#1#2{#3}\crcr\noalign{\kern2\p@\nointerlineskip}%
$\m@th\hfil#2#3\hfil$\crcr}}}
\def\underbrace@expandable#1#2#3{\vtop{\m@th\ialign{##\crcr
$\m@th\hfil#2#3\hfil$\crcr
\noalign{\kern2\p@\nointerlineskip}%
#1#2{#3}\crcr}}}
\def\overbrace@#1#2#3{\vbox{\m@th\ialign{##\crcr
#1#2\crcr\noalign{\kern2\p@\nointerlineskip}%
$\m@th\hfil#2#3\hfil$\crcr}}}
\def\underbrace@#1#2#3{\vtop{\m@th\ialign{##\crcr
$\m@th\hfil#2#3\hfil$\crcr
\noalign{\kern2\p@\nointerlineskip}%
#1#2\crcr}}}
\def\bracefill@#1#2#3#4#5{$\m@th#5#1\leaders\hbox{$#4$}\hfill#2\leaders\hbox{$#4$}\hfill#3$}
\def\downbracefill@{\bracefill@\braceld\bracemd\bracerd\bracemid}
\def\upbracefill@{\bracefill@\bracelu\bracemu\braceru\bracemid}
\def\upbrace@expandable{%
\horiz@expandable
\upbrace
\upbraceg
\upbracegg
\upbraceggg
\upbracegggg
\upbracefill@}
\def\downbrace@expandable{%
\horiz@expandable
\downbrace
\downbraceg
\downbracegg
\downbraceggg
\downbracegggg
\downbracefill@}
\DeclareRobustCommand{\overbrace}[1]{\mathop{\mathpalette{\overbrace@expandable\downbrace@expandable}{#1}}\limits}
\DeclareRobustCommand{\underbrace}[1]{\mathop{\mathpalette{\underbrace@expandable\upbrace@expandable}{#1}}\limits}
\makeatother
%------------------ MnSymbol stuff ------------------%
\begin{document}
\[ p(x) \cdot x - \overbrace{r \cdot \underbrace{\smash{\eta}}_{\equiv 1} \cdot x}^{\mathclap{\text{\tiny variable costs}}} \]
\end{document}