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 trying to create a list of notation, but I've been unable to use nomencl as I would like so I'm using a table. I'd like the table to split as it goes over to the second column (the working example below doesn't have enough lines to split, but you get the idea). It would be nice if when it split it would also redo the table column titles at the top of the next column as well, is there any way of doing this?

EDIT: I can see that supertabular may be the thing I need, how can I implement that code with it? It seems to not like \columnwidth and \toprule.

\documentclass[11pt, a4paper]{article}
\usepackage{multicol}
\usepackage[left=17.5mm,right=17.5mm,top=24.5mm,bottom=33.95mm]{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{supertabular}
\begin{document}
\begin{multicols*}{2}
\tablehead{\hline
Symbol&Description&Unit \hline}\\
\tabletail{\hline}\\
\begin{supertabular}{l l l}
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\

\end{supertabular}
\end{multicols*}
\end{document}

I've also tried the following to get the table widths right, but then it doesn't use the second column of multicols.

{
    p{\dimexpr.5\columnwidth-2\tabcolsep}
    >{\centering\arraybackslash}p{\dimexpr.3\columnwidth-2\tabcolsep}
    >{\raggedleft\arraybackslash}p{\dimexpr.2\columnwidth-2\tabcolsep}
    }
share|improve this question
    
tex.stackexchange.com/questions/45980/… shows how to do this if you don't want headings, otherwise you could use supertabular instead of longtable as discussed tex.stackexchange.com/questions/39686/… –  David Carlisle Mar 5 '12 at 13:57
    
I've looked at tex.stackexchange.com/questions/39686/… but I'm not really sure how I should go about implementing that with my code, I don't have a file that is called –  Andy Mar 5 '12 at 14:05
    
Edited my original question to ask about using supertabular with my code. –  Andy Mar 5 '12 at 14:14
    
possible duplicate of multicolumn long table or enumeration –  egreg Mar 5 '12 at 14:55
    
\toprule etc come from booktabs you can do without that originally and just use the standard \hline (you can fiddle with the line thickness later, supertabular* works like tabular* (rather than tabularx) to allow you to specify table width –  David Carlisle Mar 5 '12 at 14:59
show 2 more comments

1 Answer

up vote 2 down vote accepted

I suggest you to use xtab instead of supertabular, but the result should be the same:

\documentclass[11pt, a4paper]{article}
\usepackage[textheight=12cm,textwidth=18cm]{geometry}
\usepackage{multicol}
\usepackage{xtab}
\usepackage{booktabs}
\usepackage{array}

\makeatletter
\let\mcnewpage\newpage
\newcommand{\changenewpage}{%
  \renewcommand\newpage{%
    \if@firstcolumn
      \hrule width\linewidth height0pt
      \columnbreak
    \else
      \mcnewpage
    \fi
}}
\makeatother


\begin{document}
\begin{multicols*}{2}
\changenewpage
\tablehead{
\toprule
Symbol&Description&Unit\\
\midrule
}
\begin{xtabular}{
    >{\raggedright\arraybackslash}p{\dimexpr.2\columnwidth-2\tabcolsep}
    >{\raggedright\arraybackslash}p{\dimexpr.5\columnwidth-2\tabcolsep}
    >{\raggedright\arraybackslash}p{\dimexpr.3\columnwidth-2\tabcolsep}
    }
%\toprule
%Symbol&Description&Unit\\
%\midrule
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
$X$ &Description & $J\,kg^{-1}K^{-1}$ \\
\end{xtabular}
\end{multicols*}
\end{document}

The dimensions specified for geometry are just to show the example.

The \changenewpage implements the suggestion drawn from multicolumn long table or enumeration

share|improve this answer
    
That almost works perfectly for me, thank you so much for the example (and your patience with my questions). It breaks to the next column in the correct place, but it seems to break from the second column to the next page a bit early, what do I need to change to alter this position? Thanks :) –  Andy Mar 5 '12 at 16:35
    
To elaborate a little, if you triple the table length by copy and pasting $X$ &Description & $J\,kg^{-1}K^{-1}$ \` with \usepackage[left=17.5mm,right=17.5mm,top=24.5mm,bottom=33.95mm]{geometry}` then it acts as if the bottom margin is higher than it is actually set. –  Andy Mar 5 '12 at 16:50
    
@Andy It happens that supertabular and xtabular (which is defined in terms of the former) overestimate the row height and this may turn into premature page/column breaks. The effect is more evident with uniform rows. –  egreg Mar 5 '12 at 16:55
    
In my actual table the row height is non-uniform, there are both single and double line height rows. Is there any way that I can work around this so it breaks in the correct place? –  Andy Mar 5 '12 at 17:03
    
it seems that by adding \xentrystretch{-0.085} before my table (I had to arrive at the 0.085 value by trial and error) works ok, but is this the best solution? –  Andy Mar 5 '12 at 17:36
add comment

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.