From b13986f8177f2b46e18a7288e7bb7909d86d18a4 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 14 Oct 2020 21:46:12 +0000 Subject: gentombow (14oct20) git-svn-id: svn://tug.org/texlive/trunk@56665 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/gentombow/README.md | 34 ++- .../texmf-dist/doc/latex/gentombow/bounddvi-en.pdf | Bin 49513 -> 49397 bytes Master/texmf-dist/doc/latex/gentombow/bounddvi.pdf | Bin 123721 -> 102475 bytes .../doc/latex/gentombow/gentombow-ja.pdf | Bin 213739 -> 174085 bytes .../doc/latex/gentombow/gentombow-ja.tex | 13 +- .../texmf-dist/doc/latex/gentombow/gentombow.pdf | Bin 150461 -> 150209 bytes .../texmf-dist/doc/latex/gentombow/gentombow.tex | 1 + .../texmf-dist/doc/latex/gentombow/pxgentombow.pdf | Bin 23384 -> 23109 bytes Master/texmf-dist/tex/latex/gentombow/bounddvi.sty | 130 +++++------ .../texmf-dist/tex/latex/gentombow/gentombow.sty | 48 ++--- Master/texmf-dist/tex/latex/gentombow/pxesopic.sty | 239 +++++++++++++++++++++ .../texmf-dist/tex/latex/gentombow/pxgentombow.sty | 2 +- .../texmf-dist/tex/latex/gentombow/pxpdfpages.sty | 72 +++++++ .../texmf-dist/tex/latex/gentombow/pxtextpos.sty | 108 ++++++++++ 14 files changed, 535 insertions(+), 112 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/gentombow/pxesopic.sty create mode 100644 Master/texmf-dist/tex/latex/gentombow/pxpdfpages.sty create mode 100644 Master/texmf-dist/tex/latex/gentombow/pxtextpos.sty diff --git a/Master/texmf-dist/doc/latex/gentombow/README.md b/Master/texmf-dist/doc/latex/gentombow/README.md index 6ea7f2aea55..94cbdbdac08 100644 --- a/Master/texmf-dist/doc/latex/gentombow/README.md +++ b/Master/texmf-dist/doc/latex/gentombow/README.md @@ -3,6 +3,16 @@ This bundle provides a LaTeX package for generating Japanese-style crop marks (called 'tombow' in Japanese) for practical use in self-publishing. +The core feature of "gentombow.sty" is based on pLaTeX kernel. + +## Supported engines + +All packages except bounddvi.sty works with the followings: +- LaTeX + dvips/dvipdfmx +- pLaTeX/upLaTeX + dvips/dvipdfmx +- pdfLaTeX +- LuaLaTeX +- XeLaTeX ## Bundle contents @@ -16,11 +26,23 @@ self-publishing. Set papersize special to DVI file. Can be used on LaTeX/pLaTeX/upLaTeX (with DVI output mode) with dvips or dvipdfmx drivers. - Old version (v6.0) of this package, written by Koichi INOUE - in 2004, is available at - https://www.ma.ns.tcu.ac.jp/Pages/TeX/bounddvi.sty.html - (dead link). - Now it is maintained by Hironobu Yamashita by his courtesy. + Old version (v6.0) was written by Koichi INOU in 2004 + (https://www.ma.ns.tcu.ac.jp/Pages/TeX/bounddvi.sty.html), + and incorporated into this bundle by his courtesy. + +## Miscellaneous patches + +Some packages are unaware of crop marks defined in "gentombow"; +to cope with those packages, patches are provided here. +- pxtextpos.sty: + Patch for textpos.sty (by Norman Gray). +- pxesopic.sty: + Patch for eso-pic.sty (by Rolf Niepraschk). +- pxpdfpages.sty: + Patch for pdfpages.sty (by Andreas Matthias). + +These patches can also be used independent of "gentombow", +to avoid problems with crop marks on pLaTeX and upLaTeX. ## Character encoding @@ -44,6 +66,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2020-09-25 +2020-10-14 Hironobu Yamashita diff --git a/Master/texmf-dist/doc/latex/gentombow/bounddvi-en.pdf b/Master/texmf-dist/doc/latex/gentombow/bounddvi-en.pdf index fb9647d1eca..2cf419316e9 100644 Binary files a/Master/texmf-dist/doc/latex/gentombow/bounddvi-en.pdf and b/Master/texmf-dist/doc/latex/gentombow/bounddvi-en.pdf differ diff --git a/Master/texmf-dist/doc/latex/gentombow/bounddvi.pdf b/Master/texmf-dist/doc/latex/gentombow/bounddvi.pdf index c0a2b20af65..57fed9c6c75 100644 Binary files a/Master/texmf-dist/doc/latex/gentombow/bounddvi.pdf and b/Master/texmf-dist/doc/latex/gentombow/bounddvi.pdf differ diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf index ada6318d413..ee94b6c132b 100644 Binary files a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf and b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf differ diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex index 763f790020f..411aad1db2d 100644 --- a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex +++ b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex @@ -3,14 +3,10 @@ \epTeXinputencoding utf8 % ensure utf-8 encoding for platex \fi +\RequirePackage{plautopatch}% pldocverb \documentclass[a4paper,dvipdfmx]{jsarticle} \usepackage{doc} \makeatletter -%%% import from jltxdoc.cls -\def\verb{\relax\ifmmode\hbox\else\leavevmode\vadjust{}\fi - \bgroup \let\do\do@noligs \verbatim@nolig@list - \ttfamily \verb@eol@error \let\do\@makeother \dospecials - \@ifstar{\@sverb}{\@vobeyspaces \frenchspacing \@sverb}} \xspcode"5C=3 %% \ \xspcode"22=3 %% " %%% dangerous bend @@ -207,7 +203,11 @@ C系列(\texttt{c0}--\texttt{c10})と なお、ここでも用紙サイズが横長の場合は自動的に出力も横長になり、 縦長の場合は自動的に縦長になります。 -オプションは\jMeta{トンボ形式}\texttt{-}\jMeta{出力サイズ}の書式で与えます。 +オプションは\jMeta{トンボ形式}\texttt{-}\jMeta{出力サイズ}の書式 +\footnote{他のパッケージで見られるようなkey=value形式ではないので +注意してください。このような特殊なオプション書式を用いているのは、 +オプション名が他のクラスファイルやパッケージと衝突する可能性を +小さくするためです。}で与えます。 トンボ形式は、p\LaTeX の標準クラスと同じで \verb+tombow+, \verb+tombo+, \verb+mentuke+のいずれかを選びます (\verb+tombow+はジョブ情報を表示し、\verb+tombo+は表示しません。 @@ -453,6 +453,7 @@ $30\,\mathrm{mm}$にしたいとき\footnote{ここでは「本文の領域以 \verb+\settombowbleed+が\verb+/TrimBox+に反映されな かったバグの修正 \item 2019/07/21 v0.9k \textsf{pdfx}パッケージとの整合性をとる改良 + \item 2020/10/14 v0.9l \textsf{plautopatch}からトンボ対策パッチを取り込み \end{itemize} \end{document} diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf b/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf index c47dab8edbc..178bab4c521 100644 Binary files a/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf and b/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf differ diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow.tex b/Master/texmf-dist/doc/latex/gentombow/gentombow.tex index 81be1fe6c52..d0bc4523ab3 100644 --- a/Master/texmf-dist/doc/latex/gentombow/gentombow.tex +++ b/Master/texmf-dist/doc/latex/gentombow/gentombow.tex @@ -301,6 +301,7 @@ please load \textsf{gentombow} after \textsf{geometry}. Fix a bug that \verb+\settombowbleed+ is not considered by \verb+/TrimBox+. \item 2019/07/21 v0.9k Support \textsf{pdfx} package. + \item 2020/10/14 v0.9l Import tombow-related patches from \textsf{plautopatch}. \end{itemize} \end{document} diff --git a/Master/texmf-dist/doc/latex/gentombow/pxgentombow.pdf b/Master/texmf-dist/doc/latex/gentombow/pxgentombow.pdf index a0da4121e0e..d30a4509e45 100644 Binary files a/Master/texmf-dist/doc/latex/gentombow/pxgentombow.pdf and b/Master/texmf-dist/doc/latex/gentombow/pxgentombow.pdf differ diff --git a/Master/texmf-dist/tex/latex/gentombow/bounddvi.sty b/Master/texmf-dist/tex/latex/gentombow/bounddvi.sty index 3e355d63c1d..a70da52c6e0 100644 --- a/Master/texmf-dist/tex/latex/gentombow/bounddvi.sty +++ b/Master/texmf-dist/tex/latex/gentombow/bounddvi.sty @@ -1,6 +1,6 @@ % % bounddvi.sty -% 2020/09/25 v8.0-v7.0 h.y.acetaminophen [at] gmail.com +% 2020/10/08 v8.2-v7.0 h.y.acetaminophen [at] gmail.com % 2004/12/15 v6.0-v1.0 inoue [at] ma.ns.tcu.ac.jp % % This package, originally written by Koichi Inoue @@ -10,15 +10,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bounddvi}[2020/09/25 v8.0 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 +\ProvidesPackage{bounddvi}[2020/10/08 v8.2 bounddvi] % Note: graphics/color drivers % - dvips.def 2016/07/10 v3.1a or later @@ -28,74 +20,84 @@ % 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 +% However, these .def files do _not_ care about tombow; 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 +% detection of \iftombow status is delayed until \AtBeginDocument, +% to support both (u)pLaTeX kernel and ``gentombow.sty'' +\def\bddv@maybe@ensure@stock{% + \ifx\tombowtrue\@undefined + \let\bddv@ensure@stock\relax % skip if-tokens + \fi + \bddv@ensure@stock} + +% when \iftombow == \iftrue, we also need \stock{width,height} +\def\bddv@ensure@stock{% + \iftombow + % if \stockwidth/\stockheight are not available, + % define them now + \ifx\stockwidth\@undefined \newdimen\stockwidth \fi + \ifx\stockheight\@undefined \newdimen\stockheight \fi + % if \stockwidth already has effective value, do nothing; + % otherwise assume pLaTeX-style tombow and set it to + % \paperwidth + 2in (similar for \stockheight) + \ifdim\stockwidth>\z@\else + \stockwidth\paperwidth \advance\stockwidth2in + \fi + \ifdim\stockheight>\z@\else + \stockheight\paperheight \advance\stockheight2in + \fi + \fi +} + +% prepare actual papersize special +\def\bddv@emit@papersize{% + \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 +} %% Since LaTeX2e 2020-10-01, \@begindocumenthook is deprecated %% and \UseHook{begindocument} etc. are used. %% This code appends papersize special to the _end_ of the hook. %% (Note: support for old dvips is removed.) -\ifx\AddToHook\@undefined\else - \AtBeginDocument{\AtBeginDvi{% - \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}} - \expandafter\endinput -\fi +\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} +\IfFormatAtLeastTF{2020-10-01}{% + \AtBeginDocument{% + \bddv@maybe@ensure@stock + \AtBeginDvi{\bddv@emit@papersize}}% + \endinput +}{} %% The rest of this package is meant for %% LaTeX2e 2020-02-02 PL5 or older. % following code is almost equivalent to % \AtBeginDocument{\AtBeginDvi{...}} -% however, we append the specification to the _beginning_ of -% \@begindocumenthook; this ensures proper papersize when -% dvips (TeX Live 2016 or earlier) is used. +% however, we put into the _beginning_ of \@begindocumenthook; +% this ensures proper papersize when old dvips +% (TeX Live 2016 or earlier) is used. +% also, note that old pLaTeX (before 2016/07/01) needs \yoko +% at the beginning of \AtBeginDvi. \begingroup -\def\@prependto@begindocumenthook{\global\setbox\@begindvibox - \vbox{\csname yoko\endcsname\unvbox\@begindvibox - \begingroup - \ifx\stockwidth\@undefined\else \ifdim\stockwidth>\z@ - \paperwidth\stockwidth - \fi\fi - \ifx\stockheight\@undefined\else \ifdim\stockheight>\z@ - \paperheight\stockheight - \fi\fi - \divide\paperwidth\@m\multiply\paperwidth\mag - \divide\paperheight\@m\multiply\paperheight\mag - \special{papersize=\the\paperwidth,\the\paperheight}% - \endgroup}} +\def\@prependto@begindocumenthook{% + \bddv@maybe@ensure@stock + \global\setbox\@begindvibox\vbox{% + \csname yoko\endcsname\unvbox\@begindvibox + \bddv@emit@papersize}} \toks@\expandafter\expandafter\expandafter {\expandafter\@prependto@begindocumenthook\@begindocumenthook} \xdef\@begindocumenthook{\the\toks@} diff --git a/Master/texmf-dist/tex/latex/gentombow/gentombow.sty b/Master/texmf-dist/tex/latex/gentombow/gentombow.sty index 396a8f3405b..bcd8093f50d 100644 --- a/Master/texmf-dist/tex/latex/gentombow/gentombow.sty +++ b/Master/texmf-dist/tex/latex/gentombow/gentombow.sty @@ -8,7 +8,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{gentombow} - [2019/07/21 v0.9k Generate crop mark 'tombow'] + [2020/10/14 v0.9l Generate crop mark 'tombow'] \def\pxgtmb@pkgname{gentombow} \@namedef{ver@pxgentombow.sty}{}% fake @@ -19,7 +19,8 @@ % case 2: pdfLaTeX etc. % case 1: pLaTeX2e <2018-04-01>+2 or older % case 0: pLaTeX2e <2018-05-20> or newer -\ifx\pfmtversion\@undefined +% --- checked plcore.ltx in platex 2020/09/28 v1.3g +\ifx\pfmtname\@undefined \@ifpackageloaded{luatexja}{}{\chardef\pxgtmb@errlevel=\tw@} \fi \ifnum\pxgtmb@errlevel<\tw@ @@ -615,12 +616,15 @@ \def\pxgtmb@driver{x} \fi % required for putting \special to every page - \ifx\pfmtname\@undefined - \RequirePackage{atbegshi} - \else - \IfFileExists{pxatbegshi.sty} - {\RequirePackage{pxatbegshi}} - {\RequirePackage{atbegshi}} + \RequirePackage{atbegshi} + \ifx\pfmtname\@undefined\else + \ifx\AtBegShi@Output\@undefined + % LaTeX2e 2020-10-01: an emulation by ``atbegshi-ltx.sty'' + % => pLaTeX2e 2020-10-01 natively supports it + \else + % older: the real ``atbegshi.sty'' is loaded + \IfFileExists{pxatbegshi.sty}{\RequirePackage{pxatbegshi}}{} + \fi \fi % do it \if x\pxgtmb@driver @@ -732,34 +736,8 @@ \@onlypreamble\settombowbleed %% patch internal of pdfpages.sty to work with tombow -%% (tested on pdfpages 2017/10/31 v0.5l) -%% Note the code is the same as that of pxpdfpages.sty, -%% but reserved here since gentombow.sty can be used on -%% any LaTeX format -%% (cf. pxpdfpages.sty is restricted to (u)pLaTeX) \def\pxgtmb@patch@pdfpages{% - \RequirePackage{etoolbox} - \patchcmd{\AM@output}{% - \setlength{\@tempdima}{\AM@xmargin}% - \edef\AM@xmargin{\the\@tempdima}% - \setlength{\@tempdima}{\AM@ymargin}% - \edef\AM@ymargin{\the\@tempdima}% - }{% - \setlength{\@tempdima}{\AM@xmargin\iftombow+1in\fi}% - \edef\AM@xmargin{\the\@tempdima}% - \setlength{\@tempdima}{\AM@ymargin\iftombow-1in\fi}% - \edef\AM@ymargin{\the\@tempdima}% - } - {\PackageInfo{\pxgtmb@pkgname}{Patch for pdfpages applied}} - {\PackageWarningNoLine{\pxgtmb@pkgname}{Patch for pdfpages failed}}% -} -%% however, if running (u)pLaTeX, use pxpdfpages.sty if available -\ifx\pfmtname\@undefined\else - \IfFileExists{pxpdfpages.sty}{% - \def\pxgtmb@patch@pdfpages{\RequirePackage{pxpdfpages}}% - }{} -\fi -%% do it + \IfFileExists{pxpdfpages.sty}{\RequirePackage{pxpdfpages}}{}} \AtBeginDocument{\@ifpackageloaded{pdfpages}{\pxgtmb@patch@pdfpages}{}} %% patch pdfx.sty diff --git a/Master/texmf-dist/tex/latex/gentombow/pxesopic.sty b/Master/texmf-dist/tex/latex/gentombow/pxesopic.sty new file mode 100644 index 00000000000..567b9d0a2d2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/gentombow/pxesopic.sty @@ -0,0 +1,239 @@ +% +% pxesopic.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the gentombow bundle. +% https://github.com/aminophen/gentombow +% +% This package is expected to be compatible with +% * eso-pic.sty +% 2015/07/21 v2.0g -- 2020/09/27 v2.0i +% +% -------------------------------------------------------------- +% [Note] +% The package ``pxesopic.sty'' relies heavily on internals +% of ``plautopatch.sty''. +% Also, ``pxesopic.sty'' is incompatible with ``memoir.cls''. +% -------------------------------------------------------------- +% + +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pxesopic} + [2020/10/11 v0.4c Patch to eso-pic for tombow] + +%% preparations +\def\pxesop@pkgname{pxesopic} +\def\pxesop@error{\PackageError\pxesop@pkgname} +\def\pxesop@warn{\PackageWarningNoLine\pxesop@pkgname} +\let\pxesop@debug\@gobble +%\def\pxesop@debug#1{\typeout{\pxesop@pkgname: [DEBUG] #1}}% for debug + +\@ifclassloaded{memoir}{% + \pxesop@warn{This package should not be loaded with memoir.cls}}{} + +\@ifpackageloaded{eso-pic}{% + \pxesop@error{% + Package eso-pic is already loaded!\MessageBreak + Load pxesopic earlier}\@ehc +}{} + +%% hooks +\ifx\declare@file@substitution\@undefined + % LaTeX2e 2020-02-02 PL5 or older + \RequirePackage{filehook} + \let\pxesop@ExecuteAfterPackage=\AtEndOfPackageFile + \let\pxesop@ExecuteBeforePackage=\AtBeginOfPackageFile +\else + % LaTeX2e 2020-10-01 or newer + \def\pxesop@ExecuteAfterPackage#1{\AddToHook{package/after/#1}} + \def\pxesop@ExecuteBeforePackage#1{\AddToHook{package/before/#1}} +\fi + +%% the contents of \AtBeginShipout is dependent on \iftombow; +%% delay execution of \AtBeginShipout inside ``eso-pic.sty'' +%% until \AtBeginDocument, to support both (u)pLaTeX kernel +%% and ``gentombow.sty'' +\RequirePackage{atbegshi}% eso-pic requires atbegshi +\ifx\pfmtname\@undefined\else + \ifx\AtBegShi@Output\@undefined + % LaTeX2e 2020-10-01: an emulation by ``atbegshi-ltx.sty'' + % => pLaTeX2e 2020-10-01 natively supports it + \else + % older: the real ``atbegshi.sty'' is loaded + \IfFileExists{pxatbegshi.sty}{\RequirePackage{pxatbegshi}}{} + \fi +\fi +% +\pxesop@ExecuteBeforePackage{eso-pic}{\pxesop@before} +\pxesop@ExecuteAfterPackage{eso-pic}{\pxesop@after} +% +\def\pxesop@before{% + \let\pxesop@AtBeginShipout\AtBeginShipout + \def\AtBeginShipout##1{\def\pxesop@hook{##1}}% hide it + \pxesop@debug{\noexpand\AtBeginShipout disabled}% + \let\pxesop@before\relax +} +\def\pxesop@after{% + \let\AtBeginShipout\pxesop@AtBeginShipout % restore + \let\pxesop@AtBeginShipout\relax + \pxesop@debug{\noexpand\AtBeginShipout restored}% + \let\@unknownoptionerror\relax %% avoid an error + \pxesop@debug{\noexpand\@unknownoptionerror disabled}% + \let\pxesop@after\relax +} +%% + +%% load it; be careful not to cause unknown option error! +\expandafter\ifx\csname @unknownoptionerror\endcsname + \pxesop@error{Failed to save \noexpand\@unknownoptionerror}\@ehc +\fi +\let\pxesop@unknownoptionerror\@unknownoptionerror +% +\chardef\pxesop@status\z@ +\@ifpackageloaded{plautopatch}{% + \expandafter\ifx\csname platpc@begin@eso-pic\endcsname\relax + % ``plautopatch.sty'' is loaded but the macro is \relax + % => means that ``pxesopic.sty'' is automatically loaded + \@ifl@t@r{\fmtversion}{2020/10/01}{% + \chardef\pxesop@status\@ne + }{}% + \fi +}{} +% +%% pass all options to keyval-style ``eso-pic.sty'' +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{eso-pic}} +\ProcessOptions\relax +\RequirePackage{eso-pic} +% +%% ensure internal dimensions added in ``eso-pic.sty'' v2.0i +\ifx\ESO@tempdima\@undefined \newdimen\ESO@tempdima \fi +\ifx\ESO@tempdimb\@undefined \newdimen\ESO@tempdimb \fi +% +%% recover the error +\ifnum\pxesop@status>\z@ % auto + \def\pxesop@pkgtohook{eso-pic}% + % note that ``plautopatch.sty'' discards the hook + % on LaTeX2e 2020-02-02 PL5 or older + \ifx\declare@file@substitution\@undefined + \let\pxesop@pkgtohook\pxesop@pkgname + % throw an error for unsupported usage + % [FIXME] the error below is actually unnecessary when + % none of ``eso-pic.sty'' options is used; how to detect that? + \pxesop@error{Try loading \pxesop@pkgname\space by hand}\@ehc + \fi +\else + \let\pxesop@pkgtohook\pxesop@pkgname +\fi +\pxesop@ExecuteAfterPackage\pxesop@pkgtohook{% + \let\@unknownoptionerror\pxesop@unknownoptionerror + \pxesop@debug{\noexpand\@unknownoptionerror restored}% +} +%% + +%% do it +%-- similar to bounddvi.sty (checked 2020/10/08 v8.2) +% detection of \iftombow availability is delayed until \AtBeginDocument, +% to support both (u)pLaTeX kernel and ``gentombow.sty'' +% Note: this package does not consider changing \iftombow status +% in the middle of a single document. +\AtBeginDocument{\pxesop@do} +\def\pxesop@do{% + \ifx\tombowtrue\@undefined + \pxesop@debug{Tombow feature unavailable, no patch applied}% + \let\pxesop@switch\pxesop@orig % skip if-tokens and restore + \fi + \pxesop@switch} +% +\def\pxesop@switch{% + \iftombow \pxesop@ensure@stock \pxesop@new + \else \pxesop@orig \fi} +% +\def\pxesop@ensure@stock{% + %\iftombow + % if \stockwidth/\stockheight are not available, + % define them now + \ifx\stockwidth\@undefined \newdimen\stockwidth \fi + \ifx\stockheight\@undefined \newdimen\stockheight \fi + % if \stockwidth already has effective value, do nothing; + % otherwise assume pLaTeX-style tombow and set it to + % \paperwidth + 2in (similar for \stockheight) + \ifdim\stockwidth>\z@\else + \stockwidth\paperwidth \advance\stockwidth2in + \fi + \ifdim\stockheight>\z@\else + \stockheight\paperheight \advance\stockheight2in + \fi + %\fi +} +%-- +% +%% for \iftombow is FALSE => restore from ``eso-pic.sty'' +\expandafter\def\expandafter\pxesop@orig\expandafter{% + \expandafter\AtBeginShipout\expandafter{\pxesop@hook}} +% +%% for \iftombow is TRUE => redefine by ``pxesopic.sty'' +\def\pxesop@new{% + %% \AtStockLowerLeft: based on TRUE of \ESO@isMEMOIR + \renewcommand\AtStockLowerLeft[1]{% + \begingroup + \ESO@tempdima=-\stockwidth + \advance\ESO@tempdima\paperwidth + \ESO@tempdimb=-\stockheight + \advance\ESO@tempdimb\paperheight + %% specific BEGIN + \advance\ESO@tempdima 1in\relax + \advance\ESO@tempdimb 1in\relax + \advance\ESO@tempdima \hoffset\relax + \advance\ESO@tempdimb \voffset\relax + %% specific END + \AtPageLowerLeft{% + \put(\LenToUnit{\ESO@tempdima},\LenToUnit{\ESO@tempdimb}){##1}% + }% + \endgroup + }% === + %% \AtStockUpperLeft: based on TRUE of \ESO@isMEMOIR + \renewcommand\AtStockUpperLeft[1]{% + \AtStockLowerLeft{% + \put(0,\LenToUnit{\stockheight}){##1}% + }% + }% === + %% \AtStockCenter: based on TRUE of \ESO@isMEMOIR + \renewcommand\AtStockCenter[1]{% + \AtStockLowerLeft{% + \put(\LenToUnit{.5\stockwidth},\LenToUnit{.5\stockheight}){##1}% + }% + }% + %% \AtTextUpperLeft: same as FALSE of \ESO@isMEMOIR + % (no change) + % + %% \AtBeginShipout: based on TRUE of \ESO@isMEMOIR + \AtBeginShipout{% + \ESO@tempdima=\dimexpr(\stockwidth-\paperwidth)/2\relax + \ESO@tempdimb=-\dimexpr(\stockheight+\paperheight)/2\relax + \ifESO@texcoord + \advance\ESO@tempdimb\paperheight % [FIXME] not sure! + \fi + %% specific BEGIN + \advance\ESO@tempdima -\hoffset\relax + \advance\ESO@tempdimb \voffset\relax + %% specific END + \nointerlineskip + \AtBeginShipoutUpperLeft{% + \put(\LenToUnit{\ESO@tempdima},\LenToUnit{\ESO@tempdimb}){% + \ESO@HookIIIBG\ESO@HookIBG\ESO@HookIIBG + \global\let\ESO@HookIIBG\@empty + }% + }% + \AtBeginShipoutUpperLeftForeground{% + \put(\LenToUnit{\ESO@tempdima},\LenToUnit{\ESO@tempdimb}){% + \ESO@HookIFG\ESO@HookIIFG\ESO@HookIIIFG + \global\let\ESO@HookIIFG\@empty + }% + }% + }% === +} +%% + +\endinput +%% EOF diff --git a/Master/texmf-dist/tex/latex/gentombow/pxgentombow.sty b/Master/texmf-dist/tex/latex/gentombow/pxgentombow.sty index ab28b38bb19..bd94b4bceec 100644 --- a/Master/texmf-dist/tex/latex/gentombow/pxgentombow.sty +++ b/Master/texmf-dist/tex/latex/gentombow/pxgentombow.sty @@ -8,7 +8,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pxgentombow} - [2018/05/17 v0.9g Generate crop mark 'tombow'] + [2020/10/14 v0.9l Generate crop mark 'tombow'] \PackageWarningNoLine{pxgentombow}{% Package `pxgentombow' is now superseded by\MessageBreak `gentombow', use `gentombow' instead} diff --git a/Master/texmf-dist/tex/latex/gentombow/pxpdfpages.sty b/Master/texmf-dist/tex/latex/gentombow/pxpdfpages.sty new file mode 100644 index 00000000000..ad86ea819bf --- /dev/null +++ b/Master/texmf-dist/tex/latex/gentombow/pxpdfpages.sty @@ -0,0 +1,72 @@ +% +% pxpdfpages.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the gentombow bundle. +% https://github.com/aminophen/gentombow +% +% This package is expected to be compatible with +% * pdfpages.sty +% (2015/07/19 v0.5a -- 2020/01/28 v0.5q) +% + +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pxpdfpages} + [2020/10/11 v0.4c Patch to pdfpages for tombow] + +%% preparations +\def\pxpdpg@pkgname{pxpdfpages} +\def\pxpdpg@warn{\PackageWarningNoLine\pxpdpg@pkgname} +\def\pxpdpg@info{\PackageInfo\pxpdpg@pkgname} +\let\pxpdpg@debug\@gobble +%\def\pxpdpg@debug#1{\typeout{\pxpdpg@pkgname: [DEBUG] #1}}% for debug + +%% load it +\RequirePackageWithOptions{pdfpages}% pdfpages requires atbegshi +\ifx\pfmtname\@undefined\else + \ifx\AtBegShi@Output\@undefined + % LaTeX2e 2020-10-01: an emulation by ``atbegshi-ltx.sty'' + % => pLaTeX2e 2020-10-01 natively supports it + \else + % older: the real ``atbegshi.sty'' is loaded + \IfFileExists{pxatbegshi.sty}{\RequirePackage{pxatbegshi}}{} + \fi +\fi + +%% do it +%-- similar to bounddvi.sty (checked 2020/10/08 v8.2) +% detection of \iftombow availability is delayed until \AtBeginDocument, +% to support both (u)pLaTeX kernel and ``gentombow.sty'' +\AtBeginDocument{\pxpdpg@do} +\def\pxpdpg@do{% + \ifx\tombowtrue\@undefined + \pxpdpg@debug{Tombow feature unavailable, no patch applied}% + \let\pxpdpg@switch\relax % do nothing + \fi + \pxpdpg@switch} +% +\def\pxpdpg@switch{\pxpdpg@patch@pdfpages} + +%% patch internal for pdfpages to work with tombow +%-- Note: this code should be copied to gentombow.sty! +\def\pxpdpg@patch@pdfpages{% + \RequirePackage{etoolbox} + \patchcmd{\AM@output}{% + \setlength{\@tempdima}{\AM@xmargin}% + \edef\AM@xmargin{\the\@tempdima}% + \setlength{\@tempdima}{\AM@ymargin}% + \edef\AM@ymargin{\the\@tempdima}% + }{% + \setlength{\@tempdima}{\AM@xmargin\iftombow+1in\fi}% + \edef\AM@xmargin{\the\@tempdima}% + \setlength{\@tempdima}{\AM@ymargin\iftombow-1in\fi}% + \edef\AM@ymargin{\the\@tempdima}% + }% + {\pxpdpg@info{Patch for pdfpages applied}}% + {\pxpdpg@warn{Patch for pdfpages failed}}% +} + +%% all done + +\endinput diff --git a/Master/texmf-dist/tex/latex/gentombow/pxtextpos.sty b/Master/texmf-dist/tex/latex/gentombow/pxtextpos.sty new file mode 100644 index 00000000000..02cd5202e21 --- /dev/null +++ b/Master/texmf-dist/tex/latex/gentombow/pxtextpos.sty @@ -0,0 +1,108 @@ +% +% pxtextpos.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the gentombow bundle. +% https://github.com/aminophen/gentombow +% +% This package is expected to be compatible with +% * textpos.sty +% 2005/10/13 v1.6a -- 2019/04/15 v1.9.1 +% + +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pxtextpos} + [2020/10/11 v0.4b Patch to textpos for tombow] + +%% preparations +\def\pxtxtpos@pkgname{pxtextpos} +\def\pxtxtpos@warn{\PackageWarningNoLine\pxtxtpos@pkgname} +\let\pxtxtpos@debug\@gobble +%\def\pxtxtpos@debug#1{\typeout{\pxtxtpos@pkgname: [DEBUG] #1}}% for debug + +%% load it +\RequirePackageWithOptions{textpos} +% textpos requires everyshi, only if both conditions are met: +% (1) \fmtversion is **older** than 2020/10/01 +% (2) \ifTP@abspos == \iftrue +% [TODO] tate-mode support is incomplete! +\ifx\pfmtname\@undefined\else + \ifx\@EveryShipout@Output\@undefined + % LaTeX2e 2020-10-01: an emulation by ``everyshi-ltx.sty'' + % => pLaTeX2e 2020-10-01 natively supports it + \else + % older: the real ``everyshi.sty'' is loaded + \IfFileExists{pxeveryshi.sty}{\RequirePackage{pxeveryshi}}{} + \fi +\fi + +%% do it +%-- similar to bounddvi.sty (checked 2020/10/08 v8.2) +% detection of \iftombow availability is delayed until \AtBeginDocument, +% to support both (u)pLaTeX kernel and ``gentombow.sty'' +\AtBeginDocument{\pxtxtpos@do} +\def\pxtxtpos@do{% + \ifx\tombowtrue\@undefined + \pxtxtpos@debug{Tombow feature unavailable, no patch applied}% + \let\pxtxtpos@switch\relax % do nothing + \fi + \pxtxtpos@switch} +% +\def\pxtxtpos@switch{% + \let\textblockorigin\pxtxtpos@textblockorigin + \ifTP@abspos\textblockorigin{0pt}{0pt}\fi %% reset +} + +%% known definition +\def\pxtxtpos@textblockorigin#1#2{% + \ifTP@abspos + \TP@ox=-1in \addtolength\TP@ox{#1} + \TP@oy=-1in \addtolength\TP@oy{#2} + \ifTP@chatter\typeout{TextBlockOrigin set to #1 x #2}\fi + \else + \PackageError{textpos} + {The \protect\textblockorigin\space command\MessageBreak + may only be used if the package was given\MessageBreak + the`absolute' option when it was invoked} + {If you want to use the \protect\textblockorigin\space command, then + \MessageBreak + invoke the package with the syntax\MessageBreak + \protect\usepackage[absolute]{textpos}} + \fi +} +\@onlypreamble\pxtxtpos@textblockorigin + +%% check definition +\ifx\textblockorigin\pxtxtpos@textblockorigin\else + \pxtxtpos@warn{% + Command \noexpand\textblockorigin is beyond my knowledge.\MessageBreak + I will apply the patch anyway, but it may break:\MessageBreak + Please report to the author of `\pxtxtpos@pkgname.sty'} +\fi + +%% new definition +\def\pxtxtpos@textblockorigin#1#2{% + \ifTP@abspos + \TP@ox=-1in \addtolength\TP@ox{#1} + \TP@oy=-1in \addtolength\TP@oy{#2} + %%% addition + \iftombow + \addtolength\TP@ox{1in}\addtolength\TP@oy{1in} + \fi + %%% + \ifTP@chatter\typeout{TextBlockOrigin set to #1 x #2}\fi + \else + \PackageError{textpos} + {The \protect\textblockorigin\space command\MessageBreak + may only be used if the package was given\MessageBreak + the`absolute' option when it was invoked} + {If you want to use the \protect\textblockorigin\space command, then + \MessageBreak + invoke the package with the syntax\MessageBreak + \protect\usepackage[absolute]{textpos}} + \fi +} + +\endinput +%% EOF -- cgit v1.2.3