From 119c85f0884038993a1e14ff427e4abc96308f98 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 17 Dec 2017 22:57:56 +0000 Subject: platex-tools (17dec17) git-svn-id: svn://tug.org/texlive/trunk@46083 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/platex-tools/Makefile | 15 +- Master/texmf-dist/doc/latex/platex-tools/README.md | 8 +- .../doc/latex/platex-tools/gentombow.pdf | Bin 0 -> 141204 bytes .../doc/latex/platex-tools/gentombow.tex | 209 +++++++++++++++++++++ .../doc/latex/platex-tools/plextarray.pdf | Bin 85073 -> 85066 bytes .../doc/latex/platex-tools/plextarray.tex | 2 +- .../doc/latex/platex-tools/pxatbegshi.pdf | Bin 0 -> 57178 bytes .../doc/latex/platex-tools/pxatbegshi.tex | 75 ++++++++ .../doc/latex/platex-tools/pxgentombow.pdf | Bin 162757 -> 168874 bytes .../doc/latex/platex-tools/pxgentombow.tex | 87 ++++++--- .../tex/latex/platex-tools/gentombow.sty | 159 ++++++++++++++++ .../tex/latex/platex-tools/pxatbegshi.sty | 76 ++++++++ .../tex/latex/platex-tools/pxgentombow.sty | 34 +++- 13 files changed, 629 insertions(+), 36 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/platex-tools/gentombow.pdf create mode 100644 Master/texmf-dist/doc/latex/platex-tools/gentombow.tex create mode 100644 Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.pdf create mode 100644 Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.tex create mode 100644 Master/texmf-dist/tex/latex/platex-tools/gentombow.sty create mode 100644 Master/texmf-dist/tex/latex/platex-tools/pxatbegshi.sty (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/platex-tools/Makefile b/Master/texmf-dist/doc/latex/platex-tools/Makefile index cba9e99629e..b625b603813 100644 --- a/Master/texmf-dist/doc/latex/platex-tools/Makefile +++ b/Master/texmf-dist/doc/latex/platex-tools/Makefile @@ -3,8 +3,10 @@ FONTMAP = -f ipaex.map -f ptex-ipaex.map TEXMF = $(shell kpsewhich -var-value=TEXMFHOME) all: plarray.pdf plextarray.pdf plextdelarray.pdf \ - pxftnright.pdf pxeverysel.pdf pxeveryshi.pdf \ - bounddvi.pdf bounddvi-en.pdf pxgentombow.pdf + pxatbegshi.pdf pxftnright.pdf \ + pxeverysel.pdf pxeveryshi.pdf \ + bounddvi.pdf bounddvi-en.pdf \ + gentombow.pdf pxgentombow.pdf .SUFFIXES: .tex .dvi .pdf .tex.dvi: @@ -14,6 +16,15 @@ all: plarray.pdf plextarray.pdf plextdelarray.pdf \ .dvi.pdf: dvipdfmx $(FONTMAP) $< +bounddvi-en.dvi: bounddvi-en.tex + latex $< + latex $< + rm *.aux *.log +gentombow.pdf: gentombow.tex + pdflatex $< + pdflatex $< + rm *.aux *.log + .PHONY: install clean install: mkdir -p ${TEXMF}/doc/platex/platex-tools diff --git a/Master/texmf-dist/doc/latex/platex-tools/README.md b/Master/texmf-dist/doc/latex/platex-tools/README.md index e7183f645b2..c28e3f34f71 100644 --- a/Master/texmf-dist/doc/latex/platex-tools/README.md +++ b/Master/texmf-dist/doc/latex/platex-tools/README.md @@ -39,6 +39,12 @@ and some additional packages are included. Takayuki YATO in 2012 (https://gist.github.com/zr-tex8r/2702969), and incorporated into this bundle by his courtesy. +- pxatbegshi.sty: + Patch for atbegshi.sty (oberdiek) to support + Japanese classes for vertical writing. + Can be used on pLaTeX/upLaTeX. + The essential part of this package was proposed by + Hironori Kitagawa in 2017. - bounddvi.sty: Set papersize special to DVI file. Can be used on LaTeX/pLaTeX/upLaTeX @@ -77,6 +83,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2017-07-29 +2017-12-17 Hironobu Yamashita diff --git a/Master/texmf-dist/doc/latex/platex-tools/gentombow.pdf b/Master/texmf-dist/doc/latex/platex-tools/gentombow.pdf new file mode 100644 index 00000000000..3c3050bfbe0 Binary files /dev/null and b/Master/texmf-dist/doc/latex/platex-tools/gentombow.pdf differ diff --git a/Master/texmf-dist/doc/latex/platex-tools/gentombow.tex b/Master/texmf-dist/doc/latex/platex-tools/gentombow.tex new file mode 100644 index 00000000000..fc1d8f40f09 --- /dev/null +++ b/Master/texmf-dist/doc/latex/platex-tools/gentombow.tex @@ -0,0 +1,209 @@ +%# -*- ascii characters only -*- + +\documentclass[a4paper]{article} +\usepackage{doc} +\makeatletter +%%% dangerous bend +\font\man=manfnt at 10pt +\def\dbend{\leavevmode\raise0pt\hbox{\man\char'177}} +\newenvironment{dangerous}{% + \ifnum\@listdepth>\z@ + \GenericError{}{Do not use `dangerous' environment inside any list}{}{} + \fi + \par\addvspace\medskipamount + \@tempdima=\dimexpr\textwidth-2zw\relax\small + \divide\@tempdima by\dimexpr1zw\relax\@tempcnta=\@tempdima + \leftskip=\dimexpr\textwidth-\@tempcnta zw\relax + \@totalleftmargin\dimexpr\leftskip+0zw + \linewidth=\dimexpr\@tempcnta zw-0zw + \parindent1zw\noindent\kern-\leftskip\hbox to\leftskip{\dbend\hss}% + \everypar{\everypar{}}\ignorespaces +}{\par\addvspace\medskipamount} +%%% misc +\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$} +%%% +\makeatother +\usepackage{longtable} +\usepackage{gentombow} +\usepackage{bxpapersize} +\GetFileInfo{gentombow.sty} +\title{Package \textsf{gentombow} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +It is convenient to print documents for final smaller paper sizes +on paper of the printer's standard physical paper size; +it allows printing close to the logical paper edge +and even outside the logical page. + +This package \textsf{gentombow} provides a Japanese-style +crop marks (called `tombow' in Japanese) for trimming paper stacks, +and place the document page at the center of a larger physical +paper sheet. It automatically detects the page size +(\verb+\paperwidth+, \verb+\paperheight+) which is +going to set by document class. +This document itself is a demonstration of this package, +with final A4 paper printed on B4 (JIS B4; not ISO B4!) paper. + +Note that this package does nothing about output paper size +specification; use one of the followings to do it. +\begin{itemize} +\item \textsf{graphicx} package + with \texttt{setpagesize} feature added in 2016 + (supports all engines) +\item \textsf{bxpapersize} package + (supports all engines; by Takayuki YATO) +\item \textsf{bounddvi} package + (supports only DVI output mode; part of \textsf{platex-tools} bundle) +\end{itemize} + +A basic usage: +\begin{verbatim} + \documentclass[a4paper]{article} + \usepackage{gentombow} + \usepackage{graphicx} + \begin{document} + The content + \end{document} +\end{verbatim} +For Japanese people, \textsf{pxgentombow} (also part of +\textsf{platex-tools} bundle) is also available; +it requires Japanese p\LaTeX/up\LaTeX\ or Lua\TeX-ja. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\section*{Automatic Determination of Output Size} + +In this package, +the following printer's standard physical paper sizes are predefined; +A series (\texttt{a0}--\texttt{a10}), +B series (\texttt{b0}--\texttt{b10}), +C series (\texttt{c0}--\texttt{c10}), +\texttt{letter}, \texttt{legal} and \texttt{executive}. +In the current release, `B series' is JIS standard, +not ISO standard (this might be changed in the near future). +Also, some variations \texttt{a4var} and \texttt{b5var} are predefined. + +When one of the above sizes (except \texttt{a0}, \texttt{b0} +and \texttt{c0}) is detected, the output size is +automatically determined along with the following rule: +\begin{itemize} +\item When A series detected: + the output is going to be larger B series +\item When B/C series or + \texttt{letter}, \texttt{legal}, \texttt{executive} detected: + the output is going to be larger A series +\end{itemize} +The crop marks are automatically added. +The orientation (landscape/portrait) of the input paper is +also preserved. + +The following list shows common examples: +\begin{longtable}[c]{cc} + \hline + Detected page size & Output size \\ + \hline + a6 & b6 \\ + b6 & a5 \\ + a5 & b5 \\ + b5 & a4 \\ + a4 & b4 \\ + b4 & a3 \\ + a3 & b3 \\ + b3 & a2 \\ + \hline + c6 & a5 \\ + c5 & a4 \\ + c4 & a3 \\ + c3 & a2 \\ + \hline + letter & a3 \\ + legal & a3 \\ + executive & a4 \\ + \hline +\end{longtable} + +\section*{When Automatic Determination Failed} + +When the page size is different from any of the predefined sizes, +the page is placed with the surrounding 1~inch margins. +For example, when the page has $100\,\mathrm{mm}$ width and +$200\,\mathrm{mm}$ height, the output size is going to be +$100\,\mathrm{mm}+2\,\mathrm{in}$ width and +$200\,\mathrm{mm}+2\,\mathrm{in}$ height. + +\section*{Explicit Specification of Output Size} + +You can also force the output size using package option. +For example, +\begin{verbatim} + \documentclass[a4paper]{article} + \usepackage[tombow-a4]{gentombow} + \begin{document} + The content + \end{document} +\end{verbatim} +forces the output size to be a3 (the automatic determination +`b4' is discarded). Available sizes are the same as +the predefined sizes, that is, +A series (\texttt{a0}--\texttt{a10}), +B series (\texttt{b0}--\texttt{b10}), +C series (\texttt{c0}--\texttt{c10}) and +\texttt{a4var}, \texttt{b5var}, +\texttt{letter}, \texttt{legal}, \texttt{executive}. +The orientation (landscape/portrait) of the input paper is +also preserved again. + +The option format is: +\Meta{crop mark format}\texttt{-}\Meta{output size}. +The crop mark format is one of the following: +\verb+tombow+ (default), \verb+tombo+ (without a job info), +\verb+mentuke+ (do not print actual crop marks). + +\section*{Disabling Job Info Printing} + +When the output size is automatically determined, +the crop marks are printed with a job info like +\makeatletter\texttt{\the\@bannertoken}\makeatother. +To disable it, use \texttt{notombowdate} option: +\begin{verbatim} + \documentclass[a4j]{jarticle} + \usepackage[notombowdate]{gentombow} + \begin{document} + The content + \end{document} +\end{verbatim} + +\section*{Note for \textsf{BXjscls} users} + +When using \textsf{BXjscls} (by Takayuki YATO) with size option +other than 10pt, please add \verb+nomag+ or \verb+nomag*+ to the +class option. For example, +\begin{verbatim} + \documentclass[a4paper,14pt]{bxjsarticle} + \usepackage{gentombow} +\end{verbatim} +will not work as expected (\textsf{gentombow} throws an error +for safety). + +\section*{Note about Layout Settings} + +You should not change \verb+\hoffset+ or \verb+\voffset+ to non-zero +value, for the purpose of layout settings. Such settings will +conflict with the feature of \textsf{gentombow} package. +To set page layout correctly, you should adjust \verb+\oddsidemargin+ +or \verb+\topmargin+, or leave it to \textsf{geometry} package. + +\section*{Change History} + +\begin{itemize} + \item 2017/12/17 v0.9 First CTAN release +\end{itemize} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/platex-tools/plextarray.pdf b/Master/texmf-dist/doc/latex/platex-tools/plextarray.pdf index ff2956d2d15..bc25804728e 100644 Binary files a/Master/texmf-dist/doc/latex/platex-tools/plextarray.pdf and b/Master/texmf-dist/doc/latex/platex-tools/plextarray.pdf differ diff --git a/Master/texmf-dist/doc/latex/platex-tools/plextarray.tex b/Master/texmf-dist/doc/latex/platex-tools/plextarray.tex index ef3b12e6d45..ace6168d723 100644 --- a/Master/texmf-dist/doc/latex/platex-tools/plextarray.tex +++ b/Master/texmf-dist/doc/latex/platex-tools/plextarray.tex @@ -42,7 +42,7 @@ writing direction: \end{verbatim} The option \texttt{} permits one of the following three values. If none of them is specified, the direction inside the environment -is same as that outside the enviromnent. +is same as that outside the environment. \begin{quote} \begin{description} \item[y] \emph{yoko} direction (horizontal writing) diff --git a/Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.pdf b/Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.pdf new file mode 100644 index 00000000000..d67774c577c Binary files /dev/null and b/Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.pdf differ diff --git a/Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.tex b/Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.tex new file mode 100644 index 00000000000..cf5af4c9979 --- /dev/null +++ b/Master/texmf-dist/doc/latex/platex-tools/pxatbegshi.tex @@ -0,0 +1,75 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{pxatbegshi} +\GetFileInfo{pxatbegshi.sty} +\title{Package \textsf{pxatbegshi} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{atbegshi} (written by Heiko Oberdiek) provides +a command \verb+\AtBeginShipout{...}+, however it cannot be used +with Japanese classes for vertical writing (tarticle.cls, etc). +\begin{verbatim} + ! Incompatible direction list can't be unboxed. + \AtBeginShipoutAddToBox ...box \AtBeginShipoutBox + \kern 0pt}\AtBegShi@restor... +\end{verbatim} +The package \textsf{pxatbegshi} provides a patch for \textsf{atbegshi} +to work with both horizontal and vertical writing. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\bigskip + +Heiko Oberdiek氏による\textsf{atbegshi}パッケージは +\verb+\AtBeginShipout{...}+というコマンドを提供しますが、これを +p\LaTeX の縦組クラス(tarticle.clsなど)で使うとエラーが出てしまいます +\footnote{単に縦組クラスで\textsf{pxatbegshi}パッケージを読み込んだだけ +では、エラーは出ないようです。}。 +この\textsf{pxatbegshi}パッケージは、縦組クラスでも +\textsf{atbegshi}パッケージの機能を使えるようにするためのものです。 + +使いかたは、\textsf{atbegshi}パッケージの代わりに、あるいは +\textsf{atbegshi}パッケージに追加して、\textsf{pxatbegshi}パッケージを +読みこむだけです。使用例: +\begin{verbatim} + \documentclass[a4paper]{tarticle} + \usepackage[dvipdfmx]{graphicx} + \usepackage{pxatbegshi} + \AtBeginShipout{% + \AtBeginShipoutUpperLeft{% + \parbox[t][\paperheight][b]{\paperwidth}{% + \includegraphics[width=210truemm]{background.eps}}}} + \begin{document} + 背景に透かしを入れます。 + \end{document} +\end{verbatim} + +\section*{謝辞} + +本パッケージの実装は、北川さん(Hironori Kitagawa)さんによる +「\verb+\AtBegShi@Output+の処理を強引に横組でやらせるコード」 +をベースにしています。 + +\section*{References} + +\begin{itemize} +\item utbookでatbegshiパッケージを使いたい\\ + \texttt{https://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2134} +\item \relax[tex-jp-build] [ptex] ページ・数式の組方向 + (※北川さんのコードの初出)\\ + \texttt{https://github.com/texjporg/tex-jp-build/issues/21} +\end{itemize} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.pdf b/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.pdf index e7be24d5907..d4acb81f837 100644 Binary files a/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.pdf and b/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.pdf differ diff --git a/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.tex b/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.tex index b67bdcabae4..e460a97a3b5 100644 --- a/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.tex +++ b/Master/texmf-dist/doc/latex/platex-tools/pxgentombow.tex @@ -7,7 +7,7 @@ \usepackage{doc} \makeatletter %%% import from jltxdoc.cls -\def\verb{\relax\ifmmode\hbox\else\leavevmode\fi +\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}} @@ -29,6 +29,9 @@ \parindent1zw\noindent\kern-\leftskip\hbox to\leftskip{\dbend\hss}% \everypar{\everypar{}}\ignorespaces }{\par\addvspace\medskipamount} +%%% misc +\newcommand{\Meta}[1]{$\langle$\mbox{}\textit{#1}\mbox{}$\rangle$} +\newcommand{\jMeta}[1]{$\langle$\mbox{}\textsf{#1}\mbox{}$\rangle$} %%% \makeatother \usepackage{longtable} @@ -42,21 +45,34 @@ \maketitle -日本の出版では、たとえば版面がA4サイズの場合、一回り大きなB4サイズの用紙 -の中央にトンボ付きで印刷するということがなされることがあるようです。 +\begin{center} +English version is available: see \textsf{gentombow} package! +\end{center} + +日本の出版では、たとえば仕上がり寸法がA4サイズの場合、一回り大きな +B4サイズの用紙の中央にトンボ付きで印刷することがあるようです。 このドキュメントは、実際にA4用紙をB4用紙の中央にトンボ付きで 配置している事例です。 \textsf{pxgentombow}パッケージは、クラスファイルなどが想定している用紙 -サイズ情報(\verb+\paperwidth+, \verb+\paperheight+)を検知し、それより -一回り大きなサイズの用紙の中央にトンボ付きで出力するために必要な機能を -提供します。ただし、このパッケージは実際の出力サイズ指定を発行しません -ので、\textsf{bxpapersize}パッケージまたは\textsf{bounddvi}パッケージと -併用するとよいでしょう\footnote{\textsf{bounddvi}パッケージは、 -\textsf{pxgentombow}と同じく\textsf{platex-tools}バンドルに収録 -されていますが、名前のとおりDVIを経由する場合にしか利用できません。 +サイズ情報(\verb+\paperwidth+, \verb+\paperheight+)を検知し、 +それより一回り大きなサイズの用紙の中央にトンボ付きで出力するために +必要な機能を提供します。 +ただし、このパッケージは実際の出力サイズ指定を発行しませんので、 +以下のいずれかのパッケージと併用するとよいでしょう: +\begin{itemize} +\item \textsf{bounddvi}パッケージ(\textsf{platex-tools}バンドル) +\item \textsf{bxpapersize}パッケージ(ZRさん作) +\item \textsf{graphicx}パッケージの2016年以降の版 + (\texttt{setpagesize}機能つきのもの) +\end{itemize} +\textsf{bounddvi}パッケージは、\textsf{pxgentombow}と同じく +\textsf{platex-tools}バンドルに収録されていますが、 +名前のとおりDVIを経由する場合にしか利用できません。 一方、\textsf{bxpapersize}パッケージは汎用で、Lua\TeX のような -PDF直接出力の場合にも利用できます。}。 +PDF直接出力の場合にも利用できます。また、\textsf{graphicx}パッケージ +は画像挿入用のパッケージですが、2016年以降は自動的に出力サイズ指定も +行うようです($\verb+\mag+ \ne 1000$の場合には機能しません)。 使い方の例は \begin{verbatim} @@ -69,7 +85,9 @@ PDF直接出力の場合にも利用できます。}。 \end{verbatim} です。p\LaTeX における横組と縦組の両方で使え、また\textsf{jsclasses}の ような版面拡大(\verb+\mag+)が使われた場合にも対応しています。 -なお、現時点ではp\LaTeX とup\LaTeX およびLua\TeX-jaのみで動作します。 +なお、\textsf{pxgentombow}パッケージはp\LaTeX とup\LaTeX および +Lua\TeX-jaのみで動作します。その他(pdf\LaTeX など)で使いたい +場合は、代わりに\textsf{gentombow}パッケージを使用してください。 本パッケージは、\textsf{platex-tools}バンドルの一部として 配布されています: @@ -79,19 +97,24 @@ PDF直接出力の場合にも利用できます。}。 \section*{用紙サイズの自動検知による出力サイズ決定} -パッケージにはあらかじめA系列(a0--a10)、B系列(b0--b10), C系列(c0--c10)と -letter, legal, executiveの用紙サイズが定義されています。 -ここで、B系列はISOではなくJISです。また、変形版としてa4var(a4の変形)と -b5var(b5の変形)も定義されています。 +パッケージにはあらかじめA系列(\texttt{a0}--\texttt{a10})、 +B系列(\texttt{b0}--\texttt{b10})、C系列(\texttt{c0}--\texttt{c10})と +\texttt{letter}, \texttt{legal}, \texttt{executive}の用紙サイズが +定義されています。ここで、B系列はISOではなくJISです。 +また、変型版として\texttt{a4var}(\texttt{a4}の変型)と +\texttt{b5var}(\texttt{b5}の変型)も定義されています。 -これらのうちいずれか(ただしa0, b0, c0を除く)の用紙サイズを検知すると、 +これらのうちいずれか(ただし\texttt{a0}, \texttt{b0}, \texttt{c0}を +除く)の用紙サイズを検知すると、 出力サイズが次の規則で自動的に決定されます\footnote{なお、 -C系列とletter, legal, executiveについては日本での慣習が不明の +C系列と\texttt{letter}, \texttt{legal}, \texttt{executive}については +日本での慣習が不明の ため、現時点ではA系列のサイズで出力することにしています。}。 \begin{itemize} \item 用紙サイズがA系列のとき: 出力サイズは一回り大きなB系列 -\item 用紙サイズがB, C系列またはletter, legal, executiveのとき: +\item 用紙サイズがB, C系列または + \texttt{letter}, \texttt{legal}, \texttt{executive}のとき: 出力サイズは一回り大きなA系列 \end{itemize} この場合、パッケージを読みこんだだけでトンボが付きます。 @@ -143,13 +166,16 @@ C系列とletter, legal, executiveについては日本での慣習が不明の \end{document} \end{verbatim} とすると、出力サイズは(自動決定のb4は無視されて)a3に変わります。 -指定可能なサイズは、定義済みの用紙サイズと同じものです。 -すなわち、A系列(a0--a10)、B系列(b0--b10), C系列(c0--c10)と -a4var, b5var, letter, legal, executiveです。 +指定可能なサイズは、定義済みの用紙サイズと同じものです。すなわち、 +A系列(\texttt{a0}--\texttt{a10})、 +B系列(\texttt{b0}--\texttt{b10})、 +C系列(\texttt{c0}--\texttt{c10})と +\texttt{a4var}, \texttt{b5var}, +\texttt{letter}, \texttt{legal}, \texttt{executive}です。 なお、ここでも用紙サイズが横長の場合は自動的に出力も横長になり、 縦長の場合は自動的に縦長になります。 -オプションの書式は、トンボ形式とサイズをハイフン(-)で結びます。 +オプションは\jMeta{トンボ形式}\texttt{-}\jMeta{出力サイズ}の書式で与えます。 トンボ形式は、p\LaTeX の標準クラスと同じで \verb+tombow+, \verb+tombo+, \verb+mentuke+のいずれかを選びます (\verb+tombow+はジョブ情報を表示し、\verb+tombo+は表示しません。 @@ -195,11 +221,21 @@ a4var, b5var, letter, legal, executiveです。 \end{verbatim} と書くようにしてください。 +同様に、ZR氏による\textsf{BXjscls}のクラスを使用していて、10pt以外の +サイズオプションを指定する場合は +\begin{itemize} +\item クラスオプションに「\verb+\mag+を使わないオプション」 + (\verb+nomag+または\verb+nomag*+)を追加する。 +\end{itemize} +という対処が必要です(\textsf{BXjscls}クラスでは「トンボオプション」が +機能しないダミーになっていることに注意)。 + \section*{レイアウト設定の注意} 余白などのレイアウト設定でありがちですが、 -\verb+\hoffset+や\verb+\voffset+の値が$0$以外になっている場合、 -\textsf{pxgentombow}パッケージはエラーを出します。 +\verb+\hoffset+や\verb+\voffset+の値を$0$以外に設定するのは +避けてください。このような設定は\textsf{pxgentombow}パッケージの +トンボ出力機能と衝突するため、正しい出力が得られません。 レイアウト設定のために変更すべきなのはこれらの寸法ではなく、 \verb+\oddsidemargin+や\verb+\topmargin+であることがほとんどです。 したがって、それらを適切な値に設定するか、レイアウトの設定すべてを @@ -287,6 +323,7 @@ $30\,\mathrm{mm}$にしたいとき\footnote{ここでは「本文の領域以 \item 2017/05/06 v0.6 \textsf{jsclasses}との共存時のチェック強化、 Lua\TeX-jaでの動作確認 \item 2017/07/23 v0.7 ドキュメント更新、CTANリリース版 + \item 2017/12/17 v0.9 \textsf{gentombow}パッケージの新設、CTANリリース版 \end{itemize} \end{document} diff --git a/Master/texmf-dist/tex/latex/platex-tools/gentombow.sty b/Master/texmf-dist/tex/latex/platex-tools/gentombow.sty new file mode 100644 index 00000000000..4318d9871d6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/platex-tools/gentombow.sty @@ -0,0 +1,159 @@ +% +% gentombow.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{gentombow} + [2017/12/17 v0.9 Generate crop mark 'tombow'] +\def\pxgtmb@emu@pkgname{gentombow} + +%% error status (shared with pxgentombow.sty) +\ifx\pxgtmb@errlevel\@undefined + \chardef\pxgtmb@errlevel=\z@ +\fi + +%% supported engines +\ifx\pfmtversion\@undefined + \@ifpackageloaded{luatexja}{}{\chardef\pxgtmb@errlevel=\@ne} +\fi +\ifnum\pxgtmb@errlevel>\z@\else + \PackageInfo{\pxgtmb@emu@pkgname}{% + pLaTeX, upLaTeX and LuaTeX-ja are natively\MessageBreak + supported by `pxgentombow' package;\MessageBreak + there is no need for this package.} + \RequirePackageWithOptions{pxgentombow} + \expandafter\endinput +\fi + +%%%%% EMULATION BEGIN + +% required for patching \@outputpage +\RequirePackage{etoolbox} + +% patch \@outputpage +\begingroup +\def\pxgtmb@emu@status{0} +\let\pxgtmb@emu@outputpage\@outputpage +\patchcmd\pxgtmb@emu@outputpage % try first patch + {\reset@font\normalsize\normalsfcodes}% + {% + \@@topmargin\topmargin + \iftombow + \@@paperwidth\paperwidth \advance\@@paperwidth 6mm\relax + \@@paperheight\paperheight \advance\@@paperheight 16mm\relax + \advance\@@topmargin 1in\relax \advance\@themargin 1in\relax + \fi + \reset@font\normalsize\normalsfcodes} + {}{\def\pxgtmb@emu@status{1}} +\patchcmd\pxgtmb@emu@outputpage % try second patch + {\@begindvi \vskip \topmargin}% + {\@begindvi \@outputtombow \vskip \@@topmargin}% + {}{\def\pxgtmb@emu@status{1}} +% commit the change only when successful; otherwise +% tombow feature is never enabled, exit right away +\if 0\pxgtmb@emu@status\relax + \global\let\@outputpage\pxgtmb@emu@outputpage +\else + \PackageError{\pxgtmb@emu@pkgname}{% + Failed in patching \string\@outputpage!\MessageBreak + Sorry, I can't proceed anymore...}\@ehc + \expandafter\expandafter\expandafter\endinput\expandafter +\fi +\endgroup +% + +% provides equivalent for plcore.ltx +\newif\iftombow \tombowfalse +\newif\iftombowdate \tombowdatetrue +\newdimen\@tombowwidth +\setlength{\@tombowwidth}{.1\p@} +\newbox\@TL\newbox\@Tl +\newbox\@TC +\newbox\@TR\newbox\@Tr +\newbox\@BL\newbox\@Bl +\newbox\@BC +\newbox\@BR\newbox\@Br +\newbox\@CL +\newbox\@CR +\font\@bannerfont=cmtt9 +\newtoks\@bannertoken +\@bannertoken{} +\def\maketombowbox{% removed \yoko from all boxes + \setbox\@TL\hbox to\z@{\hss + \vrule width13mm height\@tombowwidth depth\z@ + \vrule height10mm width\@tombowwidth depth\z@ + \iftombowdate + \raise4pt\hbox to\z@{\hskip5mm\@bannerfont\the\@bannertoken\hss}% + \fi}% + \setbox\@Tl\hbox to\z@{\hss + \vrule width10mm height\@tombowwidth depth\z@ + \vrule height13mm width\@tombowwidth depth\z@}% + \setbox\@TC\hbox{% + \vrule width10mm height\@tombowwidth depth\z@ + \vrule height10mm width\@tombowwidth depth\z@ + \vrule width10mm height\@tombowwidth depth\z@}% + \setbox\@TR\hbox to\z@{% + \vrule height10mm width\@tombowwidth depth\z@ + \vrule width13mm height\@tombowwidth depth\z@\hss}% + \setbox\@Tr\hbox to\z@{% + \vrule height13mm width\@tombowwidth depth\z@ + \vrule width10mm height\@tombowwidth depth\z@\hss}% + \setbox\@BL\hbox to\z@{\hss + \vrule width13mm depth\@tombowwidth height\z@ + \vrule depth10mm width\@tombowwidth height\z@}% + \setbox\@Bl\hbox to\z@{\hss + \vrule width10mm depth\@tombowwidth height\z@ + \vrule depth13mm width\@tombowwidth height\z@}% + \setbox\@BC\hbox{% + \vrule width10mm depth\@tombowwidth height\z@ + \vrule depth10mm width\@tombowwidth height\z@ + \vrule width10mm depth\@tombowwidth height\z@}% + \setbox\@BR\hbox to\z@{% + \vrule depth10mm width\@tombowwidth height\z@ + \vrule width13mm depth\@tombowwidth height\z@\hss}% + \setbox\@Br\hbox to\z@{% + \vrule depth13mm width\@tombowwidth height\z@ + \vrule width10mm depth\@tombowwidth height\z@\hss}% + \setbox\@CL\hbox to\z@{\hss + \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth + \vrule height10mm depth10mm width\@tombowwidth}% + \setbox\@CR\hbox to\z@{% + \vrule height10mm depth10mm width\@tombowwidth + \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}% +} +\def\@outputtombow{% + \iftombow + \vbox to\z@{\kern-13mm\relax + \boxmaxdepth\maxdimen + \moveleft3mm\vbox to\@@paperheight{% + \hbox to\@@paperwidth{\hskip3mm\relax + \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip3mm}% + \kern-10mm + \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}% + \vfill + \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}% + \vfill + \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}% + \kern-10mm + \hbox to\@@paperwidth{\hskip3mm\relax + \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip3mm}% + }\vss + }% + \fi +} +\newdimen\@@paperheight +\newdimen\@@paperwidth +\newdimen\@@topmargin +\newcount\hour +\newcount\minute + +%%%%% EMULATION END + +%% load it +\RequirePackageWithOptions{pxgentombow} + +\endinput diff --git a/Master/texmf-dist/tex/latex/platex-tools/pxatbegshi.sty b/Master/texmf-dist/tex/latex/platex-tools/pxatbegshi.sty new file mode 100644 index 00000000000..91e107dc790 --- /dev/null +++ b/Master/texmf-dist/tex/latex/platex-tools/pxatbegshi.sty @@ -0,0 +1,76 @@ +% +% pxatbegshi.sty +% based on H. Kitagawa's code on GitHub:texjporg/tex-jp-build#21 +% and modified by Hironobu Yamashita +% +% This package is distributed as part of the platex-tools bundle +% maintained by Hironobu Yamashita +% https://github.com/aminophen/platex-tools +% + +%% package declaration +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxatbegshi} + [2017/11/04 v0.2 Patch to atbegshi for (u)pLaTeX] + +%% preparations +\def\pxabgs@pkgname{pxatbegshi} +\def\pxabgs@warn{\PackageWarningNoLine\pxabgs@pkgname} + +%% load it +\RequirePackage{atbegshi} + +%% internal macros are locally effective +\begingroup + +%--------------------------------------- helpers + +%% unique tokens +\def\pxabgs@mark{\pxabgs@mark@} +\def\pxabgs@fin{\pxabgs@fin@} + +%% \pxabgs@patch@cmd\CMD{}{} +\@onlypreamble\pxabgs@patch@cmd +\def\pxabgs@patch@cmd#1#2#3{% + \def\pxabgs@next##1#2##2\pxabgs@mark##3\pxabgs@fin{% + \ifx\pxabgs@mark##3\pxabgs@mark + \let\pxabgs@fragment\relax + \else + \def\pxabgs@fragment{##2}% + \def#1{##1#3##2}% + \fi}% + \expandafter\pxabgs@next#1\pxabgs@mark#2\pxabgs@mark\pxabgs@fin} + +%--------------------------------------- + +% concept: execute all hooks inside yoko direction \vbox + +% prepare +\let\pxabgs@AtBegShi@Output\AtBegShi@Output +% try first patch +\pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\let\AtBegShi@OrgProtect\protect}% + {\setbox8\vbox\bgroup\yoko\let\AtBegShi@OrgProtect\protect} +\ifx\pxabgs@fragment\relax % failure + \let\pxabgs@AtBegShi@Output\relax +\else % success, try second patch + \pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox}% + {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox\egroup} + \ifx\pxabgs@fragment\relax % failure + \let\pxabgs@AtBegShi@Output\relax + \fi +\fi +% commit the change only when successful +\ifx\pxabgs@AtBegShi@Output\relax + \pxabgs@warn{Failed in patching \string\AtBegShi@Output} +\else + \global\let\AtBegShi@Output\pxabgs@AtBegShi@Output +\fi + +\endgroup +%% internal macros are no longer effective + +%--------------------------------------- done +\endinput +%% EOF diff --git a/Master/texmf-dist/tex/latex/platex-tools/pxgentombow.sty b/Master/texmf-dist/tex/latex/platex-tools/pxgentombow.sty index 834510c55b1..99eff83f22f 100644 --- a/Master/texmf-dist/tex/latex/platex-tools/pxgentombow.sty +++ b/Master/texmf-dist/tex/latex/platex-tools/pxgentombow.sty @@ -8,20 +8,27 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pxgentombow} - [2017/07/23 v0.7 Generate crop mark 'tombow'] + [2017/12/17 v0.9 Generate crop mark 'tombow'] \def\pxgtmb@pkgname{pxgentombow} -%% error status -\chardef\pxgtmb@errlevel=\z@ +%% error status (shared with gentombow.sty) +\ifx\pxgtmb@errlevel\@undefined + \chardef\pxgtmb@errlevel=\z@ +\fi %% supported engines \ifx\pfmtversion\@undefined \@ifpackageloaded{luatexja}{}{\chardef\pxgtmb@errlevel=\@ne} \fi \ifnum\pxgtmb@errlevel>\z@ - \PackageError{\pxgtmb@pkgname}{% - Only pLaTeX, upLaTeX and LuaTeX-ja are supported now}\@ehc - \expandafter\endinput + \ifx\pxgtmb@emu@pkgname\@undefined % gentombow.sty not loaded + \PackageError{\pxgtmb@pkgname}{% + Only pLaTeX, upLaTeX and LuaTeX-ja are supported!\MessageBreak + Please use `gentombow' package instead}\@ehc + \expandafter\expandafter\expandafter\endinput\expandafter + \fi +\else + \@namedef{ver@gentombow.sty}{}% fake \fi %% import from jsclasses @@ -29,11 +36,23 @@ \@tempcnta\hour \multiply\@tempcnta 60\relax \minute\time \advance\minute-\@tempcnta +\ifnum\mag=\@m\else + % if BXjscls is detected and \mag != 1000, + % the layout will be definitely broken + \ifx\bxjs@param@mag\@undefined\else + \PackageError{\pxgtmb@pkgname}{% + It seems you are using Japanese `BXjscls'\MessageBreak + (bxjsarticle, bxjsbook, bxjsreport, etc.) or\MessageBreak + some derived class. Try adding `nomag' or\MessageBreak + `nomag*' to the class option list}\@ehc + \fi +\fi + %% this package will use tombo feature in pLaTeX kernel % if tombow-related option is not included in class option list, % show info and enable it now \iftombow\else - % if jsclasses is detected, it's too late + % if jsclasses is detected and \mag != 1000, it's too late % -- When a size option other than `10pt' is specified, % jsclasses uses \mag and calculates \oddsidemargin and \topmargin % differently, depending on tombow status. @@ -47,6 +66,7 @@ derived class. Please add `tombow' or `tombo'\MessageBreak to the class option list}\@ehc \fi \fi + % BXjscls is already checked above, no check here \PackageInfo\pxgtmb@pkgname{tombow feature enabled by \pxgtmb@pkgname} \fi \tombowtrue %\tombowdatetrue %% enabled by tombowdate option -- cgit v1.2.3