summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/platex-tools
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-10-25 20:39:41 +0000
committerKarl Berry <karl@freefriends.org>2016-10-25 20:39:41 +0000
commita668ec43fa4ad7236570e18fa0008c16d2f279c3 (patch)
tree601e7dcfd7ab7f8afe71a47dae6858842409b5db /Master/texmf-dist/tex/latex/platex-tools
parentebb5a88807ee66de22c4803faa1a8e9ad8ffa5bf (diff)
platex-tools (25oct16)
git-svn-id: svn://tug.org/texlive/trunk@42352 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/platex-tools')
-rw-r--r--Master/texmf-dist/tex/latex/platex-tools/bounddvi.sty87
-rw-r--r--Master/texmf-dist/tex/latex/platex-tools/plextarray.sty9
2 files changed, 95 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/platex-tools/bounddvi.sty b/Master/texmf-dist/tex/latex/platex-tools/bounddvi.sty
new file mode 100644
index 00000000000..7e207da447e
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/platex-tools/bounddvi.sty
@@ -0,0 +1,87 @@
+%
+% bounddvi.sty
+% 2016/10/25 v7.0-v7.1 h.y.acetaminophen@gmail.com
+% 2004/12/15 v6.0-v1.0 inoue@ma.ns.tcu.ac.jp
+%
+% This package, originally written by Koichi Inoue
+% and modified by Hironobu Yamashita, is distributed
+% as part of the platex-tools bundle.
+% https://github.com/aminophen/platex-tools
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bounddvi}[2016/10/25 v7.1 bounddvi]
+
+% catcode trick to hide \iftombow ... \else ... \fi
+% since \iftombow is defined only in pLaTeX.
+\ifx\pfmtname\@undefined
+ \catcode`\Q=14\relax
+\else
+ \catcode`\Q=9\relax
+\fi
+
+% Note: graphics/color drivers
+% - dvips.def 2016/07/10 v3.1a or later
+% - dvipdfmx.def 2016/07/10 v4.12 or later
+% emit papersize special _only_ when \Gin@setpagesizetrue
+% and \mag = 1000. When graphicx(s) or color is used with
+% setpagesize option (= default since 2016) and \mag equals
+% to 1000, we can exploit its routine.
+% (they are using \AtBeginDocument{\AtBeginDvi{...}})
+% However, these .def files do _not_ care about tombow by pLaTeX;
+% so, we set \stock{width,height} to invoke stock test in those
+% files (probably meant for memoir.cls).
+Q \iftombow
+Q % if \stockwidth/\stockheight are not available,
+Q % define them now
+Q \ifx\stockwidth\@undefined \newdimen\stockwidth \fi
+Q \ifx\stockheight\@undefined \newdimen\stockheight \fi
+Q % if \stockwidth already has effective value, do nothing;
+Q % otherwise assume pLaTeX-style tombow and set it to
+Q % \paperwidth + 2in (similar for \stockheight)
+Q \ifdim\stockwidth>\z@\else
+Q \stockwidth\paperwidth \advance\stockwidth2in
+Q \fi
+Q \ifdim\stockheight>\z@\else
+Q \stockheight\paperheight \advance\stockheight2in
+Q \fi
+Q \fi
+
+% reset catcode trick
+\catcode`\Q=11\relax
+
+% following code is almost equivalent to
+% \AtBeginDocument{\AtBeginDvi{...}}
+% however, we append the specification to the _beginning_ of
+% \@begindocumenthook; this ensures proper papersize on dvips.
+\begingroup
+\def\@prependto@begindocumenthook{\global\setbox\@begindvibox
+ \vbox{\csname yoko\endcsname\unvbox\@begindvibox
+ \begingroup
+ % if \stockwidth/\stockheight are defined & have effective
+ % values, copy them to \paperwidth/\paperheight
+ % for current group
+ \ifx\stockwidth\@undefined\else \ifdim\stockwidth>\z@
+ \paperwidth\stockwidth
+ \fi\fi
+ \ifx\stockheight\@undefined\else \ifdim\stockheight>\z@
+ \paperheight\stockheight
+ \fi\fi
+ % adjust for \mag and emit papersize special
+ \divide\paperwidth\@m\multiply\paperwidth\mag
+ \divide\paperheight\@m\multiply\paperheight\mag
+ \special{papersize=\the\paperwidth,\the\paperheight}%
+ \endgroup}}
+\toks@\expandafter\expandafter\expandafter
+ {\expandafter\@prependto@begindocumenthook\@begindocumenthook}
+\xdef\@begindocumenthook{\the\toks@}
+% append papersize special again to the _end_ of the
+% current \@begindocumenthook; this will be meaningful when
+% geometry is loaded before bounddvi and dvipdfm(x) is used.
+% (geometry adds \AtBeginDocument{\AtBeginDvi{...}}, but
+% `sandwich' specification can inactivate the effect of geometry)
+\expandafter\g@addto@macro\expandafter\@begindocumenthook
+ \expandafter{\@prependto@begindocumenthook}
+\endgroup
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/platex-tools/plextarray.sty b/Master/texmf-dist/tex/latex/platex-tools/plextarray.sty
index 210dba5dee6..6c34ee0e4f5 100644
--- a/Master/texmf-dist/tex/latex/platex-tools/plextarray.sty
+++ b/Master/texmf-dist/tex/latex/platex-tools/plextarray.sty
@@ -13,7 +13,7 @@
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{plextarray}
- [2016/10/07 v1.0f Tabular extension package for plext and array]
+ [2016/10/23 v1.0g Tabular extension package for plext and array]
\RequirePackage{plext}
\RequirePackage{array}
@@ -97,6 +97,13 @@
\def\endtabular{\endarray $\egroup\null}
\expandafter \let \csname endtabular*\endcsname = \endtabular
%
+%% done
+
+%% support for other packages
+\@ifpackageloaded{colortbl}{% --- colortbl.sty 2012/06/21 v1.0b
+ \PackageInfo{plextarray}{Package colortbl detected}%
+ \def\endarray{\crcr \egroup \egroup \@end@alignbox \@arrayright \gdef\@preamble{}\CT@end}%
+}{}
%% all done
\endinput