texlive[49375] Master/texmf-dist: jlreq (10dec18)

commits+karl at tug.org commits+karl at tug.org
Mon Dec 10 23:57:37 CET 2018


Revision: 49375
          http://tug.org/svn/texlive?view=revision&revision=49375
Author:   karl
Date:     2018-12-10 23:57:36 +0100 (Mon, 10 Dec 2018)
Log Message:
-----------
jlreq (10dec18)

Modified Paths:
--------------
    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-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/doc/latex/jlreq/jlreq.html
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
    trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md	2018-12-10 22:57:36 UTC (rev 49375)
@@ -122,23 +122,23 @@
 * `reference_mark=[inline/interlinear]`:合印の配置方法を指定します.`inline`にすると該当項目の後ろの行中に配置します.`interlinear`を指定すると該当項目の上(横組)または右(縦組)に配置します.
 * `footnote_second_indent=<寸法>`: 脚注(横書き時)または傍注(縦書き時)の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.
 * `sidenote_type=[number/symbol]`:傍注と本文との対応の方法を指定します.`number`が規定で,注の位置に通し番号が入り,それにより対応が示されます.`symbol`とすると,注の位置に特定の記号が入り,また注がついている単語が強調されます.
-* `sidenote_symbol=<記号>`:`sidenote_symbol=symbol`の時に,注の位置に入る記号.デフォルト*
-* `sidenote_keyword_font=<命令>`:`sidenote_symbol=symbol`の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)
+* `sidenote_symbol=<コード>`:`sidenote_symbol=symbol`の時に,注の位置に入る記号.デフォルト*
+* `sidenote_keyword_font=<コード>`:`sidenote_symbol=symbol`の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)
 * `endnote_second_indent=<寸法>`: 後柱の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.
 * `endnote_position=[headings/paragraph/{_<見出し名1>,_<見出し名2>,...}]`:後注の出力場所を指定します.`headings`は各見出しの直前(デフォルト),`paragraph`は改段落の際に出力します.また,`endnote_position={_chapter,_section}`とすると,`\chapter`と`\section`の直前に出力します.
 
 ### キャプション
 図表のキャプションを`\jlreqsetup`で変更できます.
-* `caption_font=<命令>`:キャプション自身のフォントを指定します.
-* `caption_label_font=<命令>`:キャプションのラベルのフォントを指定します.
+* `caption_font=<コード>`:キャプション自身のフォントを指定します.
+* `caption_label_font=<コード>`:キャプションのラベルのフォントを指定します.
 * `caption_after_label_space=<寸法>`:ラベルとキャプションの間の空きを指定します.
-* `caption_label_format=<書式>`:ラベルの書式を指定します.`caption_label_format={#1:}`のようにします.`#1`が「図1」のような番号に置換されます.
+* `caption_label_format=<コード>`:ラベルの書式を指定します.`caption_label_format={#1:}`のようにします.`#1`が「図1」のような番号に置換されます.
 * `caption_align=[{left/right/center/bottom/top/<環境名1>=<位置指定1>,<環境名2>=<位置指定2>,...}]`:キャプションの場所を指定します.`caption_align=left`のように指定します.`caption_align={center,table=right}`とすると,`table`のみ右,そのほかは中央配置となります.
 
 ### 引用
 `quote / quotation / verse`環境の挙動を`\jlreqsetup`で指定できます.
-* `quote_indent=<寸法>`:字下げを指定します.デフォルトは2zwです.一行の長さが文字サイズの整数倍になるように調整されます.
-* `quote_end_indent=<寸法>`:字上げを指定します.デフォルトは0zwです.
+* `quote_indent=<寸法>`:字下げを指定します.デフォルトは2\zwです.一行の長さが文字サイズの整数倍になるように調整されます.
+* `quote_end_indent=<寸法>`:字上げを指定します.デフォルトは0\zwです.
 * `quote_beforeafter_space=<寸法>`:前後の空きを指定します.`quote_beforeafter_space=1\baselineskip`とすると一行あきます.
 * `quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]`:フォントサイズを指定します.
 
@@ -151,37 +151,58 @@
 `\jlreqsetup`で指定します.
 * `theorem_beforeafter_space=<寸法>`:定理環境の前後の空きを指定します.
 
+### 前付きなど
+`\fontmatter` / `\mainmatter` / `\backmatter` / `\appendix`での処理を`\jlreqsetup`で指定できます.
+* `frontmatter_pagebreak=[cleardoublepage/clearpage/]`:`\frontmatter`実行時の改ページを実行する命令名を指定します.空にすると何もしません.
+* `frontmatter_counter={<カウンタ名>={value=<値>, the=<コード>, restore=[true/false]},...}`:`\frontmatter`時でのカウンタの操作を指定します.例えば`chapter={value=0,the={[\arabic{chapter]}}`とすると,`chapter`カウンタの値が`0`になり,`\thechapter`が`[\arabic{chapter}]`となります.デフォルトでは`\mainmatter`時に値と`\the<カウンタ名>`の定義を戻しますが,`restore=false`とするとこの動きが抑制されます.
+* `frontmatter_heading={<見出し命令名>={<設定>},...}`:見出し命令の動きを変更します.`\Delare***Heading`で指定できる項目の他以下を受け付けます.
+    - `heading_type=[Tobira/Block/Runin/Cutin/Modify]`:見出しの種類です.`Modify`が指定された場合は`\ModifyHeading`での変更となります.
+    - `heading_level=<数値>`:見出し命令のレベルを設定します.指定されなかった場合は,`\frontmatter`実行時の値が使われます.`heading_type=Modify`の時は無視されます.
+    - `restore=[true/false]`:`true`が指定されると,`\mainmatter`で元の定義を復帰します.デフォルトは`true`です.
+* `frontmatter_pagestyle={<ページスタイル名>[,restore=[true/false]]}`:`\frontmatter`実行時にここで指定されたページスタイルへと切り替えます.デフォルトでは`\mainmatter`時にもとのページスタイルに戻しますが,`restore=false`を指定すると戻しません.
+* `frontmatter_pagination={<ページ番号指定>[,continuous,independent]}`:ページ番号の出力形式を,`frontmatter_pagination=roman`のようにLaTeXの命令名で指定します.更に`continuous`が指定されると通しノンブルとなります.`independent`で別ノンブルです.
+* `frontmatter_precode=<コード>`:`\frontmatter`時に最初に実行されるコードです.
+* `frontmatter_postcode=<コード>`:`\frontmatter`時に最後に実行されるコードです.
+
+`frontmatter`を`mainmatter`や`backmatter`,`appendix`へと変えた設定も存在します.ただし,以下のような違いがあります.
+* `restore=[true/false]`は無効な設定です.
+* `mainmatter_pagination`に`continuous`と`independent`は指定できません.
+* `appendix_pagebreak`,`appendix_pagestyle`,`appendix_pagination`はありません.
+
+
 ## 見出し
-見出しの設定は,`\Declare***Heading`という命令で行います(***には見出しの種類に応じた文字列が入る).書式はすべて
+新しい見出しを`\New***Heading`という命令で作ることができます(***には見出しの種類に応じた文字列が入る).書式はすべて
 
 ```
-\Declare***Heading{<命令名>}{<レベル>}{<設定>}
+\New***Heading{<命令名>}{<レベル>}{<設定>}
 ```
 
-となっています.また,`\New***Heading`,`\Renew***Heading`,`\Provide***Heading`も同時に用意されます.それぞれ
+となっています.また,`\Renew***Heading`,`\Provide***Heading`,`\Declare***Heading`も同時に用意されます.それぞれ
 
-* `\New***Heading`:指定した名前の命令が既に定義されている場合はエラー.
 * `\Renew***Heading`:指定した名前の命令が定義されていなければエラー.
 * `\Provide***Heading`:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.
+* `\Declare***Heading`:指定した名前の命令が定義されているか否かによらず新しく見出し命令を定義する.
 
 となっています.
 
 ### 扉見出し
-`\DeclareTobiraHeading`で作成します.通常のクラスファイルにおける`\section`等と同じ書式の命令ができます.設定は以下の通り.
+`\NewTobiraHeading`で作成します.通常のクラスファイルにおける`\section`等と同じ書式の命令ができます.設定は以下の通り.
 
 * `type=[han/naka]`:`han`だと半扉見出しを,`naka`だと中扉見出しを作ります.
