这个长方程式该怎么写?

这个长方程式该怎么写?
\begin{eqnarray*}
\vec{E}_{tot}=q\cdot k_{b}\cdot \dfrac{r}{r^3}\left\lgroup
\dfrac{\hat{r}-\left(\dfrac{d}{2\cdot r}\right)\hat{d}}{\left(1+\left(\dfrac{d}{2\cdot r}\right)^2-\left(\dfrac{d}{ r}\right)\hat{r}\cdot\hat{d}\cdot cos (\theta)\right)^{3/2}}-\dfrac{\hat{r}+\left(\dfrac{d}{2\cdot r}\right)\hat{d}}{\left(1+\left(\dfrac{d}{2\cdot r}\right)^2+\left(\dfrac{d}{ r}\right)\cdot\hat{r}\cdot\hat{d}\cdot cos(\theta)\right)^{3/2}}
\right\rgroup

\end{eqnarray*}

答案1

这是一个案例multline

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{multline*}
\vec{E}_{\mathrm{tot}}=
  q\cdot k_{b}\cdot \dfrac{r}{r^3}
  \left\lgroup
    \frac{\hat{r}-\left(\dfrac{d}{2\cdot r}\right)\hat{d}}
         {\biggl(1+\left(\dfrac{d}{2\cdot r}\right)^2-
                   \left(\dfrac{d}{r}\right)\hat{r}\cdot\hat{d}\cdot\cos(\theta)
          \biggr)^{3/2}}
  \right.
  \\
  \left.
    {}-
    \frac{\hat{r}+\left(\dfrac{d}{2\cdot r}\right)\hat{d}}
         {\biggl(1+\left(\dfrac{d}{2\cdot r}\right)^2+
                   \left(\dfrac{d}{r}\right)\cdot\hat{r}\cdot\hat{d}\cdot\cos(\theta)
          \biggr)^{3/2}}
  \right\rgroup
\end{multline*}

\end{document}

我改变了几个\left-\right对,以使外括号稍微小一些。

在此处输入图片描述

答案2

首先:不要使用eqnarray。现在不要。永远不要。

其次,通过删除所有\cdot指令并用更小的尺寸运算符和)替换大多数\left和指令,并假设边距宽度正常,很容易在一行上写出整个等式。\right\Big\bigg

另外,您可能想研究一下不使用 displaymath-mode 小数表示法。结果如下图第二个等式所示。

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage{amsmath,mleftright}
\newcommand\ddfrac[2]{\frac{\displaystyle #1}{\displaystyle #2}}
\usepackage[margin=2.5cm]{geometry} % choose page margins suitable
\begin{document}

\[
\vec{E}_{\mathrm{tot}}=q k_{b}^{} \frac{r}{r^3}
\left(
 \ddfrac{\hat{r}-\Bigl(\frac{d}{2r}\Bigr)\hat{d}}{%
 \biggl(1+\Bigl(\frac{d}{2r}\Bigr)^{\!2}
    -\Bigl(\frac{d}{r}\Bigr)\hat{r}\hat{d}\cos(\theta)\biggr)^{\!3/2}}
-\ddfrac{\hat{r}+\Bigl(\frac{d}{2r}\Bigr)\hat{d}}{%
 \biggl(1+\Bigl(\frac{d}{2r}\Bigr)^{\!2}
    +\Bigl(\frac{d}{r}\Bigr)\hat{r}\hat{d}\cos(\theta)\biggr)^{\!3/2}}
\right)
\]

\bigskip
%% and now without displaystyle fractions
\[
\vec{E}_{\mathrm{tot}}=q k_{b}^{} \tfrac{r}{r^{3\mathstrut}}
\mleft[
 \dfrac{\hat{r}-\frac{d}{2r}\hat{d}}{%
 \bigl[1+\frac{d^2}{4r^{2\mathstrut}}
    -\frac{d}{r}\hat{r}\hat{d}\cos(\theta)\bigr]^{3/2}}
-\dfrac{\hat{r}+\frac{d}{2r}\hat{d}}{%
 \bigl[1+\frac{d^2}{4r^{2\mathstrut}}
    +\frac{d}{r}\hat{r}\hat{d}\cos(\theta)\bigr]^{3/2}}
\mright]
\]

\end{document}

答案3

multline因为它是一个方程,所以在这种情况下我宁愿使用(*) 环境。

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{multline*}
  \vec{E}_{tot} = q\cdot k_{b}\cdot \dfrac{r}{r^3}\left\lgroup
  \dfrac{\hat{r}-\left(\dfrac{d}{2\cdot r}\right)\hat{d}}{\left(1+
  \left(\dfrac{d}{2\cdot r}\right)^2-\left(\dfrac{d}{ r}\right)\hat{r}
  \cdot\hat{d}\cdot \cos (\theta)\right)^{3/2}}\right.\\
  - \left.\dfrac{\hat{r}+\left(\dfrac{d}{2\cdot r}\right)\hat{d}}
  {\left(1+\left(\dfrac{d}{2\cdot r}\right)^2
  +\left(\dfrac{d}{ r}\right)\cdot\hat{r}\cdot\hat{d}\cdot \cos(\theta)
  \right)^{3/2}}\right\rgroup
\end{multline*}
\end{document}

在此处输入图片描述

答案4

\cdot如果删除我认为不必要的 s 和一些无用的括号,它可以完美地放在一行中。与手头的问题无关,我将\vec不太好用的替换\vvesvect

\documentclass{article}

\usepackage{mathtools}
\usepackage{esvect}
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.3pt}

\begin{document}

\begin{equation*}
 \vv*{E}{\text{tot}} =q k_{b}\, \frac{r}{r^3}\mkern-6mu%
 \left\lgroup
\frac{\hat{r}-\dfrac{d}{2 r}\,\hat{d}}{\biggl(1+\biggl(\dfrac{d}{2 r}\biggr)^{\!2}\!-\dfrac{d}{ r}\,\hat{r}\hat{d}\,\cos \theta\biggr)^{\!\tfrac{3}{2}}}%
 -\frac{\hat{r}+ \dfrac{d}{2 r}\,\hat{d}}{\biggl(1+\left(\dfrac{d}{2 r}\right)^{\!2}\!+\dfrac{d}{ r}\,\hat{r}\hat{d}\, \cos \theta \biggr)^{\!\tfrac{3}{2}}}
\right\rgroup
\end{equation*}

\end{document} 

在此处输入图片描述

相关内容