texlive[48512] Master/texmf-dist: gentombow (30aug18)

commits+karl at tug.org commits+karl at tug.org
Thu Aug 30 21:35:06 CEST 2018


Revision: 48512
          http://tug.org/svn/texlive?view=revision&revision=48512
Author:   karl
Date:     2018-08-30 21:35:06 +0200 (Thu, 30 Aug 2018)
Log Message:
-----------
gentombow (30aug18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/gentombow/README.md
    trunk/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf
    trunk/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex
    trunk/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf
    trunk/Master/texmf-dist/doc/latex/gentombow/gentombow.tex
    trunk/Master/texmf-dist/tex/latex/gentombow/gentombow.sty

Modified: trunk/Master/texmf-dist/doc/latex/gentombow/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/gentombow/README.md	2018-08-30 19:34:51 UTC (rev 48511)
+++ trunk/Master/texmf-dist/doc/latex/gentombow/README.md	2018-08-30 19:35:06 UTC (rev 48512)
@@ -44,6 +44,6 @@
 
 ## Release Date
 
-2018-08-20
+2018-08-30
 
 Hironobu Yamashita

Modified: trunk/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex	2018-08-30 19:34:51 UTC (rev 48511)
+++ trunk/Master/texmf-dist/doc/latex/gentombow/gentombow-ja.tex	2018-08-30 19:35:06 UTC (rev 48512)
@@ -263,7 +263,7 @@
 
 \subsection{塗り足し(ドブ)の幅}
 
-デフォルトでは塗り足し(塗り足し)の幅は3~mmですが、
+デフォルトでは塗り足し(ドブ)の幅は3~mmですが、
 \verb+\settombowbleed{5mm}+とすると5~mmになります。
 命令の引数には任意の寸法を与えることができますが、実用上は数mmでしょう。
 
@@ -311,7 +311,7 @@
 これは、\textsf{jsclasses}クラス内で行われる\verb+\oddsidemargin+と
 \verb+\topmargin+の計算の都合からくる制約です。たとえば
 \begin{verbatim}
-  \documentclass[a4j,14pt]{jarticle}
+  \documentclass[a4j,14pt]{jsarticle}
   \usepackage{gentombow}
 \end{verbatim}
 という使い方は\emph{誤り}です(このままでは誤った余白設定が
@@ -318,11 +318,16 @@
 適用されますので、安全のため\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 @@
                          \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}

Modified: trunk/Master/texmf-dist/doc/latex/gentombow/gentombow.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/gentombow/gentombow.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/gentombow/gentombow.tex	2018-08-30 19:34:51 UTC (rev 48511)
+++ trunk/Master/texmf-dist/doc/latex/gentombow/gentombow.tex	2018-08-30 19:35:06 UTC (rev 48512)
@@ -289,6 +289,10 @@
                          \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}

