diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/platex-tools/pxftnright.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/platex-tools/pxftnright.sty | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/platex-tools/pxftnright.sty b/Master/texmf-dist/tex/latex/platex-tools/pxftnright.sty new file mode 100644 index 00000000000..f16fa403624 --- /dev/null +++ b/Master/texmf-dist/tex/latex/platex-tools/pxftnright.sty @@ -0,0 +1,132 @@ +% +% pxftnright.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% This package `pxftnright' is based on: +% * ftnright.sty in latex-tools (2014/10/28 v1.1f) +% +% Problems with ftnright to use with pLaTeX: +% * \@startcolumn is redefined +% (incompatible with vertical typesetting) +% * \@makecol is redefined +% (bottom float after footnote) +% * \@makefntext is redefined +% (incompatible with some pLaTeX classes) +% * \footnotesep is not suitable for vertical typesetting +% (rather a problem of \strutbox in pLaTeX2e kernel?) +% so, this package provides patches. +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxftnright} + [2016/09/07 v1.0 footnote layout package for pLaTeX] + +%% save \@makefntext definition from pLaTeX class +\@ifpackageloaded{ftnright}{% + \PackageError{pxftnright}{% + Package ftnright is already loaded!\MessageBreak + Load pxftnright earlier}\@ehc +}{} +\let\pxftn@makefntext\@makefntext + +%% load ftnright package +\RequirePackage{ftnright} + +%% patches for ftnright to work fine with pLaTeX +%% This code is based on pLaTeX2e 2016/09/03 community ed. + +\def\@startcolumn{% + \ifx\@deferlist\@empty + \global\@fcolmadefalse + \global\@colroom\@colht + \else + \ifvoid\footins\else + \ftn@amount\ht\footins + \advance\ftn@amount\dp\footins + \advance\ftn@amount\skip\footins + \fi + \global\advance\@colht-\ftn@amount + \global\@colroom\@colht + \@xstartcol + \global\advance\@colht\ftn@amount + \global\advance\@colroom\ftn@amount + \fi + \if@fcolmade + \setbox\@cclv\box\@outputbox + \@makecol + \else +%%%%% change for pLaTeX (import from \@reinserts in plcore) + \ifvoid\footins\else\insert\footins{% + \iftbox\footins\tate\else\yoko\fi + \unvbox\footins}\fi +%%%%% + \fi} + +\def\@makecol{% +%%%%% change for pLaTeX + \setbox\@outputbox\box\@cclv +%%%%% + \if@firstcolumn + \if@twocolumn \else + \ifvoid\footins \else + \@latexerr{ftnright package + used in one-column mode}% + {The ftnright package was designed to + work with LaTeX's standard^^Jtwocolumn + option. It does *not* work with the + multicol package.^^JSo please specify + `twocolumn' in the + \noexpand\documentclass command.}% + \shipout\box\footins \fi\fi + \ifnum\insertpenalties>\z@ + \@latexerr{ftnright package + scrambled footnotes}% + {There is too much footnote material in + the first column and ftnright^^Jis + unable to cope with this.^^JYou need + to reduce the amount to get a properly + formatted page.}% + \fi + \fi + \xdef\@freelist{\@freelist\@midlist}% + \global \let \@midlist \@empty + \@combinefloats + \ifvbox\@kludgeins + \@makespecialcolbox + \else +%%%%% change for pLaTeX (import from \@makecol in plcore) + \setbox\@outputbox \vbox to\@colht {% + \boxmaxdepth\maxdepth + \@texttop + \dimen@ \dp\@outputbox + \unvbox \@outputbox + \iftdir\vbox{\hskip\z@}\fi + \vskip -\dimen@ + \@textbottom + \if@firstcolumn\else + \ifvoid\footins\else % for pLaTeX + \vskip \skip\footins + \color@begingroup + \normalcolor + \footnoterule + \unvbox \footins + \color@endgroup + \fi + \fi + }% +%%%%% + \fi + \global\maxdepth\@maxdepth +} + +%% adjust \footnotesep for vertical typesetting +\AtBeginDocument + {\global\footnotesep\ht\iftdir\tstrutbox\else\strutbox\fi} + +%% restore \@makefntext +\let\@makefntext\pxftn@makefntext + +\endinput |