[XeTeX] Tables

Michiel Kamermans pomax at nihongoresources.com
Sun Oct 3 11:23:22 CEST 2010

On 10/2/2010 3:29 PM, Mike Maxwell wrote:
> Interesting.  We're producing grammars.  They're XML (if you want to 
> mark structure, use XML!), and they get converted to XeLaTeX for 
> typesetting (if you want to typeset, use LaTeX!).  One of the problems 
> we've had is that of deciding whether tables are too large to fit on a 
> page, and must therefore be printed with longtable instead of floating 
> tables.  We've also had a few tables that are too wide, and need to be 
> printed in landscape mode.
> When we first faced this problem a couple years ago, I was surprised 
> to find that there was no automatic way for LaTeX to detect the fact 
> that a table was too long or wide to fit on a page.  Fortunately, it's 
> possible to tag long or wide tables in XML (DocBook), so the 
> appropriate LaTeX table package is used.  But that seems a poor way to 
> do things; when somebody might want to print our grammar on a 
> different size paper (A4, or maybe a book), they'll have to check each 
> table to see whether it's appearing correctly.

I ran into the same problem with my Japanese grammar, where I wanted to 
set tables paragraph-aligned if they were narrow enough, centered on the 
page if the table would run off the page if still paragraph aligned, or 
generate a "this table is probably poorly thought up" if it didn't fit 
that way either, and using tabularx if the table fit on one page, and 
longtable if it didn't. I ended up writing to this list for help, and my 
working solution was actually rather dirty: I did it through 
preprocessing, so that the source-to-TeX conversion scripts actually 
look at the tables that are to be set, and pick the right tabling 
environment for them.

Tabling is still one of those things in TeX that severely lacks user 
friendliness. There's lots of choice how to set a specific table, but 
still no management package that makes the choice for you, based on 
table dimensions. Life without "linewrapping" when there is no explicit 
column width is an acceptable tradeoff when you want to "take control", 
but non-trivial tabling: damn, we still have a way to go =)

- Mike "Pomax" Kamermans

More information about the XeTeX mailing list