如何让分数出现在大括号的中间?

如何让分数出现在大括号的中间?
\documentclass{report}
\usepackage{natbib}
\usepackage{amsmath}
\makeatletter
\newcommand{\vast}{\bBigg@{9}}
\makeatother
\citestyle{apa}

\begin{document}
\pagenumbering{arabic}
\chapter{\textbf{General Review}}\label{cp1}
\thispagestyle{empty}


\begin{align}
+\delta_{I_i}\vast\[\frac{
\begin{tabular}{c}
$\bigg(-\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma^2}(1-e^{\gamma t_{L_i}})-\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma}(t_{L_i}e^{\gamma t_{L_i}})\bigg)e^{\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma}(1-e^{\gamma t_{L_i}})}-$\\
$\bigg(-\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma^2}(1-e^{\gamma t_{U_i}})-\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma}(t_{U_i}e^{\gamma t_{U_i}})\bigg)e^{\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma}(1-e^{\gamma t_{U_i}})}$
\end{tabular}}
{e^{\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma}(1-e^{\gamma t_{L_i}})}-e^{\frac{e^{\beta_0+\beta_1 x_{1i}}}{\gamma}(1-e^{\gamma t_{U_i}})}}\vast\]
\end{align}
\end{document}

[1]:https://i.stack.imgur.com/y0FeJ.png

有什么办法可以让分数出现在大括号的中间?

答案1

我认为,如果您决定使用单字母变量(例如)来Q表示项\exp(\beta_0+\beta_1 x_{1i})/\gamma(该项在等式中出现次数不少于 8 [!] 次)来简化等式,那么提供大外括号的问题就变得无关紧要了;请参阅下面的第一个等式以了解此替换的结果。(您显然可以自由选择其他变量名。)

如果您认为有必要在分割分子周围放置花括号,请继续这样做;请参见下面的第二个等式以了解结果。

请注意,我已经使用\splitdfrac宏(由包提供mathtools)来排版两行分子项。

在此处输入图片描述

\documentclass{report}
\usepackage{mathtools} % for '\splitdfrac' macro
\newcommand\Q{\exp(\beta_0+\beta_1 x_{1i})/\gamma}
\begin{document}
Put $Q=\Q$. Then
\begin{equation}
\dots+\delta_{I_i} \frac{%
\splitdfrac{
[-(Q/\gamma)(1-e^{\gamma t_{\mkern-1.5muL_i}})-
   Q(t_{\mkern-1.5muL_i}e^{\gamma t_{\mkern-1.5muL_i}})]
\exp[Q(1-e^{\gamma t_{\mkern-1.5muL_i}})]}{
-[-(Q/\gamma)(1-e^{\gamma t_{\mkern-1muU_i}}) 
  -Q(t_{\mkern-1muU_i}e^{\gamma t_{\mkern-1muU_i}})]
\exp[Q(1-e^{\gamma t_{\mkern-1muU_i}})]
}}{\displaystyle
 \exp[Q(1-e^{\gamma t_{\mkern-1.5muL_i}})]
-\exp[Q(1-e^{\gamma t_{\mkern-1muU_i}})]}
\end{equation}

\begin{equation} % same equation, but curly braces around numerator
\dots+\delta_{I_i} \frac{\biggl\{
\splitdfrac{
[-(Q/\gamma)(1-e^{\gamma t_{\mkern-1.5muL_i}})-
   Q(t_{\mkern-1.5muL_i}e^{\gamma t_{\mkern-1.5muL_i}})]
\exp[Q(1-e^{\gamma t_{\mkern-1.5muL_i}})]}{
-[-(Q/\gamma)(1-e^{\gamma t_{\mkern-1muU_i}}) 
  -Q(t_{\mkern-1muU_i}e^{\gamma t_{\mkern-1muU_i}})]
\exp[Q(1-e^{\gamma t_{\mkern-1muU_i}})]
}\biggr\} }{\displaystyle
 \exp[Q(1-e^{\gamma t_{\mkern-1.5muL_i}})]
-\exp[Q(1-e^{\gamma t_{\mkern-1muU_i}})]}
\end{equation}
\end{document}

答案2

无论如何,主分数线应保持在数学轴上。否则,它可能会改变数学含义,参见双分数。

以下示例首先移动内部公式,使其位于数学轴周围的框的中心。添加的栅栏现在很接近,上方或下方没有多余的空白。最后,将带有栅栏的公式向相反方向移动以保持数学轴。

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand*{\shortenfences}[3]{%
  % #1: left fence without \left
  % #2: formula inside the fences
  % #3: right fence without \right
  \mathpalette{\@shortenfences{#1}{#3}}{#2}%
}
\newdimen\sf@dimen
\newcommand*{\@shortenfences}[4]{%
  % #1: left fence
  % #2: right fence
  % #3: math style
  % #4: formula
  \sbox0{$#3#4\m@th$}%
  \sbox2{$#3\vcenter{}$}%
  % \dimen0: height above math axis
  \dimen0=\dimexpr\ht0 - \ht2\relax
  \ifdim\dimen0<\z@
    \dimen0=\z@
  \fi
  % \dimen2: depth below math axis
  \dimen2=\dimexpr\ht2 + \dp0\relax
  \ifdim\dimen2<\z@
    \dimen2=\z@
  \fi
  % \sf@dimen: amount for lowering the inner formula
  % to center the inner formula.
  \sf@dimen=\dimexpr(\dimen0 - \dimen2)/2\relax
  % lower the inner formula and raise the outer formula with
  % the fences to keep the math axis.
  \raisebox{\sf@dimen}{%
    $#3\left#1\raisebox{-\sf@dimen}{\box0}\right#2\m@th$%
  }
}
\makeatother

\begin{document}
\[
  \alpha =
  \left[
    \dfrac{
      \dfrac{\sum\limits_i^n f(i)}{a + b}
    }{c - d}
  \right]^\gamma
  =
  \shortenfences{[}{
    \dfrac{
      \dfrac{\sum\limits_i^n f(i)}{a + b}
    }{c - d}
  }{]^\gamma}
  = 0
\]
\end{document}

结果

相关内容