arydshln 与 tabu 和 X 列类型冲突吗?

arydshln 与 tabu 和 X 列类型冲突吗?
\documentclass{article}
\usepackage{tabu}
\usepackage{arydshln}

\begin{document}
\begin{table}
\begin{tabu}{l X}
a & b
\end{tabu}
\end{table}
\end{document}

这让我一遍又一遍地出现以下两个错误信息:

! Missing \cr inserted.
<inserted text> 
                \cr 
l.10 \end{tabu}

I'm guessing that you meant to end an alignment here.

! Misplaced \cr.
<inserted text> \cr 

l.10 \end{tabu}

I can't figure out why you would want to use a tab mark
or \cr or \span just now. If something like a right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.

如果我执行以下操作之一,错误就会消失:

  • 将列更改Xl
  • 消除\usepackage{arydhsln}

但是,我有一个很大的文档,其中某些部分使用了很多tabu X列,并且在其他地方绘制复杂(不是意义上的)数学矩阵时我需要arydshln该命令。\hdashlinesqrt(-1)

这场冲突能解决吗?如何解决?

答案1

您必须交换加载顺序,因为tabu会修改一些内部arydshln用途(如文档第 9 节所述)。

\documentclass{article}
\usepackage{arydshln}
\usepackage{tabu}

\begin{document}
\begin{table}
\begin{tabu}{l X}
a & b
\end{tabu}
\end{table}
\end{document}

相关内容