diff options
author | Karl Berry <karl@freefriends.org> | 2018-08-30 19:35:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-08-30 19:35:06 +0000 |
commit | a05022b9d4b59c110ad226ec4428e762919fa82d (patch) | |
tree | 49659fc88dfb3adabb7fbe139e1376b60a380ecc | |
parent | 2ef7201046ce3e99ade2f2791ceabd36a100e33e (diff) |
gentombow (30aug18)
git-svn-id: svn://tug.org/texlive/trunk@48512 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/gentombow/README.md | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf | bin | 202256 -> 204758 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/gentombow/gentombow.pdf | bin | 144379 -> 145506 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/gentombow/gentombow.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/gentombow/gentombow.sty | 174 |
6 files changed, 129 insertions, 66 deletions
diff --git a/Master/texmf-dist/doc/latex/gentombow/README.md b/Master/texmf-dist/doc/latex/gentombow/README.md index babf2da6f55..b9f5aad6a77 100644 --- a/Master/texmf-dist/doc/latex/gentombow/README.md +++ b/Master/texmf-dist/doc/latex/gentombow/README.md @@ -44,6 +44,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2018-08-20 +2018-08-30 Hironobu Yamashita diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf Binary files differindex f2a5eeb2ce6..39b9af65aae 100644 --- a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf +++ b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex index 2e9ab803182..d3135878c79 100644 --- a/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex +++ b/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex @@ -263,7 +263,7 @@ OpenTypeフォントを直接利用することもできます。}。 \subsection{塗り足し(ドブ)の幅} -デフォルトでは塗り足し(塗り足し)の幅は3~mmですが、 +デフォルトでは塗り足し(ドブ)の幅は3~mmですが、 \verb+\settombowbleed{5mm}+とすると5~mmになります。 命令の引数には任意の寸法を与えることができますが、実用上は数mmでしょう。 @@ -311,18 +311,23 @@ CMYKの版ごとにトンボを作成する場合や、特色のトンボが必 これは、\textsf{jsclasses}クラス内で行われる\verb+\oddsidemargin+と \verb+\topmargin+の計算の都合からくる制約です。たとえば \begin{verbatim} - \documentclass[a4j,14pt]{jarticle} + \documentclass[a4j,14pt]{jsarticle} \usepackage{gentombow} \end{verbatim} という使い方は\emph{誤り}です(このままでは誤った余白設定が 適用されますので、安全のため\textsf{gentombow}パッケージ がエラーを出すようにしてあります)。代わりに \begin{verbatim} - \documentclass[a4j,14pt,tombow]{jarticle} + \documentclass[a4j,14pt,tombow]{jsarticle} \usepackage{gentombow} \end{verbatim} と書くようにしてください。 +また、塗り足しの幅などの寸法指定は\verb+true+付きの単位を +使用してください。例えば +\verb+\settombowbleed{3truemm}+と指定すれば、 +\verb+\mag+による版面拡大(縮小)後の塗り足し幅を3~mmにできます。 + 同様に、ZR氏による\textsf{BXjscls}のクラスを使用していて、10pt以外の サイズオプションを指定する場合は \begin{itemize} @@ -435,6 +440,10 @@ $30\,\mathrm{mm}$にしたいとき\footnote{ここでは「本文の領域以 \verb+\settombowbleed+, \verb+\settombowcolor+の追加 \item 2018/08/20 v0.9h 用紙サイズ検出に\texttt{hagaki}を追加、 \textsf{pdfpages}対策の改良 + \item 2018/08/30 v0.9j \textsf{jsclasses}の$\verb+\mag+ \ne 1000$でも + \verb+pdfbox+オプションが正常動作するように改良、 + \verb+\settombowbleed+が\verb+/TrimBox+に反映されな + かったバグの修正 \end{itemize} \end{document} diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf b/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf Binary files differindex 231c356f4d4..0c0ea28b5d7 100644 --- a/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf +++ b/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf diff --git a/Master/texmf-dist/doc/latex/gentombow/gentombow.tex b/Master/texmf-dist/doc/latex/gentombow/gentombow.tex index 73745059211..ed7c134f3bf 100644 --- a/Master/texmf-dist/doc/latex/gentombow/gentombow.tex +++ b/Master/texmf-dist/doc/latex/gentombow/gentombow.tex @@ -289,6 +289,10 @@ or \verb+\topmargin+, or leave it to \textsf{geometry} package. \verb+\settombowcolor+. \item 2018/08/20 v0.9h Add \texttt{hagaki} size for paper detection, improve patches for \textsf{pdfpages}. + \item 2018/08/30 v0.9j Support \textsf{jsclasses}-style \verb+\mag+ employment + also with \verb+pdfbox+ option. + Fix a bug that \verb+\settombowbleed+ is not + considered by \verb+/TrimBox+. \end{itemize} \end{document} diff --git a/Master/texmf-dist/tex/latex/gentombow/gentombow.sty b/Master/texmf-dist/tex/latex/gentombow/gentombow.sty index 94f84d3cac7..6433b6da9cb 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} - [2018/08/20 v0.9h Generate crop mark 'tombow'] + [2018/08/30 v0.9j Generate crop mark 'tombow'] \def\pxgtmb@pkgname{gentombow} \@namedef{ver@pxgentombow.sty}{}% fake @@ -239,6 +239,19 @@ some derived class. Try adding `nomag' or\MessageBreak `nomag*' to the class option list}\@ehc \fi + % if \mag != 1000 and \inv@mag is defined, assume jsclasses-style \mag employment + \ifx\inv@mag\@undefined\else + % \pxgtmb@magscale is almost equivalent to \jsc@magscale (introduced around 2016) + % but defined only when \mag is actually employed + \begingroup + % calculation code borrowed from BXjscls + \@tempcnta=\mag + \advance\@tempcnta100000\relax + \def\pxgtmb@tempa#1#2#3#4\@nil{\@tempdima=#2#3.#4\p@} + \expandafter\pxgtmb@tempa\the\@tempcnta\@nil + \xdef\pxgtmb@magscale{\strip@pt\@tempdima} + \endgroup + \fi \fi %% this package will use tombo feature in pLaTeX kernel @@ -252,13 +265,13 @@ % In order to force `jsclasses' to calculate correctly, % `tombow' or `tombo' is required as a class option. % ... or, you may add `nomag' or `nomag*' instead. - \ifnum\mag=\@m\else \ifx\inv@mag\@undefined\else + \ifx\pxgtmb@magscale\@undefined\else \PackageError{\pxgtmb@pkgname}{% It seems you are using Japanese `jsclasses'\MessageBreak (jsarticle, jsbook, jsreport, etc.) or some\MessageBreak derived class. Please add `tombow' or `tombo'\MessageBreak to the class option list}\@ehc - \fi \fi + \fi % BXjscls is already checked above, no check here \PackageInfo\pxgtmb@pkgname{tombow feature enabled by \pxgtmb@pkgname} \fi @@ -271,8 +284,8 @@ \space\two@digits\hour:\two@digits\minute)} %% prepare dimension -\ifx\stockheight\@undefined \newdimen\stockheight \fi \ifx\stockwidth\@undefined \newdimen\stockwidth \fi +\ifx\stockheight\@undefined \newdimen\stockheight \fi %% prepare flag \newif\ifpxgtmb@switch \pxgtmb@switchfalse @@ -321,11 +334,11 @@ % \@ovri and \@ovro are used temporarily (safe enough) \@ovri=#3\relax \@ovro=#4\relax - % if \mag != 1000 and \inv@mag is defined, assume jsclasses-style \mag employment - \ifnum\mag=\@m\else \ifx\inv@mag\@undefined\else + % when jsclasses-style \mag employment is assumed ... + \ifx\pxgtmb@magscale\@undefined\else \@ovri=\inv@mag\@ovri\relax \@ovro=\inv@mag\@ovro\relax - \fi \fi + \fi % compare \ifdim\@tempdima=\@ovri\relax \ifdim\@tempdimb=\@ovro\relax \def\pxgtmb@guessedpaper{#2}% @@ -366,11 +379,11 @@ \setlength\stockwidth{#1}% \setlength\stockheight{#2}% \fi - % if \mag != 1000 and \inv@mag is defined, assume jsclasses-style \mag employment - \ifnum\mag=\@m\else \ifx\inv@mag\@undefined\else + % when jsclasses-style \mag employment is assumed ... + \ifx\pxgtmb@magscale\@undefined\else \stockwidth=\inv@mag\stockwidth\relax \stockheight=\inv@mag\stockheight\relax - \fi \fi + \fi }% \@onlypreamble\pxgtmb@addpapersize \@onlypreamble\pxgtmb@addp@persize @@ -491,51 +504,52 @@ Is this really what you want?} \fi -%% make tombow box according to tombowdate & \@tombowwidth status -\maketombowbox - -%% shift amount -\hoffset .5\stockwidth -\advance\hoffset -.5\paperwidth -\advance\hoffset-1truein\relax -\voffset .5\stockheight -\advance\voffset -.5\paperheight -\advance\voffset-1truein\relax - %% pdf "digital tombo" (driver-dependent) +% the box size calculation is delayed until \AtBeginDocument +% to allow users to change \@tombowbleed in the preamble \if 1\pxgtmb@pdfbox@status -\begingroup +% convert pt -> bp \def\pxgtmb@PDF@setbp#1#2{% \@tempdima=.996264#2\relax % 0.996264 = 72/72.27 (cf. 1in = 72.27pt = 72bp) + \@tempdima=\pxgtmb@magscale\@tempdima % adjustment for jsclasses-style \mag employment \edef#1{\strip@pt\@tempdima}} -%\pxgtmb@PDF@setbp\pxgtmb@PDF@crop@ur@x\stockwidth -%\pxgtmb@PDF@setbp\pxgtmb@PDF@crop@ur@y\stockheight -\pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ll@x{\dimexpr(\stockwidth-\paperwidth)/2} -\pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ll@y{\dimexpr(\stockheight-\paperheight)/2} -\pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ur@x{\dimexpr(\stockwidth+\paperwidth)/2} -\pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ur@y{\dimexpr(\stockheight+\paperheight)/2} -\pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ll@x{\dimexpr(\stockwidth-\paperwidth)/2-3mm} -\pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ll@y{\dimexpr(\stockheight-\paperheight)/2-3mm} -\pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ur@x{\dimexpr(\stockwidth+\paperwidth)/2+3mm} -\pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ur@y{\dimexpr(\stockheight+\paperheight)/2+3mm} -\xdef\pxgtmb@PDF@CTM{% - %% CropBox: implicit (same as MediaBox, large paper size) - %/CropBox [0 0 \pxgtmb@PDF@crop@ur@x\space \pxgtmb@PDF@crop@ur@y] - %% BleedBox: explicit (final paper size + surrounding 3mm) - \noexpand\pxgtmb@PDF@begin - /BleedBox [\pxgtmb@PDF@bleed@ll@x\space - \pxgtmb@PDF@bleed@ll@y\space - \pxgtmb@PDF@bleed@ur@x\space - \pxgtmb@PDF@bleed@ur@y] \noexpand\pxgtmb@PDF@end - %% TrimBox: explicit (final paper size) - \noexpand\pxgtmb@PDF@begin - /TrimBox [\pxgtmb@PDF@trim@ll@x\space - \pxgtmb@PDF@trim@ll@y\space - \pxgtmb@PDF@trim@ur@x\space - \pxgtmb@PDF@trim@ur@y] \noexpand\pxgtmb@PDF@end - %% ArtBox: implicit +% calculate and create pdf boxes +\def\pxgtmb@PDF@calcbox{% + \begingroup + % provide fallback definition inside this group + \ifx\pxgtmb@magscale\@undefined + \def\pxgtmb@magscale{1}% + \fi + % set pdf boxes in bp unit + %\pxgtmb@PDF@setbp\pxgtmb@PDF@crop@ur@x\stockwidth + %\pxgtmb@PDF@setbp\pxgtmb@PDF@crop@ur@y\stockheight + \pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ll@x{\dimexpr(\stockwidth-\paperwidth)/2}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ll@y{\dimexpr(\stockheight-\paperheight)/2}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ur@x{\dimexpr(\stockwidth+\paperwidth)/2}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@trim@ur@y{\dimexpr(\stockheight+\paperheight)/2}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ll@x{\dimexpr(\stockwidth-\paperwidth)/2-\@tombowbleed}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ll@y{\dimexpr(\stockheight-\paperheight)/2-\@tombowbleed}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ur@x{\dimexpr(\stockwidth+\paperwidth)/2+\@tombowbleed}% + \pxgtmb@PDF@setbp\pxgtmb@PDF@bleed@ur@y{\dimexpr(\stockheight+\paperheight)/2+\@tombowbleed}% + \xdef\pxgtmb@PDF@CTM{% + %% CropBox: implicit (same as MediaBox, large paper size) + %/CropBox [0 0 \pxgtmb@PDF@crop@ur@x\space \pxgtmb@PDF@crop@ur@y] + %% BleedBox: explicit (final paper size + surrounding \@tombowbleed) + \noexpand\pxgtmb@PDF@begin + /BleedBox [\pxgtmb@PDF@bleed@ll@x\space + \pxgtmb@PDF@bleed@ll@y\space + \pxgtmb@PDF@bleed@ur@x\space + \pxgtmb@PDF@bleed@ur@y] \noexpand\pxgtmb@PDF@end + %% TrimBox: explicit (final paper size) + \noexpand\pxgtmb@PDF@begin + /TrimBox [\pxgtmb@PDF@trim@ll@x\space + \pxgtmb@PDF@trim@ll@y\space + \pxgtmb@PDF@trim@ur@x\space + \pxgtmb@PDF@trim@ur@y] \noexpand\pxgtmb@PDF@end + %% ArtBox: implicit + }% + \endgroup } -\endgroup %% supported drivers: dvips, dvipdfmx, XeTeX, pdfTeX, LuaTeX \ifnum0\ifx\pdfvariable\@undefined\else\the\outputmode\fi=0\relax \ifnum0\ifx\pdfpageattr\@undefined\else\the\pdfoutput\fi=0\relax @@ -593,8 +607,10 @@ % do it \if x\pxgtmb@driver %% for XeTeX (similar to dvipdfmx, except for paper size) - \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{} - \edef\pxgtmb@PDF@CTM{{pdf:put @thispage << \pxgtmb@PDF@CTM >>}} + \AtBeginDocument{% + \pxgtmb@PDF@calcbox + \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{}% + \edef\pxgtmb@PDF@CTM{{pdf:put @thispage << \pxgtmb@PDF@CTM >>}}} % force paper size \pdfpagewidth\stockwidth \pdfpageheight\stockheight % emit pdf boxes @@ -605,21 +621,36 @@ \else \if s\pxgtmb@driver %% for dvips - \def\pxgtmb@PDF@begin{[ }\def\pxgtmb@PDF@end{/PAGE pdfmark } - \edef\pxgtmb@PDF@CTM{{ps:SDict begin \pxgtmb@PDF@CTM end}} + \AtBeginDocument{% + \pxgtmb@PDF@calcbox + \def\pxgtmb@PDF@begin{[ }\def\pxgtmb@PDF@end{/PAGE pdfmark }% + \edef\pxgtmb@PDF@CTM{{ps:SDict begin \pxgtmb@PDF@CTM end}}} \else\if m\pxgtmb@driver %% for dvipdfmx - \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{} - \edef\pxgtmb@PDF@CTM{{pdf:put @thispage << \pxgtmb@PDF@CTM >>}} + \AtBeginDocument{% + \pxgtmb@PDF@calcbox + \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{}% + \edef\pxgtmb@PDF@CTM{{pdf:put @thispage << \pxgtmb@PDF@CTM >>}}} \else %% for others (in case graphics option wrong) \PackageError{\pxgtmb@pkgname}{Sorry, driver unsupported}\@ehc \def\pxgtmb@PDF@CTM{{}}% dummy \fi\fi + %% common + \begingroup + % when jsclasses-style \mag employment is assumed ... + % [Note] \special{papersize=<width>,<height>} accepts only non-true units + % and evaluates them as if they were true units! + \ifx\pxgtmb@magscale\@undefined\else + \stockwidth \pxgtmb@magscale\stockwidth + \stockheight\pxgtmb@magscale\stockheight + \fi + \xdef\pxgtmb@PDF@size{{papersize=\the\stockwidth,\the\stockheight}} + \endgroup \AtBeginShipout{\setbox\AtBeginShipoutBox=\vbox{% \baselineskip\z@skip\lineskip\z@skip\lineskiplimit\z@ % force paper size - \special{papersize=\the\stockwidth,\the\stockheight}% + \expandafter\special\pxgtmb@PDF@size % emit pdf boxes \expandafter\special\pxgtmb@PDF@CTM % here! \copy\AtBeginShipoutBox}} @@ -627,25 +658,41 @@ \else %% for pdfTeX \def\pxgtmb@driver{p} - \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{} - \edef\pxgtmb@PDF@CTM{{\pxgtmb@PDF@CTM}} % force paper size \pdfpagewidth\stockwidth \pdfpageheight\stockheight % emit pdf boxes - \expandafter\pdfpageattr\pxgtmb@PDF@CTM + \AtBeginDocument{% + \pxgtmb@PDF@calcbox + \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{}% + \edef\pxgtmb@PDF@CTM{{\pxgtmb@PDF@CTM}}% + \expandafter\pdfpageattr\pxgtmb@PDF@CTM} \fi \else %% for LuaTeX \def\pxgtmb@driver{l} - \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{} - \edef\pxgtmb@PDF@CTM{pageattr{\pxgtmb@PDF@CTM}} % force paper size \pagewidth\stockwidth \pageheight\stockheight % emit pdf boxes - \expandafter\pdfvariable\pxgtmb@PDF@CTM + \AtBeginDocument{% + \pxgtmb@PDF@calcbox + \def\pxgtmb@PDF@begin{}\def\pxgtmb@PDF@end{}% + \edef\pxgtmb@PDF@CTM{pageattr{\pxgtmb@PDF@CTM}}% + \expandafter\pdfvariable\pxgtmb@PDF@CTM} \fi \fi +%% make visible tombow box according to the current status of +%% \@bannerfont, \@bannertoken, \@tombowwidth & \@tombowbleed +\maketombowbox + +%% shift amount +\hoffset .5\stockwidth +\advance\hoffset -.5\paperwidth +\advance\hoffset-1truein\relax +\voffset .5\stockheight +\advance\voffset -.5\paperheight +\advance\voffset-1truein\relax + %% user interface \newcommand{\settombowbanner}[1]{% \iftombowdate\else @@ -662,6 +709,9 @@ \def\@tombowbleed{#1}\maketombowbox} \newcommand{\settombowcolor}[1]{% \def\@tombowcolor{#1}} +% forbid changing \@tombowbleed after \begin{document} +% because pdf boxes are calculated only inside \AtBeginDocument +\@onlypreamble\settombowbleed %% patch internal for pdfpages to work with tombow %% (tested on pdfpages 2017/10/31 v0.5l) |