我希望等式的右边被适当大小的方括号包围。
如何让括号包含多行而不破坏对齐?
无法编译的最少代码:
\documentclass[
paper=a4,
oneside,
fontsize=13pt,
headsepline=.5pt,
numbers=noenddot,
parskip=half,
captions=tableheading,
DIV=12,
toc=bibliography,
final
]{scrartcl}
\usepackage{amsmath, amsfonts}
\begin{document}
\begin{equation}
\begin{aligned}
\vec{\nabla} = \left[ &\frac{\partial}{\partial x_1} \\
&\frac{\partial}{\partial x_2} \\
&\frac{\partial}{\partial x_3} \right]
\end{aligned}
\end{equation}
\end{document}
这会出现以下错误:
! Extra }, or forgotten \right.
<template> }
$\endtemplate
l.17 \vec{\nabla} \left[ &
\frac{\partial}{\partial x_1} \\
?
! Missing \right. inserted.
<inserted text>
\right .
l.17 \vec{\nabla} \left[ &
\frac{\partial}{\partial x_1} \\
?
! Missing } inserted.
<inserted text>
}
l.17 \vec{\nabla} \left[ &
\frac{\partial}{\partial x_1} \\
?
! Missing } inserted.
<inserted text>
}
l.19 ... &\frac{\partial}{\partial x_3} \right
]
?
! Extra \right.
l.19 ... &\frac{\partial}{\partial x_3} \right]
?
! Missing { inserted.
<inserted text>
{
l.20 \end{aligned}
?
答案1
您应该放置\left.
并\right]
外部环境aligned
。
\documentclass[paper=a4,oneside,fontsize=13pt,
headsepline=.5pt,numbers=noenddot,parskip=half,
captions=tableheading,DIV=12,toc=bibliography,
final]{scrartcl}
\usepackage{amsmath, amssymb}
\begin{document}
\begin{equation}
\left.
\begin{aligned}
\vec{\nabla} &\frac{\partial}{\partial x_1} \\
&\frac{\partial}{\partial x_2} \\
&\frac{\partial}{\partial x_3}
\end{aligned}
\right]
\end{equation}
\end{document}
但是,我怀疑您实际上根本不想使用环境aligned
。您不是只想排版一个用方括号括起来的列向量吗?如果是这样,那么bmatrix
环境就是最佳选择。
\documentclass[paper=a4,oneside,fontsize=13pt,
headsepline=.5pt,numbers=noenddot,parskip=half,
captions=tableheading,DIV=12,toc=bibliography,
final]{scrartcl}
\usepackage{amsmath, amssymb}
\begin{document}
\begin{equation}
\renewcommand\arraystretch{1.25}
\vec{\nabla}=
\begin{bmatrix}
\frac{\partial}{\partial x_1} \\
\frac{\partial}{\partial x_2} \\
\frac{\partial}{\partial x_3}
\end{bmatrix}
\end{equation}
\end{document}