diff options
author | Karl Berry <karl@freefriends.org> | 2018-05-19 23:27:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-05-19 23:27:52 +0000 |
commit | d5975620549112823d69c164a8e1d06cb83398c2 (patch) | |
tree | 58bb37ab24bdb0b7fbfd0eeeeb0db5e6e5925429 | |
parent | 4fa4ff22732b71ed4356295cbbe0672e29dcea43 (diff) |
jlreq (19may18)
git-svn-id: svn://tug.org/texlive/trunk@47771 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/LICENSE | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/README-ja.md | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/README.md | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html | 129 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md | 82 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html | 130 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md | 80 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/jlreq/jlreq.html | 10 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty | 454 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty | 355 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/jlreq/jlreq.cls | 707 |
12 files changed, 1469 insertions, 516 deletions
diff --git a/Master/texmf-dist/doc/latex/jlreq/LICENSE b/Master/texmf-dist/doc/latex/jlreq/LICENSE index 9101cf28dc5..6ec189530d2 100644 --- a/Master/texmf-dist/doc/latex/jlreq/LICENSE +++ b/Master/texmf-dist/doc/latex/jlreq/LICENSE @@ -1,5 +1,5 @@ (2-clause BSD license) -jlreq +jlreq and jlreq-trimmarks Copyright 2017-2018, Noriyuki Abe. All rights reserved. diff --git a/Master/texmf-dist/doc/latex/jlreq/README-ja.md b/Master/texmf-dist/doc/latex/jlreq/README-ja.md index 8eb2d86bb2c..0939964d7ba 100644 --- a/Master/texmf-dist/doc/latex/jlreq/README-ja.md +++ b/Master/texmf-dist/doc/latex/jlreq/README-ja.md @@ -12,7 +12,7 @@ * *.tfm -> $TEXMF/fonts/tfm/public/jlreq * *.vf -> $TEXMF/fonts/vf/public/jlreq * jfm-jlreq.lua jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq -* jlreq.cls -> $TEXMF/tex/latex/jlreq +* jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq と配置します.`make install`とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います. @@ -70,14 +70,16 @@ 全角空白(U+3000)一文字からなるマクロです.和文間隔を挿入します.LuaLaTeXでは` `のみでも和文間隔を入力できます. ### その他 -* ルビや圏点は提供されません.[PXrubrica](https://github.com/zr-tex8r/PXrubrica)またはluatexja-ruby(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います. -* 日本語組版処理の要件2.3.2.dによれば,二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.`nidanfloat`パッケージを使い, +* ルビや圏点は提供されません.[PXrubrica](https://github.com/zr-tex8r/PXrubrica)または`luatexja-ruby`(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います. +* 日本語組版処理の要件2.3.2.dによれば,横組みにおける二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.`nidanfloat`パッケージを使い, ```latex \usepackage[balance]{nidanfloat} ``` とするとこの処理が行われます.ただし,最終ページでの`\newpage`や`\clearpage`が正しく動作しません.詳しくは`nidanfloat`パッケージのマニュアルをご覧ください. +* フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は`luatexja-fontspec`や`luatexja-preset`(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,[PXchfon](https://github.com/zr-tex8r/PXchfon)での設定が可能です. + ## 各種設計 設計はクラスオプションまたは`\jlreqsetup`によりkeyval形式で行います.以下では次の用法を使います. @@ -140,7 +142,7 @@ ### 箇条書き `\jlreqsetup`で指定します. -* `itemization_beforeafter_space=<寸法>`:箇条書きの前後の空きを指定します.`itemization_beforeafter_space={i=<寸法>}`とするとトップレベルのみに設定を行います.`itemization_beforeafter_space={0pt,i=10pt,ii=5pt}`とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します. +* `itemization_beforeafter_space=<寸法>`:箇条書きの前後の空きを指定します.`itemization_beforeafter_space={i=<寸法>}`とするとトップレベルのみに設定を行います.`itemization_beforeafter_space={0pt,i=10pt,ii=5pt}`とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.レベルは上記のように小文字ローマ数字で指定します. * `itemization_itemsep=<寸法>`:項目同士の空きを指定します. ### 定理環境 @@ -377,6 +379,10 @@ JFMの名前は次の通りです.`[]`で囲まれている文字は設定に - `\labelenumi`らをjarticleなどにあわせた. - `column_gap`クラスオプションを使うとコンパイルできなかったバグ修正. - `mark_format`を`\DeclarePageStyle`に追加. +* 2018-05-19 + - 目次内のラベルの長さを今までよりも長くした. + - 一部のマクロをjlreq-helpers.styに分離した. + - バグ修正. -------------- diff --git a/Master/texmf-dist/doc/latex/jlreq/README.md b/Master/texmf-dist/doc/latex/jlreq/README.md index baf6b4f2b74..5201e22417d 100644 --- a/Master/texmf-dist/doc/latex/jlreq/README.md +++ b/Master/texmf-dist/doc/latex/jlreq/README.md @@ -9,7 +9,7 @@ Run `make`, then JFM files are created. Move the files as follows: * *.tfm -> $TEXMF/fonts/tfm/public/jlreq * *.vf -> $TEXMF/fonts/vf/public/jlreq * jfm-jlreq.lua jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq -* jlreq.cls -> $TEXMF/tex/latex/jlreq +* jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq `make install` will do this where $TEXMF=$TEXMFHOME @@ -80,7 +80,10 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS - Changed `\labelenumi` as in `jarticle` etc. - Fix a bug on `column_gap` class option. - Added `mark_format` to `\DeclarePageStyle`. - +* 2018-05-19 + - Made the width of the label in the table of contents longer. + - Moved some macros to jlreq-helpers.sty + - Fixed bugs. -------------- Noriyuki Abe diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html index 223d236bc03..236bf9e2ae1 100644 --- a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html +++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html @@ -97,7 +97,7 @@ <li>*.tfm -> $TEXMF/fonts/tfm/public/jlreq</li> <li>*.vf -> $TEXMF/fonts/vf/public/jlreq</li> <li>jfm-jlreq.lua jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq</li> -<li>jlreq.cls -> $TEXMF/tex/latex/jlreq</li> +<li>jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq</li> </ul> <p>と配置します.<code>make install</code>とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います.</p> <h2 id="使い方">使い方</h2> @@ -134,10 +134,11 @@ <p>全角空白(U+3000)一文字からなるマクロです.和文間隔を挿入します.LuaLaTeXでは<code> </code>のみでも和文間隔を入力できます.</p> <h3 id="その他">その他</h3> <ul> -<li><p>ルビや圏点は提供されません.<a href="https://github.com/zr-tex8r/PXrubrica">PXrubrica</a>またはluatexja-ruby(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います.</p></li> -<li><p>日本語組版処理の要件2.3.2.dによれば,二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.<code>nidanfloat</code>パッケージを使い,</p> +<li><p>ルビや圏点は提供されません.<a href="https://github.com/zr-tex8r/PXrubrica">PXrubrica</a>または<code>luatexja-ruby</code>(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います.</p></li> +<li><p>日本語組版処理の要件2.3.2.dによれば,横組みにおける二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.<code>nidanfloat</code>パッケージを使い,</p> <div class="sourceCode" id="cb5"><pre class="sourceCode latex"><code class="sourceCode latex"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="bu">\usepackage</span>[balance]{<span class="ex">nidanfloat</span>}</a></code></pre></div> <p>とするとこの処理が行われます.ただし,最終ページでの<code>\newpage</code>や<code>\clearpage</code>が正しく動作しません.詳しくは<code>nidanfloat</code>パッケージのマニュアルをご覧ください.</p></li> +<li><p>フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は<code>luatexja-fontspec</code>や<code>luatexja-preset</code>(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,<a href="https://github.com/zr-tex8r/PXchfon">PXchfon</a>での設定が可能です.</p></li> </ul> <h2 id="各種設計">各種設計</h2> <p>設計はクラスオプションまたは<code>\jlreqsetup</code>によりkeyval形式で行います.以下では次の用法を使います.</p> @@ -207,7 +208,7 @@ <h3 id="箇条書き">箇条書き</h3> <p><code>\jlreqsetup</code>で指定します.</p> <ul> -<li><code>itemization_beforeafter_space=<寸法></code>:箇条書きの前後の空きを指定します.<code>itemization_beforeafter_space={i=<寸法>}</code>とするとトップレベルのみに設定を行います.<code>itemization_beforeafter_space={0pt,i=10pt,ii=5pt}</code>とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.</li> +<li><code>itemization_beforeafter_space=<寸法></code>:箇条書きの前後の空きを指定します.<code>itemization_beforeafter_space={i=<寸法>}</code>とするとトップレベルのみに設定を行います.<code>itemization_beforeafter_space={0pt,i=10pt,ii=5pt}</code>とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.レベルは上記のように小文字ローマ数字で指定します.</li> <li><code>itemization_itemsep=<寸法></code>:項目同士の空きを指定します.</li> </ul> <h3 id="定理環境">定理環境</h3> @@ -452,6 +453,12 @@ <li><code>column_gap</code>クラスオプションを使うとコンパイルできなかったバグ修正.</li> <li><code>mark_format</code>を<code>\DeclarePageStyle</code>に追加.</li> </ul></li> +<li>2018-05-19 +<ul> +<li>目次内のラベルの長さを今までよりも長くした.</li> +<li>一部のマクロをjlreq-helpers.styに分離した.</li> +<li>バグ修正.</li> +</ul></li> </ul> <hr /> <p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p> diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html new file mode 100644 index 00000000000..51986b7111b --- /dev/null +++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html @@ -0,0 +1,129 @@ +<!DOCTYPE html> +<html lang="ja"> +<head> + <meta charset="utf-8"> + <meta name="generator" content="pandoc"> + <title>jlreq-trimmarks</title> + <style> + .markdown-body { + padding-top: 10px; + padding-bottom: 10px; + background-color: white; + padding: 30px; + line-height: 170%; + } + h1{ + font-size: 200%; + } + h2{ + border-style: solid; + border-width: 0 0 0.1em 0em; + padding: 0 0 0.2em 0em; + border-color: #EEEEEE; + margin-top: 2em; + } + h3{ + border-style: solid; + border-width: 0 0 0 0.5em; + padding: 0 0 0 0.5em; + border-color: #EEEEEE; + margin-top: 2em; + } + code{ + white-space: pre; + font-weight: normal; + background-color: #F4F4F4; + border-color: #F4F4F4; + border-style: solid; + border-width: .2em .5em; + border-radius: .2em; + } + pre{ + background-color: #F8F8F8; + border-color: #F8F8F8; + border-width: 1em; + border-style: solid; + border-radius: .5em; + padding: 0; + margin: 0; + line-height: 130%; + } + pre code{ + background-color: #F8F8F8; + border-style: none; + } + </style> +</head> +<body> +<article class="markdown-body"> +<h1 id="jlreq-trimmarks">jlreq-trimmarks</h1> +<h2 id="これは何">これは何?</h2> +<p>トンボ(トリムマーク)を出力するためのパッケージです.<a href="https://osdn.jp/projects/luatex-ja/wiki/FrontPage">LuaTeX-ja</a> / pLaTeX / upLaTeX / dvipdfmx / Dvips / dviout上で動きます.以下の機能を提供します.</p> +<ul> +<li>トンボの出力</li> +<li>可能な場合には,TrimBox / BleedBoxを設定</li> +<li>紙サイズの設定</li> +</ul> +<h2 id="インストール">インストール</h2> +<p>$TEXMF/tex/latex/jlreq内にjlreq-trimmarks.styとjlreq-helpers.styを配置してください.</p> +<h2 id="使い方">使い方</h2> +<p>ドライバおよびエンジンを指定して<code>\usepackage</code>で読み込みます.エンジンは省略が可能です.</p> +<pre><code>\usepackage[dvipdfmx,platex]{jlreq-trimmarks} +</code></pre> +<h2 id="オプション">オプション</h2> +<p>以下のクラスオプションを受け付けます.keyval形式です.</p> +<h3 id="platex-uplatex-lulatex"><code>platex</code>, <code>uplatex</code>, <code>lulatex</code></h3> +<p>エンジンの指定です.省略時は,</p> +<ul> +<li><code>jlreq</code>クラスファイルを読み込んでいる場合はそれと連動する</li> +<li>そうでなければ自動推定</li> +</ul> +<p>です.</p> +<h3 id="dvipdfmxdvipsdviout"><code>dvipdfmx</code>,<code>dvips</code>,<code>dviout</code></h3> +<p>dviドライバの指定です.省略時は</p> +<ul> +<li><code>lualatex</code>利用時はLuaLaTeXによりPDF出力が行われると見なされる.</li> +<li><code>platex</code>または<code>uplatex</code>利用時は<code>dvipdfmx</code>.</li> +</ul> +<h3 id="trimmarks_paper"><code>trimmarks_paper</code></h3> +<p>トンボ付きの紙サイズを指定します.<code>trimmarks_paper=a4</code>のように,<code>a0--a10</code>, <code>b0--b10</code>, <code>c2--c8</code>(BはJIS B列)を指定できる他,<code>trimmarks_paper={<width>,<height>}</code>と直接寸法を指定することも可能です.指定されなかった場合は,現在の紙サイズから縦横2インチ増えた値を採用します.</p> +<h3 id="show"><code>show</code></h3> +<p>何を出力するか指定します.<code>show={trimmarks,banner,digital}</code>のようにカンマ区切りのリストを与えます.引数を与えない場合は全て表示します.</p> +<ul> +<li><code>trimmarks</code>:トンボ自身を出力します.</li> +<li><code>banner</code>:日付などを出力します.</li> +<li><code>digital</code>:TrimBoxとBleedBoxの設定を行います(デジタルトンボ).</li> +<li><code>no</code>:何も表示しません.</li> +</ul> +<h2 id="jlreqtrimmarkssetup"><code>\jlreqtrimmarkssetup</code></h2> +<p>クラスオプションで指定できない設定を行えます.keyval形式です.</p> +<h3 id="banner"><code>banner</code></h3> +<p><code>show=banner</code>時に出力される文字列.</p> +<h3 id="bleed_margin"><code>bleed_margin</code></h3> +<p>仕上がりと裁ち落としの間(ドブ)の長さを指定します.</p> +<h3 id="trimmarks_width"><code>trimmarks_width</code></h3> +<p>トンボ自身の太さを指定します.</p> +<h3 id="color"><code>color</code></h3> +<p>トンボの色.この機能を利用するには,あらかじめ<code>\color</code>を定義するパッケージ(<code>color</code>パッケージまたはその派生)を読み込んでおく必要があります.ここでの指定は次のようにして<code>\color</code>命令に変換されます.</p> +<ul> +<li><p><code>cy</code>や<code>myk</code>のように<code>cmyk</code>という文字列の一部の場合は,<code>cmyk</code>で指定された色のみの色になります.例えば<code>color=cy</code>は<code>\color[cmyk]{1,0,1,0}</code>となります.</p></li> +<li><p>そうでない場合は<code>\color</code>の引数に回されます.<code>[***]</code>という形が先行する場合は,<code>\color</code>のオプションとして扱われます.例えば以下のようになります.</p> +<ul> +<li><code>black</code> -> <code>\color{black}</code></li> +<li><code>[cmyk]0.5,0.5,0.5,0</code> -> <code>\color[cmyk]{0.5,0.5,0.5,0}</code></li> +</ul></li> +</ul> +<h2 id="ライセンス">ライセンス</h2> +<p>このパッケージは二条項BSDライセンスの元で配布されています.詳しくは<a href="LICENSE" class="uri">LICENSE</a>をご覧ください.</p> +<h2 id="履歴">履歴</h2> +<ul> +<li>2018-05-19 +<ul> +<li>最初のバージョン</li> +</ul></li> +</ul> +<hr /> +<p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p> +</article> +</body> +</html> diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md new file mode 100644 index 00000000000..a09c1d494db --- /dev/null +++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md @@ -0,0 +1,82 @@ +# jlreq-trimmarks + +## これは何? +トンボ(トリムマーク)を出力するためのパッケージです.[LuaTeX-ja](https://osdn.jp/projects/luatex-ja/wiki/FrontPage) / pLaTeX / upLaTeX / dvipdfmx / Dvips / dviout上で動きます.以下の機能を提供します. + +* トンボの出力 +* 可能な場合には,TrimBox / BleedBoxを設定 +* 紙サイズの設定 + +## インストール +$TEXMF/tex/latex/jlreq内にjlreq-trimmarks.styとjlreq-helpers.styを配置してください. + + +## 使い方 +ドライバおよびエンジンを指定して`\usepackage`で読み込みます.エンジンは省略が可能です. + +```` +\usepackage[dvipdfmx,platex]{jlreq-trimmarks} +```` + +## オプション +以下のクラスオプションを受け付けます.keyval形式です. + +### `platex`, `uplatex`, `lulatex` +エンジンの指定です.省略時は, + +* `jlreq`クラスファイルを読み込んでいる場合はそれと連動する +* そうでなければ自動推定 + +です. + +### `dvipdfmx`,`dvips`,`dviout` +dviドライバの指定です.省略時は + +* `lualatex`利用時はLuaLaTeXによりPDF出力が行われると見なされる. +* `platex`または`uplatex`利用時は`dvipdfmx`. + +### `trimmarks_paper` +トンボ付きの紙サイズを指定します.`trimmarks_paper=a4`のように,`a0--a10`, `b0--b10`, `c2--c8`(BはJIS B列)を指定できる他,`trimmarks_paper={<width>,<height>}`と直接寸法を指定することも可能です.指定されなかった場合は,現在の紙サイズから縦横2インチ増えた値を採用します. + +### `show` +何を出力するか指定します.`show={trimmarks,banner,digital}`のようにカンマ区切りのリストを与えます.引数を与えない場合は全て表示します. + +* `trimmarks`:トンボ自身を出力します. +* `banner`:日付などを出力します. +* `digital`:TrimBoxとBleedBoxの設定を行います(デジタルトンボ). +* `no`:何も表示しません. + +## `\jlreqtrimmarkssetup` +クラスオプションで指定できない設定を行えます.keyval形式です. + +### `banner` +`show=banner`時に出力される文字列. + +### `bleed_margin` +仕上がりと裁ち落としの間(ドブ)の長さを指定します. + +### `trimmarks_width` +トンボ自身の太さを指定します. + +### ` color` +トンボの色.この機能を利用するには,あらかじめ`\color`を定義するパッケージ(`color`パッケージまたはその派生)を読み込んでおく必要があります.ここでの指定は次のようにして`\color`命令に変換されます. + +* `cy`や`myk`のように`cmyk`という文字列の一部の場合は,`cmyk`で指定された色のみの色になります.例えば`color=cy`は`\color[cmyk]{1,0,1,0}`となります. +* そうでない場合は`\color`の引数に回されます.`[***]`という形が先行する場合は,`\color`のオプションとして扱われます.例えば以下のようになります. + + - `black` -> `\color{black}` + - `[cmyk]0.5,0.5,0.5,0` -> `\color[cmyk]{0.5,0.5,0.5,0}` + +## ライセンス +このパッケージは二条項BSDライセンスの元で配布されています.詳しくは[LICENSE](LICENSE)をご覧ください. + +## 履歴 +* 2018-05-19 + - 最初のバージョン + + + +-------------- +Noriyuki Abe +https://github.com/abenori/jlreq + diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html new file mode 100644 index 00000000000..728d596f29e --- /dev/null +++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html @@ -0,0 +1,130 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="generator" content="pandoc"> + <title>jlreq-trimmarks</title> + <style> + .markdown-body { + padding-top: 10px; + padding-bottom: 10px; + background-color: white; + padding: 30px; + line-height: 170%; + } + h1{ + font-size: 200%; + } + h2{ + border-style: solid; + border-width: 0 0 0.1em 0em; + padding: 0 0 0.2em 0em; + border-color: #EEEEEE; + margin-top: 2em; + } + h3{ + border-style: solid; + border-width: 0 0 0 0.5em; + padding: 0 0 0 0.5em; + border-color: #EEEEEE; + margin-top: 2em; + } + code{ + white-space: pre; + font-weight: normal; + background-color: #F4F4F4; + border-color: #F4F4F4; + border-style: solid; + border-width: .2em .5em; + border-radius: .2em; + } + pre{ + background-color: #F8F8F8; + border-color: #F8F8F8; + border-width: 1em; + border-style: solid; + border-radius: .5em; + padding: 0; + margin: 0; + line-height: 130%; + } + pre code{ + background-color: #F8F8F8; + border-style: none; + } + </style> +</head> +<body> +<article class="markdown-body"> +<h1 id="jlreq-trimmarks">jlreq-trimmarks</h1> +<h2 id="what-is-this">What is this?</h2> +<p>This package outputs trim marks. It works with <a href="https://osdn.jp/projects/luatex-ja/wiki/FrontPage">LuaTeX-ja</a> / pLaTeX / upLaTeX / dvipdfmx / Dvips / dviout. It provides the following.</p> +<ul> +<li>Output trim marks</li> +<li>Set TrimBox and BleedBox if possible.</li> +<li>Set the size of paper..</li> +</ul> +<h2 id="installation">Installation</h2> +<p>Move jlreq-trimmarks.sty and jlre-helpers.sty to $TEXMF/tex/latex/jlreq.</p> +<h2 id="how-to-use">How to use</h2> +<p>Load it by <code>\usepackage</code> with specifying the TeX engine and the DVI driver.</p> +<pre><code>\usepackage[dvipdfmx,platex]{jlreq-trimmarks} +</code></pre> +<h2 id="options">Options</h2> +<p>The following class options (keyval style) are available.</p> +<h3 id="platex-uplatex-lulatex"><code>platex</code>, <code>uplatex</code>, <code>lulatex</code></h3> +<p>Set the engine. If it is not specified, then the engine is</p> +<ul> +<li>the one used in the jlreq class if the jlreq class is loaded.</li> +<li>guessed one if the jlreq class is not loaded.</li> +</ul> +<h3 id="dvipdfmx-dvips-dviout"><code>dvipdfmx</code>, <code>dvips</code>, <code>dviout</code></h3> +<p>Set the dvi driver. If it is not specified, then</p> +<ul> +<li>the package outputs PDF file via LuaLaTeX when the engine is <code>lualatex</code>.</li> +<li>the driver is <code>dvipdmx</code> if the engine is <code>platex</code> or <code>uplatex</code></li> +</ul> +<h3 id="trimmarks_paper"><code>trimmarks_paper</code></h3> +<p>Set the size of the paper including trim marks. There are two ways to specify it.</p> +<ul> +<li><code>trimmarks_paper=<paper type></code>: for the paper type, you can use <code>a0--a10</code>, <code>b0--b10</code> and <code>c2--c8</code>. Note that <code>b0--b10</code> is `JIS B' (Japanese B-series variant).</li> +<li><code>trimmarks_paper={<width>,height>}</code></li> +</ul> +<h3 id="show"><code>show</code></h3> +<p>Specify the types of trim marks which the package outputs. It is specified with the comma separated list like <code>show={trimmarks,banner,digital}</code>. If no argument is given, everything will be showed.</p> +<ul> +<li><code>trimmarks</code>: outputs the trim marks.</li> +<li><code>banner</code>: date etc.</li> +<li><code>digital</code>:TrimBox and BleedBox.</li> +<li><code>no</code>: nothing will be showed</li> +</ul> +<h2 id="jlreqtrimmarkssetup"><code>\jlreqtrimmarkssetup</code></h2> +<p>Set the additional settings with the keyval style.</p> +<h3 id="banner"><code>banner</code></h3> +<p>The things which the package outputs when <code>show=banner</code> is specified in the class option.</p> +<h3 id="bleed_margin"><code>bleed_margin</code></h3> +<p>Set the bleed margin.</p> +<h3 id="trimmarks_width"><code>trimmarks_width</code></h3> +<p>Set the width of trim marks.</p> +<h3 id="color"><code>color</code></h3> +<p>Set the color of the trim marks. You have to load a package which defines <code>\color</code> (`color' package or its variant) before loading this package to use this function. Here are some examples of specifying the color.</p> +<ul> +<li><code>color=c</code> -> <code>\color[cmyk]{1,0,0,0}</code></li> +<li><code>color=cyk</code> -> <code>\color[cmyk]{1,0,1,1}</code></li> +<li><code>black</code> -> <code>\color{black}</code></li> +<li><code>[cmyk]0.5,0.5,0.5,0</code> -> <code>\color[cmyk]{0.5,0.5,0.5,0}</code></li> +</ul> +<h2 id="license">LICENSE</h2> +<p>This package is distributed under the BSD 2-Clause License. See <a href="LICENSE" class="uri">LICENSE</a>.</p> +<h2 id="changelog">CHANGELOG</h2> +<ul> +<li>2018-05-19 +<ul> +<li>First release.</li> +</ul></li> +</ul> +<hr /> +<p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p> +</article> +</body> +</html> diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md new file mode 100644 index 00000000000..0d90685b740 --- /dev/null +++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md @@ -0,0 +1,80 @@ +# jlreq-trimmarks + +## What is this? +This package outputs trim marks. It works with [LuaTeX-ja](https://osdn.jp/projects/luatex-ja/wiki/FrontPage) / pLaTeX / upLaTeX / dvipdfmx / Dvips / dviout. It provides the following. + +* Output trim marks +* Set TrimBox and BleedBox if possible. +* Set the size of paper.. + +## Installation +Move jlreq-trimmarks.sty and jlre-helpers.sty to $TEXMF/tex/latex/jlreq. + +## How to use +Load it by `\usepackage` with specifying the TeX engine and the DVI driver. + +```` +\usepackage[dvipdfmx,platex]{jlreq-trimmarks} +```` + +## Options +The following class options (keyval style) are available. + +### `platex`, `uplatex`, `lulatex` +Set the engine. If it is not specified, then the engine is + +* the one used in the jlreq class if the jlreq class is loaded. +* guessed one if the jlreq class is not loaded. + +### `dvipdfmx`, `dvips`, `dviout` +Set the dvi driver. If it is not specified, then + +* the package outputs PDF file via LuaLaTeX when the engine is `lualatex`. +* the driver is `dvipdmx` if the engine is `platex` or `uplatex` + +### `trimmarks_paper` +Set the size of the paper including trim marks. There are two ways to specify it. + +* `trimmarks_paper=<paper type>`: for the paper type, you can use `a0--a10`, `b0--b10` and `c2--c8`. Note that `b0--b10` is `JIS B' (Japanese B-series variant). +* `trimmarks_paper={<width>,height>}` + +### `show` +Specify the types of trim marks which the package outputs. It is specified with the comma separated list like `show={trimmarks,banner,digital}`. If no argument is given, everything will be showed. + +* `trimmarks`: outputs the trim marks. +* `banner`: date etc. +* `digital`:TrimBox and BleedBox. +* `no`: nothing will be showed + +## `\jlreqtrimmarkssetup` +Set the additional settings with the keyval style. + +### `banner` +The things which the package outputs when `show=banner` is specified in the class option. + +### `bleed_margin` +Set the bleed margin. + +### `trimmarks_width` +Set the width of trim marks. + +### ` color` +Set the color of the trim marks. You have to load a package which defines `\color` (`color' package or its variant) before loading this package to use this function. Here are some examples of specifying the color. + +* `color=c` -> `\color[cmyk]{1,0,0,0}` +* `color=cyk` -> `\color[cmyk]{1,0,1,1}` +* `black` -> `\color{black}` +* `[cmyk]0.5,0.5,0.5,0` -> `\color[cmyk]{0.5,0.5,0.5,0}` + +## LICENSE +This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENSE). + +## CHANGELOG +* 2018-05-19 + - First release. + + +-------------- +Noriyuki Abe +https://github.com/abenori/jlreq + diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq.html b/Master/texmf-dist/doc/latex/jlreq/jlreq.html index 547c810a7ce..80d781d4907 100644 --- a/Master/texmf-dist/doc/latex/jlreq/jlreq.html +++ b/Master/texmf-dist/doc/latex/jlreq/jlreq.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="ja"> +<html lang="en"> <head> <meta charset="utf-8"> <meta name="generator" content="pandoc"> @@ -65,7 +65,7 @@ <li>*.tfm -> $TEXMF/fonts/tfm/public/jlreq</li> <li>*.vf -> $TEXMF/fonts/vf/public/jlreq</li> <li>jfm-jlreq.lua jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq</li> -<li>jlreq.cls -> $TEXMF/tex/latex/jlreq</li> +<li>jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq</li> </ul> <p><code>make install</code> will do this where $TEXMF=$TEXMFHOME</p> <h2 id="usage">Usage</h2> @@ -162,6 +162,12 @@ <li>Fix a bug on <code>column_gap</code> class option.</li> <li>Added <code>mark_format</code> to <code>\DeclarePageStyle</code>.</li> </ul></li> +<li>2018-05-19 +<ul> +<li>Made the width of the label in the table of contents longer.</li> +<li>Moved some macros to jlreq-helpers.sty</li> +<li>Fixed bugs.</li> +</ul></li> </ul> <hr /> <p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p> diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty new file mode 100644 index 00000000000..880622c4963 --- /dev/null +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty @@ -0,0 +1,454 @@ +% エンジン非依存のマクロ集 + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{jlreq-helpers}[2018/04/12 jlreq-helpers] +\RequirePackage{xkeyval,etoolbox} + +%. helper1 +\newcount\jlreq@tempcnta +\newcount\jlreq@tempcntb +\newcount\jlreq@tempcntc +\newdimen\jlreq@tempdima +\newdimen\jlreq@tempdimb +\newdimen\jlreq@tempdimc +\newskip\jlreq@tempskipa +\newskip\jlreq@tempskipb +\newskip\jlreq@tempskipc +\newif\ifjlreq@tempa +\newif\ifjlreq@tempb +\newif\ifjlreq@tempc +\newbox\jlreq@tempboxa +\newbox\jlreq@tempboxb +\newbox\jlreq@tempboxc +% 計算結果を返すための変数 +\newdimen\jlreq@resultdimen +\newskip\jlreq@resultskip +\newbox\jlreq@resultbox +\newif\ifjlreq@result +\newcount\jlreq@resultcnt + +\def\jlreq@uniqtoken{\jlreq@uniqtoken} +\def\jlreq@endmark{\jlreq@endmark} +\long\def\jlreq@deleteuntileendmark#1\jlreq@endmark{} + +\def\jlreq@expandafter@ii{\expandafter\expandafter\expandafter} +\edef\jlreq@expandafter@iii{\expandonce{\jlreq@expandafter@ii}\noexpand\expandafter\expandonce{\jlreq@expandafter@ii}} +\edef\jlreq@expandtwice#1{\expandonce{\jlreq@expandafter@ii}\noexpand\unexpanded\expandonce{\jlreq@expandafter@ii}{#1}} +\edef\jlreq@expand@three#1{\expandonce{\jlreq@expandafter@iii}\noexpand\unexpanded\expandonce{\jlreq@expandafter@iii}{#1}} + +% \jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@の形で使う +% 二回展開すると,#1の先頭(ただし空白は無視される)を取り出す.#1が空の場合は\jlreq@uniqtoken,先頭が{の場合は\bgroupとなる +\def\jlreq@endmark@{\jlreq@endmark@} % \jlreq@getfirsttokenだけのためのendmark +\long\def\jlreq@getfirsttoken#1#{\jlreq@getfirsttoken@#1\bgroup\jlreq@endmark@} +\long\def\jlreq@getfirsttoken@#1#2\jlreq@endmark@#3\jlreq@endmark@{#1} +% 与えられたトークン列が空か(展開はしないでチェック) +\long\def\jlreq@ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} +% #1の先頭トークンが#2か(ただし#1が空ならば#2=\jlreq@uniqtoken,#1={ならば#2=\bgroupでTRUEとなる) +\long\edef\jlreq@iffirsttoken#1#2{% + % スペースチェック + \unexpanded{\expandafter\expandafter\expandafter\jlreq@deleteuntileendmark\expandafter\ifx\expandafter}\expandonce{\space}\noexpand\detokenize{#1}\unexpanded{\@undefined\jlreq@endmark\expandafter\@firstoftwo\else\jlreq@endmark\expandafter\@secondoftwo\fi}{% + \noexpand\ifx\expandonce{\space}#2\unexpanded{\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}% + }{% + \noexpand\jlreq@iffirsttoken@ignorespaces{#1}{#2}% + }% +} +% こちらは先頭のスペースを読み飛ばす +\long\def\jlreq@iffirsttoken@ignorespaces#1#2{% + \expandafter\expandafter\expandafter\ifx\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi +} + +% #1が\jlreq@endmarkか +\long\def\jlreq@ifendmark#1{\jlreq@iffirsttoken{#1}{\jlreq@endmark}} + +% #1の先頭が引数なしのマクロか +\long\def\jlreq@ifmacro@noargument#1{% + \jlreq@ifempty{#1}{\@secondoftwo}{% + \jlreq@iffirsttoken{#1}{ }{\@secondoftwo}{% + \expandafter\expandafter\expandafter\jlreq@ifmacro@noargument@\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@ +}}} +\long\def\jlreq@ifmacro@noargument@#1{\expandafter\jlreq@ifmacro@noargument@@\expandafter{\meaning #1}} +\edef\jlreq@do{% + \unexpanded{\def\jlreq@ifmacro@noargument@@}##1{\noexpand\jlreq@ifmacro@noargument@@@##1\expandonce{\detokenize{macro:->}}\noexpand\jlreq@endmark} + \unexpanded{\def\jlreq@ifmacro@noargument@@@}##1\expandonce{\detokenize{macro:->}}##2\noexpand\jlreq@endmark{\noexpand\jlreq@ifempty{##1}} +} +\jlreq@do + +% #1(skipレジスタ)が0か(展開不可). +\newcommand*\jlreq@ifgluezero[1]{% + \begingroup + \edef\@tempa{\the#1}% + \edef\@tempb{\detokenize{0.0pt}}% + \edef\jlreq@do{\ifx\@tempa\@tempb\noexpand\@firstoftwo\else\noexpand\@secondoftwo\fi}% + \expandafter\endgroup + \jlreq@do +} + +% #1が#2で終わるか(展開不可) +\newcommand*{\jlreq@ifendswith}[2]{% + \jlreq@ifempty{#2}{\@firstoftwo}{% + \begingroup + \def\jlreq@tempa##1#2\jlreq@uniqtoken##2\jlreq@endmark{% + \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}% + }% + \jlreq@tempa#1\jlreq@uniqtoken#2\jlreq@uniqtoken\jlreq@endmark + \expandafter\endgroup + \jlreq@do + }% +} +% #1が#2で始まるか(展開不可) +\newcommand*{\jlreq@ifstartswith}[2]{% + \jlreq@ifempty{#2}{\@firstoftwo}{% + \jlreq@ifempty{#1}{\@secondoftwo}{% + \begingroup + \def\jlreq@tempa##1#2##2\jlreq@endmark{% + \edef\jlreq@do{\jlreq@ifempty{##1}{\noexpand\@firstoftwo}{\noexpand\@secondoftwo}}% + }% + \jlreq@tempa#1#2\jlreq@endmark + \expandafter\endgroup + \jlreq@do + }% + }% +} +% #1が#2を含むか(展開不可){}内に#2があってもFALSE判定. +\newcommand*{\jlreq@ifcontains}[2]{% + \jlreq@ifempty{#2}{\@firstoftwo}{% + \begingroup + \def\jlreq@tempa##1#2##2\jlreq@endmark{% + \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}% + }% + \jlreq@tempa#1#2\jlreq@endmark + \expandafter\endgroup + \jlreq@do + }% +} + +% @removeelementの括弧があっても動くかもしれない版 +% #2から#1を消して#3に入れる +\newcommand*{\jlreq@helper@removeelement}[3]{% + \begingroup + \edef\jlreq@tempa{\unexpanded{#1}}% 消したいやつ + \def\jlreq@tempb{}% 消していない分を放り込んでいく + \jlreq@tempatrue% 最初の\jlreq@tempbへの追加か. + \jlreq@helper@removeelement@#2,\jlreq@endmark,% + \edef\jlreq@do{\unexpanded{\def#3}{\expandonce{\jlreq@tempb}}}% + \expandafter\endgroup + \jlreq@do +} +\def\jlreq@helper@removeelement@#1,{% + \jlreq@ifendmark{#1}{}{% + \edef\@tempa{\unexpanded{#1}}% + \ifx\jlreq@tempa\@tempa\expandafter\@gobble\else\expandafter\@firstofone\fi{% + \eappto\jlreq@tempb{\ifjlreq@tempa\else,\fi\unexpanded{#1}}% + \jlreq@tempafalse + }% + \jlreq@helper@removeelement@ + }% +} + +% 空白を無視しない\@ifnextchar +\newcommand{\jlreq@ifnextchar}[3]{% + \let\reserved@d=#1% + \edef\reserved@a{\unexpanded{#2}}% + \edef\reserved@b{\unexpanded{#3}}% + \futurelet\jlreq@nextchar\jlreq@ifnextchar@ +} +\def\jlreq@ifnextchar@{% + \ifx\jlreq@nextchar\reserved@d\let\reserved@b\reserved@a\fi + \reserved@b +} +% 空白を無視しない\@ifsart +\newcommand*{\jlreq@ifstar}[2]{\jlreq@ifnextchar *{\edef\reserved@a*{\unexpanded{#1}}\reserved@a}{#2}} +% カンマで区切って,その前と後ろを\jlreq@resulta,\jlreq@resultbに入れる +% もしカンマがない場合は\ifjlreq@resultがfalseになる. +\newcommand*{\jlreq@helper@dividebycomma}[1]{\jlreq@helper@dividebycomma@#1,\jlreq@endmark} +\def\jlreq@helper@dividebycomma@#1,#2\jlreq@endmark{% + \def\jlreq@resulta{#1}% + \def\jlreq@resultb{#2}% + \ifx\jlreq@resultb\@empty\jlreq@resultfalse\else\jlreq@resulttrue\expandafter\def\expandafter\jlreq@resultb\expandafter{\jlreq@helper@removelastcomma#2\jlreq@endmark}\fi +} +\def\jlreq@helper@removelastcomma#1,\jlreq@endmark{#1} + +% vbox #1の最後を\jlreq@resultboxに入れる +% #1の最後の行は消える +\newcommand*{\jlreq@getlastbox}[1]{% + \setbox#1=\vbox{\unvbox#1\relax + \unskip\unskip\unpenalty\global\setbox\jlreq@resultbox=\lastbox}% + \ifhbox\jlreq@resultbox + \global\setbox\jlreq@resultbox=\hbox{% + \unhbox\jlreq@resultbox\unskip\unskip\unpenalty}% + \else + \global\setbox\jlreq@resultbox=\copy\voidb@x + \fi +} + +% 簡易なkeyvalのパース. +% \jlreq@parsekeyval*[family=jlreq@key]{ % *ありは\setkeys*を使う +% {key}{\def\val{#1}} +% *{key}{\def\val{#1}} % デフォルト値を空文字列にする +% {key}[choice1,choice2]{\def\valchoice{#1}} +%}{parse対象} +\newcommand*{\jlreq@parsekeyval}{% + \@ifstar{\jlreq@helper@parsekeyval@{*}}{\jlreq@helper@parsekeyval@{}}% +} +\def\jlreq@helper@parsekeyval@#1{% + \@ifnextchar[{\jlreq@helper@parsekeyval@@{#1}}{\jlreq@helper@parsekeyval@@{#1}[jlreq@key]}% +} +\long\def\jlreq@helper@parsekeyval@@#1[#2]#3#4{% + \begingroup + \def\jlreq@do{}% + \jlreq@helper@parsekeyval@@@{#2}#3{\jlreq@endmark}% + \setkeys#1{#2}{#4}% + \expandafter\endgroup + \jlreq@do +} +\def\jlreq@helper@parsekeyval@@@#1#2#{% + \jlreq@iffirsttoken@ignorespaces{#2}{*}{% + \jlreq@helper@parsekeyval@@@definekeywithdefault{#1}% + }{% + \jlreq@helper@parsekeyval@@@@{#1}% + }% +} +\long\def\jlreq@helper@parsekeyval@@@@#1#2{% + \jlreq@ifendmark{#2}{}{% + \@ifnextchar[{\jlreq@helper@parsekeyval@@@choicekey{#1}{#2}}{\jlreq@helper@parsekeyval@@@definekey{#1}{#2}}% + }% +} +\long\def\jlreq@helper@parsekeyval@@@choicekey#1#2[#3]#4{% + \define@choicekey{#1}{#2}{#3}{\eappto\jlreq@do{\unexpanded{#4}}}% + \jlreq@helper@parsekeyval@@@{#1}% +} +\long\def\jlreq@helper@parsekeyval@@@definekeywithdefault#1#2#3{% + \define@key{#1}{#2}[]{\eappto\jlreq@do{\unexpanded{#3}}}% + \jlreq@helper@parsekeyval@@@{#1}% +} +\long\def\jlreq@helper@parsekeyval@@@definekey#1#2#3{% + \define@key{#1}{#2}{\eappto\jlreq@do{\unexpanded{#3}}}% + \jlreq@helper@parsekeyval@@@{#1}% +} + +% キー指定しないkeyval(独自実装) +% \jlreq@parsekeyval@nokey{<action>}{<parse対象>} +% action内では#1=key, #2=val +\newcommand{\jlreq@parsekeyval@nokey}[2]{% + \begingroup + \def\jlreq@do{}% + \def\jlreq@parsekeyval@nokey@execute##1##2{#1}% + \expandafter\jlreq@parsekeyval@nokey@#2,\jlreq@endmark,% + \expandafter\endgroup + \jlreq@do +} +\long\def\jlreq@parsekeyval@nokey@#1,{% + \jlreq@ifendmark{#1}{}{\jlreq@parsekeyval@nokey@@#1=\jlreq@endmark}% +} +\long\def\jlreq@parsekeyval@nokey@@#1=#2\jlreq@endmark{% + \jlreq@ifempty{#2}{\jlreq@parsekeyval@nokey@@@{}{#1}}{\expandafter\jlreq@parsekeyval@nokey@@@\expandafter{\jlreq@parsekeyval@nokey@@@@#2\jlreq@endmark}{#1}}% +} +\long\def\jlreq@parsekeyval@nokey@@@#1#2{% + \eappto\jlreq@do{\expandonce{\jlreq@parsekeyval@nokey@execute{#2}{#1}}}% + \jlreq@parsekeyval@nokey@ +} +\long\def\jlreq@parsekeyval@nokey@@@@#1=\jlreq@endmark{#1} + +% \jlreq@switch{str}{ +% {str}{abcd} +% {str1}{xyz} +%}[default: input = #1] -> abcd +%または +% +% \jlreq@switch{str}{ +% {str}{abcd} +% {str1}{xyz} +% {default} % ここは#1を受け付けない(パラメータトークンを受け付けたい場合のため). +%} -> abcd +% 文字列比較→\edefして比較する +% 第一引数は\jlreq@tempaに入れておく. +\long\def\jlreq@helper@switch@executeoption#1[#2]{% + \begingroup + \def\jlreq@do##1{#2}% + \expandafter\endgroup + \jlreq@do{#1}% +} +\long\def\jlreq@helper@removeoption[#1]{} +\newcommand{\jlreq@switch}[2]{% + \begingroup + \let\jlreq@do\@undefined + \edef\jlreq@tempa{#1}% ループ中ずっと保存する + \jlreq@helper@switch@#2\jlreq@endmark + \ifx\jlreq@do\@undefined + \def\jlreq@do{\@ifnextchar[{\jlreq@helper@switch@executeoption{#1}}{}}% + \else + \appto\jlreq@do{\@ifnextchar[{\jlreq@helper@removeoption}{}}% + \fi + \expandafter\endgroup + \jlreq@do +} +\long\def\jlreq@helper@switch@#1{% + \jlreq@ifendmark{#1}{}{\jlreq@helper@switch@@{#1}}% +} + +\long\def\jlreq@helper@switch@@#1#2{% + \jlreq@ifendmark{#2}{% + \edef\jlreq@do{\unexpanded{#1}}% + }{% + \edef\jlreq@tempb{#1}% + \ifx\jlreq@tempa\jlreq@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{% + \edef\jlreq@do{\unexpanded{#2}}% + \jlreq@deleteuntileendmark + }{% + \jlreq@helper@switch@ + }% + }% +} + + +\RequirePackage[savepos]{zref} +\newcount\jlreq@zref@reference@count +\jlreq@zref@reference@count=0 +% 現在のページを得る +\zref@newprop*{jlreq@page}[0]{\number\c@page} +\zref@addprop{main}{jlreq@page} +\newcount\jlreq@currentpage +% \jlreq@setcurrentpageをすると,\jlreq@currentpageにこの場所のページ数が入る +\newcommand*{\jlreq@setcurrentpage}{% + \global\advance\jlreq@zref@reference@count by 1 + \zref@labelbyprops{jlreq@currentpage.\the\jlreq@zref@reference@count}{jlreq@page}% + \global\jlreq@currentpage=\zref@extractdefault{jlreq@currentpage.\the\jlreq@zref@reference@count}{jlreq@page}{\c@page}\relax +} + +% 先頭にあるマクロを展開しまくった結果の先頭を#2に入れる. +\newcommand{\jlreq@getfirsttoken@expandmacros}[2]{% + \jlreq@iffirsttoken{#1}{ }{\def#2{ }}{% + \jlreq@ifempty{#1}{\def#2{}}{% + \jlreq@ifmacro@noargument{#1}{% + \expandafter\jlreq@getfirsttoken@expandmacros\expandafter{#1}{#2}% + }{% + \expandafter\expandafter\expandafter\jlreq@getfirsttoken@expandmacros@\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@{#2}% + }% + }% + }% +} +\def\jlreq@getfirsttoken@expandmacros@#1#2{\def#2{#1}} + +\def\jlreq@helper@checktokenlist#1#2{% + \jlreq@ifendmark{#2}{\@firstoftwo}% + {% + \ifnum0#1{#2}>0 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi + {\jlreq@helper@checktokenlist{#1}}% + {\expandafter\@secondoftwo\jlreq@deleteuntileendmark}% + }% +} +\def\jlreq@helper@chknumlist#1{\ifx#101\fi\ifx#111\fi\ifx#121\fi\ifx#131\fi\ifx#141\fi\ifx#151\fi\ifx#161\fi\ifx#171\fi\ifx#181\fi\ifx#191\fi} +\def\jlreq@helper@chkfloatlist#1{\jlreq@helper@chknumlist{#1}\ifx#1.1\fi} +% #1が[0-9\.]*に当てはまるか. +\newcommand*{\jlreq@iffloat}[1]{\jlreq@helper@checktokenlist{\jlreq@helper@chkfloatlist}#1\jlreq@endmark} +\newcommand*{\jlreq@ifnumber}[1]{\jlreq@helper@checktokenlist{\jlreq@helper@chknumlist}#1\jlreq@endmark} + +% \jlreq@ifprimitive#1#2#3: #1がprimitiveならば#2を,そうでなければ#3を実行する +% (\if(pdf)primitiveを避けるようにしている.) +\newcommand*{\jlreq@ifprimitive}[1]{% + \begingroup + \edef\@tempa{\string#1}% + \edef\@tempb{\meaning#1}% + \expandafter\endgroup + \ifx\@tempa\@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi +} + +\newcommand*{\jlreq@helper@guessengine}{% + \jlreq@ifprimitive\directlua{% + \let\jlreq@result=l% + }{% + \jlreq@ifprimitive\ucs{% + \let\jlreq@result=u% + }{% + \let\jlreq@result=p% + }% + }% +} + +% #1を\@undefinedに,既に\@undefinedならば#2{#1}を呼ぶ +\newcommand*{\jlreq@helper@undefcs}[2]{% + \ifundef{#1}{#2{#1}}{\undef{#1}}% +} +% \if版 +\newcommand*{\jlreq@helper@undefif}[2]{% + \ifundef{#1}{#2{#1}}{% + \edef\@tempa{\expandafter\@gobble\string#1}% + \edef\@tempa{\expandafter\@gobbletwo\@tempa}% + \undef{#1}% + \expandafter\undef\expandafter{\csname\@tempa true\endcsname}% + \expandafter\undef\expandafter{\csname\@tempa false\endcsname}% + }% +} + +% 紙サイズ一覧 +\@namedef{jlreq@helper@papersizelist@a0}{{841mm}{1189mm}} +\@namedef{jlreq@helper@papersizelist@a1}{{594mm}{841mm}} +\@namedef{jlreq@helper@papersizelist@a2}{{420mm}{594mm}} +\@namedef{jlreq@helper@papersizelist@a3}{{297mm}{420mm}} +\@namedef{jlreq@helper@papersizelist@a4}{{210mm}{297mm}} +\@namedef{jlreq@helper@papersizelist@a5}{{148mm}{210mm}} +\@namedef{jlreq@helper@papersizelist@a6}{{105mm}{148mm}} +\@namedef{jlreq@helper@papersizelist@a7}{{74mm}{105mm}} +\@namedef{jlreq@helper@papersizelist@a8}{{52mm}{74mm}} +\@namedef{jlreq@helper@papersizelist@a9}{{37mm}{52mm}} +\@namedef{jlreq@helper@papersizelist@a10}{{26mm}{37mm}} + +\@namedef{jlreq@helper@papersizelist@b0}{{1030mm}{1456mm}} +\@namedef{jlreq@helper@papersizelist@b1}{{728mm}{1030mm}} +\@namedef{jlreq@helper@papersizelist@b2}{{515mm}{728mm}} +\@namedef{jlreq@helper@papersizelist@b3}{{364mm}{515mm}} +\@namedef{jlreq@helper@papersizelist@b4}{{257mm}{364mm}} +\@namedef{jlreq@helper@papersizelist@b5}{{182mm}{257mm}} +\@namedef{jlreq@helper@papersizelist@b6}{{128mm}{182mm}} +\@namedef{jlreq@helper@papersizelist@b7}{{91mm}{128mm}} +\@namedef{jlreq@helper@papersizelist@b8}{{64mm}{91mm}} +\@namedef{jlreq@helper@papersizelist@b9}{{45mm}{64mm}} +\@namedef{jlreq@helper@papersizelist@b10}{{32mm}{45mm}} + +\@namedef{jlreq@helper@papersizelist@c2}{{458mm}{648mm}} +\@namedef{jlreq@helper@papersizelist@c3}{{324mm}{458mm}} +\@namedef{jlreq@helper@papersizelist@c4}{{229mm}{354mm}} +\@namedef{jlreq@helper@papersizelist@c5}{{162mm}{229mm}} +\@namedef{jlreq@helper@papersizelist@c6}{{114mm}{162mm}} +\@namedef{jlreq@helper@papersizelist@c7}{{81mm}{114mm}} +\@namedef{jlreq@helper@papersizelist@c8}{{57mm}{81mm}} + +\@namedef{jlreq@helper@papersizelist@a4var}{{210mm}{283mm}} +\@namedef{jlreq@helper@papersizelist@b5var}{{182mm}{230mm}} + +\@namedef{jlreq@helper@papersizelist@letter}{{8.5in}{11in}} +\@namedef{jlreq@helper@papersizelist@legal}{{8.5in}{14in}} +\@namedef{jlreq@helper@papersizelist@executive}{{7.25in}{10.5in}} +\@namedef{jlreq@helper@papersizelist@hagaki}{{100mm}{148mm}} + +% #1÷#2を\jlreq@resultdimenに入れる.(#1,#2は寸法を与える.) +\newcommand*{\jlreq@helper@divide}[2]{% + \begingroup + \@tempdima=\dimexpr#1\relax\@tempdimb=\dimexpr#2\relax + % 分母を正にする + \ifdim\@tempdimb<0pt \@tempdima=-\@tempdima\@tempdimb=-\@tempdimb\fi + % \jlreq@tempdima*\@tempdimb <= \@tempdima < (\jlreq@tempdima + 1)*\@tempdimb + % となる整数\jlreq@tempdimaを捜し,\jlreq@tempdimb=\jlreq@tempdima + 1とする + \jlreq@tempdima=0pt + \ifdim\@tempdima<0pt + \loop\ifdim\strip@pt\jlreq@tempdima\@tempdimb>\@tempdima\advance\jlreq@tempdima by -1pt\repeat + \else + \loop\ifdim\strip@pt\jlreq@tempdima\@tempdimb<\@tempdima\advance\jlreq@tempdima by 1pt\repeat + \ifdim\strip@pt\jlreq@tempdima\@tempdimb=\@tempdima\else\advance\jlreq@tempdima by -1pt\fi + \fi + \jlreq@tempdimb=\dimexpr\jlreq@tempdima + 1pt\relax + % \jlreq@tempdimaと\jlreq@tempdimbで挟んでいく二分法 + \jlreq@tempcnta=0 % 無限ループを避けるためのカウンタ + \loop\ifnum\numexpr\ifdim\dimexpr\jlreq@tempdimb - \jlreq@tempdima\relax>1sp 1\else0\fi*\ifnum\jlreq@tempcnta<100 1\else 0\fi\relax=1 + \jlreq@tempdimc=\dimexpr(\jlreq@tempdima+\jlreq@tempdimb)/2\relax + \ifdim\strip@pt\jlreq@tempdimc\@tempdimb>\@tempdima\jlreq@tempdimb=\jlreq@tempdimc + \else\jlreq@tempdima=\jlreq@tempdimc\fi + \advance\jlreq@tempcnta by 1 + \repeat + \edef\jlreq@do{\noexpand\jlreq@resultdimen=\the\jlreq@tempdima\noexpand\relax}% + \expandafter\endgroup + \jlreq@do +} + +\endinput + diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty new file mode 100644 index 00000000000..48f9bd51439 --- /dev/null +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty @@ -0,0 +1,355 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{jlreq-trimmarks}[2018/05/19 jlreq-trimmarks] +\RequirePackage{xkeyval,etoolbox} +\RequirePackage{jlreq-helpers} + +\newcommand*{\jlreq@trimmarks@undeferr}[1]{\PackageError{jlreq-trimmarks}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}} +\newcommand*{\jlreq@trimmarks@afterpkg@addtodeletecs}[1]{% + \appto\jlreq@trimmarks@afterpkg@deletecslist{\jlreq@helper@undefcs{#1}{\jlreq@trimmarks@undeferr}}% +} +\newcommand*{\jlreq@trimmarks@afterpkg@addtodeleteif}[1]{% + \appto\jlreq@trimmarks@afterpkg@deletecslist{\jlreq@helper@undefif{#1}{\jlreq@trimmarks@undeferr}}% +} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@afterpkg@addtodeletecs} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@afterpkg@addtodeleteif} +\AtEndOfPackage{% + \jlreq@trimmarks@afterpkg@deletecslist + \jlreq@helper@undefcs{\jlreq@trimmarks@afterpkg@deletecslist}{\jlreq@trimmarks@undeferr}% + \undef{\jlreq@trimmarks@undeferr}% +} + +\newcommand*{\jlreq@trimmarks@DeclareOption}[2]{% + \DeclareOptionX{#1}{% + \jlreq@ifempty{##1}{}{\PackageError{jlreq-trimmarks}{The option #1 should have no value}{\@ehc}}% + #2% + } +} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@DeclareOption} + +\@ifclassloaded{jlreq}{\let\ifjlreq@trimmarks@jlreqloaded=\@firstoftwo}{\let\ifjlreq@trimmarks@jlreqloaded=\@secondoftwo} + +% dvipdfmx=f,dvips=s,dviout = o, lualatex = l +\jlreq@trimmarks@DeclareOption{dvipdfmx}{\let\jlreq@trimmarks@driver=f} +\jlreq@trimmarks@DeclareOption{dvips}{\let\jlreq@trimmarks@driver=s} +\jlreq@trimmarks@DeclareOption{dviout}{\let\jlreq@trimmarks@driver=o} +\let\jlreq@trimmarks@engine=\jlreq@engine +\jlreq@trimmarks@DeclareOption{lualatex}{\let\jlreq@trimmarks@engine=l} +\jlreq@trimmarks@DeclareOption{uplatex}{\let\jlreq@trimmarks@engine=u} +\jlreq@trimmarks@DeclareOption{platex}{\let\jlreq@trimmarks@engine=p} + +\def\jlreq@trimmarks@switchpapersize{} +\def\jlreq@trimmarks@addpapersize#1{% + \@ifnextchar[{\jlreq@trimmarks@addpapersize@{#1}}{\jlreq@trimmarks@addpapersize@@{#1}} +} +\def\jlreq@trimmarks@addpapersize@#1[#2]{% + \edef\@tempa{\unexpanded{\jlreq@trimmarks@addpapersize@@{#1}}\csexpandonce{jlreq@helper@papersizelist@#2}}% + \@tempa +} +\newcommand*{\jlreq@trimmarks@addpapersize@@}[3]{% + \@for\@tempa:=#1\do{% + \eappto\jlreq@trimmarks@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\def\jlreq@trimmarks@paperwidth{#2}\def\jlreq@trimmarks@paperheight{#3}}}}% + }% +} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@switchpapersize} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@addpapersize} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@addpapersize@} +\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@addpapersize@@} + +\jlreq@trimmarks@addpapersize{a0,A0}[a0] +\jlreq@trimmarks@addpapersize{a1,A1}[a1] +\jlreq@trimmarks@addpapersize{a2,A2}[a2] +\jlreq@trimmarks@addpapersize{a3,A3}[a3] +\jlreq@trimmarks@addpapersize{a4,A4}[a4] +\jlreq@trimmarks@addpapersize{a5,A5}[a5] +\jlreq@trimmarks@addpapersize{a6,A6}[a6] +\jlreq@trimmarks@addpapersize{a7,A7}[a7] +\jlreq@trimmarks@addpapersize{a8,A8}[a8] +\jlreq@trimmarks@addpapersize{a9,A9}[a9] +\jlreq@trimmarks@addpapersize{a10,A10}[a10] + +\jlreq@trimmarks@addpapersize{b0,B0}[b0] +\jlreq@trimmarks@addpapersize{b1,B1}[b1] +\jlreq@trimmarks@addpapersize{b2,B2}[b2] +\jlreq@trimmarks@addpapersize{b3,B3}[b3] +\jlreq@trimmarks@addpapersize{b4,B4}[b4] +\jlreq@trimmarks@addpapersize{b5,B5}[b5] +\jlreq@trimmarks@addpapersize{b6,B6}[b6] +\jlreq@trimmarks@addpapersize{b7,B7}[b7] +\jlreq@trimmarks@addpapersize{b8,B8}[b8] +\jlreq@trimmarks@addpapersize{b9,B9}[b9] +\jlreq@trimmarks@addpapersize{b10,B10}[b10] + +\jlreq@trimmarks@addpapersize{c2,C2}[c2] +\jlreq@trimmarks@addpapersize{c3,C3}[c3] +\jlreq@trimmarks@addpapersize{c4,C4}[c4] +\jlreq@trimmarks@addpapersize{c5,C5}[c5] +\jlreq@trimmarks@addpapersize{c6,C6}[c6] +\jlreq@trimmarks@addpapersize{c7,C7}[c7] +\jlreq@trimmarks@addpapersize{c8,C8}[c8] + +\jlreq@trimmarks@addpapersize{a4var}[a4var] +\jlreq@trimmarks@addpapersize{b5var}[b5var] + +\jlreq@trimmarks@addpapersize{letter}[letter] +\jlreq@trimmarks@addpapersize{legal}[legal] +\jlreq@trimmarks@addpapersize{executive}[executive] +\jlreq@trimmarks@addpapersize{hagaki}[hagaki] + +\DeclareOptionX{trimmarks_paper}{ + \edef\jlreq@do{% + \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@trimmarks@switchpapersize}}% + [\unexpanded{% + \jlreq@helper@dividebycomma{#1}% + \ifjlreq@result + \edef\jlreq@trimmarks@paperwidth{\jlreq@resulta} + \edef\jlreq@trimmarks@paperheight{\jlreq@resultb} + \else + \PackageError{jlreq}{The paper #1 is unknown}{\@ehc}% + \fi + }]% + }% + \jlreq@do +} + +\newif\ifjlreq@trimmarks@digital \jlreq@trimmarks@digitaltrue +\newif\ifjlreq@trimmarks@show \jlreq@trimmarks@showtrue +\newif\ifjlreq@trimmarks@show@artbox \jlreq@trimmarks@show@artboxfalse +\tombowdatetrue +\DeclareOptionX{show}{% + \jlreq@ifempty{#1}{ + \jlreq@trimmarks@showtrue\tombowdatetrue\jlreq@trimmarks@digitaltrue + }{ + \jlreq@trimmarks@showfalse\tombowdatefalse\jlreq@trimmarks@digitalfalse + \@for\jlreq@trimmarks@tempa:=#1\do{% + \jlreq@switch{\jlreq@trimmarks@tempa}{ + {trimmarks}{\jlreq@trimmarks@showtrue} + {banner}{\tombowdatetrue} + {digital}{\jlreq@trimmarks@digitaltrue} + {digital*}{\jlreq@trimmarks@digitaltrue\jlreq@trimmarks@show@artboxtrue} + {no}{\tombowdatefalse\jlreq@trimmarks@showfalse\jlreq@trimmarks@digitafalse} + }[\PackageError{jlreq-trimmarks}{Unknown value `##1' in the option `show'}{\@ehc}] + } + } +} + +\let\jlreq@temporary@original@@removeelement=\@removeelement +\let\@removeelement=\jlreq@helper@removeelement +\ProcessOptionsX*\relax +\let\@removeelement=\jlreq@temporary@original@@removeelement +\let\jlreq@temporary@original@@removeelement=\@undefined + +\ifx o\jlreq@trimmarks@driver + \ifjlreq@trimmarks@digital + \ClassError{jlreq}{`show=digital' can't be used with the driver `dviout'}{\@ehc} + \fi +\fi + +\newcommand{\jlreqtrimmarkssetup}[1]{% + \jlreq@parsekeyval{% + {banner}{\@bannertoken{##1}\maketombowbox} + {bleed_margin}{\def\jlreq@trimmarks@bleed{##1}\maketombowbox} + {trimmarks_width}{\setlength{\@tombowwidth}{##1}\maketombowbox} + {color}{ + \jlreq@ifempty{##1}{ + \def\jlreq@trimmarks@color{\normalcolor} + }{ + \@ifundefined{color}{ + \PackageError{jlreq-trimmarks}{`\string\color' is not defined, please load the package `color' or its variant before this package}{\@ehc} + } + \jlreq@switch{##1}{ + {c}{\def\jlreq@trimmarks@color{\color[cmyk]{1,0,0,0}}} + {m}{\def\jlreq@trimmarks@color{\color[cmyk]{0,1,0,0}}} + {y}{\def\jlreq@trimmarks@color{\color[cmyk]{0,0,1,0}}} + {k}{\def\jlreq@trimmarks@color{\color[cmyk]{0,0,0,1}}} + {cm}{\def\jlreq@trimmarks@color{\color[cmyk]{1,1,0,0}}} + {cy}{\def\jlreq@trimmarks@color{\color[cmyk]{1,0,1,0}}} + {ck}{\def\jlreq@trimmarks@color{\color[cmyk]{1,0,0,1}}} + {my}{\def\jlreq@trimmarks@color{\color[cmyk]{0,1,1,0}}} + {mk}{\def\jlreq@trimmarks@color{\color[cmyk]{0,1,0,1}}} + {yk}{\def\jlreq@trimmarks@color{\color[cmyk]{0,0,1,1}}} + {cmy}{\def\jlreq@trimmarks@color{\color[cmyk]{1,1,1,0}}} + {cmk}{\def\jlreq@trimmarks@color{\color[cmyk]{1,1,0,1}}} + {cyk}{\def\jlreq@trimmarks@color{\color[cmyk]{1,0,1,1}}} + {myk}{\def\jlreq@trimmarks@color{\color[cmyk]{0,1,1,1}}} + {cmyk}{\def\jlreq@trimmarks@color{\color[cmyk]{1,1,1,1}}} + { + \jlreq@iffirsttoken{##1}{[}{ + \def\@tempa[####1]####2\jlreq@endmark{\def\jlreq@trimmarks@color{\color[####1]{####2}}} + }{ + \def\@tempa####1\jlreq@endmark{\def\jlreq@trimmarks@color{\color{####1}}} + } + \@tempa##1\jlreq@endmark + } + } + } + \maketombowbox + } + }{#1} +} +\@onlypreamble\jlreqtrimmarkssetup +\jlreqtrimmarkssetup{ + banner={% + \jobname\space(\number\year-\two@digits\month-\two@digits\day + \space\two@digits\hour:\two@digits\minute)% + }, + bleed_margin=3mm, + color={} +} + +\ifx\jlreq@trimmarks@engine\@undefined + \jlreq@helper@guessengine + \let\jlreq@trimmarks@engine=\jlreq@result +\fi + +\ifx\jlreq@trimmarks@driver\@undefined + \ifx l\jlreq@trimmarks@engine + \let\jlreq@trimmarks@driver=l + \else + % default: dvipdfmx + \let\jlreq@trimmarks@driver=f + \fi +\fi + +\ifx\jlreq@trimmarks@paperwidth\@undefined + \edef\jlreq@trimmarks@paperwidth{\the\dimexpr\paperwidth + 2in\relax} + \edef\jlreq@trimmarks@paperheight{\the\dimexpr\paperheight + 2in\relax} +\fi + +\ifx l\jlreq@engine + \setlength{\pagewidth}{\dimexpr\jlreq@trimmarks@paperwidth\relax} + \setlength{\pageheight}{\dimexpr\jlreq@trimmarks@paperheight\relax} +\else + \setlength{\pdfpagewidth}{\dimexpr\jlreq@trimmarks@paperwidth\relax} + \setlength{\pdfpageheight}{\dimexpr\jlreq@trimmarks@paperheight\relax} +\fi + +\hoffset=\dimexpr(\jlreq@trimmarks@paperwidth - \paperwidth)/2 - 1in\relax +\voffset=\dimexpr(\jlreq@trimmarks@paperheight - \paperheight)/2 - 1in\relax + +\ifx l\jlreq@trimmarks@driver\else + \edef\@tempa{\noexpand\AtBeginDvi{\noexpand\special{papersize=\the\dimexpr\jlreq@trimmarks@paperwidth\relax,\the\dimexpr\jlreq@trimmarks@paperheight\relax}}} + \@tempa +\fi +\@ifundefined{stockwidth}{\newdimen\stockwidth}{} +\@ifundefined{stockheight}{\newdimen\stockheight}{} +\setlength{\stockwidth}{\dimexpr\jlreq@trimmarks@paperwidth\relax} +\setlength{\stockheight}{\dimexpr\jlreq@trimmarks@paperheight\relax} + +\def\maketombowbox{% + \setbox\@TL\hbox to\z@{\yoko\hss + \vrule width\dimexpr 10mm + \jlreq@trimmarks@bleed\relax 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@{\yoko\hss + \vrule width10mm height\@tombowwidth depth\z@ + \vrule height\dimexpr 10mm + \jlreq@trimmarks@bleed\relax width\@tombowwidth depth\z@}% + \setbox\@TC\hbox{\yoko + \vrule width10mm height\@tombowwidth depth\z@ + \vrule height10mm width\@tombowwidth depth\z@ + \vrule width10mm height\@tombowwidth depth\z@}% + \setbox\@TR\hbox to\z@{\yoko + \vrule height10mm width\@tombowwidth depth\z@ + \vrule width\dimexpr 10mm + \jlreq@trimmarks@bleed\relax height\@tombowwidth depth\z@\hss}% + \setbox\@Tr\hbox to\z@{\yoko + \vrule height\dimexpr 10mm + \jlreq@trimmarks@bleed\relax width\@tombowwidth depth\z@ + \vrule width10mm height\@tombowwidth depth\z@\hss}% + \setbox\@BL\hbox to\z@{\yoko\hss + \vrule width\dimexpr 10mm + \jlreq@trimmarks@bleed\relax depth\@tombowwidth height\z@ + \vrule depth10mm width\@tombowwidth height\z@}% + \setbox\@Bl\hbox to\z@{\yoko\hss + \vrule width10mm depth\@tombowwidth height\z@ + \vrule depth\dimexpr 10mm + \jlreq@trimmarks@bleed\relax width\@tombowwidth height\z@}% + \setbox\@BC\hbox{\yoko + \vrule width10mm depth\@tombowwidth height\z@ + \vrule depth10mm width\@tombowwidth height\z@ + \vrule width10mm depth\@tombowwidth height\z@}% + \setbox\@BR\hbox to\z@{\yoko + \vrule depth10mm width\@tombowwidth height\z@ + \vrule width\dimexpr 10mm + \jlreq@trimmarks@bleed\relax depth\@tombowwidth height\z@\hss}% + \setbox\@Br\hbox to\z@{\yoko + \vrule depth\dimexpr 10mm + \jlreq@trimmarks@bleed\relax width\@tombowwidth height\z@ + \vrule width10mm depth\@tombowwidth height\z@\hss}% + \setbox\@CL\hbox to\z@{\yoko\hss + \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth + \vrule height10mm depth10mm width\@tombowwidth}% + \setbox\@CR\hbox to\z@{\yoko + \vrule height10mm depth10mm width\@tombowwidth + \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss}% +} +\def\@outputtombow{% + % 6mm: from plcore + \@@paperwidth=\dimexpr\@@paperwidth - 6mm + 2\dimexpr\jlreq@trimmarks@bleed\relax\relax + \@@paperheight=\dimexpr\@@paperheight - 6mm + 2\dimexpr\jlreq@trimmarks@bleed\relax\relax + \ifjlreq@trimmarks@show + \vbox to\z@{\kern-\dimexpr 10mm + \jlreq@trimmarks@bleed\relax + \boxmaxdepth\maxdimen + \moveleft\jlreq@trimmarks@bleed\vbox to\@@paperheight{% + \color@begingroup\jlreq@trimmarks@color + \hbox to\@@paperwidth{\hskip\jlreq@trimmarks@bleed\relax + \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip\jlreq@trimmarks@bleed}% + \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{\hskip\jlreq@trimmarks@bleed\relax + \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip\jlreq@trimmarks@bleed}% + \color@endgroup}\vss + }% + \fi +} + +\ifjlreq@trimmarks@digital + \def\jlreq@trimmarks@pttobp#1{\strip@pt\dimexpr0.9963\dimexpr#1\relax\relax} + \edef\jlreq@trimmarks@trimboxsize{% + [% + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperwidth - \paperwidth)/2} + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperheight - \paperheight)/2} + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperwidth + \paperwidth)/2} + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperheight + \paperheight)/2}% + ] + } + \edef\jlreq@trimmarks@bleedboxsize{% + [% + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperwidth - \paperwidth)/2 - \jlreq@trimmarks@bleed} + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperheight - \paperheight)/2 - \jlreq@trimmarks@bleed} + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperwidth + \paperwidth)/2 + \jlreq@trimmarks@bleed} + \jlreq@trimmarks@pttobp{(\jlreq@trimmarks@paperheight + \paperheight)/2 + \jlreq@trimmarks@bleed}% + ] + } + \edef\jlreq@trimmarks@pdfattribute{% + /TrimBox \jlreq@trimmarks@trimboxsize + \ifjlreq@trimmarks@show@artbox /ArtBox \jlreq@trimmarks@trimboxsize\fi + /BleedBox \jlreq@trimmarks@bleedboxsize + } + \jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@pttobp} + \jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@trimboxsize} + \jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@bleedboxsize} + \jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@pdfattribute} + + \ifx l\jlreq@trimmarks@driver + \edef\@tempa{\noexpand\pdfvariable pageattr{\jlreq@trimmarks@pdfattribute}} + \@tempa + \fi + \ifx f\jlreq@trimmarks@driver + \edef\@outputtombow{\noexpand\special{pdf: put @thispage <<\jlreq@trimmarks@pdfattribute>>}\expandonce{\@outputtombow}} + \fi + \ifx s\jlreq@trimmarks@driver + \edef\@tempa{\noexpand\special{ps:SDict begin + [ /TrimBox \jlreq@trimmarks@trimboxsize /PAGE pdfmark + \ifjlreq@trimmarks@show@artbox [ /ArtBox \jlreq@trimmarks@trimboxsize /PAGE pdfmark \fi + [ /BleedBox \jlreq@trimmarks@bleedboxsize /PAGE pdfmark + end}}% + \@tempa + \fi +\fi + +% always true +\tombowtrue +\maketombowbox + +\endinput diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls index d84993e69ce..241fa9d4d01 100644 --- a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls +++ b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls @@ -5,328 +5,24 @@ %% % (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/) \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{jlreq}[2018/04/11 jlreq] +\ProvidesClass{jlreq}[2018/05/19 jlreq] \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen} +\RequirePackage{jlreq-helpers} -%. helper1 -\newcount\jlreq@tempcnta -\newcount\jlreq@tempcntb -\newcount\jlreq@tempcntc -\newdimen\jlreq@tempdima -\newdimen\jlreq@tempdimb -\newdimen\jlreq@tempdimc -\newskip\jlreq@tempskipa -\newskip\jlreq@tempskipb -\newskip\jlreq@tempskipc -\newif\ifjlreq@tempa -\newif\ifjlreq@tempb -\newif\ifjlreq@tempc -\newbox\jlreq@tempboxa -\newbox\jlreq@tempboxb -\newbox\jlreq@tempboxc -% 計算結果を返すための変数 -\newdimen\jlreq@resultdimen -\newskip\jlreq@resultskip -\newbox\jlreq@resultbox -\newif\ifjlreq@result -\newcount\jlreq@resultcnt - -\newcommand*{\jlreq@undefcs}[1]{% - \ifundef{#1}{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}{\undef{#1}}% -} - +\newcommand*{\jlreq@undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}} % クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする \newcommand*{\jlreq@aftercls@addtodeletecs}[1]{% - \appto\jlreq@aftercls@deletecslist{\jlreq@undefcs{#1}}% + \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefcs{#1}{\jlreq@undeferr}}% } -\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeletecs} \newcommand*{\jlreq@aftercls@addtodeleteif}[1]{% - \edef\@tempa{\expandafter\@gobble\string#1}% - \edef\@tempa{\expandafter\@gobbletwo\@tempa}% - \eappto\jlreq@aftercls@deletecslist{% - \unexpanded{\jlreq@undefcs{#1}}% - \noexpand\jlreq@undefcs{\expandonce{\csname\@tempa true\endcsname}}% - \noexpand\jlreq@undefcs{\expandonce{\csname\@tempa false\endcsname}}% - }% + \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefif{#1}{\jlreq@undeferr}}% } +\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeletecs} \jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeleteif} \AtEndOfClass{% \jlreq@aftercls@deletecslist - \jlreq@undefcs{\jlreq@aftercls@deletecslist}% - \undef{\jlreq@undefcs}% -} - -\def\jlreq@uniqtoken{\jlreq@uniqtoken} -\def\jlreq@endmark{\jlreq@endmark} -\long\def\jlreq@deleteuntileendmark#1\jlreq@endmark{} - -\def\jlreq@expandafter@ii{\expandafter\expandafter\expandafter} -\edef\jlreq@expandafter@iii{\expandonce{\jlreq@expandafter@ii}\noexpand\expandafter\expandonce{\jlreq@expandafter@ii}} -\edef\jlreq@expandtwice#1{\expandonce{\jlreq@expandafter@ii}\noexpand\unexpanded\expandonce{\jlreq@expandafter@ii}{#1}} -\edef\jlreq@expand@three#1{\expandonce{\jlreq@expandafter@iii}\noexpand\unexpanded\expandonce{\jlreq@expandafter@iii}{#1}} - -% \jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@の形で使う -% 二回展開すると,#1の先頭(ただし空白は無視される)を取り出す.#1が空の場合は\jlreq@uniqtoken,先頭が{の場合は\bgroupとなる -\def\jlreq@endmark@{\jlreq@endmark@} % \jlreq@getfirsttokenだけのためのendmark -\long\def\jlreq@getfirsttoken#1#{\jlreq@getfirsttoken@#1\bgroup\jlreq@endmark@} -\long\def\jlreq@getfirsttoken@#1#2\jlreq@endmark@#3\jlreq@endmark@{#1} -% 与えられたトークン列が空か(展開はしないでチェック) -\long\def\jlreq@ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi} -% #1の先頭トークンが#2か(ただし#1が空ならば#2=\jlreq@uniqtoken,#1={ならば#2=\bgroupでTRUEとなる) -\long\edef\jlreq@iffirsttoken#1#2{% - % スペースチェック - \unexpanded{\expandafter\expandafter\expandafter\jlreq@deleteuntileendmark\expandafter\ifx\expandafter}\expandonce{\space}\noexpand\detokenize{#1}\unexpanded{\@undefined\jlreq@endmark\expandafter\@firstoftwo\else\jlreq@endmark\expandafter\@secondoftwo\fi}{% - \noexpand\ifx\expandonce{\space}#2\unexpanded{\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}% - }{% - \noexpand\jlreq@iffirsttoken@ignorespaces{#1}{#2}% - }% -} -% こちらは先頭のスペースを読み飛ばす -\long\def\jlreq@iffirsttoken@ignorespaces#1#2{% - \expandafter\expandafter\expandafter\ifx\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi -} - -% #1が\jlreq@endmarkか -\long\def\jlreq@ifendmark#1{\jlreq@iffirsttoken{#1}{\jlreq@endmark}} - -% #1の先頭が引数なしのマクロか -\long\def\jlreq@ifmacro@noargument#1{% - \jlreq@ifempty{#1}{\@secondoftwo}{% - \jlreq@iffirsttoken{#1}{ }{\@secondoftwo}{% - \expandafter\expandafter\expandafter\jlreq@ifmacro@noargument@\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@ -}}} -\long\def\jlreq@ifmacro@noargument@#1{\expandafter\jlreq@ifmacro@noargument@@\expandafter{\meaning #1}} -\edef\jlreq@do{% - \unexpanded{\def\jlreq@ifmacro@noargument@@}##1{\noexpand\jlreq@ifmacro@noargument@@@##1\expandonce{\detokenize{macro:->}}\noexpand\jlreq@endmark} - \unexpanded{\def\jlreq@ifmacro@noargument@@@}##1\expandonce{\detokenize{macro:->}}##2\noexpand\jlreq@endmark{\noexpand\jlreq@ifempty{##1}} -} -\jlreq@do - -% #1(skipレジスタ)が0か(展開不可). -\def\jlreq@ifgluezero#1{% - \begingroup - \edef\@tempa{\the#1}% - \edef\@tempb{\detokenize{0.0pt}}% - \edef\jlreq@do{\ifx\@tempa\@tempb\noexpand\@firstoftwo\else\noexpand\@secondoftwo\fi}% - \expandafter\endgroup - \jlreq@do -} - -% #1が#2で終わるか(展開不可) -\def\jlreq@ifendswith#1#2{% - \jlreq@ifempty{#2}{\@firstoftwo}{% - \begingroup - \def\jlreq@tempa##1#2\jlreq@uniqtoken##2\jlreq@endmark{% - \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}% - }% - \jlreq@tempa#1\jlreq@uniqtoken#2\jlreq@uniqtoken\jlreq@endmark - \expandafter\endgroup - \jlreq@do - }% -} -% #1が#2で始まるか(展開不可) -\def\jlreq@ifstartswith#1#2{% - \jlreq@ifempty{#2}{\@firstoftwo}{% - \jlreq@ifempty{#1}{\@secondoftwo}{% - \begingroup - \def\jlreq@tempa##1#2##2\jlreq@endmark{% - \edef\jlreq@do{\jlreq@ifempty{##1}{\noexpand\@firstoftwo}{\noexpand\@secondoftwo}}% - }% - \jlreq@tempa#1#2\jlreq@endmark - \expandafter\endgroup - \jlreq@do - }% - }% -} -% #1が#2を含むか(展開不可){}内に#2があってもFALSE判定. -\def\jlreq@ifcontains#1#2{% - \jlreq@ifempty{#2}{\@firstoftwo}{% - \begingroup - \def\jlreq@tempa##1#2##2\jlreq@endmark{% - \edef\jlreq@do{\jlreq@ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}% - }% - \jlreq@tempa#1#2\jlreq@endmark - \expandafter\endgroup - \jlreq@do - }% -} - -% @removeelementの括弧があっても動くかもしれない版 -% #2から#1を消して#3に入れる -\def\jlreq@helper@removeelement#1#2#3{% - \begingroup - \edef\jlreq@tempa{\unexpanded{#1}}% 消したいやつ - \def\jlreq@tempb{}% 消していない分を放り込んでいく - \jlreq@tempatrue% 最初の\jlreq@tempbへの追加か. - \jlreq@helper@removeelement@#2,\jlreq@endmark,% - \edef\jlreq@do{\unexpanded{\def#3}{\expandonce{\jlreq@tempb}}}% - \expandafter\endgroup - \jlreq@do -} -\def\jlreq@helper@removeelement@#1,{% - \jlreq@ifendmark{#1}{}{% - \edef\@tempa{\unexpanded{#1}}% - \ifx\jlreq@tempa\@tempa\expandafter\@gobble\else\expandafter\@firstofone\fi{% - \eappto\jlreq@tempb{\ifjlreq@tempa\else,\fi\unexpanded{#1}}% - \jlreq@tempafalse - }% - \jlreq@helper@removeelement@ - }% -} - -% 空白を無視しない\@ifnextchar -\long\def\jlreq@ifnextchar#1#2#3{% - \let\reserved@d=#1% - \edef\reserved@a{\unexpanded{#2}}% - \edef\reserved@b{\unexpanded{#3}}% - \futurelet\jlreq@nextchar\jlreq@ifnextchar@ -} -\def\jlreq@ifnextchar@{% - \ifx\jlreq@nextchar\reserved@d\let\reserved@b\reserved@a\fi - \reserved@b -} -% 空白を無視しない\@ifsart -\def\jlreq@ifstar#1#2{\jlreq@ifnextchar *{\edef\reserved@a*{\unexpanded{#1}}\reserved@a}{#2}} -% カンマで区切って,その前と後ろを\jlreq@resulta,\jlreq@resultbに入れる -% もしカンマがない場合は\ifjlreq@resultがfalseになる. -\def\jlreq@helper@dividebycomma#1{\jlreq@helper@dividebycomma@#1,\jlreq@endmark} -\def\jlreq@helper@dividebycomma@#1,#2\jlreq@endmark{% - \def\jlreq@resulta{#1}% - \def\jlreq@resultb{#2}% - \ifx\jlreq@resultb\@empty\jlreq@resultfalse\else\jlreq@resulttrue\expandafter\def\expandafter\jlreq@resultb\expandafter{\jlreq@helper@removelastcomma#2\jlreq@endmark}\fi -} -\def\jlreq@helper@removelastcomma#1,\jlreq@endmark{#1} - -% vbox #1の最後を\jlreq@resultboxに入れる -% #1の最後の行は消える -\newcommand*{\jlreq@getlastbox}[1]{% - \setbox#1=\vbox{\unvbox#1\relax - \unskip\unskip\unpenalty\global\setbox\jlreq@resultbox=\lastbox}% - \ifhbox\jlreq@resultbox - \global\setbox\jlreq@resultbox=\hbox{% - \unhbox\jlreq@resultbox\unskip\unskip\unpenalty}% - \else - \global\setbox\jlreq@resultbox=\copy\voidb@x - \fi -} - -% 簡易なkeyvalのパース. -% \jlreq@parsekeyval*[family=jlreq@key]{ % *ありは\setkeys*を使う -% {key}{\def\val{#1}} -% *{key}{\def\val{#1}} % デフォルト値を空文字列にする -% {key}[choice1,choice2]{\def\valchoice{#1}} -%}{parse対象} -\def\jlreq@parsekeyval{% - \@ifstar{\jlreq@helper@parsekeyval@{*}}{\jlreq@helper@parsekeyval@{}}% -} -\def\jlreq@helper@parsekeyval@#1{% - \@ifnextchar[{\jlreq@helper@parsekeyval@@{#1}}{\jlreq@helper@parsekeyval@@{#1}[jlreq@key]}% -} -\long\def\jlreq@helper@parsekeyval@@#1[#2]#3#4{% - \begingroup - \def\jlreq@do{}% - \jlreq@helper@parsekeyval@@@{#2}#3{\jlreq@endmark}% - \setkeys#1{#2}{#4}% - \expandafter\endgroup - \jlreq@do -} -\def\jlreq@helper@parsekeyval@@@#1#2#{% - \jlreq@iffirsttoken@ignorespaces{#2}{*}{% - \jlreq@helper@parsekeyval@@@definekeywithdefault{#1}% - }{% - \jlreq@helper@parsekeyval@@@@{#1}% - }% -} -\long\def\jlreq@helper@parsekeyval@@@@#1#2{% - \jlreq@ifendmark{#2}{}{% - \@ifnextchar[{\jlreq@helper@parsekeyval@@@choicekey{#1}{#2}}{\jlreq@helper@parsekeyval@@@definekey{#1}{#2}}% - }% -} -\long\def\jlreq@helper@parsekeyval@@@choicekey#1#2[#3]#4{% - \define@choicekey{#1}{#2}{#3}{\eappto\jlreq@do{\unexpanded{#4}}}% - \jlreq@helper@parsekeyval@@@{#1}% -} -\long\def\jlreq@helper@parsekeyval@@@definekeywithdefault#1#2#3{% - \define@key{#1}{#2}[]{\eappto\jlreq@do{\unexpanded{#3}}}% - \jlreq@helper@parsekeyval@@@{#1}% -} -\long\def\jlreq@helper@parsekeyval@@@definekey#1#2#3{% - \define@key{#1}{#2}{\eappto\jlreq@do{\unexpanded{#3}}}% - \jlreq@helper@parsekeyval@@@{#1}% -} - -% キー指定しないkeyval(独自実装) -% \jlreq@parsekeyval@nokey{<action>}{<parse対象>} -% action内では#1=key, #2=val -\long\def\jlreq@parsekeyval@nokey#1#2{% - \begingroup - \def\jlreq@do{}% - \def\jlreq@parsekeyval@nokey@execute##1##2{#1}% - \expandafter\jlreq@parsekeyval@nokey@#2,\jlreq@endmark,% - \expandafter\endgroup - \jlreq@do -} -\long\def\jlreq@parsekeyval@nokey@#1,{% - \jlreq@ifendmark{#1}{}{\jlreq@parsekeyval@nokey@@#1=\jlreq@endmark}% -} -\long\def\jlreq@parsekeyval@nokey@@#1=#2\jlreq@endmark{% - \jlreq@ifempty{#2}{\jlreq@parsekeyval@nokey@@@{}{#1}}{\expandafter\jlreq@parsekeyval@nokey@@@\expandafter{\jlreq@parsekeyval@nokey@@@@#2\jlreq@endmark}{#1}}% -} -\long\def\jlreq@parsekeyval@nokey@@@#1#2{% - \eappto\jlreq@do{\expandonce{\jlreq@parsekeyval@nokey@execute{#2}{#1}}}% - \jlreq@parsekeyval@nokey@ -} -\long\def\jlreq@parsekeyval@nokey@@@@#1=\jlreq@endmark{#1} - -% \jlreq@switch{str}{ -% {str}{abcd} -% {str1}{xyz} -%}[default: input = #1] -> abcd -%または -% -% \jlreq@switch{str}{ -% {str}{abcd} -% {str1}{xyz} -% {default} % ここは#1を受け付けない(パラメータトークンを受け付けたい場合のため). -%} -> abcd -% 文字列比較→\edefして比較する -% 第一引数は\jlreq@tempaに入れておく. -\long\def\jlreq@helper@switch@executeoption#1[#2]{% - \begingroup - \def\jlreq@do##1{#2}% - \expandafter\endgroup - \jlreq@do{#1}% -} -\long\def\jlreq@helper@removeoption[#1]{} -\long\def\jlreq@switch#1#2{% - \begingroup - \let\jlreq@do\@undefined - \edef\jlreq@tempa{#1}% ループ中ずっと保存する - \jlreq@helper@switch@#2\jlreq@endmark - \ifx\jlreq@do\@undefined - \def\jlreq@do{\@ifnextchar[{\jlreq@helper@switch@executeoption{#1}}{}}% - \else - \appto\jlreq@do{\@ifnextchar[{\jlreq@helper@removeoption}{}}% - \fi - \expandafter\endgroup - \jlreq@do -} -\long\def\jlreq@helper@switch@#1{% - \jlreq@ifendmark{#1}{}{\jlreq@helper@switch@@{#1}}% -} - -\long\def\jlreq@helper@switch@@#1#2{% - \jlreq@ifendmark{#2}{% - \edef\jlreq@do{\unexpanded{#1}}% - }{% - \edef\jlreq@tempb{#1}% - \ifx\jlreq@tempa\jlreq@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{% - \edef\jlreq@do{\unexpanded{#2}}% - \jlreq@deleteuntileendmark - }{% - \jlreq@helper@switch@ - }% - }% + \jlreq@helper@undefcs{\jlreq@aftercls@deletecslist}{\jlreq@undeferr}% + \undef{\jlreq@undeferr}% } % preambleにいるかのスイッチ @@ -334,20 +30,6 @@ \jlreq@preambletrue \AtBeginDocument{\jlreq@preamblefalse} -\RequirePackage[savepos]{zref} -\newcount\jlreq@zref@reference@count -\jlreq@zref@reference@count=0 -% 現在のページを得る -\zref@newprop*{jlreq@page}[0]{\number\c@page} -\zref@addprop{main}{jlreq@page} -\newcount\jlreq@currentpage -% \jlreq@setcurrentpageをすると,\jlreq@currentpageにこの場所のページ数が入る -\newcommand*{\jlreq@setcurrentpage}{% - \global\advance\jlreq@zref@reference@count by 1 - \zref@labelbyprops{jlreq@currentpage.\the\jlreq@zref@reference@count}{jlreq@page}% - \global\jlreq@currentpage=\zref@extractdefault{jlreq@currentpage.\the\jlreq@zref@reference@count}{jlreq@page}{\c@page}\relax -} - \def\jlreq@saveoriginalcs#1{% \ifx#1\relax \ClassError{jlreq}{Trying to save \string#1 but it's not defined, may be a bug}{\@ehc}% @@ -363,34 +45,6 @@ {#1}% } -% 先頭にあるマクロを展開しまくった結果の先頭を#2に入れる. -\long\def\jlreq@getfirsttoken@expandmacros#1#2{% - \jlreq@iffirsttoken{#1}{ }{\def#2{ }}{% - \jlreq@ifempty{#1}{\def#2{}}{% - \jlreq@ifmacro@noargument{#1}{% - \expandafter\jlreq@getfirsttoken@expandmacros\expandafter{#1}{#2}% - }{% - \expandafter\expandafter\expandafter\jlreq@getfirsttoken@expandmacros@\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@{#2}% - }% - }% - }% -} -\def\jlreq@getfirsttoken@expandmacros@#1#2{\def#2{#1}} - -\def\jlreq@helper@checktokenlist#1#2{% - \jlreq@ifendmark{#2}{\@firstoftwo}% - {% - \ifnum0#1{#2}>0 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi - {\jlreq@helper@checktokenlist{#1}}% - {\expandafter\@secondoftwo\jlreq@deleteuntileendmark}% - }% -} -\def\jlreq@helper@chknumlist#1{\ifx#101\fi\ifx#111\fi\ifx#121\fi\ifx#131\fi\ifx#141\fi\ifx#151\fi\ifx#161\fi\ifx#171\fi\ifx#181\fi\ifx#191\fi} -\def\jlreq@helper@chkfloatlist#1{\jlreq@helper@chknumlist{#1}\ifx#1.1\fi} -% #1が[0-9\.]*に当てはまるか. -\def\jlreq@iffloat#1{\jlreq@helper@checktokenlist{\jlreq@helper@chkfloatlist}#1\jlreq@endmark} -\def\jlreq@ifnumber#1{\jlreq@helper@checktokenlist{\jlreq@helper@chknumlist}#1\jlreq@endmark} - %. オプションの定義 % オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する) % ものは\jlreq@option@<key>に格納する. @@ -419,7 +73,15 @@ \def\jlreq@switchpapersize{} \jlreq@aftercls@addtodeletecs{\jlreq@switchpapersize} % \jlreq@addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦} -\newcommand*{\jlreq@addpapersize}[4]{% + +\def\jlreq@addpapersize#1#2{% + \@ifnextchar[{\jlreq@addpapersize@{#1}{#2}}{\jlreq@addpapersize@@{#1}{#2}} +} +\def\jlreq@addpapersize@#1#2[#3]{% + \edef\@tempa{\unexpanded{\jlreq@addpapersize@@{#1}{#2}}\csexpandonce{jlreq@helper@papersizelist@#3}}% + \@tempa +} +\newcommand*{\jlreq@addpapersize@@}[4]{% \@for\@tempa:=#1\do{% \eappto\jlreq@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}% }% @@ -428,6 +90,8 @@ }% } \jlreq@aftercls@addtodeletecs{\jlreq@addpapersize} +\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@} +\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@@} \DeclareOptionX{paper}{ \edef\jlreq@do{% \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@switchpapersize}}% @@ -444,45 +108,45 @@ \jlreq@do } % 紙サイズ一覧.b*はJIS B. -\jlreq@addpapersize{a0,A0}{}{841mm}{1189mm} -\jlreq@addpapersize{a1,A1}{}{594mm}{841mm} -\jlreq@addpapersize{a2,A2}{}{420mm}{594mm} -\jlreq@addpapersize{a3,A3}{a3paper}{297mm}{420mm} -\jlreq@addpapersize{a4,A4}{a4paper}{210mm}{297mm} -\jlreq@addpapersize{a5,A5}{a5paper}{148mm}{210mm} -\jlreq@addpapersize{a6,A6}{a6paper}{105mm}{148mm} -\jlreq@addpapersize{a7,A7}{}{74mm}{105mm} -\jlreq@addpapersize{a8,A8}{}{52mm}{74mm} -\jlreq@addpapersize{a9,A9}{}{37mm}{52mm} -\jlreq@addpapersize{a10,A10}{}{26mm}{37mm} - -\jlreq@addpapersize{b0,B0}{}{1030mm}{1456mm} -\jlreq@addpapersize{b1,B1}{}{728mm}{1030mm} -\jlreq@addpapersize{b2,B2}{}{515mm}{728mm} -\jlreq@addpapersize{b3,B3}{}{364mm}{515mm} -\jlreq@addpapersize{b4,B4}{b4paper}{257mm}{364mm} -\jlreq@addpapersize{b5,B5}{b5paper}{182mm}{257mm} -\jlreq@addpapersize{b6,B6}{b6paper}{128mm}{182mm} -\jlreq@addpapersize{b7,B7}{}{91mm}{128mm} -\jlreq@addpapersize{b8,B8}{}{64mm}{91mm} -\jlreq@addpapersize{b9,B9}{}{45mm}{64mm} -\jlreq@addpapersize{b10,B10}{}{32mm}{45mm} - -\jlreq@addpapersize{c2,C2}{}{458mm}{648mm} -\jlreq@addpapersize{c3,C3}{}{324mm}{458mm} -\jlreq@addpapersize{c4C,C4}{}{229mm}{354mm} -\jlreq@addpapersize{c5,C5}{}{162mm}{229mm} -\jlreq@addpapersize{c6,C6}{}{114mm}{162mm} -\jlreq@addpapersize{c7,C7}{}{81mm}{114mm} -\jlreq@addpapersize{c8,C8}{}{57mm}{81mm} - -\jlreq@addpapersize{a4var}{}{210mm}{283mm} -\jlreq@addpapersize{b5var}{}{182mm}{230mm} - -\jlreq@addpapersize{letter}{letterpaper}{8.5in}{11in} -\jlreq@addpapersize{legal}{legalpaper}{8.5in}{14in} -\jlreq@addpapersize{executive}{executivepaper}{7.25in}{10.5in} -\jlreq@addpapersize{hagaki}{}{100mm}{148mm} +\jlreq@addpapersize{a0,A0}{}[a0] +\jlreq@addpapersize{a1,A1}{}[a1] +\jlreq@addpapersize{a2,A2}{}[a2] +\jlreq@addpapersize{a3,A3}{a3paper}[a3] +\jlreq@addpapersize{a4,A4}{a4paper}[a4] +\jlreq@addpapersize{a5,A5}{a5paper}[a5] +\jlreq@addpapersize{a6,A6}{a6paper}[a6] +\jlreq@addpapersize{a7,A7}{}[a7] +\jlreq@addpapersize{a8,A8}{}[a8] +\jlreq@addpapersize{a9,A9}{}[a9] +\jlreq@addpapersize{a10,A10}{}[a10] + +\jlreq@addpapersize{b0,B0}{}[b0] +\jlreq@addpapersize{b1,B1}{}[b1] +\jlreq@addpapersize{b2,B2}{}[b2] +\jlreq@addpapersize{b3,B3}{}[b3] +\jlreq@addpapersize{b4,B4}{b4paper}[b4] +\jlreq@addpapersize{b5,B5}{b5paper}[b5] +\jlreq@addpapersize{b6,B6}{b6paper}[b6] +\jlreq@addpapersize{b7,B7}{}[b7] +\jlreq@addpapersize{b8,B8}{}[b8] +\jlreq@addpapersize{b9,B9}{}[b9] +\jlreq@addpapersize{b10,B10}{}[b10] + +\jlreq@addpapersize{c2,C2}{}[c2] +\jlreq@addpapersize{c3,C3}{}[c3] +\jlreq@addpapersize{c4,C4}{}[c4] +\jlreq@addpapersize{c5,C5}{}[c5] +\jlreq@addpapersize{c6,C6}{}[c6] +\jlreq@addpapersize{c7,C7}{}[c7] +\jlreq@addpapersize{c8,C8}{}[c8] + +\jlreq@addpapersize{a4var}{}[a4var] +\jlreq@addpapersize{b5var}{}[b5var] + +\jlreq@addpapersize{letter}{letterpaper}[letter] +\jlreq@addpapersize{legal}{legalpaper}[legal] +\jlreq@addpapersize{executive}{executivepaper}[executive] +\jlreq@addpapersize{hagaki}{}[hagaki] %.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a) @@ -521,6 +185,10 @@ \newcommand*{\jlreq@option@gutter}{} \jlreq@aftercls@addtodeletecs{\jlreq@option@gutter} \DeclareOptionX{gutter}{\renewcommand*{\jlreq@option@gutter}{#1}} +%.. 小口 +\newcommand*{\jlreq@option@fore@edge}{} +\jlreq@aftercls@addtodeletecs{\jlreq@option@fore@edge} +\DeclareOptionX{fore_edge}{\renewcommand*{\jlreq@option@fore@edge}{#1}} %.. 柱とノンブル \newcommand*{\jlreq@option@headfoot@verticalpos}{} @@ -564,14 +232,9 @@ \newif\if@landscape\@landscapefalse \newif\if@tate \@tatefalse \jlreq@DeclareOption{landscape}{\@landscapetrue} -\jlreq@DeclareOption{tombo}{% - \tombowtrue\tombowdatefalse - \setlength{\@tombowwidth}{.1\p@}% - \maketombowbox} -\jlreq@DeclareOption{mentuke}{% - \tombowtrue\tombowdatefalse - \setlength{\@tombowwidth}{\z@}% - \maketombowbox} +\jlreq@DeclareOption{tombo}{\ClassWarningNoLine{jlreq}{The option `tombo' is not supported by jlreq class. Please use the jlreq-trimmarks package}} +\jlreq@DeclareOption{tombow}{\ClassWarningNoLine{jlreq}{The option `tombow' is not supported by jlreq class. Please use the jlreq-trimmarks package}} +\jlreq@DeclareOption{mentuke}{\ClassWarningNoLine{jlreq}{The option `mentuke' is not supported by jlreq class. Please use the jlreq-trimmarks package}} \jlreq@DeclareOption{tate}{\@tatetrue} \newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された @@ -648,26 +311,10 @@ \jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@addtofinally} \@onlypreamble\jlreqsetup -% \jlreq@ifprimitive#1#2#3: #1がprimitiveならば#2を,そうでなければ#3を実行する -% (\if(pdf)primitiveを避けるようにしている.) -\def\jlreq@ifprimitive#1{% - \begingroup - \edef\@tempa{\string#1}% - \edef\@tempb{\meaning#1}% - \expandafter\endgroup - \ifx\@tempa\@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi -} % エンジンの設定 \ifx\jlreq@engine\@undefined - \jlreq@ifprimitive\directlua{ - \let\jlreq@engine=l - }{ - \jlreq@ifprimitive\ucs{ - \let\jlreq@engine=u - }{ - \let\jlreq@engine=p - } - } + \jlreq@helper@guessengine + \let\jlreq@engine=\jlreq@result \fi @@ -757,6 +404,7 @@ \else \evensidemargin \fi + \iftombow - 1in\fi - 1in - \hoffset\relax } \else @@ -778,6 +426,7 @@ - \topmargin - \headheight - \headsep - \voffset - \zposy{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp }% + \iftombow - 1in\fi - \@totalleftmargin - 1in \relax } @@ -880,39 +529,12 @@ \jlreq@do } -% #1÷#2を\jlreq@resultdimenに入れる.(#1,#2は寸法を与える.) \ifx l\jlreq@engine \newcommand*{\jlreq@divide}[2]{% \jlreq@resultdimen=\directlua{tex.print(tostring(\strip@pt\dimexpr #1\relax/\strip@pt\dimexpr #2\relax) .. "pt ")}% } \else - \newcommand*{\jlreq@divide}[2]{% - \begingroup - \@tempdima=\dimexpr#1\relax\@tempdimb=\dimexpr#2\relax - % 分母を正にする - \ifdim\@tempdimb<0pt \@tempdima=-\@tempdima\@tempdimb=-\@tempdimb\fi - % \jlreq@tempdima*\@tempdimb <= \@tempdima < (\jlreq@tempdima + 1)*\@tempdimb - % となる整数\jlreq@tempdimaを捜し,\jlreq@tempdimb=\jlreq@tempdima + 1とする - \jlreq@tempdima=0pt - \ifdim\@tempdima<0pt - \loop\ifdim\strip@pt\jlreq@tempdima\@tempdimb>\@tempdima\advance\jlreq@tempdima by -1pt\repeat - \else - \loop\ifdim\strip@pt\jlreq@tempdima\@tempdimb<\@tempdima\advance\jlreq@tempdima by 1pt\repeat - \ifdim\strip@pt\jlreq@tempdima\@tempdimb=\@tempdima\else\advance\jlreq@tempdima by -1pt\fi - \fi - \jlreq@tempdimb=\dimexpr\jlreq@tempdima + 1pt\relax - % \jlreq@tempdimaと\jlreq@tempdimbで挟んでいく二分法 - \jlreq@tempcnta=0 % 無限ループを避けるためのカウンタ - \loop\ifnum\numexpr\ifdim\dimexpr\jlreq@tempdimb - \jlreq@tempdima\relax>1sp 1\else0\fi*\ifnum\jlreq@tempcnta<100 1\else 0\fi\relax=1 - \jlreq@tempdimc=\dimexpr(\jlreq@tempdima+\jlreq@tempdimb)/2\relax - \ifdim\strip@pt\jlreq@tempdimc\@tempdimb>\@tempdima\jlreq@tempdimb=\jlreq@tempdimc - \else\jlreq@tempdima=\jlreq@tempdimc\fi - \advance\jlreq@tempcnta by 1 - \repeat - \edef\jlreq@do{\noexpand\jlreq@resultdimen=\the\jlreq@tempdima\noexpand\relax}% - \expandafter\endgroup - \jlreq@do - } + \let\jlreq@divide=\jlreq@helper@divide \fi %. 基本設定 @@ -1251,7 +873,7 @@ % 行頭の括弧は \jlreq@open@bracket@before@space \inhibitglue 「みたいにする. \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{ - \def\jlreq@open@bracket@before@space{\hskip -.5\zw} + \def\jlreq@open@bracket@before@space{\hskip\glueexpr-.5\zw\relax} }{ \def\jlreq@open@bracket@before@space{} } @@ -1610,16 +1232,47 @@ % (TODO: 頭注) \if@tate\@mparswitchfalse\fi +\setlength{\topskip}{1\zw} % フォントサイズと一致させる +\ifx\jlreq@option@headfoot@verticalpos\@empty + \if@tate\def\jlreq@option@headfoot@verticalpos{1zw} + \else\def\jlreq@option@headfoot@verticalpos{2zw}\fi +\fi +\setlength{\headsep}{\jlreq@speciallength{\jlreq@option@headfoot@verticalpos}} +\ifdim\headsep<1\zw\relax\jlreq@note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi +\setlength{\headheight}{1\zw} + % \textwidthと\textheightのデフォルト値は縦横ともに0.75倍(調整が入る). %.. \textwidth:文字送り方向の行長 % 二段の場合は最初の段の頭から次の段の後まで % 一度\textwidthに一行の長さの文字数を入れる(段組の場合でも) +\newif\ifjlreq@determine@kihonhanmen@warning@first +\jlreq@determine@kihonhanmen@warning@firsttrue +\def\jlreq@determine@kihonhanmen@warning{ + \ifjlreq@determine@kihonhanmen@warning@first + \jlreq@note{基本版面は,a. サイズの決定 b. 仕上りサイズに対する基本版面の配置位置の決定 という手順で行う (2.4.1).} + \jlreq@determine@kihonhanmen@warning@firstfalse + \fi +} +\jlreq@aftercls@addtodeletecs{\jlreq@determine@kihonhanmen@warning} +\jlreq@aftercls@addtodeleteif{\ifjlreq@determine@kihonhanmen@warning@first} \@tempdima=1\zw \ifx\jlreq@option@line@length\@empty \if@tate - \setlength{\textwidth}{0.75\paperheight} + \ifnum 0\ifx\jlreq@option@head@space\@empty 1\fi\ifx\jlreq@option@foot@space\@empty 1\fi>0 + \setlength{\textwidth}{0.75\paperheight} + \divide\textwidth\@tempdima\multiply\textwidth\@tempdima + \else + \jlreq@determine@kihonhanmen@warning + \setlength{\textwidth}{\dimexpr\paperheight - \jlreq@option@head@space - \jlreq@option@foot@space \relax} + \fi \else - \setlength{\textwidth}{0.75\paperwidth} + \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0 + \setlength{\textwidth}{0.75\paperwidth} + \divide\textwidth\@tempdima\multiply\textwidth\@tempdima + \else + \jlreq@determine@kihonhanmen@warning + \setlength{\textwidth}{\dimexpr\paperwidth - \jlreq@option@gutter - \jlreq@option@fore@edge\relax} + \fi \fi \if@twocolumn \addtolength{\textwidth}{\dimexpr-2\marginparwidth - 2\marginparsep\relax} @@ -1627,7 +1280,6 @@ \else \addtolength{\textwidth}{\dimexpr-\marginparwidth - \marginparsep\relax} \fi - \divide\textwidth\@tempdima \else \setlength{\textwidth}{\jlreq@speciallength{\jlreq@option@line@length}} \divide\textwidth\@tempdima @@ -1640,66 +1292,95 @@ \jlreq@note{一行の長さは40文字以下が望ましい (2.4.2.c 注2).} \fi \fi + \multiply\textwidth\@tempdima \fi -\multiply\textwidth\@tempdima \if@twocolumn \setlength{\textwidth}{\dimexpr2\textwidth + \columnsep\relax} \fi -\setlength{\topskip}{1\zw} % フォントサイズと一致させる %.. \textheight:行送り方向の長さ % 一番上(直後に\topskip由来が入る)から最終行のベースラインまでの長さ. % \topskipが十分ある時は先頭行のベースラインから最終行のベースライン+\topskip +\def\jlreq@adjusttextheight{ + \addtolength{\textheight}{-\topskip} + \divide\textheight\baselineskip \multiply\textheight\baselineskip + \addtolength{\textheight}{\topskip} +} +\jlreq@aftercls@addtodeletecs{\jlreq@adjusttextheight} \ifx\jlreq@option@number@of@lines\@empty \if@tate - \setlength{\textheight}{0.75\paperwidth} + \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0 + \setlength{\textheight}{0.75\paperwidth} + \jlreq@adjusttextheight + \else + \jlreq@determine@kihonhanmen@warning + \setlength{\textheight}{\dimexpr\paperwidth - \jlreq@option@gutter - \jlreq@option@fore@edge + \topskip - 1\zw\relax} + \fi \else - \setlength{\textheight}{0.75\paperheight} + \ifnum 0\ifx\jlreq@option@head@space\@empty 1\fi\ifx\jlreq@option@foot@space\@empty 1\fi>0 + \setlength{\textheight}{0.75\paperheight} + \jlreq@adjusttextheight + \else + \jlreq@determine@kihonhanmen@warning + \setlength{\textheight}{\dimexpr\paperheight + 2\topskip - 1\zh - \Cht - \jlreq@option@head@space - \jlreq@option@foot@space\relax} + \fi \fi - \addtolength{\textheight}{-\topskip} - \divide\textheight\baselineskip \multiply\textheight\baselineskip - \addtolength{\textheight}{\topskip} \else \setlength{\textheight}{\dimexpr\numexpr\jlreq@option@number@of@lines\relax\baselineskip - \baselineskip + \topskip\relax} \fi -\ifx\jlreq@option@headfoot@verticalpos\@empty - \if@tate\def\jlreq@option@headfoot@verticalpos{1zw} - \else\def\jlreq@option@headfoot@verticalpos{2zw}\fi -\fi -\setlength{\headsep}{\jlreq@speciallength{\jlreq@option@headfoot@verticalpos}} -\ifdim\headsep<1\zw\relax\jlreq@note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi -\setlength{\headheight}{1\zw} %.. 横 -\ifx\jlreq@option@gutter\@empty - % 中央配置 +\def\jlreq@setsidemargin@by@gutter#1{ \if@tate - \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax} + \setlength{\evensidemargin}{#1} + \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax} + \addtolength{\evensidemargin}{\Cdp} \else + \setlength{\oddsidemargin}{#1} \if@twocolumn - \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax} - \else - \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax} + \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax} \fi + \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax} + \fi +} +\def\jlreq@setsidemargin@by@fore@edge#1{ + \jlreq@setsidemargin@by@gutter{#1} + \@tempdima=\evensidemargin + \evensidemargin=\oddsidemargin + \oddsidemargin=\@tempdima + \ifjlreq@determine@kihonhanmen@warning@first + \jlreq@note{基本版面の配置はのどの空き量を指定する (2.4.1.b).} \fi - \setlength{\oddsidemargin}{.5\oddsidemargin} - \ifnum0\if@twocolumn1\fi\if@tate1\fi>0 - \setlength{\evensidemargin}{\oddsidemargin} +} + +\ifx\jlreq@option@gutter\@empty + \ifx\jlreq@option@fore@edge\@empty + % 中央配置 + \if@tate + \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax} + \else + \if@twocolumn + \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax} + \else + \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax} + \fi + \fi + \setlength{\oddsidemargin}{.5\oddsidemargin} + \ifnum0\if@twocolumn1\fi\if@tate1\fi>0 + \setlength{\evensidemargin}{\oddsidemargin} + \else + \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax} + \fi \else - \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax} + \jlreq@setsidemargin@by@fore@edge{\jlreq@speciallength{\jlreq@option@fore@edge}} \fi \else - \if@tate - \setlength{\evensidemargin}{\jlreq@speciallength{\jlreq@option@gutter}} - \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax} - \addtolength{\evensidemargin}{\Cdp} - \else - \setlength{\oddsidemargin}{\jlreq@speciallength{\jlreq@option@gutter}} - \if@twocolumn - \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax} + \jlreq@setsidemargin@by@gutter{\jlreq@speciallength{\jlreq@option@gutter}} + \ifx\jlreq@option@fore@edge\@empty\else + \ifjlreq@determine@kihonhanmen@warning@first\else + \ClassWarningNoLine{jlreq}{fore_edge is ignored} \fi - \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax} \fi \fi \addtolength{\oddsidemargin}{-1in} @@ -1751,10 +1432,14 @@ % 両方指定されていたら,縦書きは地を,横書きは天を使う \if@tate \jlreq@settopmarginbyfoot{\jlreq@speciallength{\jlreq@option@foot@space}} - \ClassWarningNoLine{jlreq}{head_space is ignored} + \ifx\jlreq@option@line@length\@empty\else + \ClassWarningNoLine{jlreq}{head_space is ignored} + \fi \else \jlreq@settopmarginbyhead{\jlreq@speciallength{\jlreq@option@head@space}} - \ClassWarningNoLine{jlreq}{foot_space is ignored} + \ifx\jlreq@option@number@of@lines\@empty\else + \ClassWarningNoLine{jlreq}{foot_space is ignored} + \fi \fi \fi \fi @@ -1783,17 +1468,21 @@ \fi } -% 同行見出し以外では,jlreq@heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される. +% 扉見出しと別行見出しについては,\<csname> -> \jlreq@headingcs@csname -> 本体と +% 二段構えで展開されるようにする.一度の展開で\parが出るのを防ぐため. +% 一度展開を\longなしマクロに渡されると破綻するので.(そういうパッケージが存在する.) + +% jlreq@heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される. % #1=*または空(見出し命令に*がついていたかで分岐),#2=ラベル,#3=running head % デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる. -% 同行見出しでは\@startsection任せ % 見出しの直前に実行される \newcommand*{\jlreq@hook@beforeheadings}[1]{} % 見出し名一覧を格納する \def\jlreq@heading@allheadings{} -% 目次を出力する命令\l@<命令名>を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット} +% 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット} +% 結果は\jlreq@resultに入る. \def\jlreq@heading@make@l@#1#2#3{% \@ifundefined{l@#1}{% % 長さは適当に計測する @@ -1801,12 +1490,17 @@ % ちょっと大きめで計測しておく \csname c@#1\endcsname=9 \setbox\jlreq@tempboxa=\hbox{#3}% - \jlreq@tempdima=\wd\jlreq@tempboxa\relax% - \jlreq@tempdimb=1\zw - \divide\jlreq@tempdima by \jlreq@tempdimb + \jlreq@tempdima=\wd\jlreq@tempboxa + \csname c@#1\endcsname=26 + \setbox\jlreq@tempboxa=\hbox{#3}% + \ifdim\jlreq@tempdima<\wd\jlreq@tempboxa + \jlreq@tempdima=\wd\jlreq@tempboxa + \fi + % \numexprは四捨五入 + \jlreq@tempdimb=\dimexpr\the\numexpr\jlreq@tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax \edef\jlreq@do{% \unexpanded{\def\jlreq@result}{% - \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\numexpr\jlreq@tempdima + 1\relax\noexpand\zw}}% + \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq@tempdimb}}% }% }% \expandafter\endgroup @@ -1885,11 +1579,12 @@ \expandonce{\jlreq@heading@clearpage}% \unexpanded{\if@restonecol\twocolumn\fi}% }% - \noexpand\def\expandonce{\csname #1\endcsname}{% + \noexpand\def\expandonce{\csname jlreq@headingcs@#1\endcsname}{% % 改丁.これでよいのかな. \unexpanded{\if@twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage}% \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq@pagestyle}}\fi \noexpand\secdef{\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}}}% + \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}% }% \expandafter\endgroup \jlreq@do @@ -2407,7 +2102,7 @@ \fi \edef\jlreq@do{% \expandonce{\jlreq@do}% - \noexpand\edef\expandonce{\csname #1\endcsname}{\noexpand\unexpanded{% + \noexpand\edef\expandonce{\csname jlreq@headingcs@#1\endcsname}{\noexpand\unexpanded{% \noexpand\jlreq@hook@beforeheadings{#1}% \expandonce{\jlreq@pagebreak}% \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}% @@ -2420,6 +2115,7 @@ }% {\expandonce{\jlreq@totalformat}}% }}% + \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}% }% \expandafter\endgroup \jlreq@do @@ -2517,7 +2213,7 @@ \fi \eappto\jlreq@tempb{% \noexpand\@ifundefined{jlreq@BlockHeading@spaces@setlist@\jlreq@headings}{}{% - \noexpand\ClassError{jlrqe}{The spaces for \jlreq@headings\space is multiplly defined (in SetBlockHeadingSpaces)}{\noexpand\@ehc}% + \noexpand\ClassError{jlrqe}{The spaces for \jlreq@headings\space is defined more than once (in SetBlockHeadingSpaces)}{\noexpand\@ehc}% }% \noexpand\def\expandonce{\csname jlreq@BlockHeading@spaces@setlist@\jlreq@headings\endcsname}{{\expandonce{\jlreq@totalset}}\expandonce{\jlreq@set}}% }% @@ -2720,7 +2416,7 @@ \unexpanded{{\setbox\jlreq@tempboxa\lastbox}}% \noexpand\begingroup \expandonce{\jlreq@tempa{#5}}% - \expandonce{\csname jlreq@heading@maketoc@#1\endcsname{#3}{#6}{#4}}% + \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{#3}{#6}{#4}% \noexpand\endgroup }% }% @@ -3308,11 +3004,11 @@ \ifthenelse{\equal{#1}{one}}{ \long\def\jlreq@makefntext##1{\parindent 1\zw \addtolength{\leftskip}{\dimexpr\jlreq@footnoteindent + 1\zw\relax}% 全体をインデント+1文字分下げる - \noindent\hskip -1\zw\jlreq@referencemark@format{\@thefnmark}\hskip 1\zw##1}% 見出し出力と一文字分の空き + \noindent\hskip\glueexpr-1\zw\relax\jlreq@referencemark@format{\@thefnmark}\hskip\glueexpr1\zw\relax##1}% 見出し出力と一文字分の空き }{ \long\def\jlreq@makefntext##1{\parindent 1\zw \addtolength{\leftskip}{\jlreq@footnoteindent}% 全体をインデント - \noindent\hskip 1\zw\jlreq@referencemark@format{\@thefnmark}\hskip 1\zw##1}% 見出し出力と一文字分の空き + \noindent\hskip\glueexpr1\zw\relax\jlreq@referencemark@format{\@thefnmark}\hskip\glueexpr1\zw\relax##1}% 見出し出力と一文字分の空き } } \jlreqsetup{footnotetext_indent=one} @@ -3352,7 +3048,7 @@ }{% \begingroup \csname c@\jlreq@endnotecounter\endcsname #1\relax - \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname \jlreq@endnotecounter\endcsname}% + \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}% \endgroup }% \@endnotemark @@ -3365,7 +3061,7 @@ }{% \begingroup \csname c@\jlreq@endnotecounter\endcsname #1\relax - \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname \jlreq@endnotecounter\endcsname}% + \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}% \endgroup }% \@endnotetext{#2}% @@ -3416,7 +3112,7 @@ \jlreq@endnote@indent=2\jlreq@mol % 二行目以降を全角分下げる(4.2.4.d:TODO: 選択できるべき) \newcommand{\@makeendtext}[1]{\parindent 1\jlreq@mol - \hskip-1\jlreq@mol\csname\jlreq@endnotemarkname\endcsname\hskip 1\jlreq@mol#1}% 見出し出力と一文字分の空き(4.2.4.c) + \hskip\glueexpr-1\jlreq@mol\relax\csname\jlreq@endnotemarkname\endcsname\hskip\glueexpr1\zw\relax#1}% 見出し出力と一文字分の空き(4.2.4.c) \def\@makeendmark{\@makefnmark} % \theendnoteの出力を仕込む @@ -5112,6 +4808,11 @@ \else \jlreqsetup{year_style=seireki} \fi + +% 時刻 +\hour=\time \divide\hour by 60 +\minute=\numexpr\time - 60*\hour\relax + %.. 定理環境 \jlreq@saveoriginalcs{\@begintheorem} \jlreq@saveoriginalcs{\@opargbegintheorem} |