latex 图表标题加入矩阵

矩阵在图表标题中出现会出现错误,因为 ‘\\’ 在这里是不能够被使用的。所以就需要一个额外的命令

\protect

\caption{
This is a matrix
\left(\protect\begin{array}{cc}
  1 & 1    \protect\\
  2 & 2 
\protect\end{array}\right)
}

在\begin,\end,\\, 这三个符号前加入\protect,这样就可以了。

猜你喜欢

转载自www.cnblogs.com/qinghev/p/10807724.html