# [XeTeX] tabular in footnote

Zdenek Wagner zdenek.wagner at gmail.com
Thu Dec 8 01:57:52 CET 2011

2011/12/8 Daniel Greenhoe <dgreenhoe at gmail.com>:
> Hello Heiko,
> ...
> In my mind (and maybe in my mind only) if I code something (e.g. a
> tabular in a footnote) in accordance with documented syntax and then
> the result of that code violates a parameter (e.g. a lower text area
> boundary) defined in the same documentation, then that by definition
> is a bug. Secondly, if  a 32 line section of code is required to
> prevent my correctly coded (as defined by documented syntax) code from
> violating such a parameter, then such a violation is by definition a
> bug and the 32 lines of additional code is by definition a "patch".
>
No, I do not agree. I can only agree that the LaTeX user
documentatioin is incomplete. Consider the expression "my text". You
would certainly be disapointed if the word "text" were verticaly
aligned so that its baseline matched with the bottom of "y". That's
why boxes have height and depth and are aligned to baselines, not to
bottom. The truth is that the documentation of tabular is incomplete.
It does not say that it has zero width and the whole table extends
below baseline. Thus in your original sample file you aske LaTeX to
put the table below the baseline and LaTeX did exactly what you asked
for. Incomplete documentation is unfortunately a feature of LaTeX.
Normal users do not know that \vspace is expanded to \vskip in the
vertical mode but to \vadjust{...} in the horizontal mode and the
starred variant is esentially \vglue. I am afraid that the LaTeX
documentation does not even mention the 5 modes so that the vertical
and horizontal modes may be strange for you. Without knowledge of the
modes you cannot understand why the table behaves differently in the
footnote. It is documented in the TeXbook.

>  1. I am embarrassed by my own lack of knowledge with respect to TeX coding.
>  2. I realize that I take a lot from this email list but contribute
> nothing or next to nothing
>  3. I very much appreciate all the help that I have and do receive
> from this mailing list
>  4. I know that beggars can't be choosers.
>  5. TeX and it's derivatives has to be one of the greatest
> developments of all time --- like unto the Gutenberg Press --- many
> many thanks to everyone who has and continues to work so hard to
> develop it.
>
> Dan
>
>
> On Wed, Dec 7, 2011 at 7:51 AM, Heiko Oberdiek
>> On Wed, Dec 07, 2011 at 06:30:39AM +0800, Daniel Greenhoe wrote:
>>
>>> On Wed, Dec 7, 2011 at 5:46 AM, Heiko Oberdiek
>>> > You have to compile twice at least.
>>>
>>> I compiled at least 8 times using "xelatex Heiko.tex". I still get the
>>> same error: the text extends below the text area (see attachment). You
>>> don't get this result on your system?
>>
>>
>> | The following example addresses calculates the shift to align
>> | the baseline of the footnote line with the first line of
>> | the tabular. No time for looking at the problem with the overfull \vbox.
>>
>> I have seen two problems with your example and one of them solved,
>> the other remained unsolved. No more, no less.
>>
>> Taking more time, I see now, that the overfull \vbox is caused
>> by something different: The header is set to zero (see options
>> for geometry), but the page number is printed causing the
>> overfull \vbox. Changing the options of geometry or \pagestyle{empty}
>> solves the problem.
>>
>> The exceeding part of the second footnote text is correct behaviour:
>> TeX tries to align the top and bottom lines of a page in order to
>> get the baselines at the same position:
>> * At the top vertical space is added up to \topskip unless
>>  the height of the first element is larger than \topskip.
>> * At the bottom the bottom element might have a depth up to
>>  \maxdepth. The default for \maxdepth with \documentclass[12pt]{book}
>>  is .5\topskip = 8pt. \maxdepth=0pt doesn't allow the bottom element
>>  to exceed the textarea. Aligning the last line of the tabular with the
>>  bottom of the textarea is much more tricky.
>>
>>  The following assumes that the last line of the tabular contains
>>  normal text without large depths:
>>
>> \documentclass[12pt]{book}
>> \usepackage{array}
>> \usepackage[
>> ]{geometry}
>> \usepackage{zref-savepos}
>> \pagestyle{empty}
>>
>> %\maxdepth=0pt
>>
>> \makeatletter
>> \newsavebox\tl at box
>> \newcount\c at tlcount
>> \setcounter{tlcount}{0}
>> \def\thetlcount{\the\c at tlcount}
>> \newenvironment*{tltabular}[1]{%
>>  \stepcounter{tlcount}%
>>  \begin{lrbox}{\tl at box}%
>>  \begin{tabular}[t]{|#1|}%
>>  \hline
>>  \zref at savepos
>>  \zref at labelbyprops{tl at b\thetlcount}{posy}%
>>  \xdef\g at dp@arstrutbox{%
>>    \the\dimexpr\dp\@arstrutbox+\arrayrulewidth
>>  }%
>>  \ignorespaces
>> }{%
>>  \hline
>>  \end{tabular}%
>>  \end{lrbox}%
>>  \zref at refused{tl at a\thetlcount}%
>>  \zref at refused{tl at b\thetlcount}%
>>  \dimen@=\dimexpr
>>    \zposy{tl at a\thetlcount}sp-\zposy{tl at b\thetlcount}sp%
>>  \relax
>>  \raisebox{\dimen@}{%
>>    \zref at savepos
>>    \zref at labelbyprops{tl at a\thetlcount}{posy}%
>>    \box\tl at box
>>  }\\*[-\g at dp@arstrutbox]%
>>  \hbox{\vrule width 0pt depth\g at dp@arstrutbox}%
>> }
>>
>> \begin{document}%
>>  xyz\footnote{%
>>   \begin{tltabular}{l}
>>     abc\\
>>     def\\
>>     ghj\\
>>     klm\\
>>   \end{tltabular}%\\
>>  }
>>  xyz\footnote{%
>>   \begin{tltabular}{l}
>>     abc\\
>>     def\\
>>     ghj\\
>>     klm\\
>>   \end{tltabular}%\\
>>  }
>> \end{document}%
>>
>> Yours sincerely
>>  Heiko Oberdiek
>>
>>
>> --------------------------------------------------
>> Subscriptions, Archive, and List information, etc.:
>>  http://tug.org/mailman/listinfo/xetex
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex
>

--
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz