无法拆分较长的子方程

无法拆分较长的子方程

我似乎无法拆分两个较长的子方程。我尝试过多行、对齐、拆分和其他几种方法,但都没有奏效;我认为主要问题是我到处都有括号(确实是很长的方程!)。

我希望只有两个编号的方程式(1a 和 1b),但这些方程式要适合标准页面宽度。如能得到任何帮助,我将不胜感激。

这是我的工作代码,但我不确定接下来该怎么做:

\begin{subequations}\label{eqn:MagneticField3D}
    \begin{gather}
        B_{x}(r,x)=\frac{N I \mu_{0}}{2\pi}\left(\frac{1}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}\left(\mathcal{K}(k(r,x-d/2)^{2})+\frac{a^{2}-r^{2}-(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)-\frac{1}{\sqrt{(a+r)^{2}+(x+d/2)^{2}}}\left(\mathcal{K}(k(r,x+d/2)^{2})+\frac{a^{2}-r^{2}-(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)\right), \\
        B_{r}(r,x)=\frac{N I \mu_{0}}{2\pi r}\left(\frac{x-d/2}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}\left(-\mathcal{K}(k(r,x-d/2)^{2})+\frac{a^{2}+r^{2}+(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)-\frac{x+d/2}{\sqrt{(a+r)^{2}+(x+d/2)^{2}}}\left(-\mathcal{K}(k(r,x+d/2)^{2})+\frac{a^{2}+r^{2}+(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)\right).
    \end{gather}
\end{subequations}

答案1

这是一个不需要引入新符号的解决方案。它在必要时使用align、加上\left.\right.,以及\vphantom获得括号和圆括号的正确大小。我还将外括号改为方括号,因为我认为这样更容易阅读,但显然这是一种风格选择。

\documentclass{article}

\usepackage{amssymb,amsmath}

\begin{document}

\begin{subequations}\label{eqn:MagneticField3D}

    \begin{align}
        B_{x}(r,x) = & \frac{N I \mu_{0}}{2\pi}\left[\frac{1}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}\left(\mathcal{K}(k(r,x-d/2)^{2}) 
        \vphantom{\frac{a^{2}-r^{2}-(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}} % to size the ( correctly
        \right.\right. \nonumber \\
        & \left.\left. +\frac{a^{2}-r^{2}-(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right) \right. \nonumber \\
       & \left. -\frac{1}{\sqrt{(a+r)^{2}+(x+d/2)^{2}}}\left(\mathcal{K}(k(r,x+d/2)^{2}) 
       \vphantom{\frac{a^{2}-r^{2}-(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}} % to size the ( correctly
       \right.\right. \nonumber \\
       &  \left.\left. +\frac{a^{2}-r^{2}-(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)
       \vphantom{\frac{1}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}} % to size the ] correctly
       \right], \\
        B_{r}(r,x) = & \frac{N I \mu_{0}}{2\pi r}\left[\frac{x-d/2}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}\left(-\mathcal{K}(k(r,x-d/2)^{2}) 
        \vphantom{\frac{a^{2}+r^{2}+(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}} % to size the ( correctly
        \right.\right. \nonumber \\
            & \left.\left. +\frac{a^{2}+r^{2}+(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right) \right. \nonumber \\
    & \left. -\frac{x+d/2}{\sqrt{(a+r)^{2}+(x+d/2)^{2}}}\left(-\mathcal{K}(k(r,x+d/2)^{2}) 
    \vphantom{\frac{a^{2}+r^{2}+(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}} % to size the ( correctly
    \right.\right. \nonumber \\
    & \left.\left. +\frac{a^{2}+r^{2}+(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)
    \vphantom{\frac{x-d/2}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}} % to size the ] correctly
    \right].
    \end{align}
\end{subequations}

\end{document}

在此处输入图片描述

您还可以添加一些内容\hspace来突出“内部”括号的第二行:

\documentclass{article}

\usepackage{amssymb,amsmath}

\begin{document}

\begin{subequations}\label{eqn:MagneticField3D}

    \begin{align}
        B_{x}(r,x) = & \frac{N I \mu_{0}}{2\pi}\left[\frac{1}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}\left(\mathcal{K}(k(r,x-d/2)^{2}) 
        \vphantom{\frac{a^{2}-r^{2}-(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}} % to size the ( correctly
        \right.\right. \nonumber \\
        & \hspace{1cm} \left.\left. +\frac{a^{2}-r^{2}-(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right) \right. \nonumber \\
       & \left. -\frac{1}{\sqrt{(a+r)^{2}+(x+d/2)^{2}}}\left(\mathcal{K}(k(r,x+d/2)^{2}) 
       \vphantom{\frac{a^{2}-r^{2}-(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}} % to size the ( correctly
       \right.\right. \nonumber \\
       &  \hspace{1cm} \left.\left. +\frac{a^{2}-r^{2}-(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)
       \vphantom{\frac{1}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}} % to size the ] correctly
       \right], \\
        B_{r}(r,x) = & \frac{N I \mu_{0}}{2\pi r}\left[\frac{x-d/2}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}\left(-\mathcal{K}(k(r,x-d/2)^{2}) 
        \vphantom{\frac{a^{2}+r^{2}+(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}} % to size the ( correctly
        \right.\right. \nonumber \\
            & \hspace{1cm} \left.\left. +\frac{a^{2}+r^{2}+(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right) \right. \nonumber \\
    & \left. -\frac{x+d/2}{\sqrt{(a+r)^{2}+(x+d/2)^{2}}}\left(-\mathcal{K}(k(r,x+d/2)^{2}) 
    \vphantom{\frac{a^{2}+r^{2}+(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}} % to size the ( correctly
    \right.\right. \nonumber \\
    & \hspace{1cm} \left.\left. +\frac{a^{2}+r^{2}+(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}\mathcal{E}(k(r,x-d/2)^{2})\right)
    \vphantom{\frac{x-d/2}{\sqrt{(a+r)^{2}+(x-d/2)^{2}}}} % to size the ] correctly
    \right].
    \end{align}
\end{subequations}

\end{document}

在此处输入图片描述

答案2

您可能可以将其减少到。由于剩余分数的宽度,似乎无法减少这些分数。

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}

To reduce complexity, define
\begin{align*}
  A &= \frac{N I \mu_0}{2\pi}, \\
  B &= \sqrt{(a+r)^{2}+(x-d/2)^{2}},\\
  C &= \mathcal{K}(k(r,x-d/2)^{2}), \\
  D &= \mathcal{E}(k(r,x-d/2)^{2}), \\
  E  &= \sqrt{(a+r)^{2}+(x+d/2)^{2}}, \\
  F &= \mathcal{K}(k(r,x+d/2)^{2}),
\end{align*}
\begin{subequations}\label{eqn:MagneticField3D}
  \begin{gather}
    \begin{aligned}[b]
      B_{x}(r,x)=A\Biggl(&\frac{1}{B}\Biggl(C+\frac{a^{2}-r^{2}-(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}D\Biggr)
      \\
      &-\frac{1}{E}\Biggl(F+\frac{a^{2}-r^{2}-(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}D\Biggr)\Biggr),
    \end{aligned}
    \\
    \begin{aligned}[b]
      B_{r}(r,x)=
      \frac{A}{r}\Biggl(&\frac{x-d/2}{B}\Biggl(-C+\frac{a^{2}+r^{2}+(x-d/2)^{2}}{(a-r)^{2}+(x-d/2)^{2}}D\Biggr)
      \\
      &-\frac{x+d/2}{E}\Biggl(-F+\frac{a^{2}+r^{2}+(x+d/2)^{2}}{(a-r)^{2}+(x+d/2)^{2}}D\Biggr)\Biggr).
    \end{aligned}
  \end{gather}
\end{subequations}

\end{document}

在此处输入图片描述

答案3

另一种可能性是,geometry(对于更合理的边距)和nccmath(对于中等大小的公式,~80%的 \displaystyle,以及fleqn环境):

\documentclass[a4paper]{article}
\usepackage[ showframe]{geometry}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{mathtools, nccmath}

\begin{document}

\begin{subequations}\label{eqn:MagneticField3D}
\begin{fleqn}
    \begin{gather}
\raisetag{11.5ex}
\begin{aligned}
B_{x}(r,x)= \medmath{\frac{N I \mu_{0}}{2\pi} \! \left(\frac{1}{\sqrt{(a+r)^{2}+\bigl(x-\mfrac{d}{2}\bigr)^{2}}}\Biggl(\mathcal{K}\Bigl(k\bigl(r,x-\mfrac{d}{2}\bigr)^{2}\Bigr) + \frac{a^{2}-r^{2}-\bigl(x-\mfrac{d}{2}\bigr)^{2}}{(a-r)^{2}+\bigl(x-\mfrac{d}{2}\bigr)^{2}} \mathcal{E}\Bigl(k\bigl(r,x-\mfrac{d}{2}\bigr)^{2}\Bigr)\Biggr) \right.} \\
  \medmath{-\left. \frac{1}{\sqrt{(a+r)^{2}+\bigl(x + \mfrac{d}{2}\bigr)^{2}}}\Biggl(\mathcal{K}\Bigl(k\bigl(r,x + \mfrac{d}{2}\bigr)^{2}\Bigr) + \frac{a^{2}-r^{2}-\bigl(x + \mfrac{d}{2}\bigr)^{2}}{(a-r)^{2}+\bigl(x + \mfrac{d}{2}\bigr)^{2}} \mathcal{E}\Bigl(k\bigl(r,x-\mfrac{d}{2}\bigr)^{2}\Bigr)\Biggr)\! \right)}
\end{aligned}\\[3ex]
\raisetag{11.5ex}
        \begin{aligned}B_{r}(r,x)= \medmath{\frac{N I \mu_{0}}{2\pi r} \! \left(\frac{x-\mfrac{d}{2}}{\sqrt{(a+r)^{2}+\bigl(x-\mfrac{d}{2}\bigr)^{2}}}\Biggl(-\mathcal{K}\Bigl(k\bigl(r,x-\mfrac{d}{2}\bigr)^{2}\Bigr) + \frac{a^{2}-r^{2} + \bigl(x-\mfrac{d}{2}\bigr)^{2}}{(a-r)^{2}+\bigl(x-\mfrac{d}{2}\bigr)^{2}} \mathcal{E}\Bigl(k\bigl(r,x-\mfrac{d}{2}\bigr)^{2}\Bigr)\Biggr) \right.}\\
\medmath{\left. -\frac{x + \mfrac{d}{2}}{\sqrt{(a+r)^{2}+\bigl(x + \mfrac{d}{2}\bigr)^{2}}}\Biggl(-\mathcal{K}\Bigl(k\bigl(r,x + \mfrac{d}{2}\bigr)^{2}\Bigr) + \frac{a^{2} + r^{2} + \bigl(x + \mfrac{d}{2}\bigr)^{2}}{(a-r)^{2}+\bigl(x + \mfrac{d}{2}\bigr)^{2}} \mathcal{E}\Bigl(k\bigl(r,x-\mfrac{d}{2}\bigr)^{2}\Bigr)\Biggr)\! \right)}
    \end{aligned}
    \end{gather}
\end{fleqn}
\end{subequations}

\end{document} 

在此处输入图片描述

相关内容