[XeTeX] tabular in footnote
Daniel Greenhoe
dgreenhoe at gmail.com
Mon Dec 5 23:07:35 CET 2011
Hello Heiko,
Thank you for your hard work on my behalf. I did try compiling your
code; but it still seems to have the same problem as my original
example (see attachments). Did I do something wrong?
Dan
On Mon, Dec 5, 2011 at 4:16 PM, Heiko Oberdiek
<heiko.oberdiek at googlemail.com> wrote:
> On Sun, Dec 04, 2011 at 07:31:59AM +0800, Daniel Greenhoe wrote:
>
>> When I put a tabular in a footnote, the tabular often is extended
>> outside the text area. Besides placing a newline directive after the
>> tabular environment, is there anything I can do to prevent this
>> behavior? That is, how can I best ensure that tabulars in a footnote
>> get typeset completely within the text area? Here is an example:
>>
>> \documentclass[12pt]{book}
>> \usepackage[xetex,a4paper,noheadfoot,nomarginpar,margin=20mm,showframe]{geometry}
>> \begin{document}%
>> xyz\footnote{%
>> %\raisebox{2.5mm}{
>> \begin{tabular}[t]{|l|}
>> \hline
>> abc\\
>> def\\
>> ghj\\
>> klm\\
>> \hline
>> \end{tabular}%\\
>> %}%
>> }
>> xyz\footnote{%
>> %\raisebox{2.5mm}{
>> \begin{tabular}[t]{|l|}
>> \hline
>> abc\\
>> def\\
>> ghj\\
>> klm\\
>> \hline
>> \end{tabular}%\\
>> %}%
>> }
>> \end{document}%
>
> I don't see a relation to XeTeX, thus the mailing list texhash
> might be the better choice for this question.
>
> 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.
>
> \documentclass[12pt]{book}
> \usepackage{array}
> \usepackage[
> a4paper,noheadfoot,nomarginpar,margin=20mm,showframe
> ]{geometry}
> \usepackage{zref-savepos}
>
> \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}%
> \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
> }%
> }
>
> \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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Heiko.pdf
Type: application/pdf
Size: 5281 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20111206/34aa215e/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Heiko.tex
Type: application/x-tex
Size: 1055 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20111206/34aa215e/attachment.tex>
More information about the XeTeX
mailing list