[XeTeX] Making nice tables

Ross Moore ross at ics.mq.edu.au
Thu Nov 22 06:55:55 CET 2007

Hello Mike,

On 22/11/2007, at 4:07 PM, Mike Maxwell wrote:

> I've found solutions for many of the problems, but tables seem to  
> be a more difficult problem.  Some of our tables run longer than a  
> single page, so I have given dblatex a parameter  
> (table.in.float="0") that tells it to use the package 'longtable'.   
> The result is bizarre in certain cases; I'm attaching a jpg of one  
> of the PDF pages.  As you can see, table 3.3 (which is broken  
> across this page and the next) has a very odd bottom line; it  
> extends slightly to the left of the left-hand vertical border, and  
> over half of the right-hand part of the line is missing.

That line is the line drawn above the footnotes.
It is not connected to the table at all.

The question you should ask is why are the footnotes being placed
on this page and not floated a bit further along.

Alternatively, try \suppressfloats[b]  on this page, before
the apparently bad table, then you may be able to make
it float to the next page, and perhaps get even more footnotes
onto this one --- if there are still any left, that is.

Alternatively, allow the 2nd table to have only the [t] location,
and not [h] or [b].

> Moreover, the last word in the second column overlaps the bottom  
> line, and it isn't leaving enough room above the footnote.  All in  
> all, it's just a mess.

Sure is. I think the whole table should float to the next page.
Is it really a long table? Or just another quite short one,
like the first one on that page?

> In contrast, when we output this through Word, this table is simply  
> floated on to the next page.  This leaves a substantial white area  
> at the bottom of this page; Word does not attempt to put any text  
> in that area, and indeed there is a succession of several tables at  
> this point, so trying to put text into the white area would mean  
> that text from several pages later would be showing up here instead.
> A couple things surprise me about this.  First, I am a bit  
> surprised that Tex prefers to break this table across the page,  
> rather than float it like Word does.  I guess you could argue about  
> the ugliness of white space, but I for one prefer it in this case  
> to the alternative of either breaking the table, or trying to fill  
> in the white space with text which logically belongs much later.

Then try putting in some explicit vertical space;
e.g. with
or an explicit \vspace{....} .

> But even more surprising to me is the mess that *tex makes of last  
> line of this broken table.  I realize tables are hard, and  
> footnotes make the problem of page layout still harder, but I would  
> have thought it would get this right.

The footnote bar seems to be exactly on the baseline of the table  
yet the lines at the side of the table go a bit deeper.
Surely this is due to the algorithm for breaking the long table.
It must be allowing those side lines to be drawn without actually
adding to the vertical size of the table. Or maybe when a table breaks,
some negative \vglue is added, to make the baseline of the table occur
exactly along the bottom of the page. However, when there are footnotes,
this gets screwed-up, and some glue gets lost.

I'd have to play with an example to be able to verify these impressions
and see exactly what is happening here.

There is a  supertabular  package that also is designed to handle
overly large tables. Have you tried it? Does it fare any better ?

> So my question: If you were doing this in xetex/latex, so that you  
> could use whatever table package you wanted (instead of converting  
> from DocBook), what would you do with these tables?  Should I be  
> using some other package, instead of longtable?  Or maybe the  
> problem is with the standard footnote package?  (I can of course  
> provide the xetex input, if anyone is brave enough to look at it.)
> -- 
> 	Mike Maxwell
> 	maxwell at umiacs.umd.edu

Hope this helps,


Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114

More information about the XeTeX mailing list