该问题与以下内容相关:arydshln 与 tabu 和 X 列类型冲突吗?
以下内容适用于 article 类,但不适用于 memoir:
\documentclass{article}
\usepackage{arydshln}
\usepackage{tabu}
\begin{document}
\begin{table}
\begin{tabu}{l X}
a & b
\end{tabu}
\end{table}
\end{document}
如果我更改article
为memoir
,我会重复收到以下错误:
! 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.
我的文档中需要\hdashline
来自arydshln
和X
来自的列。tabu
答案1
新的 LaTeX3 软件包tabularray
是过时包的替代品tabu
:您可以使用带有类的虚线和X
列memoir
。
\documentclass{memoir}
\usepackage{tabularray}
\begin{document}
\begin{table}
\begin{tblr}{l|[dashed]X}
\hline
a & b \\
\hline[dashed]
c & d \\
\hline
\end{tblr}
\end{table}
\end{document}
答案2
将其添加为答案,即使它没有回答问题,希望有人看到并获得足够的信息来正确调试它。
这有效,请注意-columnm
的修饰符X
。也就是说,您可能无法获得所需的功能,但它可以编译。
\documentclass{memoir}
\usepackage{arydshln}
\usepackage{tabu}
\begin{document}
\begin{table}
\begin{tabu}{l X[m]}
a & b
\end{tabu}
\end{table}
\end{document}
我只是编写了其余的组合(即 r、c、l 或 j(或 RCLJ)以及 p 和 b),只有 m 有效。