Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using tabu to create a table that has a couple multi-line cells (the m style). However, when I set the line spacing outside the table, it seems that the space between lines is not recalculated in the table, and when I make the font small, the spacing is too large:

\documentclass{article}
\usepackage{tabu} 

\begin{document}

\linespread{1.5}\selectfont

\noindent
\begin{tabu}{|X[m,c]|X[-2,m,c]|X[m,c]|}
    {\scriptsize Line 1 \linebreak too much space here} &
    {\Huge Title} &
    Right side \linebreak Line 1 \linebreak and line 2
\end{tabu}

A normal paragraph: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

\end{document}

Putting another \linespread inside the table doesn't change anything. How can I solve this?

share|improve this question
    
I think you need to add a \par at the end. You can see the same effect outside of tabular it you enclose the last paragraph in a {}, and change the \linespread inside it. Unless there is a \par the changes inside won't have any effect. –  Peter Grill Oct 3 '12 at 2:05
    
@PeterGrill Forgot to mention in my question but I tried that, and it works, but it adds an extra space after the text (which is undesirable). –  jtbandes Oct 3 '12 at 5:01

1 Answer 1

up vote 7 down vote accepted

The line spacing is set at the end of the paragraph. If the text is put into group braces, before the end of the paragraph is reached, then the line spacing before the group is used.

\documentclass{article}
\usepackage{tabu}

\begin{document}

\linespread{1.5}\selectfont

\noindent
\begin{tabu}{|X[m,c]|X[-2,m,c]|X[m,c]|}
    \scriptsize Line 1 \linebreak too much space here &
    \Huge Title &
    Right side \linebreak Line 1 \linebreak and line 2
\end{tabu}

A normal paragraph: Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

\end{document}

Result

Or with \linespread{1} inside the table cells:

\documentclass{article}
\usepackage{tabu}

\begin{document}

\linespread{1.5}\selectfont

\noindent
\begin{tabu}{|X[m,c]|X[-2,m,c]|X[m,c]|}
    \linespread{1}\selectfont
    \scriptsize Line 1 \linebreak too much space here &
    \Huge Title &
    \linespread{1}\selectfont
    Right side \linebreak Line 1 \linebreak and line 2
\end{tabu}

A normal paragraph: Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat.

\end{document}

Result

share|improve this answer
1  
Thanks, this works great! It made me realize that I didn't even want to change the linespread in my table, I just needed to remove the {}. –  jtbandes Oct 3 '12 at 5:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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