我似乎无法让括号括住等式的右侧。我收到以下错误:错误:
./review.tex:239: Extra }, or forgotten \right. [\end{split}]
./review.tex:239: Missing \right. inserted. [\end{split}]
./review.tex:239: Missing } inserted. [\end{split}]
./review.tex:239: Missing } inserted. [\end{split}]
./review.tex:239: Extra \right. [\end{split}]
./review.tex:239: Missing { inserted. [\end{split}]
./review.tex:239: Extra }, or forgotten \right. [\end{split}]
./review.tex:239: Missing \right. inserted. [\end{split}]
./review.tex:239: Missing } inserted. [\end{split}]
./review.tex:239: Missing } inserted. [\end{split}]
./review.tex:239: Extra \right. [\end{split}]
./review.tex:239: Missing { inserted. [\end{split}]
从此代码中:
\begin{equation}
\begin{split}
\left(\hat{c}_{0}^{\dagger} + \hat{c}_{1}^{\dagger})\hat{t}_{0}^{\dagger} \ket{0000}\otimes\ket{00}= \\
(- c_{0}^{\dagger} c_{1}^{\dagger} + c_{0}^{\dagger} t_{1}^{\dagger} - c_{0}^{\dagger} v_{t}^{\dagger} + c_{1}^{\dagger 2}\\
+ c_{1}^{\dagger} t_{0}^{\dagger} + \sqrt{2} c_{1}^{\dagger} v_{c}^{\dagger} + c_{1}^{\dagger} v_{t}^{\dagger} - \\
t_{0}^{\dagger} t_{1}^{\dagger} + t_{0}^{\dagger} v_{t}^{\dagger} - t_{1}^{\dagger 2} - \sqrt{2} t_{1}^{\dagger} v_{c}^{\dagger}\\
+ t_{1}^{\dagger} v_{t}^{\dagger} + \sqrt{2} v_{c}^{\dagger} v_{t}^{\dagger}\right) \ket{0000}\otimes\ket{00}
\end{split}
\end{equation}
单行语句有效--我已经测试过了。
这是工作代码,没有我需要的括号。
\begin{equation}
\begin{split}
\hat{c}_{0}^{\dagger} + \hat{c}_{1}^{\dagger})\hat{t}_{0}^{\dagger} \ket{0000}\otimes\ket{00}= \\
(- c_{0}^{\dagger} c_{1}^{\dagger} + c_{0}^{\dagger} t_{1}^{\dagger} - c_{0}^{\dagger} v_{t}^{\dagger} + c_{1}^{\dagger 2}\\
+ c_{1}^{\dagger} t_{0}^{\dagger} + \sqrt{2} c_{1}^{\dagger} v_{c}^{\dagger} + c_{1}^{\dagger} v_{t}^{\dagger} - \\
t_{0}^{\dagger} t_{1}^{\dagger} + t_{0}^{\dagger} v_{t}^{\dagger} - t_{1}^{\dagger 2} - \sqrt{2} t_{1}^{\dagger} v_{c}^{\dagger}\\
+ t_{1}^{\dagger} v_{t}^{\dagger} + \sqrt{2} v_{c}^{\dagger} v_{t}^{\dagger}\ket{0000}\otimes\ket{00}
\end{split}
\end{equation}
答案1
您的内容不平衡\left
... \right
(它们必须在同一逻辑线上)。一个典型的(尽管丑陋)解决方案:
\documentclass{article}
\usepackage{amsmath,braket}
\begin{document}
\begin{equation}
\begin{split}
%\left(
(\hat{c}_{0}^{\dagger} + \hat{c}_{1}^{\dagger})\hat{t}_{0}^{\dagger} \ket{0000}\otimes\ket{00}= \\
\Bigl(- c_{0}^{\dagger} c_{1}^{\dagger} + c_{0}^{\dagger} t_{1}^{\dagger} - c_{0}^{\dagger} v_{t}^{\dagger} + c_{1}^{\dagger 2}\\
+ c_{1}^{\dagger} t_{0}^{\dagger} + \sqrt{2} c_{1}^{\dagger} v_{c}^{\dagger} + c_{1}^{\dagger} v_{t}^{\dagger} - \\
t_{0}^{\dagger} t_{1}^{\dagger} + t_{0}^{\dagger} v_{t}^{\dagger} - t_{1}^{\dagger 2} - \sqrt{2} t_{1}^{\dagger} v_{c}^{\dagger}\\
+ t_{1}^{\dagger} v_{t}^{\dagger} + \sqrt{2} v_{c}^{\dagger} v_{t}^{\dagger}
%\right)
\Bigr)
\ket{0000}\otimes\ket{00}
\end{split}
\end{equation}
\end{document}
答案2
除了 Przemysław 的答案之外,我还把它改得更漂亮一些。你根本不需要那么大的括号。如果你想使用像 这样的自动括号\left(
,你必须\right.
在同一行上用 '关闭'它。
这是我的 MWE。您甚至可以减少一行。有足够的空间使方程更宽一些:
% arara: pdflatex
\documentclass{article}
\usepackage{mathtools}
\usepackage{braket}
\newcommand*{\myStrut}{\vphantom{1}}
\begin{document}
\begin{equation}
\begin{split}
(\hat{c}_{0}^{\dagger} + \hat{c}_{1}^{\dagger})\hat{t}_{0}^{\dagger} \ket{0000}\otimes\ket{00} &= (c_{0}^{\dagger} t_{1}^{\dagger} - c_{0}^{\dagger} c_{1}^{\dagger} - c_{0}^{\dagger} v_{t}^{\dagger} + c_{1}^{\dagger\,2} + c_{1}^{\dagger} t_{0}^{\dagger} \\
&\qquad+ \sqrt{2} c_{1}^{\dagger} v_{c\myStrut}^{\dagger} + c_{1}^{\dagger} v_{t}^{\dagger} - t_{0}^{\dagger} t_{1}^{\dagger} + t_{0}^{\dagger} v_{t}^{\dagger} - t_{1}^{\dagger\,2} \\
&\qquad- \sqrt{2} t_{1}^{\dagger} v_{c\myStrut}^{\dagger} + t_{1}^{\dagger} v_{t}^{\dagger} \\
&\qquad+ \sqrt{2} v_{c\myStrut}^{\dagger} v_{t}^{\dagger}) \ket{0000}\otimes\ket{00}
\end{split}
\end{equation}
\end{document}
答案3
您可以有多行括号,按照 Sébastien Gouezel 在文档第 28-29 页上的示例mathtools
。此外,我建议根据alignedat
环境进行另一种对齐:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{mathtools} %
\usepackage{braket}
\newcommand\MTkillspecial[1]{% helper macro
\bgroup
\catcode`\&=9
\let\\\relax%
\scantokens{#1}%
\egroup
}
\DeclarePairedDelimiter\mlparen\lparen\rparen
\reDeclarePairedDelimiterInnerWrapper\mlparen{star}{
\mathopen{#1\vphantom{\MTkillspecial{#2}}\kern-\nulldelimiterspace\right.}
#2
\mathclose{\left.\kern-\nulldelimiterspace\vphantom{\MTkillspecial{#2}}#3}}
\begin{document}
\begin{equation}
\begin{alignedat}{2}
\bigr(\hat{c}_{0}^{\dagger} + \hat{c}_{1}^{\dagger}\bigr)\hat{t}_{0}^{\dagger} \ket{0000}\otimes\ket{00} & =
{}&\mlparen[\big]{& {- c_{0}}^{\dagger} c_{1}^{\dagger} + c_{0}^{\dagger} t_{1}^{\dagger} - c_{0}^{\dagger} v_{t}^{\dagger} + c_{1}^{\dagger 2} + c_{1}^{\dagger} t_{0}^{\dagger} \\
& &&\! + √{2} c_{1}^{\dagger} v_{c}^{\dagger} + c_{1}^{\dagger} v_{t}^{\dagger} - t_{0}^{\dagger} t_{1}^{\dagger} + t_{0}^{\dagger} v_{t}^{\dagger} - t_{1}^{\dagger 2} \\
& & &\! - √{2} t_{1}^{\dagger} v_{c}^{\dagger}+ t_{1}^{\dagger} v_{t}^{\dagger} + √{2} v_{c}^{\dagger} v_{t}^{\dagger}} \ket{0000}\otimes\ket{00}
\end{alignedat}
\end{equation}
\end{document}