Re: [XeTeX] tabular in footnote
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@box \newcount\c@tlcount \setcounter{tlcount}{0} \def\thetlcount{\the\c@tlcount} \newenvironment*{tltabular}[1]{% \stepcounter{tlcount}% \begin{lrbox}{\tl@box}% \begin{tabular}[t]{|#1|}% \hline \zref@savepos \zref@labelbyprops{tl@b\thetlcount}{posy}% \ignorespaces }{% \hline \end{tabular}% \end{lrbox}% \zref@refused{tl@a\thetlcount}% \zref@refused{tl@b\thetlcount}% \dimen@=\dimexpr \zposy{tl@a\thetlcount}sp-\zposy{tl@b\thetlcount}sp% \relax \raisebox{\dimen@}{% \zref@savepos \zref@labelbyprops{tl@a\thetlcount}{posy}% \box\tl@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
Re: [XeTeX] tabular in footnote
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: Put it in \vbox :-). At least I would do so in plain(Xe)TeX. :-) \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}% Many thanks in advance, Dan -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex -- Petr Tomasek http://www.etf.cuni.cz/~tomasek Jabber: but...@jabbim.cz EA 355:001 DU DU DU DU EA 355:002 TU TU TU TU EA 355:003 NU NU NU NU NU NU NU EA 355:004 NA NA NA NA NA -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] tabular in footnote
2011/12/5 Petr Tomasek toma...@etf.cuni.cz: 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: Put it in \vbox :-). At least I would do so in plain(Xe)TeX. :-) In (Xe)LaTeX it will be even worse because the natural width of a \vbox is the line width. If such a \vbox appears in a paragraph just after the footnote number, it will result in an overful \hbox. Breaking the line between the footnote number and the \vbox is in principle possible but the \hbox will be badly underfull and TeX will not do it unless \tolerance is set to 1. The problem is most probably caused by the fact that tabular has zero height and positive depth, it is probably set as \vtop. If placed inside \vbox, the baseline of the \vbox will be aligned with the baseline of tabular, thus the \vbox will still have zero height and positive depth (see my example in one of my previous posts). Thus \vbox does not improve the situation. \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}% Many thanks in advance, Dan -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex -- Petr Tomasek http://www.etf.cuni.cz/~tomasek Jabber: but...@jabbim.cz EA 355:001 DU DU DU DU EA 355:002 TU TU TU TU EA 355:003 NU NU NU NU NU NU NU EA 355:004 NA NA NA NA NA -- 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 -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex
Re: [XeTeX] tabular in footnote
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.oberd...@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@box \newcount\c@tlcount \setcounter{tlcount}{0} \def\thetlcount{\the\c@tlcount} \newenvironment*{tltabular}[1]{% \stepcounter{tlcount}% \begin{lrbox}{\tl@box}% \begin{tabular}[t]{|#1|}% \hline \zref@savepos \zref@labelbyprops{tl@b\thetlcount}{posy}% \ignorespaces }{% \hline \end{tabular}% \end{lrbox}% \zref@refused{tl@a\thetlcount}% \zref@refused{tl@b\thetlcount}% \dimen@=\dimexpr \zposy{tl@a\thetlcount}sp-\zposy{tl@b\thetlcount}sp% \relax \raisebox{\dimen@}{% \zref@savepos \zref@labelbyprops{tl@a\thetlcount}{posy}% \box\tl@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 Heiko.pdf Description: Adobe PDF document Heiko.tex Description: TeX document -- Subscriptions, Archive, and List information, etc.: http://tug.org/mailman/listinfo/xetex