LaTeX forum ⇒ Graphics, Figures & TablesUse longtable with functionality of tabularx?

Information and discussion about graphics, figures & tables in LaTeX documents.
jaykemper
Posts: 22
Joined: Wed Apr 15, 2009 12:11 am

Use longtable with functionality of tabularx?

Postby jaykemper » Wed Apr 15, 2009 12:20 am

I'm developing a table spanning several pages and using "longtable", but I need to be able to put new lines within the cells like one would do with "tabularx". Within the "longtable", the "\newline" command seems to be ignored, while if it's in a "tabularx" X column, a new line is put in the cell, which is want. Does anyone know a way to do this?

Recommended reading 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Use longtable with functionality of tabularx?

Postby localghost » Wed Apr 15, 2009 8:56 am

You can either use ltablex or ltxtable. Both packages represent a merge of the packages longtable and tabularx.


Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

jaykemper
Posts: 22
Joined: Wed Apr 15, 2009 12:11 am

Use longtable with functionality of tabularx?

Postby jaykemper » Wed Apr 15, 2009 7:01 pm

That works just as advertised...HOWEVER it screwed up another table of mine (!!).

I had a table the width of the text with three columns, the first two were snapped to the largest content, and the last extended to the right margin, essentially making the last column a filler. This package condensed the last column and centered the table.

\usepackage{ltablex}

...

\textbf{Revision History}\\
\begin{tabularx}{\textwidth}{ | l | l | X|}
        \hline
        Revision&Revision Date&Description\\
        \hline
        R00&13 April 2009&Initial Release\\
        \hline
\end{tabularx}


Any thoughts?


[Edit] Figured it out.

Add the command \keepXColumns just before the \begin{tabularx} declaration.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests