如何将多行方程式中除第一行之外的所有内容左对齐并缩进?

如何将多行方程式中除第一行之外的所有内容左对齐并缩进?

我正在尝试在双列文档中拆分方程,使第一行向左对齐,所有其他行都缩进并在两点对齐。到目前为止,我得到的最接近的方法是下面显示的秘诀,使用 2 个对齐环境。我该如何正确完成此操作?

另外,我怎样才能减少第一个和第二个对齐点之间的空间(例如,在方程式最后一行的“+”号之前)?理想情况下,我想让方程式编号适合最后一行。

谢谢并问候,豪尔赫。

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{showframe}
\usepackage{etoolbox}
\newlength\Fcolumnseprule
\setlength\Fcolumnseprule{0.4pt}
\makeatletter
\newcommand\ShowInterColumnFrame{
\patchcmd{\@outputdblcol}
  {{\normalcolor\vrule \@width\columnseprule}}
  {\vrule \@width\Fcolumnseprule\hfil
    {\normalcolor\vrule \@width\columnseprule}
    \hfil\vrule \@width\Fcolumnseprule
  }{}{}}
\makeatother
\ShowInterColumnFrame

\begin{document}

\noindent{}This kind of works:

\begin{flalign*}
&V_{R}\cdot\overline{B}_{rec}&\notag\\
\end{flalign*}
\vspace{-30pt}
\begin{flalign}
&&&=V_{R}\cdot\overline{B}_{f}&&{+}\left(V_{R}\cdot\overline{B}_{b}\right)/A_{rec} &\notag\\
&&&=v_{IN}+q_{n,f}&&{+}\frac{\Sigma_{i}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{rec}} &\notag\\
&&&=v_{IN}+\left(1{-}\frac{a_{1}}{A_{rec}}\right)q_{n,f}&&{+}\frac{\Sigma_{i\neq{}1}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{rec}} &
\end{flalign}

\noindent{}This definitely doesn't:

\begin{flalign}
V_{R}\cdot\overline{B}_{rec}\notag\\
&=V_{R}\cdot\overline{B}_{f}&&{+}\left(V_{R}\cdot\overline{B}_{b}\right)/A_{rec} &\notag\\
&=v_{IN}+q_{n,f}&&{+}\frac{\Sigma_{i}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{rec}} &\notag\\
&=v_{IN}+\left(1{-}\frac{a_{1}}{A_{rec}}\right)q_{n,f}&&{+}\frac{\Sigma_{i\neq{}1}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{rec}} &
\end{flalign}

\end{document}

结果:

在此处输入图片描述

更新:

(1) 非常感谢大家的回复;现在很明显,除了 之外,最好的实现方法是使用其他环境\align

(2)在我的实际文档代码(使用 ieeetran 类)中插入 egreg 的解决方案后,方程式编号垂直居中显示(见下文)……有什么想法可以强制它与方程式底部对齐吗?

在此处输入图片描述

答案1

也许您正在寻找\lefteqn(隐藏宽度)和alignedat

\documentclass[twocolumn]{article}
\usepackage{amsmath}

%% just for the example
\usepackage{showframe}
\usepackage{etoolbox}
\newlength\Fcolumnseprule
\setlength\Fcolumnseprule{0.4pt}
\makeatletter
\newcommand\ShowInterColumnFrame{
\patchcmd{\@outputdblcol}
  {{\normalcolor\vrule \@width\columnseprule}}
  {\vrule \@width\Fcolumnseprule\hfil
    {\normalcolor\vrule \@width\columnseprule}
    \hfil\vrule \@width\Fcolumnseprule
  }{}{}}
\makeatother
\ShowInterColumnFrame
%%

\begin{document}

This should be what you want; remember not leaving
blank lines before displays:
\begin{equation}
\begin{alignedat}{2}
\lefteqn{V_{R}\cdot\overline{B}_{\mathrm{rec}}}\;\;\\
&=V_{R}\cdot\overline{B}_{f}
  &&+\left(V_{R}\cdot\overline{B}_{b}\right)/A_{\mathrm{rec}}\\
&=v_{IN}+q_{n,f}
  &&+\frac{\sum_{i}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{\mathrm{rec}}}\\
&=v_{IN}+\left(1{-}\frac{a_{1}}{A_{\mathrm{rec}}}\right)q_{n,f}
  &&+\frac{\sum_{i\neq{}1}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{\mathrm{rec}}}
