更新时间 2019-01-14

更新时间 2019-01-14

MIKTEX 包更新后,tabu 中的垂直 m 列对齐不再起作用。请参阅下面的 MWE

\documentclass{article}
\usepackage{tabu}

\begin{document}

\tabulinesep=3pt


Result using tabu:

\begin{tabu} to \linewidth {|X[p]| X[m]| X[b]|}
    \hline
    \centering header p &
    \centering header m &   
    \centering header b \tabularnewline
    \hline
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column 
    \tabularnewline
    \hline
\end{tabu}

\vspace*{1cm}

Result using tabular:

\begin{tabular}{|p{0.3\linewidth}|m{0.3\linewidth}|b{0.3\linewidth}|}
    \hline
    \centering header p &
    \centering header m &   
    \centering header b \tabularnewline
    \hline
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column 
    \tabularnewline
    \hline
\end{tabular}


\end{document}

结果是: 具有禁忌和表格的 MWE

两个表应该相等,但 tabu 中的 m 列损坏了。有人知道哪个包是造成这种情况的原因吗?以下是已更新的包列表: 在此处输入图片描述

答案1

更新时间 2019-01-14

tabu 2.9 中包含了针对此问题的解决方法,并已提交给 ctan。


[=...tabu 可能需要更新才能匹配最新数组,但您可以使用新的可选参数强制使用旧数组\usepackage

在此处输入图片描述

\documentclass{article}
\usepackage{array}[=2016-10-06]
\usepackage{tabu}

\begin{document}

\tabulinesep=3pt


Result using tabu:

\begin{tabu} to \linewidth {|X[p]| X[m]| X[b]|}
    \hline
    \centering header p &
    \centering header m &   
    \centering header b \tabularnewline
    \hline
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column 
    \tabularnewline
    \hline
\end{tabu}

\vspace*{1cm}

Result using tabular:

\begin{tabular}{|p{0.3\linewidth}|m{0.3\linewidth}|b{0.3\linewidth}|}
    \hline
    \centering header p &
    \centering header m &   
    \centering header b \tabularnewline
    \hline
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column  & 
    text which is considerably longer than the width of the column 
    \tabularnewline
    \hline
\end{tabular}


\end{document}

相关内容