表格中的逐项不再起作用

表格中的逐项不再起作用

我是这个论坛的新手(对于 LaTeX 也比较陌生)。

昨天晚上将 MiKTeX 升级到最新版本后,我无法编译包含或环境\begin{itemize} ... \end{itemize}内的构造的文档。tabularytabularx

\documentclass[fontsize=11pt, paper=a4, twoside, headinclude, footinclude, headsepline, footsepline, BCOR=5mm]{scrreprt}
\usepackage[lmargin=2.5cm,rmargin=2.5cm,tmargin=2.5cm,bmargin=3.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english,ngerman]{babel}
\usepackage{tabularx}
\usepackage{tabulary}
\setlength{\tymin}{50pt}
\setlength{\tymax}{\linewidth}

\begin{document}
\begin{table}[hbt!]
\captionabove{Test Table}
\label{tab:Test Table}
\centering
    \begin{tabulary}{\textwidth}{LL}
%    \begin{tabularx}{\textwidth}{XX}
    \rowcolor{black!90}
    \toprule
    \color{white}\textbf{Column 1} & \color{white}\textbf{Column 2}\\
    \midrule
    Col 1 / Row 1 & Col 2 / Row 1:
            \begin{itemize}
                \item Item 1 with a long text which must be wrapped into the next line
                \item Item 2 with a long text which must be wrapped into the next line
            \end{itemize}\\
    \hline
    Col 1 / Row 2 & Col 2 / Row 2\\
    \hline
    Col 1 / Row 3 & Col 2 / Row 3 and again, a column with a long text which must be wrapped into the next line\\
    \hline
    Col 1 / Row 4 & Col 2 / Row 4\\
    \bottomrule
%    \end{tabularx}
    \end{tabulary}
\end{table}
\end{document}

错误消息如下tabulary

Zeile 35: Undefined control sequence \end{tabulary}
...
Zeile 35: Something's wrong--perhaps a missing \item. \end{tabulary}
...
Zeile 35: Undefined control sequence \end{tabulary}

因为tabularx它们是:

Zeile 34: Undefined control sequence \end{tabularx}
....
Zeile 34: Undefined control sequence \end{tabularx}

在升级到最新版本之前,一切都很好(已测试tabularx)。有人能告诉我为什么它不再工作了吗?或者这是一个错误吗?

答案1

嗯,对我来说,您的示例已经(毫不奇怪地)因未定义的\rowcolor, \color,而受阻\toprule。您确定您确实测试了此代码吗?

无论如何:查看的代码,tabulary我会说列表在的 LCRJ 列中不起作用tabulary。此类单元格的内容首先在 l 类型的列中处理,并且不允许使用列表。这不是新情况:tabulary最近没有改变。

tabularx应该可以正常工作(如果我添加了您示例中所有缺失的包,那么在最新的 miktex 中它对我来说也可以正常工作)。

相关内容