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 have a \sidewaystable that is also a \threeparttable. I'm trying to produce it using booktabs. In the shape columns there are words with more than 8 letters that TeX keeps hyphenating. The column widths have been set to their current values to ensure that the entire table fits on an A4 page.

Whether or not I include the \noalign{smallskip} after the \toprule and \midrule I get the error:

! Misplaced \cr.
\reserved@c ->\ifnum 0=`{}\fi \cr 

l.34 \toprule
             \noalign{smallskip}
? 

Here is an example

\documentclass[12pt,a4paper,openleft,draft]{report}
\usepackage[lmargin=4.0cm, rmargin=2.5cm,tmargin=3cm,bmargin=2.5cm]{geometry}
\usepackage{natbib}
\usepackage{mathpazo}    
\usepackage{overpic}
\usepackage[margin=10pt,font=small,labelfont=bf,labelsep=period,singlelinecheck=false]{caption}
\usepackage{threeparttable}
\usepackage{rotating}
\usepackage{units}
\usepackage{sectsty}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{setspace}
\usepackage{url}
\usepackage[english]{babel}
\usepackage{booktabs}
\usepackage{slantsc}
\usepackage{amsmath}
\usepackage{MnSymbol}
\usepackage{array}


\begin{document}

\begin{sidewaystable}[htp]
\begin{scriptsize}
\begin{center}
\caption{Key morphological characteristics}
\label{tab:cycadnmorph}
\begin{threeparttable}
\begin{tabular}
{>{\raggedright}p{3.05cm}>{\raggedright}p{0.6cm}>{\raggedright}p{1.5cm}>{\raggedright}p{2cm}>{\raggedright}p{1.75cm}>{\raggedright}p{1.75cm}>{\raggedright}p{0.25cm}>{\raggedright}p{2cm}>{\raggedright}p{1.5cm}>{\raggedright}p{1.75cm}>{\raggedright}p{1.75cm}}}
\tabularnewline
\toprule\noalign{smallskip}
&&C&&&&&H&&&\tabularnewline
\cmidrule{3-6}
\cmidrule{8-11}
Species&OTU\tnote{a}&Cells\tnote{b}&Shape&Length\tnote{c}&Width\tnote{c}&&Shape&(\%)\tnote{d}&Length\tnote{c}&Width\tnote{c}\tabularnewline
\midrule\noalign{smallskip}
\emph{species name}&A&number (min, max)&Shape&number (min, max)&number (min, max)&&Shape Bigshape biggershape&number (min, max)&number (min, max)&number (min, max)\tabularnewline
\emph{species name}&A&number (min, max)&Shape&number (min, max)&number (min, max)&&Shape Bigshape biggershape&number (min, max)&number (min, max)&number (min, max)\tabularnewline
\emph{species name}&A&number (min, max)&Shape&number (min, max)&number (min, max)&&Shape Bigshape biggershape&number (min, max)&number (min, max)&number (min, max)\tabularnewline
\emph{species name}&A&number (min, max)&Shape&number (min, max)&number (min, max)&&Shape Bigshape biggershape&number (min, max)&number (min, max)&number (min, max)\tabularnewline
\bottomrule
\end{tabular}
\begin{tablenotes}
\item [a] Data adapted.
\item [b] ND, no data.
\item [c] Accession numbers
\item[d] D
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{scriptsize}
\end{sidewaystable}



\end{document} 
share|improve this question

1 Answer 1

up vote 3 down vote accepted

The command to use is \addlinespace; you have also a wrong }:

\begin{threeparttable}
\begin{tabular}{
  >{\raggedright}p{3.05cm}
  >{\raggedright}p{0.6cm}
  >{\raggedright}p{1.5cm}
  >{\raggedright}p{2cm}
  >{\raggedright}p{1.75cm}
  >{\raggedright}p{1.75cm}
  >{\raggedright}p{0.25cm}
  >{\raggedright}p{2cm}
  >{\raggedright}p{1.5cm}
  >{\raggedright}p{1.75cm}
  >{\raggedright}p{1.75cm}
}
\toprule\addlinespace[\smallskipamount]

However, I don't think that adding such a space is needed.

There are other points where your code can be improved. For example, defining

\newcolumntype{P}[1]{>{\raggedright}p{#1}}

in the preamble, your tabular preamble can be reduced to

\begin{tabular}{
  P{3.05cm}
  P{0.6cm}
  P{1.5cm}
  P{2cm}
  P{1.75cm}
  P{1.75cm}
  P{0.25cm}
  P{2cm}
  P{1.5cm}
  P{1.75cm}
  >{\arraybackslash}P{1.75cm}
}

so that you're not required to use \tabularnewline for ending table rows.

The table enclosure can be more simply

\begin{sidewaystable}[htp]
\caption{Key morphological characteristics}
\label{tab:cycadnmorph}
\centering\scriptsize
\begin{threeparttable}
...<the tabular>...
\begin{tablenotes}
\item [a] Data adapted.
\item [b] ND, no data.
\item [c] Accession numbers
\item[d] D
\end{tablenotes}
\end{threeparttable}
\end{sidewaysttable}
share|improve this answer
    
Replacing \noalign{smallskip} with \addlinespace does not remove the error message regarding \toprule. Any further suggestions? –  Will Mar 28 '12 at 9:24
    
@Will See the edited answer: you also had a wrong } (and the first \tabularnewline was out of place). –  egreg Mar 28 '12 at 9:33
    
Apologies for not properly checking your answer. It worked brilliantly. –  Will Mar 28 '12 at 9:42

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.