我想underbrace
在公式中使用:
\begin{IEEEeqnarray}{r/C/l?s}
P_{a} \left( a | \gamma, \epsilon, \hat{K} \right)
& = & \frac{1}{1 + \frac{\gamma}{\epsilon} \times
\underbrace{
\frac{\alpha_{X} \left( p_{f} | \hat{K} \right)} {\alpha_{Y} \left( a | \hat{S} \right)}
}_{\Gamma \left( a | \hat{K} \right)}
}
& \IEEEnonumber
\end{IEEEeqnarray}
与无下支撑的公式相比,下支撑部分被放大了:
\begin{IEEEeqnarray}{r/C/l?s}
P_{a} \left( a | \gamma, \epsilon, \hat{K} \right)
& = & \frac{1}{1 + \frac{\gamma}{\epsilon} \times
% \underbrace{
\frac{\alpha_{X} \left( p_{f} | \hat{K} \right)} {\alpha_{Y} \left( a | \hat{S} \right)}
% }_{\Gamma \left( a | \hat{K} \right)}
}
& \IEEEnonumber
\end{IEEEeqnarray}
在对公式的某些部分进行下划线时,如何避免字体大小的改变?
答案1
\textstyle
在里面添加\underbrace
;更好的是,定义一个新命令。
\documentclass{article}
\usepackage{IEEEtrantools}
\newcommand{\tunderbrace}[1]{\underbrace{\textstyle#1}}
\begin{document}
\begin{IEEEeqnarray}{r/C/l?s}
P_{a} ( a | \gamma, \epsilon, \hat{K} )
& = & \frac{1}{1 + \frac{\gamma}{\epsilon} \times
\tunderbrace{
\frac{\alpha_{X} ( p_{f} | \hat{K} )} {\alpha_{Y} ( a | \hat{S} )}
}_{\Gamma ( a | \hat{K} )}
}
& \IEEEnonumber
\end{IEEEeqnarray}
\end{document}
顺便说一句,您应该已经发现为什么滥用\left
和使用\right
是错误的。
您可能还想使用\mid
:|
\documentclass{article}
\usepackage{IEEEtrantools}
\newcommand{\tunderbrace}[1]{\underbrace{\textstyle#1}}
\begin{document}
\begin{IEEEeqnarray}{r/C/l?s}
P_{a} ( a \mid \gamma, \epsilon, \hat{K} )
& = & \frac{1}{1 + \frac{\gamma}{\epsilon} \times
\tunderbrace{
\frac{\alpha_{X} ( p_{f} \mid \hat{K} )} {\alpha_{Y} ( a \mid \hat{S} )}
}_{\Gamma ( a \mid \hat{K} )}
}
& \IEEEnonumber
\end{IEEEeqnarray}
\end{document}
答案2
以下示例基于egreg 的解决方案(最后一个例子是\mid
)。它定义了\KeepStyleUnderBrace
也自动适用于其他数学样式:
\documentclass{article}
\usepackage{IEEEtrantools}
\newcommand*{\KeepStyleUnderBrace}[1]{%
\mathop{%
\mathchoice
{\underbrace{\displaystyle#1}}%
{\underbrace{\textstyle#1}}%
{\underbrace{\scriptstyle#1}}%
{\underbrace{\scriptscriptstyle#1}}%
}\limits
}
\begin{document}
\begin{IEEEeqnarray}{r/C/l?s}
P_{a} ( a \mid \gamma, \epsilon, \hat{K} )
& = &
\frac{1}{1 + \frac{\gamma}{\epsilon} \times
\KeepStyleUnderBrace{
\frac{\alpha_{X} ( p_{f} \mid \hat{K} )}
{\alpha_{Y} ( a \mid \hat{S} )}
}_{\Gamma ( a \mid \hat{K} )}
}
& \IEEEnonumber
\end{IEEEeqnarray}
\end{document}