\end{alignedat}
\end{equation}

\end{document}

我将和中的所有rec下标都改为,这似乎更合适。\mathrm{rec}\Sigma\sum

在此处输入图片描述

如果要强制数字在适合显示时位于底线,请使用\begin{aligned}[b]{2}

\documentclass{IEEEtran}
\usepackage{amsmath}
\usepackage{newtxtext,newtxmath}

\usepackage{lipsum}

\begin{document}

This should be what you want; remember not leaving
blank lines before displays:
\begin{equation}
\begin{alignedat}[b]{2}
\lefteqn{V_{R}\cdot\overline{B}_{\mathrm{rec}}}\;\;\\
&=V_{R}\cdot\overline{B}_{f}
  &&+\left(V_{R}\cdot\overline{B}_{b}\right)/A_{\mathrm{rec}}\\
&=v_{IN}+q_{n,f}
  &&+\frac{\sum_{i}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{\mathrm{rec}}}\\
&=v_{IN}+\left(1{-}\frac{a_{1}}{A_{\mathrm{rec}}}\right)q_{n,f}
  &&+\frac{\sum_{i\neq{}1}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{\mathrm{rec}}}
\end{alignedat}
\end{equation}
\lipsum

\end{document}

在此处输入图片描述

答案2

使用与您类似的方法但使用较少的&s,您可以创建类似以下内容:

\documentclass[twocolumn]{article}

\usepackage{amsmath,showframe,etoolbox}
\newlength\Fcolumnseprule
\setlength\Fcolumnseprule{0.4pt}
\makeatletter
\newcommand\ShowInterColumnFrame{
\patchcmd{\@outputdblcol}
  {{\normalcolor\vrule \@width\columnseprule}}
  {\vrule \@width\Fcolumnseprule\hfil
    {\normalcolor\vrule \@width\columnseprule}
    \hfil\vrule \@width\Fcolumnseprule
  }{}{}}
\makeatother
\ShowInterColumnFrame

\begin{document}
\noindent
This works but might lead to problems:
\begin{flalign}
  V_R \cdot \overline{B}_\mathrm{rec}\hspace{-3.5em}&\notag\\
  & = V_{R}\cdot\overline{B}_{f}
    &&+ \left(V_{R}\cdot\overline{B}_{b}\right)/A_\mathrm{rec}\notag\\
  & = v_{IN}+q_{n,f}
    &&+\frac{\Sigma_{i}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_\mathrm{rec}}\notag\\
  & = v_{IN}+\left(1{-}\frac{a_{1}}{A_\mathrm{rec}}\right)q_{n,f}
    &&+\frac{\Sigma_{i\neq{}1}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_\mathrm{rec}}
\end{flalign}
\end{document}

在此处输入图片描述

答案3

在此处输入图片描述

\sum请注意\Sigma,这也允许限制样式占用较少的水平空间。

\documentclass[twocolumn]{article}
\usepackage{amsmath,mathtools}
\usepackage{showframe}
\usepackage{etoolbox}
\newlength\Fcolumnseprule
\setlength\Fcolumnseprule{0.4pt}
\makeatletter
\newcommand\ShowInterColumnFrame{
\patchcmd{\@outputdblcol}
  {{\normalcolor\vrule \@width\columnseprule}}
  {\vrule \@width\Fcolumnseprule\hfil
    {\normalcolor\vrule \@width\columnseprule}
    \hfil\vrule \@width\Fcolumnseprule
  }{}{}}
\makeatother
\ShowInterColumnFrame

\begin{document}

This?
\begin{equation}
\begin{multlined}
V_{R}\cdot\overline{B}_{\mathrm{rec}}\\
\,\begin{alignedat}{2}
&=V_{R}\cdot\overline{B}_{f}&&+(V_{R}\cdot\overline{B}_{b})/A_{\mathrm{rec}} \\
&=v_{IN}+q_{n,f}&&+\dfrac{\sum\limits_{i}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{\mathrm{rec}}} \\
&=v_{IN}+\bigl(1{-}\dfrac{a_{1}}{A_{\mathrm{rec}}}\bigr)q_{n,f}&&+\dfrac{\sum\limits_{i\neq{}1}a_{i}(-q_{n,f})^{i}+q_{n,b}}{A_{\mathrm{rec}}} 
\end{alignedat}
\end{multlined}
\end{equation}

\end{document}

相关内容