texlive[47771] Master/texmf-dist: jlreq (19may18)

commits+karl at tug.org commits+karl at tug.org
Sun May 20 01:27:52 CEST 2018


Revision: 47771
          http://tug.org/svn/texlive?view=revision&revision=47771
Author:   karl
Date:     2018-05-20 01:27:52 +0200 (Sun, 20 May 2018)
Log Message:
-----------
jlreq (19may18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE
    trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
    trunk/Master/texmf-dist/doc/latex/jlreq/README.md
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
    trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE	2018-05-19 23:27:30 UTC (rev 47770)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/LICENSE	2018-05-19 23:27:52 UTC (rev 47771)
@@ -1,5 +1,5 @@
 (2-clause BSD license)
-jlreq
+jlreq and jlreq-trimmarks
 Copyright 2017-2018, Noriyuki Abe.
 All rights reserved.
 

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2018-05-19 23:27:30 UTC (rev 47770)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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,8 +70,8 @@
 全角空白(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}
@@ -78,7 +78,9 @@
     ```
 
     とするとこの処理が行われます.ただし,最終ページでの`\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 @@
     - `\labelenumi`らをjarticleなどにあわせた.
     - `column_gap`クラスオプションを使うとコンパイルできなかったバグ修正.
     - `mark_format`を`\DeclarePageStyle`に追加.
+* 2018-05-19
+    - 目次内のラベルの長さを今までよりも長くした.
+    - 一部のマクロをjlreq-helpers.styに分離した.
+    - バグ修正.
 
 
 --------------

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2018-05-19 23:27:30 UTC (rev 47770)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2018-05-19 23:27:52 UTC (rev 47771)
@@ -9,7 +9,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` will do this where $TEXMF=$TEXMFHOME
 
@@ -80,8 +80,11 @@
     - 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
 https://github.com/abenori/jlreq

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2018-05-19 23:27:30 UTC (rev 47770)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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>

Added: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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>


Property changes on: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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
+


Property changes on: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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>


Property changes on: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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
+


Property changes on: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2018-05-19 23:27:30 UTC (rev 47770)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2018-05-19 23:27:52 UTC (rev 47771)
@@ -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>

Added: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty	2018-05-19 23:27:52 UTC (rev 47771)
@@ -0,0 +1,454 @@
+% エンジン非依存のマクロ集
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{jlreq-helpers}[2018/04/12 jlreq-helpers]
+\RequirePackage{xkeyval,etoolbox}
+
+%. helper1
+\newcount\jlreq at tempcnta
+\newcount\jlreq at tempcntb
+\newcount\jlreq at tempcntc
+\newdimen\jlreq at tempdima
+\newdimen\jlreq at tempdimb
+\newdimen\jlreq at tempdimc
+\newskip\jlreq at tempskipa
+\newskip\jlreq at tempskipb
+\newskip\jlreq at tempskipc
+\newif\ifjlreq at tempa
+\newif\ifjlreq at tempb
+\newif\ifjlreq at tempc
+\newbox\jlreq at tempboxa
+\newbox\jlreq at tempboxb
+\newbox\jlreq at tempboxc
+% 計算結果を返すための変数
+\newdimen\jlreq at resultdimen
+\newskip\jlreq at resultskip
+\newbox\jlreq at resultbox
+\newif\ifjlreq at result
+\newcount\jlreq at resultcnt
+
+\def\jlreq at uniqtoken{\jlreq at uniqtoken}
+\def\jlreq at endmark{\jlreq at endmark}
+\long\def\jlreq at deleteuntileendmark#1\jlreq at endmark{}
+
+\def\jlreq at expandafter@ii{\expandafter\expandafter\expandafter}
+\edef\jlreq at expandafter@iii{\expandonce{\jlreq at expandafter@ii}\noexpand\expandafter\expandonce{\jlreq at expandafter@ii}}
+\edef\jlreq at expandtwice#1{\expandonce{\jlreq at expandafter@ii}\noexpand\unexpanded\expandonce{\jlreq at expandafter@ii}{#1}}
+\edef\jlreq at expand@three#1{\expandonce{\jlreq at expandafter@iii}\noexpand\unexpanded\expandonce{\jlreq at expandafter@iii}{#1}}
+
+% \jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@の形で使う
+% 二回展開すると,#1の先頭(ただし空白は無視される)を取り出す.#1が空の場合は\jlreq at uniqtoken,先頭が{の場合は\bgroupとなる
+\def\jlreq at endmark@{\jlreq at endmark@} % \jlreq at getfirsttokenだけのためのendmark
+\long\def\jlreq at getfirsttoken#1#{\jlreq at getfirsttoken@#1\bgroup\jlreq at endmark@}
+\long\def\jlreq at getfirsttoken@#1#2\jlreq at endmark@#3\jlreq at endmark@{#1}
+% 与えられたトークン列が空か(展開はしないでチェック)
+\long\def\jlreq at ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+% #1の先頭トークンが#2か(ただし#1が空ならば#2=\jlreq at uniqtoken,#1={ならば#2=\bgroupでTRUEとなる)
+\long\edef\jlreq at iffirsttoken#1#2{%
+  % スペースチェック
+  \unexpanded{\expandafter\expandafter\expandafter\jlreq at deleteuntileendmark\expandafter\ifx\expandafter}\expandonce{\space}\noexpand\detokenize{#1}\unexpanded{\@undefined\jlreq at endmark\expandafter\@firstoftwo\else\jlreq at endmark\expandafter\@secondoftwo\fi}{%
+    \noexpand\ifx\expandonce{\space}#2\unexpanded{\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}%
+  }{%
+    \noexpand\jlreq at iffirsttoken@ignorespaces{#1}{#2}%
+  }%
+}
+% こちらは先頭のスペースを読み飛ばす
+\long\def\jlreq at iffirsttoken@ignorespaces#1#2{%
+  \expandafter\expandafter\expandafter\ifx\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+
+% #1が\jlreq at endmarkか
+\long\def\jlreq at ifendmark#1{\jlreq at iffirsttoken{#1}{\jlreq at endmark}}
+
+% #1の先頭が引数なしのマクロか
+\long\def\jlreq at ifmacro@noargument#1{%
+  \jlreq at ifempty{#1}{\@secondoftwo}{%
+    \jlreq at iffirsttoken{#1}{ }{\@secondoftwo}{%
+      \expandafter\expandafter\expandafter\jlreq at ifmacro@noargument@\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@
+}}}
+\long\def\jlreq at ifmacro@noargument@#1{\expandafter\jlreq at ifmacro@noargument@@\expandafter{\meaning #1}}
+\edef\jlreq at do{%
+  \unexpanded{\def\jlreq at ifmacro@noargument@@}##1{\noexpand\jlreq at ifmacro@noargument@@@##1\expandonce{\detokenize{macro:->}}\noexpand\jlreq at endmark}
+  \unexpanded{\def\jlreq at ifmacro@noargument@@@}##1\expandonce{\detokenize{macro:->}}##2\noexpand\jlreq at endmark{\noexpand\jlreq at ifempty{##1}}
+}
+\jlreq at do
+
+% #1(skipレジスタ)が0か(展開不可).
+\newcommand*\jlreq at ifgluezero[1]{%
+  \begingroup
+    \edef\@tempa{\the#1}%
+    \edef\@tempb{\detokenize{0.0pt}}%
+    \edef\jlreq at do{\ifx\@tempa\@tempb\noexpand\@firstoftwo\else\noexpand\@secondoftwo\fi}%
+  \expandafter\endgroup
+  \jlreq at do
+}
+
+% #1が#2で終わるか(展開不可)
+\newcommand*{\jlreq at ifendswith}[2]{%
+  \jlreq at ifempty{#2}{\@firstoftwo}{%
+    \begingroup
+      \def\jlreq at tempa##1#2\jlreq at uniqtoken##2\jlreq at endmark{%
+        \edef\jlreq at do{\jlreq at ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
+      }%
+      \jlreq at tempa#1\jlreq at uniqtoken#2\jlreq at uniqtoken\jlreq at endmark
+    \expandafter\endgroup
+    \jlreq at do
+  }%
+}
+% #1が#2で始まるか(展開不可)
+\newcommand*{\jlreq at ifstartswith}[2]{%
+  \jlreq at ifempty{#2}{\@firstoftwo}{%
+    \jlreq at ifempty{#1}{\@secondoftwo}{%
+      \begingroup
+        \def\jlreq at tempa##1#2##2\jlreq at endmark{%
+          \edef\jlreq at do{\jlreq at ifempty{##1}{\noexpand\@firstoftwo}{\noexpand\@secondoftwo}}%
+        }%
+        \jlreq at tempa#1#2\jlreq at endmark
+      \expandafter\endgroup
+      \jlreq at do
+    }%
+  }%
+}
+% #1が#2を含むか(展開不可){}内に#2があってもFALSE判定.
+\newcommand*{\jlreq at ifcontains}[2]{%
+  \jlreq at ifempty{#2}{\@firstoftwo}{%
+    \begingroup
+      \def\jlreq at tempa##1#2##2\jlreq at endmark{%
+        \edef\jlreq at do{\jlreq at ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
+      }%
+      \jlreq at tempa#1#2\jlreq at endmark
+    \expandafter\endgroup
+    \jlreq at do
+  }%
+}
+
+% @removeelementの括弧があっても動くかもしれない版
+% #2から#1を消して#3に入れる
+\newcommand*{\jlreq at helper@removeelement}[3]{%
+  \begingroup
+    \edef\jlreq at tempa{\unexpanded{#1}}% 消したいやつ
+    \def\jlreq at tempb{}% 消していない分を放り込んでいく
+    \jlreq at tempatrue% 最初の\jlreq at tempbへの追加か.
+    \jlreq at helper@removeelement@#2,\jlreq at endmark,%
+    \edef\jlreq at do{\unexpanded{\def#3}{\expandonce{\jlreq at tempb}}}%
+  \expandafter\endgroup
+  \jlreq at do
+}
+\def\jlreq at helper@removeelement@#1,{%
+  \jlreq at ifendmark{#1}{}{%
+    \edef\@tempa{\unexpanded{#1}}%
+    \ifx\jlreq at tempa\@tempa\expandafter\@gobble\else\expandafter\@firstofone\fi{%
+      \eappto\jlreq at tempb{\ifjlreq at tempa\else,\fi\unexpanded{#1}}%
+      \jlreq at tempafalse
+    }%
+    \jlreq at helper@removeelement@
+  }%
+}
+
+% 空白を無視しない\@ifnextchar
+\newcommand{\jlreq at ifnextchar}[3]{%
+  \let\reserved at d=#1%
+  \edef\reserved at a{\unexpanded{#2}}%
+  \edef\reserved at b{\unexpanded{#3}}%
+  \futurelet\jlreq at nextchar\jlreq at ifnextchar@
+}
+\def\jlreq at ifnextchar@{%
+  \ifx\jlreq at nextchar\reserved at d\let\reserved at b\reserved at a\fi
+  \reserved at b
+}
+% 空白を無視しない\@ifsart
+\newcommand*{\jlreq at ifstar}[2]{\jlreq at ifnextchar *{\edef\reserved at a*{\unexpanded{#1}}\reserved at a}{#2}}
+% カンマで区切って,その前と後ろを\jlreq at resulta,\jlreq at resultbに入れる
+% もしカンマがない場合は\ifjlreq at resultがfalseになる.
+\newcommand*{\jlreq at helper@dividebycomma}[1]{\jlreq at helper@dividebycomma@#1,\jlreq at endmark}
+\def\jlreq at helper@dividebycomma@#1,#2\jlreq at endmark{%
+  \def\jlreq at resulta{#1}%
+  \def\jlreq at resultb{#2}%
+  \ifx\jlreq at resultb\@empty\jlreq at resultfalse\else\jlreq at resulttrue\expandafter\def\expandafter\jlreq at resultb\expandafter{\jlreq at helper@removelastcomma#2\jlreq at endmark}\fi
+}
+\def\jlreq at helper@removelastcomma#1,\jlreq at endmark{#1}
+
+% vbox #1の最後を\jlreq at resultboxに入れる
+% #1の最後の行は消える
+\newcommand*{\jlreq at getlastbox}[1]{%
+  \setbox#1=\vbox{\unvbox#1\relax
+    \unskip\unskip\unpenalty\global\setbox\jlreq at resultbox=\lastbox}%
+  \ifhbox\jlreq at resultbox
+    \global\setbox\jlreq at resultbox=\hbox{%
+      \unhbox\jlreq at resultbox\unskip\unskip\unpenalty}%
+  \else
+    \global\setbox\jlreq at resultbox=\copy\voidb at x
+  \fi
+}
+
+% 簡易なkeyvalのパース.
+% \jlreq at parsekeyval*[family=jlreq at key]{ % *ありは\setkeys*を使う
+%  {key}{\def\val{#1}}
+%  *{key}{\def\val{#1}} % デフォルト値を空文字列にする
+%  {key}[choice1,choice2]{\def\valchoice{#1}}
+%}{parse対象}
+\newcommand*{\jlreq at parsekeyval}{%
+  \@ifstar{\jlreq at helper@parsekeyval@{*}}{\jlreq at helper@parsekeyval@{}}%
+}
+\def\jlreq at helper@parsekeyval@#1{%
+  \@ifnextchar[{\jlreq at helper@parsekeyval@@{#1}}{\jlreq at helper@parsekeyval@@{#1}[jlreq at key]}%
+}
+\long\def\jlreq at helper@parsekeyval@@#1[#2]#3#4{%
+  \begingroup
+    \def\jlreq at do{}%
+    \jlreq at helper@parsekeyval@@@{#2}#3{\jlreq at endmark}%
+    \setkeys#1{#2}{#4}%
+  \expandafter\endgroup
+  \jlreq at do
+}
+\def\jlreq at helper@parsekeyval@@@#1#2#{%
+  \jlreq at iffirsttoken@ignorespaces{#2}{*}{%
+    \jlreq at helper@parsekeyval@@@definekeywithdefault{#1}%
+  }{%
+    \jlreq at helper@parsekeyval@@@@{#1}%
+  }%
+}
+\long\def\jlreq at helper@parsekeyval@@@@#1#2{%
+  \jlreq at ifendmark{#2}{}{%
+    \@ifnextchar[{\jlreq at helper@parsekeyval@@@choicekey{#1}{#2}}{\jlreq at helper@parsekeyval@@@definekey{#1}{#2}}%
+  }%
+}
+\long\def\jlreq at helper@parsekeyval@@@choicekey#1#2[#3]#4{%
+  \define at choicekey{#1}{#2}{#3}{\eappto\jlreq at do{\unexpanded{#4}}}%
+  \jlreq at helper@parsekeyval@@@{#1}%
+}
+\long\def\jlreq at helper@parsekeyval@@@definekeywithdefault#1#2#3{%
+  \define at key{#1}{#2}[]{\eappto\jlreq at do{\unexpanded{#3}}}%
+  \jlreq at helper@parsekeyval@@@{#1}%
+}
+\long\def\jlreq at helper@parsekeyval@@@definekey#1#2#3{%
+  \define at key{#1}{#2}{\eappto\jlreq at do{\unexpanded{#3}}}%
+  \jlreq at helper@parsekeyval@@@{#1}%
+}
+
+% キー指定しないkeyval(独自実装)
+% \jlreq at parsekeyval@nokey{<action>}{<parse対象>}
+% action内では#1=key, #2=val
+\newcommand{\jlreq at parsekeyval@nokey}[2]{%
+  \begingroup
+    \def\jlreq at do{}%
+    \def\jlreq at parsekeyval@nokey at execute##1##2{#1}%
+    \expandafter\jlreq at parsekeyval@nokey@#2,\jlreq at endmark,%
+  \expandafter\endgroup
+  \jlreq at do
+}
+\long\def\jlreq at parsekeyval@nokey@#1,{%
+  \jlreq at ifendmark{#1}{}{\jlreq at parsekeyval@nokey@@#1=\jlreq at endmark}%
+}
+\long\def\jlreq at parsekeyval@nokey@@#1=#2\jlreq at endmark{%
+  \jlreq at ifempty{#2}{\jlreq at parsekeyval@nokey@@@{}{#1}}{\expandafter\jlreq at parsekeyval@nokey@@@\expandafter{\jlreq at parsekeyval@nokey@@@@#2\jlreq at endmark}{#1}}%
+}
+\long\def\jlreq at parsekeyval@nokey@@@#1#2{%
+  \eappto\jlreq at do{\expandonce{\jlreq at parsekeyval@nokey at execute{#2}{#1}}}%
+  \jlreq at parsekeyval@nokey@
+}
+\long\def\jlreq at parsekeyval@nokey@@@@#1=\jlreq at endmark{#1}
+
+% \jlreq at switch{str}{
+%   {str}{abcd}
+%   {str1}{xyz}
+%}[default: input = #1] -> abcd
+%または
+%
+% \jlreq at switch{str}{
+%   {str}{abcd}
+%   {str1}{xyz}
+%   {default} % ここは#1を受け付けない(パラメータトークンを受け付けたい場合のため).
+%} -> abcd
+% 文字列比較→\edefして比較する
+% 第一引数は\jlreq at tempaに入れておく.
+\long\def\jlreq at helper@switch at executeoption#1[#2]{%
+  \begingroup
+    \def\jlreq at do##1{#2}%
+  \expandafter\endgroup
+  \jlreq at do{#1}%
+}
+\long\def\jlreq at helper@removeoption[#1]{}
+\newcommand{\jlreq at switch}[2]{%
+  \begingroup
+    \let\jlreq at do\@undefined
+    \edef\jlreq at tempa{#1}% ループ中ずっと保存する
+    \jlreq at helper@switch@#2\jlreq at endmark
+    \ifx\jlreq at do\@undefined
+      \def\jlreq at do{\@ifnextchar[{\jlreq at helper@switch at executeoption{#1}}{}}%
+    \else
+      \appto\jlreq at do{\@ifnextchar[{\jlreq at helper@removeoption}{}}%
+    \fi
+  \expandafter\endgroup
+  \jlreq at do
+}
+\long\def\jlreq at helper@switch@#1{%
+  \jlreq at ifendmark{#1}{}{\jlreq at helper@switch@@{#1}}%
+}
+
+\long\def\jlreq at helper@switch@@#1#2{%
+  \jlreq at ifendmark{#2}{%
+    \edef\jlreq at do{\unexpanded{#1}}%
+  }{%
+    \edef\jlreq at tempb{#1}%
+    \ifx\jlreq at tempa\jlreq at tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
+      \edef\jlreq at do{\unexpanded{#2}}%
+      \jlreq at deleteuntileendmark
+    }{%
+      \jlreq at helper@switch@
+    }%
+  }%
+}
+
+
+\RequirePackage[savepos]{zref}
+\newcount\jlreq at zref@reference at count
+\jlreq at zref@reference at count=0
+% 現在のページを得る
+\zref at newprop*{jlreq at page}[0]{\number\c at page}
+\zref at addprop{main}{jlreq at page}
+\newcount\jlreq at currentpage
+% \jlreq at setcurrentpageをすると,\jlreq at currentpageにこの場所のページ数が入る
+\newcommand*{\jlreq at setcurrentpage}{%
+  \global\advance\jlreq at zref@reference at count by 1
+  \zref at labelbyprops{jlreq at currentpage.\the\jlreq at zref@reference at count}{jlreq at page}%
+  \global\jlreq at currentpage=\zref at extractdefault{jlreq at currentpage.\the\jlreq at zref@reference at count}{jlreq at page}{\c at page}\relax
+}
+
+% 先頭にあるマクロを展開しまくった結果の先頭を#2に入れる.
+\newcommand{\jlreq at getfirsttoken@expandmacros}[2]{%
+  \jlreq at iffirsttoken{#1}{ }{\def#2{ }}{%
+    \jlreq at ifempty{#1}{\def#2{}}{%
+      \jlreq at ifmacro@noargument{#1}{%
+        \expandafter\jlreq at getfirsttoken@expandmacros\expandafter{#1}{#2}%
+      }{%
+        \expandafter\expandafter\expandafter\jlreq at getfirsttoken@expandmacros@\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@{#2}%
+      }%
+    }%
+  }%
+}
+\def\jlreq at getfirsttoken@expandmacros@#1#2{\def#2{#1}}
+
+\def\jlreq at helper@checktokenlist#1#2{%
+  \jlreq at ifendmark{#2}{\@firstoftwo}%
+  {%
+    \ifnum0#1{#2}>0 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+      {\jlreq at helper@checktokenlist{#1}}%
+      {\expandafter\@secondoftwo\jlreq at deleteuntileendmark}%
+  }%
+}
+\def\jlreq at 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 at helper@chkfloatlist#1{\jlreq at helper@chknumlist{#1}\ifx#1.1\fi}
+% #1が[0-9\.]*に当てはまるか.
+\newcommand*{\jlreq at iffloat}[1]{\jlreq at helper@checktokenlist{\jlreq at helper@chkfloatlist}#1\jlreq at endmark}
+\newcommand*{\jlreq at ifnumber}[1]{\jlreq at helper@checktokenlist{\jlreq at helper@chknumlist}#1\jlreq at endmark}
+
+% \jlreq at ifprimitive#1#2#3: #1がprimitiveならば#2を,そうでなければ#3を実行する
+% (\if(pdf)primitiveを避けるようにしている.)
+\newcommand*{\jlreq at ifprimitive}[1]{%
+  \begingroup
+    \edef\@tempa{\string#1}%
+    \edef\@tempb{\meaning#1}%
+  \expandafter\endgroup
+  \ifx\@tempa\@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+
+\newcommand*{\jlreq at helper@guessengine}{%
+  \jlreq at ifprimitive\directlua{%
+    \let\jlreq at result=l%
+  }{%
+    \jlreq at ifprimitive\ucs{%
+      \let\jlreq at result=u%
+    }{%
+      \let\jlreq at result=p%
+    }%
+  }%
+}
+
+% #1を\@undefinedに,既に\@undefinedならば#2{#1}を呼ぶ
+\newcommand*{\jlreq at helper@undefcs}[2]{%
+  \ifundef{#1}{#2{#1}}{\undef{#1}}%
+}
+% \if版
+\newcommand*{\jlreq at 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 at helper@papersizelist at a0}{{841mm}{1189mm}}
+\@namedef{jlreq at helper@papersizelist at a1}{{594mm}{841mm}}
+\@namedef{jlreq at helper@papersizelist at a2}{{420mm}{594mm}}
+\@namedef{jlreq at helper@papersizelist at a3}{{297mm}{420mm}}
+\@namedef{jlreq at helper@papersizelist at a4}{{210mm}{297mm}}
+\@namedef{jlreq at helper@papersizelist at a5}{{148mm}{210mm}}
+\@namedef{jlreq at helper@papersizelist at a6}{{105mm}{148mm}}
+\@namedef{jlreq at helper@papersizelist at a7}{{74mm}{105mm}}
+\@namedef{jlreq at helper@papersizelist at a8}{{52mm}{74mm}}
+\@namedef{jlreq at helper@papersizelist at a9}{{37mm}{52mm}}
+\@namedef{jlreq at helper@papersizelist at a10}{{26mm}{37mm}}
+
+\@namedef{jlreq at helper@papersizelist at b0}{{1030mm}{1456mm}}
+\@namedef{jlreq at helper@papersizelist at b1}{{728mm}{1030mm}}
+\@namedef{jlreq at helper@papersizelist at b2}{{515mm}{728mm}}
+\@namedef{jlreq at helper@papersizelist at b3}{{364mm}{515mm}}
+\@namedef{jlreq at helper@papersizelist at b4}{{257mm}{364mm}}
+\@namedef{jlreq at helper@papersizelist at b5}{{182mm}{257mm}}
+\@namedef{jlreq at helper@papersizelist at b6}{{128mm}{182mm}}
+\@namedef{jlreq at helper@papersizelist at b7}{{91mm}{128mm}}
+\@namedef{jlreq at helper@papersizelist at b8}{{64mm}{91mm}}
+\@namedef{jlreq at helper@papersizelist at b9}{{45mm}{64mm}}
+\@namedef{jlreq at helper@papersizelist at b10}{{32mm}{45mm}}
+
+\@namedef{jlreq at helper@papersizelist at c2}{{458mm}{648mm}}
+\@namedef{jlreq at helper@papersizelist at c3}{{324mm}{458mm}}
+\@namedef{jlreq at helper@papersizelist at c4}{{229mm}{354mm}}
+\@namedef{jlreq at helper@papersizelist at c5}{{162mm}{229mm}}
+\@namedef{jlreq at helper@papersizelist at c6}{{114mm}{162mm}}
+\@namedef{jlreq at helper@papersizelist at c7}{{81mm}{114mm}}
+\@namedef{jlreq at helper@papersizelist at c8}{{57mm}{81mm}}
+
+\@namedef{jlreq at helper@papersizelist at a4var}{{210mm}{283mm}}
+\@namedef{jlreq at helper@papersizelist at b5var}{{182mm}{230mm}}
+
+\@namedef{jlreq at helper@papersizelist at letter}{{8.5in}{11in}}
+\@namedef{jlreq at helper@papersizelist at legal}{{8.5in}{14in}}
+\@namedef{jlreq at helper@papersizelist at executive}{{7.25in}{10.5in}}
+\@namedef{jlreq at helper@papersizelist at hagaki}{{100mm}{148mm}}
+
+% #1÷#2を\jlreq at resultdimenに入れる.(#1,#2は寸法を与える.)
+\newcommand*{\jlreq at helper@divide}[2]{%
+  \begingroup
+    \@tempdima=\dimexpr#1\relax\@tempdimb=\dimexpr#2\relax
+    % 分母を正にする
+    \ifdim\@tempdimb<0pt \@tempdima=-\@tempdima\@tempdimb=-\@tempdimb\fi
+    % \jlreq at tempdima*\@tempdimb <= \@tempdima < (\jlreq at tempdima + 1)*\@tempdimb
+    % となる整数\jlreq at tempdimaを捜し,\jlreq at tempdimb=\jlreq at tempdima + 1とする
+    \jlreq at tempdima=0pt
+    \ifdim\@tempdima<0pt
+      \loop\ifdim\strip at pt\jlreq at tempdima\@tempdimb>\@tempdima\advance\jlreq at tempdima by -1pt\repeat
+    \else
+      \loop\ifdim\strip at pt\jlreq at tempdima\@tempdimb<\@tempdima\advance\jlreq at tempdima by 1pt\repeat
+      \ifdim\strip at pt\jlreq at tempdima\@tempdimb=\@tempdima\else\advance\jlreq at tempdima by -1pt\fi
+    \fi
+    \jlreq at tempdimb=\dimexpr\jlreq at tempdima + 1pt\relax
+    % \jlreq at tempdimaと\jlreq at tempdimbで挟んでいく二分法
+    \jlreq at tempcnta=0 % 無限ループを避けるためのカウンタ
+    \loop\ifnum\numexpr\ifdim\dimexpr\jlreq at tempdimb - \jlreq at tempdima\relax>1sp 1\else0\fi*\ifnum\jlreq at tempcnta<100 1\else 0\fi\relax=1
+      \jlreq at tempdimc=\dimexpr(\jlreq at tempdima+\jlreq at tempdimb)/2\relax
+      \ifdim\strip at pt\jlreq at tempdimc\@tempdimb>\@tempdima\jlreq at tempdimb=\jlreq at tempdimc
+      \else\jlreq at tempdima=\jlreq at tempdimc\fi
+      \advance\jlreq at tempcnta by 1
+    \repeat
+    \edef\jlreq at do{\noexpand\jlreq at resultdimen=\the\jlreq at tempdima\noexpand\relax}%
+  \expandafter\endgroup
+  \jlreq at do
+}
+
+\endinput
+


Property changes on: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty	2018-05-19 23:27:52 UTC (rev 47771)
@@ -0,0 +1,355 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{jlreq-trimmarks}[2018/05/19 jlreq-trimmarks]
+\RequirePackage{xkeyval,etoolbox}
+\RequirePackage{jlreq-helpers}
+
+\newcommand*{\jlreq at trimmarks@undeferr}[1]{\PackageError{jlreq-trimmarks}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
+\newcommand*{\jlreq at trimmarks@afterpkg at addtodeletecs}[1]{%
+  \appto\jlreq at trimmarks@afterpkg at deletecslist{\jlreq at helper@undefcs{#1}{\jlreq at trimmarks@undeferr}}%
+}
+\newcommand*{\jlreq at trimmarks@afterpkg at addtodeleteif}[1]{%
+  \appto\jlreq at trimmarks@afterpkg at deletecslist{\jlreq at helper@undefif{#1}{\jlreq at trimmarks@undeferr}}%
+}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@afterpkg at addtodeletecs}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@afterpkg at addtodeleteif}
+\AtEndOfPackage{%
+  \jlreq at trimmarks@afterpkg at deletecslist
+  \jlreq at helper@undefcs{\jlreq at trimmarks@afterpkg at deletecslist}{\jlreq at trimmarks@undeferr}%
+  \undef{\jlreq at trimmarks@undeferr}%
+}
+
+\newcommand*{\jlreq at trimmarks@DeclareOption}[2]{%
+  \DeclareOptionX{#1}{%
+    \jlreq at ifempty{##1}{}{\PackageError{jlreq-trimmarks}{The option #1 should have no value}{\@ehc}}%
+    #2%
+  }
+}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@DeclareOption}
+
+\@ifclassloaded{jlreq}{\let\ifjlreq at trimmarks@jlreqloaded=\@firstoftwo}{\let\ifjlreq at trimmarks@jlreqloaded=\@secondoftwo}
+
+% dvipdfmx=f,dvips=s,dviout = o, lualatex = l
+\jlreq at trimmarks@DeclareOption{dvipdfmx}{\let\jlreq at trimmarks@driver=f}
+\jlreq at trimmarks@DeclareOption{dvips}{\let\jlreq at trimmarks@driver=s}
+\jlreq at trimmarks@DeclareOption{dviout}{\let\jlreq at trimmarks@driver=o}
+\let\jlreq at trimmarks@engine=\jlreq at engine
+\jlreq at trimmarks@DeclareOption{lualatex}{\let\jlreq at trimmarks@engine=l}
+\jlreq at trimmarks@DeclareOption{uplatex}{\let\jlreq at trimmarks@engine=u}
+\jlreq at trimmarks@DeclareOption{platex}{\let\jlreq at trimmarks@engine=p}
+
+\def\jlreq at trimmarks@switchpapersize{}
+\def\jlreq at trimmarks@addpapersize#1{%
+  \@ifnextchar[{\jlreq at trimmarks@addpapersize@{#1}}{\jlreq at trimmarks@addpapersize@@{#1}}
+}
+\def\jlreq at trimmarks@addpapersize@#1[#2]{%
+  \edef\@tempa{\unexpanded{\jlreq at trimmarks@addpapersize@@{#1}}\csexpandonce{jlreq at helper@papersizelist@#2}}%
+  \@tempa
+}
+\newcommand*{\jlreq at trimmarks@addpapersize@@}[3]{%
+  \@for\@tempa:=#1\do{%
+    \eappto\jlreq at trimmarks@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\def\jlreq at trimmarks@paperwidth{#2}\def\jlreq at trimmarks@paperheight{#3}}}}%
+  }%
+}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@switchpapersize}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@addpapersize}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@addpapersize@}
+\jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@addpapersize@@}
+
+\jlreq at trimmarks@addpapersize{a0,A0}[a0]
+\jlreq at trimmarks@addpapersize{a1,A1}[a1]
+\jlreq at trimmarks@addpapersize{a2,A2}[a2]
+\jlreq at trimmarks@addpapersize{a3,A3}[a3]
+\jlreq at trimmarks@addpapersize{a4,A4}[a4]
+\jlreq at trimmarks@addpapersize{a5,A5}[a5]
+\jlreq at trimmarks@addpapersize{a6,A6}[a6]
+\jlreq at trimmarks@addpapersize{a7,A7}[a7]
+\jlreq at trimmarks@addpapersize{a8,A8}[a8]
+\jlreq at trimmarks@addpapersize{a9,A9}[a9]
+\jlreq at trimmarks@addpapersize{a10,A10}[a10]
+
+\jlreq at trimmarks@addpapersize{b0,B0}[b0]
+\jlreq at trimmarks@addpapersize{b1,B1}[b1]
+\jlreq at trimmarks@addpapersize{b2,B2}[b2]
+\jlreq at trimmarks@addpapersize{b3,B3}[b3]
+\jlreq at trimmarks@addpapersize{b4,B4}[b4]
+\jlreq at trimmarks@addpapersize{b5,B5}[b5]
+\jlreq at trimmarks@addpapersize{b6,B6}[b6]
+\jlreq at trimmarks@addpapersize{b7,B7}[b7]
+\jlreq at trimmarks@addpapersize{b8,B8}[b8]
+\jlreq at trimmarks@addpapersize{b9,B9}[b9]
+\jlreq at trimmarks@addpapersize{b10,B10}[b10]
+
+\jlreq at trimmarks@addpapersize{c2,C2}[c2]
+\jlreq at trimmarks@addpapersize{c3,C3}[c3]
+\jlreq at trimmarks@addpapersize{c4,C4}[c4]
+\jlreq at trimmarks@addpapersize{c5,C5}[c5]
+\jlreq at trimmarks@addpapersize{c6,C6}[c6]
+\jlreq at trimmarks@addpapersize{c7,C7}[c7]
+\jlreq at trimmarks@addpapersize{c8,C8}[c8]
+
+\jlreq at trimmarks@addpapersize{a4var}[a4var]
+\jlreq at trimmarks@addpapersize{b5var}[b5var]
+
+\jlreq at trimmarks@addpapersize{letter}[letter]
+\jlreq at trimmarks@addpapersize{legal}[legal]
+\jlreq at trimmarks@addpapersize{executive}[executive]
+\jlreq at trimmarks@addpapersize{hagaki}[hagaki]
+
+\DeclareOptionX{trimmarks_paper}{
+  \edef\jlreq at do{%
+    \unexpanded{\jlreq at switch{#1}}{\expandonce{\jlreq at trimmarks@switchpapersize}}%
+    [\unexpanded{%
+      \jlreq at helper@dividebycomma{#1}%
+      \ifjlreq at result
+        \edef\jlreq at trimmarks@paperwidth{\jlreq at resulta}
+        \edef\jlreq at trimmarks@paperheight{\jlreq at resultb}
+      \else
+        \PackageError{jlreq}{The paper #1 is unknown}{\@ehc}%
+      \fi
+    }]%
+  }%
+  \jlreq at do
+}
+
+\newif\ifjlreq at trimmarks@digital \jlreq at trimmarks@digitaltrue
+\newif\ifjlreq at trimmarks@show \jlreq at trimmarks@showtrue
+\newif\ifjlreq at trimmarks@show at artbox \jlreq at trimmarks@show at artboxfalse
+\tombowdatetrue
+\DeclareOptionX{show}{%
+  \jlreq at ifempty{#1}{
+    \jlreq at trimmarks@showtrue\tombowdatetrue\jlreq at trimmarks@digitaltrue
+  }{
+    \jlreq at trimmarks@showfalse\tombowdatefalse\jlreq at trimmarks@digitalfalse
+    \@for\jlreq at trimmarks@tempa:=#1\do{%
+      \jlreq at switch{\jlreq at trimmarks@tempa}{
+        {trimmarks}{\jlreq at trimmarks@showtrue}
+        {banner}{\tombowdatetrue}
+        {digital}{\jlreq at trimmarks@digitaltrue}
+        {digital*}{\jlreq at trimmarks@digitaltrue\jlreq at trimmarks@show at artboxtrue}
+        {no}{\tombowdatefalse\jlreq at trimmarks@showfalse\jlreq at trimmarks@digitafalse}
+      }[\PackageError{jlreq-trimmarks}{Unknown value `##1' in the option `show'}{\@ehc}]
+    }
+  }
+}
+
+\let\jlreq at temporary@original@@removeelement=\@removeelement
+\let\@removeelement=\jlreq at helper@removeelement
+\ProcessOptionsX*\relax
+\let\@removeelement=\jlreq at temporary@original@@removeelement
+\let\jlreq at temporary@original@@removeelement=\@undefined
+
+\ifx o\jlreq at trimmarks@driver
+  \ifjlreq at trimmarks@digital
+    \ClassError{jlreq}{`show=digital' can't be used with the driver `dviout'}{\@ehc}
+  \fi
+\fi
+
+\newcommand{\jlreqtrimmarkssetup}[1]{%
+  \jlreq at parsekeyval{%
+    {banner}{\@bannertoken{##1}\maketombowbox}
+    {bleed_margin}{\def\jlreq at trimmarks@bleed{##1}\maketombowbox}
+    {trimmarks_width}{\setlength{\@tombowwidth}{##1}\maketombowbox}
+    {color}{
+      \jlreq at ifempty{##1}{
+        \def\jlreq at 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 at switch{##1}{
+          {c}{\def\jlreq at trimmarks@color{\color[cmyk]{1,0,0,0}}}
+          {m}{\def\jlreq at trimmarks@color{\color[cmyk]{0,1,0,0}}}
+          {y}{\def\jlreq at trimmarks@color{\color[cmyk]{0,0,1,0}}}
+          {k}{\def\jlreq at trimmarks@color{\color[cmyk]{0,0,0,1}}}
+          {cm}{\def\jlreq at trimmarks@color{\color[cmyk]{1,1,0,0}}}
+          {cy}{\def\jlreq at trimmarks@color{\color[cmyk]{1,0,1,0}}}
+          {ck}{\def\jlreq at trimmarks@color{\color[cmyk]{1,0,0,1}}}
+          {my}{\def\jlreq at trimmarks@color{\color[cmyk]{0,1,1,0}}}
+          {mk}{\def\jlreq at trimmarks@color{\color[cmyk]{0,1,0,1}}}
+          {yk}{\def\jlreq at trimmarks@color{\color[cmyk]{0,0,1,1}}}
+          {cmy}{\def\jlreq at trimmarks@color{\color[cmyk]{1,1,1,0}}}
+          {cmk}{\def\jlreq at trimmarks@color{\color[cmyk]{1,1,0,1}}}
+          {cyk}{\def\jlreq at trimmarks@color{\color[cmyk]{1,0,1,1}}}
+          {myk}{\def\jlreq at trimmarks@color{\color[cmyk]{0,1,1,1}}}
+          {cmyk}{\def\jlreq at trimmarks@color{\color[cmyk]{1,1,1,1}}}
+          {
+            \jlreq at iffirsttoken{##1}{[}{
+              \def\@tempa[####1]####2\jlreq at endmark{\def\jlreq at trimmarks@color{\color[####1]{####2}}}
+            }{
+              \def\@tempa####1\jlreq at endmark{\def\jlreq at trimmarks@color{\color{####1}}}
+            }
+            \@tempa##1\jlreq at endmark
+          }
+        }
+      }
+    \maketombowbox
+    }
+  }{#1}
+}
+\@onlypreamble\jlreqtrimmarkssetup
+\jlreqtrimmarkssetup{
+  banner={%
+    \jobname\space(\number\year-\two at digits\month-\two at digits\day
+    \space\two at digits\hour:\two at digits\minute)%
+  },
+  bleed_margin=3mm,
+  color={}
+}
+
+\ifx\jlreq at trimmarks@engine\@undefined
+  \jlreq at helper@guessengine
+  \let\jlreq at trimmarks@engine=\jlreq at result
+\fi
+
+\ifx\jlreq at trimmarks@driver\@undefined
+  \ifx l\jlreq at trimmarks@engine
+    \let\jlreq at trimmarks@driver=l
+  \else
+    % default: dvipdfmx
+    \let\jlreq at trimmarks@driver=f
+  \fi
+\fi
+
+\ifx\jlreq at trimmarks@paperwidth\@undefined
+  \edef\jlreq at trimmarks@paperwidth{\the\dimexpr\paperwidth + 2in\relax}
+  \edef\jlreq at trimmarks@paperheight{\the\dimexpr\paperheight + 2in\relax}
+\fi
+
+\ifx l\jlreq at engine
+  \setlength{\pagewidth}{\dimexpr\jlreq at trimmarks@paperwidth\relax}
+  \setlength{\pageheight}{\dimexpr\jlreq at trimmarks@paperheight\relax}
+\else
+  \setlength{\pdfpagewidth}{\dimexpr\jlreq at trimmarks@paperwidth\relax}
+  \setlength{\pdfpageheight}{\dimexpr\jlreq at trimmarks@paperheight\relax}
+\fi
+
+\hoffset=\dimexpr(\jlreq at trimmarks@paperwidth - \paperwidth)/2 - 1in\relax
+\voffset=\dimexpr(\jlreq at trimmarks@paperheight - \paperheight)/2 - 1in\relax
+
+\ifx l\jlreq at trimmarks@driver\else
+  \edef\@tempa{\noexpand\AtBeginDvi{\noexpand\special{papersize=\the\dimexpr\jlreq at trimmarks@paperwidth\relax,\the\dimexpr\jlreq at trimmarks@paperheight\relax}}}
+  \@tempa
+\fi
+\@ifundefined{stockwidth}{\newdimen\stockwidth}{}
+\@ifundefined{stockheight}{\newdimen\stockheight}{}
+\setlength{\stockwidth}{\dimexpr\jlreq at trimmarks@paperwidth\relax}
+\setlength{\stockheight}{\dimexpr\jlreq at trimmarks@paperheight\relax}
+
+\def\maketombowbox{%
+  \setbox\@TL\hbox to\z@{\yoko\hss
+      \vrule width\dimexpr 10mm + \jlreq at 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 at 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 at trimmarks@bleed\relax height\@tombowwidth depth\z@\hss}%
+  \setbox\@Tr\hbox to\z@{\yoko
+      \vrule height\dimexpr 10mm + \jlreq at 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 at 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 at 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 at trimmarks@bleed\relax depth\@tombowwidth height\z@\hss}%
+  \setbox\@Br\hbox to\z@{\yoko
+      \vrule depth\dimexpr 10mm + \jlreq at 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 at trimmarks@bleed\relax\relax
+  \@@paperheight=\dimexpr\@@paperheight - 6mm + 2\dimexpr\jlreq at trimmarks@bleed\relax\relax
+  \ifjlreq at trimmarks@show
+  \vbox to\z@{\kern-\dimexpr 10mm + \jlreq at trimmarks@bleed\relax
+    \boxmaxdepth\maxdimen
+    \moveleft\jlreq at trimmarks@bleed\vbox to\@@paperheight{%
+      \color at begingroup\jlreq at trimmarks@color
+      \hbox to\@@paperwidth{\hskip\jlreq at trimmarks@bleed\relax
+         \copy\@TL\hfill\copy\@TC\hfill\copy\@TR\hskip\jlreq at 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 at trimmarks@bleed\relax
+         \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip\jlreq at trimmarks@bleed}%
+    \color at endgroup}\vss
+  }%
+  \fi
+}
+
+\ifjlreq at trimmarks@digital
+  \def\jlreq at trimmarks@pttobp#1{\strip at pt\dimexpr0.9963\dimexpr#1\relax\relax}
+  \edef\jlreq at trimmarks@trimboxsize{%
+    [%
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperwidth - \paperwidth)/2}
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperheight - \paperheight)/2}
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperwidth + \paperwidth)/2}
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperheight + \paperheight)/2}%
+    ]
+  }
+  \edef\jlreq at trimmarks@bleedboxsize{%
+    [%
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperwidth - \paperwidth)/2 - \jlreq at trimmarks@bleed}
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperheight - \paperheight)/2 - \jlreq at trimmarks@bleed}
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperwidth + \paperwidth)/2 + \jlreq at trimmarks@bleed}
+      \jlreq at trimmarks@pttobp{(\jlreq at trimmarks@paperheight + \paperheight)/2 + \jlreq at trimmarks@bleed}%
+    ]
+  }
+  \edef\jlreq at trimmarks@pdfattribute{%
+    /TrimBox \jlreq at trimmarks@trimboxsize
+    \ifjlreq at trimmarks@show at artbox /ArtBox \jlreq at trimmarks@trimboxsize\fi
+    /BleedBox \jlreq at trimmarks@bleedboxsize
+  }
+  \jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@pttobp}
+  \jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@trimboxsize}
+  \jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@bleedboxsize}
+  \jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@pdfattribute}
+
+  \ifx l\jlreq at trimmarks@driver
+    \edef\@tempa{\noexpand\pdfvariable pageattr{\jlreq at trimmarks@pdfattribute}}
+    \@tempa
+  \fi
+  \ifx f\jlreq at trimmarks@driver
+    \edef\@outputtombow{\noexpand\special{pdf: put @thispage <<\jlreq at trimmarks@pdfattribute>>}\expandonce{\@outputtombow}}
+  \fi
+  \ifx s\jlreq at trimmarks@driver
+    \edef\@tempa{\noexpand\special{ps:SDict begin
+      [ /TrimBox  \jlreq at trimmarks@trimboxsize /PAGE pdfmark
+      \ifjlreq at trimmarks@show at artbox [ /ArtBox   \jlreq at trimmarks@trimboxsize /PAGE pdfmark \fi
+      [ /BleedBox \jlreq at trimmarks@bleedboxsize /PAGE pdfmark
+    end}}%
+    \@tempa
+  \fi
+\fi
+
+% always true
+\tombowtrue
+\maketombowbox
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2018-05-19 23:27:30 UTC (rev 47770)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2018-05-19 23:27:52 UTC (rev 47771)
@@ -5,349 +5,31 @@
 %%
 % (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 at tempcnta
-\newcount\jlreq at tempcntb
-\newcount\jlreq at tempcntc
-\newdimen\jlreq at tempdima
-\newdimen\jlreq at tempdimb
-\newdimen\jlreq at tempdimc
-\newskip\jlreq at tempskipa
-\newskip\jlreq at tempskipb
-\newskip\jlreq at tempskipc
-\newif\ifjlreq at tempa
-\newif\ifjlreq at tempb
-\newif\ifjlreq at tempc
-\newbox\jlreq at tempboxa
-\newbox\jlreq at tempboxb
-\newbox\jlreq at tempboxc
-% 計算結果を返すための変数
-\newdimen\jlreq at resultdimen
-\newskip\jlreq at resultskip
-\newbox\jlreq at resultbox
-\newif\ifjlreq at result
-\newcount\jlreq at resultcnt
-
-\newcommand*{\jlreq at 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 at undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
 % クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
 \newcommand*{\jlreq at aftercls@addtodeletecs}[1]{%
-  \appto\jlreq at aftercls@deletecslist{\jlreq at undefcs{#1}}%
+  \appto\jlreq at aftercls@deletecslist{\jlreq at helper@undefcs{#1}{\jlreq at undeferr}}%
 }
-\jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeletecs}
 \newcommand*{\jlreq at aftercls@addtodeleteif}[1]{%
-  \edef\@tempa{\expandafter\@gobble\string#1}%
-  \edef\@tempa{\expandafter\@gobbletwo\@tempa}%
-  \eappto\jlreq at aftercls@deletecslist{%
-    \unexpanded{\jlreq at undefcs{#1}}%
-    \noexpand\jlreq at undefcs{\expandonce{\csname\@tempa true\endcsname}}%
-    \noexpand\jlreq at undefcs{\expandonce{\csname\@tempa false\endcsname}}%
-  }%
+  \appto\jlreq at aftercls@deletecslist{\jlreq at helper@undefif{#1}{\jlreq at undeferr}}%
 }
+\jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeletecs}
 \jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeleteif}
 \AtEndOfClass{%
   \jlreq at aftercls@deletecslist
-  \jlreq at undefcs{\jlreq at aftercls@deletecslist}%
-  \undef{\jlreq at undefcs}%
+  \jlreq at helper@undefcs{\jlreq at aftercls@deletecslist}{\jlreq at undeferr}%
+  \undef{\jlreq at undeferr}%
 }
 
-\def\jlreq at uniqtoken{\jlreq at uniqtoken}
-\def\jlreq at endmark{\jlreq at endmark}
-\long\def\jlreq at deleteuntileendmark#1\jlreq at endmark{}
-
-\def\jlreq at expandafter@ii{\expandafter\expandafter\expandafter}
-\edef\jlreq at expandafter@iii{\expandonce{\jlreq at expandafter@ii}\noexpand\expandafter\expandonce{\jlreq at expandafter@ii}}
-\edef\jlreq at expandtwice#1{\expandonce{\jlreq at expandafter@ii}\noexpand\unexpanded\expandonce{\jlreq at expandafter@ii}{#1}}
-\edef\jlreq at expand@three#1{\expandonce{\jlreq at expandafter@iii}\noexpand\unexpanded\expandonce{\jlreq at expandafter@iii}{#1}}
-
-% \jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@の形で使う
-% 二回展開すると,#1の先頭(ただし空白は無視される)を取り出す.#1が空の場合は\jlreq at uniqtoken,先頭が{の場合は\bgroupとなる
-\def\jlreq at endmark@{\jlreq at endmark@} % \jlreq at getfirsttokenだけのためのendmark
-\long\def\jlreq at getfirsttoken#1#{\jlreq at getfirsttoken@#1\bgroup\jlreq at endmark@}
-\long\def\jlreq at getfirsttoken@#1#2\jlreq at endmark@#3\jlreq at endmark@{#1}
-% 与えられたトークン列が空か(展開はしないでチェック)
-\long\def\jlreq at ifempty#1{\expandafter\ifx\expandafter\relax\detokenize{#1}\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-% #1の先頭トークンが#2か(ただし#1が空ならば#2=\jlreq at uniqtoken,#1={ならば#2=\bgroupでTRUEとなる)
-\long\edef\jlreq at iffirsttoken#1#2{%
-  % スペースチェック
-  \unexpanded{\expandafter\expandafter\expandafter\jlreq at deleteuntileendmark\expandafter\ifx\expandafter}\expandonce{\space}\noexpand\detokenize{#1}\unexpanded{\@undefined\jlreq at endmark\expandafter\@firstoftwo\else\jlreq at endmark\expandafter\@secondoftwo\fi}{%
-    \noexpand\ifx\expandonce{\space}#2\unexpanded{\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}%
-  }{%
-    \noexpand\jlreq at iffirsttoken@ignorespaces{#1}{#2}%
-  }%
-}
-% こちらは先頭のスペースを読み飛ばす
-\long\def\jlreq at iffirsttoken@ignorespaces#1#2{%
-  \expandafter\expandafter\expandafter\ifx\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-}
-
-% #1が\jlreq at endmarkか
-\long\def\jlreq at ifendmark#1{\jlreq at iffirsttoken{#1}{\jlreq at endmark}}
-
-% #1の先頭が引数なしのマクロか
-\long\def\jlreq at ifmacro@noargument#1{%
-  \jlreq at ifempty{#1}{\@secondoftwo}{%
-    \jlreq at iffirsttoken{#1}{ }{\@secondoftwo}{%
-      \expandafter\expandafter\expandafter\jlreq at ifmacro@noargument@\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@
-}}}
-\long\def\jlreq at ifmacro@noargument@#1{\expandafter\jlreq at ifmacro@noargument@@\expandafter{\meaning #1}}
-\edef\jlreq at do{%
-  \unexpanded{\def\jlreq at ifmacro@noargument@@}##1{\noexpand\jlreq at ifmacro@noargument@@@##1\expandonce{\detokenize{macro:->}}\noexpand\jlreq at endmark}
-  \unexpanded{\def\jlreq at ifmacro@noargument@@@}##1\expandonce{\detokenize{macro:->}}##2\noexpand\jlreq at endmark{\noexpand\jlreq at ifempty{##1}}
-}
-\jlreq at do
-
-% #1(skipレジスタ)が0か(展開不可).
-\def\jlreq at ifgluezero#1{%
-  \begingroup
-    \edef\@tempa{\the#1}%
-    \edef\@tempb{\detokenize{0.0pt}}%
-    \edef\jlreq at do{\ifx\@tempa\@tempb\noexpand\@firstoftwo\else\noexpand\@secondoftwo\fi}%
-  \expandafter\endgroup
-  \jlreq at do
-}
-
-% #1が#2で終わるか(展開不可)
-\def\jlreq at ifendswith#1#2{%
-  \jlreq at ifempty{#2}{\@firstoftwo}{%
-    \begingroup
-      \def\jlreq at tempa##1#2\jlreq at uniqtoken##2\jlreq at endmark{%
-        \edef\jlreq at do{\jlreq at ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
-      }%
-      \jlreq at tempa#1\jlreq at uniqtoken#2\jlreq at uniqtoken\jlreq at endmark
-    \expandafter\endgroup
-    \jlreq at do
-  }%
-}
-% #1が#2で始まるか(展開不可)
-\def\jlreq at ifstartswith#1#2{%
-  \jlreq at ifempty{#2}{\@firstoftwo}{%
-    \jlreq at ifempty{#1}{\@secondoftwo}{%
-      \begingroup
-        \def\jlreq at tempa##1#2##2\jlreq at endmark{%
-          \edef\jlreq at do{\jlreq at ifempty{##1}{\noexpand\@firstoftwo}{\noexpand\@secondoftwo}}%
-        }%
-        \jlreq at tempa#1#2\jlreq at endmark
-      \expandafter\endgroup
-      \jlreq at do
-    }%
-  }%
-}
-% #1が#2を含むか(展開不可){}内に#2があってもFALSE判定.
-\def\jlreq at ifcontains#1#2{%
-  \jlreq at ifempty{#2}{\@firstoftwo}{%
-    \begingroup
-      \def\jlreq at tempa##1#2##2\jlreq at endmark{%
-        \edef\jlreq at do{\jlreq at ifempty{##2}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
-      }%
-      \jlreq at tempa#1#2\jlreq at endmark
-    \expandafter\endgroup
-    \jlreq at do
-  }%
-}
-
-% @removeelementの括弧があっても動くかもしれない版
-% #2から#1を消して#3に入れる
-\def\jlreq at helper@removeelement#1#2#3{%
-  \begingroup
-    \edef\jlreq at tempa{\unexpanded{#1}}% 消したいやつ
-    \def\jlreq at tempb{}% 消していない分を放り込んでいく
-    \jlreq at tempatrue% 最初の\jlreq at tempbへの追加か.
-    \jlreq at helper@removeelement@#2,\jlreq at endmark,%
-    \edef\jlreq at do{\unexpanded{\def#3}{\expandonce{\jlreq at tempb}}}%
-  \expandafter\endgroup
-  \jlreq at do
-}
-\def\jlreq at helper@removeelement@#1,{%
-  \jlreq at ifendmark{#1}{}{%
-    \edef\@tempa{\unexpanded{#1}}%
-    \ifx\jlreq at tempa\@tempa\expandafter\@gobble\else\expandafter\@firstofone\fi{%
-      \eappto\jlreq at tempb{\ifjlreq at tempa\else,\fi\unexpanded{#1}}%
-      \jlreq at tempafalse
-    }%
-    \jlreq at helper@removeelement@
-  }%
-}
-
-% 空白を無視しない\@ifnextchar
-\long\def\jlreq at ifnextchar#1#2#3{%
-  \let\reserved at d=#1%
-  \edef\reserved at a{\unexpanded{#2}}%
-  \edef\reserved at b{\unexpanded{#3}}%
-  \futurelet\jlreq at nextchar\jlreq at ifnextchar@
-}
-\def\jlreq at ifnextchar@{%
-  \ifx\jlreq at nextchar\reserved at d\let\reserved at b\reserved at a\fi
-  \reserved at b
-}
-% 空白を無視しない\@ifsart
-\def\jlreq at ifstar#1#2{\jlreq at ifnextchar *{\edef\reserved at a*{\unexpanded{#1}}\reserved at a}{#2}}
-% カンマで区切って,その前と後ろを\jlreq at resulta,\jlreq at resultbに入れる
-% もしカンマがない場合は\ifjlreq at resultがfalseになる.
-\def\jlreq at helper@dividebycomma#1{\jlreq at helper@dividebycomma@#1,\jlreq at endmark}
-\def\jlreq at helper@dividebycomma@#1,#2\jlreq at endmark{%
-  \def\jlreq at resulta{#1}%
-  \def\jlreq at resultb{#2}%
-  \ifx\jlreq at resultb\@empty\jlreq at resultfalse\else\jlreq at resulttrue\expandafter\def\expandafter\jlreq at resultb\expandafter{\jlreq at helper@removelastcomma#2\jlreq at endmark}\fi
-}
-\def\jlreq at helper@removelastcomma#1,\jlreq at endmark{#1}
-
-% vbox #1の最後を\jlreq at resultboxに入れる
-% #1の最後の行は消える
-\newcommand*{\jlreq at getlastbox}[1]{%
-  \setbox#1=\vbox{\unvbox#1\relax
-    \unskip\unskip\unpenalty\global\setbox\jlreq at resultbox=\lastbox}%
-  \ifhbox\jlreq at resultbox
-    \global\setbox\jlreq at resultbox=\hbox{%
-      \unhbox\jlreq at resultbox\unskip\unskip\unpenalty}%
-  \else
-    \global\setbox\jlreq at resultbox=\copy\voidb at x
-  \fi
-}
-
-% 簡易なkeyvalのパース.
-% \jlreq at parsekeyval*[family=jlreq at key]{ % *ありは\setkeys*を使う
-%  {key}{\def\val{#1}}
-%  *{key}{\def\val{#1}} % デフォルト値を空文字列にする
-%  {key}[choice1,choice2]{\def\valchoice{#1}}
-%}{parse対象}
-\def\jlreq at parsekeyval{%
-  \@ifstar{\jlreq at helper@parsekeyval@{*}}{\jlreq at helper@parsekeyval@{}}%
-}
-\def\jlreq at helper@parsekeyval@#1{%
-  \@ifnextchar[{\jlreq at helper@parsekeyval@@{#1}}{\jlreq at helper@parsekeyval@@{#1}[jlreq at key]}%
-}
-\long\def\jlreq at helper@parsekeyval@@#1[#2]#3#4{%
-  \begingroup
-    \def\jlreq at do{}%
-    \jlreq at helper@parsekeyval@@@{#2}#3{\jlreq at endmark}%
-    \setkeys#1{#2}{#4}%
-  \expandafter\endgroup
-  \jlreq at do
-}
-\def\jlreq at helper@parsekeyval@@@#1#2#{%
-  \jlreq at iffirsttoken@ignorespaces{#2}{*}{%
-    \jlreq at helper@parsekeyval@@@definekeywithdefault{#1}%
-  }{%
-    \jlreq at helper@parsekeyval@@@@{#1}%
-  }%
-}
-\long\def\jlreq at helper@parsekeyval@@@@#1#2{%
-  \jlreq at ifendmark{#2}{}{%
-    \@ifnextchar[{\jlreq at helper@parsekeyval@@@choicekey{#1}{#2}}{\jlreq at helper@parsekeyval@@@definekey{#1}{#2}}%
-  }%
-}
-\long\def\jlreq at helper@parsekeyval@@@choicekey#1#2[#3]#4{%
-  \define at choicekey{#1}{#2}{#3}{\eappto\jlreq at do{\unexpanded{#4}}}%
-  \jlreq at helper@parsekeyval@@@{#1}%
-}
-\long\def\jlreq at helper@parsekeyval@@@definekeywithdefault#1#2#3{%
-  \define at key{#1}{#2}[]{\eappto\jlreq at do{\unexpanded{#3}}}%
-  \jlreq at helper@parsekeyval@@@{#1}%
-}
-\long\def\jlreq at helper@parsekeyval@@@definekey#1#2#3{%
-  \define at key{#1}{#2}{\eappto\jlreq at do{\unexpanded{#3}}}%
-  \jlreq at helper@parsekeyval@@@{#1}%
-}
-
-% キー指定しないkeyval(独自実装)
-% \jlreq at parsekeyval@nokey{<action>}{<parse対象>}
-% action内では#1=key, #2=val
-\long\def\jlreq at parsekeyval@nokey#1#2{%
-  \begingroup
-    \def\jlreq at do{}%
-    \def\jlreq at parsekeyval@nokey at execute##1##2{#1}%
-    \expandafter\jlreq at parsekeyval@nokey@#2,\jlreq at endmark,%
-  \expandafter\endgroup
-  \jlreq at do
-}
-\long\def\jlreq at parsekeyval@nokey@#1,{%
-  \jlreq at ifendmark{#1}{}{\jlreq at parsekeyval@nokey@@#1=\jlreq at endmark}%
-}
-\long\def\jlreq at parsekeyval@nokey@@#1=#2\jlreq at endmark{%
-  \jlreq at ifempty{#2}{\jlreq at parsekeyval@nokey@@@{}{#1}}{\expandafter\jlreq at parsekeyval@nokey@@@\expandafter{\jlreq at parsekeyval@nokey@@@@#2\jlreq at endmark}{#1}}%
-}
-\long\def\jlreq at parsekeyval@nokey@@@#1#2{%
-  \eappto\jlreq at do{\expandonce{\jlreq at parsekeyval@nokey at execute{#2}{#1}}}%
-  \jlreq at parsekeyval@nokey@
-}
-\long\def\jlreq at parsekeyval@nokey@@@@#1=\jlreq at endmark{#1}
-
-% \jlreq at switch{str}{
-%   {str}{abcd}
-%   {str1}{xyz}
-%}[default: input = #1] -> abcd
-%または
-%
-% \jlreq at switch{str}{
-%   {str}{abcd}
-%   {str1}{xyz}
-%   {default} % ここは#1を受け付けない(パラメータトークンを受け付けたい場合のため).
-%} -> abcd
-% 文字列比較→\edefして比較する
-% 第一引数は\jlreq at tempaに入れておく.
-\long\def\jlreq at helper@switch at executeoption#1[#2]{%
-  \begingroup
-    \def\jlreq at do##1{#2}%
-  \expandafter\endgroup
-  \jlreq at do{#1}%
-}
-\long\def\jlreq at helper@removeoption[#1]{}
-\long\def\jlreq at switch#1#2{%
-  \begingroup
-    \let\jlreq at do\@undefined
-    \edef\jlreq at tempa{#1}% ループ中ずっと保存する
-    \jlreq at helper@switch@#2\jlreq at endmark
-    \ifx\jlreq at do\@undefined
-      \def\jlreq at do{\@ifnextchar[{\jlreq at helper@switch at executeoption{#1}}{}}%
-    \else
-      \appto\jlreq at do{\@ifnextchar[{\jlreq at helper@removeoption}{}}%
-    \fi
-  \expandafter\endgroup
-  \jlreq at do
-}
-\long\def\jlreq at helper@switch@#1{%
-  \jlreq at ifendmark{#1}{}{\jlreq at helper@switch@@{#1}}%
-}
-
-\long\def\jlreq at helper@switch@@#1#2{%
-  \jlreq at ifendmark{#2}{%
-    \edef\jlreq at do{\unexpanded{#1}}%
-  }{%
-    \edef\jlreq at tempb{#1}%
-    \ifx\jlreq at tempa\jlreq at tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
-      \edef\jlreq at do{\unexpanded{#2}}%
-      \jlreq at deleteuntileendmark
-    }{%
-      \jlreq at helper@switch@
-    }%
-  }%
-}
-
 % preambleにいるかのスイッチ
 \newif\ifjlreq at preamble
 \jlreq at preambletrue
 \AtBeginDocument{\jlreq at preamblefalse}
 
-\RequirePackage[savepos]{zref}
-\newcount\jlreq at zref@reference at count
-\jlreq at zref@reference at count=0
-% 現在のページを得る
-\zref at newprop*{jlreq at page}[0]{\number\c at page}
-\zref at addprop{main}{jlreq at page}
-\newcount\jlreq at currentpage
-% \jlreq at setcurrentpageをすると,\jlreq at currentpageにこの場所のページ数が入る
-\newcommand*{\jlreq at setcurrentpage}{%
-  \global\advance\jlreq at zref@reference at count by 1
-  \zref at labelbyprops{jlreq at currentpage.\the\jlreq at zref@reference at count}{jlreq at page}%
-  \global\jlreq at currentpage=\zref at extractdefault{jlreq at currentpage.\the\jlreq at zref@reference at count}{jlreq at page}{\c at page}\relax
-}
-
 \def\jlreq at 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 at getfirsttoken@expandmacros#1#2{%
-  \jlreq at iffirsttoken{#1}{ }{\def#2{ }}{%
-    \jlreq at ifempty{#1}{\def#2{}}{%
-      \jlreq at ifmacro@noargument{#1}{%
-        \expandafter\jlreq at getfirsttoken@expandmacros\expandafter{#1}{#2}%
-      }{%
-        \expandafter\expandafter\expandafter\jlreq at getfirsttoken@expandmacros@\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@{#2}%
-      }%
-    }%
-  }%
-}
-\def\jlreq at getfirsttoken@expandmacros@#1#2{\def#2{#1}}
-
-\def\jlreq at helper@checktokenlist#1#2{%
-  \jlreq at ifendmark{#2}{\@firstoftwo}%
-  {%
-    \ifnum0#1{#2}>0 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-      {\jlreq at helper@checktokenlist{#1}}%
-      {\expandafter\@secondoftwo\jlreq at deleteuntileendmark}%
-  }%
-}
-\def\jlreq at 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 at helper@chkfloatlist#1{\jlreq at helper@chknumlist{#1}\ifx#1.1\fi}
-% #1が[0-9\.]*に当てはまるか.
-\def\jlreq at iffloat#1{\jlreq at helper@checktokenlist{\jlreq at helper@chkfloatlist}#1\jlreq at endmark}
-\def\jlreq at ifnumber#1{\jlreq at helper@checktokenlist{\jlreq at helper@chknumlist}#1\jlreq at endmark}
-
 %. オプションの定義
 % オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する)
 % ものは\jlreq at option@<key>に格納する.
@@ -419,7 +73,15 @@
 \def\jlreq at switchpapersize{}
 \jlreq at aftercls@addtodeletecs{\jlreq at switchpapersize}
 % \jlreq at addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦}
-\newcommand*{\jlreq at addpapersize}[4]{%
+
+\def\jlreq at addpapersize#1#2{%
+  \@ifnextchar[{\jlreq at addpapersize@{#1}{#2}}{\jlreq at addpapersize@@{#1}{#2}}
+}
+\def\jlreq at addpapersize@#1#2[#3]{%
+  \edef\@tempa{\unexpanded{\jlreq at addpapersize@@{#1}{#2}}\csexpandonce{jlreq at helper@papersizelist@#3}}%
+  \@tempa
+}
+\newcommand*{\jlreq at addpapersize@@}[4]{%
   \@for\@tempa:=#1\do{%
     \eappto\jlreq at switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}%
   }%
@@ -428,6 +90,8 @@
   }%
 }
 \jlreq at aftercls@addtodeletecs{\jlreq at addpapersize}
+\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize@}
+\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize@@}
 \DeclareOptionX{paper}{
   \edef\jlreq at do{%
     \unexpanded{\jlreq at switch{#1}}{\expandonce{\jlreq at switchpapersize}}%
@@ -444,45 +108,45 @@
   \jlreq at do
 }
 % 紙サイズ一覧.b*はJIS B.
-\jlreq at addpapersize{a0,A0}{}{841mm}{1189mm}
-\jlreq at addpapersize{a1,A1}{}{594mm}{841mm}
-\jlreq at addpapersize{a2,A2}{}{420mm}{594mm}
-\jlreq at addpapersize{a3,A3}{a3paper}{297mm}{420mm}
-\jlreq at addpapersize{a4,A4}{a4paper}{210mm}{297mm}
-\jlreq at addpapersize{a5,A5}{a5paper}{148mm}{210mm}
-\jlreq at addpapersize{a6,A6}{a6paper}{105mm}{148mm}
-\jlreq at addpapersize{a7,A7}{}{74mm}{105mm}
-\jlreq at addpapersize{a8,A8}{}{52mm}{74mm}
-\jlreq at addpapersize{a9,A9}{}{37mm}{52mm}
-\jlreq at addpapersize{a10,A10}{}{26mm}{37mm}
+\jlreq at addpapersize{a0,A0}{}[a0]
+\jlreq at addpapersize{a1,A1}{}[a1]
+\jlreq at addpapersize{a2,A2}{}[a2]
+\jlreq at addpapersize{a3,A3}{a3paper}[a3]
+\jlreq at addpapersize{a4,A4}{a4paper}[a4]
+\jlreq at addpapersize{a5,A5}{a5paper}[a5]
+\jlreq at addpapersize{a6,A6}{a6paper}[a6]
+\jlreq at addpapersize{a7,A7}{}[a7]
+\jlreq at addpapersize{a8,A8}{}[a8]
+\jlreq at addpapersize{a9,A9}{}[a9]
+\jlreq at addpapersize{a10,A10}{}[a10]
 
-\jlreq at addpapersize{b0,B0}{}{1030mm}{1456mm}
-\jlreq at addpapersize{b1,B1}{}{728mm}{1030mm}
-\jlreq at addpapersize{b2,B2}{}{515mm}{728mm}
-\jlreq at addpapersize{b3,B3}{}{364mm}{515mm}
-\jlreq at addpapersize{b4,B4}{b4paper}{257mm}{364mm}
-\jlreq at addpapersize{b5,B5}{b5paper}{182mm}{257mm}
-\jlreq at addpapersize{b6,B6}{b6paper}{128mm}{182mm}
-\jlreq at addpapersize{b7,B7}{}{91mm}{128mm}
-\jlreq at addpapersize{b8,B8}{}{64mm}{91mm}
-\jlreq at addpapersize{b9,B9}{}{45mm}{64mm}
-\jlreq at addpapersize{b10,B10}{}{32mm}{45mm}
+\jlreq at addpapersize{b0,B0}{}[b0]
+\jlreq at addpapersize{b1,B1}{}[b1]
+\jlreq at addpapersize{b2,B2}{}[b2]
+\jlreq at addpapersize{b3,B3}{}[b3]
+\jlreq at addpapersize{b4,B4}{b4paper}[b4]
+\jlreq at addpapersize{b5,B5}{b5paper}[b5]
+\jlreq at addpapersize{b6,B6}{b6paper}[b6]
+\jlreq at addpapersize{b7,B7}{}[b7]
+\jlreq at addpapersize{b8,B8}{}[b8]
+\jlreq at addpapersize{b9,B9}{}[b9]
+\jlreq at addpapersize{b10,B10}{}[b10]
 
-\jlreq at addpapersize{c2,C2}{}{458mm}{648mm}
-\jlreq at addpapersize{c3,C3}{}{324mm}{458mm}
-\jlreq at addpapersize{c4C,C4}{}{229mm}{354mm}
-\jlreq at addpapersize{c5,C5}{}{162mm}{229mm}
-\jlreq at addpapersize{c6,C6}{}{114mm}{162mm}
-\jlreq at addpapersize{c7,C7}{}{81mm}{114mm}
-\jlreq at addpapersize{c8,C8}{}{57mm}{81mm}
+\jlreq at addpapersize{c2,C2}{}[c2]
+\jlreq at addpapersize{c3,C3}{}[c3]
+\jlreq at addpapersize{c4,C4}{}[c4]
+\jlreq at addpapersize{c5,C5}{}[c5]
+\jlreq at addpapersize{c6,C6}{}[c6]
+\jlreq at addpapersize{c7,C7}{}[c7]
+\jlreq at addpapersize{c8,C8}{}[c8]
 
-\jlreq at addpapersize{a4var}{}{210mm}{283mm}
-\jlreq at addpapersize{b5var}{}{182mm}{230mm}
+\jlreq at addpapersize{a4var}{}[a4var]
+\jlreq at addpapersize{b5var}{}[b5var]
 
-\jlreq at addpapersize{letter}{letterpaper}{8.5in}{11in}
-\jlreq at addpapersize{legal}{legalpaper}{8.5in}{14in}
-\jlreq at addpapersize{executive}{executivepaper}{7.25in}{10.5in}
-\jlreq at addpapersize{hagaki}{}{100mm}{148mm}
+\jlreq at addpapersize{letter}{letterpaper}[letter]
+\jlreq at addpapersize{legal}{legalpaper}[legal]
+\jlreq at addpapersize{executive}{executivepaper}[executive]
+\jlreq at addpapersize{hagaki}{}[hagaki]
 
 
 %.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a)
@@ -521,6 +185,10 @@
 \newcommand*{\jlreq at option@gutter}{}
 \jlreq at aftercls@addtodeletecs{\jlreq at option@gutter}
 \DeclareOptionX{gutter}{\renewcommand*{\jlreq at option@gutter}{#1}}
+%.. 小口
+\newcommand*{\jlreq at option@fore at edge}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@fore at edge}
+\DeclareOptionX{fore_edge}{\renewcommand*{\jlreq at option@fore at edge}{#1}}
 
 %.. 柱とノンブル
 \newcommand*{\jlreq at option@headfoot at verticalpos}{}
@@ -564,14 +232,9 @@
 \newif\if at landscape\@landscapefalse
 \newif\if at tate \@tatefalse
 \jlreq at DeclareOption{landscape}{\@landscapetrue}
-\jlreq at DeclareOption{tombo}{%
-  \tombowtrue\tombowdatefalse
-  \setlength{\@tombowwidth}{.1\p@}%
-  \maketombowbox}
-\jlreq at DeclareOption{mentuke}{%
-  \tombowtrue\tombowdatefalse
-  \setlength{\@tombowwidth}{\z@}%
-  \maketombowbox}
+\jlreq at DeclareOption{tombo}{\ClassWarningNoLine{jlreq}{The option `tombo' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq at DeclareOption{tombow}{\ClassWarningNoLine{jlreq}{The option `tombow' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq at DeclareOption{mentuke}{\ClassWarningNoLine{jlreq}{The option `mentuke' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
 \jlreq at DeclareOption{tate}{\@tatetrue}
 
 \newif\ifjlreq at option@twoside\jlreq at option@twosidefalse % onesideかtwosideが指定された
@@ -648,26 +311,10 @@
 \jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@addtofinally}
 \@onlypreamble\jlreqsetup
 
-% \jlreq at ifprimitive#1#2#3: #1がprimitiveならば#2を,そうでなければ#3を実行する
-% (\if(pdf)primitiveを避けるようにしている.)
-\def\jlreq at ifprimitive#1{%
-  \begingroup
-    \edef\@tempa{\string#1}%
-    \edef\@tempb{\meaning#1}%
-  \expandafter\endgroup
-  \ifx\@tempa\@tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-}
 % エンジンの設定
 \ifx\jlreq at engine\@undefined
-  \jlreq at ifprimitive\directlua{
-    \let\jlreq at engine=l
-  }{
-    \jlreq at ifprimitive\ucs{
-      \let\jlreq at engine=u
-    }{
-      \let\jlreq at engine=p
-    }
-  }
+  \jlreq at helper@guessengine
+  \let\jlreq at engine=\jlreq at 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 at rest@width.pos.\the\jlreq at zref@reference at count} sp
       }%
+      \iftombow - 1in\fi
       - \@totalleftmargin - 1in
     \relax
   }
@@ -880,39 +529,12 @@
   \jlreq at do
 }
 
-% #1÷#2を\jlreq at resultdimenに入れる.(#1,#2は寸法を与える.)
 \ifx l\jlreq at engine
   \newcommand*{\jlreq at divide}[2]{%
     \jlreq at resultdimen=\directlua{tex.print(tostring(\strip at pt\dimexpr #1\relax/\strip at pt\dimexpr #2\relax) .. "pt ")}%
   }
 \else
-  \newcommand*{\jlreq at divide}[2]{%
-    \begingroup
-      \@tempdima=\dimexpr#1\relax\@tempdimb=\dimexpr#2\relax
-      % 分母を正にする
-      \ifdim\@tempdimb<0pt \@tempdima=-\@tempdima\@tempdimb=-\@tempdimb\fi
-      % \jlreq at tempdima*\@tempdimb <= \@tempdima < (\jlreq at tempdima + 1)*\@tempdimb
-      % となる整数\jlreq at tempdimaを捜し,\jlreq at tempdimb=\jlreq at tempdima + 1とする
-      \jlreq at tempdima=0pt
-      \ifdim\@tempdima<0pt
-        \loop\ifdim\strip at pt\jlreq at tempdima\@tempdimb>\@tempdima\advance\jlreq at tempdima by -1pt\repeat
-      \else
-        \loop\ifdim\strip at pt\jlreq at tempdima\@tempdimb<\@tempdima\advance\jlreq at tempdima by 1pt\repeat
-        \ifdim\strip at pt\jlreq at tempdima\@tempdimb=\@tempdima\else\advance\jlreq at tempdima by -1pt\fi
-      \fi
-      \jlreq at tempdimb=\dimexpr\jlreq at tempdima + 1pt\relax
-      % \jlreq at tempdimaと\jlreq at tempdimbで挟んでいく二分法
-      \jlreq at tempcnta=0 % 無限ループを避けるためのカウンタ
-      \loop\ifnum\numexpr\ifdim\dimexpr\jlreq at tempdimb - \jlreq at tempdima\relax>1sp 1\else0\fi*\ifnum\jlreq at tempcnta<100 1\else 0\fi\relax=1
-        \jlreq at tempdimc=\dimexpr(\jlreq at tempdima+\jlreq at tempdimb)/2\relax
-        \ifdim\strip at pt\jlreq at tempdimc\@tempdimb>\@tempdima\jlreq at tempdimb=\jlreq at tempdimc
-        \else\jlreq at tempdima=\jlreq at tempdimc\fi
-        \advance\jlreq at tempcnta by 1
-      \repeat
-      \edef\jlreq at do{\noexpand\jlreq at resultdimen=\the\jlreq at tempdima\noexpand\relax}%
-    \expandafter\endgroup
-    \jlreq at do
-  }
+  \let\jlreq at divide=\jlreq at helper@divide
 \fi
 
 %. 基本設定
@@ -1251,7 +873,7 @@
 
 % 行頭の括弧は \jlreq at open@bracket at before@space \inhibitglue 「みたいにする.
 \ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{
-  \def\jlreq at open@bracket at before@space{\hskip -.5\zw}
+  \def\jlreq at open@bracket at before@space{\hskip\glueexpr-.5\zw\relax}
 }{
   \def\jlreq at open@bracket at before@space{}
 }
@@ -1610,16 +1232,47 @@
 % (TODO: 頭注)
 \if at tate\@mparswitchfalse\fi
 
+\setlength{\topskip}{1\zw} % フォントサイズと一致させる
+\ifx\jlreq at option@headfoot at verticalpos\@empty
+  \if at tate\def\jlreq at option@headfoot at verticalpos{1zw}
+  \else\def\jlreq at option@headfoot at verticalpos{2zw}\fi
+\fi
+\setlength{\headsep}{\jlreq at speciallength{\jlreq at option@headfoot at verticalpos}}
+\ifdim\headsep<1\zw\relax\jlreq at note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi
+\setlength{\headheight}{1\zw}
+
 % \textwidthと\textheightのデフォルト値は縦横ともに0.75倍(調整が入る).
 %.. \textwidth:文字送り方向の行長
 % 二段の場合は最初の段の頭から次の段の後まで
 % 一度\textwidthに一行の長さの文字数を入れる(段組の場合でも)
+\newif\ifjlreq at determine@kihonhanmen at warning@first
+\jlreq at determine@kihonhanmen at warning@firsttrue
+\def\jlreq at determine@kihonhanmen at warning{
+  \ifjlreq at determine@kihonhanmen at warning@first
+    \jlreq at note{基本版面は,a. サイズの決定 b. 仕上りサイズに対する基本版面の配置位置の決定 という手順で行う (2.4.1).}
+    \jlreq at determine@kihonhanmen at warning@firstfalse
+  \fi
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at determine@kihonhanmen at warning}
+\jlreq at aftercls@addtodeleteif{\ifjlreq at determine@kihonhanmen at warning@first}
 \@tempdima=1\zw
 \ifx\jlreq at option@line at length\@empty
   \if at tate
-    \setlength{\textwidth}{0.75\paperheight}
+    \ifnum 0\ifx\jlreq at option@head at space\@empty 1\fi\ifx\jlreq at option@foot at space\@empty 1\fi>0
+      \setlength{\textwidth}{0.75\paperheight}
+      \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
+    \else
+      \jlreq at determine@kihonhanmen at warning
+      \setlength{\textwidth}{\dimexpr\paperheight - \jlreq at option@head at space - \jlreq at option@foot at space \relax}
+    \fi
   \else
-    \setlength{\textwidth}{0.75\paperwidth}
+    \ifnum 0\ifx\jlreq at option@gutter\@empty 1\fi\ifx\jlreq at option@fore at edge\@empty 1\fi>0
+      \setlength{\textwidth}{0.75\paperwidth}
+      \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
+    \else
+      \jlreq at determine@kihonhanmen at warning
+      \setlength{\textwidth}{\dimexpr\paperwidth - \jlreq at option@gutter - \jlreq at option@fore at edge\relax}
+    \fi
   \fi
   \if at 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 at speciallength{\jlreq at option@line at length}}
   \divide\textwidth\@tempdima
@@ -1640,66 +1292,95 @@
       \jlreq at note{一行の長さは40文字以下が望ましい (2.4.2.c 注2).}
     \fi
   \fi
+  \multiply\textwidth\@tempdima
 \fi
-\multiply\textwidth\@tempdima
 \if at twocolumn
   \setlength{\textwidth}{\dimexpr2\textwidth + \columnsep\relax}
 \fi
 
-\setlength{\topskip}{1\zw} % フォントサイズと一致させる
 
 %.. \textheight:行送り方向の長さ
 % 一番上(直後に\topskip由来が入る)から最終行のベースラインまでの長さ.
 % \topskipが十分ある時は先頭行のベースラインから最終行のベースライン+\topskip
+\def\jlreq at adjusttextheight{
+  \addtolength{\textheight}{-\topskip}
+  \divide\textheight\baselineskip \multiply\textheight\baselineskip
+  \addtolength{\textheight}{\topskip}
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at adjusttextheight}
 \ifx\jlreq at option@number at of@lines\@empty
   \if at tate
-    \setlength{\textheight}{0.75\paperwidth}
+    \ifnum 0\ifx\jlreq at option@gutter\@empty 1\fi\ifx\jlreq at option@fore at edge\@empty 1\fi>0
+      \setlength{\textheight}{0.75\paperwidth}
+      \jlreq at adjusttextheight
+    \else
+      \jlreq at determine@kihonhanmen at warning
+      \setlength{\textheight}{\dimexpr\paperwidth - \jlreq at option@gutter - \jlreq at option@fore at edge + \topskip - 1\zw\relax}
+    \fi
   \else
-    \setlength{\textheight}{0.75\paperheight}
+    \ifnum 0\ifx\jlreq at option@head at space\@empty 1\fi\ifx\jlreq at option@foot at space\@empty 1\fi>0
+      \setlength{\textheight}{0.75\paperheight}
+      \jlreq at adjusttextheight
+    \else
+      \jlreq at determine@kihonhanmen at warning
+      \setlength{\textheight}{\dimexpr\paperheight  + 2\topskip - 1\zh -  \Cht - \jlreq at option@head at space - \jlreq at option@foot at space\relax}
+    \fi
   \fi
-  \addtolength{\textheight}{-\topskip}
-  \divide\textheight\baselineskip \multiply\textheight\baselineskip
-  \addtolength{\textheight}{\topskip}
 \else
   \setlength{\textheight}{\dimexpr\numexpr\jlreq at option@number at of@lines\relax\baselineskip - \baselineskip + \topskip\relax}
 \fi
 
-\ifx\jlreq at option@headfoot at verticalpos\@empty
-  \if at tate\def\jlreq at option@headfoot at verticalpos{1zw}
-  \else\def\jlreq at option@headfoot at verticalpos{2zw}\fi
-\fi
-\setlength{\headsep}{\jlreq at speciallength{\jlreq at option@headfoot at verticalpos}}
-\ifdim\headsep<1\zw\relax\jlreq at note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi
-\setlength{\headheight}{1\zw}
 %.. 横
-\ifx\jlreq at option@gutter\@empty
-  % 中央配置
+\def\jlreq at setsidemargin@by at gutter#1{
   \if at 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 at twocolumn
-      \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax}
+      \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax}
+    \fi
+    \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax}
+  \fi
+}
+\def\jlreq at setsidemargin@by at fore@edge#1{
+  \jlreq at setsidemargin@by at gutter{#1}
+  \@tempdima=\evensidemargin
+  \evensidemargin=\oddsidemargin
+  \oddsidemargin=\@tempdima
+  \ifjlreq at determine@kihonhanmen at warning@first
+    \jlreq at note{基本版面の配置はのどの空き量を指定する (2.4.1.b).}
+  \fi
+}
+
+\ifx\jlreq at option@gutter\@empty
+  \ifx\jlreq at option@fore at edge\@empty
+    % 中央配置
+    \if at tate
+      \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax}
     \else
-      \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax}
+      \if at twocolumn
+        \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax}
+      \else
+        \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax}
+      \fi
     \fi
-  \fi
-  \setlength{\oddsidemargin}{.5\oddsidemargin}
-  \ifnum0\if at twocolumn1\fi\if at tate1\fi>0
-    \setlength{\evensidemargin}{\oddsidemargin}
+    \setlength{\oddsidemargin}{.5\oddsidemargin}
+    \ifnum0\if at twocolumn1\fi\if at tate1\fi>0
+      \setlength{\evensidemargin}{\oddsidemargin}
+    \else
+      \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax}
+    \fi
   \else
-    \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax}
+    \jlreq at setsidemargin@by at fore@edge{\jlreq at speciallength{\jlreq at option@fore at edge}}
   \fi
 \else
-  \if at tate
-    \setlength{\evensidemargin}{\jlreq at speciallength{\jlreq at option@gutter}}
-    \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax}
-    \addtolength{\evensidemargin}{\Cdp}
-  \else
-    \setlength{\oddsidemargin}{\jlreq at speciallength{\jlreq at option@gutter}}
-    \if at twocolumn
-      \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax}
+  \jlreq at setsidemargin@by at gutter{\jlreq at speciallength{\jlreq at option@gutter}}
+  \ifx\jlreq at option@fore at edge\@empty\else
+    \ifjlreq at determine@kihonhanmen at 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 at tate
       \jlreq at settopmarginbyfoot{\jlreq at speciallength{\jlreq at option@foot at space}}
-      \ClassWarningNoLine{jlreq}{head_space is ignored}
+      \ifx\jlreq at option@line at length\@empty\else
+        \ClassWarningNoLine{jlreq}{head_space is ignored}
+      \fi
     \else
       \jlreq at settopmarginbyhead{\jlreq at speciallength{\jlreq at option@head at space}}
-      \ClassWarningNoLine{jlreq}{foot_space is ignored}
+      \ifx\jlreq at option@number at of@lines\@empty\else
+        \ClassWarningNoLine{jlreq}{foot_space is ignored}
+      \fi
     \fi
   \fi
 \fi
@@ -1783,10 +1468,13 @@
   \fi
 }
 
-% 同行見出し以外では,jlreq at heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される.
+% 扉見出しと別行見出しについては,\<csname> -> \jlreq at headingcs@csname -> 本体と
+% 二段構えで展開されるようにする.一度の展開で\parが出るのを防ぐため.
+% 一度展開を\longなしマクロに渡されると破綻するので.(そういうパッケージが存在する.)
+
+% jlreq at heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される.
 % #1=*または空(見出し命令に*がついていたかで分岐),#2=ラベル,#3=running head
 % デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる.
-% 同行見出しでは\@startsection任せ
 
 % 見出しの直前に実行される
 \newcommand*{\jlreq at hook@beforeheadings}[1]{}
@@ -1793,7 +1481,8 @@
 % 見出し名一覧を格納する
 \def\jlreq at heading@allheadings{}
 
-% 目次を出力する命令\l@<命令名>を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
+% 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
+% 結果は\jlreq at resultに入る.
 \def\jlreq at heading@make at l@#1#2#3{%
   \@ifundefined{l@#1}{%
    % 長さは適当に計測する
@@ -1801,12 +1490,17 @@
       % ちょっと大きめで計測しておく
       \csname c@#1\endcsname=9
       \setbox\jlreq at tempboxa=\hbox{#3}%
-      \jlreq at tempdima=\wd\jlreq at tempboxa\relax%
-      \jlreq at tempdimb=1\zw
-      \divide\jlreq at tempdima by \jlreq at tempdimb
+      \jlreq at tempdima=\wd\jlreq at tempboxa
+      \csname c@#1\endcsname=26
+      \setbox\jlreq at tempboxa=\hbox{#3}%
+      \ifdim\jlreq at tempdima<\wd\jlreq at tempboxa
+        \jlreq at tempdima=\wd\jlreq at tempboxa
+      \fi
+      % \numexprは四捨五入
+      \jlreq at tempdimb=\dimexpr\the\numexpr\jlreq at tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax
       \edef\jlreq at do{%
         \unexpanded{\def\jlreq at result}{%
-          \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\numexpr\jlreq at tempdima + 1\relax\noexpand\zw}}%
+          \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq at tempdimb}}%
         }%
       }%
     \expandafter\endgroup
@@ -1885,11 +1579,12 @@
         \expandonce{\jlreq at heading@clearpage}%
         \unexpanded{\if at restonecol\twocolumn\fi}%
       }%
-      \noexpand\def\expandonce{\csname #1\endcsname}{%
+      \noexpand\def\expandonce{\csname jlreq at headingcs@#1\endcsname}{%
         % 改丁.これでよいのかな.
         \unexpanded{\if at twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage}%
         \ifx\jlreq at pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq at pagestyle}}\fi
         \noexpand\secdef{\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq at TobiraHeading@start at s@#1\endcsname}}}%
+      \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq at headingcs@#1\endcsname}}%
     }%
   \expandafter\endgroup
   \jlreq at do
@@ -2407,7 +2102,7 @@
     \fi
     \edef\jlreq at do{%
       \expandonce{\jlreq at do}%
-      \noexpand\edef\expandonce{\csname #1\endcsname}{\noexpand\unexpanded{%
+      \noexpand\edef\expandonce{\csname jlreq at headingcs@#1\endcsname}{\noexpand\unexpanded{%
         \noexpand\jlreq at hook@beforeheadings{#1}%
         \expandonce{\jlreq at pagebreak}%
         \unexpanded{\jlreq at BlockHeading@start{#1}{#2}}%
@@ -2420,6 +2115,7 @@
         }%
         {\expandonce{\jlreq at totalformat}}%
       }}%
+      \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq at headingcs@#1\endcsname}}%
     }%
   \expandafter\endgroup
   \jlreq at do
@@ -2517,7 +2213,7 @@
     \fi
     \eappto\jlreq at tempb{%
       \noexpand\@ifundefined{jlreq at BlockHeading@spaces at setlist@\jlreq at headings}{}{%
-        \noexpand\ClassError{jlrqe}{The spaces for \jlreq at headings\space is multiplly defined (in SetBlockHeadingSpaces)}{\noexpand\@ehc}%
+        \noexpand\ClassError{jlrqe}{The spaces for \jlreq at headings\space is defined more than once (in SetBlockHeadingSpaces)}{\noexpand\@ehc}%
       }%
       \noexpand\def\expandonce{\csname jlreq at BlockHeading@spaces at setlist@\jlreq at headings\endcsname}{{\expandonce{\jlreq at totalset}}\expandonce{\jlreq at set}}%
     }%
@@ -2720,7 +2416,7 @@
         \unexpanded{{\setbox\jlreq at tempboxa\lastbox}}%
         \noexpand\begingroup
           \expandonce{\jlreq at tempa{#5}}%
-          \expandonce{\csname jlreq at heading@maketoc@#1\endcsname{#3}{#6}{#4}}%
+          \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{#3}{#6}{#4}%
         \noexpand\endgroup
       }%
     }%
@@ -3308,11 +3004,11 @@
   \ifthenelse{\equal{#1}{one}}{
     \long\def\jlreq at makefntext##1{\parindent 1\zw
       \addtolength{\leftskip}{\dimexpr\jlreq at footnoteindent + 1\zw\relax}% 全体をインデント+1文字分下げる
-      \noindent\hskip -1\zw\jlreq at referencemark@format{\@thefnmark}\hskip 1\zw##1}% 見出し出力と一文字分の空き
+      \noindent\hskip\glueexpr-1\zw\relax\jlreq at referencemark@format{\@thefnmark}\hskip\glueexpr1\zw\relax##1}% 見出し出力と一文字分の空き
   }{
     \long\def\jlreq at makefntext##1{\parindent 1\zw
       \addtolength{\leftskip}{\jlreq at footnoteindent}% 全体をインデント
-      \noindent\hskip 1\zw\jlreq at referencemark@format{\@thefnmark}\hskip 1\zw##1}% 見出し出力と一文字分の空き
+      \noindent\hskip\glueexpr1\zw\relax\jlreq at referencemark@format{\@thefnmark}\hskip\glueexpr1\zw\relax##1}% 見出し出力と一文字分の空き
   }
 }
 \jlreqsetup{footnotetext_indent=one}
@@ -3352,7 +3048,7 @@
   }{%
     \begingroup
       \csname c@\jlreq at endnotecounter\endcsname #1\relax
-      \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname \jlreq at endnotecounter\endcsname}%
+      \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
     \endgroup
   }%
   \@endnotemark
@@ -3365,7 +3061,7 @@
   }{%
     \begingroup
       \csname c@\jlreq at endnotecounter\endcsname #1\relax
-      \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname \jlreq at endnotecounter\endcsname}%
+      \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
     \endgroup
   }%
   \@endnotetext{#2}%
@@ -3416,7 +3112,7 @@
 \jlreq at endnote@indent=2\jlreq at mol
 % 二行目以降を全角分下げる(4.2.4.d:TODO: 選択できるべき)
 \newcommand{\@makeendtext}[1]{\parindent 1\jlreq at mol
-    \hskip-1\jlreq at mol\csname\jlreq at endnotemarkname\endcsname\hskip 1\jlreq at mol#1}% 見出し出力と一文字分の空き(4.2.4.c)
+    \hskip\glueexpr-1\jlreq at mol\relax\csname\jlreq at 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 at saveoriginalcs{\@begintheorem}
 \jlreq at saveoriginalcs{\@opargbegintheorem}



More information about the tex-live-commits mailing list