3

How can the same text in different tabular cells with the same width get hyphenated in a different way?

\documentclass[11pt]{article}
\usepackage{multirow}
\usepackage[ngerman]{babel}
\begin{document}
\begin{tabular}{|p{6em}|p{12em}|p{7.5em}|}
\hline
\multirow[t]{3}{=}{Uebergang zum Regelbetrieb}
   & Anzahl Leerfahrten
      & \multirow[t]{3}{=}{Statistische Auswertung, ggf. Simulation} \\
   & Gefahrene Leerkilometer
      & \\
   & Anzahl der Personal- und Fahrzeugwechsel
      & \\
\hline
Auswirkung auf anderen Bahnverkehr
   & Streuung von Verspaetungen auf eigentlich nicht betroffene Linien
      & Statistische Auswertung, ggf. Simulation\\
\hline
\end{tabular}
\end{document}

The result looks really odd:

enter image description here

Since I'm using multirow (version 2.1), this seems to cause the effect. How can one avoid this?

1
  • 1
    I have minimized the code and made it self-contained. I have no answer (yet), but with the minimized code the chances are higher that someone else picks up the challenge.
    – gernot
    Nov 29, 2016 at 9:12

1 Answer 1

2

This is because your "normal" cell uses full justification (which actually is undesirable for such a narrow text). And \multirow uses \raggedright, so this gives a different hyphenation.

Actually, the multirow setup can be changed. Like if you remove the `\raggedright, you will get the same in both cells. Do this with

\renewcommand{\multirowsetup}{}

The alternative (which I think is better) is to also use \raggedright in the other cells.

4
  • Thank you very much! Actually, this is part of a longtable, thus, using raggedright or RaggedRight might get a little bit complicated. Is there any way to do this for singular cells within longtable? I don't want to exchange my longtable environment for LTXtable (other difficulties then).
    – D. Duesen
    Nov 29, 2016 at 10:14
  • 1
    For a single cell, use {\raggedright Statistische Auswertung, ggf. Simulation\par}. Even for longtable you can use a column specifier of >{\raggedright\arraybackslash}p{7.5em} if you also have \usepackage{array}. Nov 29, 2016 at 10:23
  • Thanks a lot, the column specifier worked very well! RaggedRight was also possible, just for some reason it would not be allowed using P columns defined as '\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash\hspace{0pt}}p{#1}}'. That's why I thought of using LTXtable in the first place.
    – D. Duesen
    Nov 29, 2016 at 11:37
  • 1
    Put the \hspace{0pt} before the \arraybackslash. Nov 29, 2016 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .