0

I have a few tables with lots of text in two columns, so I used tabulary to have fluid column width. But then I noticed that I have a table which is longer than one page (I am using a standard article class, if it matters). I searched how to make a table span two pages, but the environments for that have to be used instead of tabular, so I can have either longtable or tabulary but not both.

Are there any tricks to either make tabulary span many pages or have long text fitted in a cell in a longtable? Or is there a third package which can do both?

    \documentclass[a4paper,10pt]{article} \usepackage[utf8x]{inputenc} \usepackage{tabulary}

%opening \title{an example} \author{rumtscho}

\begin{document}

\maketitle

\begin{abstract}  long table example \end{abstract}

\section{the only section}

\begin{table}[htb] \renewcommand{\arraystretch}{1.5} \begin{tabulary}{0.8\textwidth}{p{24mm} L L} \hline   Column 1 &   Column 2 &   Column 3 \\   \hline

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\ 

  short name &    long text long text long text long text long text long text long text long text long text long text long text &    long text long text long text long text long text long text long text long text long text long text long text \\    \hline

\end{tabulary} \caption{A table} \label{tab:aTable} \end{table}

\end{document}
rumtscho
  • 989
  • Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – cfr Apr 21 '14 at 15:32
  • @cfr as this is more of a question which package to use (or which parameters) and not about error hunting, I didn't expect that anybody will be compiling my example. But you seem to think it is necessary, so I edited it. – rumtscho Apr 21 '14 at 15:40
  • There is ltxtable or ltablex which combine the facilities of longtable and tabularx. Not quite the same, but possibly useful. cals might also be of interest. A list of possible packages is at http://ctan.org/topic/table so it is worth looking through them in case something is useful. – cfr Apr 21 '14 at 15:42
  • An MWE is helpful if anybody wants to try out a workaround which involves redefining something, for example. That's much easier to do with complete code than it would be otherwise. (Lots of solutions involve redefining a command or environment in the preamble or creating a new one.) That may not be the case here but if you knew that in advance, you'd likely not be asking the question (and I certainly don't know the answer!). – cfr Apr 21 '14 at 15:45
  • There is also the tabu package, which provides a tabu environment (similar to tabularx) and a longtabu environment (like tabularx + longtable), according to its documentation. – Dan Apr 21 '14 at 16:53
  • 99 times out of 100 it is better to set such informationas a list rather than a table (then page breaking even within an item, is automatic) otherwise you could use ltxtable (using tabularx rather than tabulary) or for a version of tabulary breaking over a page see the (answer which is automatically linked on the right already) http://tex.stackexchange.com/questions/78075/multi-page-with-tabulary – David Carlisle Apr 22 '14 at 00:02
  • for an answer showing how to use a list rather than a table see http://tex.stackexchange.com/questions/135333/parameter-description-with-long-descriptions-and-long-lists-possibility-of-pa – David Carlisle Apr 22 '14 at 00:07

0 Answers0