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.

Is it possible to use tabularx inside a longtable environment?

If not, is there any way I can get the "X" funcionality of tabularx with the option of long tables ---In order for me to be able to break them in two pages? Using longtabu is not an option, as stated by @jon here:

I would recommend staying away from tabu as the package author is still fiddling with things and explicitly promised that there would not be backwards compatibility. See here for the discussion.

UPDATE:

Using the package ltxtable suggested by @Alan Munn (Writeen by @David Carlisle) I have the current Minimal Non-Working Example

Main File:

\documentclass{article}

\usepackage{array}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{ltxtable}

\begin{document}
Hello.

\LTXtable{\textwidth}{VersionOne}

\end{document}  

Where the file VersionOne goes:

\begin{longtable}{XX}
\caption{A very long table}\\
WHO                 & \hspace{5mm} World Health Organization\\[1mm]
GDP                 & \hspace{5mm} Gross Domestic Product\\[1mm]
PPP                 & \hspace{5mm} Purchasing Power Parities\\[1mm]
\label{tab:LongtableOne}
\end{longtable}

When I try to run this code, I get a Emergency Stop and a fatal error. Am I writing this correctly?

share|improve this question
3  
There is the ltxtable package by David Carlisle which combines the capabilities of both. –  Alan Munn Apr 2 '13 at 4:54
    
@AlanMunn, Could you please give an example? The documentation (ftp.di.uminho.pt/pub/ctan/macros/latex/contrib/carlisle/…) is not very explicative, and I wasn't able to run anything –  Mario S. E. Apr 2 '13 at 15:26
    
Just put your longtable in a separate file and include it with \LTXtable{\textwidth}{name-of-file-with-table} –  David Carlisle Apr 2 '13 at 15:49
    
And what about the Xs? Should I also write a tabularx environment? –  Mario S. E. Apr 2 '13 at 16:10
2  
@MarioS.E. No just use X in the longtable preamble –  David Carlisle Apr 2 '13 at 16:53
show 3 more comments

1 Answer 1

As stated in the comments for ltxtable the longtable has to be in a separate file. Processing the updated example (twice) with pdflatex produces

enter image description here

share|improve this answer
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.