[XeTeX] table indentation

Ross Moore ross at ics.mq.edu.au
Wed Nov 25 23:55:02 CET 2009


Hi Mike,

On 26/11/2009, at 9:05 AM, maxwell wrote:

> The solutions I can think of that work in this context (need to set  
> wide
> tables on a narrower page, without narrowing the columns) are:
> 1) Reduce the whitespace between colums (the opposite of  
> \setTableToWidth)
> 2) Reduce the font size
> 3) Set the table in landscape mode

If the width were the only problem, then these options
could be handled by:
  1. first setting the table in a box at its natural size,
  2. measure the table's width
  3. if it is too wide, try again using the allowable methods
     as listed above.

>
> I also commonly have the problem that a table may need to float, or  
> it may
> need to continue onto the next page.  I'm pretty sure that the  
> common table
> packages in LaTeX allow you to do one or the other, but not both  
> with the
> same command.

They make a float, and use TeX's inbuilt mechanism for placing
floats, which makes that kind of decision.

However, you cannot (easily) use this to start with a subset
of the table that is less than a full page in height.

> And since the data is generated automatically, I don't want
> to go in manually and choose one or the other package.  So here the  
> options
> are
> 4) Put the table *here*, if it makes sense
> 5) Float the table, assuming it will fit on the next page
> 6) If it won't fit on the next page, start the table *here*, if  
> there is
> room for at least a few rows, and continue it on to the next page
> 7) Else if we're too close to the bottom of the page, and it's a
> multi-page table, start it at the top of the next page, and let it  
> continue
> on to multiple pages.

These options require knowing how much of the current page
has been filled already, so that you can deduce how much room
is available for (a portion of) your tables.
This is something that is not normally available while TeX
is collecting the material to be put onto a page.

To get at such information would require either adjusting
the \output routine, or calling up something similar to it.
You need to simulate closing off the page, measuring its
natural size to get the information that you want, then
opening up the page again so that more material can be added.

This is trickier programming than is normally done, with packages
that just organise chunks of data into a particular layout or
format.

>
> So what I'm asking for is probably a new package, call it SmartTable.
> (And yes, this list may not be the appropriate one, but I haven't  
> had any
> better luck on other lists.  Besides, the people here are nice :-).)

Usually true, of most of us.  :-)

> This
> package would automatically decide which of the above solutions to  
> use (and
> the user would probably need to specify in a preamble which  
> solutions are
> acceptable, e.g. reducing the font size might be unacceptable under  
> certain
> circumstances).

Yes. Organising a way to declare which strategies are acceptable,
then deciding how to handle those that are, is not likely to be
a straight-forward task.

>
> I also notice that some of the above solutions are incompatible, e.g.
> setting a table in landscape mode and continuing it on the next page.

Sure this is possible.
When building the table you interchange text height and width.
Only when there is enough to fill this new (virtual) page do
you create the box, then add the commands to rotate the
table by 90 degrees, then put this box onto a normal page,
along with headers and footers, etc.

Continue in the same way for the table continuing onto the
next page.
The table could only appear on rotated pages. It doesn't make
a lot of sense to have other paragraph-like material filling up
some of a page, then have part of a rotated table beneath it.

But then again, beauty is in the eye of the beholder, not the
TeX programmer.  :-)

> In
> such a case, SmartTable would throw up its figurative hands and  
> issue a
> warning or error msg, I suppose.



>
>    Mike Maxwell


Hope this helps,

	Ross

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





More information about the XeTeX mailing list