In my document i am using a \linespread{1.5}
for the whole document, but I would like to have a \linespread{1}
for tables and long tables. How can I change it?
1 Answer
The following shows different values of \baselinestretch
applying to text and longtables within the same page:
\documentclass{article}
\usepackage{longtable}
\def\a{One two three four five six. }
\def\b{\a\a\par Red green blue. \a\a\a\par Yellow black \a\a\a\a}
\begin{document}
111! \b
\renewcommand\baselinestretch{2.5}\selectfont
222! \b
\begin{longtable}{|l|c|r|}
\hline
aaa aa aa aaa a a a&1&bbbbbbbbbbbbbb\\
aaaaaaaaaaaaaaa&1&bbbb\\
aaaaaaaaaaa&1234567890&bbbbb b b b b bbbbbbbbbbb\\
\hline
\end{longtable}
\b
\renewcommand\baselinestretch{1}\selectfont
111!
\begin{longtable}{|l|c|r|}
\hline
aaa aa aa aaa a a a&1&bbbbbbbbbbbbbb\\
aaaaaaaaaaaaaaa&1&bbbb\\
aaaaaaaaaaa&1234567890&bbbbb b b b b bbbbbbbbbbb\\
\hline
\end{longtable}
\renewcommand\baselinestretch{2.5}\selectfont
222!
\b\b\b
\end{document}
\renewcommand\linespread{1}
before the table (You might want to look at thesetspace
package which takes care of some issues with line spacing. (Of course don't do this at all unless absolutely forced by submission rules, it hardly ever improves the look of the document)