1

I'm currently building a table and came across an issue with texlive. I was designing my tex-template on windows with MikTex and it rendered just fine. When I rendered it on Linux using TexLive, I get an ugly double line wrap. Any Idea how to get rid of that and make the TexLive output the same as the MikTex output?

See Column Foo in the example below.

MikTex output: MikTex output

TexLive output: TexLive output

Source:

\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}
2
  • 1
    update to a newer texlive. In texlive 2021 it works, the different output is in texlive 2019. Aug 17 at 7:25
  • Ah okay. I was just using the distro default version, looking into it.
    – CShark
    Aug 17 at 7:26
3

The definition of \raggedright has changed. The newer version now changes also \finalhyphendemerits, and this means that tex no longer tries to avoid that the line before the last doesn't have an hyphen. You can correct the output in your older texlive with

\newcolumntype{L}[1]{>{\raggedright\finalhyphendemerits =0 \arraybackslash}p{#1}}
3
  • so, not my fault Aug 17 at 7:38
  • @DavidCarlisle definitly ;-) Aug 17 at 7:51
  • Ok, this is faster than installing and maintaining a manual tex environment, when I'm only using it for automated generation of documents :D
    – CShark
    Aug 17 at 8:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.