-* `pagestyle=<ページスタイル>`:見出し箇所のページスタイルを指定します.
-* `label_format=<書式>`:ラベルを出力する命令を指定します.たとえば`label_format={第\thechapter 章}`のように指定します.
-* `format=<書式>`:実際に出力する書式を指定します.`format={\null\vfil {\Huge\bfseries #1#2}}`のようにします.`#1`はラベルに,`#2`は見出し文字列に置き換えられます.
+* `pagestyle=<ページスタイル名>`:見出し箇所のページスタイルを指定します.
+* `label_format=<コード>`:ラベルを出力する命令を指定します.たとえば`label_format={第\thechapter 章}`のように指定します.
+* `format=<コード>`:実際に出力する書式を指定します.`format={\null\vfil {\Huge\bfseries #1#2}}`のようにします.`#1`はラベルに,`#2`は見出し文字列に置き換えられます.この中では`\jlreqHeadingLabel`,`\jlreqHeadingText`という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば`format={[\jlreqHeadingLabel{Label=#1}]}`と指定されていれば,ラベルが空でない時には`[Label=<ラベル>]`を,そうでなければ`[]`を出力します.
+* `number=[true/false]':採番を行うかを指定します.ただし,`number=false`の場合でも対応するカウンタは定義されます.また`\the<カウンタ名>`の変更もされないので,必要ならば再定義が必要になります.
 
 ### 別行見出し
-`\DeclareBlockHeading`で作成します.`\<命令名>*[running head]{見出し文字列}[副題]`という書式の命令を作成します.設定は以下の通り.
+`\NewBlockHeading`で作成します.`\<命令名>*[running head]{見出し文字列}[副題]`という書式の命令を作成します.設定は以下の通り.
 
 #### 書式関連
-* `font=<命令>`:見出しのフォントを指定します.
-* `subtitle_font=<命令>`:副題のフォントを指定します.
-* `label_format=<命令>`:ラベルのフォーマットを指定します.`label_format={第\thechapter 章}`などのようにします.
-* `subtitle_format=<命令>`:副題のフォーマットを指定します.`subtitle_format={「#1」}`のようにします.`#1`が副題自身になります.
+* `font=<コード>`:見出しのフォントを指定します.
+* `subtitle_font=<コード>`:副題のフォントを指定します.
+* `label_format=<コード>`:ラベルのフォーマットを指定します.`label_format={第\thechapter 章}`などのようにします.
+* `subtitle_format=<コード>`:副題のフォーマットを指定します.`subtitle_format={「#1」}`のようにします.`#1`は副題自身に置き換えられます.
+* `format=<コード>`:見出し全体のフォーマットを指定します.`#1`がラベル,`#2`が見出し文字列,`#3`が副題に置き換えられます.内部では`\jlreqHeadingLabel`,`\jlreqHeadingText`,`\jlreqHeadingSubtitle`という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列,副題が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば`format={[\jlreqHeadingLabel{Label=#1}]}`と指定されていれば,ラベルが空でない時には`[Label=<ラベル>]`を,そうでなければ`[]`を出力します.
 
 #### インデント関連
 * `align=[left/center/right]`:見出し位置の横方向の配置場所を指定します.
@@ -188,8 +209,8 @@
 * `indent=<寸法>`:見出し全体の字下げ量を指定します.
 * `end_indent=<寸法>`:見出し全体の字上げ量を指定します.
 * `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
-* `second_heading_text_indent=[<寸法>/{<寸法>,<寸法>}]`:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,`second_heading_text_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.(ラベルがない時は一行目の頭が起点.)また,`second_heading_text_indent={<ラベルがある時>,<ラベルがない時>}`という指定をすると,ラベルの有無に応じて値を変更することができます.`<ラベルがある時>`の指定ではやはり`*`を使うことができます.
-* `subtitle_indent=<寸法>`:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.
+* `second_heading_text_indent=[<寸法>/{<寸法>,<寸法>}]`:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,`second_heading_text_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.また,`second_heading_text_indent={<ラベルがある時>,<ラベルがない時>}`という指定をすると,ラベルの有無に応じて値を変更することができます.`<ラベルがある時>`の指定ではやはり`*`を使うことができます.
+* `subtitle_indent=<寸法>`:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.ただし,`subtitle_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.`subtitle_indent=true`の時のみ有効です.
 
 #### その他
 * `subtitle_break=[true/false]`:見出し文字列と副題の間を改行するか指定します.
@@ -197,6 +218,7 @@
 * `pagebreak=[clearpage/cleardoublepage/clearcolumn/nariyuki/begin_with_odd_page/begin_with_even_page]`:見出し直前の改ページを指定します.それぞれ,改ページ,`\cleardoublepage`実行,改段,なりゆき,奇数ページ開始,偶数ページ開始,です.
 * `afterindent=[true/false]`:見出し直後の段落の字下げを行うかを指定します.
 * `column_spanning=[true/false]`: 段抜きの見出しにします.`pagebreak=nariyuki`または`pagebreak=clearcolumn`の時には無視されます.
+* `number=[true/false]':採番を行うかを指定します.`\NewTobiraHeading`と同様の注意が必要です.
 
 #### 行取り
 行取りの指定は以下のいずれかの方法で行うことができます.
@@ -232,15 +254,16 @@
 なお,見出しが連続しているかは単純に別行見出しの命令が並んで書かれているかのみで判断します.従ってそれらの命令間に出力には関係しないような命令が挟まっていたとしても,見出しが連続して掲げられているとは判断されません.ただし,見出し命令の間に空白,改行または`\label[<オプション>]{<引数>}…{<引数>}`という形のもののみが挟まれている場合は,見出しが連続していると判断されます.
 
 ### 同行見出し
-`\DeclareRuninHeading`で作成します.通常の文書クラスにおける`\section`と同様の,`\<命令名>*[running head]{見出し文字列}`という書式の命令が作成されます.設定は以下の通り.
+`\NewRuninHeading`で作成します.通常の文書クラスにおける`\section`と同様の,`\<命令名>*[running head]{見出し文字列}`という書式の命令が作成されます.設定は以下の通り.
 
 * `font=<命令>`:見出しのフォントを指定します.
 * `indent=<寸法>` 見出し文字列全体の字下げ量を指定します.
 * `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
 * `label_format=<命令>`:ラベルのフォーマットを指定します.`label_format={\theparagraph}`などのようにします.
+* `number=[true/false]':採番を行うかを指定します.`\NewTobiraHeading`と同様の注意が必要です.
 
 ### 窓見出し
-`\DeclareCutinHeading`で作成します.`\<命令名>{見出し文字列}`という書式の命令を作成します.設定は以下の通り.
+`\NewCutinHeading`で作成します.`\<命令名>{見出し文字列}`という書式の命令を作成します.設定は以下の通り.
 
 * `font=<命令>`:見出しのフォントを指定します.
 * `indent=<寸法>`:見出し全体の字下げ量を指定します.
@@ -266,7 +289,7 @@
 
 ## ページスタイル
 ```
-\DeclarePageStyle{<ページスタイル名>}{<設定>}
+\NewPageStyle{<ページスタイル名>}{<設定>}
 ```
 によりページスタイルを定義することができます.`<設定>`はkeyval形式です.定義したページスタイルは`\pagestyle`で適用できます.設定は以下の通り.
 
@@ -274,7 +297,7 @@
 * `tate`:縦書きで小口側に出力します.
 * `font=<命令>`:柱とノンブルのフォントを指定します.
 * `running_head_position`, `nombre_position`:柱とノンブルの位置を指定します.`yoko`か`tate`のどちらが指定されているかで指定方法が変わります.
-    - `yoko`指定時:`top-left`のように指定できます.`top / bottom / center / left / right / gutter / fore_edge`が使えます.`gutter`はのど,`fore_edge`は小口です.`left`,`right`の指定は奇数ページに対するものです.`twoside`が指定されている場合,偶数ページはその逆になります.
+    - `yoko`指定時:`top-left`のように指定できます.`top / bottom / center / left / right / gutter / fore-edge`が使えます.`gutter`はのど,`fore-edge`は小口です.`left`,`right`の指定は奇数ページに対するものです.`twoside`が指定されている場合,偶数ページはその逆になります.
     - `tate`指定時:`<寸法>`が指定できます.`running_head_position`は柱の天からの下げ量を,`nombre_position`はノンブルの地からの上げ量を指定します.
 * `nombre=<書式>`:出力するノンブルを指定します.デフォルトは`\thepage`.
 * `odd_running_head=<書式>`,`even_running_head=<書式>`:それぞれ奇数ページ,偶数ページの柱を指定します.`_section`のように`_`から始まる名前を指定すると,対応する見出しを出力します.(`_section`だと現在の`\section`を出力する.)
@@ -282,7 +305,7 @@
 * `nombre_ii=<書式>`: 二つ目のノンブルを指定します.`nombre_ii_position`で場所指定もできます.指定方法は`nombre`や`nombre_position`と同じです.`odd_running_head_ii`,`even_running_head_ii`,`running_head_ii_position`もあります.`nombre_ii_position`や`running_head_ii_position`が指定されなかった場合,`yoko`指定時にはそれぞれ`nombre_position`および`running_head_position`と同じ位置に設定されます.`tate`指定時は一つ目のノンブルや柱に続く場所に表示されます.
 
 
-`\NewPageStyle`,`\RenewPageStyle`,`\ProvidePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です.
+`\RenewPageStyle`,`\ProvidePageStyle`,`\DeclarePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です.
 
 ## JFM
 以下のような独自のJFMを使います.パッケージによっては,パッケージ独自のJFMや,また標準のJFMを使うように設定がし直される場合があります.例えばLuaTeX-jaに付属するluatexja-presetパッケージは通常LuaTeX-ja標準のJFMを使います.本クラスファイルで使っているJFMを使う場合は,
@@ -398,6 +421,11 @@
 * 2018-09-01
     - `\mag`が`1000`でない場合も動くようにした(つもり).
     - バグ修正.
+* 2018-12-10
+    - 見出し命令を作る命令に`number=[true/false]`を追加.
+    - `\frontmatter`等の挙動を設定できるようにした.
+    - `\jlreqHeadingLabel`等を扉見出しと別行見出しの`format`内で使えるようにした.
+    - バグ修正
 
 
 --------------

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README.md	2018-12-10 22:57:36 UTC (rev 49375)
@@ -4,14 +4,14 @@
 This package provides the class file and JFM (Japanese font metric) files for LuaTeX-ja / pLaTeX / upLaTeX. This aims to implement [Requirements for Japanese Text Layout](https://www.w3.org/TR/jlreq/).
 
 ## Installation
-Run `make`, then JFM files are created. Move the files as follows:
+Run `make` to generate JFM files. Move the files as follows:
 
 * *.tfm -> $TEXMF/fonts/tfm/public/jlreq
 * *.vf -> $TEXMF/fonts/vf/public/jlreq
-* jfm-jlreq.lua jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq
+* jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq
 * jlreq.cls, jlreq-helpers.sty  -> $TEXMF/tex/latex/jlreq
 
-`make install` will do this where $TEXMF=$TEXMFHOME
+The other way to install is just to run `make install`. It will install all files in `$TEXMFHOME`.
 
 ## Usage
 See [README-ja.md](README-ja.md) (in Japanese).
@@ -96,7 +96,13 @@
 * 2018-09-01
     - jlreq works with unusual `\mag`.
     - Fixed bugs.
+* 2018-12-10
+    - Added `number=[true/false]` to `\New***Heading`.
+    - Added options for `\frontmatter` etc in `\jlreqsetup`.
+    - Made `\jlreqHeadingLabel` etc available in `format` in `\NewTobiraHeading` and `\NewBlockHeading`.
+    - 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-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html	2018-12-10 22:57:36 UTC (rev 49375)
@@ -185,8 +185,8 @@
 <li><code>reference_mark=[inline/interlinear]</code>:合印の配置方法を指定します.<code>inline</code>にすると該当項目の後ろの行中に配置します.<code>interlinear</code>を指定すると該当項目の上(横組)または右(縦組)に配置します.</li>
 <li><code>footnote_second_indent=<寸法></code>: 脚注(横書き時)または傍注(縦書き時)の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.</li>
 <li><code>sidenote_type=[number/symbol]</code>:傍注と本文との対応の方法を指定します.<code>number</code>が規定で,注の位置に通し番号が入り,それにより対応が示されます.<code>symbol</code>とすると,注の位置に特定の記号が入り,また注がついている単語が強調されます.</li>
-<li><code>sidenote_symbol=<記号></code>:<code>sidenote_symbol=symbol</code>の時に,注の位置に入る記号.デフォルト*</li>
-<li><code>sidenote_keyword_font=<命令></code>:<code>sidenote_symbol=symbol</code>の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)</li>
+<li><code>sidenote_symbol=<コード></code>:<code>sidenote_symbol=symbol</code>の時に,注の位置に入る記号.デフォルト*</li>
+<li><code>sidenote_keyword_font=<コード></code>:<code>sidenote_symbol=symbol</code>の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)</li>
 <li><code>endnote_second_indent=<寸法></code>: 後柱の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.</li>
 <li><code>endnote_position=[headings/paragraph/{_<見出し名1>,_<見出し名2>,...}]</code>:後注の出力場所を指定します.<code>headings</code>は各見出しの直前(デフォルト),<code>paragraph</code>は改段落の際に出力します.また,<code>endnote_position={_chapter,_section}</code>とすると,<code>\chapter</code>と<code>\section</code>の直前に出力します.</li>
 </ul>
@@ -193,17 +193,17 @@
 <h3 id="キャプション">キャプション</h3>
 <p>図表のキャプションを<code>\jlreqsetup</code>で変更できます.</p>
 <ul>
-<li><code>caption_font=<命令></code>:キャプション自身のフォントを指定します.</li>
-<li><code>caption_label_font=<命令></code>:キャプションのラベルのフォントを指定します.</li>
+<li><code>caption_font=<コード></code>:キャプション自身のフォントを指定します.</li>
+<li><code>caption_label_font=<コード></code>:キャプションのラベルのフォントを指定します.</li>
 <li><code>caption_after_label_space=<寸法></code>:ラベルとキャプションの間の空きを指定します.</li>
-<li><code>caption_label_format=<書式></code>:ラベルの書式を指定します.<code>caption_label_format={#1:}</code>のようにします.<code>#1</code>が「図1」のような番号に置換されます.</li>
+<li><code>caption_label_format=<コード></code>:ラベルの書式を指定します.<code>caption_label_format={#1:}</code>のようにします.<code>#1</code>が「図1」のような番号に置換されます.</li>
 <li><code>caption_align=[{left/right/center/bottom/top/<環境名1>=<位置指定1>,<環境名2>=<位置指定2>,...}]</code>:キャプションの場所を指定します.<code>caption_align=left</code>のように指定します.<code>caption_align={center,table=right}</code>とすると,<code>table</code>のみ右,そのほかは中央配置となります.</li>
 </ul>
 <h3 id="引用">引用</h3>
 <p><code>quote / quotation / verse</code>環境の挙動を<code>\jlreqsetup</code>で指定できます.</p>
 <ul>
-<li><code>quote_indent=<寸法></code>:字下げを指定します.デフォルトは2zwです.一行の長さが文字サイズの整数倍になるように調整されます.</li>
-<li><code>quote_end_indent=<寸法></code>:字上げを指定します.デフォルトは0zwです.</li>
+<li><code>quote_indent=<寸法></code>:字下げを指定します.デフォルトは2\zwです.一行の長さが文字サイズの整数倍になるように調整されます.</li>
+<li><code>quote_end_indent=<寸法></code>:字上げを指定します.デフォルトは0\zwです.</li>
 <li><code>quote_beforeafter_space=<寸法></code>:前後の空きを指定します.<code>quote_beforeafter_space=1\baselineskip</code>とすると一行あきます.</li>
 <li><code>quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]</code>:フォントサイズを指定します.</li>
 </ul>
@@ -218,33 +218,57 @@
 <ul>
 <li><code>theorem_beforeafter_space=<寸法></code>:定理環境の前後の空きを指定します.</li>
 </ul>
+<h3 id="前付きなど">前付きなど</h3>
+<p><code>\fontmatter</code> / <code>\mainmatter</code> / <code>\backmatter</code> / <code>\appendix</code>での処理を<code>\jlreqsetup</code>で指定できます.</p>
+<ul>
+<li><code>frontmatter_pagebreak=[cleardoublepage/clearpage/]</code>:<code>\frontmatter</code>実行時の改ページを実行する命令名を指定します.空にすると何もしません.</li>
+<li><code>frontmatter_counter={<カウンタ名>={value=<値>, the=<コード>, restore=[true/false]},...}</code>:<code>\frontmatter</code>時でのカウンタの操作を指定します.例えば<code>chapter={value=0,the={[\arabic{chapter]}}</code>とすると,<code>chapter</code>カウンタの値が<code>0</code>になり,<code>\thechapter</code>が<code>[\arabic{chapter}]</code>となります.デフォルトでは<code>\mainmatter</code>時に値と<code>\the<カウンタ名></code>の定義を戻しますが,<code>restore=false</code>とするとこの動きが抑制されます.</li>
+<li><code>frontmatter_heading={<見出し命令名>={<設定>},...}</code>:見出し命令の動きを変更します.<code>\Delare***Heading</code>で指定できる項目の他以下を受け付けます.
+<ul>
+<li><code>heading_type=[Tobira/Block/Runin/Cutin/Modify]</code>:見出しの種類です.<code>Modify</code>が指定された場合は<code>\ModifyHeading</code>での変更となります.</li>
+<li><code>heading_level=<数値></code>:見出し命令のレベルを設定します.指定されなかった場合は,<code>\frontmatter</code>実行時の値が使われます.<code>heading_type=Modify</code>の時は無視されます.</li>
+<li><code>restore=[true/false]</code>:<code>true</code>が指定されると,<code>\mainmatter</code>で元の定義を復帰します.デフォルトは<code>true</code>です.</li>
+</ul></li>
+<li><code>frontmatter_pagestyle={<ページスタイル名>[,restore=[true/false]]}</code>:<code>\frontmatter</code>実行時にここで指定されたページスタイルへと切り替えます.デフォルトでは<code>\mainmatter</code>時にもとのページスタイルに戻しますが,<code>restore=false</code>を指定すると戻しません.</li>
+<li><code>frontmatter_pagination={<ページ番号指定>[,continuous,independent]}</code>:ページ番号の出力形式を,<code>frontmatter_pagination=roman</code>のようにLaTeXの命令名で指定します.更に<code>continuous</code>が指定されると通しノンブルとなります.<code>independent</code>で別ノンブルです.</li>
+<li><code>frontmatter_precode=<コード></code>:<code>\frontmatter</code>時に最初に実行されるコードです.</li>
+<li><code>frontmatter_postcode=<コード></code>:<code>\frontmatter</code>時に最後に実行されるコードです.</li>
+</ul>
+<p><code>frontmatter</code>を<code>mainmatter</code>や<code>backmatter</code>,<code>appendix</code>へと変えた設定も存在します.ただし,以下のような違いがあります.</p>
+<ul>
+<li><code>restore=[true/false]</code>は無効な設定です.</li>
+<li><code>mainmatter_pagination</code>に<code>continuous</code>と<code>independent</code>は指定できません.</li>
+<li><code>appendix_pagebreak</code>,<code>appendix_pagestyle</code>,<code>appendix_pagination</code>はありません.</li>
+</ul>
 <h2 id="見出し">見出し</h2>
-<p>見出しの設定は,<code>\Declare***Heading</code>という命令で行います(***には見出しの種類に応じた文字列が入る).書式はすべて</p>
-<pre><code>\Declare***Heading{<命令名>}{<レベル>}{<設定>}
+<p>新しい見出しを<code>\New***Heading</code>という命令で作ることができます(***には見出しの種類に応じた文字列が入る).書式はすべて</p>
+<pre><code>\New***Heading{<命令名>}{<レベル>}{<設定>}
 </code></pre>
-<p>となっています.また,<code>\New***Heading</code>,<code>\Renew***Heading</code>,<code>\Provide***Heading</code>も同時に用意されます.それぞれ</p>
+<p>となっています.また,<code>\Renew***Heading</code>,<code>\Provide***Heading</code>,<code>\Declare***Heading</code>も同時に用意されます.それぞれ</p>
 <ul>
-<li><code>\New***Heading</code>:指定した名前の命令が既に定義されている場合はエラー.</li>
 <li><code>\Renew***Heading</code>:指定した名前の命令が定義されていなければエラー.</li>
 <li><code>\Provide***Heading</code>:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.</li>
+<li><code>\Declare***Heading</code>:指定した名前の命令が定義されているか否かによらず新しく見出し命令を定義する.</li>
 </ul>
 <p>となっています.</p>
 <h3 id="扉見出し">扉見出し</h3>
-<p><code>\DeclareTobiraHeading</code>で作成します.通常のクラスファイルにおける<code>\section</code>等と同じ書式の命令ができます.設定は以下の通り.</p>
+<p><code>\NewTobiraHeading</code>で作成します.通常のクラスファイルにおける<code>\section</code>等と同じ書式の命令ができます.設定は以下の通り.</p>
 <ul>
 <li><code>type=[han/naka]</code>:<code>han</code>だと半扉見出しを,<code>naka</code>だと中扉見出しを作ります.</li>
-<li><code>pagestyle=<ページスタイル></code>:見出し箇所のページスタイルを指定します.</li>
-<li><code>label_format=<書式></code>:ラベルを出力する命令を指定します.たとえば<code>label_format={第\thechapter 章}</code>のように指定します.</li>
-<li><code>format=<書式></code>:実際に出力する書式を指定します.<code>format={\null\vfil {\Huge\bfseries #1#2}}</code>のようにします.<code>#1</code>はラベルに,<code>#2</code>は見出し文字列に置き換えられます.</li>
+<li><code>pagestyle=<ページスタイル名></code>:見出し箇所のページスタイルを指定します.</li>
+<li><code>label_format=<コード></code>:ラベルを出力する命令を指定します.たとえば<code>label_format={第\thechapter 章}</code>のように指定します.</li>
+<li><code>format=<コード></code>:実際に出力する書式を指定します.<code>format={\null\vfil {\Huge\bfseries #1#2}}</code>のようにします.<code>#1</code>はラベルに,<code>#2</code>は見出し文字列に置き換えられます.この中では<code>\jlreqHeadingLabel</code>,<code>\jlreqHeadingText</code>という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば<code>format={[\jlreqHeadingLabel{Label=#1}]}</code>と指定されていれば,ラベルが空でない時には<code>[Label=<ラベル>]</code>を,そうでなければ<code>[]</code>を出力します.</li>
+<li><code>number=[true/false]':採番を行うかを指定します.ただし,</code>number=false<code>の場合でも対応するカウンタは定義されます.また</code>\the<カウンタ名>`の変更もされないので,必要ならば再定義が必要になります.</li>
 </ul>
 <h3 id="別行見出し">別行見出し</h3>
-<p><code>\DeclareBlockHeading</code>で作成します.<code>\<命令名>*[running head]{見出し文字列}[副題]</code>という書式の命令を作成します.設定は以下の通り.</p>
+<p><code>\NewBlockHeading</code>で作成します.<code>\<命令名>*[running head]{見出し文字列}[副題]</code>という書式の命令を作成します.設定は以下の通り.</p>
 <h4 id="書式関連">書式関連</h4>
 <ul>
-<li><code>font=<命令></code>:見出しのフォントを指定します.</li>
-<li><code>subtitle_font=<命令></code>:副題のフォントを指定します.</li>
-<li><code>label_format=<命令></code>:ラベルのフォーマットを指定します.<code>label_format={第\thechapter 章}</code>などのようにします.</li>
-<li><code>subtitle_format=<命令></code>:副題のフォーマットを指定します.<code>subtitle_format={「#1」}</code>のようにします.<code>#1</code>が副題自身になります.</li>
+<li><code>font=<コード></code>:見出しのフォントを指定します.</li>
+<li><code>subtitle_font=<コード></code>:副題のフォントを指定します.</li>
+<li><code>label_format=<コード></code>:ラベルのフォーマットを指定します.<code>label_format={第\thechapter 章}</code>などのようにします.</li>
+<li><code>subtitle_format=<コード></code>:副題のフォーマットを指定します.<code>subtitle_format={「#1」}</code>のようにします.<code>#1</code>は副題自身に置き換えられます.</li>
+<li><code>format=<コード></code>:見出し全体のフォーマットを指定します.<code>#1</code>がラベル,<code>#2</code>が見出し文字列,<code>#3</code>が副題に置き換えられます.内部では<code>\jlreqHeadingLabel</code>,<code>\jlreqHeadingText</code>,<code>\jlreqHeadingSubtitle</code>という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列,副題が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば<code>format={[\jlreqHeadingLabel{Label=#1}]}</code>と指定されていれば,ラベルが空でない時には<code>[Label=<ラベル>]</code>を,そうでなければ<code>[]</code>を出力します.</li>
 </ul>
 <h4 id="インデント関連">インデント関連</h4>
 <ul>
@@ -252,8 +276,8 @@
 <li><code>indent=<寸法></code>:見出し全体の字下げ量を指定します.</li>
 <li><code>end_indent=<寸法></code>:見出し全体の字上げ量を指定します.</li>
 <li><code>after_label_space=<寸法></code>:ラベル後,見出し文字列までの空きを指定します.</li>
-<li><code>second_heading_text_indent=[<寸法>/{<寸法>,<寸法>}]</code>:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,<code>second_heading_text_indent=*1\zw</code>のように先頭に<code>*</code>をつけるとラベルの頭を起点としての指定になります.(ラベルがない時は一行目の頭が起点.)また,<code>second_heading_text_indent={<ラベルがある時>,<ラベルがない時>}</code>という指定をすると,ラベルの有無に応じて値を変更することができます.<code><ラベルがある時></code>の指定ではやはり<code>*</code>を使うことができます.</li>
-<li><code>subtitle_indent=<寸法></code>:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.</li>
+<li><code>second_heading_text_indent=[<寸法>/{<寸法>,<寸法>}]</code>:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,<code>second_heading_text_indent=*1\zw</code>のように先頭に<code>*</code>をつけるとラベルの頭を起点としての指定になります.また,<code>second_heading_text_indent={<ラベルがある時>,<ラベルがない時>}</code>という指定をすると,ラベルの有無に応じて値を変更することができます.<code><ラベルがある時></code>の指定ではやはり<code>*</code>を使うことができます.</li>
+<li><code>subtitle_indent=<寸法></code>:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.ただし,<code>subtitle_indent=*1\zw</code>のように先頭に<code>*</code>をつけるとラベルの頭を起点としての指定になります.<code>subtitle_indent=true</code>の時のみ有効です.</li>
 </ul>
 <h4 id="その他-1">その他</h4>
 <ul>
@@ -262,6 +286,7 @@
 <li><code>pagebreak=[clearpage/cleardoublepage/clearcolumn/nariyuki/begin_with_odd_page/begin_with_even_page]</code>:見出し直前の改ページを指定します.それぞれ,改ページ,<code>\cleardoublepage</code>実行,改段,なりゆき,奇数ページ開始,偶数ページ開始,です.</li>
 <li><code>afterindent=[true/false]</code>:見出し直後の段落の字下げを行うかを指定します.</li>
 <li><code>column_spanning=[true/false]</code>: 段抜きの見出しにします.<code>pagebreak=nariyuki</code>または<code>pagebreak=clearcolumn</code>の時には無視されます.</li>
+<li><code>number=[true/false]':採番を行うかを指定します.</code>\NewTobiraHeading`と同様の注意が必要です.</li>
 </ul>
 <h4 id="行取り">行取り</h4>
 <p>行取りの指定は以下のいずれかの方法で行うことができます.</p>
@@ -292,15 +317,16 @@
 </ul>
 <p>なお,見出しが連続しているかは単純に別行見出しの命令が並んで書かれているかのみで判断します.従ってそれらの命令間に出力には関係しないような命令が挟まっていたとしても,見出しが連続して掲げられているとは判断されません.ただし,見出し命令の間に空白,改行または<code>\label[<オプション>]{<引数>}…{<引数>}</code>という形のもののみが挟まれている場合は,見出しが連続していると判断されます.</p>
 <h3 id="同行見出し">同行見出し</h3>
-<p><code>\DeclareRuninHeading</code>で作成します.通常の文書クラスにおける<code>\section</code>と同様の,<code>\<命令名>*[running head]{見出し文字列}</code>という書式の命令が作成されます.設定は以下の通り.</p>
+<p><code>\NewRuninHeading</code>で作成します.通常の文書クラスにおける<code>\section</code>と同様の,<code>\<命令名>*[running head]{見出し文字列}</code>という書式の命令が作成されます.設定は以下の通り.</p>
 <ul>
 <li><code>font=<命令></code>:見出しのフォントを指定します.</li>
 <li><code>indent=<寸法></code> 見出し文字列全体の字下げ量を指定します.</li>
 <li><code>after_label_space=<寸法></code>:ラベル後,見出し文字列までの空きを指定します.</li>
 <li><code>label_format=<命令></code>:ラベルのフォーマットを指定します.<code>label_format={\theparagraph}</code>などのようにします.</li>
+<li><code>number=[true/false]':採番を行うかを指定します.</code>\NewTobiraHeading`と同様の注意が必要です.</li>
 </ul>
 <h3 id="窓見出し">窓見出し</h3>
-<p><code>\DeclareCutinHeading</code>で作成します.<code>\<命令名>{見出し文字列}</code>という書式の命令を作成します.設定は以下の通り.</p>
+<p><code>\NewCutinHeading</code>で作成します.<code>\<命令名>{見出し文字列}</code>という書式の命令を作成します.設定は以下の通り.</p>
 <ul>
 <li><code>font=<命令></code>:見出しのフォントを指定します.</li>
 <li><code>indent=<寸法></code>:見出し全体の字下げ量を指定します.</li>
@@ -319,7 +345,7 @@
 <a class="sourceLine" id="cb9-4" data-line-number="4"><span class="fu">\restoresection</span> <span class="co">% \sectionの中身を元に戻す.</span></a></code></pre>
 <p>のように使います.</p>
 <h2 id="ページスタイル">ページスタイル</h2>
-<pre><code>\DeclarePageStyle{<ページスタイル名>}{<設定>}
+<pre><code>\NewPageStyle{<ページスタイル名>}{<設定>}
 </code></pre>
 <p>によりページスタイルを定義することができます.<code><設定></code>はkeyval形式です.定義したページスタイルは<code>\pagestyle</code>で適用できます.設定は以下の通り.</p>
 <ul>
@@ -328,7 +354,7 @@
 <li><code>font=<命令></code>:柱とノンブルのフォントを指定します.</li>
 <li><code>running_head_position</code>, <code>nombre_position</code>:柱とノンブルの位置を指定します.<code>yoko</code>か<code>tate</code>のどちらが指定されているかで指定方法が変わります.
 <ul>
-<li><code>yoko</code>指定時:<code>top-left</code>のように指定できます.<code>top / bottom / center / left / right / gutter / fore_edge</code>が使えます.<code>gutter</code>はのど,<code>fore_edge</code>は小口です.<code>left</code>,<code>right</code>の指定は奇数ページに対するものです.<code>twoside</code>が指定されている場合,偶数ページはその逆になります.</li>
+<li><code>yoko</code>指定時:<code>top-left</code>のように指定できます.<code>top / bottom / center / left / right / gutter / fore-edge</code>が使えます.<code>gutter</code>はのど,<code>fore-edge</code>は小口です.<code>left</code>,<code>right</code>の指定は奇数ページに対するものです.<code>twoside</code>が指定されている場合,偶数ページはその逆になります.</li>
 <li><code>tate</code>指定時:<code><寸法></code>が指定できます.<code>running_head_position</code>は柱の天からの下げ量を,<code>nombre_position</code>はノンブルの地からの上げ量を指定します.</li>
 </ul></li>
 <li><code>nombre=<書式></code>:出力するノンブルを指定します.デフォルトは<code>\thepage</code>.</li>
@@ -336,7 +362,7 @@
 <li><code>mark_format={[odd=<書式>/even=<書式>/_<見出し命令名>=<書式>],...}</code>:見出しを柱に出力する際のフォーマットを指定します.<code>mark_format={_section={節\thesection:#1},_chapter={第\thechapter 章\quad #1}}</code>のように指定します.見出し命令名の代わりに<code>odd</code>や<code>even</code>も指定でき,それぞれ奇数ページ/偶数ページの柱の書式になります.<code>\pagestyle</code>実行時に<code>\sectionmark</code>等を定義することで実現しています.</li>
 <li><code>nombre_ii=<書式></code>: 二つ目のノンブルを指定します.<code>nombre_ii_position</code>で場所指定もできます.指定方法は<code>nombre</code>や<code>nombre_position</code>と同じです.<code>odd_running_head_ii</code>,<code>even_running_head_ii</code>,<code>running_head_ii_position</code>もあります.<code>nombre_ii_position</code>や<code>running_head_ii_position</code>が指定されなかった場合,<code>yoko</code>指定時にはそれぞれ<code>nombre_position</code>および<code>running_head_position</code>と同じ位置に設定されます.<code>tate</code>指定時は一つ目のノンブルや柱に続く場所に表示されます.</li>
 </ul>
-<p><code>\NewPageStyle</code>,<code>\RenewPageStyle</code>,<code>\ProvidePageStyle</code>もあります.<code>\ModifyPageStyle</code>により既存のページスタイルを改変することが可能です.</p>
+<p><code>\RenewPageStyle</code>,<code>\ProvidePageStyle</code>,<code>\DeclarePageStyle</code>もあります.<code>\ModifyPageStyle</code>により既存のページスタイルを改変することが可能です.</p>
 <h2 id="jfm">JFM</h2>
 <p>以下のような独自のJFMを使います.パッケージによっては,パッケージ独自のJFMや,また標準のJFMを使うように設定がし直される場合があります.例えばLuaTeX-jaに付属するluatexja-presetパッケージは通常LuaTeX-ja標準のJFMを使います.本クラスファイルで使っているJFMを使う場合は,</p>
 <pre class="sourceCode LaTeX" id="cb11"><code class="sourceCode latex"><a class="sourceLine" id="cb11-1" data-line-number="1"><span class="bu">\usepackage</span>[jfm_yoko=jlreq,jfm_tate=jlreqv,hiragino-pron]{<span class="ex">luatexja-preset</span>}</a></code></pre>
@@ -482,6 +508,13 @@
 <li><code>\mag</code>が<code>1000</code>でない場合も動くようにした(つもり).</li>
 <li>バグ修正.</li>
 </ul></li>
+<li>2018-12-10
+<ul>
+<li>見出し命令を作る命令に<code>number=[true/false]</code>を追加.</li>
+<li><code>\frontmatter</code>等の挙動を設定できるようにした.</li>
+<li><code>\jlreqHeadingLabel</code>等を扉見出しと別行見出しの<code>format</code>内で使えるようにした.</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>

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html	2018-12-10 22:57:36 UTC (rev 49375)
@@ -52,6 +52,36 @@
       background-color: #F8F8F8;
       border-style: none;
     }
+    div.sourceCode { overflow-x: auto; text-indent: 0em;}
+    code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+    code span.dt { color: #902000; } /* DataType */
+    code span.dv { color: #40a070; } /* DecVal */
+    code span.bn { color: #40a070; } /* BaseN */
+    code span.fl { color: #40a070; } /* Float */
+    code span.ch { color: #4070a0; } /* Char */
+    code span.st { color: #4070a0; } /* String */
+    code span.co { color: #008000; } /* Comment */
+    code span.ot { color: #007020; } /* Other */
+    code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+    code span.fu { color: #0040FF; } /* Function */
+    code span.er { color: #ff0000; font-weight: bold; } /* Error */
+    code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+    code span.cn { color: #880000; } /* Constant */
+    code span.sc { color: #4070a0; } /* SpecialChar */
+    code span.vs { color: #4070a0; } /* VerbatimString */
+    code span.ss { color: #bb6688; } /* SpecialString */
+    code span.im { } /* Import */
+    code span.va { color: #19177c; } /* Variable */
+    code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+    code span.op { color: #666666; } /* Operator */
+    code span.bu { color: #0040FF; } /* BuiltIn */
+    code span.ex { } /* Extension */
+    code span.pp { color: #bc7a00; } /* Preprocessor */
+    code span.at { color: #7d9029; } /* Attribute */
+    code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+    code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+    code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+    code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
   </style>
 </head>
 <body>
@@ -109,7 +139,36 @@
 <h2 id="jlreqtrimmarkssetup"><code>\jlreqtrimmarkssetup</code></h2>
 <p>パッケージオプションで指定できない設定を行えます.keyval形式です.</p>
 <h3 id="banner"><code>banner</code></h3>
-<p><code>show=banner</code>時に出力される文字列.</p>
+<p><code>show=banner</code>時に出力される文字列.通常は左上に出力されますが,四つ角および上下左右の中心に出力することもできます.例えば次のように指定します.</p>
+<pre class="sourceCode latex" id="cb2"><code class="sourceCode latex"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="fu">\jlreqtrimmarkssetup</span>{</a>
+<a class="sourceLine" id="cb2-2" data-line-number="2">  banner={</a>
+<a class="sourceLine" id="cb2-3" data-line-number="3">    top-right={</a>
+<a class="sourceLine" id="cb2-4" data-line-number="4">      tate={</a>
+<a class="sourceLine" id="cb2-5" data-line-number="5">        odd = {奇数ページの右上に縦書きで表示},</a>
+<a class="sourceLine" id="cb2-6" data-line-number="6">        even = {偶数ページの右上に縦書きで表示},</a>
+<a class="sourceLine" id="cb2-7" data-line-number="7">      },</a>
+<a class="sourceLine" id="cb2-8" data-line-number="8">      yoko={右上に横書きで表示}, <span class="co">% ページの偶奇によらず共通</span></a>
+<a class="sourceLine" id="cb2-9" data-line-number="9">      corner={右上角に横書きで表示},</a>
+<a class="sourceLine" id="cb2-10" data-line-number="10">      in-yoko = {右上版面内に横書きで表示},</a>
+<a class="sourceLine" id="cb2-11" data-line-number="11">      in-tate = {右上版面内に縦書きで表示},</a>
+<a class="sourceLine" id="cb2-12" data-line-number="12">    },</a>
+<a class="sourceLine" id="cb2-13" data-line-number="13">    bottom-center={</a>
+<a class="sourceLine" id="cb2-14" data-line-number="14">      left = {中央下の左に表示}, <span class="co">% 必要ならばodd=, even=が利用可能</span></a>
+<a class="sourceLine" id="cb2-15" data-line-number="15">      right = {中央下の右に表示},</a>
+<a class="sourceLine" id="cb2-16" data-line-number="16">      in = {中央下の版面内に表示},</a>
+<a class="sourceLine" id="cb2-17" data-line-number="17">    }</a>
+<a class="sourceLine" id="cb2-18" data-line-number="18">  }</a>
+<a class="sourceLine" id="cb2-19" data-line-number="19">}</a></code></pre>
+<p>各項目に<code>\thepage</code>を指定するとページ数を出力できます.キー名は省略することもできます.例えば次の通り.</p>
+<pre class="sourceCode latex" id="cb3"><code class="sourceCode latex"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="fu">\jlreqtrimmarkssetup</span>{</a>
+<a class="sourceLine" id="cb3-2" data-line-number="2">  banner={</a>
+<a class="sourceLine" id="cb3-3" data-line-number="3">    tate = {左上に縦書き}, <span class="co">% 場所が省略されるとtop-leftと見なされる.</span></a>
+<a class="sourceLine" id="cb3-4" data-line-number="4">    odd = {左上奇数ページ}, <span class="co">% 省略されたのでyokoと見なされる.</span></a>
+<a class="sourceLine" id="cb3-5" data-line-number="5">    top-right = {</a>
+<a class="sourceLine" id="cb3-6" data-line-number="6">      odd = {右上奇数ページ} <span class="co">% ここもyokoが省略されている.</span></a>
+<a class="sourceLine" id="cb3-7" data-line-number="7">    }</a>
+<a class="sourceLine" id="cb3-8" data-line-number="8">  }</a>
+<a class="sourceLine" id="cb3-9" data-line-number="9">}</a></code></pre>
 <h3 id="trimmarks_width"><code>trimmarks_width</code></h3>
 <p>トンボ自身の太さを指定します.</p>
 <h3 id="color"><code>color</code></h3>
@@ -145,6 +204,10 @@
 <li><code>\mag</code>が<code>1000</code>でない場合も動くようにした(つもり)</li>
 <li>バグ修正</li>
 </ul></li>
+<li>2018-12-10
+<ul>
+<li><code>\jlreqtrimmarkssetup</code>内の<code>banner</code>を拡張.</li>
+</ul></li>
 </ul>
 <hr />
 <p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p>

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md	2018-12-10 22:57:36 UTC (rev 49375)
@@ -65,8 +65,43 @@
 パッケージオプションで指定できない設定を行えます.keyval形式です.
 
 ### `banner`
-`show=banner`時に出力される文字列.
+`show=banner`時に出力される文字列.通常は左上に出力されますが,四つ角および上下左右の中心に出力することもできます.例えば次のように指定します.
 
+```latex
+\jlreqtrimmarkssetup{
+  banner={
+    top-right={
+      tate={
+        odd = {奇数ページの右上に縦書きで表示},
+        even = {偶数ページの右上に縦書きで表示},
+      },
+      yoko={右上に横書きで表示}, % ページの偶奇によらず共通
+      corner={右上角に横書きで表示},
+      in-yoko = {右上版面内に横書きで表示},
+      in-tate = {右上版面内に縦書きで表示},
+    },
+    bottom-center={
+      left = {中央下の左に表示}, % 必要ならばodd=, even=が利用可能
+      right = {中央下の右に表示},
+      in = {中央下の版面内に表示},
+    }
+  }
+}
+```
+各項目に`\thepage`を指定するとページ数を出力できます.キー名は省略することもできます.例えば次の通り.
+```latex
+\jlreqtrimmarkssetup{
+  banner={
+    tate = {左上に縦書き}, % 場所が省略されるとtop-leftと見なされる.
+    odd = {左上奇数ページ}, % 省略されたのでyokoと見なされる.
+    top-right = {
+      odd = {右上奇数ページ} % ここもyokoが省略されている.
+    }
+  }
+}
+```
+
+
 ### `trimmarks_width`
 トンボ自身の太さを指定します.
 
@@ -94,8 +129,9 @@
     - `bleed_margin`を`\jlreqtrimmarkssetup`からパッケージオプションに移した.
     - `\mag`が`1000`でない場合も動くようにした(つもり)
     - バグ修正
+* 2018-12-10
+    - `\jlreqtrimmarkssetup`内の`banner`を拡張.
 
-
 --------------
 Noriyuki Abe
 https://github.com/abenori/jlreq

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html	2018-12-10 22:57:36 UTC (rev 49375)
@@ -52,6 +52,36 @@
       background-color: #F8F8F8;
       border-style: none;
     }
+    div.sourceCode { overflow-x: auto; text-indent: 0em;}
+    code span.kw { color: #007020; font-weight: bold; } /* Keyword */
+    code span.dt { color: #902000; } /* DataType */
+    code span.dv { color: #40a070; } /* DecVal */
+    code span.bn { color: #40a070; } /* BaseN */
+    code span.fl { color: #40a070; } /* Float */
+    code span.ch { color: #4070a0; } /* Char */
+    code span.st { color: #4070a0; } /* String */
+    code span.co { color: #008000; } /* Comment */
+    code span.ot { color: #007020; } /* Other */
+    code span.al { color: #ff0000; font-weight: bold; } /* Alert */
+    code span.fu { color: #0040FF; } /* Function */
+    code span.er { color: #ff0000; font-weight: bold; } /* Error */
+    code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
+    code span.cn { color: #880000; } /* Constant */
+    code span.sc { color: #4070a0; } /* SpecialChar */
+    code span.vs { color: #4070a0; } /* VerbatimString */
+    code span.ss { color: #bb6688; } /* SpecialString */
+    code span.im { } /* Import */
+    code span.va { color: #19177c; } /* Variable */
+    code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
+    code span.op { color: #666666; } /* Operator */
+    code span.bu { color: #0040FF; } /* BuiltIn */
+    code span.ex { } /* Extension */
+    code span.pp { color: #bc7a00; } /* Preprocessor */
+    code span.at { color: #7d9029; } /* Attribute */
+    code span.do { color: #ba2121; font-style: italic; } /* Documentation */
+    code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
+    code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
+    code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
   </style>
 </head>
 <body>
@@ -58,7 +88,7 @@
 <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 and any document class (not only with jlreq class). It provides the following.</p>
+<p>This package outputs trim (register) marks. It works with <a href="https://osdn.jp/projects/luatex-ja/wiki/FrontPage">LuaTeX-ja</a> / pLaTeX / upLaTeX / dvipdfmx / Dvips / dviout and any document class (not only with jlreq class). It provides the following.</p>
 <ul>
 <li>Output trim marks</li>
 <li>Set TrimBox and BleedBox if possible.</li>
@@ -108,7 +138,36 @@
 <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 package option.</p>
+<p>The things which the package outputs when <code>show=banner</code> is specified in the package option. Normally it is showed in the left of the top. You can also put them in many places, for example:</p>
+<pre class="sourceCode latex" id="cb2"><code class="sourceCode latex"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="fu">\jlreqtrimmarkssetup</span>{</a>
+<a class="sourceLine" id="cb2-2" data-line-number="2">  banner={</a>
+<a class="sourceLine" id="cb2-3" data-line-number="3">    top-right={</a>
+<a class="sourceLine" id="cb2-4" data-line-number="4">      vertical={</a>
+<a class="sourceLine" id="cb2-5" data-line-number="5">        odd = {In the right of the top, only in odd pages, vertical mode.},</a>
+<a class="sourceLine" id="cb2-6" data-line-number="6">        even = {In the right of the top, only in even pages, vertical mode.},</a>
+<a class="sourceLine" id="cb2-7" data-line-number="7">      },</a>
+<a class="sourceLine" id="cb2-8" data-line-number="8">      horizontal={In the right of the top, horizontal mode.}, <span class="co">% does not depend on the parity of the page number</span></a>
+<a class="sourceLine" id="cb2-9" data-line-number="9">      corner={In the corner of the right of the top, horizontal mode.},</a>
+<a class="sourceLine" id="cb2-10" data-line-number="10">      in-horizontal = {In the right of the top, horizontal mode, in the trim area.},</a>
+<a class="sourceLine" id="cb2-11" data-line-number="11">      in-vertical = {In the right of the top, vertical mode, in the trim area.},</a>
+<a class="sourceLine" id="cb2-12" data-line-number="12">    },</a>
+<a class="sourceLine" id="cb2-13" data-line-number="13">    bottom-center={</a>
+<a class="sourceLine" id="cb2-14" data-line-number="14">      left = {In the left in the center of the bottom}, <span class="co">% odd=, even= is also available</span></a>
+<a class="sourceLine" id="cb2-15" data-line-number="15">      right = {In the right in the center of the bottom},</a>
+<a class="sourceLine" id="cb2-16" data-line-number="16">      in = {In the trim area in the center of the bottom.},</a>
+<a class="sourceLine" id="cb2-17" data-line-number="17">    }</a>
+<a class="sourceLine" id="cb2-18" data-line-number="18">  }</a>
+<a class="sourceLine" id="cb2-19" data-line-number="19">}</a></code></pre>
+<p>You can use <code>\thepage</code> to output the number of the page. The keys can be ommited. For example:</p>
+<pre class="sourceCode latex" id="cb3"><code class="sourceCode latex"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="fu">\jlreqtrimmarkssetup</span>{</a>
+<a class="sourceLine" id="cb3-2" data-line-number="2">  banner={</a>
+<a class="sourceLine" id="cb3-3" data-line-number="3">    vertical = {Vertical mode, in the top of the left},</a>
+<a class="sourceLine" id="cb3-4" data-line-number="4">    odd = {In the top of the left, only in odd pages.}, <span class="co">% regarded as `horizontal`</span></a>
+<a class="sourceLine" id="cb3-5" data-line-number="5">    top-right = {</a>
+<a class="sourceLine" id="cb3-6" data-line-number="6">      odd = {In the top of the right, only in odd pages, horizontal mode.}</a>
+<a class="sourceLine" id="cb3-7" data-line-number="7">    }</a>
+<a class="sourceLine" id="cb3-8" data-line-number="8">  }</a>
+<a class="sourceLine" id="cb3-9" data-line-number="9">}</a></code></pre>
 <h3 id="trimmarks_width"><code>trimmarks_width</code></h3>
 <p>Set the width of trim marks.</p>
 <h3 id="color"><code>color</code></h3>
@@ -142,6 +201,10 @@
 <li>jlreq-trimmarks works with unusugal<code>\mag</code>.</li>
 <li>Fixed bugs.</li>
 </ul></li>
+<li>2018-12-10
+<ul>
+<li>Extended <code>banner</code> in <code>\jlreqtrimmarkssetup</code>.</li>
+</ul></li>
 </ul>
 <hr />
 <p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p>

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md	2018-12-10 22:57:36 UTC (rev 49375)
@@ -1,7 +1,7 @@
 # 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 and any document class (not only with jlreq class). It provides the following.
+This package outputs trim (register) marks. It works with [LuaTeX-ja](https://osdn.jp/projects/luatex-ja/wiki/FrontPage) / pLaTeX / upLaTeX / dvipdfmx / Dvips / dviout and any document class (not only with jlreq class). It provides the following.
 
 * Output trim marks
 * Set TrimBox and BleedBox if possible.
@@ -64,7 +64,42 @@
 
 ### `banner`
 The things which the package outputs when `show=banner` is specified in the package option.
+Normally it is showed in the left of the top. You can also put them in many places, for example:
 
+```latex
+\jlreqtrimmarkssetup{
+  banner={
+    top-right={
+      vertical={
+        odd = {In the right of the top, only in odd pages, vertical mode.},
+        even = {In the right of the top, only in even pages, vertical mode.},
+      },
+      horizontal={In the right of the top, horizontal mode.}, % does not depend on the parity of the page number
+      corner={In the corner of the right of the top, horizontal mode.},
+      in-horizontal = {In the right of the top, horizontal mode, in the trim area.},
+      in-vertical = {In the right of the top, vertical mode, in the trim area.},
+    },
+    bottom-center={
+      left = {In the left in the center of the bottom}, % odd=, even= is also available
+      right = {In the right in the center of the bottom},
+      in = {In the trim area in the center of the bottom.},
+    }
+  }
+}
+```
+You can use `\thepage` to output the number of the page. The keys can be ommited. For example:
+```latex
+\jlreqtrimmarkssetup{
+  banner={
+    vertical = {Vertical mode, in the top of the left},
+    odd = {In the top of the left, only in odd pages.}, % regarded as `horizontal`
+    top-right = {
+      odd = {In the top of the right, only in odd pages, horizontal mode.}
+    }
+  }
+}
+```
+
 ### `trimmarks_width`
 Set the width of trim marks.
 
@@ -91,8 +126,9 @@
     - Moved `bleed_margin` from `\jlreqtrimmarkssetup` to a package option.
     - jlreq-trimmarks works with unusugal`\mag`.
     - Fixed bugs.
+* 2018-12-10
+    - Extended `banner` in `\jlreqtrimmarkssetup`.
 
-
 --------------
 Noriyuki Abe
 https://github.com/abenori/jlreq

Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html	2018-12-10 22:57:36 UTC (rev 49375)
@@ -60,14 +60,14 @@
 <h2 id="what-is-this">What is this?</h2>
 <p>This package provides the class file and JFM (Japanese font metric) files for LuaTeX-ja / pLaTeX / upLaTeX. This aims to implement <a href="https://www.w3.org/TR/jlreq/">Requirements for Japanese Text Layout</a>.</p>
 <h2 id="installation">Installation</h2>
-<p>Run <code>make</code>, then JFM files are created. Move the files as follows:</p>
+<p>Run <code>make</code> to generate JFM files. Move the files as follows:</p>
 <ul>
 <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>jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/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>
+<p>The other way to install is just to run <code>make install</code>. It will install all files in <code>$TEXMFHOME</code>.</p>
 <h2 id="usage">Usage</h2>
 <p>See <a href="README-ja.md" class="uri">README-ja.md</a> (in Japanese).</p>
 <h2 id="license">LICENSE</h2>
@@ -188,6 +188,13 @@
 <li>jlreq works with unusual <code>\mag</code>.</li>
 <li>Fixed bugs.</li>
 </ul></li>
+<li>2018-12-10
+<ul>
+<li>Added <code>number=[true/false]</code> to <code>\New***Heading</code>.</li>
+<li>Added options for <code>\frontmatter</code> etc in <code>\jlreqsetup</code>.</li>
+<li>Made <code>\jlreqHeadingLabel</code> etc available in <code>format</code> in <code>\NewTobiraHeading</code> and <code>\NewBlockHeading</code>.</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>

Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty	2018-12-10 22:57:36 UTC (rev 49375)
@@ -248,32 +248,38 @@
 % <parse対象>は一回だけ展開される.
 \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 at i#2,\jlreq at endmark,%
+    \long\def\jlreq at do{}%
+    \long\def\jlreq at parsekeyval@nokey at execute##1##2{#1}%
+    \expandafter\jlreq at parsekeyval@nokey at i@wuniq\expandafter\jlreq at uniqtoken#2,\jlreq at endmark,%
   \expandafter\endgroup
   \jlreq at do
 }
-\long\def\jlreq at parsekeyval@nokey at i#1,{\jlreq at ifendmark{#1}{}{\jlreq at parsekeyval@nokey at ii#1=\jlreq at endmark}}
-\long\def\jlreq at parsekeyval@nokey at ii#1=#2\jlreq at endmark{%
-  \jlreq at ifempty{#2}{\jlreq at parsekeyval@nokey at iii{#2}{#1}}{%
+\long\def\jlreq at parsekeyval@nokey at i@wuniq#1,{\expandafter\jlreq at parsekeyval@nokey at i\expandafter{\@gobble#1}}
+\long\def\jlreq at parsekeyval@nokey at i#1{\jlreq at ifendmark{#1}{}{\jlreq at parsekeyval@nokey at ii@wuniq\jlreq at uniqtoken#1=\jlreq at endmark}}
+\long\def\jlreq at parsekeyval@nokey at ii@wuniq#1=#2\jlreq at endmark{\expandafter\jlreq at parsekeyval@nokey at ii\expandafter{\@gobble#1}{#2}}%
+\long\def\jlreq at parsekeyval@nokey at ii#1#2{%
+  \jlreq at ifempty{#2}{\jlreq at parsekeyval@nokey at iii{*}{#2}{#1}}{%
     \edef\jlreq at tempa{%
-      \noexpand\jlreq at parsekeyval@nokey at iii{\jlreq at parsekeyval@nokey at removeequal{#2}}{\unexpanded{#1}}%
+      \noexpand\jlreq at parsekeyval@nokey at iii{}{\jlreq at parsekeyval@nokey at removeequal{#2}}{\unexpanded{#1}}%
     }%
     \jlreq at tempa
   }%
 }
-\long\def\jlreq at parsekeyval@nokey at iii#1#2{%
-  \jlreq at remove@spaceandbracket{#1}{\jlreq at tempa}%
-  \jlreq at remove@spaceandbracket{#2}{\jlreq at tempb}%
+% valueが与えられていない場合は#1=*になる.そうでなければ#1は空
+\long\def\jlreq at parsekeyval@nokey at iii#1#2#3{%
+  \jlreq at remove@spaceandbracket{#2}{\jlreq at tempa}%
+  \jlreq at remove@spaceandbracket{#3}{\jlreq at tempb}%
   \ifx\jlreq at tempb\@empty\else
-    \edef\@tempa{\noexpand\jlreq at parsekeyval@nokey at iv{\expandonce{\jlreq at tempb}}{\expandonce{\jlreq at tempa}}}%
+    \edef\@tempa{\noexpand\jlreq at parsekeyval@nokey at iv{#1}{\expandonce{\jlreq at tempb}}{\expandonce{\jlreq at tempa}}}%
     \@tempa
   \fi
-  \jlreq at parsekeyval@nokey at i
+  \jlreq at parsekeyval@nokey at i@wuniq\jlreq at uniqtoken
 }
-\long\def\jlreq at parsekeyval@nokey at iv#1#2{%
-  \eappto\jlreq at do{\expandonce{\jlreq at parsekeyval@nokey at execute{#1}{#2}}}%
+\long\def\jlreq at parsekeyval@nokey at iv#1#2#3{%
+  \eappto\jlreq at do{%
+    \unexpanded{\let\ifjlreq at parsekeyval@nokey at novalue}\jlreq at ifempty{#1}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}%
+    \expandonce{\jlreq at parsekeyval@nokey at execute{#2}{#3}}%
+  }%
 }
 \long\def\jlreq at parsekeyval@nokey at removeequal#1{\jlreq at parsekeyval@nokey at removeequal@\jlreq at uniqtoken#1\jlreq at endmark}
 \long\def\jlreq at parsekeyval@nokey at removeequal@#1=\jlreq at endmark{\expandafter\unexpanded\expandafter{\@gobble#1}}
@@ -322,7 +328,7 @@
 %   {str1}{xyz}
 %   {default} % ここは#1を受け付けない(パラメータトークンを受け付けたい場合のため).
 %} -> abcd
-% 文字列比較→\edefして比較する
+% strは\edefで展開されるが,\jlreq at switch*の場合は展開されない.
 % 第一引数は\jlreq at tempaに入れておく.
 \long\def\jlreq at helper@switch at executeoption#1[#2]{%
   \begingroup
@@ -331,13 +337,14 @@
   \jlreq at do{#1}%
 }
 \long\def\jlreq at helper@removeoption[#1]{}
-\newcommand{\jlreq at switch}[2]{%
+\newcommand{\jlreq at switch}{\@ifstar{\jlreq at switch@{*}}{\jlreq at switch@{}}}
+\newcommand{\jlreq at switch@}[3]{%
   \begingroup
     \let\jlreq at do\@undefined
-    \edef\jlreq at tempa{#1}% ループ中ずっと保存する
-    \jlreq at helper@switch@#2\jlreq at endmark
+    \edef\jlreq at tempa{\jlreq at ifempty{#1}{#2}{\unexpanded{#2}}}% ループ中ずっと保存する
+    \jlreq at helper@switch@{#1}#3\jlreq at endmark
     \ifx\jlreq at do\@undefined
-      \def\jlreq at do{\@ifnextchar[{\jlreq at helper@switch at executeoption{#1}}{}}%
+      \edef\jlreq at do{\unexpanded{\jlreq at ifnextchar[{\jlreq at helper@switch at executeoption{#2}}{}}}%
     \else
       \appto\jlreq at do{\@ifnextchar[{\jlreq at helper@removeoption}{}}%
     \fi
@@ -344,20 +351,20 @@
   \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}{}{\jlreq at helper@switch@@{#1}{#2}}%
 }
 
-\long\def\jlreq at helper@switch@@#1#2{%
-  \jlreq at ifendmark{#2}{%
-    \edef\jlreq at do{\unexpanded{#1}}%
+\long\def\jlreq at helper@switch@@#1#2#3{%
+  \jlreq at ifendmark{#3}{%
+    \edef\jlreq at do{\unexpanded{#2}}%
   }{%
-    \edef\jlreq at tempb{#1}%
+    \edef\jlreq at tempb{\jlreq at ifempty{#1}{#2}{\unexpanded{#2}}}%
     \ifx\jlreq at tempa\jlreq at tempb\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
-      \edef\jlreq at do{\unexpanded{#2}}%
+      \edef\jlreq at do{\unexpanded{#3}}%
       \jlreq at deleteuntileendmark
     }{%
-      \jlreq at helper@switch@
+      \jlreq at helper@switch@{#1}%
     }%
   }%
 }

Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty	2018-12-10 22:57:36 UTC (rev 49375)
@@ -1,5 +1,5 @@
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{jlreq-trimmarks}[2018/09/01 jlreq-trimmarks]
+\ProvidesPackage{jlreq-trimmarks}[2018/12/10 jlreq-trimmarks]
 \RequirePackage{xkeyval,etoolbox}
 \RequirePackage{jlreq-helpers}
 
@@ -27,7 +27,7 @@
   \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}
 
@@ -101,17 +101,17 @@
 \jlreq at trimmarks@addpapersize{hagaki}[hagaki]
 
 % width -> \jlreq at resulta, height -> \jlreq at resultb
-\edef\jlreq at trimmarks@analyzepapersize#1{%
-  \noexpand\jlreq at switch{#1}{%
+\edef\jlreq at trimmarks@analyzepapersize#1{
+  \noexpand\jlreq at switch{#1}{
     \expandonce{\jlreq at trimmarks@switchpapersize}%
     {%
-      \noexpand\jlreq at helper@dividebycomma{#1}
-      \unexpanded{\ifjlreq at result\else}
-        \unexpanded{\def\jlreq at resulta}{#1}
-        \unexpanded{\def\jlreq at resultb}{#1}
+      \noexpand\jlreq at helper@dividebycomma{#1}%
+      \unexpanded{\ifjlreq at result\else}%
+        \unexpanded{\def\jlreq at resulta}{#1}%
+        \unexpanded{\def\jlreq at resultb}{#1}%
       \noexpand\fi
     }%
-  }\noexpand\relax%
+  }\noexpand\relax
 }
 \jlreq at trimmarks@afterpkg at addtodeletecs{\jlreq at trimmarks@analyzepapersize}
 
@@ -127,7 +127,7 @@
 \newif\ifjlreq at trimmarks@option at show \jlreq at trimmarks@option at showfalse
 
 \DeclareOptionX{show}{%
-  \jlreq at trimmarks@showtrue
+  \jlreq at trimmarks@option at showtrue
   \jlreq at ifempty{#1}{
     \jlreq at trimmarks@showtrue\tombowdatetrue\jlreq at trimmarks@digitaltrue
   }{
@@ -202,17 +202,137 @@
   \fi
 \fi
 
+\long\def\jlreq at trimmarks@setbanner#1#2{%
+  \begingroup
+    \def\jlreq at do{}%
+    \jlreq at parsekeyval@nokey{%
+      \ifjlreq at parsekeyval@nokey at novalue{}{%
+        \jlreq at switch{##1}{
+          {yoko}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{yoko@#1}{##2}}}
+          {horizontal}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{yoko@#1}{##2}}}
+          {tate}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{tate@#1}{##2}}}
+          {vertial}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{tate@#1}{##2}}}
+          {corner}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{corner@#1}{##2}}}
+          {in-yoko}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{inyoko@#1}{##2}}}
+          {in-horizontal}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{inyoko@#1}{##2}}}
+          {in-tate}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{intate@#1}{##2}}}
+          {in-vertial}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{intate@#1}{##2}}}
+        }%
+      }%
+    }{#2}%
+    \ifx\jlreq at do\@empty
+      \appto\jlreq at do{\jlreq at trimmarks@setbanner@@{yoko@#1}{#2}}%
+    \fi
+  \expandafter\endgroup
+  \jlreq at do
+}
+
+\long\def\jlreq at trimmarks@setbanner@#1#2{%
+  \begingroup
+    \def\jlreq at do{}%
+    \jlreq at parsekeyval@nokey{%
+      \ifjlreq at parsekeyval@nokey at novalue{}{%
+        \jlreq at switch*{##1}{
+          {left}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{before@#1}{##2}}}
+          {right}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{after@#1}{##2}}}
+          {above}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{before@#1}{##2}}}
+          {below}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{after@#1}{##2}}}
+          {in}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@@{in@#1}{##2}}}
+        }%
+      }%
+    }{#2}%
+    \ifx\jlreq at do\@empty
+      \appto\jlreq at do{\jlreq at trimmarks@setbanner@@{before@#1}{#2}}%
+    \fi
+  \expandafter\endgroup
+  \jlreq at do
+}
+
+\long\def\jlreq at trimmarks@setbanner@@#1#2{%
+  \begingroup
+    \def\jlreq at do{}%
+    \jlreq at parsekeyval@nokey{%
+      \ifjlreq at parsekeyval@nokey at novalue{}{%
+        \jlreq at switch*{##1}{
+          {odd}{\appto\jlreq at do{\expandafter\edef\csname jlreq at trimmarks@banner at odd@#1\endcsname{\unexpanded{##2}}}}
+          {even}{\appto\jlreq at do{\expandafter\edef\csname jlreq at trimmarks@banner at even@#1\endcsname{\unexpanded{##2}}}}
+        }%
+      }%
+    }{#2}%
+    \ifx\jlreq at do\@empty
+      \appto\jlreq at do{%
+        \expandafter\edef\csname jlreq at trimmarks@banner at odd@#1\endcsname{\unexpanded{#2}}%
+        \expandafter\edef\csname jlreq at trimmarks@banner at even@#1\endcsname{\unexpanded{#2}}%
+      }%
+    \fi
+  \expandafter\endgroup
+  \jlreq at do
+}
+
 \newcommand{\jlreqtrimmarkssetup}[1]{%
-  \jlreq at parsekeyval{%
-    {banner}{\@bannertoken{##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 parsekeyval[jlreqtrimmarkssetup]{
+    {banner}{%
+      \@for\@tempa:=odd,even\do{%
+        \@for\jlreq at tempa:=tate,yoko,corner,inyoko,intate\do{%
+          \@for\jlreq at tempb:=top,bottom\do{%
+            \@for\jlreq at tempc:=left,right\do{%
+              \@namedef{jlreq at trimmarks@banner@\@tempa @\jlreq at tempa @\jlreq at tempb @\jlreq at tempc}{}%
+            }%
+          }%
+        }%
+        \@for\jlreq at tempa:=before,after\do{%
+          \@for\jlreq at tempb:=top,bottom,in\do{%
+            \@namedef{jlreq at trimmarks@banner@\@tempa @\jlreq at tempa @\jlreq at tempb @center}{}%
+          }%
+          \@for\jlreq at tempb:=left,right,in\do{%
+            \@namedef{jlreq at trimmarks@banner@\@tempa @\jlreq at tempa @center@\jlreq at tempb}{}%
+          }%
+        }%
+      }%
+      \@bannertoken{}%
+      \def\jlreq at do{}%
+      \jlreq at parsekeyval@nokey{%
+        \ifjlreq at parsekeyval@nokey at novalue{}{%
+          \jlreq at tempafalse
+          \jlreq at switch*{####1}{
+            {top-left}{\jlreq at tempatrue\appto\jlreq at do{\jlreq at trimmarks@setbanner{top at left}{####2}}}
+            {left-top}{\jlreq at tempatrue\appto\jlreq at do{\jlreq at trimmarks@setbanner{top at left}{####2}}}
+            {top-right}{\appto\jlreq at do{\jlreq at trimmarks@setbanner{top at right}{####2}}}
+            {right-top}{\appto\jlreq at do{\jlreq at trimmarks@setbanner{top at right}{####2}}}
+            {bottom-left}{\appto\jlreq at do{\jlreq at trimmarks@setbanner{bottom at left}{####2}}}
+            {left-bottom}{\appto\jlreq at do{\jlreq at trimmarks@setbanner{bottom at left}{####2}}}
+            {bottom-right}{\appto\jlreq at do{\jlreq at trimmarks@setbanner{bottom at right}{####2}}}
+            {right-bottom}{\appto\jlreq at do{\jlreq at trimmarks@setbanner{bottom at right}{####2}}}
+            {top-center}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{top at center}{####2}}}
+            {center-top}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{top at center}{####2}}}
+            {bottom-center}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{bottom at center}{####2}}}
+            {center-bottom}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{bottom at center}{####2}}}
+            {center-right}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{center at right}{####2}}}
+            {right-center}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{center at right}{####2}}}
+            {center-left}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{center at left}{####2}}}
+            {left-center}{\appto\jlreq at do{\jlreq at trimmarks@setbanner@{center at left}{####2}}}
+          }%
+          \ifjlreq at tempa
+            \appto\jlreq at do{\expandafter\@bannertoken\expandafter{\jlreq at trimmarks@banner at odd@yoko at top@left}}%
+          \fi
+        }%
+      }{##1}%
+      \ifx\jlreq at do\@empty
+        \jlreq at trimmarks@setbanner{top at left}{##1}%
+        \expandafter\@bannertoken\expandafter{\jlreq at trimmarks@banner at odd@yoko at top@left}%
+      \else
+        \jlreq at do
+      \fi
+    }
+    {banner_font}{\def\jlreq at trimmarks@bannerfont{##1}}
+    {trimmarks_width}{\setlength{\@tombowwidth}{##1}}
+    {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}}}
@@ -229,19 +349,18 @@
           {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}}}
-            }
+          {%
+            \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}
+          }%
+        }%
+      }%
+    }%
+  }{#1}%
 }
 \@onlypreamble\jlreqtrimmarkssetup
 \jlreqtrimmarkssetup{
@@ -249,6 +368,7 @@
     \jobname\space(\number\year-\two at digits\month-\two at digits\day
     \space\two at digits\hour:\two at digits\minute)%
   },
+  banner_font={},
   color={}
 }
 
@@ -266,7 +386,7 @@
   \fi
 \fi
 
-\ifx l\jlreq at engine
+\ifx l\jlreq at trimmarks@engine
   \setlength{\pagewidth}{\dimexpr\jlreq at trimmarks@paperwidth\relax}
   \setlength{\pageheight}{\dimexpr\jlreq at trimmarks@paperheight\relax}
 \else
@@ -274,9 +394,9 @@
   \setlength{\pdfpageheight}{\dimexpr\jlreq at trimmarks@paperheight\relax}
 \fi
 
-\hoffset=\dimexpr(\jlreq at trimmarks@paperwidth - \paperwidth)/2 - \ifx l\jlreq at engine 1in\else 1truein\fi\relax
-\voffset=\dimexpr(\jlreq at trimmarks@paperheight - \paperheight)/2 - \ifx l\jlreq at engine 1in\else 1truein\fi\relax
-\ifx l\jlreq at engine\else
+\hoffset=\dimexpr(\jlreq at trimmarks@paperwidth - \paperwidth)/2 - \ifx l\jlreq at trimmarks@engine 1in\else 1truein\fi\relax
+\voffset=\dimexpr(\jlreq at trimmarks@paperheight - \paperheight)/2 - \ifx l\jlreq at trimmarks@engine 1in\else 1truein\fi\relax
+\ifx l\jlreq at trimmarks@engine\else
   \@ifundefined{@tombowreset@@paper}{
     \AtBeginDocument{%
       \addtolength{\oddsidemargin}{\dimexpr 1truein - 1in\relax}%
@@ -308,77 +428,360 @@
 \setlength{\stockwidth}{\dimexpr\jlreq at trimmarks@paperwidth\relax}
 \setlength{\stockheight}{\dimexpr\jlreq at trimmarks@paperheight\relax}
 
+\def\jlreq at trimmarks@outputbanner#1#2{%
+  \iftombowdate
+    \expandafter\let\expandafter\jlreq at tempa\csname jlreq at trimmarks@banner@\ifodd\c at page odd\else even\fi @#1\endcsname
+    \ifx\jlreq at tempa\@empty\else
+      \def\@tempa##1{#2}%
+      \expandafter\@tempa\expandafter{\jlreq at tempa}%
+    \fi
+  \fi
+}
 
-\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 = \@tombowbleed: 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
+\def\jlreq at trimmarks@outputtombow{%
+  \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}%
+      \hbox to\@@paperwidth{%
+        \hskip\jlreq at trimmarks@bleed\relax
+        \setbox\jlreq at tempboxa=\hbox to\z@{% \@TL
+          \yoko\hss
+          \vrule width\dimexpr 10mm + \jlreq at trimmarks@bleed\relax height\@tombowwidth depth\z@
+          \vrule height10mm width\@tombowwidth depth\z@
+          \iftombowdate
+            \setbox\jlreq at tempboxa=\hbox to\z@{\hskip5mm\@bannerfont\jlreq at trimmarks@bannerfont
+              \ifodd\c at page\the\@bannertoken\else\jlreq at trimmarks@banner at even@yoko at top@left\fi
+            \hss}%
+            \dp\jlreq at tempboxa=0pt
+            \raise 4pt\box\jlreq at tempboxa
+          \fi
+          \jlreq at trimmarks@outputbanner{inyoko at top@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + \jlreq at trimmarks@bleed\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+        }%
+        \dp\jlreq at tempboxa=0pt
+        \box\jlreq at tempboxa
+        \hfill
+        \setbox\jlreq at tempboxa=\hbox{% \@TC
+          \yoko
+          \vrule width10mm height\@tombowwidth depth\z@
+          \jlreq at trimmarks@outputbanner{before at top@center}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hss\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 5mm}%
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \raise 4pt\box\jlreq at tempboxa
+          }%
+          \jlreq at trimmarks@outputbanner{in at top@center}{%
+            \setbox\jlreq at tempboxa=\hbox{\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + \jlreq at trimmarks@bleed\relax
+            \jlreq at tempdimb=0.5\wd\jlreq at tempboxa
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdimb\raise-\jlreq at tempdima\box\jlreq at tempboxa\kern\jlreq at tempdimb
+          }%
+          \vrule height10mm width\@tombowwidth depth\z@
+          \jlreq at trimmarks@outputbanner{after at top@center}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hskip 5mm\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \raise 4pt\box\jlreq at tempboxa
+          }%
+          \vrule width10mm height\@tombowwidth depth\z@
+        }%
+        \dp\jlreq at tempboxa=0pt
+        \box\jlreq at tempboxa
+        \hfill
+        \setbox\jlreq at tempboxa=\hbox to\z@{% \@TR
+          \yoko
+          \jlreq at trimmarks@outputbanner{yoko at top@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\yoko\hss\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 5mm}%
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise 4pt\box\jlreq at tempboxa
+          }%
+          \jlreq at trimmarks@outputbanner{inyoko at top@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\yoko\hss\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \ht\jlreq at tempboxa\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \vrule height10mm width\@tombowwidth depth\z@
+          \jlreq at trimmarks@outputbanner{corner at top@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hskip\dimexpr\jlreq at trimmarks@bleed + 4pt\relax\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise 4pt\box\jlreq at tempboxa
+          }%
+          \vrule width\dimexpr 10mm + \jlreq at trimmarks@bleed\relax height\@tombowwidth depth\z@\hss
+        }%
+        \dp\jlreq at tempboxa=0pt
+        \box\jlreq at tempboxa
+        \hskip\jlreq at trimmarks@bleed
+      }%
       \kern-10mm
-      \hbox to\@@paperwidth{\copy\@Tl\hfill\copy\@Tr}%
+      \hbox to\@@paperwidth{%
+        \hbox to\z@{% \@Tl
+          \yoko\hss
+          \vrule width10mm height\@tombowwidth depth\z@
+          \jlreq at trimmarks@outputbanner{corner at top@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hss\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 4pt}%
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt
+            \raise\dimexpr \jlreq at trimmarks@bleed + 4pt\relax\box\jlreq at tempboxa
+          }%
+          \vrule height\dimexpr 10mm + \jlreq at trimmarks@bleed\relax width\@tombowwidth depth\z@
+          \jlreq at trimmarks@outputbanner{tate at top@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr 4pt + \ht\jlreq at tempboxa\relax
+             \else
+              \jlreq at tempdima=\dimexpr 4pt + \wd\jlreq at tempboxa\relax
+            \fi
+            \wd\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\raise-5mm\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \jlreq at trimmarks@outputbanner{intate at top@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed \ifx l\jlreq at trimmarks@engine + \ht\jlreq at tempboxa\fi\relax
+            \wd\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+        }%
+        \hfill
+        \hbox to\z@{% \@Tr
+          \yoko
+          \jlreq at trimmarks@outputbanner{tate at top@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr 4pt \ifx l\jlreq at trimmarks@engine + \dp\jlreq at tempboxa\fi\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\raise -5mm\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+          \jlreq at trimmarks@outputbanner{intate at top@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \ht\jlreq at tempboxa\relax
+            \else
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \wd\jlreq at tempboxa\relax
+            \fi
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \vrule height\dimexpr 10mm + \jlreq at trimmarks@bleed\relax width\@tombowwidth depth\z@
+          \vrule width10mm height\@tombowwidth depth\z@
+          \hss
+        }%
+      }%
       \vfill
-      \hbox to\@@paperwidth{\copy\@CL\hfill\copy\@CR}%
+      \hbox to\@@paperwidth{%
+        \hbox to\z@{% \@CL
+          \yoko\hss
+          \vrule width10mm height.5\@tombowwidth depth.5\@tombowwidth
+          \jlreq at trimmarks@outputbanner{before at center@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\hss\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 5mm}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr 4pt + \ht\jlreq at tempboxa\relax
+             \else
+              \jlreq at tempdima=\dimexpr 4pt + \wd\jlreq at tempboxa\relax
+            \fi
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \jlreq at trimmarks@outputbanner{after at center@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\hskip 5mm\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr 4pt + \ht\jlreq at tempboxa\relax
+             \else
+              \jlreq at tempdima=\dimexpr 4pt + \wd\jlreq at tempboxa\relax
+            \fi
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \vrule height10mm depth10mm width\@tombowwidth
+          \jlreq at trimmarks@outputbanner{in at center@left}{%
+            \setbox\jlreq at tempboxa=\hbox{\tate\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \ht\jlreq at tempboxa\relax
+              \jlreq at tempdimb=.5\wd\jlreq at tempboxa
+             \else
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed\relax
+              \jlreq at tempdimb=.5\dimexpr\ht\jlreq at tempboxa + \dp\jlreq at tempboxa\relax
+            \fi
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\raise\jlreq at tempdimb\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+        }%
+        \hfill
+        \hbox to\z@{% \@CR
+          \yoko
+          \jlreq at trimmarks@outputbanner{in at center@right}{%
+            \setbox\jlreq at tempboxa=\hbox{\tate\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed  + \ht\jlreq at tempboxa\relax
+              \jlreq at tempdimb=0.5\wd\jlreq at tempboxa
+            \else
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed  + \wd\jlreq at tempboxa\relax
+              \jlreq at tempdimb=0.5\dimexpr\ht\jlreq at tempboxa + \dp\jlreq at tempboxa\relax
+            \fi
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\raise\jlreq at tempdimb\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \vrule height10mm depth10mm width\@tombowwidth
+          \jlreq at trimmarks@outputbanner{before at center@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\hss\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 5mm}%
+            \jlreq at tempdima=\dimexpr 4pt \ifx l\jlreq at trimmarks@engine + \dp\jlreq at tempboxa\fi\relax
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+          \jlreq at trimmarks@outputbanner{after at center@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\hskip 5mm\adjustbaseline\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr 4pt \ifx l\jlreq at trimmarks@engine + \dp\jlreq at tempboxa\fi\relax
+            \dp\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+          \vrule height.5\@tombowwidth depth.5\@tombowwidth width10mm\hss
+        }%
+      }%
       \vfill
-      \hbox to\@@paperwidth{\copy\@Bl\hfill\copy\@Br}%
+      \hbox to\@@paperwidth{%
+        \hbox to\z@{% \@Bl
+          \yoko\hss
+          \vrule width10mm depth\@tombowwidth height\z@
+          \vrule depth\dimexpr 10mm + \jlreq at trimmarks@bleed\relax width\@tombowwidth height\z@
+          \jlreq at trimmarks@outputbanner{tate at bottom@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\hss\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr 4pt + \ht\jlreq at tempboxa\relax
+             \else
+              \jlreq at tempdima=\dimexpr 4pt + \wd\jlreq at tempboxa\relax
+            \fi
+            \wd\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\raise 5mm\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \jlreq at trimmarks@outputbanner{intate at bottom@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\hss\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed \ifx l\jlreq at trimmarks@engine + \ht\jlreq at tempboxa\fi\relax
+            \wd\jlreq at tempboxa=0pt \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+        }%
+        \hfill
+        \hbox to\z@{% \@Br
+          \yoko
+          \jlreq at trimmarks@outputbanner{tate at bottom@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\hss\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \jlreq at tempdima=\dimexpr\ifx l\jlreq at trimmarks@engine\ht\jlreq at tempboxa + \fi 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern\jlreq at tempdima\raise5mm\box\jlreq at tempboxa\kern-\jlreq at tempdima
+          }%
+          \jlreq at trimmarks@outputbanner{intate at bottom@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\tate\adjustbaseline\hss\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \ifx l\jlreq at trimmarks@engine
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \ht\jlreq at tempboxa\relax
+            \else
+              \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \wd\jlreq at tempboxa\relax
+            \fi
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdima\box\jlreq at tempboxa\kern\jlreq at tempdima
+          }%
+          \vrule depth\dimexpr 10mm + \jlreq at trimmarks@bleed\relax width\@tombowwidth height\z@
+          \jlreq at trimmarks@outputbanner{corner at bottom@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hskip 4pt\relax\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa  + \jlreq at trimmarks@bleed + 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \vrule width10mm depth\@tombowwidth height\z@\hss
+        }%
+      }%
       \kern-10mm
-      \hbox to\@@paperwidth{\hskip\jlreq at trimmarks@bleed\relax
-         \copy\@BL\hfill\copy\@BC\hfill\copy\@BR\hskip\jlreq at trimmarks@bleed}%
+      \hbox to\@@paperwidth{%
+        \hskip\jlreq at trimmarks@bleed\relax
+        \setbox\jlreq at tempboxa=\hbox to\z@{% \@BL
+          \yoko\hss
+          \vrule width\dimexpr 10mm + \jlreq at trimmarks@bleed\relax depth\@tombowwidth height\z@
+          \jlreq at trimmarks@outputbanner{corner at bottom@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hss\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip\dimexpr\jlreq at trimmarks@bleed + 4pt\relax}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \vrule depth10mm width\@tombowwidth height\z@
+          \jlreq at trimmarks@outputbanner{yoko at bottom@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\yoko\hskip 5mm\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \jlreq at trimmarks@outputbanner{inyoko at bottom@left}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\yoko\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr\jlreq at trimmarks@bleed + \dp\jlreq at tempboxa\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+        }%
+        \ht\jlreq at tempboxa=0pt
+        \box\jlreq at tempboxa
+        \hfill
+        \setbox\jlreq at tempboxa=\hbox{% \@BC
+          \yoko
+          \vrule width10mm depth\@tombowwidth height\z@
+          \jlreq at trimmarks@outputbanner{before at bottom@center}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hss\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 5mm}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \jlreq at trimmarks@outputbanner{in at bottom@center}{%
+            \setbox\jlreq at tempboxa=\hbox{\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \jlreq at tempdima=\dimexpr\dp\jlreq at tempboxa + \jlreq at trimmarks@bleed\relax
+            \jlreq at tempdimb=.5\wd\jlreq at tempboxa
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt \wd\jlreq at tempboxa=0pt
+            \kern-\jlreq at tempdimb\raise\jlreq at tempdima\box\jlreq at tempboxa\kern\jlreq at tempdimb
+          }%
+          \vrule depth10mm width\@tombowwidth height\z@
+          \jlreq at trimmarks@outputbanner{before at bottom@center}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\hskip 5mm\@bannerfont\jlreq at trimmarks@bannerfont##1\hss}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \vrule width10mm depth\@tombowwidth height\z@
+        }%
+        \ht\jlreq at tempboxa=0pt
+        \box\jlreq at tempboxa
+        \hfill
+        \setbox\jlreq at tempboxa=\hbox to 0pt{% \@BR
+          \yoko
+          \jlreq at trimmarks@outputbanner{yoko at bottom@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\yoko\hss\@bannerfont\jlreq at trimmarks@bannerfont##1\hskip 5mm}%
+            \jlreq at tempdima=\dimexpr\ht\jlreq at tempboxa + 4pt\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise-\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \jlreq at trimmarks@outputbanner{inyoko at bottom@right}{%
+            \setbox\jlreq at tempboxa=\hbox to 0pt{\yoko\hss\@bannerfont\jlreq at trimmarks@bannerfont##1}%
+            \jlreq at tempdima=\dimexpr\dp\jlreq at tempboxa + \jlreq at trimmarks@bleed\relax
+            \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+            \raise\jlreq at tempdima\box\jlreq at tempboxa
+          }%
+          \vrule depth10mm width\@tombowwidth height\z@
+          \vrule width\dimexpr 10mm + \jlreq at trimmarks@bleed\relax depth\@tombowwidth height\z@\hss
+        }%
+        \ht\jlreq at tempboxa=0pt \dp\jlreq at tempboxa=0pt
+        \box\jlreq at tempboxa
+        \hskip\jlreq at trimmarks@bleed
+      }%
     \color at endgroup}\vss
   }%
-  \fi
 }
+\def\@outputtombow{%
+  % 6mm = \@tombowbleed: 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\expandafter\jlreq at trimmarks@outputtombow\fi
+}
 
 \ifjlreq at trimmarks@digital
-  \ifx l\jlreq at engine
+  \ifx l\jlreq at trimmarks@engine
     \setlength\jlreq at resultdimen{1pt}
   \else
     \jlreq at helper@divide{\the\mag pt}{1000pt}
@@ -430,6 +833,6 @@
 
 % always true
 \tombowtrue
-\maketombowbox
 
+
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2018-12-10 22:57:17 UTC (rev 49374)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls	2018-12-10 22:57:36 UTC (rev 49375)
@@ -5,7 +5,7 @@
 %%
 % (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2018/09/01 jlreq]
+\ProvidesClass{jlreq}[2018/12/10 jlreq]
 \RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
 \RequirePackage{jlreq-helpers}
 
@@ -189,6 +189,7 @@
 \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}}
+\DeclareOptionX{fore-edge}{\renewcommand*{\jlreq at option@fore at edge}{#1}}
 
 %.. 柱とノンブル
 \newcommand*{\jlreq at option@headfoot at verticalpos}{}
@@ -254,6 +255,9 @@
 \jlreq at DeclareOption{openany}{\@openrightfalse\jlreq at option@opentrue}
 \jlreq at DeclareOption{leqno}{\input{leqno.clo}}
 \jlreq at DeclareOption{fleqn}{\input{fleqn.clo}}
+\newif\ifjlreq at option@enablejfam \jlreq at option@enablejfamtrue
+\jlreq at aftercls@addtodeleteif{\ifjlreq at option@enablejfam}
+\jlreq at DeclareOption{disablejfam}{\jlreq at option@enablejfamfalse}
 
 \newcommand*{\jlreq at note}[1]{}
 \jlreq at DeclareOption{jlreq_notes}{\renewcommand*{\jlreq at note}[1]{\message{^^JJLReq note: ##1^^J}}}
@@ -320,7 +324,11 @@
 
 % 必要パッケージのロード
 \ifx l\jlreq at engine
-  \RequirePackage{luatexja}
+  \ifjlreq at option@enablejfam
+    \RequirePackage{luatexja}
+  \else
+    \RequirePackage[disablejfam]{luatexja}
+  \fi
   \directlua{jlreq = {}}
 \fi
 
@@ -558,14 +566,14 @@
 \fi
 
 %. 基本設定
-\providecommand*{\jlreq at kanjiskip}{0pt plus 0.25\zw minus 0pt}
-\providecommand*{\jlreq at xkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
+\providecommand*{\jlreqkanjiskip}{0pt plus 0.25\zw minus 0pt}
+\providecommand*{\jlreqxkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
 \ifx l\jlreq at engine
-  \ltjsetparameter{kanjiskip=\jlreq at kanjiskip}
-  \ltjsetparameter{xkanjiskip=\jlreq at xkanjiskip}
+  \ltjsetparameter{kanjiskip=\jlreqkanjiskip}
+  \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip}
 \else
-  \kanjiskip=\jlreq at kanjiskip
-  \xkanjiskip=\jlreq at xkanjiskip
+  \kanjiskip=\jlreqkanjiskip
+  \xkanjiskip=\jlreqxkanjiskip
 \fi
 
 % 文字クラスのリスト(必要なものだけ)
@@ -572,7 +580,7 @@
 % 開き括弧(文字クラス1)
 \edef\jlreq at charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq at engine\else ⦅〘〖«〝\fi}
 % 閉じ括弧(文字クラス2)
-\edef\jlreq at charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq at engine\else⦆〙〗»〟\fi}
+\edef\jlreq at charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq at engine\else ⦆〙〗»〟\fi}
 % ハイフン(文字クラス3)
 \edef\jlreq at charlist@hyphens{‐〜\ifx p\jlreq at engine\else ゠–\fi}
 % 区切り約物(文字クラス4)
@@ -948,17 +956,19 @@
   \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
 
 % 数式フォント設定
-\ifx l\jlreq at engine\else
-  \DeclareSymbolFont{mincho}{\jlreq at yokokanjiencoding}{mc}{m}{n}
-  \DeclareSymbolFontAlphabet{\mathmc}{mincho}
-  \SetSymbolFont{mincho}{bold}{\jlreq at yokokanjiencoding}{gt}{m}{n}
-  \jfam\symmincho
-  \DeclareMathAlphabet{\mathgt}{\jlreq at yokokanjiencoding}{gt}{m}{n}
+\ifjlreq at option@enablejfam
+  \ifx l\jlreq at engine\else
+    \DeclareSymbolFont{mincho}{\jlreq at yokokanjiencoding}{mc}{m}{n}
+    \DeclareSymbolFontAlphabet{\mathmc}{mincho}
+    \SetSymbolFont{mincho}{bold}{\jlreq at yokokanjiencoding}{gt}{m}{n}
+    \jfam\symmincho
+    \DeclareMathAlphabet{\mathgt}{\jlreq at yokokanjiencoding}{gt}{m}{n}
+  \fi
+  \AtBeginDocument{%
+    \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
+    \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
+  }
 \fi
-\AtBeginDocument{%
-  \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
-  \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
-}
 
 % 和文間隔
 \DeclareRobustCommand*\ {\futurelet\jlreq at nextchar\jlreq at zenkakuspace@ignorespaces}
@@ -1049,18 +1059,18 @@
   \ifdim\@tempskipa=\maxdimen\else
     \appto\jlreq at setfontsizehook{%
       \ltj at setpar@global
-      \ltjsetkanjiskip\jlreq at kanjiskip
+      \ltjsetkanjiskip\jlreqkanjiskip
       \@tempskipa=\ltjgetparameter{xkanjiskip}%
       \ifdim\@tempskipa>0pt
-        \ltjsetxkanjiskip\jlreq at xkanjiskip
+        \ltjsetxkanjiskip\jlreqxkanjiskip
       \fi
     }
   \fi
 \else
   \appto\jlreq at setfontsizehook{%
-    \kanjiskip=\jlreq at kanjiskip
+    \kanjiskip=\jlreqkanjiskip
     \ifdim\xkanjiskip>0pt
-      \xkanjiskip=\jlreq at xkanjiskip
+      \xkanjiskip=\jlreqxkanjiskip
     \fi
   }
 \fi
@@ -1381,7 +1391,7 @@
   \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
-      \ClassWarningNoLine{jlreq}{fore_edge is ignored}
+      \ClassWarningNoLine{jlreq}{fore-edge is ignored}
     \fi
   \fi
 \fi
@@ -1511,7 +1521,9 @@
       \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\jlreq at tempdimb}}%
+          \noexpand\def\expandonce{\csname l@#1\endcsname}{%
+            \unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq at tempdimb}%
+          }%
         }%
       }%
     \expandafter\endgroup
@@ -1519,15 +1531,22 @@
   }{\def\jlreq at result{}}%
 }
 
+% \jlreq at heading@make at maketoc{セクション名}{レベル}
 \def\jlreq at heading@make at maketoc#1#2{%
   % 目次への出力をするマクロ.外部に切り出しておく.
   \@ifundefined{jlreq at heading@maketoc@#1}{%
-    % {1 = *}{2 = ラベル}{3 = running head}
+    % {1 = */-}{2 = ラベル}{3 = running head}
+    % 1はcounter=falseならば-,星付き命令ならば*,それ以外は空.
+    % 1が*または-の時は見出しにはラベルが現れないが,2には常にラベルが入るので,必要ならばここで無視する.
     \expandafter\def\csname jlreq at heading@maketoc@#1\endcsname##1##2##3{%
-      \ifnum0\jlreq at ifempty{##1}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0\else
+      \jlreq at iffirsttoken{##1}{*}{}{%
         \csname #1mark\endcsname{##3}%
-        \addcontentsline{toc}{#1}{\protect\numberline{##2}##3}%
-      \fi
+        \ifnum0\jlreq at iffirsttoken{##1}{-}{1}{}\ifnum #2>\c at secnumdepth 1\fi>0
+          \addcontentsline{toc}{#1}{##3}%
+        \else
+          \addcontentsline{toc}{#1}{\jlreq at ifempty{##2}{}{\protect\numberline{##2}}##3}%
+        \fi
+      }{}%
     }%
   }{}%
 }
@@ -1549,6 +1568,7 @@
     \edef\jlreq at label@format{\expandonce{\csname the#1\endcsname}}%
     \def\jlreq at heading@clearpage{\clearpage\hbox{}\clearpage}%
     \def\jlreq at pagestyle{empty}%
+    \newif\ifjlreq at number \jlreq at numbertrue
     \jlreq at parsekeyval[DeclareTobiraHeading:#1]{
       {label_format}{\def\jlreq at label@format{##1}}
       {format}{\def\jlreq at format####1####2{##1}}
@@ -1559,6 +1579,7 @@
           {naka}{\def\jlreq at heading@clearpage{\clearpage\hbox{}\clearpage}}
         }%
       }
+      {number}[true,false]{\csname jlreq at number##1\endcsname}
     }{#3}%
     \def\jlreq at do{}%
     \ifx\jlreq at format\@undefined
@@ -1570,21 +1591,39 @@
     \edef\jlreq at do{%
       \expandonce{\jlreq at do}%
       \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}[####1]####2{%
-        \unexpanded{\ifnum#2>\c at secnumdepth\else}%
-          \unexpanded{\refstepcounter{#1}}%
-        \noexpand\fi
-        \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{}{\expandonce{\jlreq at label@format}}{####1}%
-        \unexpanded{\ifnum#2>\c at secnumdepth\relax}%
+        \ifjlreq at number
+          \unexpanded{\ifnum#2>\c at secnumdepth\else}%
+            \unexpanded{\refstepcounter{#1}}%
+          \noexpand\fi
+        \fi
+        \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{\ifjlreq at number\else -\fi}{\expandonce{\jlreq at label@format}}{####1}%
+        \unexpanded{\jlreq at ifempty{##2}%
+          {\long\gdef\jlreqHeadingText####1{}}%
+          {\long\gdef\jlreqHeadingText####1{####1}}%
+        }%
+        \ifjlreq at number
+          \unexpanded{\ifnum#2>\c at secnumdepth\relax}%
+            \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+            \expandonce{\jlreq at format{}{##1}}%
+          \noexpand\else
+            \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
+            \expandafter\expandonce\expandafter{\jlreq at formatwlabel{##2}}%
+          \noexpand\fi
+        \else
+          \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
           \expandonce{\jlreq at format{}{##1}}%
-        \noexpand\else
-          \expandafter\expandonce\expandafter{\jlreq at formatwlabel{##2}}%
-        \noexpand\fi
+        \fi
         \noexpand\@afterheading
         \expandonce{\jlreq at heading@clearpage}%
         \unexpanded{\if at restonecol\twocolumn\fi}%
       }%
       \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start at s@#1\endcsname}####1{%
-        \expandonce{\jlreq at format{}{##1}}%
+        \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+        \unexpanded{\jlreq at ifempty{##1}%
+          {\long\gdef\jlreqHeadingText####1{}}%
+          {\long\gdef\jlreqHeadingText####1{####1}}%
+        }%
+        \expandonce{\jlreq at format{}{##1}}
         \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq at label@format}}{####1}%
         \noexpand\@afterheading
         \expandonce{\jlreq at heading@clearpage}%
@@ -1613,7 +1652,8 @@
 
 %.. 別行見出し
 % \jlreq at BlockHeading@start:別行見出しを出力する命令.
-% \jlreq at BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 =  フォーマット関連}{5 = 全体フォーマット}*{見出し}[副題]
+% \jlreq at BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = カウンタ関連}{5 =  フォーマット関連}{6 = 全体フォーマット}*{見出し}[副題]
+% カウンタ関連=-,*,無し:-はカウンタ関連を処理しない.*はさらに目次に追加しない(星付き命令と同様).星付きで呼び出された時は常に*同等.
 % スペース関連={配置:lcr(左中央右)}{字下げ(寸法)}{字上げ(寸法)}{前空き}{後空き}{行取りの行数}{空か*か,偶数ページでも改ページを許可するならば空}
 % 前/後空きはprefixにa:/s:/r:が入る.r:は空きがその値そのものになる.a:/s:は行取りに加えて入る.a:で指定された空きはページ行頭では入らない
 % 後空きの時はs:は指定できない.
@@ -1623,19 +1663,19 @@
 % 見出し全体のフォーマット内では#1=ラベル,#2=見出し文字列,#3=副題,それぞれ各々のフォーマットに基づき整形される.
 % ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題
 % ラベルのみのフォーマットは目次に使われる.
-\newcommand{\jlreq at BlockHeading@start}[5]{%
+\newcommand{\jlreq at BlockHeading@start}[6]{%
   \if at noskipsec\leavevmode\fi
-  \edef\jlreq at BlockHeading@start at format{\unexpanded{#4}}% この二つは\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
-  \edef\jlreq at BlockHeading@start at totalformat{\unexpanded{#5}}%
-  \jlreq at BlockHeading@start@{#1}{#2}{#3}%
+  \edef\jlreq at BlockHeading@start at format{\unexpanded{#5}}% この二つは\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
+  \edef\jlreq at BlockHeading@start at totalformat{\unexpanded{#6}}%
+  \jlreq at BlockHeading@start@{#1}{#2}{#3}{#4}%
 }
 % {1 = 命令}{2 = レベル}{3 = スペース関連}
-\newcommand{\jlreq at BlockHeading@start@}[3]{%
-  \@ifstar{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{}}}%
+\newcommand{\jlreq at BlockHeading@start@}[4]{%
+  \@ifstar{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{#4}}}%
 }
 % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}[5 = running head]{6 = 見出し}
 \long\def\jlreq at BlockHeading@start@@#1#2#3#4[#5]#6{%
-  \jlreq at ifnextchar[{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}%
+  \@ifnextchar[{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}%
 }
 
 % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題]
@@ -1696,7 +1736,7 @@
 }
 
 % コントロールシークエンスを保存
-\def\jlreq at BlockHeading@start at afterheading@saveafter at cs#1{%
+\long\def\jlreq at BlockHeading@start at afterheading@saveafter at cs#1{%
   \csgappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{#1}%
   \jlreq at BlockHeading@start at afterheading@saveafter at option
 }
@@ -1704,15 +1744,25 @@
 \def\jlreq at BlockHeading@start at afterheading@saveafter at option{%
   \@ifnextchar[{\jlreq at BlockHeading@start at afterheading@saveafter at option@}{\jlreq at BlockHeading@start at afterheading@saveafter at arguments}%
 }
-\def\jlreq at BlockHeading@start at afterheading@saveafter at option@[#1]{%
+\long\def\jlreq at BlockHeading@start at afterheading@saveafter at option@[#1]{%
   \csxappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{\unexpanded{[#1]}}%
   \jlreq at BlockHeading@start at afterheading@saveafter at arguments
 }
 % 引数を保存し続けるループ
 \def\jlreq at BlockHeading@start at afterheading@saveafter at arguments{%
-  \jlreq at ifnextchar\bgroup{\jlreq at BlockHeading@start at afterheading@saveafter at arguments@}{\jlreq at BlockHeading@start at afterheading}%
+  \futurelet\jlreq at nextchar\jlreq at BlockHeading@start at afterheading@saveafter at arguments@
 }
-\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@#1{%
+\edef\jlreq at BlockHeading@start at afterheading@saveafter at arguments@{%
+  \noexpand\ifx\space\unexpanded{\jlreq at nextchar\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@\else\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@\fi}%
+}
+\expandafter\def\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@\space{%
+  \csgappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{ }%
+  \jlreq at BlockHeading@start at afterheading@saveafter at arguments
+}
+\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@{%
+  \jlreq at ifnextchar\bgroup{\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@@}{\jlreq at BlockHeading@start at afterheading}%
+}
+\long\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@@#1{%
   \csxappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{\unexpanded{{#1}}}%
   \jlreq at BlockHeading@start at afterheading@saveafter at arguments
 }
@@ -1724,10 +1774,10 @@
 % {1 = 命令}{2 = レベル}{3 = スペース関連(横方向のみ)}{4 = フォーマット群}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題}
 \long\def\jlreq at BlockHeading@start at makeoutput#1#2#3#4#5#6#7#8{%
   \begingroup
-    \ifnum0\jlreq at ifempty{#5}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0
+    \ifnum #2>\c at secnumdepth
       \def\jlreq at tempc{*}%
     \else
-      \def\jlreq at tempc{}%
+      \def\jlreq at tempc{#5}%
     \fi
     \long\def\jlreq at tempa##1##2##3##4##5##6##7{%
       \long\def\jlreq at tempa{##1}% 素のラベルのフォーマットを取り出す
@@ -1739,7 +1789,18 @@
     \jlreq at do
     \edef\jlreq at do{%
       \unexpanded{\def\jlreq at resulta}{%
-        \expandafter\if\jlreq at tempc *\else\unexpanded{\refstepcounter{#1}}\fi
+        \ifx\jlreq at tempc\@empty
+          \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
+          \unexpanded{\refstepcounter{#1}}%
+        \else
+          \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+        \fi
+        \jlreq at ifempty{#7}%
+          {\unexpanded{\long\gdef\jlreqHeadingText####1{}}}%
+          {\unexpanded{\long\gdef\jlreqHeadingText####1{####1}}}%
+        \jlreq at ifempty{#8}%
+          {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{}}}%
+          {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{####1}}}%
         \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{\unexpanded{#5}}{\expandonce{\jlreq at tempa}}{\unexpanded{#6}}%
       }%
       \unexpanded{\def\jlreq at resultb}{%
@@ -1801,15 +1862,15 @@
   }%
 }
 
-% 行取り処理
+% 行取り処理.#3が空の時は行取りの処理はしない.(空白挿入は行う.)
 % {1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}{4 = 偶数ページ改ページするなら空}{5 = 出力}
-\long\def\jlreq at BlockHeading@start at gyodori#1#2#3#4#5{{%
-  \par
+\long\def\jlreq at BlockHeading@start at gyodori#1#2#3#4#5{\par{%
   \jlreq at ifempty{#4}{\jlreq at setcurrentpage}{}%
   \setbox\jlreq at tempboxa=\vbox{#5}%
   % \jlreq at tempskip(a/b)に前/後ろに入れるべき値を入れる
   % #1がa:ならばその値は\jlreq at tempskipaには足さず\jlreq at tempskipcに入れておく
   \jlreq at tempskipa=0pt
+  \jlreq at tempskipb=0pt
   \jlreq at tempskipc=0pt
   \jlreq at BlockHeading@start at analyzespace#1:\jlreq at endmark
   \let\jlreq at maeakitype=\jlreq at resulta
@@ -1823,7 +1884,11 @@
   \setbox\jlreq at tempboxb=\hbox{阿}%
   \ifx\jlreq at lines\@empty
     \ifx\jlreq at maeaki\@empty\else
-      \jlreq at tempskipa=\glueexpr\jlreq at maeaki\relax
+      \ifx a\jlreq at maeakitype
+        \jlreq at tempskipc=\glueexpr\jlreq at maeaki\relax
+      \else
+        \jlreq at tempskipa=\glueexpr\jlreq at maeaki\relax
+      \fi
     \fi
     \ifx\jlreq at ushiroaki\@empty\else
       \jlreq at tempskipb=\glueexpr\jlreq at ushiroaki\relax
@@ -1858,26 +1923,42 @@
         \jlreq at tempskipa=\glueexpr\jlreq at tempdima - \jlreq at tempskipb + \baselineskip - \ht\jlreq at tempboxb\relax
       \fi
     \fi
+    % \jlreq at tempdimaの利用ここまで
   \fi
   \jlreq at ifgluezero\jlreq at tempskipc{}{\vskip\jlreq at tempskipc\relax}%
   \ifx r\jlreq at maeakitype\prevdepth=-1000pt\fi
+  % \jlreq at tempdimb, \jlreq at tempdimcに出力対称の高さを深さを代入
+  \jlreq at tempdimb=\ht\jlreq at tempboxa
+  \jlreq at tempdimc=\dp\jlreq at tempboxa
   \setbox\jlreq at tempboxa=\vbox{%
     \jlreq at ifgluezero\jlreq at tempskipa{}{\vskip\jlreq at tempskipa}%
-    \unvbox\jlreq at tempboxa}%
-  \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa\relax
-  \ht\jlreq at tempboxa=0pt
-  \box\jlreq at tempboxa
+    \unvbox\jlreq at tempboxa
+  }%
+  \ifx\jlreq at lines\@empty
+    \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa - \jlreq at tempdimb\relax
+    \ht\jlreq at tempboxa=\jlreq at tempdimb
+    \box\jlreq at tempboxa
+    \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt \else\prevdepth=\jlreq at tempdimc\fi
+    % \jlreq at tempdimb, \jlreq at tempdimcの利用ここまで
+  \else
+    \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa\relax
+    \ht\jlreq at tempboxa=0pt
+    \box\jlreq at tempboxa
+    \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt \else\prevdepth=0pt \fi
+  \fi
   \jlreq at ifempty{#4}{\ifodd\jlreq at currentpage\nobreak\fi}{\nobreak}%
-  \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt\else\prevdepth=0pt\fi
   \jlreq at ifgluezero\jlreq at tempskipb{}{\vskip\jlreq at tempskipb}%
   \edef\jlreq at do{%
-    \unexpanded{\def\jlreq at parhook@gyodori}{%
-      \noexpand\parskip=\the\parskip
-      \unexpanded{\def\jlreq at parhook@gyodori{}}%
-    }%
-    \unexpanded{\parskip=0pt plus 1pt}%
+    \ifdim\parskip=0pt \else
+      \unexpanded{\def\jlreq at parhook@gyodori}{%
+        \noexpand\parskip=\the\parskip
+        \unexpanded{\def\jlreq at parhook@gyodori{}}%
+      }%
+      \unexpanded{\parskip=0pt plus 1pt}%
+    \fi
   }%
-\expandafter}\jlreq at do}
+  \expandafter}\jlreq at do
+}
 \PushPostHook{par}{\jlreq at parhook@gyodori}
 \def\jlreq at parhook@gyodori{}
 
@@ -1891,7 +1972,7 @@
 \def\jlreq at BlockHeading@gyodori at parsekeyval@#1{%
   \@ifnextchar[{\jlreq at BlockHeading@gyodori at parsekeyval@@{#1}}{\jlreq at BlockHeading@gyodori at parsekeyval@@{#1}[jlreq at key]}%
 }
-\def\jlreq at BlockHeading@gyodori at parsekeyval@@#1[#2]#3#4#5#6{%
+\long\def\jlreq at BlockHeading@gyodori at parsekeyval@@#1[#2]#3#4#5#6{%
   \begingroup
     \def\jlreq at lines{#6}%
     \def\jlreq at before@space{}%
@@ -1903,9 +1984,11 @@
       {before_space}{\def\jlreq at before@space{##1}}
       {after_space}{\def\jlreq at after@space{##1}}
       {before_lines}{%
-        \jlreq at iffirsttoken@ignorespaces{##1}{*}%
-          {\edef\jlreq at before@lines{s:\expandonce{\@gobble ##1}}}%
-          {\def\jlreq at before@lines{a:##1}}%
+        \jlreq at ifempty{##1}{\def\jlreq at before@lines{}}{%
+          \jlreq at iffirsttoken@ignorespaces{##1}{*}%
+            {\edef\jlreq at before@lines{s:\expandonce{\@gobble ##1}}}%
+            {\def\jlreq at before@lines{a:##1}}%
+        }%
       }
       {after_lines}{\def\jlreq at after@lines{##1}}
     }{#3}%
@@ -1952,6 +2035,7 @@
     \def\jlreq at second@heading at text@indent at wlabel{0pt}%
     \def\jlreq at second@heading at text@indent at wolabel{0pt}%
     \edef\jlreq at subtitle@format{\unexpanded{---##1---}}%
+    \newif\ifjlreq at subtitleindent@withlabel\jlreq at subtitleindent@withlabeltrue
     \def\jlreq at subtitle@indent{1\zw}%
     \def\jlreq at afterindent{\@afterindenttrue}%
     \def\jlreq at allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空,そうでないなら*
@@ -1959,6 +2043,7 @@
     \def\jlreq at subtitle@indent{1\zw}%
     \def\jlreq at column@spanning{false}%
     \newif\ifjlreq at column@spanning at possible\jlreq at column@spanning at possiblefalse
+    \newif\ifjlreq at number \jlreq at numbertrue
     % a,bみたいなのをaとbにわける.カンマがなければbは空.引数を{a}{b}として##2を呼び出す.
     \def\jlreq at parsecomma##1##2{%
       \jlreq at helper@dividebycomma{##1}%
@@ -2007,7 +2092,15 @@
       }
       {label_format}{\edef\jlreq at label@format{\unexpanded{##1}}}
       {subtitle_format}{\edef\jlreq at subtitle@format{\unexpanded{##1}}}
-      {subtitle_indent}{\def\jlreq at subtitle@indent{##1}}
+      {subtitle_indent}{%
+        \jlreq at iffirsttoken{##1}{*}{%
+          \jlreq at subtitleindent@withlabelfalse
+          \edef\jlreq at subtitle@indent{\expandonce{\@gobble ##1}}%
+        }{%
+          \jlreq at subtitleindent@withlabeltrue
+          \def\jlreq at subtitle@indent{##1}%
+        }%
+      }
       {subtitle_break}[true,false]{\csname jlreq at subtitle@break##1\endcsname}
       {afterindent}[true,false]{\edef\jlreq at afterindent{\expandonce{\csname @afterindent##1\endcsname}}}
       {allowbreak_if_evenpage}[true,false]{%
@@ -2042,6 +2135,7 @@
         }%
         \ifjlreq at tempa\ClassWarningNoLine{jlreq}{Invalid input `##1' for column_spanning in BlockHeading #1}\fi
       }
+      {number}[true,false]{\csname jlreq at number##1\endcsname}
     }{#3}%
     \def\jlreq at do{}% 初期化.これに最終処理を入れていく.
     % 入力チェック
@@ -2051,48 +2145,69 @@
         \def\jlreq at column@spanning{false}%
       \fi
     }{}%
-    \edef\jlreq at format{\expandonce{\jlreq at font}\expandonce{\jlreq at format}}%
     % 空き量などの調整を含んだラベル
     \edef\jlreq at label@format at modified{%
       \noexpand\noindent
-      \unexpanded{\setbox\jlreq at tempboxa=\hbox}{\expandonce{\jlreq at label@format}}%
-      \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq at after@label at space}) + (\expandonce{\jlreq at second@heading at text@indent at wlabel})%
-      \ifjlreq at hang
-        +\wd\jlreq at tempboxa\relax
+      \ifnum 0\ifjlreq at subtitleindent@withlabel 1\fi\ifjlreq at hang 1\fi>0
+        \unexpanded{\setbox\jlreq at tempboxa=\hbox}{\expandonce{\jlreq at label@format}}%
+        \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{\the\wd\jlreq at tempboxa}}%
+        \unexpanded{\box\jlreq at tempboxa}%
       \else
-        \relax
-        \unexpanded{\edef\jlreq at BlockHeading@start at labellength{\the\wd\jlreq at tempboxa}}%
+        \expandonce{\jlreq at label@format}%
       \fi
-      \box\jlreq at tempboxa
+      \inhibitglue\hbox{}%
+      \ifdim\dimexpr\jlreq at after@label at space\relax=0pt \else
+        \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq at after@label at space}\noexpand\relax}%
+      \fi
     }%
     \edef\jlreq at heading@text at format@wlabel{%
-      \ifdim\dimexpr\jlreq at after@label at space\relax=0pt\else
-        \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq at after@label at space}\noexpand\relax}%
+      \ifnum 0\ifdim\jlreq at second@heading at text@indent at wlabel>0pt 1\fi\ifjlreq at hang 1\fi>0
+        \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq at second@heading at text@indent at wlabel})%
+          \ifjlreq at hang + (\expandonce{\jlreq at after@label at space}) + \unexpanded{\jlreq at BlockHeading@start at labellength}\fi
+          \noexpand\relax
       \fi
       \expandonce{\jlreq at heading@text at format}%
     }%
     \edef\jlreq at heading@text at format@wolabel{%
-      \ifdim\dimexpr\jlreq at second@heading at text@indent at wolabel\relax=0pt\else
-        \noexpand\hangindent=\noexpand\dimexpr\expandonce{\jlreq at second@heading at text@indent at wolabel}\noexpand\relax
+      \ifdim\dimexpr\jlreq at second@heading at text@indent at wolabel\relax=0pt \else
+        \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at second@heading at text@indent at wolabel}\noexpand\relax
       \fi
       \expandonce{\jlreq at heading@text at format}%
     }%
     \def\jlreq at make@subtitle at format##1##2{%
       \edef##1{%
-        \ifjlreq at subtitle@break\unexpanded{{\par}\hangafter=0}\fi
-        \unexpanded{\hangindent=\dimexpr\hangindent + }(\expandonce{\jlreq at subtitle@indent}) ##2\noexpand\relax
-        \ifdim\jlreq at subtitle@indent=0pt\else
-          \ifjlreq at subtitle@break\else\unexpanded{\hspace*}{\expandonce{\jlreq at subtitle@indent}}\fi
+        \ifjlreq at subtitle@break
+          \unexpanded{\par}%
+          ##2%
         \fi
-        \unexpanded{\nobreak\noindent}%
-        {\ifx\jlreq at subtitle@font\@empty\else\expandonce{\jlreq at subtitle@font}\fi\expandonce{\jlreq at subtitle@format}}%
+        \ifdim\jlreq at subtitle@indent=0pt \else
+          \ifjlreq at subtitle@break\else
+            \unexpanded{\hspace*}{\expandonce{\jlreq at subtitle@indent}}%
+          \fi
+        \fi
+        \ifjlreq at subtitle@break
+          \unexpanded{\nobreak\noindent}%
+        \fi
+        {\expandonce{\jlreq at subtitle@font}\expandonce{\jlreq at subtitle@format}}%
       }%
     }%
     \jlreq at make@subtitle at format\jlreq at subtitle@format at wlabel{%
-      - (\expandonce{\jlreq at second@heading at text@indent at wlabel})%
-      \ifjlreq at hang\else + (\noexpand\jlreq at BlockHeading@start at labellength)\fi
+      \ifjlreq at subtitleindent@withlabel
+        \noexpand\hangafter=0
+        \unexpanded{\hangindent=\dimexpr}\noexpand\jlreq at BlockHeading@start at labellength + (\expandonce{\jlreq at after@label at space}) + (\expandonce{\jlreq at subtitle@indent})\noexpand\relax
+      \else
+        \ifdim\jlreq at subtitle@indent>0pt
+          \noexpand\hangafter=0
+          \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at subtitle@indent}\noexpand\relax
+        \fi
+      \fi
     }%
-    \jlreq at make@subtitle at format\jlreq at subtitle@format at wolabel{- (\expandonce{\jlreq at second@heading at text@indent at wolabel})}%
+    \jlreq at make@subtitle at format\jlreq at subtitle@format at wolabel{%
+      \ifdim\jlreq at subtitle@indent>0pt
+        \noexpand\hangafter=0
+        \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at subtitle@indent}\noexpand\relax
+      \fi
+    }%
     \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
     \eappto\jlreq at do{\expandonce{\jlreq at result}}%
     \jlreq at BlockHeading@gyodori at parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
@@ -2104,12 +2219,12 @@
           % 前開きが常に入ってしまうので,a:の時は除去する
           \jlreq at iffirsttoken{##1}{a}{\def\jlreq at spaceset{{}{##2}{##3}}}{}
           \edef\jlreq at totalformat{%
-            \noexpand\twocolumn[%
+            \noexpand\twocolumn[{%
               % 普段自動で入る\topskipと\baselineskipを手動で入れる
               \jlreq at iffirsttoken{##1}{r}{}{\unexpanded{\vskip\topskip\relax}}%
               \unexpanded{####1}%
               \jlreq at iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
-            ]%
+            }]%
           }%
         }%
         \expandafter\@tempa\jlreq at spaceset
@@ -2122,11 +2237,12 @@
         \expandonce{\jlreq at pagebreak}%
         \unexpanded{\jlreq at BlockHeading@start{#1}{#2}}%
         {{\expandonce{\jlreq at align}}{\expandonce{\jlreq at indent}}{\expandonce{\jlreq at end@indent}}\expandonce{\jlreq at spaceset}{\expandonce{\jlreq at allowbreak@evenpage}}}%
+        {\ifjlreq at number\else -\fi}%
         {%
           {\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at label@format at modified}}%
           {\expandonce{\jlreq at heading@text at format@wlabel}}{\expandonce{\jlreq at heading@text at format@wolabel}}%
           {\expandonce{\jlreq at subtitle@format at wlabel}}{\expandonce{\jlreq at subtitle@format at wolabel}}%
-          {\expandonce{\jlreq at format}}%
+          {\expandonce{\jlreq at font}\expandonce{\jlreq at format}}%
         }%
         {\expandonce{\jlreq at totalformat}}%
       }}%
@@ -2264,7 +2380,7 @@
   \jlreq at ifendswith{#1}{*}{{%
     \def\@tempa_##1*{\def\@tempa{##1}}%
     \@tempa#1%
-    \ClassWarning{jlreq}{The heading name `\@gobble #1' ends with `*'. Do you mean `\@tempa{*}'? (in SetBlockHeadingSpaces)}%
+    \ClassWarning{jlreq}{The heading name `\@gobble #1' ends with `*'. Do you mean `_\@tempa{*}'? (in SetBlockHeadingSpaces)}%
   }}{}%
   \appto\jlreq at headings{#1}%
   \jlreq at SetBlockHeadingSpaces@v
@@ -2402,15 +2518,15 @@
 }
 
 %.. 同行見出し
-% {1 = 命令名}{2 = レベル}{3 = ラベルフォーマット}{4 = ラベルありフォーマット}{5 = ラベルなしフォーマット}
+% {1 = 命令名}{2 = レベル}{3 = */-}{4 = ラベルフォーマット}{5 = ラベルありフォーマット}{6 = ラベルなしフォーマット}
 % 4,5は見出し文字列が#1になる.
-\long\def\jlreq at RuninHeading@start#1#2#3#4#5{%
-  \edef\jlreq at RuninHeading@start at format@label{\unexpanded{#3}}%
-  \edef\jlreq at RuninHeading@start at format@wlabel{\unexpanded{#4}}%
-  \edef\jlreq at RuninHeading@start at format@wolabel{\unexpanded{#5}}%
-  \@ifstar{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{*}}}{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{}}}%
+\long\def\jlreq at RuninHeading@start#1#2#3#4#5#6{%
+  \edef\jlreq at RuninHeading@start at format@label{\unexpanded{#4}}%
+  \edef\jlreq at RuninHeading@start at format@wlabel{\unexpanded{#5}}%
+  \edef\jlreq at RuninHeading@start at format@wolabel{\unexpanded{#6}}%
+  \@ifstar{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{*}}}{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{#3}}}%
 }
-% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}
+% {1 = 命令名}{2 = レベル}{3 = */-}{4 = running head}{5 = 見出し}
 \long\def\jlreq at RuninHeading@start@#1#2#3[#4]#5{%
   \edef\jlreq at do{\unexpanded{\jlreq at RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}}{\expandonce{\jlreq at RuninHeading@start at format@label}}{\expandonce{\jlreq at RuninHeading@start at format@wlabel}}{\expandonce{\jlreq at RuninHeading@start at format@wolabel}}}%
   \jlreq at do
@@ -2466,6 +2582,7 @@
     \def\jlreq at label@font{}%
     \def\jlreq at label@format{\@seccntformat{#1}}%
     \def\jlreq at after@space{1\zw}%
+    \newif\ifjlreq at number \jlreq at numbertrue
     \jlreq at parsekeyval[RuninHeading:#1]{%
       {font}{\def\jlreq at font{##1}}
       {indent}{\def\jlreq at indent{##1}}
@@ -2479,6 +2596,7 @@
         \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_space in Runin Heading #1 should be not negative}\fi
         \def\jlreq at after@space{##1}%
       }
+      {number}{\csname jlreq at number##1\endcsname}
     }{#3}%
     \newif\ifjlreq at indent@zero
     \jlreq at ifgluezero{\glueexpr\jlreq at indent\relax}{\jlreq at indent@zerotrue}{\jlreq at indent@zerofalse}%
@@ -2507,7 +2625,7 @@
       \noexpand\edef\expandonce{\csname #1\endcsname}{%
         \noexpand\unexpanded{%
           \unexpanded{\jlreq at hook@beforeheadings{#1}}%
-          \unexpanded{\jlreq at RuninHeading@start{#1}{#2}}{\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at format@wlabel}}{\expandonce{\jlreq at format@wolabel}}%
+          \unexpanded{\jlreq at RuninHeading@start{#1}{#2}}{\ifjlreq at number\else -\fi}{\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at format@wlabel}}{\expandonce{\jlreq at format@wolabel}}%
         }%
       }%
     }%
@@ -2564,11 +2682,11 @@
     \hspace*{#2}%
     \copy\@tempboxa
     \hspace*{#3}%
-    \par
     % でかい見出しボックスの分をキャンセルする空きを入れる
     % \baselineskip - \ht\jlreq at tempboxaはTeXが挿入するスキップの分
-    \vskip -\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq at tempboxa\relax\relax
     \edef\jlreq at do{%
+      \noexpand\par
+      \noexpand\vskip -\the\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq at tempboxa\relax\relax
       \noexpand\hangindent=\the\dimexpr#2 + \wd\@tempboxa + #3\relax\relax
       \noexpand\hangafter=-\jlreq at CutinHeading@linecount\relax
     }%
@@ -2652,7 +2770,7 @@
   \jlreq at do
 }
 
-\newcommand*\jlreq at HeadingType[1]{%
+\newcommand*{\jlreq at HeadingType}[1]{%
   \ifcsname jlreq at heading@type@#1\endcsname
     \jlreq at HeadingType@{#1}{\RenewTobiraHeading}{TobiraHeading}{%
     \jlreq at HeadingType@{#1}{\RenewBlockHeading}{BlockHeading}{%
@@ -2663,7 +2781,7 @@
     UndefinedHeading%
   \fi
 }
-\newcommand*\jlreq at HeadingType@[2]{%
+\newcommand*{\jlreq at HeadingType@}[2]{%
   \expandafter\expandafter\expandafter\ifx\csname jlreq at heading@type@#1\endcsname#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
 }
 
@@ -2774,34 +2892,7 @@
     \ModifyHeading{chapter}{pagebreak=clearpage}
   \fi
 }
-\jlreq at switch{\jlreq at article@type}{
-  {book}{%
-    \renewcommand{\jlreq at heading@maketoc at chapter}[3]{%
-      \jlreq at ifempty{#1}{%
-        \chaptermark{#3}%
-        \ifnum0\if at mainmatter\else1\fi\ifnum\jlreq at heading@level at chapter>\c at secnumdepth 1\fi>0
-          \addcontentsline{toc}{chapter}{#3}%
-        \else
-          \addcontentsline{toc}{chapter}{\protect\numberline{#2}#3}%
-        \fi
-      }{}%
-    }
-  }
-  {report}{
-    \renewcommand{\jlreq at heading@maketoc at chapter}[3]{%
-      \jlreq at ifempty{#1}{%
-        \chaptermark{#3}%
-        \ifnum0\ifnum\jlreq at heading@level at chapter>\c at secnumdepth 1\fi>0
-          \addcontentsline{toc}{chapter}{#3}%
-        \else
-          \addcontentsline{toc}{chapter}{\protect\numberline{#2}#3}%
-        \fi
-      }{}%
-    }
-  }
-}
 
-
 %. 注
 % 文字サイズは6ポイントくらい(4.2.3.a)とりあえす\scriptsize
 %.. 合印(4.2.3)
@@ -3230,7 +3321,7 @@
   \def\jlreq at sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
   \long\def\@sidenotetext#1{%
     \marginpar{\reset at font\footnotesize
-      \color at begingroup
+      \color at begingroup\normalcolor
       \@makesidetext{#1}%
       \color at endgroup
     }%
@@ -3326,12 +3417,14 @@
 % \inlinenote*は自動で改行されない.\\で改行位置を指定する.
 \newif\ifjlreq at in@inlinenote
 \jlreq at in@inlinenotefalse
-\newcommand*{\inlinenote}{%
-  \ifjlreq at in@inlinenote\ClassError{jlreq}{\string\inlinenote\space can't be nested}{\@ehc}\fi
+\newcommand*{\jlreq at inlinenote@}[1]{%
+  \ifjlreq at in@inlinenote\ClassError{jlreq}{\string#1\space can't be nested}{\@ehc}\fi
   \jlreq at in@inlinenotetrue
   \ifvmode\leavevmode\fi
-  \@ifstar\jlreq at inlinenote@noauto\jlreq at inlinenote@auto}
-\let\warichu=\inlinenote
+  \@ifstar\jlreq at inlinenote@noauto\jlreq at inlinenote@auto
+}
+\newcommand*{\inlinenote}{\jlreq at inlinenote@{\inlinenote}}
+\newcommand*{\warichu}{\jlreq at inlinenote@{\warichu}}
 
 \newcommand*{\jlreq at inlinenote@auto}[1]{%
   % 割注初め括弧の前の場所を保存
@@ -3359,9 +3452,7 @@
   \else
     \jlreq at tempdima=\dimexpr\jlreq at tempdimc - \jlreq at tempdimb\relax
     \divide\jlreq at tempdima\linewidth
-    \@tempcntb=\number\jlreq at tempdima
-    \multiply\@tempcntb by 2\relax
-    \advance\@tempcntb by 4\relax
+    \@tempcntb=\numexpr 2*\number\jlreq at tempdima + 4\relax
   \fi
   % \jlreq at parshapeargに\parshapeに指定する書式の最後以外を入れる.
   \ifnum\@tempcntb>2\relax
@@ -3492,58 +3583,60 @@
 % として整形した際に,#5行以内に収まる.
 % \jlreq at resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
 \newcommand{\jlreq at inlinenote@determinelength}[7]{%
-%  \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
-  \@tempcnta=1\relax
-  \def\@tempa{}%
-  % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq at tempdima.
-  \@whilenum\@tempcnta<#4\do{%
-    \expandafter\def\expandafter\@tempa\expandafter{\@tempa 0pt \the\jlreq at tempdima}%
-    \advance\@tempcnta by 1\relax
-  }%
-  \@tempcnta=0
-  \jlreq at tempdima=#6\relax
-  % \jlreq at tempdimaを少しずつ伸ばしていく
-  \@whilenum\@tempcnta<1000\do{%
-    \ifnum\@tempcnta>999\relax% ループが長すぎる
-      \global\setbox\jlreq at resultbox=\voidb at x%
-      \@tempcnta=1001\relax
-    \else
-      \setbox\@tempboxa=\vbox{#2%
-        \vbadness=10000\hbadness=10000\vfuzz=\maxdimen\hfuzz=\maxdimen
-        \parindent=0pt\leftskip=0pt\rightskip=0pt
-        \parshape #5 #3 \@tempa 0pt \the\maxdimen
-        #1\par\global\@tempcntb=\prevgraf}%
-%      \message{\string\jlreq at tempdima = \the\jlreq at tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}%
-    \fi
-    \jlreq at getlastbox{\@tempboxa}%
-    \setbox\jlreq at tempboxa=\box\jlreq at resultbox
-    \ifnum\@tempcntb<#5\relax% 行数が達していないならOK
-%      \message{行数 = \the\@tempcntb により確定}
-      % #5行になるまで空の水平ボックスを加えていく.
-      \global\setbox\jlreq at resultbox=\vbox{#2%
-        \unvbox\@tempboxa\hbox{\unhbox\jlreq at tempboxa\unskip\unskip\unpenalty}%
-        \@whilenum\@tempcntb<#5\do{\hbox{}\advance\@tempcntb by 1}}%
-      \@tempcnta=1001\relax
-    \else
-      % そうでない場合は最後の二行の長さを比較する
+  \begingroup
+  %  \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
+    \@tempcnta=1\relax
+    \def\@tempa{}%
+    % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq at tempdima.
+    \@whilenum\@tempcnta<#4\do{%
+      \expandafter\def\expandafter\@tempa\expandafter{\@tempa 0pt \the\jlreq at tempdima}%
+      \advance\@tempcnta by 1\relax
+    }%
+    \@tempcnta=0
+    \jlreq at tempdima=#6\relax
+    % \jlreq at tempdimaを少しずつ伸ばしていく
+    \@whilenum\@tempcnta<1000\do{%
+      \ifnum\@tempcnta>999\relax% ループが長すぎる
+        \global\setbox\jlreq at resultbox=\voidb at x%
+        \@tempcnta=1001\relax
+      \else
+        \setbox\@tempboxa=\vbox{#2%
+          \vbadness=10000\hbadness=10000\vfuzz=\maxdimen\hfuzz=\maxdimen
+          \parindent=0pt\leftskip=0pt\rightskip=0pt
+          \parshape #5 #3 \@tempa 0pt \the\maxdimen
+          #1\par\global\@tempcntb=\prevgraf}%
+  %      \message{\string\jlreq at tempdima = \the\jlreq at tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}%
+      \fi
       \jlreq at getlastbox{\@tempboxa}%
-      \setbox\jlreq at tempboxb=\box\jlreq at resultbox
-%      \message{最終行の長さ \the\wd\jlreq at tempboxa, その前の長さ \the\wd\jlreq at tempboxb}%
-      \ifdim\wd\jlreq at tempboxa>\wd\jlreq at tempboxb
-        \advance\jlreq at tempdima by 0.3pt\relax% 0.3ptに意味はない
+      \setbox\jlreq at tempboxa=\box\jlreq at resultbox
+      \ifnum\@tempcntb<#5\relax% 行数が達していないならOK
+  %      \message{行数 = \the\@tempcntb により確定}
+        % #5行になるまで空の水平ボックスを加えていく.
+        \global\setbox\jlreq at resultbox=\vbox{#2%
+          \unvbox\@tempboxa\hbox{\unhbox\jlreq at tempboxa\unskip\unskip\unpenalty}%
+          \@whilenum\@tempcntb<#5\do{\hbox{}\advance\@tempcntb by 1}}%
+        \@tempcnta=1001\relax
       \else
-        % 後ろが短いのでOK
-        \global\setbox\jlreq at resultbox=\vbox{#2\unvbox\@tempboxa\box\jlreq at tempboxb\box\jlreq at tempboxa}%
-        \jlreq at resultdimen=\jlreq at tempdima
+        % そうでない場合は最後の二行の長さを比較する
+        \jlreq at getlastbox{\@tempboxa}%
+        \setbox\jlreq at tempboxb=\box\jlreq at resultbox
+  %      \message{最終行の長さ \the\wd\jlreq at tempboxa, その前の長さ \the\wd\jlreq at tempboxb}%
+        \ifdim\wd\jlreq at tempboxa>\wd\jlreq at tempboxb
+          \advance\jlreq at tempdima by 0.3pt\relax% 0.3ptに意味はない
+        \else
+          % 後ろが短いのでOK
+          \global\setbox\jlreq at resultbox=\vbox{#2\unvbox\@tempboxa\box\jlreq at tempboxb\box\jlreq at tempboxa}%
+          \jlreq at resultdimen=\jlreq at tempdima
+          \@tempcnta=1001\relax
+        \fi
+      \fi
+      \ifdim\jlreq at tempdima>#7\relax
+        \global\setbox\jlreq at resultbox=\box\voidb at x
         \@tempcnta=1001\relax
       \fi
-    \fi
-    \ifdim\jlreq at tempdima>#7\relax
-      \global\setbox\jlreq at resultbox=\box\voidb at x
-      \@tempcnta=1001\relax
-    \fi
-    \advance\@tempcnta by 1\relax
-  }%
+      \advance\@tempcnta by 1\relax
+    }%
+  \endgroup
 }
 
 %. ページスタイル.
@@ -3594,6 +3687,7 @@
     {center}{\def\jlreq at tempd{#1}}
     {gutter}{\if at tate\def\jlreq at tempd{right}\else\def\jlreq at tempd{left}\fi}
     {fore_edge}{\if at tate\def\jlreq at tempd{left}\else\def\jlreq at tempd{right}\fi}
+    {fore-edge}{\if at tate\def\jlreq at tempd{left}\else\def\jlreq at tempd{right}\fi}
     {\ClassError{jlreq}{Invalid position: #1}{\@ehc}}
   }%
 }
@@ -3859,7 +3953,11 @@
 
 \def\jlreq at pagestyle@make at headingmark@@#1#2#3#4#5{%
   % \jlreq at tempbに\***markの定義を入れる
-  \edef\jlreq at tempb{\expandonce{\csname the#1\endcsname}\noexpand\quad\unexpanded{##1}}%
+  \edef\jlreq at tempb{%
+    \expandonce{\csname the#1\endcsname}%
+    \noexpand\ifx\expandonce{\csname the#1\endcsname}\unexpanded{\@empty\else\quad\fi}%
+    \unexpanded{##1}%
+  }%
   \jlreq at parsekeyval@nokey{%
     \jlreq at ifempty{##1}{}{\ifthenelse{\equal{##1}{#3}}{\edef\jlreq at tempb{\unexpanded{##2}}}{}}%
     \ifthenelse{\equal{##1}{_#1}}{\edef\jlreq at tempb{\unexpanded{##2}}}{}%
@@ -3907,20 +4005,20 @@
 
 % #1の左右に傍注調整用の空白を入れて#1に代入する
 \def\jlreq at pagestyle@addsidenotemargin at left#1{%
-  \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{}{\marginparwidth+\marginparsep}%
+  \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{}%
 }
-\def\jlreq at pagestyle@addsidenotemargin at right#1{
-  \jlreq at pagestyle@addsidenotemargin@{#1}{}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}%
+\def\jlreq at pagestyle@addsidenotemargin at right#1{%
+  \jlreq at pagestyle@addsidenotemargin@{#1}{}{\marginparwidth+\marginparsep}%
 }
-\def\jlreq at pagestyle@addsidenotemargin at bothside#1{
-  \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}{2\marginparwidth+2\marginparsep}%
+\def\jlreq at pagestyle@addsidenotemargin at bothside#1{%
+  \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}%
 }
 % #2: 左,#3:右,#4:#2 + #3
-\def\jlreq at pagestyle@addsidenotemargin@#1#2#3#4{%
+\def\jlreq at pagestyle@addsidenotemargin@#1#2#3{%
   \ifx#1\@empty\else
     \edef#1{%
       \jlreq at ifempty{#2}{}{\unexpanded{\hskip-\dimexpr #2\relax}}%
-      \unexpanded{\hbox to \dimexpr\textwidth + #4\relax}{\expandonce{#1}}%
+      \expandonce{#1}%
       \jlreq at ifempty{#3}{}{\unexpanded{\hskip-\dimexpr #3\relax}}%
     }%
   \fi
@@ -3931,9 +4029,9 @@
   \ifx#1\@empty\ifx#4\@empty\else\eappto#2{\expandonce{#3}\expandonce{#4}}\def#4{}\fi\fi
 }
 
-% #1: ターゲットなコントロールシークエンスの名前,#2:*ならばreverseする,#3:空き
 % #1に入っている{柱1}{柱2}... という並びから,実際に出力する柱を構築する.
 % 間に空白を入れる.
+% #1: ターゲットなコントロールシークエンスの名前,#2:*ならばreverseする,#3:空き
 \def\jlreq at pagestyle@make at runninghead#1#2#3{%
   \expandafter\ifx\csname #1\endcsname\@empty\expandafter\@gobble\else\expandafter\@firstofone\fi{%
     \edef\jlreq at do{%
@@ -3967,6 +4065,15 @@
   }%
 }
 
+% #1= cs,#2 = フォーマットの入ったcs,#3 = デフォルトフォーマットの入ったcs
+\def\jlreq at pagestyle@applyformat#1#2#3{%
+  % デフォルト時に限り,\hbox to ***{空トークン}を避ける
+  \ifnum 0\ifx#1\@empty\else 1\fi\ifx#2\relax\else 1\fi>0
+    \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\ifx#2\relax\expandonce{#3}\else\expandonce{#2}\fi}}\jlreq at do
+    \edef#1{\expandafter\expandonce\expandafter{\expandafter\jlreq at tempa\expandafter{#1}}}%
+  \fi
+}
+
 %.. \DeclarePageStyle
 \newcommand{\DeclarePageStyle}[2]{%
   \expandafter\edef\csname jlreq at pagestyle@setting@#1\endcsname{\unexpanded{#2}}%
@@ -3979,6 +4086,10 @@
     \def\jlreq at command{}%
     \def\jlreq at mark@format{}%
     \def\jlreq at font{}%
+    \let\jlreq at oddheadformat\relax
+    \let\jlreq at evenheadformat\relax
+    \let\jlreq at oddfootformat\relax
+    \let\jlreq at evenfootformat\relax
     % 柱とノンブルの間
     \def\jlreq at gap{1.5\zw}%
     \def\jlreq at nombre@gap{}%
@@ -4008,6 +4119,10 @@
       {running_head_gap}{\def\jlreq at running@head at gap{##1}}
       % trueにすると,\ps@***実行時にまず\***markを全て\@gobbleにする.
       {clear_markcommand}[true,false]{\csname jlreq at clearmarkcommand##1\endcsname}
+      {odd_head_format}{\edef\jlreq at oddheadformat{\unexpanded{##1}}}
+      {even_head_format}{\edef\jlreq at evenheadformat{\unexpanded{##1}}}
+      {odd_foot_format}{\edef\jlreq at oddfootformat{\unexpanded{##1}}}
+      {even_foot_format}{\edef\jlreq at evenfootformat{\unexpanded{##1}}}
       % 二つ目
       {nombre_ii}{\def\jlreq at nombre@ii{##1}}
       {nombre_ii_position}{\def\jlreq at nombre@ii at position{##1}}
@@ -4120,13 +4235,20 @@
           \fi
         }%
         % \jlreq@(odd|even)headの構築
+        \@ifundefined{jlreq@\jlreq at parity headformat}
+          {\def\jlreq at format{####1}}%
+          {\expandafter\let\expandafter\jlreq at format\csname jlreq@\jlreq at parity headformat\endcsname}%
+        \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\expandonce{\jlreq at format}}}\jlreq at do
+        \edef\jlreq at tempb{%
+          \csexpandonce{jlreq@\jlreq at parity @contents}%
+          \noexpand\hfil
+          \expandonce{\jlreq at nombre@contents}%
+        }%
         \expandafter\edef\csname jlreq@\jlreq at parity head\endcsname{%
           \unexpanded{\setbox\jlreq at tempboxa=\hbox to \dimexpr\headsep + \headheight + \textheight}\if at tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax
           {%
             \unexpanded{\tate\adjustbaseline}%
-            \csexpandonce{jlreq@\jlreq at parity @contents}%
-            \noexpand\hfil
-            \expandonce{\jlreq at nombre@contents}%
+            \expandafter\expandonce\expandafter{\expandafter\jlreq at tempa\expandafter{\jlreq at tempb}}%
           }%
           % Underful対策
           \ifx l\jlreq at engine
@@ -4138,7 +4260,7 @@
       }%
       % \jlreq at tempboxaに入っているボックスを正しく配置する
       \edef\jlreq at lefthead@adjustbox{%
-        \noexpand\hskip\noexpand\dimexpr\if at tate\unexpanded{- \Cdp}\fi - \unexpanded{\headsep - 1\zw\relax}%
+        \noexpand\hskip\noexpand\dimexpr\if at tate\unexpanded{- \Cdp}\fi \unexpanded{- \headsep - 1\zw\relax}%
         \unexpanded{\box\jlreq at tempboxa\hfil}%
       }%
       \edef\jlreq at righthead@adjustbox{%
@@ -4264,6 +4386,15 @@
       \jlreq at pagestyle@setheadfoot{\jlreq at oddfoot}{jlreq at odd@bottom at left}{jlreq at odd@bottom at center}{jlreq at odd@bottom at right}%
       \jlreq at pagestyle@setheadfoot{\jlreq at evenhead}{jlreq at even@top at left}{jlreq at even@top at center}{jlreq at even@top at right}%
       \jlreq at pagestyle@setheadfoot{\jlreq at evenfoot}{jlreq at even@bottom at left}{jlreq at even@bottom at center}{jlreq at even@bottom at right}%
+      \ifdim\marginparwidth>0pt
+        \def\jlreq at defaultformat{\hbox to \jlreqyokoheadlength{####1}}%
+      \else
+        \def\jlreq at defaultformat{####1}%
+      \fi
+      \jlreq at pagestyle@applyformat{\jlreq at oddhead}{\jlreq at oddheadformat}{\jlreq at defaultformat}%
+      \jlreq at pagestyle@applyformat{\jlreq at evenhead}{\jlreq at evenheadformat}{\jlreq at defaultformat}%
+      \jlreq at pagestyle@applyformat{\jlreq at oddfoot}{\jlreq at oddfootformat}{\jlreq at defaultformat}%
+      \jlreq at pagestyle@applyformat{\jlreq at evenfoot}{\jlreq at evenfootformat}{\jlreq at defaultformat}%
       % 傍注用調整
       \ifdim\marginparwidth>0pt
         \if at tate\else
@@ -4304,6 +4435,17 @@
   \jlreq at do
 }
 
+\ifdim\marginparwidth>0pt
+  \if at twocolumn
+    \def\jlreqyokoheadlength{\dimexpr\textwidth + 2\marginparwidth + 2\marginparsep\relax}
+  \else
+    \def\jlreqyokoheadlength{\dimexpr\textwidth + \marginparwidth + \marginparsep\relax}
+  \fi
+\else
+  \def\jlreqyokoheadlength{\textwidth}
+\fi
+\edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if at tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax}
+
 \newcommand*{\NewPageStyle}[2]{%
   \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
 }
@@ -4376,11 +4518,12 @@
   \vskip\abovecaptionskip
   \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\expandonce{\jlreq at makecaption@label at format}}}%
   \jlreq at do
-  \jlreq at ifempty{#1}{}{%
-    \edef\jlreq at tempa{{\noexpand\jlreq@@makecaption at label@font\expandonce{\jlreq at tempa{#1}}\unexpanded{\hskip \glueexpr\jlreq at makecaption@after at label@space\relax}}}%
-  }%
-  \appto\jlreq at tempa{{\jlreq@@makecaption at font #2}}%
-  \setbox\@tempboxa=\hbox{\jlreq at tempa}%
+  \setbox\jlreq at tempboxa=\hbox{\jlreq@@makecaption at label@font #1}%
+  \ifdim\wd\jlreq at tempboxa=0pt
+    \edef\jlreq at tempa{\unexpanded{{\jlreq@@makecaption at font #2}}}%
+  \else
+    \edef\jlreq at tempa{{\noexpand\jlreq@@makecaption at label@font\expandonce{\jlreq at tempa{#1}}\unexpanded{\hskip\glueexpr\jlreq at makecaption@after at label@space\relax}}\unexpanded{{\jlreq@@makecaption at font #2}}}%
+  \fi
   \@ifundefined{@currenvir}{%
     \@ifundefined{@captype}%
       {\def\jlreq at tempb{}}%
@@ -4389,11 +4532,12 @@
   \@ifundefined{jlreq at caption@align@\jlreq at tempb}%
     {\let\jlreq at align=\jlreq at caption@align}%
     {\expandafter\let\expandafter\jlreq at align\csname jlreq at caption@align@\jlreq at tempb\endcsname}%
+  \setbox\@tempboxa=\hbox{\jlreq at tempa}%
   \ifdim\wd\@tempboxa>\hsize\relax
     {%
       \ifx c\jlreq at align\centering\fi
       \ifx r\jlreq at align\raggedleft\fi
-      \jlreq at tempa\par
+      \unhbox\@tempboxa\par
     }%
   \else
     \global\@minipagefalse
@@ -4718,7 +4862,7 @@
       }%
     }%
     \def\jlreq at tempa{%
-      \jlreq at parsekeyval{%
+      \jlreq at parsekeyval[jlreqsetup: itemization_beforeafter_space]{%
         {i}{\appto\jlreq at do{\def\jlreq at itemization@beforeafter at space@i{####1}}}
         {ii}{\appto\jlreq at do{\def\jlreq at itemization@beforeafter at space@ii{####1}}}
         {iii}{\appto\jlreq at do{\def\jlreq at itemization@beforeafter at space@iii{####1}}}
@@ -4968,12 +5112,12 @@
     \interlinepenalty\@M
     \leavevmode
     \@lnumwidth #3\relax
-      \@tempcnta=#1\relax
-      \advance\@tempcnta by -\jlreq at top@contents
-      \@tempdima=1\jlreq at mol
-      \multiply \@tempdima by \@tempcnta
+    \@tempcnta=#1\relax
+    \advance\@tempcnta by -\jlreq at top@contents
+    \@tempdima=1\jlreq at mol
+    \multiply \@tempdima by \@tempcnta
     \advance\leftskip \@lnumwidth \hbox{}\hskip -\leftskip
-      \advance\leftskip\@tempdima
+    \advance\leftskip\@tempdima
     {#4}\nobreak
     \leaders\hbox{$\m at th\mkern \@dotsep mu$\null\inhibitglue ・\inhibitglue\null$\m at th\mkern \@dotsep mu$}%
     \hfill\nobreak
@@ -5053,71 +5197,336 @@
 \newcommand{\subsubitem}{\@idxitem \hspace*{3\jlreq at mol}}
 \newcommand{\indexspace}{\par \vskip 1\jlreq at gol \@plus .5\jlreq at gol \@minus .3\jlreq at gol\relax}
 
+%. 前付,後付,付録
 
-%. 前付,後付,付録
+% \jlreq at matter@heading[restoreする見出し一覧を入れる制御綴]{#2@<見出し命令名>に今の見出しの中身を入れる}{生成する制御綴の名前}{設定}
+\def\jlreq at matter@heading{\@ifnextchar[{\jlreq at matter@heading@}{\jlreq at matter@heading@[]{}}}
+\def\jlreq at matter@heading@[#1]#2#3#4{%
+  \begingroup
+    \def\jlreq at restoreheadings{}% 復帰させる見出し名(カンマ区切り)
+    \def\jlreq at headingscmds{}% \ModiryHeadings**,\RenewHeadings**の塊
+    \jlreq at parsekeyval@nokey{%
+      % ##1 = 見出し命令名, ##2 = 設定
+      \def\jlreq at headingsettings{}% Modifyする中身
+      \def\jlreq at declaretype{Modify}%
+      \def\jlreq at level{}%
+      \jlreq at tempatrue % restore
+      \jlreq at parsekeyval@nokey{%
+        % 各見出し命令に対する設定を解析
+        \ifjlreq at parsekeyval@nokey at novalue{%
+          \eappto\jlreq at headingsettings{\unexpanded{####1}}%
+        }{%
+          \jlreq at switch{####1}{%
+            {heading_type}{%
+              \lowercase{\def\jlreq at tempa{####2}}%
+              \jlreq at switch{\jlreq at tempa}{
+                {tobira}{\def\jlreq at declaretype{RenewTobira}}
+                {block}{\def\jlreq at declaretype{RenewBlock}}
+                {runin}{\def\jlreq at declaretype{RenewRunin}}
+                {cutin}{\def\jlreq at declaretype{RenewCutin}}
+                {modify}{\def\jlreq at declaretype{Modify}}
+                {\ClassError{jlreq}{Unknown heading type `####2'}{\@ehc}}
+              }%
+            }
+            {heading_level}{\def\jlreq at level{####2}}
+            {%
+              \jlreq at ifempty{#1}{\@firstofone}{%
+                \ifthenelse{\equal{####1}{restore}}{%
+                  \csname jlreq at tempa####2\endcsname\@gobble
+                }{\@firstofone}%
+              }%
+              {\eappto\jlreq at headingsettings{\ifx\jlreq at headingsettings\@empty\else ,\fi\unexpanded{####1={####2}}}}%
+            }%
+          }%
+        }%
+      }{##2}%
+      \jlreq at ifempty{#1}{}{%
+        \ifjlreq at tempa
+          \eappto\jlreq at headingscmds{\noexpand\SaveHeading{\unexpanded{##1}}{\expandonce{\csname #2@##1\endcsname}}}%
+          \eappto\jlreq at restoreheadings{\ifx\jlreq at restoreheadings\@empty\else ,\fi\unexpanded{##1}}%
+        \fi
+      }%
+      % \jlreq at declareに\ModifyHeadingか\Renew***Headingを入れる
+      \ifx\jlreq@\@empty\else
+        \edef\jlreq at declare{\expandonce{\csname\jlreq at declaretype Heading\endcsname}{##1}}%
+        \ifthenelse{\NOT \equal{\jlreq at declaretype}{Modify}}{%
+          \ifx\jlreq at level\@empty
+            % \frontmatter時でのレベルを引用する.
+            \edef\jlreq at declare{%
+              \unexpanded{\edef\jlreq at tempa}{\noexpand\unexpanded{\expandonce{\jlreq at declare}}{\noexpand\expandonce{\expandonce{\csname jlreq at heading@level@##1\endcsname}}}}%
+              \noexpand\jlreq at tempa
+            }%
+          \else
+            \eappto\jlreq at declare{{\expandonce{\jlreq at level}}}%
+          \fi
+        }{}%
+        \eappto\jlreq at headingscmds{\expandonce{\jlreq at declare}{\expandonce{\jlreq at headingsettings}}}%
+      \fi
+    }{#4}%
+    \edef\jlreq at do{%
+      \unexpanded{\def#3}{%
+        \expandonce{\jlreq at headingscmds}%
+        \jlreq at ifempty{#1}{}{\unexpanded{\def#1}{\expandonce{\jlreq at restoreheadings}}}%
+      }%
+    }%
+  \expandafter\endgroup
+  \jlreq at do
+}
+
+\def\jlreq at matter@counter at norestore#1#2{%
+  \def#1{}%
+  \jlreq at parsekeyval@nokey{%
+    \jlreq at parsekeyval{
+      {value}{\appto#1{\setcounter{##1}{####1}}}
+      {the}{\eappto#1{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
+    }{##2}%
+  }{#2}%
+}
+
 \ifthenelse{\equal{\jlreq at article@type}{book}}{
+%  \tracingmacros=1
   \newif\if at mainmatter
   \@mainmattertrue
+  \jlreq at jlreqsetup@add{frontmatter_pagebreak}{%
+    \edef\jlreq at frontmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+  }
+  \jlreq at jlreqsetup@add{frontmatter_counter}{%
+    \def\jlreq at frontmatter@counter{}%
+    \def\jlreq at tempa{}% 復帰させるカウンタ名リスト
+    \jlreq at parsekeyval@nokey{%
+      \def\jlreq at tempb{}% 中身
+      \jlreq at tempatrue % restore
+      \jlreq at parsekeyval{
+        {value}{\appto\jlreq at tempb{\setcounter{##1}{####1}}}
+        {restore}{\csname jlreq at tempa####1\endcsname}
+        {the}{\eappto\jlreq at tempb{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
+      }{##2}%
+      \ifjlreq at tempa
+        \epreto\jlreq at tempb{%
+          \noexpand\let\expandonce{\csname jlreq at frontmatter@savedcounter at the@##1\endcsname}\expandonce{\csname the##1\endcsname}%
+          \noexpand\edef\expandonce{\csname jlreq at frontmatter@savedcounter at value@##1\endcsname}{\unexpanded{\the\value{##1}}}%
+        }%
+        \eappto\jlreq at tempa{\ifx\jlreq at tempa\@empty\else ,\fi\unexpanded{##1}}%
+      \fi
+      \eappto\jlreq at frontmatter@counter{\expandonce{\jlreq at tempb}}%
+    }{#1}%
+    \eappto\jlreq at frontmatter@counter{\unexpanded{\def\jlreq at frontmatter@restorecounters}{\expandonce{\jlreq at tempa}}}%
+  }
+  \jlreq at jlreqsetup@add{frontmatter_heading}{\jlreq at matter@heading[\jlreq at frontmatter@restoreheadings]{jlreq at frontmatter@savedheading}{\jlreq at frontmatter@heading}{#1}}
+  \jlreq at jlreqsetup@add{frontmatter_pagestyle}{%
+    \def\jlreq at tempa{}% ページスタイル名
+    \def\jlreq at frontmatter@pagestyle{}%
+    \jlreq at tempatrue % restore
+    \jlreq at parsekeyval@nokey{%
+      \ifjlreq at parsekeyval@nokey at novalue{\def\jlreq at tempa{##1}}{%
+        \jlreq at switch{##1}{%
+          {restore}{\csname jlreq at tempa##2\endcsname}%
+        }%
+      }%
+    }{#1}%
+    \ifjlreq at tempa
+      \appto\jlreq at frontmatter@pagestyle{\let\jlreq at frontmatter@savedpagestyle\jlreq at current@pagestyle}%
+    \fi
+    \ifx\jlreq at tempa\@empty\else
+      \eappto\jlreq at frontmatter@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq at tempa}}}%
+    \fi
+  }
+  \jlreq at jlreqsetup@add{frontmatter_precode}{\edef\jlreq at frontmatter@precode{\unexpanded{#1}}}
+  \jlreq at jlreqsetup@add{frontmatter_postcode}{\edef\jlreq at frontmatter@postcode{\unexpanded{#1}}}
+  \jlreq at jlreqsetup@add{frontmatter_pagination}{%
+    \def\jlreq at pagination@frontmatterstyle{arabic}%
+    \let\jlreq at pagination@mainmatterpagecommand=\pagenumbering
+    \@for\jlreq at tempa:=#1\do{%
+      \jlreq at switch{\jlreq at tempa}{
+        {continuous}{%
+          \def\jlreq at pagination@mainmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c at page}}%
+        }
+        {independent}{\let\jlreq at pagination@mainmatterpagecommand=\pagenumbering}
+        {\edef\jlreq at pagination@frontmatterstyle{\jlreq at tempa}}
+      }%
+    }%
+  }
   \newcommand*{\frontmatter}{%
-    \cleardoublepage
+    \jlreq at frontmatter@precode
+    \jlreq at frontmatter@pagebreak
     \@mainmatterfalse
-    \let\jlreq at pagestyle@atmain\jlreq at current@pagestyle
-    \SaveHeading{chapter}{\jlreq at heading@chapter at atmain}%
-    \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
-    \pagestyle{plain}%
-    \pagenumbering{roman}}
+    \let\jlreq at frontmatter@savedpagestyle\@undefined
+    \jlreq at frontmatter@pagestyle
+    \jlreq at frontmatter@counter
+    \jlreq at frontmatter@heading
+    \expandafter\gdef\expandafter\thepage\expandafter{\csname @\jlreq at pagination@frontmatterstyle\endcsname\c at page}%
+    \jlreq at frontmatter@postcode
+  }
+  \def\jlreq at frontmatter@restorecounters{}
+  \def\jlreq at frontmatter@restoreheadings{}
+  \def\jlreq at frontmatter@restorecommands{}
+  \jlreq at jlreqsetup@add{mainmatter_pagebreak}{%
+    \edef\jlreq at mainmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+  }
+  \jlreq at jlreqsetup@add{mainmatter_pagestyle}{%
+    \edef\jlreq at mainmatter@pagestyle{\jlreq at ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
+  }
+  \jlreq at jlreqsetup@add{mainmatter_counter}{\jlreq at matter@counter at norestore{\jlreq at mainmatter@counter}{#1}}%
+  \jlreq at jlreqsetup@add{mainmatter_heading}{\jlreq at matter@heading{\jlreq at mainmatter@heading}{#1}}%
+  \jlreq at jlreqsetup@add{mainmatter_precode}{\edef\jlreq at mainmatter@precode{\unexpanded{#1}}}%
+  \jlreq at jlreqsetup@add{mainmatter_postcode}{\edef\jlreq at mainmatter@postcode{\unexpanded{#1}}}%
+  \jlreq at jlreqsetup@add{mainmatter_pagination}{%
+    \def\jlreq at pagination@mainmatterstyle{#1}%
+  }
   \newcommand*{\mainmatter}{%
-    \cleardoublepage
+    \jlreq at mainmatter@precode
+    \jlreq at mainmatter@pagebreak
     \@mainmattertrue
-    \@ifundefined{jlreq at pagestyle@atmain}{}{%
-      \expandafter\pagestyle\expandafter{\jlreq at pagestyle@atmain}%
+    \@ifundefined{jlreq at frontmatter@savedpagestyle}{%
+      \jlreq at mainmatter@pagestyle
+    }{%
+      \expandafter\pagestyle\expandafter{\jlreq at frontmatter@savedpagestyle}%
     }%
-    \@ifundefined{jlreq at heading@chapter at atmain}{}{\jlreq at heading@chapter at atmain}%
-    \setcounter{chapter}{0}%
-    \pagenumbering{arabic}}
+    \@for\jlreq at tempa:=\jlreq at frontmatter@restorecounters\do{%
+      \setcounter{\jlreq at tempa}{\csname jlreq at frontmatter@savedcounter at value@\jlreq at tempa\endcsname}%
+      \expandafter\let\csname the\jlreq at tempa\expandafter\endcsname\csname jlreq at frontmatter@savedcounter at the@\jlreq at tempa\endcsname
+    }%
+    \jlreq at mainmatter@counter
+    \@for\jlreq at tempa:=\jlreq at frontmatter@restoreheadings\do{\csname jlreq at frontmatter@savedheading@\jlreq at tempa\endcsname}
+    \jlreq at mainmatter@heading
+    \@for\jlreq at tempa:=\jlreq at frontmatter@restorecommands\do{%
+      \expandafter\let\csname \jlreq at tempa\expandafter\endcsname\csname jlreq at frontmatter@savedcommand@\jlreq at tempa\endcsname
+    }%
+    \expandafter\jlreq at pagination@mainmatterpagecommand\expandafter{\jlreq at pagination@mainmatterstyle}%
+    \jlreq at mainmatter@postcode
+  }
+  \jlreq at jlreqsetup@add{backmatter_pagebreak}{%
+    \edef\jlreq at backmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+  }
+  \jlreq at jlreqsetup@add{backmatter_pagestyle}{%
+    \edef\jlreq at backmatter@pagestyle{\jlreq at ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
+  }
+  \jlreq at jlreqsetup@add{backmatter_counter}{\jlreq at matter@counter at norestore{\jlreq at backmatter@counter}{#1}}%
+  \jlreq at jlreqsetup@add{backmatter_heading}{\jlreq at matter@heading{\jlreq at backmatter@heading}{#1}}
+  \jlreq at jlreqsetup@add{backmatter_precode}{\edef\jlreq at backmatter@precode{\unexpanded{#1}}}
+  \jlreq at jlreqsetup@add{backmatter_postcode}{\edef\jlreq at backmatter@postcode{\unexpanded{#1}}}
+  \jlreq at jlreqsetup@add{backmatter_pagination}{
+    \let\jlreq at pagination@backmatterpagecommand=\pagenumbering
+    \def\jlreq at pagination@backmatterstyle{arabic}%
+    \@for\jlreq at tempa:=#1\do{%
+      \jlreq at switch{\jlreq at tempa}{
+        {continuous}{%
+          \def\jlreq at pagination@backmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c at page}}%
+        }
+        {independent}{\let\jlreq at pagination@backmatterpagecommand=\pagenumbering}
+        {\edef\jlreq at pagination@backmatterstyle{\jlreq at tempa}}
+      }%
+    }%
+  }
   \newcommand*{\backmatter}{%
-    \if at openright
-      \cleardoublepage
-    \else
-      \clearpage
-    \fi
-    \ifthenelse{\equal{\jlreq at article@type}{article}}{}{%book, report
-      \SaveHeading{chapter}{\jlreq at heading@chapter at atmain}%
-      \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
-    }%
-    \pagestyle{plain}%
+    \jlreq at backmatter@precode
+    \jlreq at backmatter@pagebreak
+    \jlreq at backmatter@pagestyle
     \@mainmatterfalse
-    \setcounter{chapter}{0}}
+    \jlreq at backmatter@counter
+    \jlreq at backmatter@heading
+    \expandafter\jlreq at pagination@backmatterpagecommand\expandafter{\jlreq at pagination@backmatterstyle}%
+    \jlreq at backmatter@postcode
+  }
+  \jlreqsetup{
+    frontmatter_pagebreak = cleardoublepage,
+    frontmatter_pagestyle = {plain,restore = true},
+    frontmatter_heading = {chapter={number=false, restore = true}},
+    frontmatter_counter = {
+      figure = {the = \arabic{figure},restore = true},
+      table = {the = \arabic{table},restore = true},
+    },
+    frontmatter_precode = {},
+    frontmatter_postcode = {},
+  }
+  \jlreqsetup{
+    mainmatter_pagebreak = cleardoublepage,
+    mainmatter_counter = {
+      chapter = {value = 0},
+    },
+    mainmatter_pagestyle = {},
+    mainmatter_heading = {},
+    mainmatter_precode = {},
+    mainmatter_postcode = {},
+  }
+  \if at openright
+    \jlreqsetup{backmatter_pagebreak=cleardoublepage}
+  \else
+    \jlreqsetup{backmatter_pagebreak=clearpage}
+  \fi
+  \jlreqsetup{
+    backmatter_pagestyle = plain,
+    backmatter_counter = {
+      chapter={value = 0, the = {}},
+      figure = {value = 0, the = {\arabic{figure}}},
+      table = {value = 0, the = {\arabic{table}}}
+    },
+    backmatter_heading = {chapter = {number = false}},
+    backmatter_precode = {},
+    backmatter_postcode = {}
+  }
+  \jlreqsetup{
+    frontmatter_pagination = {independent,roman},
+    mainmatter_pagination = {arabic},
+    backmatter_pagination = {continuous,arabic},
+  }
 }{}
-\newcommand*{\appendix}{\par
-  \setcounter{section}{0}%
+
+\jlreq at jlreqsetup@add{appendix_counter}{\jlreq at matter@counter at norestore{\jlreq at appendix@counter}{#1}}
+\jlreq at jlreqsetup@add{appendix_heading}{\jlreq at matter@heading{\jlreq at appendix@heading}{#1}}
+\jlreq at jlreqsetup@add{appendix_precode}{\edef\jlreq at appendix@precode{\unexpanded{#1}}}
+\jlreq at jlreqsetup@add{appendix_postcode}{\edef\jlreq at appendix@postcode{\unexpanded{#1}}}
+\newcommand*{\appendix}{%
+  \par
+  \jlreq at appendix@precode
+  \jlreq at appendix@counter
+  \jlreq at appendix@heading
+  \jlreq at appendix@postcode
 }
 
 \ifthenelse{\equal{\jlreq at article@type}{article}}{
-  \appto\appendix{%
-    \setcounter{subsection}{0}%
-    \if at tate
-      \def\thesection{\jlreq at rensuji{\Alph{section}}}%
-    \else
-      \def\thesection{\Alph{section}}%
-    \fi
-  }
+  \if at tate
+    \jlreqsetup{
+      appendix_counter = {
+        section = {value = 0, the = {\jlreq at rensuji{\Alph{section}}}},
+        subsection = {value = 0},
+      }
+    }
+  \else
+    \jlreqsetup{
+      appendix_counter = {
+        section = {value = 0, the = {\Alph{chapter}}},
+        subsection = {value = 0},
+      }
+    }
+  \fi
+ \jlreqsetup{appendix_heading = {},appendix_precode = {},appendix_postcode = {}}
 }{%book, report
-  \appto\appendix{%
-    \setcounter{chapter}{0}%
-    \if at tate
-      \def\thechapter{\jlreq at rensuji{\Alph{chapter}}}%
-    \else
-      \def\thechapter{\Alph{chapter}}%
-    \fi
-    \ModifyHeading{chapter}{label_format={付録\thechapter}}%
-    \ifx\jlreq at current@pagestyle\@undefined\else
-      \ifthenelse{\equal{\jlreq at current@pagestyle}{headings}}{%
-        \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
-        \ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
-      }{}%
-    \fi
-  }
+  \if at tate
+    \jlreqsetup{
+      appendix_counter = {
+        chapter = {value = 0, the = {\jlreq at rensuji{\Alph{chapter}}}},
+      }
+    }
+ \else
+    \jlreqsetup{
+      appendix_counter = {
+        chapter = {value = 0, the = {\Alph{chapter}}},
+      }
+    }
+ \fi
+ \jlreqsetup{
+   appendix_heading = {
+     chapter = {label_format = {付録\thechapter}}
+   },
+   appendix_postcode = {%
+     \ifthenelse{\equal{\jlreq at current@pagestyle}{headings}}{%
+       \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
+       \ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
+     }{}%
+   },
+   appendix_precode = {}
+ }
 }
 
 %. その他諸々



More information about the tex-live-commits mailing list