7

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}
    }
3

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

  • 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

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.