20

In my preamble I use \renewcommand{\baselinestretch}{1.5} to get "onehalf" line spacing. This works fine.

Then I started to use tnote in a threeparttable.

I changed font size to \scriptsize as I think it is big enough for the table notes. I discovered that the line spacing on the \tnote \items is to big. I found an advice in the LaTeX wikibook that line spacing in lists can be changed using \itemsep1pt \parskip0pt \parsep0pt.

Unfortunately this only works when using the setspace package. But activating this package has an impact on all table/tabular environments in that all cells have a smaller padding.

How can I avoid this impact on tables or is there another possibility to change line spacing in lists, e.g. the tnote list in a threeparttable?

The MWE:

\documentclass[a4paper,12pt]{report}
% language settings
\usepackage[english,german,ngerman]{babel}
% Specifies which font encoding LaTeX should use.
\usepackage[T1]{fontenc}   
% Allows the specification of an input encoding.
\usepackage[utf8]{inputenc}  
% define page layout
\usepackage[left=3.5cm,right=3cm,top=3cm,bottom=2.5cm]{geometry}
% line spacing
%\renewcommand{\baselinestretch}{1.5}
% to set custiom line spacing
% http://en.wikibooks.org/wiki/LaTeX/Paragraph_Formatting#Line_Spacing
\usepackage{setspace}
%\onehalfspacing
%\doublespacing
\setstretch{1.5}
% intention of a paragraph
\parindent0pt
% Prints current chapter heading and the page number in the header on each page.
\pagestyle{headings}
% Set of commands for inclusion of graphics.
\usepackage{graphicx}
\usepackage{epstopdf}
% used to control how to float figures
\usepackage{float}
% Use the harvard family of bibliographic styles.
\usepackage{harvard}
\bibliographystyle{agsm}
\citationmode{abbr} 
% used to layout source file regions
\usepackage{listings}
% euro
\usepackage[left]{eurosym}
\usepackage{enumerate}
% used for nameref
\usepackage{nameref}
\usepackage{url}
% used to define color and colors for table cells
\usepackage{color}
\usepackage{colortbl}
% color definitions
\definecolor{dunkelgrau}{rgb}{0.8,0.8,0.8}
\definecolor{hellgrau}{rgb}{0.95,0.95,0.95}
% tables of three parts.
% http://www.tex.ac.uk/CTAN/macros/latex/contrib/threeparttable/threeparttable.pdf
\usepackage{threeparttable}
% for combining cells across rows
\usepackage{multirow}
% for combining cells across columns
\usepackage{multicol}
% for using array environments.
\usepackage{array}
% for using verbatim and comment environments
\usepackage{verbatim}
% for footnotes in tables
%\usepackage{tablefootnote}
%\usepackage{footnote}
%\makesavenoteenv{tabular}
% provide a 'landscape' environment
\usepackage{lscape}
% define vcentered colum types
\newcolumntype{C}{>{$\vcenter\bgroup\hbox\bgroup}c<{\egroup\egroup$}}
\newcolumntype{L}{>{$\vcenter\bgroup\hbox\bgroup}l<{\egroup\egroup$}}
\newcolumntype{R}{>{$\vcenter\bgroup\hbox\bgroup}r<{\egroup\egroup$}}
% provide blind test with \blindtext
\usepackage{blindtext}
%-----------------------------------------------------------------------------
\begin{document}
%-----------------------------------------------------------------------------
\setlength{\extrarowheight}{2pt}
%-----------------------------------------------------------------------------
\pagenumbering{arabic}
% -----------------------------------------------------------------------------
\chapter{Chapter 1}
% -----------------------------------------------------------------------------
\section{Section 1}
% -----------------------------------------------------------------------------
\blindtext
% -----------------------------------------------------------------------------
\begin{table}
\begin{center}
\begin{threeparttable}
\begin{tabular}{|L|C|C|C|C|C|C|C|}
\hline
\rowcolor{dunkelgrau}
Head1                   & Head2     \\
\hline
first row\tnote{1}      & abcd abcd abcd        \\
\hline
second row\tnote{2}     & efgh efgh efgh        \\
\hline
third row               & ijkl ijkl ijkl        \\
\hline
\end{tabular}
\caption{Caption of table}
\label{table:labelOfTable}
\begin{tablenotes}
\item[1]{\scriptsize note 1}
\item[2]{\scriptsize note 2}
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}
% -----------------------------------------------------------------------------
\end{document}
  • 11
    So you are using both \baselinestretch and setspace? You shouldn't do that. Use only setspace with \onehalfspacing at the beginning of the document which leaves spacing of tables, footnotes etc. at 1. You can then adjust the row height of a table by using \setlength{\extrarowheight}{2pt} in the preamble. – Jörg Oct 25 '12 at 11:31
  • i already tried to abondon \baselinestretch with 1.5 and use setspace with \onehalfspace, but baselinestretch gives 'more' space between lines. why do those two commands not give same line spacing? i used \setstretch{1.5} instead of \onehalfspace and \baselinestretch, which gives the same line spacing like \baselinestretch. And \extrarowheight just adds space on top of the rows? is it possible to add space to the whole row so that the text can be valigned center? – Joysn Oct 25 '12 at 15:57
  • Yes, setting \baselinestretch to 1.5 gives more than \onehalfspacing (which is roughly equivalent to setting it to 1.2. That's because the whole idea of spacing in "multiples" (inherited from typewriters) doesn't play well with proper typesetting anyway. You can either use \doublespacing (about 1.6), or \setstretch{1.5} if that's what you really need. – Paul Stanley Oct 25 '12 at 16:29
  • 1
    I wrote a full answer. Your MWE above was not really an MWE as it included a number of packages that are not required. I removed all those in my MWE, so this should be some guidance how an MWE can look like for future questions (it makes things easier if it is as simple as possible). – Jörg Oct 26 '12 at 10:22
27

If you want to adjust the spacing of text you should avoid to change the \baselinestretch as it changes the spacing for everything in the document, including footnotes and tables, which is usually not desirable (of course, if you want that effect then \renewcommand{\baselinestretch}{1.5} is correct)

If you want a typographically pleasing result rely on the setspace package as this changes only the spacing of body text and the bibliography. As Paul Stanley noted, setting the document to \onehalfspace is less than a baselinestretch of 1.5. If you want the same effect use \setstretch{1.5}.

Now, with regards to your table there are several ways. First, do not use the center environment, but instead \centering. Second, you have specified way to many columns - your table only has two. If you a table with the same look and feel as your current one, the easiest way is to use \renewcommand{\arraystretch}{1.2} which adds space above and below each row. This document might be useful to you.

If you want an aesthetically pleasing table use the booktabs package and avoid vertical rules and horizontal rules apart from one each at the top, bottom and the head. If you do that, then \setlength{\extrarowheight}{3pt} is the best way to increase spacing and the table will look much nicer overall. The MWE below should clarify things:

\documentclass[12pt]{report}

\usepackage{setspace}
\setstretch{1.5}

\usepackage{threeparttable}
\usepackage{array}
\usepackage{booktabs}

\usepackage{blindtext}

\begin{document}

\begin{table}[ht!]
\renewcommand{\arraystretch}{1.2}
\centering% do not use the center environment
\begin{threeparttable}
\begin{tabular}{|l|c|}% you only have two columns
\hline
Head1                   & Head2     \\
\hline
first row\tnote{1}      & abcd abcd abcd        \\
\hline
second row\tnote{2}     & efgh efgh efgh        \\
\hline
third row               & ijkl ijkl ijkl        \\
\hline
\end{tabular}
\caption{Caption of table}
\begin{tablenotes}
\item[1]{\scriptsize note 1}
\item[2]{\scriptsize note 2}
\end{tablenotes}
\end{threeparttable}
\end{table}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobor-
tis facilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent
imperdiet mi nec ante.

\begin{table}\begin{table}[h!]
\centering
\setlength{\extrarowheight}{5pt}
\begin{threeparttable}
\begin{tabular}{lc}
\toprule
Head1                   & Head2     \\
\midrule
first row\tnote{1}      & abcd abcd abcd        \\
second row\tnote{2}     & efgh efgh efgh        \\
third row               & ijkl ijkl ijkl        \\
\bottomrule
\end{tabular}
\caption{A prettier Table}
\begin{tablenotes}
\item[1]{\scriptsize note 1}
\item[2]{\scriptsize note 2}
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

enter image description here

  • i removed now the horizontal rules, but i can not get rid of the vertical rules. How can i remove them? – Joysn Oct 26 '12 at 10:57
  • Remove the vertical lines here \begin{tabular}{|l|c|} – Jörg Oct 26 '12 at 10:59
  • What about \linespread ? – kalmanIsAGameChanger Feb 8 '18 at 9:29

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.