pmatrix 的问题

pmatrix 的问题

我正在尝试按如下方式使用 pmatrix:

\begin{equation}\label{Eq.11}
J =
\begin{pmatrix}
  \frac{\partial c_{1}(t+1)}{\partial c_{1}(t)} & \frac{\partial c_{1}(t+1)}{\partial c_{2}(t)} & \cdots & \frac{\partial c_{1}(t+1)}{\partial c_{L}(t)} \\
  \frac{\partial c_{2}(t+1)}{\partial c_{1}(t)} & \frac{\partial c_{2}(t+1)}{\partial c_{2}(t)} & \cdots & \frac{\partial c_{2}(t+1)}{\partial c_{L}(t)} \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  \frac{\partial c_{L}(t+1)}{\partial c_{1}(t)} & \frac{\partial c_{L}(t+1)}{\partial c_{2}(t)} & \cdots & \frac{\partial c_{L}(t+1)}{\partial c_{L}(t)} 
 \end{pmatrix}.
\end{equation}

出现以下错误:

! Extra \right.\endpmatrix -> \endmatrix \right ) \end{pmatrix}
! Missing $ inserted.<inserted text>$ \end{pmatrix}
! Missing } inserted.<inserted text>} \end{pmatrix}
! You can't use `\eqno' in math mode.\endmathdisplay@a ...\df@tag \@empty \else \veqno\alt@tag \df@tag \fi \ifx ... \end{equation}
! Missing \right. inserted.<inserted text>\right . \end{equation}
! Missing \endgroup inserted.<inserted text>\endgroup \end{equation}

该代码在其他文档中运行良好,但我正在处理的最后一个文档由多个文件组成,每个文件代表文档中的一个章节。

任何建议都将不胜感激。

谢谢

答案1

请随时发帖完全的产生错误的文档。特别是,它允许您检查您发布的片段是否确实产生了错误。问题中的片段不会产生错误,而且错误消息也不是完整的 TeX 错误消息。

然而我猜你的真实文档是这样的,它会产生类似的错误,这里我展示了完整的 TeX 错误,它比过滤视图更具信息性:

\documentclass{article}

\usepackage{amsmath}
\begin{document}

$\left(     % unfinished math expression
\begin{equation}\label{Eq.11}
J =
\begin{pmatrix}
  \frac{\partial c_{1}(t+1)}{\partial c_{1}(t)} & \frac{\partial c_{1}(t+1)}{\partial c_{2}(t)} & \cdots & \frac{\partial c_{1}(t+1)}{\partial c_{L}(t)} \\
  \frac{\partial c_{2}(t+1)}{\partial c_{1}(t)} & \frac{\partial c_{2}(t+1)}{\partial c_{2}(t)} & \cdots & \frac{\partial c_{2}(t+1)}{\partial c_{L}(t)} \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  \frac{\partial c_{L}(t+1)}{\partial c_{1}(t)} & \frac{\partial c_{L}(t+1)}{\partial c_{2}(t)} & \cdots & \frac{\partial c_{L}(t+1)}{\partial c_{L}(t)} 
 \end{pmatrix}.
\end{equation}

\end{document}

出现以下错误(在 TeX 中总是首先查看第一个错误,因为在这种情况下,所有后续错误都是虚假的)

! LaTeX Error: Bad math environment delimiter.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.7 \begin{equation}
                    \label{Eq.11}
? 
! You can't use `\eqno' in math mode.
\endmathdisplay@a ...\df@tag \@empty \else \veqno 
                                                  \alt@tag \df@tag \fi \ifx ...
l.15 \end{equation}

? 
! Missing \endgroup inserted.
<inserted text> 
                \endgroup 
l.15 \end{equation}

? 
! Missing \right. inserted.
<inserted text> 
                \right .
l.15 \end{equation}

? 

! LaTeX Error: \begin{document} ended by \end{equation}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.15 \end{equation}

相关内容