Modified: trunk/Master/texmf-dist/tex/latex/gentombow/gentombow.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/gentombow/gentombow.sty	2018-08-30 19:34:51 UTC (rev 48511)
+++ trunk/Master/texmf-dist/tex/latex/gentombow/gentombow.sty	2018-08-30 19:35:06 UTC (rev 48512)
@@ -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 at pkgname{gentombow}
 \@namedef{ver at 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 at mag is defined, assume jsclasses-style \mag employment
+  \ifx\inv at mag\@undefined\else
+    % \pxgtmb at magscale is almost equivalent to \jsc at 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 at tempa#1#2#3#4\@nil{\@tempdima=#2#3.#4\p@}
+      \expandafter\pxgtmb at tempa\the\@tempcnta\@nil
+      \xdef\pxgtmb at magscale{\strip at 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 at mag\@undefined\else
+  \ifx\pxgtmb at magscale\@undefined\else
     \PackageError{\pxgtmb at 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 at pkgname{tombow feature enabled by \pxgtmb at pkgname}
 \fi
@@ -271,8 +284,8 @@
   \space\two at digits\hour:\two at digits\minute)}
 
 %% prepare dimension
+\ifx\stockwidth\@undefined  \newdimen\stockwidth  \fi
 \ifx\stockheight\@undefined \newdimen\stockheight \fi
-\ifx\stockwidth\@undefined  \newdimen\stockwidth  \fi
 
 %% prepare flag
 \newif\ifpxgtmb at switch    \pxgtmb at switchfalse
@@ -321,11 +334,11 @@
     % \@ovri and \@ovro are used temporarily (safe enough)
     \@ovri=#3\relax
     \@ovro=#4\relax
-    % if \mag != 1000 and \inv at mag is defined, assume jsclasses-style \mag employment
-    \ifnum\mag=\@m\else \ifx\inv at mag\@undefined\else
+    % when jsclasses-style \mag employment is assumed ...
+    \ifx\pxgtmb at magscale\@undefined\else
       \@ovri=\inv at mag\@ovri\relax
       \@ovro=\inv at mag\@ovro\relax
-    \fi \fi
+    \fi
     % compare
     \ifdim\@tempdima=\@ovri\relax \ifdim\@tempdimb=\@ovro\relax
       \def\pxgtmb at guessedpaper{#2}%
@@ -366,11 +379,11 @@
     \setlength\stockwidth{#1}%
     \setlength\stockheight{#2}%
   \fi
-  % if \mag != 1000 and \inv at mag is defined, assume jsclasses-style \mag employment
-  \ifnum\mag=\@m\else \ifx\inv at mag\@undefined\else
+  % when jsclasses-style \mag employment is assumed ...
+  \ifx\pxgtmb at magscale\@undefined\else
     \stockwidth=\inv at mag\stockwidth\relax
     \stockheight=\inv at mag\stockheight\relax
-  \fi \fi
+  \fi
 }%
 \@onlypreamble\pxgtmb at addpapersize
 \@onlypreamble\pxgtmb at 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 at pdfbox@status
-\begingroup
+% convert pt -> bp
 \def\pxgtmb at PDF@setbp#1#2{%
   \@tempdima=.996264#2\relax % 0.996264 = 72/72.27 (cf. 1in = 72.27pt = 72bp)
+  \@tempdima=\pxgtmb at magscale\@tempdima % adjustment for jsclasses-style \mag employment
   \edef#1{\strip at pt\@tempdima}}
-%\pxgtmb at PDF@setbp\pxgtmb at PDF@crop at ur@x\stockwidth
-%\pxgtmb at PDF@setbp\pxgtmb at PDF@crop at ur@y\stockheight
-\pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ll@x{\dimexpr(\stockwidth-\paperwidth)/2}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ll@y{\dimexpr(\stockheight-\paperheight)/2}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ur@x{\dimexpr(\stockwidth+\paperwidth)/2}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ur@y{\dimexpr(\stockheight+\paperheight)/2}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ll@x{\dimexpr(\stockwidth-\paperwidth)/2-3mm}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ll@y{\dimexpr(\stockheight-\paperheight)/2-3mm}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ur@x{\dimexpr(\stockwidth+\paperwidth)/2+3mm}
-\pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ur@y{\dimexpr(\stockheight+\paperheight)/2+3mm}
-\xdef\pxgtmb at PDF@CTM{%
-  %% CropBox: implicit (same as MediaBox, large paper size)
-  %/CropBox  [0 0 \pxgtmb at PDF@crop at ur@x\space \pxgtmb at PDF@crop at ur@y]
-  %% BleedBox: explicit (final paper size + surrounding 3mm)
-  \noexpand\pxgtmb at PDF@begin
-  /BleedBox [\pxgtmb at PDF@bleed at ll@x\space
-             \pxgtmb at PDF@bleed at ll@y\space
-             \pxgtmb at PDF@bleed at ur@x\space
-             \pxgtmb at PDF@bleed at ur@y] \noexpand\pxgtmb at PDF@end
-  %% TrimBox: explicit (final paper size)
-  \noexpand\pxgtmb at PDF@begin
-  /TrimBox  [\pxgtmb at PDF@trim at ll@x\space
-             \pxgtmb at PDF@trim at ll@y\space
-             \pxgtmb at PDF@trim at ur@x\space
-             \pxgtmb at PDF@trim at ur@y] \noexpand\pxgtmb at PDF@end
-  %% ArtBox: implicit
+% calculate and create pdf boxes
+\def\pxgtmb at PDF@calcbox{%
+  \begingroup
+  % provide fallback definition inside this group
+  \ifx\pxgtmb at magscale\@undefined
+    \def\pxgtmb at magscale{1}%
+  \fi
+  % set pdf boxes in bp unit
+  %\pxgtmb at PDF@setbp\pxgtmb at PDF@crop at ur@x\stockwidth
+  %\pxgtmb at PDF@setbp\pxgtmb at PDF@crop at ur@y\stockheight
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ll@x{\dimexpr(\stockwidth-\paperwidth)/2}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ll@y{\dimexpr(\stockheight-\paperheight)/2}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ur@x{\dimexpr(\stockwidth+\paperwidth)/2}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@trim at ur@y{\dimexpr(\stockheight+\paperheight)/2}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ll@x{\dimexpr(\stockwidth-\paperwidth)/2-\@tombowbleed}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ll@y{\dimexpr(\stockheight-\paperheight)/2-\@tombowbleed}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ur@x{\dimexpr(\stockwidth+\paperwidth)/2+\@tombowbleed}%
+  \pxgtmb at PDF@setbp\pxgtmb at PDF@bleed at ur@y{\dimexpr(\stockheight+\paperheight)/2+\@tombowbleed}%
+  \xdef\pxgtmb at PDF@CTM{%
+    %% CropBox: implicit (same as MediaBox, large paper size)
+    %/CropBox  [0 0 \pxgtmb at PDF@crop at ur@x\space \pxgtmb at PDF@crop at ur@y]
+    %% BleedBox: explicit (final paper size + surrounding \@tombowbleed)
+    \noexpand\pxgtmb at PDF@begin
+    /BleedBox [\pxgtmb at PDF@bleed at ll@x\space
+               \pxgtmb at PDF@bleed at ll@y\space
+               \pxgtmb at PDF@bleed at ur@x\space
+               \pxgtmb at PDF@bleed at ur@y] \noexpand\pxgtmb at PDF@end
+    %% TrimBox: explicit (final paper size)
+    \noexpand\pxgtmb at PDF@begin
+    /TrimBox  [\pxgtmb at PDF@trim at ll@x\space
+               \pxgtmb at PDF@trim at ll@y\space
+               \pxgtmb at PDF@trim at ur@x\space
+               \pxgtmb at PDF@trim at ur@y] \noexpand\pxgtmb at 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 at driver
     %% for XeTeX (similar to dvipdfmx, except for paper size)
-    \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}
-    \edef\pxgtmb at PDF@CTM{{pdf:put @thispage << \pxgtmb at PDF@CTM >>}}
+    \AtBeginDocument{%
+      \pxgtmb at PDF@calcbox
+      \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}%
+      \edef\pxgtmb at PDF@CTM{{pdf:put @thispage << \pxgtmb at PDF@CTM >>}}}
     % force paper size
     \pdfpagewidth\stockwidth \pdfpageheight\stockheight
     % emit pdf boxes
@@ -605,21 +621,36 @@
   \else
     \if s\pxgtmb at driver
       %% for dvips
-      \def\pxgtmb at PDF@begin{[ }\def\pxgtmb at PDF@end{/PAGE pdfmark }
-      \edef\pxgtmb at PDF@CTM{{ps:SDict begin \pxgtmb at PDF@CTM end}}
+      \AtBeginDocument{%
+        \pxgtmb at PDF@calcbox
+        \def\pxgtmb at PDF@begin{[ }\def\pxgtmb at PDF@end{/PAGE pdfmark }%
+        \edef\pxgtmb at PDF@CTM{{ps:SDict begin \pxgtmb at PDF@CTM end}}}
     \else\if m\pxgtmb at driver
       %% for dvipdfmx
-      \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}
-      \edef\pxgtmb at PDF@CTM{{pdf:put @thispage << \pxgtmb at PDF@CTM >>}}
+      \AtBeginDocument{%
+        \pxgtmb at PDF@calcbox
+        \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}%
+        \edef\pxgtmb at PDF@CTM{{pdf:put @thispage << \pxgtmb at PDF@CTM >>}}}
     \else
       %% for others (in case graphics option wrong)
       \PackageError{\pxgtmb at pkgname}{Sorry, driver unsupported}\@ehc
       \def\pxgtmb at 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 at magscale\@undefined\else
+        \stockwidth \pxgtmb at magscale\stockwidth
+        \stockheight\pxgtmb at magscale\stockheight
+      \fi
+      \xdef\pxgtmb at PDF@size{{papersize=\the\stockwidth,\the\stockheight}}
+    \endgroup
     \AtBeginShipout{\setbox\AtBeginShipoutBox=\vbox{%
       \baselineskip\z at skip\lineskip\z at skip\lineskiplimit\z@
       % force paper size
-      \special{papersize=\the\stockwidth,\the\stockheight}%
+      \expandafter\special\pxgtmb at PDF@size
       % emit pdf boxes
       \expandafter\special\pxgtmb at PDF@CTM % here!
       \copy\AtBeginShipoutBox}}
@@ -627,25 +658,41 @@
 \else
   %% for pdfTeX
   \def\pxgtmb at driver{p}
-  \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}
-  \edef\pxgtmb at PDF@CTM{{\pxgtmb at PDF@CTM}}
   % force paper size
   \pdfpagewidth\stockwidth \pdfpageheight\stockheight
   % emit pdf boxes
-  \expandafter\pdfpageattr\pxgtmb at PDF@CTM
+  \AtBeginDocument{%
+    \pxgtmb at PDF@calcbox
+    \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}%
+    \edef\pxgtmb at PDF@CTM{{\pxgtmb at PDF@CTM}}%
+    \expandafter\pdfpageattr\pxgtmb at PDF@CTM}
 \fi
 \else
   %% for LuaTeX
   \def\pxgtmb at driver{l}
-  \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}
-  \edef\pxgtmb at PDF@CTM{pageattr{\pxgtmb at PDF@CTM}}
   % force paper size
   \pagewidth\stockwidth \pageheight\stockheight
   % emit pdf boxes
-  \expandafter\pdfvariable\pxgtmb at PDF@CTM
+  \AtBeginDocument{%
+    \pxgtmb at PDF@calcbox
+    \def\pxgtmb at PDF@begin{}\def\pxgtmb at PDF@end{}%
+    \edef\pxgtmb at PDF@CTM{pageattr{\pxgtmb at PDF@CTM}}%
+    \expandafter\pdfvariable\pxgtmb at 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)



More information about the tex-live-commits mailing list