Longtable 和 TexLive 的断字问题

Longtable 和 TexLive 的断字问题

我目前正在构建一个表格,遇到了 texlive 的问题。我在 Windows 上使用 MikTex 设计了我的 tex 模板,它渲染得很好。当我在 Linux 上使用 TexLive 渲染它时,我得到了一个难看的双行换行。有什么想法可以消除这个问题并使 TexLive 输出与 MikTex 输出相同吗?

参见下面示例中的 Foo 列。

MikTex 输出: MikTex 输出

TexLive 输出: TexLive 输出

来源:

\documentclass{article}
\usepackage[a4paper,left=1cm,right=1cm,top=1cm,bottom=2cm]{geometry}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{colortbl}
\usepackage{graphicx}

\setlength{\parindent}{0em}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}

\begin{document}


\small
\begin{longtable}{L{3.2cm}L{3.5cm}L{2.5cm}L{.8cm}L{2.5cm}L{3.7cm}}
\rowcolor[gray]{.9}
& & & & & \\[-.5em]
\rowcolor[gray]{.9}
\normalsize\textbf{Blah} & \normalsize\textbf{Blub} & \normalsize\textbf{Foo} & \normalsize\textbf{Bar} & \normalsize\textbf{Baz} & \normalsize\textbf{FooBarBaz} \\ [5pt]\midrule
\endhead    

Test & Test & Test-Test-Test-Test 123 & Test & Test & Test \\

\end{longtable}

\end{document}

答案1

\raggedright 的定义已更改。新版本现在还更改了 \finalhyphendemerits,这意味着 tex 不再试图避免倒数第二行没有连字符。您可以使用以下命令在旧版 texlive 中更正输出

\newcolumntype{L}[1]{>{\raggedright\finalhyphendemerits =0 \arraybackslash}p{#1}}

相关内容