如何防止分数的分子超过求和符号的高度?

如何防止分数的分子超过求和符号的高度?

我使用了@Qrrbrbirlbel 提出的技术

做出一个大的总结手势

使我的求和符号足够大。

\documentclass[11pt,oneside,openany]{book}
\usepackage[a4paper, left=1.5cm, right=1.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage{array}
\usepackage[table]{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{calc}
\usepackage{actuarialsymbol}
%I copied this part from tex.stackexchange.com written by @Qrrbrbirlbel
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}

\newcommand{\nsum}[1][1.4]{% only for \displaystyle
    \mathop{%
        \raisebox
        {-#1\depthofsumsign+1\depthofsumsign}
        {\scalebox
            {#1}
            {$\displaystyle\sum$}%
        }
    }
}
\newcommand{\resum}[1]{%
    \def\s{#1}
    \mathop{
        \mathpalette\resumaux{#1}
    }
}

\newcommand{\resumaux}[2]{% internally
    \sbox0{$#1#2$}
    \sbox1{$#1\sum$}
    \setlength{\heightanddepthofargument}{\wd0+\dp0}
    \setlength{\totalheightofsumsign}{\wd1+\dp1}
    \def\quot{\DivideLengths{\heightanddepthofargument}{\totalheightofsumsign}}
    \nsum[\quot]%
}

% http://tex.stackexchange.com/a/6424/16595
\makeatletter
\newcommand*{\DivideLengths}[2]{%
    \strip@pt\dimexpr\number\numexpr\number\dimexpr#1\relax*65536/\number\dimexpr#2\relax\relax sp\relax
}
\makeatother
\begin{document}
    \begin{align}
    CHN &=\nsum[1.7]\limits_{\forall x}\actsymb[x]{f}{b}[T]\cdot\dfrac{\lx{b}[B]}{
            \lx{0}[F]}\nsum[2.5]\limits_{s=0}\dfrac{\actsymb[n]{f}{r}[E]\cdot\dfrac{\lx{q}[W] 
                }{\lx{6}[Y]}}{\actsymb[m]{f}{q}[B]}
    \end{align}
\end{document}

我不知道该如何调整。我在此恳请大家帮助。

答案1

虽然可以做到,但是看起来很糟糕!

您还可以使用 pgfmath 来计算比例因子。

演示

\documentclass[11pt,oneside,openany]{book}
\usepackage[a4paper, left=1.5cm, right=1.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage{array}
\usepackage[table]{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{calc}
\usepackage{actuarialsymbol}
%I copied this part from tex.stackexchange.com written by @Qrrbrbirlbel
\newlength{\depthofsumsign}
\setlength{\depthofsumsign}{\depthof{$\sum$}}
\newlength{\totalheightofsumsign}
\newlength{\heightanddepthofargument}
\newsavebox{\tempbox}

\newcommand{\nsum}[1][1.4]{% only for \displaystyle
    \mathop{%
        \raisebox
        {-#1\depthofsumsign+1\depthofsumsign}
        {\scalebox
            {#1}
            {$\displaystyle\sum$}%
        }
    }
}
\newcommand{\resum}[1]{%
    \def\s{#1}
    \mathop{
        \mathpalette\resumaux{#1}
    }
}

\newcommand{\resumaux}[2]{% internally
    \sbox0{$#1#2$}
    \sbox1{$#1\sum$}
    \setlength{\heightanddepthofargument}{\wd0+\dp0}
    \setlength{\totalheightofsumsign}{\wd1+\dp1}
    \def\quot{\DivideLengths{\heightanddepthofargument}{\totalheightofsumsign}}
    \nsum[\quot]%
}

% http://tex.stackexchange.com/a/6424/16595
\makeatletter
\newcommand*{\DivideLengths}[2]{%
    \strip@pt\dimexpr\number\numexpr\number\dimexpr#1\relax*65536/\number\dimexpr#2\relax\relax sp\relax
}
\makeatother
\begin{document}
  \savebox{\tempbox}{$\dfrac{\actsymb[n]{f}{r}[E]\cdot\dfrac{\lx{q}[W]}{\lx{6}[Y]}}{\actsymb[m]{f}{q}[B]}$}% measure height
    \begin{align}
    CHN &=\nsum[1.7]\limits_{\forall x}\actsymb[x]{f}{b}[T]\cdot\dfrac{\lx{b}[B]}{
            \lx{0}[F]}\resizebox{!}{\ht\tempbox}{$\sum\limits_{s=0}$} \usebox\tempbox
    \end{align}
\end{document}

相关内容