LaTeX 中长方程式的问题

LaTeX 中长方程式的问题

我正在使用以下软件包:

\usepackage{mathrsfs}
\usepackage{mathtools}
\usepackage{amsmath,latexsym}

以便写出下列等式。

\begin{eqnarray*}
\frac{\partial\mathscr{L}}{\partial(\partial_\nu A_\mu)} =-\frac{1}{4} \left[ 
\left(\frac{\partial(\partial_\sigma A_\omega)}{\partial(\partial_\nu A_\mu)}
 -\frac{\partial(\partial_\omega A_\sigma)}{\partial(\partial_\nu A_\mu)}\right)
(\partial_\alpha A_\beta-\partial_\beta A_\alpha) 
 + (\partial_\sigma A_\omega - \partial_\omega A_\sigma)
\left(\frac{\partial(\partial_\alpha A_\beta)}{\partial(\partial_\nu A_\mu)}
 -\frac{\partial(\partial_\beta A_\alpha)}{\partial(\delta_\nu A_\mu)}\right) 
\right]
\end{eqnarray*}

问题是这个公式太长,一行写不完。当我尝试在“加号”处断开它时,它不再识别最后一个\right]命令,而且我的括号没有闭合。我检查了代码几次,它似乎是正确的。

有任何想法吗?

答案1

为了完整起见,我想建议使用 的自动化解决方案breqn。它可以打破显示数学方程尊重\left\right分隔符。公式内没有任何变化的示例:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathrsfs}
\usepackage{breqn}
\begin{document}
\begin{dmath*}
\frac{\partial\mathscr{L}}{\partial(\partial_\nu A_\mu)}
  =-\frac{1}{4}\left[\left(
      \frac{\partial(\partial_\sigma A_\omega)}{\partial(\partial_\nu A_\mu)}
      -\frac{\partial(\partial_\omega A_\sigma)}{\partial(\partial_\nu A_\mu)}\right)
      (\partial_\alpha A_\beta-\partial_\beta A_\alpha) 
      + (\partial_\sigma A_\omega - \partial_\omega A_\sigma)
      \left(\frac{\partial(\partial_\alpha A_\beta)}{\partial(\partial_\nu A_\mu)}
        -\frac{\partial(\partial_\beta A_\alpha)}{\partial(\delta_\nu A_\mu)}
      \right)\right]
\end{dmath*}
\end{document}

结果模仿multline

在此处输入图片描述

答案2

对于您的长方程式来说,似乎有multlined 合适的数学环境:

\documentclass{article}
\usepackage{mathrsfs}
\usepackage{mathtools, amssymb}

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{multline*}
\frac{\partial\mathscr{L}}{\partial(\partial_\nu A_\mu)}
    = -\frac{1}{4} \left[\left(
            \frac{\partial(\partial_\sigma A_\omega)}
                 {\partial(\partial_\nu A_\mu)}
          - \frac{\partial(\partial_\omega A_\sigma)}
                 {\partial(\partial_\nu A_\mu)}\right)\right.
           (\partial_\alpha A_\beta-\partial_\beta A_\alpha)        \\
      + (\partial_\sigma A_\omega - \partial_\omega A_\sigma)
        \left.\left(
            \frac{\partial(\partial_\alpha A_\beta)}
                 {\partial(\partial_\nu A_\mu)}
          - \frac{\partial(\partial_\beta A_\alpha)}
                 {\partial(\delta_\nu A_\mu)}\right)\right]
    \end{multline*}
\end{document}

在此处输入图片描述

(红线表示文本边框)

答案3

你写了,

我检查了代码几次,它似乎是正确的。

事实上,不是正确:TeX 语法规则不允许\left[...\right]组内换行。解决方案是不要首先使用\leftand 。而是使用and 。\right\biggl[\biggr]

这是一个使用align*环境的解决方案——不要使用严重弃用的eqnarray*环境 -- 并重新排列第二行中的乘法项,以便可以与第一行中的相应项对齐。并且,所有自动调整大小指令都已替换为显式调整大小指令\biggl\biggr

在此处输入图片描述

\documentclass{article}
\usepackage{mathrsfs}  % for '\mathscr' macro
\usepackage{mathtools}
\usepackage{%amsmath, % is loaded automatically by 'mathtools' package
            amssymb}   % not 'latexsym'!

\begin{document}

\begin{align*}
\frac{\partial\mathscr{L}}{\partial(\partial_\nu A_\mu)}
=-\frac{1}{4} \biggl[ 
&\biggl(\frac{\partial(\partial_\sigma A_\omega)}{\partial(\partial_\nu A_\mu)}
-\frac{\partial(\partial_\omega A_\sigma)}{\partial(\partial_\nu A_\mu)}\biggr)
(\partial_\alpha A_\beta-\partial_\beta A_\alpha)\\
{}+{} % make '+' act like a binary, not unary, operator
&\biggl(\frac{\partial(\partial_\alpha A_\beta)}{\partial(\partial_\nu A_\mu)}
-\frac{\partial(\partial_\beta A_\alpha)}{\partial(\delta_\nu A_\mu)}\biggr)
(\partial_\sigma A_\omega - \partial_\omega A_\sigma) 
\biggr]
\end{align*}
\end{document}

相关内容