summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/LICENSE24
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/README-ja.md792
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/README.md192
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html953
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html21
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md19
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html23
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md23
-rw-r--r--Master/texmf-dist/doc/latex/jlreq/jlreq.html368
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty13
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty73
-rw-r--r--Master/texmf-dist/tex/latex/jlreq/jlreq.cls10147
-rw-r--r--Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua2390
-rw-r--r--Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua2846
14 files changed, 9180 insertions, 8704 deletions
diff --git a/Master/texmf-dist/doc/latex/jlreq/LICENSE b/Master/texmf-dist/doc/latex/jlreq/LICENSE
index 6ec189530d2..48c53c7d809 100644
--- a/Master/texmf-dist/doc/latex/jlreq/LICENSE
+++ b/Master/texmf-dist/doc/latex/jlreq/LICENSE
@@ -1,12 +1,12 @@
-(2-clause BSD license)
-jlreq and jlreq-trimmarks
-Copyright 2017-2018, Noriyuki Abe.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+(2-clause BSD license)
+jlreq and jlreq-trimmarks
+Copyright 2017-2018, Noriyuki Abe.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/Master/texmf-dist/doc/latex/jlreq/README-ja.md b/Master/texmf-dist/doc/latex/jlreq/README-ja.md
index 07720fae115..9ef3dfafe03 100644
--- a/Master/texmf-dist/doc/latex/jlreq/README-ja.md
+++ b/Master/texmf-dist/doc/latex/jlreq/README-ja.md
@@ -1,392 +1,400 @@
-# jlreq
-
-## これは何?
-[日本語組版処理の要件](https://www.w3.org/TR/jlreq/ja/)の実装を試みる[LuaTeX-ja](https://osdn.jp/projects/luatex-ja/wiki/FrontPage) / pLaTeX / upLaTeX用のクラスファイルと,それに必要なJFMの組み合わせです.
-
-## 提供されるもの
-クラスファイルjlreq.clsと,横書きLuaTeX-ja用のJFMであるjfm-jlreq.luaが用意されています.また,縦書きのJFMやpLaTeX / upLaTeX 用のJFMを生成するいくつかのスクリプトがあります.
-
-## インストール
-`make`で必要なJFMを生成してください.その後,
-
-* *.tfm -> $TEXMF/fonts/tfm/public/jlreq
-* *.vf -> $TEXMF/fonts/vf/public/jlreq
-* jfm-jlreq.lua jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq
-* jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq
-
-と配置します.`make install`とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います.
-
-## 使い方
-通常通り
-```latex
-\documentclass{jlreq}
-```
-とします.これで横書きのarticle相当の文書クラスとなります.エンジンは自動判定されますが,指定する場合はクラスオプションに`platex/uplatex/lualatex`のいずれかを渡してください.縦書きにするには`tate`オプションを渡します.また,reportやbook相当の文書クラスとするには,それぞれ`report`や`book`オプションを渡します.たとえば,縦書きの本を作成するには
-```latex
-\documentclass[tate,book]{jlreq}
-```
-とします.
-
-その他,`oneside / twoside / onecolumn / twocolumn / titlepage / notitlepage / draft / final / openright / openany / leqno / fleqn`というよくあるオプションを受け付けます.
-
-標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.
-
-### `\jlreqsetup`
-設定用命令です.プリアンブルでしか使えません.文書に対する設定は,クラスオプションとして行うか`\jlreqsetup`を通じて行うかします.どちらで設定するかは設定項目によります.
-
-### `\section`
-`\section*[running head]{見出し文字列}[副題]`というように,通常の書式に加えて副題を受け付けられるように拡張されています.その他,`\part`(articleのみ),`\chapter`(book/reportのみ),`\subsection`,`\subsubsection`も副題を受け付けます.
-
-### `abstract`環境
-プリアンブルにもかけるようになっています.プリアンブルに書かれた場合は,`\maketitle`とともに出力されます.二段組の場合は,段組にならず概要を出力することができます.
-
-### `\sidenote`
-この命令は傍注の幅が正の時にのみ定義されます.デフォルトの基本版面ではこの幅は0に設定されています.従って`\sidenote`は定義されません.後の基本版面の設定を参考にしてください.
-
-`\sidenote`は傍注(縦組みの場合は脚注)を出力します.内部では`\marginpar`を使っています.デフォルトでは`\footnote`と同様の書式となりますが,`\jlreqsetup`で`sidenote_type=symbol`が指定されている場合,その書式は`\sidenote{該当項目}{注}`となります.たとえば
-```latex
-刊行できる\sidenote{原稿}{印刷などの方法により……}を入手する仕事である.
-```
-とします.後の説明も参照してください.
-
-
-### `\endnote`
-後注を指定します.`\footnote`と同様の書式です.デフォルトでは,注自身の出力は見出し直前に行われます.この動作は`\jlreqsetup`に`endnote_position`を渡すことで制御できます.詳しくは後の注関係の説明をご覧ください.また`\theendnotes`を実行するとその場に出力をします.
-
-### `\warichu`
-割注を出力します.行分割位置などは自動で計算されます.(複数回のコンパイルが必要.)`\warichu*`ではこれらの位置を手動で指定できます.書式は
-```
-\warichu*{(一行目前) & (一行目後)\\ (二行目前) & (二行目後)...}
-```
-です.`&`が省略されている場合は自動で調整されます.
-
-### `\tatechuyoko`
-縦中横を出力します.`\tatechuyoko{<文字列>}`とします.縦書きでない場所で使うとエラーになります.
-
-### `\jafontsize`
-和文フォントサイズを指定する`\fontsize`です.クラスオプションで`jafontscale=0.9`とされている場合,`\fontsize{9pt}{15pt}`とすると和文フォントのサイズは`8.1pt`となりますが,`\jafontsize{9pt}{15pt}`とすると`9pt`となります.(欧文フォントサイズは`10pt`となる.)なお,第二引数は`\fontsize`の第二引数と全く同じです.
-
-### `\ `
-全角空白(U+3000)一文字からなるマクロです.和文間隔を挿入します.LuaLaTeXでは` `のみでも和文間隔を入力できます.
-
-### その他
-* ルビや圏点は提供されません.[PXrubrica](https://github.com/zr-tex8r/PXrubrica)または`luatexja-ruby`(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います.
-* 日本語組版処理の要件2.3.2.dによれば,横組みにおける二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.`nidanfloat`パッケージを使い,
-
- ```latex
- \usepackage[balance]{nidanfloat}
- ```
-
- とするとこの処理が行われます.ただし,最終ページでの`\newpage`や`\clearpage`が正しく動作しません.詳しくは`nidanfloat`パッケージのマニュアルをご覧ください.
-* フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は`luatexja-fontspec`や`luatexja-preset`(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,[PXchfon](https://github.com/zr-tex8r/PXchfon)での設定が可能です.
-
-
-## 各種設計
-設計はクラスオプションまたは`\jlreqsetup`によりkeyval形式で行います.以下では次の用法を使います.
-
-* `[A/B]`:AまたはBです.`[A/B/C]`等も同様.
-* `<寸法>`:TeXが認識する寸法です.簡単な式(`10pt+10pt`のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)`\jlreqsetup`内のような場所では,常に`\zw`や`\zh`により全角幅が記述できます.以下,たとえば`Q`が利用可能な場合は`<寸法;Q>`のように記述します.
- - `Q`:0.25mmと解釈されます.
- - `zw`, `zh`:全角幅として解釈されます.
-
-
-### 基本版面
-クラスオプションです.
-
-* `paper=[<紙サイズ名>/{<寸法>,<寸法>}]`:紙サイズです.紙サイズ名はa0からa10,b0からb10,c2からc8を指定できます.B列はJIS B列です.また,`{<横>,<縦>}`と直接寸法を指定することもできます.
-* `fontsize=<寸法;Q>`:欧文フォントサイズ.デフォルトは10pt.
-* `jafontsize=<寸法;Q>`:和文フォントサイズ.
-* `jafontscale=<実数値>`:欧文フォントと和文フォントの比(和文 / 欧文).`fontsize`と`jafontsize`が両方指定されている場合は無視される.デフォルトは1.
-* `line_length=<寸法;zw,zh>`:一行の長さ.デフォルトは字送り方向の紙幅の0.75倍.実際の値は一文字の長さの整数倍になるように補正されます.
-* `number_of_lines=<自然数値>`:一ページの行数.デフォルトは行送り方向の紙幅の0.75倍になるような値.
-* `gutter=<寸法;zw,zh>`:のどの余白の大きさ.
- - `tate`無指定時は奇数ページ左,偶数ページ右の余白
- - `tate`指定時は奇数ページ右,偶数ページ左の余白
- - `twoside`が指定されていない時は,常に奇数ページ扱いで余白が設定される
-* `head_space=<寸法;zw,zh>`:天の空き量.デフォルトは中央寄せになるような値.
-* `foot_space=<寸法;zw,zh>`:地の空き量.デフォルトは中央寄せになるような値.
-* `baselineskip=<寸法;Q,zw,zh>`:行送り.デフォルトは`jafontsize`の1.7倍.
-* `linegap=<寸法;Q,zw,zh>`:行間.
-* `headfoot_sidemargin=<寸法;zw,zh>`:柱やノンブルの左右の空き.
-* `column_gap=<寸法;zw,zh>`:段間(`twocolumn`指定時のみ).
-* `sidenote_length=<寸法;zw,zh>`:傍注の幅を指定します.
-
-### 組み方
-クラスオプションです.
-* `open_bracket_pos=[zenkaku_tentsuki/zenkakunibu_nibu/nibu_tentsuki]`:始め括弧が行頭に来た際の配置方法を指定します.それぞれ段落開始全角折り返し行頭天付き(デフォルト),段落開始全角二分折り返し行頭二分,段落開始二分折り返し行頭天付きを意味します.
-* `hanging_punctuation`:ぶら下げ組をします.
-
-### 注関係
-`\jlreqsetup`で指定します.
-
-* `reference_mark=[inline/interlinear]`:合印の配置方法を指定します.`inline`にすると該当項目の後ろの行中に配置します.`interlinear`を指定すると該当項目の上(横組)または右(縦組)に配置します.
-* `sidenote_type=[number/symbol]`:傍注と本文との対応の方法を指定します.`number`が規定で,注の位置に通し番号が入り,それにより対応が示されます.`symbol`とすると,注の位置に特定の記号が入り,また注がついている単語が強調されます.
-* `sidenote_symbol=<記号>`:`sidenote_symbol=symbol`の時に,注の位置に入る記号.デフォルト*
-* `sidenote_keyword_font=<命令>`:`sidenote_symbol=symbol`の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)
-* `endnote_position=[headings/paragraph/{_<見出し名1>,_<見出し名2>,...}]`:後注の出力場所を指定します.`headings`は各見出しの直前(デフォルト),`paragraph`は改段落の際に出力します.また,`endnote_position={_chapter,_section}`とすると,`\chapter`と`\section`の直前に出力します.
-
-### キャプション
-図表のキャプションを`\jlreqsetup`で変更できます.
-* `caption_font=<命令>`:キャプション自身のフォントを指定します.
-* `caption_label_font=<命令>`:キャプションのラベルのフォントを指定します.
-* `caption_after_label_space=<寸法>`:ラベルとキャプションの間の空きを指定します.
-* `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_beforeafter_space=<寸法>`:前後の空きを指定します.`quote_beforeafter_space=1\baselineskip`とすると一行あきます.
-* `quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]`:フォントサイズを指定します.
-
-### 箇条書き
-`\jlreqsetup`で指定します.
-* `itemization_beforeafter_space=<寸法>`:箇条書きの前後の空きを指定します.`itemization_beforeafter_space={i=<寸法>}`とするとトップレベルのみに設定を行います.`itemization_beforeafter_space={0pt,i=10pt,ii=5pt}`とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.レベルは上記のように小文字ローマ数字で指定します.
-* `itemization_itemsep=<寸法>`:項目同士の空きを指定します.
-
-### 定理環境
-`\jlreqsetup`で指定します.
-* `theorem_beforeafter_space=<寸法>`:定理環境の前後の空きを指定します.
-
-## 見出し
-見出しの設定は,`\Declare***Heading`という命令で行います(***には見出しの種類に応じた文字列が入る).書式はすべて
-
-```
-\Declare***Heading{<命令名>}{<レベル>}{<設定>}
-```
-
-となっています.また,`\New***Heading`,`\Renew***Heading`,`\Provide***Heading`も同時に用意されます.それぞれ
-
-* `\New***Heading`:指定した名前の命令が既に定義されている場合はエラー.
-* `\Renew***Heading`:指定した名前の命令が定義されていなければエラー.
-* `\Provide***Heading`:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.
-
-となっています.
-
-### 扉見出し
-`\DeclareTobiraHeading`で作成します.通常のクラスファイルにおける`\section`等と同じ書式の命令ができます.設定は以下の通り.
-
-* `type=[han/naka]`:`han`だと半扉見出しを,`naka`だと中扉見出しを作ります.
-* `pagestyle=<ページスタイル>`:見出し箇所のページスタイルを指定します.
-* `label_format=<書式>`:ラベルを出力する命令を指定します.たとえば`label_format={第\thechapter 章}`のように指定します.
-* `format=<書式>`:実際に出力する書式を指定します.`format={\null\vfil {\Huge\bfseries #1#2}}`のようにします.`#1`はラベルに,`#2`は見出し文字列に置き換えられます.
-
-### 別行見出し
-`\DeclareBlockHeading`で作成します.`\<命令名>*[running head]{見出し文字列}[副題]`という書式の命令を作成します.設定は以下の通り.
-
-#### 書式関連
-* `font=<命令>`:見出しのフォントを指定します.
-* `subtitle_font=<命令>`:副題のフォントを指定します.
-* `label_format=<命令>`:ラベルのフォーマットを指定します.`label_format={第\thechapter 章}`などのようにします.
-* `subtitle_format=<命令>`:副題のフォーマットを指定します.`subtitle_format={「#1」}`のようにします.`#1`が副題自身になります.
-
-#### インデント関連
-* `align=[left/center/right]`:見出し位置の横方向の配置場所を指定します.
-* `indent=<寸法>`:見出し全体の字下げ量を指定します.
-* `end_indent=<寸法>`:見出し全体の字上げ量を指定します.
-* `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
-* `second_heading_text_indent=[<寸法>/{<寸法>,<寸法>}]`:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,`second_heading_text_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.(ラベルがない時は一行目の頭が起点.)また,`second_heading_text_indent={<ラベルがある時>,<ラベルがない時>}`という指定をすると,ラベルの有無に応じて値を変更することができます.`<ラベルがある時>`の指定ではやはり`*`を使うことができます.
-* `subtitle_indent=<寸法>`:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.
-
-#### その他
-* `subtitle_break=[true/false]`:見出し文字列と副題の間を改行するか指定します.
-* `allowbreak_if_evenpage=[true/false]`:見出しが偶数ページにあった場合,その直後の改ページを許可します.
-* `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`の時には無視されます.
-
-#### 行取り
-行取りの指定は以下のいずれかの方法で行うことができます.
-
-* 行数を指定し,その中央に配置します.`lines=<自然数値>`により行数を指定します.`before_lines=<自然数値>`や`after_lines=<自然数値>`により,さらに前後に追加する行数を指定します.たとえば`lines=3,after_lines=1`とすれば,四行の中に配置され,前の空きよりも後ろの空きの方が一行分大きくなります.`before_lines`により指定された空きはページ頭には入りませんが,`before_lines=*1`というように`*`を先頭につけると常に入るようになります.
-* 行数と,前後いずれかの空きを指定します.`lines=<自然数値>`により行数を,`before_space=<寸法>`または`after_space=<寸法>`のいずれかの指定によりそれぞれ前または後ろの空きを指定します.
-* 前後の空きを指定します.`before_space=<寸法>`および`after_space=<寸法>`を指定します.
-
-#### 連続して掲げる見出しの行取り
-``\SetBlockHeadingSpaces``により,見出しが連続して掲げられたときの行取りを設定することができます.``\SetBlockHeadingSpaces``は
-
-```latex
-\SetBlockHeadingSpaces{
- {_part{lines=3,before_lines=1},_section{lines=2},_subsection{lines=2}}
- [lines=5]{_section,23pt,_subsection,16pt}
-}
-```
-
-のように使います.この意味は次の通りです.
-
-* `\part`,`\section`,`\subsection`という順番で見出しが掲げられていて,その前後が見出しでない場合は,`\part`は三行取り+前に一行空き,`\section`と`\subsection`は二行取りとなります.
-* `\section`,`\subsection`という順番で見出しが掲げられていて,その前後が見出しでない場合は,全体で五行取りとし,`\section`と`\subsection`との間に`23pt`の空き,`\subsection`の後に`16pt`の空きを入れます.
-
-個々の設定は以下のようになります.
-
-* 各々の``{}``内には``_<見出し命令名>``か``<寸法>``をカンマ区切りで並べます.
-* 先頭に``[]``で囲まれた設定を追加できます.これは連続して掲げられた見出し全体への設定となります.``lines / before_lines / after_lines / before_space / after_space``が利用可能です.各々の意味は上述の行取り指定と同じです.
-* 寸法はそのまま空き量を表します.
-* ``_<見出し命令名>``の後に``{}``で囲まれた設定を追加することで,その見出しの空き量を設定します.設定しない場合は前後に空きが入りません.
-* 見出しに対する``{}``で囲まれた設定内では,``lines / before_lines / after_lines / before_space / after_space``が利用可能です.各々の意味は上述の行取り指定と同じです.
-* ``{}``で囲まれた部分を``*``のみにすると(例えば``_section{*}``とすると)単独で掲げた場合と同じ設定を使います.
-
-なお,見出しが連続しているかは単純に別行見出しの命令が並んで書かれているかのみで判断します.従ってそれらの命令間に出力には関係しないような命令が挟まっていたとしても,見出しが連続して掲げられているとは判断されません.ただし,見出し命令の間に空白,改行または`\label[<オプション>]{<引数>}…{<引数>}`という形のもののみが挟まれている場合は,見出しが連続していると判断されます.
-
-### 同行見出し
-`\DeclareRuninHeading`で作成します.通常の文書クラスにおける`\section`と同様の,`\<命令名>*[running head]{見出し文字列}`という書式の命令が作成されます.設定は以下の通り.
-
-* `font=<命令>`:見出しのフォントを指定します.
-* `indent=<寸法>` 見出し文字列全体の字下げ量を指定します.
-* `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
-* `label_format=<命令>`:ラベルのフォーマットを指定します.`label_format={\theparagraph}`などのようにします.
-
-### 窓見出し
-`\DeclareCutinHeading`で作成します.`\<命令名>{見出し文字列}`という書式の命令を作成します.設定は以下の通り.
-
-* `font=<命令>`:見出しのフォントを指定します.
-* `indent=<寸法>`:見出し全体の字下げ量を指定します.
-* `after_space=<寸法>`:見出しと本文との間の空きを指定します.
-* `onelinemax=<寸法>`, `twolinemax=<寸法>`:見出し文字列の長さが`onelinemax`以下ならば一行で,`twolinemax`以下ならば二行で窓見出しを出力します.それ以上の場合は三行です.デフォルトはそれぞれ6文字,20文字の長さ.
-
-### `\ModifyHeading`
-既に(上のどれかを使い)定義された見出し命令の設定を変更します.たとえば
-```latex
-\ModifyHeading{section}{lines=10}
-```
-とすると,`\section`のフォントなどの設定はそのままに,行取りのみが10行に変更されます.見出しの種類を変更することはできません.
-
-### `\SaveHeading`
-見出し命令の定義を待避します.
-```latex
-\SaveHeading{section}{\restoresection} % \sectionの中身を\restoresectionに待避.
-\RenewBlockHeading{section}{1}{font=……} % \sectionを新しく定義する.
-……
-\restoresection % \sectionの中身を元に戻す.
-```
-のように使います.
-
-## ページスタイル
-```
-\DeclarePageStyle{<ページスタイル名>}{<設定>}
-```
-によりページスタイルを定義することができます.`<設定>`はkeyval形式です.定義したページスタイルは`\pagestyle`で適用できます.設定は以下の通り.
-
-* `yoko`:横書きで上下に出力します.デフォルト.
-* `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`が指定されている場合,偶数ページはその逆になります.
- - `tate`指定時:`<寸法>`が指定できます.`running_head_position`は柱の天からの下げ量を,`nombre_position`はノンブルの地からの上げ量を指定します.
-* `nombre=<書式>`:出力するノンブルを指定します.デフォルトは`\thepage`.
-* `odd_running_head=<書式>`,`even_running_head=<書式>`:それぞれ奇数ページ,偶数ページの柱を指定します.`_section`のように`_`から始まる名前を指定すると,対応する見出しを出力します.(`_section`だと現在の`\section`を出力する.)
-* `mark_format={[odd=<書式>/even=<書式>/_<見出し命令名>=<書式>],...}`:見出しを柱に出力する際のフォーマットを指定します.`mark_format={_section={節\thesection:#1},_chapter={第\thechapter 章\quad #1}}`のように指定します.見出し命令名の代わりに`odd`や`even`も指定でき,それぞれ奇数ページ/偶数ページの柱の書式になります.`\pagestyle`実行時に`\sectionmark`等を定義することで実現しています.
-
-
-`\NewPageStyle`,`\RenewPageStyle`,`\ProvidePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です.
-
-## JFM
-以下のような独自のJFMを使います.パッケージによっては,パッケージ独自のJFMや,また標準のJFMを使うように設定がし直される場合があります.例えばLuaTeX-jaに付属するluatexja-presetパッケージは通常LuaTeX-ja標準のJFMを使います.本クラスファイルで使っているJFMを使う場合は,
-
-```LaTeX
-\usepackage[jfm_yoko=jlreq,jfm_tate=jlreqv,hiragino-pron]{luatexja-preset}
-```
-
-のようにオプションで指定する必要があります.
-
-### pLaTeX/upLaTeXの場合
-JFMの名前は次の通りです.`[]`で囲まれている文字は設定により入ったり入らなかったりします.
-```
-[u][b][z]jlreq[g][-v]
-```
-それぞれの文字は以下の場合に入ります.
-
-* `u`: upLaTeX利用時
-* `b`: ぶら下げ組み利用時.(クラスオプションに`hanging_punctuation`が指定された時.)
-* `z`: 行頭における開き括弧類の前の空きが,段落開始時が全角二分,折り返し時が二分の時.(クラスオプションに`open_bracket_pos=zenkakunibu_nibu`が指定された時.)
-* `g`: ゴシック用フォント.
-* `-v`: 縦書き用.
-
-例えば,ぶら下げ組みを利用せず,クラスオプションに`open_bracket_pos=zenkakunibu_nibu`が指定されいてるソースをpLaTeXで処理した場合,横書き明朝体には`zjlreq`という名前のJFMが使われます.
-
-### LuaLaTeXの場合
-* 横書き用のJFMは`jlreq`
-* 縦書き用のJFMは`jlreqv`
-
-となります.ゴシックも同じJFMを使います.
-
-
-## その他
-* クラスオプション`jlreq_notes`が渡されると,日本語組版処理の記述と矛盾する設定が行われた場合に通知がされます.
-
-## ライセンス
-このパッケージは二条項BSDライセンスの元で配布されています.詳しくは[LICENSE](LICENSE)をご覧ください.
-
-## 履歴
-* 2017-02-08
- - 最初のバージョン.
-* 2017-02-17
- - いくつかバグを修正.
- - クラスオプション/`\jlreqsetup`にいくつかのキーを追加/変更.
- - `abstract`環境を実装.
- - パッケージを読み込んでいるだけのはやめた.
-* 2017-03-14
- - いくつかバグを修正.
- - 和文ファミリを欧文ファミリに従属させるようにした.
- - `\DeclareBlockHeading`にオプションをたくさん追加.
- - quote環境などを調整するオプションを追加.
-* 2017-03-20
- - バグ修正.
- - `\footnote / \sidenote / \endnote`の周りに必要ならば空白を挿入するようにした.
-* 2017-04-04
- - バグ修正.
- - `\DeclarePageStyle`に`tate`と`font`オプションを追加.
-* 2017-04-29
- - バグ修正
- - `jafontsize`と`jafontscale`をクラスオプションに,また`\jafontsize`を追加.
- - `\tatechuyoko`を追加.
- - クラスオプション`jlreq_warnings`を`jlreq_notes`に変更.
- - いくつかのクラスオプションを`\jlreqsetup`に移動.
- - いくつかのオプションを`\jlreqsetup`に追加.
- - クラスオプションの`paper={<縦>,<横>}`を`paper={<横>,<縦>}`に変更.
-* 2017-06-11
- - `plext` / `lltjext`の読み込みを中止.
- - `\DeclareBlockHeading`に`align`を追加.`indent=center`や`end_indent=center`を廃止.
- - 一部の`\kcatcode` (upLaTeX時) を変更.
-* 2017-08-13
- - `column_spanning`を`\DeclareBlockHeading`に追加.
- - ページレイアウトにおける「本文の長さ」に傍注の長さを入れるようにした.
- - 傍注の長さのデフォルトを0とした.
- - 傍注の長さが0の時には`\sidenote`を定義しないようにした.
- - 和文間隔を挿入する命令を追加.
-* 2017-08-29
- - 縦書きでも著者名が横書きで出てしまうバグを修正.
-* 2017-11-23
- - バグ修正
- - `\SetBlockHeadingSpaces`を追加.
- - `\contentsname` と `\indexname`に入っていたスペースを削除.
-* 2017-12-02
- - バグ修正
-* 2017-12-22
- - JFMを改善.
- - 別行見出しの間の`\label`の検出方法を変更.
- - `\theequation`,`\thefigure`,`\thetable`に章番号を追加.
-* 2018-02-01
- - 縦書きの傍注は奇数ページにのみ出るようにした(改善の余地ありかも).
- - LuaTeX時に`\fnfixbottomtrue`を追加.
- - キャプション関係のオプションを`\jlreqsetup`に追加.
- - `itemization_beforeafter_space`を拡張.
- - バグ修正.
-* 2018-04-11
- - 縦書き二段組みの傍注を下段に出すようにした.
- - `begin_widh_(odd|even)_page`を`\DeclareBlockHeading`に追加.
- - `\labelenumi`らをjarticleなどにあわせた.
- - `column_gap`クラスオプションを使うとコンパイルできなかったバグ修正.
- - `mark_format`を`\DeclarePageStyle`に追加.
-* 2018-05-19
- - 目次内のラベルの長さを今までよりも長くした.
- - 一部のマクロをjlreq-helpers.styに分離した.
- - バグ修正.
-* 2018-06-17
- - シリーズbもゴシックにするようにした.
- - バグ修正.
-
---------------
-Noriyuki Abe
-https://github.com/abenori/jlreq
+# jlreq
+
+## これは何?
+[日本語組版処理の要件](https://www.w3.org/TR/jlreq/ja/)の実装を試みる[LuaTeX-ja](https://osdn.jp/projects/luatex-ja/wiki/FrontPage) / pLaTeX / upLaTeX用のクラスファイルと,それに必要なJFMの組み合わせです.
+
+## 提供されるもの
+クラスファイルjlreq.clsと,横書きLuaTeX-ja用のJFMであるjfm-jlreq.luaが用意されています.また,縦書きのJFMやpLaTeX / upLaTeX 用のJFMを生成するいくつかのスクリプトがあります.
+
+## インストール
+`make`で必要なJFMを生成してください.その後,
+
+* *.tfm -> $TEXMF/fonts/tfm/public/jlreq
+* *.vf -> $TEXMF/fonts/vf/public/jlreq
+* jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq
+* jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq
+
+と配置します.`make install`とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います.
+
+## 使い方
+通常通り
+```latex
+\documentclass{jlreq}
+```
+とします.これで横書きのarticle相当の文書クラスとなります.エンジンは自動判定されますが,指定する場合はクラスオプションに`platex/uplatex/lualatex`のいずれかを渡してください.縦書きにするには`tate`オプションを渡します.また,reportやbook相当の文書クラスとするには,それぞれ`report`や`book`オプションを渡します.たとえば,縦書きの本を作成するには
+```latex
+\documentclass[tate,book]{jlreq}
+```
+とします.
+
+その他,`oneside / twoside / onecolumn / twocolumn / titlepage / notitlepage / draft / final / openright / openany / leqno / fleqn`というよくあるオプションを受け付けます.
+
+標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.
+
+### `\jlreqsetup`
+設定用命令です.プリアンブルでしか使えません.文書に対する設定は,クラスオプションとして行うか`\jlreqsetup`を通じて行うかします.どちらで設定するかは設定項目によります.
+
+### `\section`
+`\section*[running head]{見出し文字列}[副題]`というように,通常の書式に加えて副題を受け付けられるように拡張されています.その他,`\part`(articleのみ),`\chapter`(book/reportのみ),`\subsection`,`\subsubsection`も副題を受け付けます.
+
+### `abstract`環境
+プリアンブルにもかけるようになっています.プリアンブルに書かれた場合は,`\maketitle`とともに出力されます.二段組の場合は,段組にならず概要を出力することができます.
+
+### `\sidenote`
+この命令は傍注の幅が正の時にのみ定義されます.デフォルトの基本版面ではこの幅は0に設定されています.従って`\sidenote`は定義されません.後の基本版面の設定を参考にしてください.
+
+`\sidenote`は傍注(縦組みの場合は脚注)を出力します.内部では`\marginpar`を使っています.デフォルトでは`\footnote`と同様の書式となりますが,`\jlreqsetup`で`sidenote_type=symbol`が指定されている場合,その書式は`\sidenote{該当項目}{注}`となります.たとえば
+```latex
+刊行できる\sidenote{原稿}{印刷などの方法により……}を入手する仕事である.
+```
+とします.後の説明も参照してください.
+
+
+### `\endnote`
+後注を指定します.`\footnote`と同様の書式です.デフォルトでは,注自身の出力は見出し直前に行われます.この動作は`\jlreqsetup`に`endnote_position`を渡すことで制御できます.詳しくは後の注関係の説明をご覧ください.また`\theendnotes`を実行するとその場に出力をします.
+
+### `\warichu`
+割注を出力します.行分割位置などは自動で計算されます.(複数回のコンパイルが必要.)`\warichu*`ではこれらの位置を手動で指定できます.書式は
+```
+\warichu*{(一行目前) & (一行目後)\\ (二行目前) & (二行目後)...}
+```
+です.`&`が省略されている場合は自動で調整されます.
+
+### `\tatechuyoko`
+縦中横を出力します.`\tatechuyoko{<文字列>}`とします.縦書きでない場所で使うとエラーになります.
+
+### `\jafontsize`
+和文フォントサイズを指定する`\fontsize`です.クラスオプションで`jafontscale=0.9`とされている場合,`\fontsize{9pt}{15pt}`とすると和文フォントのサイズは`8.1pt`となりますが,`\jafontsize{9pt}{15pt}`とすると`9pt`となります.(欧文フォントサイズは`10pt`となる.)なお,第二引数は`\fontsize`の第二引数と全く同じです.
+
+### `\ `
+全角空白(U+3000)一文字からなるマクロです.和文間隔を挿入します.LuaLaTeXでは` `のみでも和文間隔を入力できます.
+
+### その他
+* ルビや圏点は提供されません.[PXrubrica](https://github.com/zr-tex8r/PXrubrica)または`luatexja-ruby`(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います.
+* 日本語組版処理の要件2.3.2.dによれば,横組みにおける二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.`nidanfloat`パッケージを使い,
+
+ ```latex
+ \usepackage[balance]{nidanfloat}
+ ```
+
+ とするとこの処理が行われます.ただし,最終ページでの`\newpage`や`\clearpage`が正しく動作しません.詳しくは`nidanfloat`パッケージのマニュアルをご覧ください.
+* フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は`luatexja-fontspec`や`luatexja-preset`(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,[PXchfon](https://github.com/zr-tex8r/PXchfon)での設定が可能です.
+
+
+## 各種設計
+設計はクラスオプションまたは`\jlreqsetup`によりkeyval形式で行います.以下では次の用法を使います.
+
+* `[A/B]`:AまたはBです.`[A/B/C]`等も同様.
+* `<寸法>`:TeXが認識する寸法です.簡単な式(`10pt+10pt`のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)`\jlreqsetup`内のような場所では,常に`\zw`や`\zh`により全角幅が記述できます.以下,たとえば`Q`が利用可能な場合は`<寸法;Q>`のように記述します.
+ - `Q`:0.25mmと解釈されます.
+ - `zw`, `zh`:全角幅として解釈されます.
+
+
+### 基本版面
+クラスオプションです.
+
+* `paper=[<紙サイズ名>/{<寸法>,<寸法>}]`:紙サイズです.紙サイズ名はa0からa10,b0からb10,c2からc8を指定できます.B列はJIS B列です.また,`{<横>,<縦>}`と直接寸法を指定することもできます.
+* `fontsize=<寸法;Q>`:欧文フォントサイズ.デフォルトは10pt.
+* `jafontsize=<寸法;Q>`:和文フォントサイズ.
+* `jafontscale=<実数値>`:欧文フォントと和文フォントの比(和文 / 欧文).`fontsize`と`jafontsize`が両方指定されている場合は無視される.デフォルトは1.
+* `line_length=<寸法;zw,zh>`:一行の長さ.デフォルトは字送り方向の紙幅の0.75倍.実際の値は一文字の長さの整数倍になるように補正されます.
+* `number_of_lines=<自然数値>`:一ページの行数.デフォルトは行送り方向の紙幅の0.75倍になるような値.
+* `gutter=<寸法;zw,zh>`:のどの余白の大きさ.
+ - `tate`無指定時は奇数ページ左,偶数ページ右の余白
+ - `tate`指定時は奇数ページ右,偶数ページ左の余白
+ - `twoside`が指定されていない時は,常に奇数ページ扱いで余白が設定される
+* `head_space=<寸法;zw,zh>`:天の空き量.デフォルトは中央寄せになるような値.
+* `foot_space=<寸法;zw,zh>`:地の空き量.デフォルトは中央寄せになるような値.
+* `baselineskip=<寸法;Q,zw,zh>`:行送り.デフォルトは`jafontsize`の1.7倍.
+* `linegap=<寸法;Q,zw,zh>`:行間.
+* `headfoot_sidemargin=<寸法;zw,zh>`:柱やノンブルの左右の空き.
+* `column_gap=<寸法;zw,zh>`:段間(`twocolumn`指定時のみ).
+* `sidenote_length=<寸法;zw,zh>`:傍注の幅を指定します.
+
+### 組み方
+クラスオプションです.
+* `open_bracket_pos=[zenkaku_tentsuki/zenkakunibu_nibu/nibu_tentsuki]`:始め括弧が行頭に来た際の配置方法を指定します.それぞれ段落開始全角折り返し行頭天付き(デフォルト),段落開始全角二分折り返し行頭二分,段落開始二分折り返し行頭天付きを意味します.
+* `hanging_punctuation`:ぶら下げ組をします.
+
+### 注関係
+`\jlreqsetup`で指定します.
+
+* `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`の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)
+* `endnote_second_indent=<寸法>`: 後柱の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.
+* `endnote_position=[headings/paragraph/{_<見出し名1>,_<見出し名2>,...}]`:後注の出力場所を指定します.`headings`は各見出しの直前(デフォルト),`paragraph`は改段落の際に出力します.また,`endnote_position={_chapter,_section}`とすると,`\chapter`と`\section`の直前に出力します.
+
+### キャプション
+図表のキャプションを`\jlreqsetup`で変更できます.
+* `caption_font=<命令>`:キャプション自身のフォントを指定します.
+* `caption_label_font=<命令>`:キャプションのラベルのフォントを指定します.
+* `caption_after_label_space=<寸法>`:ラベルとキャプションの間の空きを指定します.
+* `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_beforeafter_space=<寸法>`:前後の空きを指定します.`quote_beforeafter_space=1\baselineskip`とすると一行あきます.
+* `quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]`:フォントサイズを指定します.
+
+### 箇条書き
+`\jlreqsetup`で指定します.
+* `itemization_beforeafter_space=<寸法>`:箇条書きの前後の空きを指定します.`itemization_beforeafter_space={i=<寸法>}`とするとトップレベルのみに設定を行います.`itemization_beforeafter_space={0pt,i=10pt,ii=5pt}`とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.レベルは上記のように小文字ローマ数字で指定します.
+* `itemization_itemsep=<寸法>`:項目同士の空きを指定します.
+
+### 定理環境
+`\jlreqsetup`で指定します.
+* `theorem_beforeafter_space=<寸法>`:定理環境の前後の空きを指定します.
+
+## 見出し
+見出しの設定は,`\Declare***Heading`という命令で行います(***には見出しの種類に応じた文字列が入る).書式はすべて
+
+```
+\Declare***Heading{<命令名>}{<レベル>}{<設定>}
+```
+
+となっています.また,`\New***Heading`,`\Renew***Heading`,`\Provide***Heading`も同時に用意されます.それぞれ
+
+* `\New***Heading`:指定した名前の命令が既に定義されている場合はエラー.
+* `\Renew***Heading`:指定した名前の命令が定義されていなければエラー.
+* `\Provide***Heading`:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.
+
+となっています.
+
+### 扉見出し
+`\DeclareTobiraHeading`で作成します.通常のクラスファイルにおける`\section`等と同じ書式の命令ができます.設定は以下の通り.
+
+* `type=[han/naka]`:`han`だと半扉見出しを,`naka`だと中扉見出しを作ります.
+* `pagestyle=<ページスタイル>`:見出し箇所のページスタイルを指定します.
+* `label_format=<書式>`:ラベルを出力する命令を指定します.たとえば`label_format={第\thechapter 章}`のように指定します.
+* `format=<書式>`:実際に出力する書式を指定します.`format={\null\vfil {\Huge\bfseries #1#2}}`のようにします.`#1`はラベルに,`#2`は見出し文字列に置き換えられます.
+
+### 別行見出し
+`\DeclareBlockHeading`で作成します.`\<命令名>*[running head]{見出し文字列}[副題]`という書式の命令を作成します.設定は以下の通り.
+
+#### 書式関連
+* `font=<命令>`:見出しのフォントを指定します.
+* `subtitle_font=<命令>`:副題のフォントを指定します.
+* `label_format=<命令>`:ラベルのフォーマットを指定します.`label_format={第\thechapter 章}`などのようにします.
+* `subtitle_format=<命令>`:副題のフォーマットを指定します.`subtitle_format={「#1」}`のようにします.`#1`が副題自身になります.
+
+#### インデント関連
+* `align=[left/center/right]`:見出し位置の横方向の配置場所を指定します.
+* `indent=<寸法>`:見出し全体の字下げ量を指定します.
+* `end_indent=<寸法>`:見出し全体の字上げ量を指定します.
+* `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
+* `second_heading_text_indent=[<寸法>/{<寸法>,<寸法>}]`:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,`second_heading_text_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.(ラベルがない時は一行目の頭が起点.)また,`second_heading_text_indent={<ラベルがある時>,<ラベルがない時>}`という指定をすると,ラベルの有無に応じて値を変更することができます.`<ラベルがある時>`の指定ではやはり`*`を使うことができます.
+* `subtitle_indent=<寸法>`:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.
+
+#### その他
+* `subtitle_break=[true/false]`:見出し文字列と副題の間を改行するか指定します.
+* `allowbreak_if_evenpage=[true/false]`:見出しが偶数ページにあった場合,その直後の改ページを許可します.
+* `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`の時には無視されます.
+
+#### 行取り
+行取りの指定は以下のいずれかの方法で行うことができます.
+
+* 行数を指定し,その中央に配置します.`lines=<自然数値>`により行数を指定します.`before_lines=<自然数値>`や`after_lines=<自然数値>`により,さらに前後に追加する行数を指定します.たとえば`lines=3,after_lines=1`とすれば,四行の中に配置され,前の空きよりも後ろの空きの方が一行分大きくなります.`before_lines`により指定された空きはページ頭には入りませんが,`before_lines=*1`というように`*`を先頭につけると常に入るようになります.
+* 行数と,前後いずれかの空きを指定します.`lines=<自然数値>`により行数を,`before_space=<寸法>`または`after_space=<寸法>`のいずれかの指定によりそれぞれ前または後ろの空きを指定します.
+* 前後の空きを指定します.`before_space=<寸法>`および`after_space=<寸法>`を指定します.
+
+#### 連続して掲げる見出しの行取り
+``\SetBlockHeadingSpaces``により,見出しが連続して掲げられたときの行取りを設定することができます.``\SetBlockHeadingSpaces``は
+
+```latex
+\SetBlockHeadingSpaces{
+ {_part{lines=3,before_lines=1},_section{lines=2},_subsection{lines=2}}
+ [lines=5]{_section,23pt,_subsection,16pt}
+}
+```
+
+のように使います.この意味は次の通りです.
+
+* `\part`,`\section`,`\subsection`という順番で見出しが掲げられていて,その前後が見出しでない場合は,`\part`は三行取り+前に一行空き,`\section`と`\subsection`は二行取りとなります.
+* `\section`,`\subsection`という順番で見出しが掲げられていて,その前後が見出しでない場合は,全体で五行取りとし,`\section`と`\subsection`との間に`23pt`の空き,`\subsection`の後に`16pt`の空きを入れます.
+
+個々の設定は以下のようになります.
+
+* 各々の``{}``内には``_<見出し命令名>``か``<寸法>``をカンマ区切りで並べます.
+* 先頭に``[]``で囲まれた設定を追加できます.これは連続して掲げられた見出し全体への設定となります.``lines / before_lines / after_lines / before_space / after_space``が利用可能です.各々の意味は上述の行取り指定と同じです.
+* 寸法はそのまま空き量を表します.
+* ``_<見出し命令名>``の後に``{}``で囲まれた設定を追加することで,その見出しの空き量を設定します.設定しない場合は前後に空きが入りません.
+* 見出しに対する``{}``で囲まれた設定内では,``lines / before_lines / after_lines / before_space / after_space``が利用可能です.各々の意味は上述の行取り指定と同じです.
+* ``{}``で囲まれた部分を``*``のみにすると(例えば``_section{*}``とすると)単独で掲げた場合と同じ設定を使います.
+
+なお,見出しが連続しているかは単純に別行見出しの命令が並んで書かれているかのみで判断します.従ってそれらの命令間に出力には関係しないような命令が挟まっていたとしても,見出しが連続して掲げられているとは判断されません.ただし,見出し命令の間に空白,改行または`\label[<オプション>]{<引数>}…{<引数>}`という形のもののみが挟まれている場合は,見出しが連続していると判断されます.
+
+### 同行見出し
+`\DeclareRuninHeading`で作成します.通常の文書クラスにおける`\section`と同様の,`\<命令名>*[running head]{見出し文字列}`という書式の命令が作成されます.設定は以下の通り.
+
+* `font=<命令>`:見出しのフォントを指定します.
+* `indent=<寸法>` 見出し文字列全体の字下げ量を指定します.
+* `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
+* `label_format=<命令>`:ラベルのフォーマットを指定します.`label_format={\theparagraph}`などのようにします.
+
+### 窓見出し
+`\DeclareCutinHeading`で作成します.`\<命令名>{見出し文字列}`という書式の命令を作成します.設定は以下の通り.
+
+* `font=<命令>`:見出しのフォントを指定します.
+* `indent=<寸法>`:見出し全体の字下げ量を指定します.
+* `after_space=<寸法>`:見出しと本文との間の空きを指定します.
+* `onelinemax=<寸法>`, `twolinemax=<寸法>`:見出し文字列の長さが`onelinemax`以下ならば一行で,`twolinemax`以下ならば二行で窓見出しを出力します.それ以上の場合は三行です.デフォルトはそれぞれ6文字,20文字の長さ.
+
+### `\ModifyHeading`
+既に(上のどれかを使い)定義された見出し命令の設定を変更します.たとえば
+```latex
+\ModifyHeading{section}{lines=10}
+```
+とすると,`\section`のフォントなどの設定はそのままに,行取りのみが10行に変更されます.見出しの種類を変更することはできません.
+
+### `\SaveHeading`
+見出し命令の定義を待避します.
+```latex
+\SaveHeading{section}{\restoresection} % \sectionの中身を\restoresectionに待避.
+\RenewBlockHeading{section}{1}{font=……} % \sectionを新しく定義する.
+……
+\restoresection % \sectionの中身を元に戻す.
+```
+のように使います.
+
+## ページスタイル
+```
+\DeclarePageStyle{<ページスタイル名>}{<設定>}
+```
+によりページスタイルを定義することができます.`<設定>`はkeyval形式です.定義したページスタイルは`\pagestyle`で適用できます.設定は以下の通り.
+
+* `yoko`:横書きで上下に出力します.デフォルト.
+* `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`が指定されている場合,偶数ページはその逆になります.
+ - `tate`指定時:`<寸法>`が指定できます.`running_head_position`は柱の天からの下げ量を,`nombre_position`はノンブルの地からの上げ量を指定します.
+* `nombre=<書式>`:出力するノンブルを指定します.デフォルトは`\thepage`.
+* `odd_running_head=<書式>`,`even_running_head=<書式>`:それぞれ奇数ページ,偶数ページの柱を指定します.`_section`のように`_`から始まる名前を指定すると,対応する見出しを出力します.(`_section`だと現在の`\section`を出力する.)
+* `mark_format={[odd=<書式>/even=<書式>/_<見出し命令名>=<書式>],...}`:見出しを柱に出力する際のフォーマットを指定します.`mark_format={_section={節\thesection:#1},_chapter={第\thechapter 章\quad #1}}`のように指定します.見出し命令名の代わりに`odd`や`even`も指定でき,それぞれ奇数ページ/偶数ページの柱の書式になります.`\pagestyle`実行時に`\sectionmark`等を定義することで実現しています.
+* `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`により既存のページスタイルを改変することが可能です.
+
+## JFM
+以下のような独自のJFMを使います.パッケージによっては,パッケージ独自のJFMや,また標準のJFMを使うように設定がし直される場合があります.例えばLuaTeX-jaに付属するluatexja-presetパッケージは通常LuaTeX-ja標準のJFMを使います.本クラスファイルで使っているJFMを使う場合は,
+
+```LaTeX
+\usepackage[jfm_yoko=jlreq,jfm_tate=jlreqv,hiragino-pron]{luatexja-preset}
+```
+
+のようにオプションで指定する必要があります.
+
+### pLaTeX/upLaTeXの場合
+JFMの名前は次の通りです.`[]`で囲まれている文字は設定により入ったり入らなかったりします.
+```
+[u][b][z]jlreq[g][-v]
+```
+それぞれの文字は以下の場合に入ります.
+
+* `u`: upLaTeX利用時
+* `b`: ぶら下げ組み利用時.(クラスオプションに`hanging_punctuation`が指定された時.)
+* `z`: 行頭における開き括弧類の前の空きが,段落開始時が全角二分,折り返し時が二分の時.(クラスオプションに`open_bracket_pos=zenkakunibu_nibu`が指定された時.)
+* `g`: ゴシック用フォント.
+* `-v`: 縦書き用.
+
+例えば,ぶら下げ組みを利用せず,クラスオプションに`open_bracket_pos=zenkakunibu_nibu`が指定されいてるソースをpLaTeXで処理した場合,横書き明朝体には`zjlreq`という名前のJFMが使われます.
+
+### LuaLaTeXの場合
+* 横書き用のJFMは`jlreq`
+* 縦書き用のJFMは`jlreqv`
+
+となります.ゴシックも同じJFMを使います.
+
+
+## その他
+* クラスオプション`jlreq_notes`が渡されると,日本語組版処理の記述と矛盾する設定が行われた場合に通知がされます.
+
+## ライセンス
+このパッケージは二条項BSDライセンスの元で配布されています.詳しくは[LICENSE](LICENSE)をご覧ください.
+
+## 履歴
+* 2017-02-08
+ - 最初のバージョン.
+* 2017-02-17
+ - いくつかバグを修正.
+ - クラスオプション/`\jlreqsetup`にいくつかのキーを追加/変更.
+ - `abstract`環境を実装.
+ - パッケージを読み込んでいるだけのはやめた.
+* 2017-03-14
+ - いくつかバグを修正.
+ - 和文ファミリを欧文ファミリに従属させるようにした.
+ - `\DeclareBlockHeading`にオプションをたくさん追加.
+ - quote環境などを調整するオプションを追加.
+* 2017-03-20
+ - バグ修正.
+ - `\footnote / \sidenote / \endnote`の周りに必要ならば空白を挿入するようにした.
+* 2017-04-04
+ - バグ修正.
+ - `\DeclarePageStyle`に`tate`と`font`オプションを追加.
+* 2017-04-29
+ - バグ修正
+ - `jafontsize`と`jafontscale`をクラスオプションに,また`\jafontsize`を追加.
+ - `\tatechuyoko`を追加.
+ - クラスオプション`jlreq_warnings`を`jlreq_notes`に変更.
+ - いくつかのクラスオプションを`\jlreqsetup`に移動.
+ - いくつかのオプションを`\jlreqsetup`に追加.
+ - クラスオプションの`paper={<縦>,<横>}`を`paper={<横>,<縦>}`に変更.
+* 2017-06-11
+ - `plext` / `lltjext`の読み込みを中止.
+ - `\DeclareBlockHeading`に`align`を追加.`indent=center`や`end_indent=center`を廃止.
+ - 一部の`\kcatcode` (upLaTeX時) を変更.
+* 2017-08-13
+ - `column_spanning`を`\DeclareBlockHeading`に追加.
+ - ページレイアウトにおける「本文の長さ」に傍注の長さを入れるようにした.
+ - 傍注の長さのデフォルトを0とした.
+ - 傍注の長さが0の時には`\sidenote`を定義しないようにした.
+ - 和文間隔を挿入する命令を追加.
+* 2017-08-29
+ - 縦書きでも著者名が横書きで出てしまうバグを修正.
+* 2017-11-23
+ - バグ修正
+ - `\SetBlockHeadingSpaces`を追加.
+ - `\contentsname` と `\indexname`に入っていたスペースを削除.
+* 2017-12-02
+ - バグ修正
+* 2017-12-22
+ - JFMを改善.
+ - 別行見出しの間の`\label`の検出方法を変更.
+ - `\theequation`,`\thefigure`,`\thetable`に章番号を追加.
+* 2018-02-01
+ - 縦書きの傍注は奇数ページにのみ出るようにした(改善の余地ありかも).
+ - LuaTeX時に`\fnfixbottomtrue`を追加.
+ - キャプション関係のオプションを`\jlreqsetup`に追加.
+ - `itemization_beforeafter_space`を拡張.
+ - バグ修正.
+* 2018-04-11
+ - 縦書き二段組みの傍注を下段に出すようにした.
+ - `begin_width_(odd|even)_page`を`\DeclareBlockHeading`に追加.
+ - `\labelenumi`らをjarticleなどにあわせた.
+ - `column_gap`クラスオプションを使うとコンパイルできなかったバグ修正.
+ - `mark_format`を`\DeclarePageStyle`に追加.
+* 2018-05-19
+ - 目次内のラベルの長さを今までよりも長くした.
+ - 一部のマクロをjlreq-helpers.styに分離した.
+ - バグ修正.
+* 2018-06-17
+ - シリーズbもゴシックにするようにした.
+ - バグ修正.
+* 2018-07-31
+ - `\DeclarePageStyle`に`nombre_ii`等を追加.
+ - バグ修正.
+ - `\jlreqsetup`に`footnote_second_indent`と`endnote_second_indent`を追加.
+
+
+--------------
+Noriyuki Abe
+https://github.com/abenori/jlreq
diff --git a/Master/texmf-dist/doc/latex/jlreq/README.md b/Master/texmf-dist/doc/latex/jlreq/README.md
index 4cd2a1850e9..01292255cf0 100644
--- a/Master/texmf-dist/doc/latex/jlreq/README.md
+++ b/Master/texmf-dist/doc/latex/jlreq/README.md
@@ -1,94 +1,98 @@
-# jlreq
-
-## What is this?
-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:
-
-* *.tfm -> $TEXMF/fonts/tfm/public/jlreq
-* *.vf -> $TEXMF/fonts/vf/public/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
-
-## Usage
-See [README-ja.md](README-ja.md) (in Japanese).
-
-## LICENSE
-This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENSE).
-
-## CHANGELOG
-* 2017-02-08
- - First release.
-* 2017-02-17
- - Fixed bugs.
- - Implement `abstract` environment.
- - Changed/Added some keys to class option/`\jlreqsetup`
- - Stopped to load `pxrubirica`, `luatexja-ruby` and `nidanfloat`.
-* 2017-03-14
- - Fixed bugs.
- - `\sffamily` etc. also change the Japanese font family.
- - Added many options to `\DeclareBlockHeading`.
- - Some options related to `quote` environment etc.
-* 2017-03-20
- - Fixed bugs.
- - Insert some spaces around `\footnote / \sidenote / \endnote`.
-* 2017-04-04
- - Fixed a bug.
- - Added options `tate` and `font` to `\DeclarePageStyle`.
-* 2017-04-29
- - Fixed bugs.
- - Added `jafontsize` and `jafontscale` options and `\jafontsize`.
- - Added `\tatechuyoko`.
- - `jlreq_warnings` -> `jlreq_notes` (class option).
- - Moved some class options to `\jlreqsetup`.
- - Added some options to `\jlreqsetup`.
- - `paper={<height>,<width>}` -> `paper={<width>,<height>}`.
-* 2017-06-11
- - Stopped to load `plext` and `lltjext`.
- - Added `align` to `\DeclareBlockHeading` and delete `indent=center`, `end_indent=center`.
- - Changed `\kcatcode` for some characters (upLaTeX).
-* 2017-08-13
- - Added `column_spanning` to `\DeclareBlockHeading`.
- - Sidenotes are a part of the main text now.
- - Changed the default length of sidenotes to 0.
- - jlreq does not define `\sidenote` if the length for sidenotes is zero.
- - Added a command for the full-width ideographic space.
-* 2017-08-29
- - Fixed a bug.
-* 2017-11-23
- - Fixed bugs.
- - Added `\SetBlockHeadingSpaces`.
- - Removed a space from `\contentsname` and `\indexname`.
-* 2017-12-02
- - Fixed bugs.
-* 2017-12-22
- - Improved JFM.
- - Change the way to detect `\label` between block headings.
- - Added chapter number to `\theequation`,`\thefigure`,`\thetable`.
-* 2018-02-01
- - Sidenotes appears only odd pages in `tate` mode.
- - Added `\fnfixbottomtrue` for LuaLaTeX.
- - Added some options related to captions.
- - Extended `itemization_beforeafter_space`.
- - Fixed bugs.
-* 2018-04-11
- - Sidenotes (`\footnote`) appears in the second column in `tate` mode.
- - Added options `begin_widh_(odd|even)_page` to `\DeclareBlockHeading`.
- - Changed `\labelenumi` as in `jarticle` etc.
- - Fix a bug on `column_gap` class option.
- - Added `mark_format` to `\DeclarePageStyle`.
-* 2018-05-19
- - Made the width of the label in the table of contents longer.
- - Moved some macros to jlreq-helpers.sty
- - Fixed bugs.
-* 2018-06-17
- - Gothic font is attached to font shape 'b'.
- - Fixed bugs.
-
-
---------------
-Noriyuki Abe
-https://github.com/abenori/jlreq
+# jlreq
+
+## What is this?
+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:
+
+* *.tfm -> $TEXMF/fonts/tfm/public/jlreq
+* *.vf -> $TEXMF/fonts/vf/public/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
+
+## Usage
+See [README-ja.md](README-ja.md) (in Japanese).
+
+## LICENSE
+This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENSE).
+
+## CHANGELOG
+* 2017-02-08
+ - First release.
+* 2017-02-17
+ - Fixed bugs.
+ - Implement `abstract` environment.
+ - Changed/Added some keys to class option/`\jlreqsetup`
+ - Stopped to load `pxrubirica`, `luatexja-ruby` and `nidanfloat`.
+* 2017-03-14
+ - Fixed bugs.
+ - `\sffamily` etc. also change the Japanese font family.
+ - Added many options to `\DeclareBlockHeading`.
+ - Some options related to `quote` environment etc.
+* 2017-03-20
+ - Fixed bugs.
+ - Insert some spaces around `\footnote / \sidenote / \endnote`.
+* 2017-04-04
+ - Fixed a bug.
+ - Added options `tate` and `font` to `\DeclarePageStyle`.
+* 2017-04-29
+ - Fixed bugs.
+ - Added `jafontsize` and `jafontscale` options and `\jafontsize`.
+ - Added `\tatechuyoko`.
+ - `jlreq_warnings` -> `jlreq_notes` (class option).
+ - Moved some class options to `\jlreqsetup`.
+ - Added some options to `\jlreqsetup`.
+ - `paper={<height>,<width>}` -> `paper={<width>,<height>}`.
+* 2017-06-11
+ - Stopped to load `plext` and `lltjext`.
+ - Added `align` to `\DeclareBlockHeading` and delete `indent=center`, `end_indent=center`.
+ - Changed `\kcatcode` for some characters (upLaTeX).
+* 2017-08-13
+ - Added `column_spanning` to `\DeclareBlockHeading`.
+ - Sidenotes are a part of the main text now.
+ - Changed the default length of sidenotes to 0.
+ - jlreq does not define `\sidenote` if the length for sidenotes is zero.
+ - Added a command for the full-width ideographic space.
+* 2017-08-29
+ - Fixed a bug.
+* 2017-11-23
+ - Fixed bugs.
+ - Added `\SetBlockHeadingSpaces`.
+ - Removed a space from `\contentsname` and `\indexname`.
+* 2017-12-02
+ - Fixed bugs.
+* 2017-12-22
+ - Improved JFM.
+ - Change the way to detect `\label` between block headings.
+ - Added chapter number to `\theequation`,`\thefigure`,`\thetable`.
+* 2018-02-01
+ - Sidenotes appears only odd pages in `tate` mode.
+ - Added `\fnfixbottomtrue` for LuaLaTeX.
+ - Added some options related to captions.
+ - Extended `itemization_beforeafter_space`.
+ - Fixed bugs.
+* 2018-04-11
+ - Sidenotes (`\footnote`) appears in the second column in `tate` mode.
+ - Added options `begin_widh_(odd|even)_page` to `\DeclareBlockHeading`.
+ - Changed `\labelenumi` as in `jarticle` etc.
+ - Fix a bug on `column_gap` class option.
+ - Added `mark_format` to `\DeclarePageStyle`.
+* 2018-05-19
+ - Made the width of the label in the table of contents longer.
+ - Moved some macros to jlreq-helpers.sty
+ - Fixed bugs.
+* 2018-06-17
+ - Gothic font is attached to font shape 'b'.
+ - Fixed bugs.
+* 2018-08-08
+ - Added `nombre_ii` etc. to `\DeclarePageStyle`.
+ - Fixed bugs.
+ - Added `footnote_second_indent` and `endnote_second_indent` to `\jlreqsetup`.
+
+
+--------------
+Noriyuki Abe
+https://github.com/abenori/jlreq
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
index 885d7475429..b3d28bf3e7e 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
@@ -1,472 +1,481 @@
-<!DOCTYPE html>
-<html lang="ja">
-<head>
- <meta charset="utf-8">
- <meta name="generator" content="pandoc">
- <title>jlreq</title>
- <style>
- .markdown-body {
- padding-top: 10px;
- padding-bottom: 10px;
- background-color: white;
- padding: 30px;
- line-height: 170%;
- }
- h1{
- font-size: 200%;
- }
- h2{
- border-style: solid;
- border-width: 0 0 0.1em 0em;
- padding: 0 0 0.2em 0em;
- border-color: #EEEEEE;
- margin-top: 2em;
- }
- h3{
- border-style: solid;
- border-width: 0 0 0 0.5em;
- padding: 0 0 0 0.5em;
- border-color: #EEEEEE;
- margin-top: 2em;
- }
- code{
- white-space: pre;
- font-weight: normal;
- background-color: #F4F4F4;
- border-color: #F4F4F4;
- border-style: solid;
- border-width: .2em .5em;
- border-radius: .2em;
- }
- pre{
- background-color: #F8F8F8;
- border-color: #F8F8F8;
- border-width: 1em;
- border-style: solid;
- border-radius: .5em;
- padding: 0;
- margin: 0;
- line-height: 130%;
- }
- pre code{
- background-color: #F8F8F8;
- border-style: none;
- }
- 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>
-<article class="markdown-body">
-<h1 id="jlreq">jlreq</h1>
-<h2 id="これは何">これは何?</h2>
-<p><a href="https://www.w3.org/TR/jlreq/ja/">日本語組版処理の要件</a>の実装を試みる<a href="https://osdn.jp/projects/luatex-ja/wiki/FrontPage">LuaTeX-ja</a> / pLaTeX / upLaTeX用のクラスファイルと,それに必要なJFMの組み合わせです.</p>
-<h2 id="提供されるもの">提供されるもの</h2>
-<p>クラスファイルjlreq.clsと,横書きLuaTeX-ja用のJFMであるjfm-jlreq.luaが用意されています.また,縦書きのJFMやpLaTeX / upLaTeX 用のJFMを生成するいくつかのスクリプトがあります.</p>
-<h2 id="インストール">インストール</h2>
-<p><code>make</code>で必要なJFMを生成してください.その後,</p>
-<ul>
-<li>*.tfm -&gt; $TEXMF/fonts/tfm/public/jlreq</li>
-<li>*.vf -&gt; $TEXMF/fonts/vf/public/jlreq</li>
-<li>jfm-jlreq.lua jfm-jlreqv.lua -&gt; $TEXMF/tex/luatex/jlreq</li>
-<li>jlreq.cls, jlreq-helpers.sty -&gt; $TEXMF/tex/latex/jlreq</li>
-</ul>
-<p>と配置します.<code>make install</code>とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います.</p>
-<h2 id="使い方">使い方</h2>
-<p>通常通り</p>
-<pre class="sourceCode latex" id="cb1"><code class="sourceCode latex"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">jlreq</span>}</a></code></pre>
-<p>とします.これで横書きのarticle相当の文書クラスとなります.エンジンは自動判定されますが,指定する場合はクラスオプションに<code>platex/uplatex/lualatex</code>のいずれかを渡してください.縦書きにするには<code>tate</code>オプションを渡します.また,reportやbook相当の文書クラスとするには,それぞれ<code>report</code>や<code>book</code>オプションを渡します.たとえば,縦書きの本を作成するには</p>
-<pre class="sourceCode latex" id="cb2"><code class="sourceCode latex"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="bu">\documentclass</span>[tate,book]{<span class="ex">jlreq</span>}</a></code></pre>
-<p>とします.</p>
-<p>その他,<code>oneside / twoside / onecolumn / twocolumn / titlepage / notitlepage / draft / final / openright / openany / leqno / fleqn</code>というよくあるオプションを受け付けます.</p>
-<p>標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.</p>
-<h3 id="jlreqsetup"><code>\jlreqsetup</code></h3>
-<p>設定用命令です.プリアンブルでしか使えません.文書に対する設定は,クラスオプションとして行うか<code>\jlreqsetup</code>を通じて行うかします.どちらで設定するかは設定項目によります.</p>
-<h3 id="section"><code>\section</code></h3>
-<p><code>\section*[running head]{見出し文字列}[副題]</code>というように,通常の書式に加えて副題を受け付けられるように拡張されています.その他,<code>\part</code>(articleのみ),<code>\chapter</code>(book/reportのみ),<code>\subsection</code>,<code>\subsubsection</code>も副題を受け付けます.</p>
-<h3 id="abstract環境"><code>abstract</code>環境</h3>
-<p>プリアンブルにもかけるようになっています.プリアンブルに書かれた場合は,<code>\maketitle</code>とともに出力されます.二段組の場合は,段組にならず概要を出力することができます.</p>
-<h3 id="sidenote"><code>\sidenote</code></h3>
-<p>この命令は傍注の幅が正の時にのみ定義されます.デフォルトの基本版面ではこの幅は0に設定されています.従って<code>\sidenote</code>は定義されません.後の基本版面の設定を参考にしてください.</p>
-<p><code>\sidenote</code>は傍注(縦組みの場合は脚注)を出力します.内部では<code>\marginpar</code>を使っています.デフォルトでは<code>\footnote</code>と同様の書式となりますが,<code>\jlreqsetup</code>で<code>sidenote_type=symbol</code>が指定されている場合,その書式は<code>\sidenote{該当項目}{注}</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">\sidenote</span>{原稿}{印刷などの方法により……}を入手する仕事である.</a></code></pre>
-<p>とします.後の説明も参照してください.</p>
-<h3 id="endnote"><code>\endnote</code></h3>
-<p>後注を指定します.<code>\footnote</code>と同様の書式です.デフォルトでは,注自身の出力は見出し直前に行われます.この動作は<code>\jlreqsetup</code>に<code>endnote_position</code>を渡すことで制御できます.詳しくは後の注関係の説明をご覧ください.また<code>\theendnotes</code>を実行するとその場に出力をします.</p>
-<h3 id="warichu"><code>\warichu</code></h3>
-<p>割注を出力します.行分割位置などは自動で計算されます.(複数回のコンパイルが必要.)<code>\warichu*</code>ではこれらの位置を手動で指定できます.書式は</p>
-<pre><code>\warichu*{(一行目前) &amp; (一行目後)\\ (二行目前) &amp; (二行目後)...}
-</code></pre>
-<p>です.<code>&amp;</code>が省略されている場合は自動で調整されます.</p>
-<h3 id="tatechuyoko"><code>\tatechuyoko</code></h3>
-<p>縦中横を出力します.<code>\tatechuyoko{&lt;文字列&gt;}</code>とします.縦書きでない場所で使うとエラーになります.</p>
-<h3 id="jafontsize"><code>\jafontsize</code></h3>
-<p>和文フォントサイズを指定する<code>\fontsize</code>です.クラスオプションで<code>jafontscale=0.9</code>とされている場合,<code>\fontsize{9pt}{15pt}</code>とすると和文フォントのサイズは<code>8.1pt</code>となりますが,<code>\jafontsize{9pt}{15pt}</code>とすると<code>9pt</code>となります.(欧文フォントサイズは<code>10pt</code>となる.)なお,第二引数は<code>\fontsize</code>の第二引数と全く同じです.</p>
-<h3 id="-"><code>\ </code></h3>
-<p>全角空白(U+3000)一文字からなるマクロです.和文間隔を挿入します.LuaLaTeXでは<code> </code>のみでも和文間隔を入力できます.</p>
-<h3 id="その他">その他</h3>
-<ul>
-<li><p>ルビや圏点は提供されません.<a href="https://github.com/zr-tex8r/PXrubrica">PXrubrica</a>または<code>luatexja-ruby</code>(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います.</p></li>
-<li><p>日本語組版処理の要件2.3.2.dによれば,横組みにおける二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.<code>nidanfloat</code>パッケージを使い,</p>
-<pre class="sourceCode latex" id="cb5"><code class="sourceCode latex"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="bu">\usepackage</span>[balance]{<span class="ex">nidanfloat</span>}</a></code></pre>
-<p>とするとこの処理が行われます.ただし,最終ページでの<code>\newpage</code>や<code>\clearpage</code>が正しく動作しません.詳しくは<code>nidanfloat</code>パッケージのマニュアルをご覧ください.</p></li>
-<li><p>フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は<code>luatexja-fontspec</code>や<code>luatexja-preset</code>(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,<a href="https://github.com/zr-tex8r/PXchfon">PXchfon</a>での設定が可能です.</p></li>
-</ul>
-<h2 id="各種設計">各種設計</h2>
-<p>設計はクラスオプションまたは<code>\jlreqsetup</code>によりkeyval形式で行います.以下では次の用法を使います.</p>
-<ul>
-<li><code>[A/B]</code>:AまたはBです.<code>[A/B/C]</code>等も同様.</li>
-<li><code>&lt;寸法&gt;</code>:TeXが認識する寸法です.簡単な式(<code>10pt+10pt</code>のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)<code>\jlreqsetup</code>内のような場所では,常に<code>\zw</code>や<code>\zh</code>により全角幅が記述できます.以下,たとえば<code>Q</code>が利用可能な場合は<code>&lt;寸法;Q&gt;</code>のように記述します.
-<ul>
-<li><code>Q</code>:0.25mmと解釈されます.</li>
-<li><code>zw</code>, <code>zh</code>:全角幅として解釈されます.</li>
-</ul></li>
-</ul>
-<h3 id="基本版面">基本版面</h3>
-<p>クラスオプションです.</p>
-<ul>
-<li><code>paper=[&lt;紙サイズ名&gt;/{&lt;寸法&gt;,&lt;寸法&gt;}]</code>:紙サイズです.紙サイズ名はa0からa10,b0からb10,c2からc8を指定できます.B列はJIS B列です.また,<code>{&lt;横&gt;,&lt;縦&gt;}</code>と直接寸法を指定することもできます.</li>
-<li><code>fontsize=&lt;寸法;Q&gt;</code>:欧文フォントサイズ.デフォルトは10pt.</li>
-<li><code>jafontsize=&lt;寸法;Q&gt;</code>:和文フォントサイズ.</li>
-<li><code>jafontscale=&lt;実数値&gt;</code>:欧文フォントと和文フォントの比(和文 / 欧文).<code>fontsize</code>と<code>jafontsize</code>が両方指定されている場合は無視される.デフォルトは1.</li>
-<li><code>line_length=&lt;寸法;zw,zh&gt;</code>:一行の長さ.デフォルトは字送り方向の紙幅の0.75倍.実際の値は一文字の長さの整数倍になるように補正されます.</li>
-<li><code>number_of_lines=&lt;自然数値&gt;</code>:一ページの行数.デフォルトは行送り方向の紙幅の0.75倍になるような値.</li>
-<li><code>gutter=&lt;寸法;zw,zh&gt;</code>:のどの余白の大きさ.
-<ul>
-<li><code>tate</code>無指定時は奇数ページ左,偶数ページ右の余白</li>
-<li><code>tate</code>指定時は奇数ページ右,偶数ページ左の余白</li>
-<li><code>twoside</code>が指定されていない時は,常に奇数ページ扱いで余白が設定される</li>
-</ul></li>
-<li><code>head_space=&lt;寸法;zw,zh&gt;</code>:天の空き量.デフォルトは中央寄せになるような値.</li>
-<li><code>foot_space=&lt;寸法;zw,zh&gt;</code>:地の空き量.デフォルトは中央寄せになるような値.</li>
-<li><code>baselineskip=&lt;寸法;Q,zw,zh&gt;</code>:行送り.デフォルトは<code>jafontsize</code>の1.7倍.</li>
-<li><code>linegap=&lt;寸法;Q,zw,zh&gt;</code>:行間.</li>
-<li><code>headfoot_sidemargin=&lt;寸法;zw,zh&gt;</code>:柱やノンブルの左右の空き.</li>
-<li><code>column_gap=&lt;寸法;zw,zh&gt;</code>:段間(<code>twocolumn</code>指定時のみ).</li>
-<li><code>sidenote_length=&lt;寸法;zw,zh&gt;</code>:傍注の幅を指定します.</li>
-</ul>
-<h3 id="組み方">組み方</h3>
-<p>クラスオプションです.</p>
-<ul>
-<li><code>open_bracket_pos=[zenkaku_tentsuki/zenkakunibu_nibu/nibu_tentsuki]</code>:始め括弧が行頭に来た際の配置方法を指定します.それぞれ段落開始全角折り返し行頭天付き(デフォルト),段落開始全角二分折り返し行頭二分,段落開始二分折り返し行頭天付きを意味します.</li>
-<li><code>hanging_punctuation</code>:ぶら下げ組をします.</li>
-</ul>
-<h3 id="注関係">注関係</h3>
-<p><code>\jlreqsetup</code>で指定します.</p>
-<ul>
-<li><code>reference_mark=[inline/interlinear]</code>:合印の配置方法を指定します.<code>inline</code>にすると該当項目の後ろの行中に配置します.<code>interlinear</code>を指定すると該当項目の上(横組)または右(縦組)に配置します.</li>
-<li><code>sidenote_type=[number/symbol]</code>:傍注と本文との対応の方法を指定します.<code>number</code>が規定で,注の位置に通し番号が入り,それにより対応が示されます.<code>symbol</code>とすると,注の位置に特定の記号が入り,また注がついている単語が強調されます.</li>
-<li><code>sidenote_symbol=&lt;記号&gt;</code>:<code>sidenote_symbol=symbol</code>の時に,注の位置に入る記号.デフォルト*</li>
-<li><code>sidenote_keyword_font=&lt;命令&gt;</code>:<code>sidenote_symbol=symbol</code>の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)</li>
-<li><code>endnote_position=[headings/paragraph/{_&lt;見出し名1&gt;,_&lt;見出し名2&gt;,...}]</code>:後注の出力場所を指定します.<code>headings</code>は各見出しの直前(デフォルト),<code>paragraph</code>は改段落の際に出力します.また,<code>endnote_position={_chapter,_section}</code>とすると,<code>\chapter</code>と<code>\section</code>の直前に出力します.</li>
-</ul>
-<h3 id="キャプション">キャプション</h3>
-<p>図表のキャプションを<code>\jlreqsetup</code>で変更できます.</p>
-<ul>
-<li><code>caption_font=&lt;命令&gt;</code>:キャプション自身のフォントを指定します.</li>
-<li><code>caption_label_font=&lt;命令&gt;</code>:キャプションのラベルのフォントを指定します.</li>
-<li><code>caption_after_label_space=&lt;寸法&gt;</code>:ラベルとキャプションの間の空きを指定します.</li>
-<li><code>caption_label_format=&lt;書式&gt;</code>:ラベルの書式を指定します.<code>caption_label_format={#1:}</code>のようにします.<code>#1</code>が「図1」のような番号に置換されます.</li>
-<li><code>caption_align=[{left/right/center/bottom/top/&lt;環境名1&gt;=&lt;位置指定1&gt;,&lt;環境名2&gt;=&lt;位置指定2&gt;,...}]</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=&lt;寸法&gt;</code>:字下げを指定します.デフォルトは2zwです.一行の長さが文字サイズの整数倍になるように調整されます.</li>
-<li><code>quote_end_indent=&lt;寸法&gt;</code>:字上げを指定します.デフォルトは0zwです.</li>
-<li><code>quote_beforeafter_space=&lt;寸法&gt;</code>:前後の空きを指定します.<code>quote_beforeafter_space=1\baselineskip</code>とすると一行あきます.</li>
-<li><code>quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]</code>:フォントサイズを指定します.</li>
-</ul>
-<h3 id="箇条書き">箇条書き</h3>
-<p><code>\jlreqsetup</code>で指定します.</p>
-<ul>
-<li><code>itemization_beforeafter_space=&lt;寸法&gt;</code>:箇条書きの前後の空きを指定します.<code>itemization_beforeafter_space={i=&lt;寸法&gt;}</code>とするとトップレベルのみに設定を行います.<code>itemization_beforeafter_space={0pt,i=10pt,ii=5pt}</code>とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.レベルは上記のように小文字ローマ数字で指定します.</li>
-<li><code>itemization_itemsep=&lt;寸法&gt;</code>:項目同士の空きを指定します.</li>
-</ul>
-<h3 id="定理環境">定理環境</h3>
-<p><code>\jlreqsetup</code>で指定します.</p>
-<ul>
-<li><code>theorem_beforeafter_space=&lt;寸法&gt;</code>:定理環境の前後の空きを指定します.</li>
-</ul>
-<h2 id="見出し">見出し</h2>
-<p>見出しの設定は,<code>\Declare***Heading</code>という命令で行います(***には見出しの種類に応じた文字列が入る).書式はすべて</p>
-<pre><code>\Declare***Heading{&lt;命令名&gt;}{&lt;レベル&gt;}{&lt;設定&gt;}
-</code></pre>
-<p>となっています.また,<code>\New***Heading</code>,<code>\Renew***Heading</code>,<code>\Provide***Heading</code>も同時に用意されます.それぞれ</p>
-<ul>
-<li><code>\New***Heading</code>:指定した名前の命令が既に定義されている場合はエラー.</li>
-<li><code>\Renew***Heading</code>:指定した名前の命令が定義されていなければエラー.</li>
-<li><code>\Provide***Heading</code>:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.</li>
-</ul>
-<p>となっています.</p>
-<h3 id="扉見出し">扉見出し</h3>
-<p><code>\DeclareTobiraHeading</code>で作成します.通常のクラスファイルにおける<code>\section</code>等と同じ書式の命令ができます.設定は以下の通り.</p>
-<ul>
-<li><code>type=[han/naka]</code>:<code>han</code>だと半扉見出しを,<code>naka</code>だと中扉見出しを作ります.</li>
-<li><code>pagestyle=&lt;ページスタイル&gt;</code>:見出し箇所のページスタイルを指定します.</li>
-<li><code>label_format=&lt;書式&gt;</code>:ラベルを出力する命令を指定します.たとえば<code>label_format={第\thechapter 章}</code>のように指定します.</li>
-<li><code>format=&lt;書式&gt;</code>:実際に出力する書式を指定します.<code>format={\null\vfil {\Huge\bfseries #1#2}}</code>のようにします.<code>#1</code>はラベルに,<code>#2</code>は見出し文字列に置き換えられます.</li>
-</ul>
-<h3 id="別行見出し">別行見出し</h3>
-<p><code>\DeclareBlockHeading</code>で作成します.<code>\&lt;命令名&gt;*[running head]{見出し文字列}[副題]</code>という書式の命令を作成します.設定は以下の通り.</p>
-<h4 id="書式関連">書式関連</h4>
-<ul>
-<li><code>font=&lt;命令&gt;</code>:見出しのフォントを指定します.</li>
-<li><code>subtitle_font=&lt;命令&gt;</code>:副題のフォントを指定します.</li>
-<li><code>label_format=&lt;命令&gt;</code>:ラベルのフォーマットを指定します.<code>label_format={第\thechapter 章}</code>などのようにします.</li>
-<li><code>subtitle_format=&lt;命令&gt;</code>:副題のフォーマットを指定します.<code>subtitle_format={「#1」}</code>のようにします.<code>#1</code>が副題自身になります.</li>
-</ul>
-<h4 id="インデント関連">インデント関連</h4>
-<ul>
-<li><code>align=[left/center/right]</code>:見出し位置の横方向の配置場所を指定します.</li>
-<li><code>indent=&lt;寸法&gt;</code>:見出し全体の字下げ量を指定します.</li>
-<li><code>end_indent=&lt;寸法&gt;</code>:見出し全体の字上げ量を指定します.</li>
-<li><code>after_label_space=&lt;寸法&gt;</code>:ラベル後,見出し文字列までの空きを指定します.</li>
-<li><code>second_heading_text_indent=[&lt;寸法&gt;/{&lt;寸法&gt;,&lt;寸法&gt;}]</code>:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,<code>second_heading_text_indent=*1\zw</code>のように先頭に<code>*</code>をつけるとラベルの頭を起点としての指定になります.(ラベルがない時は一行目の頭が起点.)また,<code>second_heading_text_indent={&lt;ラベルがある時&gt;,&lt;ラベルがない時&gt;}</code>という指定をすると,ラベルの有無に応じて値を変更することができます.<code>&lt;ラベルがある時&gt;</code>の指定ではやはり<code>*</code>を使うことができます.</li>
-<li><code>subtitle_indent=&lt;寸法&gt;</code>:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.</li>
-</ul>
-<h4 id="その他-1">その他</h4>
-<ul>
-<li><code>subtitle_break=[true/false]</code>:見出し文字列と副題の間を改行するか指定します.</li>
-<li><code>allowbreak_if_evenpage=[true/false]</code>:見出しが偶数ページにあった場合,その直後の改ページを許可します.</li>
-<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>
-</ul>
-<h4 id="行取り">行取り</h4>
-<p>行取りの指定は以下のいずれかの方法で行うことができます.</p>
-<ul>
-<li>行数を指定し,その中央に配置します.<code>lines=&lt;自然数値&gt;</code>により行数を指定します.<code>before_lines=&lt;自然数値&gt;</code>や<code>after_lines=&lt;自然数値&gt;</code>により,さらに前後に追加する行数を指定します.たとえば<code>lines=3,after_lines=1</code>とすれば,四行の中に配置され,前の空きよりも後ろの空きの方が一行分大きくなります.<code>before_lines</code>により指定された空きはページ頭には入りませんが,<code>before_lines=*1</code>というように<code>*</code>を先頭につけると常に入るようになります.</li>
-<li>行数と,前後いずれかの空きを指定します.<code>lines=&lt;自然数値&gt;</code>により行数を,<code>before_space=&lt;寸法&gt;</code>または<code>after_space=&lt;寸法&gt;</code>のいずれかの指定によりそれぞれ前または後ろの空きを指定します.</li>
-<li>前後の空きを指定します.<code>before_space=&lt;寸法&gt;</code>および<code>after_space=&lt;寸法&gt;</code>を指定します.</li>
-</ul>
-<h4 id="連続して掲げる見出しの行取り">連続して掲げる見出しの行取り</h4>
-<p><code>\SetBlockHeadingSpaces</code>により,見出しが連続して掲げられたときの行取りを設定することができます.<code>\SetBlockHeadingSpaces</code>は</p>
-<pre class="sourceCode latex" id="cb7"><code class="sourceCode latex"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="fu">\SetBlockHeadingSpaces</span>{</a>
-<a class="sourceLine" id="cb7-2" data-line-number="2"> {_part{lines=3,before_lines=1},_section{lines=2},_subsection{lines=2}}</a>
-<a class="sourceLine" id="cb7-3" data-line-number="3"> [lines=5]{_section,23pt,_subsection,16pt}</a>
-<a class="sourceLine" id="cb7-4" data-line-number="4">}</a></code></pre>
-<p>のように使います.この意味は次の通りです.</p>
-<ul>
-<li><code>\part</code>,<code>\section</code>,<code>\subsection</code>という順番で見出しが掲げられていて,その前後が見出しでない場合は,<code>\part</code>は三行取り+前に一行空き,<code>\section</code>と<code>\subsection</code>は二行取りとなります.</li>
-<li><code>\section</code>,<code>\subsection</code>という順番で見出しが掲げられていて,その前後が見出しでない場合は,全体で五行取りとし,<code>\section</code>と<code>\subsection</code>との間に<code>23pt</code>の空き,<code>\subsection</code>の後に<code>16pt</code>の空きを入れます.</li>
-</ul>
-<p>個々の設定は以下のようになります.</p>
-<ul>
-<li>各々の<code>{}</code>内には<code>_&lt;見出し命令名&gt;</code>か<code>&lt;寸法&gt;</code>をカンマ区切りで並べます.</li>
-<li>先頭に<code>[]</code>で囲まれた設定を追加できます.これは連続して掲げられた見出し全体への設定となります.<code>lines / before_lines / after_lines / before_space / after_space</code>が利用可能です.各々の意味は上述の行取り指定と同じです.</li>
-<li>寸法はそのまま空き量を表します.</li>
-<li><code>_&lt;見出し命令名&gt;</code>の後に<code>{}</code>で囲まれた設定を追加することで,その見出しの空き量を設定します.設定しない場合は前後に空きが入りません.</li>
-<li>見出しに対する<code>{}</code>で囲まれた設定内では,<code>lines / before_lines / after_lines / before_space / after_space</code>が利用可能です.各々の意味は上述の行取り指定と同じです.</li>
-<li><code>{}</code>で囲まれた部分を<code>*</code>のみにすると(例えば<code>_section{*}</code>とすると)単独で掲げた場合と同じ設定を使います.</li>
-</ul>
-<p>なお,見出しが連続しているかは単純に別行見出しの命令が並んで書かれているかのみで判断します.従ってそれらの命令間に出力には関係しないような命令が挟まっていたとしても,見出しが連続して掲げられているとは判断されません.ただし,見出し命令の間に空白,改行または<code>\label[&lt;オプション&gt;]{&lt;引数&gt;}…{&lt;引数&gt;}</code>という形のもののみが挟まれている場合は,見出しが連続していると判断されます.</p>
-<h3 id="同行見出し">同行見出し</h3>
-<p><code>\DeclareRuninHeading</code>で作成します.通常の文書クラスにおける<code>\section</code>と同様の,<code>\&lt;命令名&gt;*[running head]{見出し文字列}</code>という書式の命令が作成されます.設定は以下の通り.</p>
-<ul>
-<li><code>font=&lt;命令&gt;</code>:見出しのフォントを指定します.</li>
-<li><code>indent=&lt;寸法&gt;</code> 見出し文字列全体の字下げ量を指定します.</li>
-<li><code>after_label_space=&lt;寸法&gt;</code>:ラベル後,見出し文字列までの空きを指定します.</li>
-<li><code>label_format=&lt;命令&gt;</code>:ラベルのフォーマットを指定します.<code>label_format={\theparagraph}</code>などのようにします.</li>
-</ul>
-<h3 id="窓見出し">窓見出し</h3>
-<p><code>\DeclareCutinHeading</code>で作成します.<code>\&lt;命令名&gt;{見出し文字列}</code>という書式の命令を作成します.設定は以下の通り.</p>
-<ul>
-<li><code>font=&lt;命令&gt;</code>:見出しのフォントを指定します.</li>
-<li><code>indent=&lt;寸法&gt;</code>:見出し全体の字下げ量を指定します.</li>
-<li><code>after_space=&lt;寸法&gt;</code>:見出しと本文との間の空きを指定します.</li>
-<li><code>onelinemax=&lt;寸法&gt;</code>, <code>twolinemax=&lt;寸法&gt;</code>:見出し文字列の長さが<code>onelinemax</code>以下ならば一行で,<code>twolinemax</code>以下ならば二行で窓見出しを出力します.それ以上の場合は三行です.デフォルトはそれぞれ6文字,20文字の長さ.</li>
-</ul>
-<h3 id="modifyheading"><code>\ModifyHeading</code></h3>
-<p>既に(上のどれかを使い)定義された見出し命令の設定を変更します.たとえば</p>
-<pre class="sourceCode latex" id="cb8"><code class="sourceCode latex"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="fu">\ModifyHeading</span>{section}{lines=10}</a></code></pre>
-<p>とすると,<code>\section</code>のフォントなどの設定はそのままに,行取りのみが10行に変更されます.見出しの種類を変更することはできません.</p>
-<h3 id="saveheading"><code>\SaveHeading</code></h3>
-<p>見出し命令の定義を待避します.</p>
-<pre class="sourceCode latex" id="cb9"><code class="sourceCode latex"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="fu">\SaveHeading</span>{section}{<span class="fu">\restoresection</span>} <span class="co">% \sectionの中身を\restoresectionに待避.</span></a>
-<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="fu">\RenewBlockHeading</span>{section}{1}{font=……} <span class="co">% \sectionを新しく定義する.</span></a>
-<a class="sourceLine" id="cb9-3" data-line-number="3">……</a>
-<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{&lt;ページスタイル名&gt;}{&lt;設定&gt;}
-</code></pre>
-<p>によりページスタイルを定義することができます.<code>&lt;設定&gt;</code>はkeyval形式です.定義したページスタイルは<code>\pagestyle</code>で適用できます.設定は以下の通り.</p>
-<ul>
-<li><code>yoko</code>:横書きで上下に出力します.デフォルト.</li>
-<li><code>tate</code>:縦書きで小口側に出力します.</li>
-<li><code>font=&lt;命令&gt;</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>tate</code>指定時:<code>&lt;寸法&gt;</code>が指定できます.<code>running_head_position</code>は柱の天からの下げ量を,<code>nombre_position</code>はノンブルの地からの上げ量を指定します.</li>
-</ul></li>
-<li><code>nombre=&lt;書式&gt;</code>:出力するノンブルを指定します.デフォルトは<code>\thepage</code>.</li>
-<li><code>odd_running_head=&lt;書式&gt;</code>,<code>even_running_head=&lt;書式&gt;</code>:それぞれ奇数ページ,偶数ページの柱を指定します.<code>_section</code>のように<code>_</code>から始まる名前を指定すると,対応する見出しを出力します.(<code>_section</code>だと現在の<code>\section</code>を出力する.)</li>
-<li><code>mark_format={[odd=&lt;書式&gt;/even=&lt;書式&gt;/_&lt;見出し命令名&gt;=&lt;書式&gt;],...}</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>
-</ul>
-<p><code>\NewPageStyle</code>,<code>\RenewPageStyle</code>,<code>\ProvidePageStyle</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>
-<p>のようにオプションで指定する必要があります.</p>
-<h3 id="platexuplatexの場合">pLaTeX/upLaTeXの場合</h3>
-<p>JFMの名前は次の通りです.<code>[]</code>で囲まれている文字は設定により入ったり入らなかったりします.</p>
-<pre><code>[u][b][z]jlreq[g][-v]
-</code></pre>
-<p>それぞれの文字は以下の場合に入ります.</p>
-<ul>
-<li><code>u</code>: upLaTeX利用時</li>
-<li><code>b</code>: ぶら下げ組み利用時.(クラスオプションに<code>hanging_punctuation</code>が指定された時.)</li>
-<li><code>z</code>: 行頭における開き括弧類の前の空きが,段落開始時が全角二分,折り返し時が二分の時.(クラスオプションに<code>open_bracket_pos=zenkakunibu_nibu</code>が指定された時.)</li>
-<li><code>g</code>: ゴシック用フォント.</li>
-<li><code>-v</code>: 縦書き用.</li>
-</ul>
-<p>例えば,ぶら下げ組みを利用せず,クラスオプションに<code>open_bracket_pos=zenkakunibu_nibu</code>が指定されいてるソースをpLaTeXで処理した場合,横書き明朝体には<code>zjlreq</code>という名前のJFMが使われます.</p>
-<h3 id="lualatexの場合">LuaLaTeXの場合</h3>
-<ul>
-<li>横書き用のJFMは<code>jlreq</code></li>
-<li>縦書き用のJFMは<code>jlreqv</code></li>
-</ul>
-<p>となります.ゴシックも同じJFMを使います.</p>
-<h2 id="その他-2">その他</h2>
-<ul>
-<li>クラスオプション<code>jlreq_notes</code>が渡されると,日本語組版処理の記述と矛盾する設定が行われた場合に通知がされます.</li>
-</ul>
-<h2 id="ライセンス">ライセンス</h2>
-<p>このパッケージは二条項BSDライセンスの元で配布されています.詳しくは<a href="LICENSE" class="uri">LICENSE</a>をご覧ください.</p>
-<h2 id="履歴">履歴</h2>
-<ul>
-<li>2017-02-08
-<ul>
-<li>最初のバージョン.</li>
-</ul></li>
-<li>2017-02-17
-<ul>
-<li>いくつかバグを修正.</li>
-<li>クラスオプション/<code>\jlreqsetup</code>にいくつかのキーを追加/変更.</li>
-<li><code>abstract</code>環境を実装.</li>
-<li>パッケージを読み込んでいるだけのはやめた.</li>
-</ul></li>
-<li>2017-03-14
-<ul>
-<li>いくつかバグを修正.</li>
-<li>和文ファミリを欧文ファミリに従属させるようにした.</li>
-<li><code>\DeclareBlockHeading</code>にオプションをたくさん追加.</li>
-<li>quote環境などを調整するオプションを追加.</li>
-</ul></li>
-<li>2017-03-20
-<ul>
-<li>バグ修正.</li>
-<li><code>\footnote / \sidenote / \endnote</code>の周りに必要ならば空白を挿入するようにした.</li>
-</ul></li>
-<li>2017-04-04
-<ul>
-<li>バグ修正.</li>
-<li><code>\DeclarePageStyle</code>に<code>tate</code>と<code>font</code>オプションを追加.</li>
-</ul></li>
-<li>2017-04-29
-<ul>
-<li>バグ修正</li>
-<li><code>jafontsize</code>と<code>jafontscale</code>をクラスオプションに,また<code>\jafontsize</code>を追加.</li>
-<li><code>\tatechuyoko</code>を追加.</li>
-<li>クラスオプション<code>jlreq_warnings</code>を<code>jlreq_notes</code>に変更.</li>
-<li>いくつかのクラスオプションを<code>\jlreqsetup</code>に移動.</li>
-<li>いくつかのオプションを<code>\jlreqsetup</code>に追加.</li>
-<li>クラスオプションの<code>paper={&lt;縦&gt;,&lt;横&gt;}</code>を<code>paper={&lt;横&gt;,&lt;縦&gt;}</code>に変更.</li>
-</ul></li>
-<li>2017-06-11
-<ul>
-<li><code>plext</code> / <code>lltjext</code>の読み込みを中止.</li>
-<li><code>\DeclareBlockHeading</code>に<code>align</code>を追加.<code>indent=center</code>や<code>end_indent=center</code>を廃止.</li>
-<li>一部の<code>\kcatcode</code> (upLaTeX時) を変更.</li>
-</ul></li>
-<li>2017-08-13
-<ul>
-<li><code>column_spanning</code>を<code>\DeclareBlockHeading</code>に追加.</li>
-<li>ページレイアウトにおける「本文の長さ」に傍注の長さを入れるようにした.</li>
-<li>傍注の長さのデフォルトを0とした.</li>
-<li>傍注の長さが0の時には<code>\sidenote</code>を定義しないようにした.</li>
-<li>和文間隔を挿入する命令を追加.</li>
-</ul></li>
-<li>2017-08-29
-<ul>
-<li>縦書きでも著者名が横書きで出てしまうバグを修正.</li>
-</ul></li>
-<li>2017-11-23
-<ul>
-<li>バグ修正</li>
-<li><code>\SetBlockHeadingSpaces</code>を追加.</li>
-<li><code>\contentsname</code> と <code>\indexname</code>に入っていたスペースを削除.</li>
-</ul></li>
-<li>2017-12-02
-<ul>
-<li>バグ修正</li>
-</ul></li>
-<li>2017-12-22
-<ul>
-<li>JFMを改善.</li>
-<li>別行見出しの間の<code>\label</code>の検出方法を変更.</li>
-<li><code>\theequation</code>,<code>\thefigure</code>,<code>\thetable</code>に章番号を追加.</li>
-</ul></li>
-<li>2018-02-01
-<ul>
-<li>縦書きの傍注は奇数ページにのみ出るようにした(改善の余地ありかも).</li>
-<li>LuaTeX時に<code>\fnfixbottomtrue</code>を追加.</li>
-<li>キャプション関係のオプションを<code>\jlreqsetup</code>に追加.</li>
-<li><code>itemization_beforeafter_space</code>を拡張.</li>
-<li>バグ修正.</li>
-</ul></li>
-<li>2018-04-11
-<ul>
-<li>縦書き二段組みの傍注を下段に出すようにした.</li>
-<li><code>begin_widh_(odd|even)_page</code>を<code>\DeclareBlockHeading</code>に追加.</li>
-<li><code>\labelenumi</code>らをjarticleなどにあわせた.</li>
-<li><code>column_gap</code>クラスオプションを使うとコンパイルできなかったバグ修正.</li>
-<li><code>mark_format</code>を<code>\DeclarePageStyle</code>に追加.</li>
-</ul></li>
-<li>2018-05-19
-<ul>
-<li>目次内のラベルの長さを今までよりも長くした.</li>
-<li>一部のマクロをjlreq-helpers.styに分離した.</li>
-<li>バグ修正.</li>
-</ul></li>
-<li>2018-06-17
-<ul>
-<li>シリーズbもゴシックにするようにした.</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>
-</article>
-</body>
-</html>
+<!DOCTYPE html>
+<html lang="ja">
+<head>
+ <meta charset="utf-8">
+ <meta name="generator" content="pandoc">
+ <title>jlreq</title>
+ <style>
+ .markdown-body {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ background-color: white;
+ padding: 30px;
+ line-height: 170%;
+ }
+ h1{
+ font-size: 200%;
+ }
+ h2{
+ border-style: solid;
+ border-width: 0 0 0.1em 0em;
+ padding: 0 0 0.2em 0em;
+ border-color: #EEEEEE;
+ margin-top: 2em;
+ }
+ h3{
+ border-style: solid;
+ border-width: 0 0 0 0.5em;
+ padding: 0 0 0 0.5em;
+ border-color: #EEEEEE;
+ margin-top: 2em;
+ }
+ code{
+ white-space: pre;
+ font-weight: normal;
+ background-color: #F4F4F4;
+ border-color: #F4F4F4;
+ border-style: solid;
+ border-width: .2em .5em;
+ border-radius: .2em;
+ }
+ pre{
+ background-color: #F8F8F8;
+ border-color: #F8F8F8;
+ border-width: 1em;
+ border-style: solid;
+ border-radius: .5em;
+ padding: 0;
+ margin: 0;
+ line-height: 130%;
+ }
+ pre code{
+ background-color: #F8F8F8;
+ border-style: none;
+ }
+ 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>
+<article class="markdown-body">
+<h1 id="jlreq">jlreq</h1>
+<h2 id="これは何">これは何?</h2>
+<p><a href="https://www.w3.org/TR/jlreq/ja/">日本語組版処理の要件</a>の実装を試みる<a href="https://osdn.jp/projects/luatex-ja/wiki/FrontPage">LuaTeX-ja</a> / pLaTeX / upLaTeX用のクラスファイルと,それに必要なJFMの組み合わせです.</p>
+<h2 id="提供されるもの">提供されるもの</h2>
+<p>クラスファイルjlreq.clsと,横書きLuaTeX-ja用のJFMであるjfm-jlreq.luaが用意されています.また,縦書きのJFMやpLaTeX / upLaTeX 用のJFMを生成するいくつかのスクリプトがあります.</p>
+<h2 id="インストール">インストール</h2>
+<p><code>make</code>で必要なJFMを生成してください.その後,</p>
+<ul>
+<li>*.tfm -&gt; $TEXMF/fonts/tfm/public/jlreq</li>
+<li>*.vf -&gt; $TEXMF/fonts/vf/public/jlreq</li>
+<li>jfm-jlreq.lua, jfm-jlreqv.lua -&gt; $TEXMF/tex/luatex/jlreq</li>
+<li>jlreq.cls, jlreq-helpers.sty -&gt; $TEXMF/tex/latex/jlreq</li>
+</ul>
+<p>と配置します.<code>make install</code>とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います.</p>
+<h2 id="使い方">使い方</h2>
+<p>通常通り</p>
+<pre class="sourceCode latex" id="cb1"><code class="sourceCode latex"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="bu">\documentclass</span>{<span class="ex">jlreq</span>}</a></code></pre>
+<p>とします.これで横書きのarticle相当の文書クラスとなります.エンジンは自動判定されますが,指定する場合はクラスオプションに<code>platex/uplatex/lualatex</code>のいずれかを渡してください.縦書きにするには<code>tate</code>オプションを渡します.また,reportやbook相当の文書クラスとするには,それぞれ<code>report</code>や<code>book</code>オプションを渡します.たとえば,縦書きの本を作成するには</p>
+<pre class="sourceCode latex" id="cb2"><code class="sourceCode latex"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="bu">\documentclass</span>[tate,book]{<span class="ex">jlreq</span>}</a></code></pre>
+<p>とします.</p>
+<p>その他,<code>oneside / twoside / onecolumn / twocolumn / titlepage / notitlepage / draft / final / openright / openany / leqno / fleqn</code>というよくあるオプションを受け付けます.</p>
+<p>標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.</p>
+<h3 id="jlreqsetup"><code>\jlreqsetup</code></h3>
+<p>設定用命令です.プリアンブルでしか使えません.文書に対する設定は,クラスオプションとして行うか<code>\jlreqsetup</code>を通じて行うかします.どちらで設定するかは設定項目によります.</p>
+<h3 id="section"><code>\section</code></h3>
+<p><code>\section*[running head]{見出し文字列}[副題]</code>というように,通常の書式に加えて副題を受け付けられるように拡張されています.その他,<code>\part</code>(articleのみ),<code>\chapter</code>(book/reportのみ),<code>\subsection</code>,<code>\subsubsection</code>も副題を受け付けます.</p>
+<h3 id="abstract環境"><code>abstract</code>環境</h3>
+<p>プリアンブルにもかけるようになっています.プリアンブルに書かれた場合は,<code>\maketitle</code>とともに出力されます.二段組の場合は,段組にならず概要を出力することができます.</p>
+<h3 id="sidenote"><code>\sidenote</code></h3>
+<p>この命令は傍注の幅が正の時にのみ定義されます.デフォルトの基本版面ではこの幅は0に設定されています.従って<code>\sidenote</code>は定義されません.後の基本版面の設定を参考にしてください.</p>
+<p><code>\sidenote</code>は傍注(縦組みの場合は脚注)を出力します.内部では<code>\marginpar</code>を使っています.デフォルトでは<code>\footnote</code>と同様の書式となりますが,<code>\jlreqsetup</code>で<code>sidenote_type=symbol</code>が指定されている場合,その書式は<code>\sidenote{該当項目}{注}</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">\sidenote</span>{原稿}{印刷などの方法により……}を入手する仕事である.</a></code></pre>
+<p>とします.後の説明も参照してください.</p>
+<h3 id="endnote"><code>\endnote</code></h3>
+<p>後注を指定します.<code>\footnote</code>と同様の書式です.デフォルトでは,注自身の出力は見出し直前に行われます.この動作は<code>\jlreqsetup</code>に<code>endnote_position</code>を渡すことで制御できます.詳しくは後の注関係の説明をご覧ください.また<code>\theendnotes</code>を実行するとその場に出力をします.</p>
+<h3 id="warichu"><code>\warichu</code></h3>
+<p>割注を出力します.行分割位置などは自動で計算されます.(複数回のコンパイルが必要.)<code>\warichu*</code>ではこれらの位置を手動で指定できます.書式は</p>
+<pre><code>\warichu*{(一行目前) &amp; (一行目後)\\ (二行目前) &amp; (二行目後)...}
+</code></pre>
+<p>です.<code>&amp;</code>が省略されている場合は自動で調整されます.</p>
+<h3 id="tatechuyoko"><code>\tatechuyoko</code></h3>
+<p>縦中横を出力します.<code>\tatechuyoko{&lt;文字列&gt;}</code>とします.縦書きでない場所で使うとエラーになります.</p>
+<h3 id="jafontsize"><code>\jafontsize</code></h3>
+<p>和文フォントサイズを指定する<code>\fontsize</code>です.クラスオプションで<code>jafontscale=0.9</code>とされている場合,<code>\fontsize{9pt}{15pt}</code>とすると和文フォントのサイズは<code>8.1pt</code>となりますが,<code>\jafontsize{9pt}{15pt}</code>とすると<code>9pt</code>となります.(欧文フォントサイズは<code>10pt</code>となる.)なお,第二引数は<code>\fontsize</code>の第二引数と全く同じです.</p>
+<h3 id="-"><code>\ </code></h3>
+<p>全角空白(U+3000)一文字からなるマクロです.和文間隔を挿入します.LuaLaTeXでは<code> </code>のみでも和文間隔を入力できます.</p>
+<h3 id="その他">その他</h3>
+<ul>
+<li><p>ルビや圏点は提供されません.<a href="https://github.com/zr-tex8r/PXrubrica">PXrubrica</a>または<code>luatexja-ruby</code>(LuaLaTeX,LuaTeX-jaパッケージに付属)を使うと良いかと思います.</p></li>
+<li><p>日本語組版処理の要件2.3.2.dによれば,横組みにおける二段組の最後のページの各段の行数は揃えることが望ましいとされていますが,この処理は行われません.<code>nidanfloat</code>パッケージを使い,</p>
+<pre class="sourceCode latex" id="cb5"><code class="sourceCode latex"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="bu">\usepackage</span>[balance]{<span class="ex">nidanfloat</span>}</a></code></pre>
+<p>とするとこの処理が行われます.ただし,最終ページでの<code>\newpage</code>や<code>\clearpage</code>が正しく動作しません.詳しくは<code>nidanfloat</code>パッケージのマニュアルをご覧ください.</p></li>
+<li><p>フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は<code>luatexja-fontspec</code>や<code>luatexja-preset</code>(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,<a href="https://github.com/zr-tex8r/PXchfon">PXchfon</a>での設定が可能です.</p></li>
+</ul>
+<h2 id="各種設計">各種設計</h2>
+<p>設計はクラスオプションまたは<code>\jlreqsetup</code>によりkeyval形式で行います.以下では次の用法を使います.</p>
+<ul>
+<li><code>[A/B]</code>:AまたはBです.<code>[A/B/C]</code>等も同様.</li>
+<li><code>&lt;寸法&gt;</code>:TeXが認識する寸法です.簡単な式(<code>10pt+10pt</code>のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)<code>\jlreqsetup</code>内のような場所では,常に<code>\zw</code>や<code>\zh</code>により全角幅が記述できます.以下,たとえば<code>Q</code>が利用可能な場合は<code>&lt;寸法;Q&gt;</code>のように記述します.
+<ul>
+<li><code>Q</code>:0.25mmと解釈されます.</li>
+<li><code>zw</code>, <code>zh</code>:全角幅として解釈されます.</li>
+</ul></li>
+</ul>
+<h3 id="基本版面">基本版面</h3>
+<p>クラスオプションです.</p>
+<ul>
+<li><code>paper=[&lt;紙サイズ名&gt;/{&lt;寸法&gt;,&lt;寸法&gt;}]</code>:紙サイズです.紙サイズ名はa0からa10,b0からb10,c2からc8を指定できます.B列はJIS B列です.また,<code>{&lt;横&gt;,&lt;縦&gt;}</code>と直接寸法を指定することもできます.</li>
+<li><code>fontsize=&lt;寸法;Q&gt;</code>:欧文フォントサイズ.デフォルトは10pt.</li>
+<li><code>jafontsize=&lt;寸法;Q&gt;</code>:和文フォントサイズ.</li>
+<li><code>jafontscale=&lt;実数値&gt;</code>:欧文フォントと和文フォントの比(和文 / 欧文).<code>fontsize</code>と<code>jafontsize</code>が両方指定されている場合は無視される.デフォルトは1.</li>
+<li><code>line_length=&lt;寸法;zw,zh&gt;</code>:一行の長さ.デフォルトは字送り方向の紙幅の0.75倍.実際の値は一文字の長さの整数倍になるように補正されます.</li>
+<li><code>number_of_lines=&lt;自然数値&gt;</code>:一ページの行数.デフォルトは行送り方向の紙幅の0.75倍になるような値.</li>
+<li><code>gutter=&lt;寸法;zw,zh&gt;</code>:のどの余白の大きさ.
+<ul>
+<li><code>tate</code>無指定時は奇数ページ左,偶数ページ右の余白</li>
+<li><code>tate</code>指定時は奇数ページ右,偶数ページ左の余白</li>
+<li><code>twoside</code>が指定されていない時は,常に奇数ページ扱いで余白が設定される</li>
+</ul></li>
+<li><code>head_space=&lt;寸法;zw,zh&gt;</code>:天の空き量.デフォルトは中央寄せになるような値.</li>
+<li><code>foot_space=&lt;寸法;zw,zh&gt;</code>:地の空き量.デフォルトは中央寄せになるような値.</li>
+<li><code>baselineskip=&lt;寸法;Q,zw,zh&gt;</code>:行送り.デフォルトは<code>jafontsize</code>の1.7倍.</li>
+<li><code>linegap=&lt;寸法;Q,zw,zh&gt;</code>:行間.</li>
+<li><code>headfoot_sidemargin=&lt;寸法;zw,zh&gt;</code>:柱やノンブルの左右の空き.</li>
+<li><code>column_gap=&lt;寸法;zw,zh&gt;</code>:段間(<code>twocolumn</code>指定時のみ).</li>
+<li><code>sidenote_length=&lt;寸法;zw,zh&gt;</code>:傍注の幅を指定します.</li>
+</ul>
+<h3 id="組み方">組み方</h3>
+<p>クラスオプションです.</p>
+<ul>
+<li><code>open_bracket_pos=[zenkaku_tentsuki/zenkakunibu_nibu/nibu_tentsuki]</code>:始め括弧が行頭に来た際の配置方法を指定します.それぞれ段落開始全角折り返し行頭天付き(デフォルト),段落開始全角二分折り返し行頭二分,段落開始二分折り返し行頭天付きを意味します.</li>
+<li><code>hanging_punctuation</code>:ぶら下げ組をします.</li>
+</ul>
+<h3 id="注関係">注関係</h3>
+<p><code>\jlreqsetup</code>で指定します.</p>
+<ul>
+<li><code>reference_mark=[inline/interlinear]</code>:合印の配置方法を指定します.<code>inline</code>にすると該当項目の後ろの行中に配置します.<code>interlinear</code>を指定すると該当項目の上(横組)または右(縦組)に配置します.</li>
+<li><code>footnote_second_indent=&lt;寸法&gt;</code>: 脚注(横書き時)または傍注(縦書き時)の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.</li>
+<li><code>sidenote_type=[number/symbol]</code>:傍注と本文との対応の方法を指定します.<code>number</code>が規定で,注の位置に通し番号が入り,それにより対応が示されます.<code>symbol</code>とすると,注の位置に特定の記号が入り,また注がついている単語が強調されます.</li>
+<li><code>sidenote_symbol=&lt;記号&gt;</code>:<code>sidenote_symbol=symbol</code>の時に,注の位置に入る記号.デフォルト*</li>
+<li><code>sidenote_keyword_font=&lt;命令&gt;</code>:<code>sidenote_symbol=symbol</code>の時に,注のついている単語のフォント指定.デフォルトは無し(強調しない)</li>
+<li><code>endnote_second_indent=&lt;寸法&gt;</code>: 後柱の二行目以降の字下げ量を指定します.一行目からの相対字下げ量です.</li>
+<li><code>endnote_position=[headings/paragraph/{_&lt;見出し名1&gt;,_&lt;見出し名2&gt;,...}]</code>:後注の出力場所を指定します.<code>headings</code>は各見出しの直前(デフォルト),<code>paragraph</code>は改段落の際に出力します.また,<code>endnote_position={_chapter,_section}</code>とすると,<code>\chapter</code>と<code>\section</code>の直前に出力します.</li>
+</ul>
+<h3 id="キャプション">キャプション</h3>
+<p>図表のキャプションを<code>\jlreqsetup</code>で変更できます.</p>
+<ul>
+<li><code>caption_font=&lt;命令&gt;</code>:キャプション自身のフォントを指定します.</li>
+<li><code>caption_label_font=&lt;命令&gt;</code>:キャプションのラベルのフォントを指定します.</li>
+<li><code>caption_after_label_space=&lt;寸法&gt;</code>:ラベルとキャプションの間の空きを指定します.</li>
+<li><code>caption_label_format=&lt;書式&gt;</code>:ラベルの書式を指定します.<code>caption_label_format={#1:}</code>のようにします.<code>#1</code>が「図1」のような番号に置換されます.</li>
+<li><code>caption_align=[{left/right/center/bottom/top/&lt;環境名1&gt;=&lt;位置指定1&gt;,&lt;環境名2&gt;=&lt;位置指定2&gt;,...}]</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=&lt;寸法&gt;</code>:字下げを指定します.デフォルトは2zwです.一行の長さが文字サイズの整数倍になるように調整されます.</li>
+<li><code>quote_end_indent=&lt;寸法&gt;</code>:字上げを指定します.デフォルトは0zwです.</li>
+<li><code>quote_beforeafter_space=&lt;寸法&gt;</code>:前後の空きを指定します.<code>quote_beforeafter_space=1\baselineskip</code>とすると一行あきます.</li>
+<li><code>quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]</code>:フォントサイズを指定します.</li>
+</ul>
+<h3 id="箇条書き">箇条書き</h3>
+<p><code>\jlreqsetup</code>で指定します.</p>
+<ul>
+<li><code>itemization_beforeafter_space=&lt;寸法&gt;</code>:箇条書きの前後の空きを指定します.<code>itemization_beforeafter_space={i=&lt;寸法&gt;}</code>とするとトップレベルのみに設定を行います.<code>itemization_beforeafter_space={0pt,i=10pt,ii=5pt}</code>とすれば,レベル1の箇条書きに10ptを,レベル2のそれに5ptを,それ以外には0ptを設定します.レベルは上記のように小文字ローマ数字で指定します.</li>
+<li><code>itemization_itemsep=&lt;寸法&gt;</code>:項目同士の空きを指定します.</li>
+</ul>
+<h3 id="定理環境">定理環境</h3>
+<p><code>\jlreqsetup</code>で指定します.</p>
+<ul>
+<li><code>theorem_beforeafter_space=&lt;寸法&gt;</code>:定理環境の前後の空きを指定します.</li>
+</ul>
+<h2 id="見出し">見出し</h2>
+<p>見出しの設定は,<code>\Declare***Heading</code>という命令で行います(***には見出しの種類に応じた文字列が入る).書式はすべて</p>
+<pre><code>\Declare***Heading{&lt;命令名&gt;}{&lt;レベル&gt;}{&lt;設定&gt;}
+</code></pre>
+<p>となっています.また,<code>\New***Heading</code>,<code>\Renew***Heading</code>,<code>\Provide***Heading</code>も同時に用意されます.それぞれ</p>
+<ul>
+<li><code>\New***Heading</code>:指定した名前の命令が既に定義されている場合はエラー.</li>
+<li><code>\Renew***Heading</code>:指定した名前の命令が定義されていなければエラー.</li>
+<li><code>\Provide***Heading</code>:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.</li>
+</ul>
+<p>となっています.</p>
+<h3 id="扉見出し">扉見出し</h3>
+<p><code>\DeclareTobiraHeading</code>で作成します.通常のクラスファイルにおける<code>\section</code>等と同じ書式の命令ができます.設定は以下の通り.</p>
+<ul>
+<li><code>type=[han/naka]</code>:<code>han</code>だと半扉見出しを,<code>naka</code>だと中扉見出しを作ります.</li>
+<li><code>pagestyle=&lt;ページスタイル&gt;</code>:見出し箇所のページスタイルを指定します.</li>
+<li><code>label_format=&lt;書式&gt;</code>:ラベルを出力する命令を指定します.たとえば<code>label_format={第\thechapter 章}</code>のように指定します.</li>
+<li><code>format=&lt;書式&gt;</code>:実際に出力する書式を指定します.<code>format={\null\vfil {\Huge\bfseries #1#2}}</code>のようにします.<code>#1</code>はラベルに,<code>#2</code>は見出し文字列に置き換えられます.</li>
+</ul>
+<h3 id="別行見出し">別行見出し</h3>
+<p><code>\DeclareBlockHeading</code>で作成します.<code>\&lt;命令名&gt;*[running head]{見出し文字列}[副題]</code>という書式の命令を作成します.設定は以下の通り.</p>
+<h4 id="書式関連">書式関連</h4>
+<ul>
+<li><code>font=&lt;命令&gt;</code>:見出しのフォントを指定します.</li>
+<li><code>subtitle_font=&lt;命令&gt;</code>:副題のフォントを指定します.</li>
+<li><code>label_format=&lt;命令&gt;</code>:ラベルのフォーマットを指定します.<code>label_format={第\thechapter 章}</code>などのようにします.</li>
+<li><code>subtitle_format=&lt;命令&gt;</code>:副題のフォーマットを指定します.<code>subtitle_format={「#1」}</code>のようにします.<code>#1</code>が副題自身になります.</li>
+</ul>
+<h4 id="インデント関連">インデント関連</h4>
+<ul>
+<li><code>align=[left/center/right]</code>:見出し位置の横方向の配置場所を指定します.</li>
+<li><code>indent=&lt;寸法&gt;</code>:見出し全体の字下げ量を指定します.</li>
+<li><code>end_indent=&lt;寸法&gt;</code>:見出し全体の字上げ量を指定します.</li>
+<li><code>after_label_space=&lt;寸法&gt;</code>:ラベル後,見出し文字列までの空きを指定します.</li>
+<li><code>second_heading_text_indent=[&lt;寸法&gt;/{&lt;寸法&gt;,&lt;寸法&gt;}]</code>:見出し文字列の二行目以降のインデントを指定します.一行目の頭を起点として指定しますが,<code>second_heading_text_indent=*1\zw</code>のように先頭に<code>*</code>をつけるとラベルの頭を起点としての指定になります.(ラベルがない時は一行目の頭が起点.)また,<code>second_heading_text_indent={&lt;ラベルがある時&gt;,&lt;ラベルがない時&gt;}</code>という指定をすると,ラベルの有無に応じて値を変更することができます.<code>&lt;ラベルがある時&gt;</code>の指定ではやはり<code>*</code>を使うことができます.</li>
+<li><code>subtitle_indent=&lt;寸法&gt;</code>:副題のインデント量を指定します.見出し文字列の一行目を起点として指定します.</li>
+</ul>
+<h4 id="その他-1">その他</h4>
+<ul>
+<li><code>subtitle_break=[true/false]</code>:見出し文字列と副題の間を改行するか指定します.</li>
+<li><code>allowbreak_if_evenpage=[true/false]</code>:見出しが偶数ページにあった場合,その直後の改ページを許可します.</li>
+<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>
+</ul>
+<h4 id="行取り">行取り</h4>
+<p>行取りの指定は以下のいずれかの方法で行うことができます.</p>
+<ul>
+<li>行数を指定し,その中央に配置します.<code>lines=&lt;自然数値&gt;</code>により行数を指定します.<code>before_lines=&lt;自然数値&gt;</code>や<code>after_lines=&lt;自然数値&gt;</code>により,さらに前後に追加する行数を指定します.たとえば<code>lines=3,after_lines=1</code>とすれば,四行の中に配置され,前の空きよりも後ろの空きの方が一行分大きくなります.<code>before_lines</code>により指定された空きはページ頭には入りませんが,<code>before_lines=*1</code>というように<code>*</code>を先頭につけると常に入るようになります.</li>
+<li>行数と,前後いずれかの空きを指定します.<code>lines=&lt;自然数値&gt;</code>により行数を,<code>before_space=&lt;寸法&gt;</code>または<code>after_space=&lt;寸法&gt;</code>のいずれかの指定によりそれぞれ前または後ろの空きを指定します.</li>
+<li>前後の空きを指定します.<code>before_space=&lt;寸法&gt;</code>および<code>after_space=&lt;寸法&gt;</code>を指定します.</li>
+</ul>
+<h4 id="連続して掲げる見出しの行取り">連続して掲げる見出しの行取り</h4>
+<p><code>\SetBlockHeadingSpaces</code>により,見出しが連続して掲げられたときの行取りを設定することができます.<code>\SetBlockHeadingSpaces</code>は</p>
+<pre class="sourceCode latex" id="cb7"><code class="sourceCode latex"><a class="sourceLine" id="cb7-1" data-line-number="1"><span class="fu">\SetBlockHeadingSpaces</span>{</a>
+<a class="sourceLine" id="cb7-2" data-line-number="2"> {_part{lines=3,before_lines=1},_section{lines=2},_subsection{lines=2}}</a>
+<a class="sourceLine" id="cb7-3" data-line-number="3"> [lines=5]{_section,23pt,_subsection,16pt}</a>
+<a class="sourceLine" id="cb7-4" data-line-number="4">}</a></code></pre>
+<p>のように使います.この意味は次の通りです.</p>
+<ul>
+<li><code>\part</code>,<code>\section</code>,<code>\subsection</code>という順番で見出しが掲げられていて,その前後が見出しでない場合は,<code>\part</code>は三行取り+前に一行空き,<code>\section</code>と<code>\subsection</code>は二行取りとなります.</li>
+<li><code>\section</code>,<code>\subsection</code>という順番で見出しが掲げられていて,その前後が見出しでない場合は,全体で五行取りとし,<code>\section</code>と<code>\subsection</code>との間に<code>23pt</code>の空き,<code>\subsection</code>の後に<code>16pt</code>の空きを入れます.</li>
+</ul>
+<p>個々の設定は以下のようになります.</p>
+<ul>
+<li>各々の<code>{}</code>内には<code>_&lt;見出し命令名&gt;</code>か<code>&lt;寸法&gt;</code>をカンマ区切りで並べます.</li>
+<li>先頭に<code>[]</code>で囲まれた設定を追加できます.これは連続して掲げられた見出し全体への設定となります.<code>lines / before_lines / after_lines / before_space / after_space</code>が利用可能です.各々の意味は上述の行取り指定と同じです.</li>
+<li>寸法はそのまま空き量を表します.</li>
+<li><code>_&lt;見出し命令名&gt;</code>の後に<code>{}</code>で囲まれた設定を追加することで,その見出しの空き量を設定します.設定しない場合は前後に空きが入りません.</li>
+<li>見出しに対する<code>{}</code>で囲まれた設定内では,<code>lines / before_lines / after_lines / before_space / after_space</code>が利用可能です.各々の意味は上述の行取り指定と同じです.</li>
+<li><code>{}</code>で囲まれた部分を<code>*</code>のみにすると(例えば<code>_section{*}</code>とすると)単独で掲げた場合と同じ設定を使います.</li>
+</ul>
+<p>なお,見出しが連続しているかは単純に別行見出しの命令が並んで書かれているかのみで判断します.従ってそれらの命令間に出力には関係しないような命令が挟まっていたとしても,見出しが連続して掲げられているとは判断されません.ただし,見出し命令の間に空白,改行または<code>\label[&lt;オプション&gt;]{&lt;引数&gt;}…{&lt;引数&gt;}</code>という形のもののみが挟まれている場合は,見出しが連続していると判断されます.</p>
+<h3 id="同行見出し">同行見出し</h3>
+<p><code>\DeclareRuninHeading</code>で作成します.通常の文書クラスにおける<code>\section</code>と同様の,<code>\&lt;命令名&gt;*[running head]{見出し文字列}</code>という書式の命令が作成されます.設定は以下の通り.</p>
+<ul>
+<li><code>font=&lt;命令&gt;</code>:見出しのフォントを指定します.</li>
+<li><code>indent=&lt;寸法&gt;</code> 見出し文字列全体の字下げ量を指定します.</li>
+<li><code>after_label_space=&lt;寸法&gt;</code>:ラベル後,見出し文字列までの空きを指定します.</li>
+<li><code>label_format=&lt;命令&gt;</code>:ラベルのフォーマットを指定します.<code>label_format={\theparagraph}</code>などのようにします.</li>
+</ul>
+<h3 id="窓見出し">窓見出し</h3>
+<p><code>\DeclareCutinHeading</code>で作成します.<code>\&lt;命令名&gt;{見出し文字列}</code>という書式の命令を作成します.設定は以下の通り.</p>
+<ul>
+<li><code>font=&lt;命令&gt;</code>:見出しのフォントを指定します.</li>
+<li><code>indent=&lt;寸法&gt;</code>:見出し全体の字下げ量を指定します.</li>
+<li><code>after_space=&lt;寸法&gt;</code>:見出しと本文との間の空きを指定します.</li>
+<li><code>onelinemax=&lt;寸法&gt;</code>, <code>twolinemax=&lt;寸法&gt;</code>:見出し文字列の長さが<code>onelinemax</code>以下ならば一行で,<code>twolinemax</code>以下ならば二行で窓見出しを出力します.それ以上の場合は三行です.デフォルトはそれぞれ6文字,20文字の長さ.</li>
+</ul>
+<h3 id="modifyheading"><code>\ModifyHeading</code></h3>
+<p>既に(上のどれかを使い)定義された見出し命令の設定を変更します.たとえば</p>
+<pre class="sourceCode latex" id="cb8"><code class="sourceCode latex"><a class="sourceLine" id="cb8-1" data-line-number="1"><span class="fu">\ModifyHeading</span>{section}{lines=10}</a></code></pre>
+<p>とすると,<code>\section</code>のフォントなどの設定はそのままに,行取りのみが10行に変更されます.見出しの種類を変更することはできません.</p>
+<h3 id="saveheading"><code>\SaveHeading</code></h3>
+<p>見出し命令の定義を待避します.</p>
+<pre class="sourceCode latex" id="cb9"><code class="sourceCode latex"><a class="sourceLine" id="cb9-1" data-line-number="1"><span class="fu">\SaveHeading</span>{section}{<span class="fu">\restoresection</span>} <span class="co">% \sectionの中身を\restoresectionに待避.</span></a>
+<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="fu">\RenewBlockHeading</span>{section}{1}{font=……} <span class="co">% \sectionを新しく定義する.</span></a>
+<a class="sourceLine" id="cb9-3" data-line-number="3">……</a>
+<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{&lt;ページスタイル名&gt;}{&lt;設定&gt;}
+</code></pre>
+<p>によりページスタイルを定義することができます.<code>&lt;設定&gt;</code>はkeyval形式です.定義したページスタイルは<code>\pagestyle</code>で適用できます.設定は以下の通り.</p>
+<ul>
+<li><code>yoko</code>:横書きで上下に出力します.デフォルト.</li>
+<li><code>tate</code>:縦書きで小口側に出力します.</li>
+<li><code>font=&lt;命令&gt;</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>tate</code>指定時:<code>&lt;寸法&gt;</code>が指定できます.<code>running_head_position</code>は柱の天からの下げ量を,<code>nombre_position</code>はノンブルの地からの上げ量を指定します.</li>
+</ul></li>
+<li><code>nombre=&lt;書式&gt;</code>:出力するノンブルを指定します.デフォルトは<code>\thepage</code>.</li>
+<li><code>odd_running_head=&lt;書式&gt;</code>,<code>even_running_head=&lt;書式&gt;</code>:それぞれ奇数ページ,偶数ページの柱を指定します.<code>_section</code>のように<code>_</code>から始まる名前を指定すると,対応する見出しを出力します.(<code>_section</code>だと現在の<code>\section</code>を出力する.)</li>
+<li><code>mark_format={[odd=&lt;書式&gt;/even=&lt;書式&gt;/_&lt;見出し命令名&gt;=&lt;書式&gt;],...}</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=&lt;書式&gt;</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>
+<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>
+<p>のようにオプションで指定する必要があります.</p>
+<h3 id="platexuplatexの場合">pLaTeX/upLaTeXの場合</h3>
+<p>JFMの名前は次の通りです.<code>[]</code>で囲まれている文字は設定により入ったり入らなかったりします.</p>
+<pre><code>[u][b][z]jlreq[g][-v]
+</code></pre>
+<p>それぞれの文字は以下の場合に入ります.</p>
+<ul>
+<li><code>u</code>: upLaTeX利用時</li>
+<li><code>b</code>: ぶら下げ組み利用時.(クラスオプションに<code>hanging_punctuation</code>が指定された時.)</li>
+<li><code>z</code>: 行頭における開き括弧類の前の空きが,段落開始時が全角二分,折り返し時が二分の時.(クラスオプションに<code>open_bracket_pos=zenkakunibu_nibu</code>が指定された時.)</li>
+<li><code>g</code>: ゴシック用フォント.</li>
+<li><code>-v</code>: 縦書き用.</li>
+</ul>
+<p>例えば,ぶら下げ組みを利用せず,クラスオプションに<code>open_bracket_pos=zenkakunibu_nibu</code>が指定されいてるソースをpLaTeXで処理した場合,横書き明朝体には<code>zjlreq</code>という名前のJFMが使われます.</p>
+<h3 id="lualatexの場合">LuaLaTeXの場合</h3>
+<ul>
+<li>横書き用のJFMは<code>jlreq</code></li>
+<li>縦書き用のJFMは<code>jlreqv</code></li>
+</ul>
+<p>となります.ゴシックも同じJFMを使います.</p>
+<h2 id="その他-2">その他</h2>
+<ul>
+<li>クラスオプション<code>jlreq_notes</code>が渡されると,日本語組版処理の記述と矛盾する設定が行われた場合に通知がされます.</li>
+</ul>
+<h2 id="ライセンス">ライセンス</h2>
+<p>このパッケージは二条項BSDライセンスの元で配布されています.詳しくは<a href="LICENSE" class="uri">LICENSE</a>をご覧ください.</p>
+<h2 id="履歴">履歴</h2>
+<ul>
+<li>2017-02-08
+<ul>
+<li>最初のバージョン.</li>
+</ul></li>
+<li>2017-02-17
+<ul>
+<li>いくつかバグを修正.</li>
+<li>クラスオプション/<code>\jlreqsetup</code>にいくつかのキーを追加/変更.</li>
+<li><code>abstract</code>環境を実装.</li>
+<li>パッケージを読み込んでいるだけのはやめた.</li>
+</ul></li>
+<li>2017-03-14
+<ul>
+<li>いくつかバグを修正.</li>
+<li>和文ファミリを欧文ファミリに従属させるようにした.</li>
+<li><code>\DeclareBlockHeading</code>にオプションをたくさん追加.</li>
+<li>quote環境などを調整するオプションを追加.</li>
+</ul></li>
+<li>2017-03-20
+<ul>
+<li>バグ修正.</li>
+<li><code>\footnote / \sidenote / \endnote</code>の周りに必要ならば空白を挿入するようにした.</li>
+</ul></li>
+<li>2017-04-04
+<ul>
+<li>バグ修正.</li>
+<li><code>\DeclarePageStyle</code>に<code>tate</code>と<code>font</code>オプションを追加.</li>
+</ul></li>
+<li>2017-04-29
+<ul>
+<li>バグ修正</li>
+<li><code>jafontsize</code>と<code>jafontscale</code>をクラスオプションに,また<code>\jafontsize</code>を追加.</li>
+<li><code>\tatechuyoko</code>を追加.</li>
+<li>クラスオプション<code>jlreq_warnings</code>を<code>jlreq_notes</code>に変更.</li>
+<li>いくつかのクラスオプションを<code>\jlreqsetup</code>に移動.</li>
+<li>いくつかのオプションを<code>\jlreqsetup</code>に追加.</li>
+<li>クラスオプションの<code>paper={&lt;縦&gt;,&lt;横&gt;}</code>を<code>paper={&lt;横&gt;,&lt;縦&gt;}</code>に変更.</li>
+</ul></li>
+<li>2017-06-11
+<ul>
+<li><code>plext</code> / <code>lltjext</code>の読み込みを中止.</li>
+<li><code>\DeclareBlockHeading</code>に<code>align</code>を追加.<code>indent=center</code>や<code>end_indent=center</code>を廃止.</li>
+<li>一部の<code>\kcatcode</code> (upLaTeX時) を変更.</li>
+</ul></li>
+<li>2017-08-13
+<ul>
+<li><code>column_spanning</code>を<code>\DeclareBlockHeading</code>に追加.</li>
+<li>ページレイアウトにおける「本文の長さ」に傍注の長さを入れるようにした.</li>
+<li>傍注の長さのデフォルトを0とした.</li>
+<li>傍注の長さが0の時には<code>\sidenote</code>を定義しないようにした.</li>
+<li>和文間隔を挿入する命令を追加.</li>
+</ul></li>
+<li>2017-08-29
+<ul>
+<li>縦書きでも著者名が横書きで出てしまうバグを修正.</li>
+</ul></li>
+<li>2017-11-23
+<ul>
+<li>バグ修正</li>
+<li><code>\SetBlockHeadingSpaces</code>を追加.</li>
+<li><code>\contentsname</code> と <code>\indexname</code>に入っていたスペースを削除.</li>
+</ul></li>
+<li>2017-12-02
+<ul>
+<li>バグ修正</li>
+</ul></li>
+<li>2017-12-22
+<ul>
+<li>JFMを改善.</li>
+<li>別行見出しの間の<code>\label</code>の検出方法を変更.</li>
+<li><code>\theequation</code>,<code>\thefigure</code>,<code>\thetable</code>に章番号を追加.</li>
+</ul></li>
+<li>2018-02-01
+<ul>
+<li>縦書きの傍注は奇数ページにのみ出るようにした(改善の余地ありかも).</li>
+<li>LuaTeX時に<code>\fnfixbottomtrue</code>を追加.</li>
+<li>キャプション関係のオプションを<code>\jlreqsetup</code>に追加.</li>
+<li><code>itemization_beforeafter_space</code>を拡張.</li>
+<li>バグ修正.</li>
+</ul></li>
+<li>2018-04-11
+<ul>
+<li>縦書き二段組みの傍注を下段に出すようにした.</li>
+<li><code>begin_width_(odd|even)_page</code>を<code>\DeclareBlockHeading</code>に追加.</li>
+<li><code>\labelenumi</code>らをjarticleなどにあわせた.</li>
+<li><code>column_gap</code>クラスオプションを使うとコンパイルできなかったバグ修正.</li>
+<li><code>mark_format</code>を<code>\DeclarePageStyle</code>に追加.</li>
+</ul></li>
+<li>2018-05-19
+<ul>
+<li>目次内のラベルの長さを今までよりも長くした.</li>
+<li>一部のマクロをjlreq-helpers.styに分離した.</li>
+<li>バグ修正.</li>
+</ul></li>
+<li>2018-06-17
+<ul>
+<li>シリーズbもゴシックにするようにした.</li>
+<li>バグ修正.</li>
+</ul></li>
+<li>2018-07-31
+<ul>
+<li><code>\DeclarePageStyle</code>に<code>nombre_ii</code>等を追加.</li>
+<li>バグ修正.</li>
+<li><code>\jlreqsetup</code>に<code>footnote_second_indent</code>と<code>endnote_second_indent</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>
+</article>
+</body>
+</html>
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
index a4682dc5976..d6fe74f89b5 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.html
@@ -64,6 +64,7 @@
<li>可能な場合には,TrimBox / BleedBoxを設定</li>
<li>紙サイズの設定</li>
</ul>
+<p>なお,本パッケージは<a href="https://www.w3.org/TR/jlreq/ja/">日本語組版処理の要件</a> (JLReq)とは無縁です.JLReqにはトンボに関する記述はありません.</p>
<h2 id="インストール">インストール</h2>
<p>$TEXMF/tex/latex/jlreq内にjlreq-trimmarks.styとjlreq-helpers.styを配置してください.</p>
<h2 id="使い方">使い方</h2>
@@ -71,7 +72,7 @@
<pre><code>\usepackage[dvipdfmx,platex]{jlreq-trimmarks}
</code></pre>
<h2 id="オプション">オプション</h2>
-<p>以下のクラスオプションを受け付けます.keyval形式です.</p>
+<p>以下のパッケージオプションを受け付けます.keyval形式です.</p>
<h3 id="platex-uplatex-lulatex"><code>platex</code>, <code>uplatex</code>, <code>lulatex</code></h3>
<p>エンジンの指定です.省略時は,</p>
<ul>
@@ -86,7 +87,16 @@
<li><code>platex</code>または<code>uplatex</code>利用時は<code>dvipdfmx</code>.</li>
</ul>
<h3 id="trimmarks_paper"><code>trimmarks_paper</code></h3>
-<p>トンボ付きの紙サイズを指定します.<code>trimmarks_paper=a4</code>のように,<code>a0--a10</code>, <code>b0--b10</code>, <code>c2--c8</code>(BはJIS B列)を指定できる他,<code>trimmarks_paper={&lt;width&gt;,&lt;height&gt;}</code>と直接寸法を指定することも可能です.指定されなかった場合は,現在の紙サイズから縦横2インチ増えた値を採用します.</p>
+<p>トンボ付きの紙サイズを指定します.</p>
+<ul>
+<li><code>trimmarks_paper=a4</code>のように,<code>a0--a10</code>, <code>b0--b10</code>, <code>c2--c8</code>(BはJIS B列)を指定できる他,<code>trimmarks_paper={&lt;width&gt;,&lt;height&gt;}</code>と直接寸法を指定することができます.</li>
+<li><code>a4+{1cm,2cm}</code>のように<code>&lt;紙サイズ&gt;+{&lt;寸法横&gt;,&lt;寸法縦&gt;}</code>とした場合は,指定された紙サイズから指定された寸法だけ増やした紙サイズを設定します.</li>
+<li><code>a4+2cm</code>は<code>a4+{2cm,2cm}</code>と等価です.</li>
+<li><code>+2cm</code>と紙サイズの部分を省略すると,現在の紙サイズを利用します.</li>
+<li>デフォルトは<code>+2in</code>です.</li>
+</ul>
+<h3 id="landscape"><code>landscape</code></h3>
+<p>紙のサイズの縦と横とを入れ替えます.ただし入れ替えるのは<code>trimmarks_paper</code>で明示的に指定された値に限ります.例えば<code>landscape,trimmarks_paper=+{1cm,2cm}</code>とすると,もともとの紙サイズ(これは入れ替わらない)の横幅が2cm増え,縦幅が1cm増えた紙サイズとなります.</p>
<h3 id="show"><code>show</code></h3>
<p>何を出力するか指定します.<code>show={trimmarks,banner,digital}</code>のようにカンマ区切りのリストを与えます.引数を与えない場合は全て表示します.</p>
<ul>
@@ -96,7 +106,7 @@
<li><code>no</code>:何も表示しません.</li>
</ul>
<h2 id="jlreqtrimmarkssetup"><code>\jlreqtrimmarkssetup</code></h2>
-<p>クラスオプションで指定できない設定を行えます.keyval形式です.</p>
+<p>パッケージオプションで指定できない設定を行えます.keyval形式です.</p>
<h3 id="banner"><code>banner</code></h3>
<p><code>show=banner</code>時に出力される文字列.</p>
<h3 id="bleed_margin"><code>bleed_margin</code></h3>
@@ -125,6 +135,11 @@
<ul>
<li>バグ修正.</li>
</ul></li>
+<li>2018-08-08
+<ul>
+<li><code>trimmarks_paper</code>を拡張.</li>
+<li>パッケージオプション<code>landscape</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>
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
index ca30cf24094..d488bd1f181 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks-ja.md
@@ -7,6 +7,8 @@
* 可能な場合には,TrimBox / BleedBoxを設定
* 紙サイズの設定
+なお,本パッケージは[日本語組版処理の要件](https://www.w3.org/TR/jlreq/ja/) (JLReq)とは無縁です.JLReqにはトンボに関する記述はありません.
+
## インストール
$TEXMF/tex/latex/jlreq内にjlreq-trimmarks.styとjlreq-helpers.styを配置してください.
@@ -19,7 +21,7 @@ $TEXMF/tex/latex/jlreq内にjlreq-trimmarks.styとjlreq-helpers.styを配置し
````
## オプション
-以下のクラスオプションを受け付けます.keyval形式です.
+以下のパッケージオプションを受け付けます.keyval形式です.
### `platex`, `uplatex`, `lulatex`
エンジンの指定です.省略時は,
@@ -36,7 +38,15 @@ dviドライバの指定です.省略時は
* `platex`または`uplatex`利用時は`dvipdfmx`.
### `trimmarks_paper`
-トンボ付きの紙サイズを指定します.`trimmarks_paper=a4`のように,`a0--a10`, `b0--b10`, `c2--c8`(BはJIS B列)を指定できる他,`trimmarks_paper={<width>,<height>}`と直接寸法を指定することも可能です.指定されなかった場合は,現在の紙サイズから縦横2インチ増えた値を採用します.
+トンボ付きの紙サイズを指定します.
+* `trimmarks_paper=a4`のように,`a0--a10`, `b0--b10`, `c2--c8`(BはJIS B列)を指定できる他,`trimmarks_paper={<width>,<height>}`と直接寸法を指定することができます.
+* `a4+{1cm,2cm}`のように`<紙サイズ>+{<寸法横>,<寸法縦>}`とした場合は,指定された紙サイズから指定された寸法だけ増やした紙サイズを設定します.
+* `a4+2cm`は`a4+{2cm,2cm}`と等価です.
+* `+2cm`と紙サイズの部分を省略すると,現在の紙サイズを利用します.
+* デフォルトは`+2in`です.
+
+### `landscape`
+紙のサイズの縦と横とを入れ替えます.ただし入れ替えるのは`trimmarks_paper`で明示的に指定された値に限ります.例えば`landscape,trimmarks_paper=+{1cm,2cm}`とすると,もともとの紙サイズ(これは入れ替わらない)の横幅が2cm増え,縦幅が1cm増えた紙サイズとなります.
### `show`
何を出力するか指定します.`show={trimmarks,banner,digital}`のようにカンマ区切りのリストを与えます.引数を与えない場合は全て表示します.
@@ -47,7 +57,7 @@ dviドライバの指定です.省略時は
* `no`:何も表示しません.
## `\jlreqtrimmarkssetup`
-クラスオプションで指定できない設定を行えます.keyval形式です.
+パッケージオプションで指定できない設定を行えます.keyval形式です.
### `banner`
`show=banner`時に出力される文字列.
@@ -75,6 +85,9 @@ dviドライバの指定です.省略時は
- 最初のバージョン
* 2018-06-17
- バグ修正.
+* 2018-08-08
+ - `trimmarks_paper`を拡張.
+ - パッケージオプション`landscape`を追加.
--------------
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
index eab0f3f002c..1186f439f7f 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.html
@@ -62,8 +62,9 @@
<ul>
<li>Output trim marks</li>
<li>Set TrimBox and BleedBox if possible.</li>
-<li>Set the size of paper..</li>
+<li>Set the size of paper.</li>
</ul>
+<p>Note that this package is independent from <a href="https://www.w3.org/TR/jlreq/">Requirements for Japanese Text Layout</a> (JLReq). JLReq says nothing about trim marks.</p>
<h2 id="installation">Installation</h2>
<p>Move jlreq-trimmarks.sty and jlre-helpers.sty to $TEXMF/tex/latex/jlreq.</p>
<h2 id="how-to-use">How to use</h2>
@@ -71,7 +72,7 @@
<pre><code>\usepackage[dvipdfmx,platex]{jlreq-trimmarks}
</code></pre>
<h2 id="options">Options</h2>
-<p>The following class options (keyval style) are available.</p>
+<p>The following package options (keyval style) are available.</p>
<h3 id="platex-uplatex-lulatex"><code>platex</code>, <code>uplatex</code>, <code>lulatex</code></h3>
<p>Set the engine. If it is not specified, then the engine is</p>
<ul>
@@ -85,11 +86,16 @@
<li>the driver is <code>dvipdmx</code> if the engine is <code>platex</code> or <code>uplatex</code></li>
</ul>
<h3 id="trimmarks_paper"><code>trimmarks_paper</code></h3>
-<p>Set the size of the paper including trim marks. There are two ways to specify it.</p>
+<p>Set the size of the paper including trim marks.</p>
<ul>
-<li><code>trimmarks_paper=&lt;paper type&gt;</code>: for the paper type, you can use <code>a0--a10</code>, <code>b0--b10</code> and <code>c2--c8</code>. Note that <code>b0--b10</code> is `JIS B' (Japanese B-series variant).</li>
-<li><code>trimmarks_paper={&lt;width&gt;,height&gt;}</code></li>
+<li><code>trimmarks_paper=&lt;paper type&gt;</code>: specify via the paper type. for the paper type, you can use <code>a0--a10</code>, <code>b0--b10</code> and <code>c2--c8</code>. Note that <code>b0--b10</code> is `JIS B' (Japanese B-series variant).</li>
+<li><code>trimmarks_paper={&lt;width&gt;,height&gt;}</code>: specify via the width and height.</li>
+<li><code>trimmarks_paper=&lt;paper size&gt;+{&lt;width&gt;,&lt;height&gt;}</code> (e.g. <code>trimmarks_paper=a4+{1cm,2cm}</code>): <code>&lt;width&gt;</code> (resp. <code>&lt;height&gt;</code>) is added to the width (resp. height) of the paper size specified by <code>&lt;paper size&gt;</code> For <code>&lt;paper size&gt;</code>, one can use <code>&lt;paper type&gt;</code> or <code>{&lt;width&gt;,&lt;height&gt;}</code> as in the above.</li>
+<li><code>trimmarks_paper=a4+2cm</code> is equivalent to <code>trimmarks_paper=a4+{2cm,2cm}</code>.</li>
+<li>If <code>&lt;paper size&gt;</code> is empty (e.g. <code>trimmarks_paper=+2cm</code>), the current paper size (which is specified usually by the option for the document class) is used.</li>
</ul>
+<h3 id="landscape"><code>landscape</code></h3>
+<p>Swap the width and the height. This swaps only the width and height which is specified with the option <code>trimmarks_paper</code>. For example, <code>landscape,trimmarks_paper=+{2cm,1cm}</code>, adds 1cm to the height and 2cm to the width. But the current paper size is not swapped.</p>
<h3 id="show"><code>show</code></h3>
<p>Specify the types of trim marks which the package outputs. It is specified with the comma separated list like <code>show={trimmarks,banner,digital}</code>. If no argument is given, everything will be showed.</p>
<ul>
@@ -101,7 +107,7 @@
<h2 id="jlreqtrimmarkssetup"><code>\jlreqtrimmarkssetup</code></h2>
<p>Set the additional settings with the keyval style.</p>
<h3 id="banner"><code>banner</code></h3>
-<p>The things which the package outputs when <code>show=banner</code> is specified in the class option.</p>
+<p>The things which the package outputs when <code>show=banner</code> is specified in the package option.</p>
<h3 id="bleed_margin"><code>bleed_margin</code></h3>
<p>Set the bleed margin.</p>
<h3 id="trimmarks_width"><code>trimmarks_width</code></h3>
@@ -126,6 +132,11 @@
<ul>
<li>Fixed a bug.</li>
</ul></li>
+<li>2018-08-08
+<ul>
+<li>Extended <code>trimmarks_paper</code>.</li>
+<li>Added a package option <code>landscape</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>
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
index d206d31251f..8be01236445 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq-trimmarks.md
@@ -5,7 +5,9 @@ This package outputs trim marks. It works with [LuaTeX-ja](https://osdn.jp/proje
* Output trim marks
* Set TrimBox and BleedBox if possible.
-* Set the size of paper..
+* Set the size of paper.
+
+Note that this package is independent from [Requirements for Japanese Text Layout](https://www.w3.org/TR/jlreq/) (JLReq). JLReq says nothing about trim marks.
## Installation
Move jlreq-trimmarks.sty and jlre-helpers.sty to $TEXMF/tex/latex/jlreq.
@@ -18,7 +20,7 @@ Load it by `\usepackage` with specifying the TeX engine and the DVI driver.
````
## Options
-The following class options (keyval style) are available.
+The following package options (keyval style) are available.
### `platex`, `uplatex`, `lulatex`
Set the engine. If it is not specified, then the engine is
@@ -33,10 +35,16 @@ Set the dvi driver. If it is not specified, then
* the driver is `dvipdmx` if the engine is `platex` or `uplatex`
### `trimmarks_paper`
-Set the size of the paper including trim marks. There are two ways to specify it.
+Set the size of the paper including trim marks.
+
+* `trimmarks_paper=<paper type>`: specify via the paper type. for the paper type, you can use `a0--a10`, `b0--b10` and `c2--c8`. Note that `b0--b10` is `JIS B' (Japanese B-series variant).
+* `trimmarks_paper={<width>,height>}`: specify via the width and height.
+* `trimmarks_paper=<paper size>+{<width>,<height>}` (e.g. `trimmarks_paper=a4+{1cm,2cm}`): `<width>` (resp. `<height>`) is added to the width (resp. height) of the paper size specified by `<paper size>` For `<paper size>`, one can use `<paper type>` or `{<width>,<height>}` as in the above.
+* `trimmarks_paper=a4+2cm` is equivalent to `trimmarks_paper=a4+{2cm,2cm}`.
+* If `<paper size>` is empty (e.g. `trimmarks_paper=+2cm`), the current paper size (which is specified usually by the option for the document class) is used.
-* `trimmarks_paper=<paper type>`: for the paper type, you can use `a0--a10`, `b0--b10` and `c2--c8`. Note that `b0--b10` is `JIS B' (Japanese B-series variant).
-* `trimmarks_paper={<width>,height>}`
+### `landscape`
+Swap the width and the height. This swaps only the width and height which is specified with the option `trimmarks_paper`. For example, `landscape,trimmarks_paper=+{2cm,1cm}`, adds 1cm to the height and 2cm to the width. But the current paper size is not swapped.
### `show`
Specify the types of trim marks which the package outputs. It is specified with the comma separated list like `show={trimmarks,banner,digital}`. If no argument is given, everything will be showed.
@@ -50,7 +58,7 @@ Specify the types of trim marks which the package outputs. It is specified with
Set the additional settings with the keyval style.
### `banner`
-The things which the package outputs when `show=banner` is specified in the class option.
+The things which the package outputs when `show=banner` is specified in the package option.
### `bleed_margin`
Set the bleed margin.
@@ -74,6 +82,9 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS
- First release.
* 2018-06-17
- Fixed a bug.
+* 2018-08-08
+ - Extended `trimmarks_paper`.
+ - Added a package option `landscape`.
--------------
diff --git a/Master/texmf-dist/doc/latex/jlreq/jlreq.html b/Master/texmf-dist/doc/latex/jlreq/jlreq.html
index 72af47fc093..cda3e4835df 100644
--- a/Master/texmf-dist/doc/latex/jlreq/jlreq.html
+++ b/Master/texmf-dist/doc/latex/jlreq/jlreq.html
@@ -1,181 +1,187 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="generator" content="pandoc">
- <title>jlreq</title>
- <style>
- .markdown-body {
- padding-top: 10px;
- padding-bottom: 10px;
- background-color: white;
- padding: 30px;
- line-height: 170%;
- }
- h1{
- font-size: 200%;
- }
- h2{
- border-style: solid;
- border-width: 0 0 0.1em 0em;
- padding: 0 0 0.2em 0em;
- border-color: #EEEEEE;
- margin-top: 2em;
- }
- h3{
- border-style: solid;
- border-width: 0 0 0 0.5em;
- padding: 0 0 0 0.5em;
- border-color: #EEEEEE;
- margin-top: 2em;
- }
- code{
- white-space: pre;
- font-weight: normal;
- background-color: #F4F4F4;
- border-color: #F4F4F4;
- border-style: solid;
- border-width: .2em .5em;
- border-radius: .2em;
- }
- pre{
- background-color: #F8F8F8;
- border-color: #F8F8F8;
- border-width: 1em;
- border-style: solid;
- border-radius: .5em;
- padding: 0;
- margin: 0;
- line-height: 130%;
- }
- pre code{
- background-color: #F8F8F8;
- border-style: none;
- }
- </style>
-</head>
-<body>
-<article class="markdown-body">
-<h1 id="jlreq">jlreq</h1>
-<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>
-<ul>
-<li>*.tfm -&gt; $TEXMF/fonts/tfm/public/jlreq</li>
-<li>*.vf -&gt; $TEXMF/fonts/vf/public/jlreq</li>
-<li>jfm-jlreq.lua jfm-jlreqv.lua -&gt; $TEXMF/tex/luatex/jlreq</li>
-<li>jlreq.cls, jlreq-helpers.sty -&gt; $TEXMF/tex/latex/jlreq</li>
-</ul>
-<p><code>make install</code> will do this where $TEXMF=$TEXMFHOME</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>
-<p>This package is distributed under the BSD 2-Clause License. See <a href="LICENSE" class="uri">LICENSE</a>.</p>
-<h2 id="changelog">CHANGELOG</h2>
-<ul>
-<li>2017-02-08
-<ul>
-<li>First release.</li>
-</ul></li>
-<li>2017-02-17
-<ul>
-<li>Fixed bugs.</li>
-<li>Implement <code>abstract</code> environment.</li>
-<li>Changed/Added some keys to class option/<code>\jlreqsetup</code></li>
-<li>Stopped to load <code>pxrubirica</code>, <code>luatexja-ruby</code> and <code>nidanfloat</code>.</li>
-</ul></li>
-<li>2017-03-14
-<ul>
-<li>Fixed bugs.</li>
-<li><code>\sffamily</code> etc. also change the Japanese font family.</li>
-<li>Added many options to <code>\DeclareBlockHeading</code>.</li>
-<li>Some options related to <code>quote</code> environment etc.</li>
-</ul></li>
-<li>2017-03-20
-<ul>
-<li>Fixed bugs.</li>
-<li>Insert some spaces around <code>\footnote / \sidenote / \endnote</code>.</li>
-</ul></li>
-<li>2017-04-04
-<ul>
-<li>Fixed a bug.</li>
-<li>Added options <code>tate</code> and <code>font</code> to <code>\DeclarePageStyle</code>.</li>
-</ul></li>
-<li>2017-04-29
-<ul>
-<li>Fixed bugs.</li>
-<li>Added <code>jafontsize</code> and <code>jafontscale</code> options and <code>\jafontsize</code>.</li>
-<li>Added <code>\tatechuyoko</code>.</li>
-<li><code>jlreq_warnings</code> -&gt; <code>jlreq_notes</code> (class option).</li>
-<li>Moved some class options to <code>\jlreqsetup</code>.</li>
-<li>Added some options to <code>\jlreqsetup</code>.</li>
-<li><code>paper={&lt;height&gt;,&lt;width&gt;}</code> -&gt; <code>paper={&lt;width&gt;,&lt;height&gt;}</code>.</li>
-</ul></li>
-<li>2017-06-11
-<ul>
-<li>Stopped to load <code>plext</code> and <code>lltjext</code>.</li>
-<li>Added <code>align</code> to <code>\DeclareBlockHeading</code> and delete <code>indent=center</code>, <code>end_indent=center</code>.</li>
-<li>Changed <code>\kcatcode</code> for some characters (upLaTeX).</li>
-</ul></li>
-<li>2017-08-13
-<ul>
-<li>Added <code>column_spanning</code> to <code>\DeclareBlockHeading</code>.</li>
-<li>Sidenotes are a part of the main text now.</li>
-<li>Changed the default length of sidenotes to 0.</li>
-<li>jlreq does not define <code>\sidenote</code> if the length for sidenotes is zero.</li>
-<li>Added a command for the full-width ideographic space.</li>
-</ul></li>
-<li>2017-08-29
-<ul>
-<li>Fixed a bug.</li>
-</ul></li>
-<li>2017-11-23
-<ul>
-<li>Fixed bugs.</li>
-<li>Added <code>\SetBlockHeadingSpaces</code>.</li>
-<li>Removed a space from <code>\contentsname</code> and <code>\indexname</code>.</li>
-</ul></li>
-<li>2017-12-02
-<ul>
-<li>Fixed bugs.</li>
-</ul></li>
-<li>2017-12-22
-<ul>
-<li>Improved JFM.</li>
-<li>Change the way to detect <code>\label</code> between block headings.</li>
-<li>Added chapter number to <code>\theequation</code>,<code>\thefigure</code>,<code>\thetable</code>.</li>
-</ul></li>
-<li>2018-02-01
-<ul>
-<li>Sidenotes appears only odd pages in <code>tate</code> mode.</li>
-<li>Added <code>\fnfixbottomtrue</code> for LuaLaTeX.</li>
-<li>Added some options related to captions.</li>
-<li>Extended <code>itemization_beforeafter_space</code>.</li>
-<li>Fixed bugs.</li>
-</ul></li>
-<li>2018-04-11
-<ul>
-<li>Sidenotes (<code>\footnote</code>) appears in the second column in <code>tate</code> mode.</li>
-<li>Added options <code>begin_widh_(odd|even)_page</code> to <code>\DeclareBlockHeading</code>.</li>
-<li>Changed <code>\labelenumi</code> as in <code>jarticle</code> etc.</li>
-<li>Fix a bug on <code>column_gap</code> class option.</li>
-<li>Added <code>mark_format</code> to <code>\DeclarePageStyle</code>.</li>
-</ul></li>
-<li>2018-05-19
-<ul>
-<li>Made the width of the label in the table of contents longer.</li>
-<li>Moved some macros to jlreq-helpers.sty</li>
-<li>Fixed bugs.</li>
-</ul></li>
-<li>2018-06-17
-<ul>
-<li>Gothic font is attached to font shape 'b'.</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>
-</article>
-</body>
-</html>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="generator" content="pandoc">
+ <title>jlreq</title>
+ <style>
+ .markdown-body {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ background-color: white;
+ padding: 30px;
+ line-height: 170%;
+ }
+ h1{
+ font-size: 200%;
+ }
+ h2{
+ border-style: solid;
+ border-width: 0 0 0.1em 0em;
+ padding: 0 0 0.2em 0em;
+ border-color: #EEEEEE;
+ margin-top: 2em;
+ }
+ h3{
+ border-style: solid;
+ border-width: 0 0 0 0.5em;
+ padding: 0 0 0 0.5em;
+ border-color: #EEEEEE;
+ margin-top: 2em;
+ }
+ code{
+ white-space: pre;
+ font-weight: normal;
+ background-color: #F4F4F4;
+ border-color: #F4F4F4;
+ border-style: solid;
+ border-width: .2em .5em;
+ border-radius: .2em;
+ }
+ pre{
+ background-color: #F8F8F8;
+ border-color: #F8F8F8;
+ border-width: 1em;
+ border-style: solid;
+ border-radius: .5em;
+ padding: 0;
+ margin: 0;
+ line-height: 130%;
+ }
+ pre code{
+ background-color: #F8F8F8;
+ border-style: none;
+ }
+ </style>
+</head>
+<body>
+<article class="markdown-body">
+<h1 id="jlreq">jlreq</h1>
+<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>
+<ul>
+<li>*.tfm -&gt; $TEXMF/fonts/tfm/public/jlreq</li>
+<li>*.vf -&gt; $TEXMF/fonts/vf/public/jlreq</li>
+<li>jfm-jlreq.lua jfm-jlreqv.lua -&gt; $TEXMF/tex/luatex/jlreq</li>
+<li>jlreq.cls, jlreq-helpers.sty -&gt; $TEXMF/tex/latex/jlreq</li>
+</ul>
+<p><code>make install</code> will do this where $TEXMF=$TEXMFHOME</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>
+<p>This package is distributed under the BSD 2-Clause License. See <a href="LICENSE" class="uri">LICENSE</a>.</p>
+<h2 id="changelog">CHANGELOG</h2>
+<ul>
+<li>2017-02-08
+<ul>
+<li>First release.</li>
+</ul></li>
+<li>2017-02-17
+<ul>
+<li>Fixed bugs.</li>
+<li>Implement <code>abstract</code> environment.</li>
+<li>Changed/Added some keys to class option/<code>\jlreqsetup</code></li>
+<li>Stopped to load <code>pxrubirica</code>, <code>luatexja-ruby</code> and <code>nidanfloat</code>.</li>
+</ul></li>
+<li>2017-03-14
+<ul>
+<li>Fixed bugs.</li>
+<li><code>\sffamily</code> etc. also change the Japanese font family.</li>
+<li>Added many options to <code>\DeclareBlockHeading</code>.</li>
+<li>Some options related to <code>quote</code> environment etc.</li>
+</ul></li>
+<li>2017-03-20
+<ul>
+<li>Fixed bugs.</li>
+<li>Insert some spaces around <code>\footnote / \sidenote / \endnote</code>.</li>
+</ul></li>
+<li>2017-04-04
+<ul>
+<li>Fixed a bug.</li>
+<li>Added options <code>tate</code> and <code>font</code> to <code>\DeclarePageStyle</code>.</li>
+</ul></li>
+<li>2017-04-29
+<ul>
+<li>Fixed bugs.</li>
+<li>Added <code>jafontsize</code> and <code>jafontscale</code> options and <code>\jafontsize</code>.</li>
+<li>Added <code>\tatechuyoko</code>.</li>
+<li><code>jlreq_warnings</code> -&gt; <code>jlreq_notes</code> (class option).</li>
+<li>Moved some class options to <code>\jlreqsetup</code>.</li>
+<li>Added some options to <code>\jlreqsetup</code>.</li>
+<li><code>paper={&lt;height&gt;,&lt;width&gt;}</code> -&gt; <code>paper={&lt;width&gt;,&lt;height&gt;}</code>.</li>
+</ul></li>
+<li>2017-06-11
+<ul>
+<li>Stopped to load <code>plext</code> and <code>lltjext</code>.</li>
+<li>Added <code>align</code> to <code>\DeclareBlockHeading</code> and delete <code>indent=center</code>, <code>end_indent=center</code>.</li>
+<li>Changed <code>\kcatcode</code> for some characters (upLaTeX).</li>
+</ul></li>
+<li>2017-08-13
+<ul>
+<li>Added <code>column_spanning</code> to <code>\DeclareBlockHeading</code>.</li>
+<li>Sidenotes are a part of the main text now.</li>
+<li>Changed the default length of sidenotes to 0.</li>
+<li>jlreq does not define <code>\sidenote</code> if the length for sidenotes is zero.</li>
+<li>Added a command for the full-width ideographic space.</li>
+</ul></li>
+<li>2017-08-29
+<ul>
+<li>Fixed a bug.</li>
+</ul></li>
+<li>2017-11-23
+<ul>
+<li>Fixed bugs.</li>
+<li>Added <code>\SetBlockHeadingSpaces</code>.</li>
+<li>Removed a space from <code>\contentsname</code> and <code>\indexname</code>.</li>
+</ul></li>
+<li>2017-12-02
+<ul>
+<li>Fixed bugs.</li>
+</ul></li>
+<li>2017-12-22
+<ul>
+<li>Improved JFM.</li>
+<li>Change the way to detect <code>\label</code> between block headings.</li>
+<li>Added chapter number to <code>\theequation</code>,<code>\thefigure</code>,<code>\thetable</code>.</li>
+</ul></li>
+<li>2018-02-01
+<ul>
+<li>Sidenotes appears only odd pages in <code>tate</code> mode.</li>
+<li>Added <code>\fnfixbottomtrue</code> for LuaLaTeX.</li>
+<li>Added some options related to captions.</li>
+<li>Extended <code>itemization_beforeafter_space</code>.</li>
+<li>Fixed bugs.</li>
+</ul></li>
+<li>2018-04-11
+<ul>
+<li>Sidenotes (<code>\footnote</code>) appears in the second column in <code>tate</code> mode.</li>
+<li>Added options <code>begin_widh_(odd|even)_page</code> to <code>\DeclareBlockHeading</code>.</li>
+<li>Changed <code>\labelenumi</code> as in <code>jarticle</code> etc.</li>
+<li>Fix a bug on <code>column_gap</code> class option.</li>
+<li>Added <code>mark_format</code> to <code>\DeclarePageStyle</code>.</li>
+</ul></li>
+<li>2018-05-19
+<ul>
+<li>Made the width of the label in the table of contents longer.</li>
+<li>Moved some macros to jlreq-helpers.sty</li>
+<li>Fixed bugs.</li>
+</ul></li>
+<li>2018-06-17
+<ul>
+<li>Gothic font is attached to font shape 'b'.</li>
+<li>Fixed bugs.</li>
+</ul></li>
+<li>2018-08-08
+<ul>
+<li>Added <code>nombre_ii</code> etc. to <code>\DeclarePageStyle</code>.</li>
+<li>Fixed bugs.</li>
+<li>Added <code>footnote_second_indent</code> and <code>endnote_second_indent</code> to <code>\jlreqsetup</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>
+</article>
+</body>
+</html>
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
index c8204d7e9db..41bb74447fd 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
@@ -1,7 +1,7 @@
% エンジン非依存のマクロ集
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{jlreq-helpers}[2018/04/12 jlreq-helpers]
+\ProvidesPackage{jlreq-helpers}[2018/08/08 jlreq-helpers]
\RequirePackage{xkeyval,etoolbox}
%. helper1
@@ -248,7 +248,7 @@
\jlreq@do
}
\long\def\jlreq@parsekeyval@nokey@#1,{%
- \jlreq@ifendmark{#1}{}{\jlreq@parsekeyval@nokey@@#1=\jlreq@endmark}%
+ \jlreq@ifendmark{#1}{}{\jlreq@ifempty{#1}{\jlreq@parsekeyval@nokey@}{\jlreq@parsekeyval@nokey@@#1=\jlreq@endmark}}%
}
\long\def\jlreq@parsekeyval@nokey@@#1=#2\jlreq@endmark{%
\jlreq@ifempty{#2}{\jlreq@parsekeyval@nokey@@@{}{#1}}{\expandafter\jlreq@parsekeyval@nokey@@@\expandafter{\jlreq@parsekeyval@nokey@@@@#2\jlreq@endmark}{#1}}%
@@ -460,5 +460,14 @@
\jlreq@do
}
+\def\jlreq@for@noexpand#1:={\@for#1:=\@empty}
+
+\def\jlreq@swap#1#2{%
+ \let\jlreq@swaptoken=#1%
+ \let#1=#2%
+ \let#2=\jlreq@swaptoken
+ \let\jlreq@swaptoken=\@undefined
+}
+
\endinput
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
index 73d9bed7603..d6242c6c56d 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq-trimmarks.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{jlreq-trimmarks}[2018/06/17 jlreq-trimmarks]
+\ProvidesPackage{jlreq-trimmarks}[2018/08/08 jlreq-trimmarks]
\RequirePackage{xkeyval,etoolbox}
\RequirePackage{jlreq-helpers}
@@ -52,7 +52,7 @@
}
\newcommand*{\jlreq@trimmarks@addpapersize@@}[3]{%
\@for\@tempa:=#1\do{%
- \eappto\jlreq@trimmarks@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\def\jlreq@trimmarks@paperwidth{#2}\def\jlreq@trimmarks@paperheight{#3}}}}%
+ \eappto\jlreq@trimmarks@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\def\jlreq@resulta{#2}\def\jlreq@resultb{#3}}}}%
}%
}
\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@switchpapersize}
@@ -100,21 +100,24 @@
\jlreq@trimmarks@addpapersize{executive}[executive]
\jlreq@trimmarks@addpapersize{hagaki}[hagaki]
-\DeclareOptionX{trimmarks_paper}{
- \edef\jlreq@do{%
- \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@trimmarks@switchpapersize}}%
- [\unexpanded{%
- \jlreq@helper@dividebycomma{#1}%
- \ifjlreq@result
- \edef\jlreq@trimmarks@paperwidth{\jlreq@resulta}
- \edef\jlreq@trimmarks@paperheight{\jlreq@resultb}
- \else
- \PackageError{jlreq}{The paper #1 is unknown}{\@ehc}%
- \fi
- }]%
- }%
- \jlreq@do
+% width -> \jlreq@resulta, height -> \jlreq@resultb
+\edef\jlreq@trimmarks@analyzepapersize#1{%
+ \noexpand\jlreq@switch{#1}{%
+ \expandonce{\jlreq@trimmarks@switchpapersize}%
+ {%
+ \noexpand\jlreq@helper@dividebycomma{#1}
+ \unexpanded{\ifjlreq@result\else}
+ \unexpanded{\def\jlreq@resulta}{#1}
+ \unexpanded{\def\jlreq@resultb}{#1}
+ \noexpand\fi
+ }%
+ }\noexpand\relax%
}
+\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@analyzepapersize}
+
+\def\jlreq@trimmarks@option@papersize{+2in}
+\DeclareOptionX{trimmarks_paper}{\def\jlreq@trimmarks@option@papersize{#1}}
+\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@option@papersize}
\newif\ifjlreq@trimmarks@digital \jlreq@trimmarks@digitaltrue
\newif\ifjlreq@trimmarks@show \jlreq@trimmarks@showtrue
@@ -136,6 +139,9 @@
}
}
}
+\newif\ifjlreq@trimmarks@landscape \jlreq@trimmarks@landscapefalse
+\jlreq@trimmarks@DeclareOption{landscape}{\jlreq@trimmarks@landscapetrue}
+\jlreq@trimmarks@afterpkg@addtodeleteif{\ifjlreq@trimmarks@landscape}
\let\jlreq@temporary@original@@removeelement=\@removeelement
\let\@removeelement=\jlreq@helper@removeelement
@@ -143,9 +149,37 @@
\let\@removeelement=\jlreq@temporary@original@@removeelement
\let\jlreq@temporary@original@@removeelement=\@undefined
+\def\jlreq@trimmarks@setpapersize#1{%
+ \jlreq@ifcontains{#1}{+}{
+ \def\@tempa##1+##2\jlreq@endmark{%
+ \jlreq@ifempty{##1}{
+ \let\jlreq@tempa=\paperwidth
+ \let\jlreq@tempb=\paperheight
+ }{
+ \jlreq@trimmarks@analyzepapersize{##1}
+ \let\jlreq@tempa=\jlreq@resulta
+ \let\jlreq@tempb=\jlreq@resultb
+ \ifjlreq@trimmarks@landscape\jlreq@swap{\jlreq@tempa}{\jlreq@tempb}\fi
+ }
+ \jlreq@trimmarks@analyzepapersize{##2}
+ \ifjlreq@trimmarks@landscape\jlreq@swap{\jlreq@resulta}{\jlreq@resultb}\fi
+ \edef\jlreq@trimmarks@paperwidth{\the\dimexpr\jlreq@tempa + \jlreq@resulta\relax}
+ \edef\jlreq@trimmarks@paperheight{\the\dimexpr\jlreq@tempb + \jlreq@resultb\relax}
+ }
+ \@tempa#1\jlreq@endmark
+ }{
+ \jlreq@trimmarks@analyzepapersize{#1}
+ \ifjlreq@trimmarks@landscape\jlreq@swap{\jlreq@resulta}{\jlreq@resultb}\fi
+ \edef\jlreq@trimmarks@paperwidth{\jlreq@resulta}
+ \edef\jlreq@trimmarks@paperheight{\jlreq@resultb}
+ }
+}
+\jlreq@trimmarks@afterpkg@addtodeletecs{\jlreq@trimmarks@setpapersize}
+\expandafter\jlreq@trimmarks@setpapersize\expandafter{\jlreq@trimmarks@option@papersize}
+
\ifx o\jlreq@trimmarks@driver
\ifjlreq@trimmarks@digital
- \ClassError{jlreq}{`show=digital' can't be used with the driver `dviout'}{\@ehc}
+ \PackageError{jlreq-trimmarks}{`show=digital' can't be used with the driver `dviout'}{\@ehc}
\fi
\fi
@@ -215,11 +249,6 @@
\fi
\fi
-\ifx\jlreq@trimmarks@paperwidth\@undefined
- \edef\jlreq@trimmarks@paperwidth{\the\dimexpr\paperwidth + 2in\relax}
- \edef\jlreq@trimmarks@paperheight{\the\dimexpr\paperheight + 2in\relax}
-\fi
-
\ifx l\jlreq@engine
\setlength{\pagewidth}{\dimexpr\jlreq@trimmarks@paperwidth\relax}
\setlength{\pageheight}{\dimexpr\jlreq@trimmarks@paperheight\relax}
diff --git a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
index b717e3efbf7..9291611a4c3 100644
--- a/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
+++ b/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
@@ -1,4893 +1,5254 @@
-%% Japanese document class based on requirements for Japanese text layout
-%%
-%% The package is distributed under the BSD 2-Clause License
-%%
-%%
-% (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2018/06/17 jlreq]
-\RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
-\RequirePackage{jlreq-helpers}
-
-\newcommand*{\jlreq@undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
-% クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
-\newcommand*{\jlreq@aftercls@addtodeletecs}[1]{%
- \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefcs{#1}{\jlreq@undeferr}}%
-}
-\newcommand*{\jlreq@aftercls@addtodeleteif}[1]{%
- \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefif{#1}{\jlreq@undeferr}}%
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeletecs}
-\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeleteif}
-\AtEndOfClass{%
- \jlreq@aftercls@deletecslist
- \jlreq@helper@undefcs{\jlreq@aftercls@deletecslist}{\jlreq@undeferr}%
- \undef{\jlreq@undeferr}%
-}
-
-% preambleにいるかのスイッチ
-\newif\ifjlreq@preamble
-\jlreq@preambletrue
-\AtBeginDocument{\jlreq@preamblefalse}
-
-\def\jlreq@saveoriginalcs#1{%
- \ifx#1\relax
- \ClassError{jlreq}{Trying to save \string#1 but it's not defined, may be a bug}{\@ehc}%
- \fi
- \expandafter\ifx\csname jlreq@original@\expandafter\@gobble\string#1\endcsname\relax\else
- \ClassError{jlreq}{Trying to save \string#1 twice, may be a bug}{\@ehc}%
- \fi
- \expandafter\let\csname jlreq@original@\expandafter\@gobble\string#1\endcsname=#1
-}
-\def\jlreq@useoriginalcs#1{%
- \ifcsname jlreq@original@\expandafter\@gobble\string#1\endcsname\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
- {\csname jlreq@original@\expandafter\@gobble\string#1\endcsname}%
- {#1}%
-}
-
-%. オプションの定義
-% オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する)
-% ものは\jlreq@option@<key>に格納する.
-% _とかは@に変換する.
-% 引数無しの\DeclareOptionX
-\newcommand*{\jlreq@DeclareOption}[2]{%
- \DeclareOptionX{#1}{%
- \jlreq@ifempty{##1}{}{\ClassError{jlreq}{The option #1 should have no value}{\@ehc}}%
- #2%
- }
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@DeclareOption}
-% エンジン類
-\jlreq@DeclareOption{uplatex}{\let\jlreq@engine=u}
-\jlreq@DeclareOption{platex}{\let\jlreq@engine=p}
-\jlreq@DeclareOption{lualatex}{\let\jlreq@engine=l}
-
-% 文書のタイプ
-\newcommand*\jlreq@article@type{article}
-\define@choicekey{jlreq.cls}{article_type}{article,report,book}{\renewcommand*{\jlreq@article@type}{#1}}
-\jlreq@DeclareOption{article}{\renewcommand*{\jlreq@article@type}{article}}
-\jlreq@DeclareOption{report}{\renewcommand*{\jlreq@article@type}{report}}
-\jlreq@DeclareOption{book}{\renewcommand*{\jlreq@article@type}{book}}
-
-%.. 基本版面.まずは紙サイズ.
-\def\jlreq@switchpapersize{}
-\jlreq@aftercls@addtodeletecs{\jlreq@switchpapersize}
-% \jlreq@addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦}
-
-\def\jlreq@addpapersize#1#2{%
- \@ifnextchar[{\jlreq@addpapersize@{#1}{#2}}{\jlreq@addpapersize@@{#1}{#2}}
-}
-\def\jlreq@addpapersize@#1#2[#3]{%
- \edef\@tempa{\unexpanded{\jlreq@addpapersize@@{#1}{#2}}\csexpandonce{jlreq@helper@papersizelist@#3}}%
- \@tempa
-}
-\newcommand*{\jlreq@addpapersize@@}[4]{%
- \@for\@tempa:=#1\do{%
- \eappto\jlreq@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}%
- }%
- \@for\@tempa:=#2\do{%
- \expandafter\jlreq@DeclareOption\expandafter{\@tempa}{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}%
- }%
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize}
-\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@}
-\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@@}
-\DeclareOptionX{paper}{
- \edef\jlreq@do{%
- \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@switchpapersize}}%
- [\unexpanded{%
- \jlreq@helper@dividebycomma{#1}%
- \ifjlreq@result
- \setlength{\paperwidth}{\dimexpr\jlreq@resulta\relax}%
- \setlength{\paperheight}{\dimexpr\jlreq@resultb\relax}%
- \else
- \ClassError{jlreq}{The paper #1 is unknown}{\@ehc}%
- \fi
- }]%
- }%
- \jlreq@do
-}
-% 紙サイズ一覧.b*はJIS B.
-\jlreq@addpapersize{a0,A0}{}[a0]
-\jlreq@addpapersize{a1,A1}{}[a1]
-\jlreq@addpapersize{a2,A2}{}[a2]
-\jlreq@addpapersize{a3,A3}{a3paper}[a3]
-\jlreq@addpapersize{a4,A4}{a4paper}[a4]
-\jlreq@addpapersize{a5,A5}{a5paper}[a5]
-\jlreq@addpapersize{a6,A6}{a6paper}[a6]
-\jlreq@addpapersize{a7,A7}{}[a7]
-\jlreq@addpapersize{a8,A8}{}[a8]
-\jlreq@addpapersize{a9,A9}{}[a9]
-\jlreq@addpapersize{a10,A10}{}[a10]
-
-\jlreq@addpapersize{b0,B0}{}[b0]
-\jlreq@addpapersize{b1,B1}{}[b1]
-\jlreq@addpapersize{b2,B2}{}[b2]
-\jlreq@addpapersize{b3,B3}{}[b3]
-\jlreq@addpapersize{b4,B4}{b4paper}[b4]
-\jlreq@addpapersize{b5,B5}{b5paper}[b5]
-\jlreq@addpapersize{b6,B6}{b6paper}[b6]
-\jlreq@addpapersize{b7,B7}{}[b7]
-\jlreq@addpapersize{b8,B8}{}[b8]
-\jlreq@addpapersize{b9,B9}{}[b9]
-\jlreq@addpapersize{b10,B10}{}[b10]
-
-\jlreq@addpapersize{c2,C2}{}[c2]
-\jlreq@addpapersize{c3,C3}{}[c3]
-\jlreq@addpapersize{c4,C4}{}[c4]
-\jlreq@addpapersize{c5,C5}{}[c5]
-\jlreq@addpapersize{c6,C6}{}[c6]
-\jlreq@addpapersize{c7,C7}{}[c7]
-\jlreq@addpapersize{c8,C8}{}[c8]
-
-\jlreq@addpapersize{a4var}{}[a4var]
-\jlreq@addpapersize{b5var}{}[b5var]
-
-\jlreq@addpapersize{letter}{letterpaper}[letter]
-\jlreq@addpapersize{legal}{legalpaper}[legal]
-\jlreq@addpapersize{executive}{executivepaper}[executive]
-\jlreq@addpapersize{hagaki}{}[hagaki]
-
-
-%.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a)
-\newcommand*{\jlreq@option@fontsize}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@fontsize}
-\DeclareOptionX{fontsize}{\renewcommand*{\jlreq@option@fontsize}{#1}}
-\jlreq@DeclareOption{10pt}{\renewcommand*{\jlreq@option@fontsize}{10pt}}
-\jlreq@DeclareOption{11pt}{\renewcommand*{\jlreq@option@fontsize}{11pt}}
-\jlreq@DeclareOption{12pt}{\renewcommand*{\jlreq@option@fontsize}{12pt}}
-\newcommand*{\jlreq@option@jafontsize}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@jafontsize}
-\DeclareOptionX{jafontsize}{\renewcommand*{\jlreq@option@jafontsize}{#1}}
-\newcommand*{\jlreq@option@jafontscale}{1}
-\DeclareOptionX{jafontscale}{\renewcommand*{\jlreq@option@jafontscale}{#1}}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@jafontscale}
-%.. 行の長さ
-\newcommand*{\jlreq@option@line@length}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@line@length}
-\DeclareOptionX{line_length}{\renewcommand*{\jlreq@option@line@length}{#1}}
-%.. 1ページあたりの行数
-\newcommand*{\jlreq@option@number@of@lines}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@number@of@lines}
-\DeclareOptionX{number_of_lines}{\renewcommand*{\jlreq@option@number@of@lines}{#1}}
-
-% 地の空き量,のどの空き量で配置位置を決める(2.4.1.b)省略されたら中央配置.
-%.. 天
-\newcommand*{\jlreq@option@head@space}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@head@space}
-\DeclareOptionX{head_space}{\renewcommand*{\jlreq@option@head@space}{#1}}
-
-%.. 地
-\newcommand*{\jlreq@option@foot@space}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@foot@space}
-\DeclareOptionX{foot_space}{\renewcommand*{\jlreq@option@foot@space}{#1}}
-%.. のど
-\newcommand*{\jlreq@option@gutter}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@gutter}
-\DeclareOptionX{gutter}{\renewcommand*{\jlreq@option@gutter}{#1}}
-%.. 小口
-\newcommand*{\jlreq@option@fore@edge}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@fore@edge}
-\DeclareOptionX{fore_edge}{\renewcommand*{\jlreq@option@fore@edge}{#1}}
-
-%.. 柱とノンブル
-\newcommand*{\jlreq@option@headfoot@verticalpos}{}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@headfoot@verticalpos}
-% 本文とヘッダ/フッタの間の空き
-\DeclareOptionX{headfoot_verticalposition}{\renewcommand*{\jlreq@option@headfoot@verticalpos}{#1}}
-\newcommand*{\jlreq@headfoot@sidemargin}{0pt}
-% 柱やノンブルの左右の空き
-\DeclareOptionX{headfoot_sidemargin}{\renewcommand*{\jlreq@headfoot@sidemargin}{#1}}
-
-%.. 段間
-\newcommand*{\jlreq@option@column@gap}{2zw}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@column@gap}
-\DeclareOptionX{column_gap}{\renewcommand*{\jlreq@option@column@gap}{#1}}
-
-%.. 行送り,指定無しの場合は文字サイズの1.7倍とする.(1.5から2倍が好ましい:2.4.2.d 注3)
-\newcommand*{\jlreq@option@baselineskip}{17zw/10}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@baselineskip}
-\DeclareOptionX{baselineskip}{\def\jlreq@option@baselineskip{#1}}
-\DeclareOptionX{linegap}{\def\jlreq@option@baselineskip{1zw + #1}}
-
-%.. 組み方系
-% 行頭に括弧が来たときの配置:3.1.5
-% 段落頭指定_折り返し行頭指定 で与える.
-\newcommand*{\jlreq@open@bracket@pos}{zenkaku_tentsuki}
-\define@choicekey{jlreq.cls}{open_bracket_pos}{zenkaku_tentsuki,zenkakunibu_nibu,nibu_tentsuki}{\renewcommand*{\jlreq@open@bracket@pos}{#1}}
-% ぶら下げ組みをするか:3.8.2 注1
-\newif\ifjlreq@burasage\jlreq@burasagefalse
-\jlreq@DeclareOption{hanging_punctuation}{\jlreq@burasagetrue}
-
-%.. 注
-% 傍注のタイプ
-\newcommand*{\jlreq@option@sidenote@length}{0pt}
-\jlreq@aftercls@addtodeletecs{\jlreq@option@sidenote@length}
-\DeclareOptionX{sidenote_length}{\renewcommand*{\jlreq@option@sidenote@length}{#1}}
-
-%.. もろもろ
-\newif\if@restonecol\@restonecolfalse
-\newif\if@titlepage\@titlepagefalse
-\newif\ifjlreq@option@titlepage \jlreq@option@titlepagefalse % titlepageかnotitlepageかが指定された
-\newif\if@landscape\@landscapefalse
-\newif\if@tate \@tatefalse
-\jlreq@DeclareOption{landscape}{\@landscapetrue}
-\jlreq@DeclareOption{tombo}{\ClassWarningNoLine{jlreq}{The option `tombo' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
-\jlreq@DeclareOption{tombow}{\ClassWarningNoLine{jlreq}{The option `tombow' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
-\jlreq@DeclareOption{mentuke}{\ClassWarningNoLine{jlreq}{The option `mentuke' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
-\jlreq@DeclareOption{tate}{\@tatetrue}
-
-\newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された
-\jlreq@aftercls@addtodeleteif{\ifjlreq@option@twoside}
-\jlreq@DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue}
-\jlreq@DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue}
-\jlreq@DeclareOption{onecolumn}{\@twocolumnfalse}
-\jlreq@DeclareOption{twocolumn}{\@twocolumntrue}
-\jlreq@DeclareOption{titlepage}{\jlreq@option@titlepagetrue\@titlepagetrue}
-\jlreq@DeclareOption{notitlepage}{\jlreq@option@titlepagetrue\@titlepagefalse}
-\jlreq@DeclareOption{draft}{\setlength\overfullrule{5pt}}
-\jlreq@DeclareOption{final}{\setlength\overfullrule{0pt}}
-\newif\if@openright
-\newif\ifjlreq@option@open \jlreq@option@openfalse % openrightかopenanyが指定された
-\jlreq@aftercls@addtodeleteif{\ifjlreq@option@open}
-\jlreq@DeclareOption{openright}{\@openrighttrue\jlreq@option@opentrue}
-\jlreq@DeclareOption{openany}{\@openrightfalse\jlreq@option@opentrue}
-\jlreq@DeclareOption{leqno}{\input{leqno.clo}}
-\jlreq@DeclareOption{fleqn}{\input{fleqn.clo}}
-
-\newcommand*{\jlreq@note}[1]{}
-\jlreq@DeclareOption{jlreq_notes}{\renewcommand*{\jlreq@note}[1]{\message{^^JJLReq note: ##1^^J}}}
-
-\ExecuteOptionsX{article_type=article,paper=a4,open_bracket_pos=zenkaku_tentsuki,onecolumn,final}
-% \@removeelementを一旦置き換えてから\ProcessOptionsXを実行する
-\let\jlreq@temporary@original@@removeelement=\@removeelement
-\let\@removeelement=\jlreq@helper@removeelement
-\ProcessOptionsX\relax
-\let\@removeelement=\jlreq@temporary@original@@removeelement
-\let\jlreq@temporary@original@@removeelement=\@undefined
-
-\ifjlreq@option@titlepage\else
- \ifthenelse{\equal{\jlreq@article@type}{article}}{\@titlepagefalse}{\@titlepagetrue}
-\fi
-\ifjlreq@option@open\else
- \ifthenelse{\equal{\jlreq@article@type}{book}}{\@openrighttrue}{\@openrightfalse}
-\fi
-% articleではopenrightは効かない.
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
- \if@openright
- \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article}
- \@openrightfalse
- \fi
-}{}
-\ifjlreq@option@twoside\else
- \ifthenelse{\equal{\jlreq@article@type}{book}}{\@twosidetrue}{\@twosidefalse}
-\fi
-
-\def\jlreq@jlreqsetup@keyvallist{}
-\def\jlreq@jlreqsetup@finally{}
-\newcommand{\jlreqsetup}[1]{%
- \begingroup
- \edef\jlreq@do{\unexpanded{\jlreq@parsekeyval[jlreqsetup]}{\expandonce{\jlreq@jlreqsetup@keyvallist}}}%
- \expandafter\endgroup
- \jlreq@do{#1}%
- \jlreq@jlreqsetup@finally
-}
-% \jlreqsetupの項目に加えるマクロ.\jlreq@jlreqsetup@add{key}{action}とするとkeyに対して定義できる.
-% action内ではvalが#1として取得できる.(従ってaction内でマクロを定義する際には##1を使う必要がある.)
-\newcommand{\jlreq@jlreqsetup@add}[1]{%
- \@ifnextchar[{\jlreq@jlreqsetup@add@{#1}}{\jlreq@jlreqsetup@add@@{#1}}%
-}
-\long\def\jlreq@jlreqsetup@add@#1[#2]#3{%
- \eappto\jlreq@jlreqsetup@keyvallist{\unexpanded{{#1}[#2]{#3}}}%
-}
-\long\def\jlreq@jlreqsetup@add@@#1#2{%
- \eappto\jlreq@jlreqsetup@keyvallist{\unexpanded{{#1}{#2}}}%
-}
-% \jlreqsetupの最後に必ず実行される処理を入れる.
-\newcommand\jlreq@jlreqsetup@addtofinally[1]{\eappto\jlreq@jlreqsetup@finally{\unexpanded{#1}}}
-\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add}
-\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add@}
-\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add@@}
-\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@addtofinally}
-\@onlypreamble\jlreqsetup
-
-% エンジンの設定
-\ifx\jlreq@engine\@undefined
- \jlreq@helper@guessengine
- \let\jlreq@engine=\jlreq@result
-\fi
-
-
-% 必要パッケージのロード
-\ifx l\jlreq@engine
- \RequirePackage{luatexja}
- \directlua{jlreq = {}}
-\fi
-
-% (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので,
-% これ以前には和文は使えない.
-\ifx l\jlreq@engine\else
- \epTeXinputencoding utf8
- \def\zw{zw}\def\zh{zh}
- % http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1508&parent=8435
- \if@tate\AtEndPreamble{\par}\fi
-\fi
-\if@tate
- \AtBeginDocument{\tate\message{《縦組モード》}\adjustbaseline}
-\fi
-
-% \jlreq@gol(Gyo Okuri Length), \jlreq@mol (Moji Okuri Length)を定義
-\let\jlreq@gol=\zh
-\let\jlreq@mol=\zw
-
-%. helper2(エンジン依存系:和文文字を含むものもこれ以降)
-% #1のboxを今の真ん中に配置する.
-\def\jlreq@box@putcenter#1{%
- \begingroup
- \jlreq@tempdima=\dimexpr(\ht#1 - \dp#1)/2\relax
- \setbox\jlreq@tempboxa=\hbox{阿}%
- \edef\jlreq@do{%
- \noexpand\lower\the\dimexpr(\jlreq@tempdima - (\ht\jlreq@tempboxa - \dp\jlreq@tempboxa)/2)\relax\unexpanded{\box#1}%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-
-% #1の先頭が文字か
-\long\def\jlreq@ifletter#1{%
- \jlreq@iffirsttoken{#1}{ }{\@secondoftwo}{%
- \expandafter\expandafter\expandafter\jlreq@helper@ifletter\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@
- }%
-}
-
-\long\def\jlreq@helper@ifletter#1{%
- \ifnum
- 0%
- \ifcat 阿\noexpand #11\fi
- \ifcat あ\noexpand #11\fi
- \ifcat (\noexpand #11\fi
- \ifcat A\noexpand #11\fi
- \ifcat 1\noexpand #11\fi
- >0
- \expandafter\@firstoftwo\else\expandafter\@secondoftwo
- \fi
-}
-
-
-% 組方向を判定
-% \jlreq@if(y|t)(dir|box)を定義する.
-\ifx l\jlreq@engine\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{
- \def\jlreq@ifydir{\ifnum\ltjgetparameter{direction}=4 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
- \def\jlreq@iftdir{\ifnum\numexpr\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8\relax=3 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
- \def\jlreq@ifybox#1{\ifnum\ltjgetparameter{boxdir}{#1}=4 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
- \def\jlreq@iftbox#1{\ifnum\numexpr\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8\relax=3 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-}{
- \def\jlreq@ifydir{\ifydir\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
- \def\jlreq@iftdir{\iftdir\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
- \def\jlreq@ifybox#1{\ifybox#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
- \def\jlreq@iftbox#1{\iftbox#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
-}
-
-\ifx l\jlreq@engine
- \newcommand*{\jlreq@getpostbreakpenalty}[1]{\ltjgetparameter{postbreakpenalty}{#1}}
-\else
- \newcommand*{\jlreq@getpostbreakpenalty}[1]{\postbreakpenalty#1}
-\fi
-
-% 現在行の残りを得る.
-\ifx l\jlreq@engine
- % 以下のコードはおかしい.
- \newcommand*{\jlreq@calc@current@linewidth@onecolumn}{%
- \dimexpr\zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \@totalleftmargin -
- \ifodd\jlreq@currentpage
- \oddsidemargin
- \else
- \evensidemargin
- \fi
- \iftombow - 1in\fi
- - 1in - \hoffset\relax
- }
-\else
- \newcommand*{\jlreq@calc@current@linewidth@onecolumn}{%
- \dimexpr
- \jlreq@ifydir{%
- \zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \hoffset
- \ifodd\jlreq@currentpage
- - \oddsidemargin
- \else
- - \evensidemargin
- \fi
- }{%
- \ifdim\pdfpagewidth=0pt
- \paperheight
- \else
- \pdfpageheight
- \fi
- - \topmargin - \headheight - \headsep - \voffset
- - \zposy{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp
- }%
- \iftombow - 1in\fi
- - \@totalleftmargin - 1in
- \relax
- }
-\fi
-\newcommand*{\jlreq@calc@current@linewidth}{%
- \dimexpr\jlreq@calc@current@linewidth@onecolumn
- \if@twocolumn
- \ifdim\jlreq@calc@current@linewidth@onecolumn<\dimexpr\linewidth+\columnsep\relax\else
- - \linewidth - \columnsep
- \fi
- \fi
- \relax
-}
-
-\newdimen\jlreq@current@linewidth
-\newdimen\jlreq@rest@linewidth
-% この命令以降,次にこの命令を実行する前まで\jlreq@current@linewidth/\jlreq@rest@linewidthで
-% この行の行頭からの長さ/残りの長さが取得できる
-\newcommand*{\jlreq@savepos@for@rest@linewidth}{%
- \jlreq@setcurrentpage
- \global\advance\jlreq@zref@reference@count by 1\relax
- \zsavepos{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}%
- \global\jlreq@current@linewidth=\jlreq@calc@current@linewidth
- \global\jlreq@rest@linewidth=\dimexpr\linewidth - \jlreq@current@linewidth\relax
- \edef\jlreq@savepos@iflabelundefined{\noexpand\zref@ifrefundefined{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}}%
-}
-
-\ifx l\jlreq@engine
- \newcommand*{\lastnodechar}{\directlua{luatexja.pltx_composite_last_node_char()}}% undocumentedな機能を使っている
-\fi
-
-% #1と#2の間に入るjmglue((x)kanjiskipも)を\jlreq@resultskipに入れる
-\ifx l\jlreq@engine
- \newcommand*{\jlreq@calc@jfmglue}[2]{%
- \begingroup
- \setbox\jlreq@tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
- \setbox\jlreq@tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
- \edef\jlreq@do{\noexpand\jlreq@resultskip=\the\dimexpr\wd\jlreq@tempboxb - \wd\jlreq@tempboxa\relax\noexpand\relax}%
- \jlreq@do
- \directlua{
- local width = 0
- local stretch = 0
- local shrink = 0
- local n = tex.box["jlreq@tempboxb"].head
- while n do
- % すべてのglueの和を計算する.
- if n.id == node.id("glue") then
- width = width + n.width
- stretch = stretch + n.stretch
- shrink = shrink + n.shrink
- end
- n = n.next
- end
- tex.setglue("jlreq@tempskipa",width,stretch,shrink)
- }%
- % TeXで計測した物と一致していなければTeXでの方を信じる
- \ifdim\jlreq@resultskip=\jlreq@tempskipa
- \edef\jlreq@do{\noexpand\jlreq@resultskip=\the\jlreq@tempskipa\relax}%
- \fi
- \expandafter\endgroup
- \jlreq@do
- }
-\else
- \newcommand*{\jlreq@calc@jfmglue}[2]{%
- \begingroup
- \setbox\jlreq@tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
- \setbox\jlreq@tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
- \edef\jlreq@do{\noexpand\jlreq@resultskip=\the\dimexpr\wd\jlreq@tempboxb - \wd\jlreq@tempboxa\relax\noexpand\relax}%
- \expandafter\endgroup
- \jlreq@do
- }
-\fi
-
-\newcount\jlreq@lastnodechar
-% \jlreq@fixjfm<次の文字>の形で使う.
-% jlreq@lastnodecharに入っている値と次のトークン(\futureletで得る)の間に入るJFMグルー等を挿入する
-\newcommand*{\jlreq@fixjfm}{%
- \begingroup
- \ifnum\jlreq@lastnodechar>-1
- \def\jlreq@do{\futurelet\jlreq@nextchar\jlreq@insertjfm}%
- \else\def\jlreq@do{}\fi
- \expandafter\endgroup
- \jlreq@do
-}
-% \jlreq@nextcharと\jlreq@lastnodecharの間のJFMグルーを挿入
-\def\jlreq@insertjfm{%
- \ifnum\jlreq@getpostbreakpenalty{\jlreq@lastnodechar}=0\else\penalty\jlreq@getpostbreakpenalty{\jlreq@lastnodechar}\fi
- \begingroup
- \def\jlreq@do{}%
- \jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
- \expandafter\jlreq@ifletter\expandafter{\jlreq@tempa}{%
- \jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{\jlreq@tempa}%
-% \message{fixjfm Insert: \the\jlreq@resultskip}%
- \edef\jlreq@do{%
- \noexpand\hskip\the\jlreq@resultskip\space
- \noexpand\inhibitglue
- }%
- }{}%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\ifx l\jlreq@engine
- \newcommand*{\jlreq@divide}[2]{%
- \jlreq@resultdimen=\directlua{tex.print(tostring(\strip@pt\dimexpr #1\relax/\strip@pt\dimexpr #2\relax) .. "pt ")}%
- }
-\else
- \let\jlreq@divide=\jlreq@helper@divide
-\fi
-
-%. 基本設定
-\providecommand*{\jlreq@kanjiskip}{0pt plus 0.25\zw minus 0pt}
-\providecommand*{\jlreq@xkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
-\ifx l\jlreq@engine
- \ltjsetparameter{kanjiskip=\jlreq@kanjiskip}
- \ltjsetparameter{xkanjiskip=\jlreq@xkanjiskip}
-\else
- \kanjiskip=\jlreq@kanjiskip
- \xkanjiskip=\jlreq@xkanjiskip
-\fi
-
-% 文字クラスのリスト(必要なものだけ)
-% 開き括弧(文字クラス1)
-\edef\jlreq@charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq@engine\else ⦅〘〖«〝\fi}
-% 閉じ括弧(文字クラス2)
-\edef\jlreq@charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq@engine\else⦆〙〗»〟\fi}
-% ハイフン(文字クラス3)
-\edef\jlreq@charlist@hyphens{‐〜\ifx p\jlreq@engine\else ゠–\fi}
-% 区切り約物(文字クラス4)
-\edef\jlreq@charlist@dividingpunctuationmarks{!?\ifx p\jlreq@engine\else ‼⁇⁈⁉\fi}
-% 中点類(文字クラス5)
-\edef\jlreq@charlist@middlenodes{・:;}
-% 句点類(文字クラス6)
-\edef\jlreq@charlist@fullstops{。.}
-% 読点類(文字クラス7)
-\edef\jlreq@charlist@commas{、,}
-% 分離禁止文字(文字クラス8)
-\edef\jlreq@charlist@inseparablecharacters{—…‥\ifx p\jlreq@engine\else 〳〴〵\fi}
-% 繰返し記号(文字クラス9)
-\edef\jlreq@charlist@iterationmarks{ヽヾゝゞ々\ifx p\jlreq@engine\else 〻\fi}
-% 長音記号(文字クラス10)
-\edef\jlreq@charlist@prolongedsoundmark{ー}
-% 小書きの仮名(文字クラス11)
-\edef\jlreq@charlist@smallkana{ぁぃぅぇぉァィゥェォっゃゅょゎッャュョヮヵヶ\ifx p\jlreq@engine\else ゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ\fi}%ㇷ゚
-% 前置省略記号(文字クラス12)
-\edef\jlreq@charlist@prefixedabbreviations{¥$£#\ifx p\jlreq@engine\else €№\fi}
-% 平仮名(文字クラス15)
-\edef\jlreq@charlist@hiragana{あいうえおかがきぎくぐけげこごさざしじすずせぜそぞただちぢつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもやゆよらりるれろわゐゑをん\ifx p\jlreq@engine\else ゔ\fi}% か゚き゚く゚け゚こ゚
-% 片仮名(文字クラス16)
-\edef\jlreq@charlist@katakana{アイウエオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモヤユヨラリルレロワヰヱヲンヴ\ifx p\jlreq@engine\else ヷヸヹヺ\fi}% カ゚キ゚ク゚ケ゚コ゚セ゚ツ゚ト゚
-
-\ifx l\jlreq@engine
- \newcommand*{\jlreq@setpostbreakpenalty@}[2]{\ltjsetparameter{postbreakpenalty={`#1,#2}}}
- \newcommand*{\jlreq@setprebreakpenalty@}[2]{\ltjsetparameter{prebreakpenalty={`#1,#2}}}
- \newcommand*{\jlreq@addjaxspmode@}[2]{%
- \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
- \jlreq@switch{#2}{
- {pre}{%
- \ifnum\jlreq@tempcnta=2
- \ltjsetparameter{jaxspmode={`#1,allow}}%
- \else\ifnum\jlreq@tempcnta=0
- \ltjsetparameter{jaxspmode={`#1,preonly}}%
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq@tempcnta=1
- \ltjsetparameter{jaxspmode={`#1,allow}}%
- \else\ifnum\jlreq@tempcnta=0
- \ltjsetparameter{jaxspmode={`#1,postonly}}%
- \fi\fi
- }
- }%
- }
- \newcommand*{\jlreq@deljaxspmode@}[2]{%
- \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
- \jlreq@switch{#2}{
- {pre}{%
- \ifnum\jlreq@tempcnta=2
- \ltjsetparameter{jaxspmode={`#1,postonly}}%
- \else\ifnum\jlreq@tempcnta=1
- \ltjsetparameter{jaxspmode={`#1,inhibit}}%
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq@tempcnta=3
- \ltjsetparameter{jaxspmode={`#1,preonly}}%
- \else\ifnum\jlreq@tempcnta=2
- \ltjsetparameter{jaxspmode={`#1,inhibit}}%
- \fi\fi
- }
- }%
- }
-\else
- \newcommand*{\jlreq@setpostbreakpenalty@}[2]{\postbreakpenalty`#1=#2}
- \newcommand*{\jlreq@setprebreakpenalty@}[2]{\prebreakpenalty`#1=#2}
- \newcommand*{\jlreq@addjaxspmode@}[2]{%
- \jlreq@tempcnta=\inhibitxspcode`#1
- \jlreq@switch{#2}{
- {pre}{%
- \ifnum\jlreq@tempcnta=1
- \inhibitxspcode`#1=3
- \else\ifnum\jlreq@tempcnta=0
- \inhibitxspcode`#1=2
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq@tempcnta=2
- \inhibitxspcode`#1=3
- \else\ifnum\jlreq@tempcnta=0
- \inhibitxspcode`#1=1
- \fi\fi
- }
- }%
- }
- \newcommand*{\jlreq@deljaxspmode@}[2]{%
- \jlreq@tempcnta=\inhibitxspcode`#1
- \jlreq@switch{#2}{
- {pre}{%
- \ifnum\jlreq@tempcnta=3
- \inhibitxspcode`#1=1
- \else\ifnum\jlreq@tempcnta=2
- \inhibitxspcode`#1=0
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq@tempcnta=3
- \inhibitxspcode`#1=2
- \else\ifnum\jlreq@tempcnta=1
- \inhibitxspcode`#1=0
- \fi\fi
- }
- }%
- }
-\fi
-% #1{...}{#3}を...が#2のリストに対して適用.
-\newcommand*\jlreq@iterateapply[3]{%
- \edef\jlreq@tempa{#2}%
- \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@tempa\do{%
- \expandafter#1\expandafter{\@tempa}{#3}%
- }%
-}
-\def\jlreq@setpostbreakpenalty{\jlreq@iterateapply{\jlreq@setpostbreakpenalty@}}
-\def\jlreq@setprebreakpenalty{\jlreq@iterateapply{\jlreq@setprebreakpenalty@}}
-\def\jlreq@addjaxspmode{\jlreq@iterateapply{\jlreq@addjaxspmode@}}
-\def\jlreq@deljaxspmode{\jlreq@iterateapply{\jlreq@deljaxspmode@}}
-
-\jlreq@aftercls@addtodeletecs{\jlreq@iterateapply}
-\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty}
-\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty@}
-\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty}
-\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty@}
-\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode}
-\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode@}
-\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode}
-\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode@}
-
-% 行末禁則
-\jlreq@setpostbreakpenalty{\jlreq@charlist@openingbrackets}{10000}
-\jlreq@setpostbreakpenalty{\jlreq@charlist@prefixedabbreviations}{10000}
-
-% 行頭禁則
-\jlreq@setprebreakpenalty{\jlreq@charlist@closingbrackets}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@hyphens}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@dividingpunctuationmarks}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@middlenodes}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@fullstops}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@commas}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@iterationmarks}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@prolongedsoundmark}{10000}
-\jlreq@setprebreakpenalty{\jlreq@charlist@smallkana}{10000}
-
-% xkanjiskip
-\jlreq@addjaxspmode{\jlreq@charlist@iterationmarks}{pre}
-\jlreq@addjaxspmode{\jlreq@charlist@iterationmarks}{post}
-\jlreq@addjaxspmode{\jlreq@charlist@prolongedsoundmark}{pre}
-\jlreq@addjaxspmode{\jlreq@charlist@prolongedsoundmark}{post}
-\jlreq@addjaxspmode{\jlreq@charlist@smallkana}{pre}
-\jlreq@addjaxspmode{\jlreq@charlist@smallkana}{post}
-\jlreq@addjaxspmode{\jlreq@charlist@hiragana}{pre}
-\jlreq@addjaxspmode{\jlreq@charlist@hiragana}{post}
-\jlreq@addjaxspmode{\jlreq@charlist@katakana}{pre}
-\jlreq@addjaxspmode{\jlreq@charlist@katakana}{post}
-\jlreq@addjaxspmode{\jlreq@charlist@dividingpunctuationmarks}{post}
-
-% 分割禁止(分離禁止文字は特定の並びで分割禁止だが,とりあえず一括で禁止しておく.)
-\jlreq@setprebreakpenalty{\jlreq@charlist@inseparablecharacters}{10000}
-% ¥100とか70%とか……
-
-%.. 文字範囲
-\ifx u\jlreq@engine
- % \kcatcodeの設定
- \def\jlreq@setkcatcode#1#2{\@for\@tempa:=#1\do{\kcatcode"\@tempa=#2\relax}}
- \jlreq@aftercls@addtodeletecs{\jlreq@setkcatcode}
- % LuaTeX-jaのデフォルトのままに近い設定をする
- % 範囲1&8
- \jlreq@setkcatcode{80}{15} % Latin-1 Supplement,どうしよう……
- \jlreq@setkcatcode{100,180,250,2B0,300,1E00}{15}
- % 範囲2
- \jlreq@setkcatcode{370,400,1F00}{18}
- % 範囲3
- \jlreq@setkcatcode{2000,2070,20A0,20D0,2100,2150,2190,2200,2300,2400,2500,2580,25A0,2600,2700,2900,2980,2B00}{18}
- % 範囲4
- \jlreq@setkcatcode{500,530,590,600,700,750,780,7C0,800,840,8A0,900,980,A00,A80,B00,B80,C00,C80,D00,D80,E00,E80,F00,1000,10A0,1200,1380,13A0,1400,1680,16A0,1700,1720,1740,1760,1780,1800,18B0,1900,1950,1980,19E0,1A00,1A20,1AB0,1B00,1B80,1BC0,1C00,1C50,1C80,1CC0,1CD0,1D00,1D80,1DC0,2400,2440,27C0,27F0,2800,2A00,2C00,4DC0,A4D0,A500,A640,A6A0,A700,A720,A800,A840,A880,A8E0,A900,A930,A960,A980,A9E0,AA00,AA60,AA80,AAE0,AB00,AB30,AB70,ABC0,FB00,FB50,FE00,FE20,FE70,10000,10080,10100,10140,10190,101D0,10280,102A0,102E0,10300,10330,10350,10380,103A0,10400,10450,10480,104B0,10500,10530,10600,10800,10840,10860,10880,108E0,10900,10920,10980,109A0,10A00,10A60,10A80,10AC0,10B00,10B40,10B60,10B80,10C00,10C80,10E60,11000,11080,110D0,11100,11150,11180,111E0,11200,11280,112B0,11300,11400,11480,11580,11600,11660,11680,11700,118A0,11AC0,11C00,11C70,12000,12400,12480,13000,14400,16800,16A40,16AD0,16B00,16F00,16FE0,17000,18800,1B000,1BC00,1BCA0,1D000,1D100,1D200,1D300,1D360,1D400,1D800,1E000,1E800,1E900,1EE00,1F000,1F030,1F0A0,1F100,1F200,1F300,1F600,1F650,1F680,1F700,1F780,1F800,1F900,E000}{15}
- % 範囲5(Variation Selectors SupplementはLuaTeX-jaではE01F0--E01EFまで範囲5,他は範囲6)
- \jlreq@setkcatcode{D800,DB80,DC00,E0000,F0000,100000}{15}
- % 範囲6
- \jlreq@setkcatcode{3040,30A0,31F0}{17} % Hiragana,Katakana,Katakana Phonetic Extensions
- \jlreq@setkcatcode{2460,3000,3200,3300,FE10,FE30,FE50,E0100}{18} % Enclosed Alphanumerics,CJK Symbols and Punctuation,Enclosed CJK Letters and Months,CJK Compatibility,Vertical Forms,CJK Compatibility Forms,Small Form Variants,Variation Selectors Supplement
- \jlreq@setkcatcode{2E80,3190,3400,4E00,F900,20000}{16}
- % 範囲7
- \jlreq@setkcatcode{A000,A490}{18} % Yi Syllables,Yi Radicals
- \jlreq@setkcatcode{1100,3130,AC00,D7B0}{19} % Hangul Jamo,Hangul Compatibility Jamo,Hangul Syllables,Hangul Jamo Extended-B
- \jlreq@setkcatcode{2F00,2FF0,3100,31A0,31C0,A830}{16}
-\fi
-
-% フォントサイズを設定
-\newdimen\jlreq@fontsize
-\newdimen\jlreq@jafontsize
-\ifx l\jlreq@engine
- % Q,zw,zhが正しく扱われるようになる.\dimexprつきに展開される.
- \def\jlreq@expand@optionfontsize#1{%
- \dimexpr\directlua{
- local act = string.char(92)
- local s = [[#1]]
- s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax")
- tex.print(s)
- }\relax
- }%
-\else
- \def\jlreq@expand@optionfontsize#1{\dimexpr#1\relax}
-\fi
-\jlreq@aftercls@addtodeletecs{\jlreq@expand@optionfontsize}
-\ifx\jlreq@option@fontsize\@empty
- \ifx\jlreq@option@jafontsize\@empty
- \jlreq@fontsize=10pt
- \jlreq@jafontsize=\jlreq@option@jafontscale\jlreq@fontsize
- \else
- \setlength{\jlreq@jafontsize}{\jlreq@expand@optionfontsize{\jlreq@option@jafontsize}}
- \jlreq@divide{\jlreq@jafontsize}{\jlreq@option@jafontscale pt}
- \jlreq@fontsize=\jlreq@resultdimen
- \fi
-\else
- \setlength{\jlreq@fontsize}{\jlreq@expand@optionfontsize{\jlreq@option@fontsize}}
- \ifx\jlreq@option@jafontsize\@empty
- \jlreq@jafontsize=\jlreq@option@jafontscale\jlreq@fontsize
- \else
- \setlength{\jlreq@jafontsize}{\jlreq@expand@optionfontsize{\jlreq@option@jafontsize}}
- \fi
-\fi
-%. フォント
-\RequirePackage{lmodern}
-
-%.. 古いフォントコマンド
-\DeclareOldFontCommand{\jlreq@oldfontcommand@mc}{\normalfont\mcfamily}{\mathmc}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@gt}{\normalfont\gtfamily}{\mathgt}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@rm}{\normalfont\rmfamily}{\mathrm}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@sf}{\normalfont\sffamily}{\mathsf}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@tt}{\normalfont\ttfamily}{\mathtt}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@bf}{\normalfont\bfseries}{\mathbf}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@it}{\normalfont\itshape}{\mathit}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@sl}{\normalfont\slshape}{\@nomath\sl}
-\DeclareOldFontCommand{\jlreq@oldfontcommand@sc}{\normalfont\scshape}{\@nomath\sc}
-\newcommand*{\jlreq@oldfontcommand@enable}{%
- \let\mc=\jlreq@oldfontcommand@mc
- \let\gt=\jlreq@oldfontcommand@gt
- \let\rm=\jlreq@oldfontcommand@rm
- \let\sf=\jlreq@oldfontcommand@sf
- \let\tt=\jlreq@oldfontcommand@tt
- \let\bf=\jlreq@oldfontcommand@bf
- \let\it=\jlreq@oldfontcommand@it
- \let\sl=\jlreq@oldfontcommand@sl
- \let\sc=\jlreq@oldfontcommand@sc
-}
-\newcommand*{\jlreq@oldfontcommand@disable}{%
- \let\mc=\@undefined
- \let\gt=\@undefined
- \let\rm=\@undefined
- \let\sf=\@undefined
- \let\tt=\@undefined
- \let\bf=\@undefined
- \let\it=\@undefined
- \let\sl=\@undefined
- \let\sc=\@undefined
-}
-
-\DeclareRobustCommand*{\cal}{\@fontswitch\relax\mathcal}
-\DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal}
-
-%.. 和文
-% ダミー
-\def\@ptsize{0}
-% JFMに関連する設定
-\ifx l\jlreq@engine
- % この値は後でjfm-jlreq内で読む
- \directlua{jlreq.open_bracket_pos = [[\jlreq@open@bracket@pos]]}
- \ifjlreq@burasage\directlua{jlreq.burasage = true}\else\directlua{jlreq.burasage = false}\fi
- % \item後の行頭括弧のために仕込み.
- \jlreq@saveoriginalcs{\list}
- \jlreq@saveoriginalcs{\endlist}
- \PushPostHook{par}{\jlreq@parhook@atbeginlist}
- \pretocmd{\list}{\def\jlreq@parhook@atbeginlist{\ltjfakeparbegin}}{}{}
- \apptocmd{\endlist}{\def\jlreq@parhook@atbeginlist{}}{}{}
- \def\jlreq@parhook@atbeginlist{}
-\else
- % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処.
- % 行頭括弧に対して\inhibitglueを入れたりする命令を作る
- % \jlreq@charlist@openingbracketsの各括弧に対して,\ifx\jlreq@nextchar 「1\fiみたいなのが並んだのを作る
- \def\jlreq@tempa{}
- \def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar#11\fi}\jlreq@do}}
- \expandafter\jlreq@do\jlreq@charlist@openingbrackets\jlreq@endmark
- % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる.
- \ifthenelse{\equal{\jlreq@open@bracket@pos}{nibu_tentsuki}}{
- \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\hskip -.5\zw\inhibitglue}\noexpand\fi}
- }{% zenkakunibu_nibu,zenkaku_tentsuki
- \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
- }
- % source special対策
- \def\jlreq@openbracket@hook{\ifx\jlreq@nextchar\special\expandafter\jlreq@openbracket@hook@@\else\expandafter\jlreq@openbracket@hook@\fi}
- \def\jlreq@openbracket@hook@@#1#2{#1{#2}\futurelet\jlreq@nextchar\jlreq@openbracket@hook}
- \def\jlreq@jfmname@prefix{}
- \jlreq@aftercls@addtodeletecs{\jlreq@jfmname@prefix}
- \ifjlreq@burasage\edef\jlreq@jfmname@prefix{b\jlreq@jfmname@prefix}\fi
- \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{\edef\jlreq@jfmname@prefix{\jlreq@jfmname@prefix z}}{}
- \ifx u\jlreq@engine\edef\jlreq@jfmname@prefix{u\jlreq@jfmname@prefix}\fi
- \edef\jlreq@jfmname{\jlreq@jfmname@prefix jlreq} % JFMの名前
- \edef\jlreq@jfmnameg{\jlreq@jfmname@prefix jlreqg} % ゴシックなJFMの名前
- \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}}
-\fi
-
-% 行頭の括弧は \jlreq@open@bracket@before@space \inhibitglue 「みたいにする.
-\ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{
- \def\jlreq@open@bracket@before@space{\hskip\glueexpr-.5\zw\relax}
-}{
- \def\jlreq@open@bracket@before@space{}
-}
-
-\ifx l\jlreq@engine
- \RequirePackage{luatexja-adjust}
- \ltjenableadjust[lineend=extended,priority=true]
- \ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=10}}
- \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=-30}}
-\fi
-
-\ifx p\jlreq@engine
- \def\jlreq@yokokanjiencoding{JY1}
- \def\jlreq@tatekanjiencoding{JT1}
-\fi
-\ifx u\jlreq@engine
- \def\jlreq@yokokanjiencoding{JY2}
- \def\jlreq@tatekanjiencoding{JT2}
-\fi
-\ifx l\jlreq@engine
- \def\jlreq@yokokanjiencoding{JY3}
- \def\jlreq@tatekanjiencoding{JT3}
-\fi
-\expandafter\let\csname \jlreq@yokokanjiencoding/mc/m/n/10\endcsname\relax
-\expandafter\let\csname \jlreq@tatekanjiencoding/mc/m/n/10\endcsname\relax
-\jlreq@divide{\jlreq@jafontsize}{\jlreq@fontsize}
-\edef\jlreq@jafontscale{\strip@pt\jlreq@resultdimen}
-\jlreq@aftercls@addtodeletecs{\jlreq@jafontscale}
-\ifx l\jlreq@engine
- \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreq;script=latn;-kern}{}
- \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont:jfm=jlreq;script=latn;-kern}{}
- \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreqv;script=latn;-kern}{}
- \DeclareFontShape{JT3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont:jfm=jlreqv;script=latn;-kern}{}
-\else
- \DeclareFontShape{\jlreq@yokokanjiencoding}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmname}{}
- \DeclareFontShape{\jlreq@yokokanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg}{}
- \DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmname-v}{}
- \DeclareFontShape{\jlreq@tatekanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg-v}{}
-\fi
-\@for\jlreq@encoding:=\jlreq@yokokanjiencoding,\jlreq@tatekanjiencoding\do{
- \@for\jlreq@shape:=n,it,sl,sc\do{
- \@for\jlreq@series:=m,b,bx,sb,c\do{
- \ifthenelse{\equal{\jlreq@shape}{n} \AND \equal{\jlreq@series}{m}}{}{
- \DeclareFontShape{\jlreq@encoding}{gt}{\jlreq@series}{\jlreq@shape}{<->ssub*gt/m/n}{}
- }
- }
- \@for\jlreq@series:=bx,b,sb\do{
- \DeclareFontShape{\jlreq@encoding}{mc}{\jlreq@series}{\jlreq@shape}{<->ssub*gt/m/n}{}
- }
- \@for\jlreq@series:=m,c\do{
- \ifthenelse{\equal{\jlreq@shape}{n} \AND \equal{\jlreq@series}{m}}{}{
- \DeclareFontShape{\jlreq@encoding}{mc}{\jlreq@series}{\jlreq@shape}{<->ssub*mc/m/n}{}
- }
- }
- }
-}
-
-% 和文ファミリと欧文ファミリの連動
-\DeclareRobustCommand\rmfamily{%
- \not@math@alphabet\rmfamily\mathrm
- \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
-\DeclareRobustCommand\sffamily{%
- \not@math@alphabet\sffamily\mathsf
- \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
-\DeclareRobustCommand\ttfamily{%
- \not@math@alphabet\ttfamily\mathtt
- \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
-
-% 数式フォント設定
-\ifx l\jlreq@engine\else
- \DeclareSymbolFont{mincho}{\jlreq@yokokanjiencoding}{mc}{m}{n}
- \DeclareSymbolFontAlphabet{\mathmc}{mincho}
- \SetSymbolFont{mincho}{bold}{\jlreq@yokokanjiencoding}{gt}{m}{n}
- \jfam\symmincho
- \DeclareMathAlphabet{\mathgt}{\jlreq@yokokanjiencoding}{gt}{m}{n}
-\fi
-\AtBeginDocument{%
- \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
- \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
-}
-
-% 和文間隔
-\DeclareRobustCommand*\ {\futurelet\jlreq@nextchar\jlreq@zenkakuspace@ignorespaces}
-% 後続の空白を無視する処理
-\edef\jlreq@zenkakuspace@ignorespaces{%
- \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@zenkakuspace@ignorespaces@\else\expandafter\jlreq@zenkakuspace@main\fi}%
-}
-\expandafter\def\expandafter\jlreq@zenkakuspace@ignorespaces@\space{\ }
-\def\jlreq@tempa{}
-\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifnum\lastnodechar=`#1 1\fi}\jlreq@do}}
-\expandafter\jlreq@do\jlreq@charlist@dividingpunctuationmarks\jlreq@endmark
-\edef\@tempa{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 }
-\expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq@zenkakuspace@main\expandafter{\@tempa
- \hskip 1\zw\hbox{}%
- \jlreq@lastnodechar=` 
- \expandafter\jlreq@fixjfm
- \else\expandafter \fi
-}
-\ifx l\jlreq@engine
- {
- \catcode` =\active
- \global\let =\jlreq@zenkakuspace@main
- }
- \AtBeginDocument{\catcode` =\active}
-\fi
-
-% \jaspace
-\DeclareRobustCommand*{\jaspace}[1]{%
- \ifcsname jlreq@jaspace@#1\endcsname\csname jlreq@jaspace@#1\endcsname
- \else\ClassError{jlreq}{unknown jaspace: #1}{\@ehc}\fi
-}
-\def\jlreq@jaspace@zenkaku{\hskip\glueexpr 1\zw\relax}
-\def\jlreq@jaspace@nibu{\hskip\glueexpr .5\zw\relax}
-\def\jlreq@jaspace@shibu{\hskip\glueexpr .25\zw\relax}
-
-% 区切り約物.\? みたいな命令を作る.直後の空きが自動で入る.
-% \?*とすると文中の?として扱われる.
-\def\jlreq@tempa{}
-\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar #11\fi}\jlreq@do}}
-\expandafter\jlreq@do\jlreq@charlist@closingbrackets\jlreq@endmark
-\edef\jlreq@dividingpunctuationmarkscommand{%
- \noexpand\ifnum 0\expandonce{\jlreq@tempa}>0 \unexpanded{\expandafter\ignorespaces\else\expandafter\ \fi}%
-}
-\def\jlreq@do#1{%
- \jlreq@ifendmark{#1}{}{
- \expandafter\DeclareRobustCommand\expandafter*\csname #1\endcsname{%
- \jlreq@ifstar
- {\hskip .25\zw #1\hskip .25\zw\ignorespaces}%
- {#1\futurelet\jlreq@nextchar\jlreq@dividingpunctuationmarkscommand}%
- }
- \jlreq@do
- }
-}
-\expandafter\jlreq@do\jlreq@charlist@dividingpunctuationmarks\jlreq@endmark
-
-% \baselineskipの計算
-% いったん文字サイズを変更((u)platexの際にzh/zwをきちんとするため)
-\@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@fontsize}%
-\newdimen\jlreq@baselineskip
-\ifx l\jlreq@engine
- \setlength{\jlreq@baselineskip}{%
- \dimexpr\directlua{
- local act = string.char(92)
- local s = [[\jlreq@option@baselineskip]]
- s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw")
- tex.print(s)
- }\relax
- }%
-\else
- \setlength{\jlreq@baselineskip}{\dimexpr\jlreq@option@baselineskip\relax}
-\fi
-\ifdim\jlreq@fontsize>\jlreq@baselineskip
- \ClassError{jlreq}{The baselineskip is less than fontsize}{\@ehc}%
-\fi
-\ifthenelse{\lengthtest{\jlreq@baselineskip<1.5\zw} \OR \lengthtest{\jlreq@baselineskip>2\zw}}{
- \jlreq@note{行間は二分以上全角以下が望ましい (2.4.2.d 注3).}
-}{}
-
-\emergencystretch 3\jlreq@gol
-
-%.. 文字サイズ変更
-\def\jlreq@setfontsizehook{}
-\jlreq@saveoriginalcs{\set@fontsize}
-\apptocmd{\set@fontsize}{\expandafter\def\expandafter\size@update\expandafter{\size@update\jlreq@setfontsizehook}}{}{}
-\appto\jlreq@setfontsizehook{\ifdim\parindent>0pt \setlength{\parindent}{1\zw}\fi}
-\ifx l\jlreq@engine
- \@tempskipa=\ltjgetparameter{kanjiskip}
- \ifdim\@tempskipa=\maxdimen\else
- \appto\jlreq@setfontsizehook{%
- \ltj@setpar@global
- \ltjsetkanjiskip\jlreq@kanjiskip
- \@tempskipa=\ltjgetparameter{xkanjiskip}%
- \ifdim\@tempskipa>0pt
- \ltjsetxkanjiskip\jlreq@xkanjiskip
- \fi
- }
- \fi
-\else
- \appto\jlreq@setfontsizehook{%
- \kanjiskip=\jlreq@kanjiskip
- \ifdim\xkanjiskip>0pt
- \xkanjiskip=\jlreq@xkanjiskip
- \fi
- }
-\fi
-
-% \jafontsize
-\ifdim\jlreq@fontsize=\jlreq@jafontsize
- \let\jafontsize=\fontsize
-\else
- \def\@tempa#1{
- \DeclareRobustCommand*{\jafontsize}[2]{%
- \begingroup
- \jlreq@iffloat{##1}{%
- \edef\jlreq@do{\noexpand\fontsize{\strip@pt\dimexpr#1\dimexpr##1pt\relax\relax}}%
- }{%
- \edef\jlreq@do{\noexpand\fontsize{\the\dimexpr#1\dimexpr##1\relax\relax}}%
- }%
- \expandafter\endgroup
- \jlreq@do{##2}%
- }
- }
- \jlreq@divide{\jlreq@fontsize}{\jlreq@jafontsize}
- \edef\jlreq@do{\noexpand\@tempa{\strip@pt\jlreq@resultdimen}}
- \jlreq@do
-\fi
-
-\renewcommand{\normalsize}{%
- \@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@baselineskip}%
- \abovedisplayskip 1.1\jlreq@fontsize \@plus .3\jlreq@fontsize \@minus .4\jlreq@fontsize
- \abovedisplayshortskip \z@ \@plus .3\jlreq@fontsize
- \belowdisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize
- \belowdisplayshortskip \belowdisplayskip
- \let\@listi\@listI}
-
-\if@tate\tate\fi % ここで発行しておく
-\mcfamily\selectfont\normalsize
-\setbox\jlreq@tempboxa\hbox{阿}
-\setlength\Cht{\ht\jlreq@tempboxa}
-\setlength\Cdp{\dp\jlreq@tempboxa}
-\setlength\Cwd{\wd\jlreq@tempboxa}
-\setlength\Cvs{\baselineskip}
-\setlength\Chs{\wd\jlreq@tempboxa}
-
-% 4.1.3.a
-% 2.5.2 \baselineskipは一定の方がよい?
-% \@listiは再定義しないようにした.(\normalsizeと共用でJLReq通りだと思う.)
-\newcommand{\footnotesize}{%
- \@setfontsize\footnotesize{.8\jlreq@fontsize}{\dimexpr 115\jlreq@baselineskip/170\relax}% 脚注文字サイズの二分より少し小さい値を行間に: 4.2.5.e
- \abovedisplayskip .6\jlreq@fontsize \@plus.2\jlreq@fontsize \@minus.4\jlreq@fontsize
- \abovedisplayshortskip \z@ \@plus.1\jlreq@fontsize
- \belowdisplayshortskip .3\jlreq@fontsize \@plus.1\jlreq@fontsize \@minus.2\jlreq@fontsize
- \belowdisplayskip \abovedisplayskip}
-% tsize10.cloの引数を,そのまま\jlreq@fontsize/\jlreq@baselineskipでスケーリングしているだけ.
-\newcommand{\small}{%
- % jsarticleのもの
- \@setfontsize\small{.9\jlreq@fontsize}{\dimexpr 13\jlreq@baselineskip/17\relax}%
- \abovedisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize
- \abovedisplayshortskip \z@ \@plus.3\jlreq@fontsize
- \belowdisplayshortskip \abovedisplayshortskip
- \belowdisplayskip \abovedisplayskip}
-\newcommand{\scriptsize}{\@setfontsize\scriptsize{\dimexpr 7\jlreq@fontsize/10\relax}{\dimexpr 8\jlreq@baselineskip/17\relax}}
-\newcommand{\tiny}{\@setfontsize\tiny{\dimexpr 5\jlreq@fontsize/10\relax}{\dimexpr 6\jlreq@baselineskip/17\relax}}
-\newcommand{\large}{\@setfontsize\large{\dimexpr12\jlreq@fontsize/10\relax}{\jlreq@baselineskip}}
-\newcommand{\Large}{\@setfontsize\Large{\dimexpr14\jlreq@fontsize/10\relax}{\dimexpr 21\jlreq@baselineskip/17\relax}}
-\newcommand{\LARGE}{\@setfontsize\LARGE{\dimexpr17\jlreq@fontsize/10\relax}{\dimexpr 25\jlreq@baselineskip/17\relax}}
-\newcommand{\huge}{\@setfontsize\huge{2\jlreq@fontsize}{\dimexpr 28\jlreq@baselineskip/17\relax}}
-\newcommand{\Huge}{\@setfontsize\Huge{\dimexpr 25\jlreq@fontsize/10\relax}{\dimexpr 33\jlreq@baselineskip/17\relax}}
-
-%. plextから一部拝借
-% オプションも*もない\rensuji(コピペ)
-\DeclareRobustCommand{\jlreq@rensuji}[1]{%
- \ifvmode\leavevmode\fi
- \jlreq@ifydir{\hbox{#1}}{%
- \hskip 0pt plus 0.25\zw minus 0pt % \rensujiskipは固定値
- \setbox\jlreq@tempboxa=\hbox{\yoko#1}%
- \@tempdima=\dimexpr\ht\jlreq@tempboxa+\dp\jlreq@tempboxa\relax
- \vrule\@width\z@ \@height.5\@tempdima \@depth.5\@tempdima
- \hbox to 1\zw{\yoko\hss#1\hss}%
- \hskip 0pt plus 0.25\zw minus 0pt
-}}
-\def\jlreq@Kanji#1{\expandafter\kansuji\csname c@#1\endcsname}
-
-% このあたりはtarticleと同じ
-\setlength\lineskip{.1\zh}
-\setlength\normallineskip{.1\zh}
-\renewcommand{\baselinestretch}{}
-\setlength\parskip{0\p@ \@plus \p@}
-\setlength\parindent{1\zw}
-\@lowpenalty 51
-\@medpenalty 151
-\@highpenalty 301
-
-% 変数定義(他にも散らばっているけど)
-% 罫線の太さ(4.4.3.c 注1)
-\newdimen\jlreq@omotekeiwidth
-\jlreq@omotekeiwidth=0.12mm
-\newdimen\jlreq@chuubusokeiwidth
-\jlreq@chuubusokeiwidth=0.25mm
-\newdimen\jlreq@urakeiwidth
-\jlreq@urakeiwidth=0.4mm
-% 脚注のインデント
-\newdimen\jlreq@footnoteindent
-
-%\RequirePackage{jlreq-debug}
-
-%. ページレイアウト
-% landscapeの場合縦横をひっくり返す
-\if@landscape
- \setlength\@tempdima {\paperheight}
- \setlength\paperheight{\paperwidth}
- \setlength\paperwidth {\@tempdima}
-\fi
-
-% \pdfpagewidthとか設定
-\ifx l\jlreq@engine
- \let\jlreq@pagewidth=\pagewidth
- \let\jlreq@pageheight=\pageheight
-\else
- \let\jlreq@pagewidth=\pdfpagewidth
- \let\jlreq@pageheight=\pdfpageheight
-\fi
-\setlength{\jlreq@pagewidth}{\paperwidth}
-\setlength{\jlreq@pageheight}{\paperheight}
-\iftombow
- \addtolength{\jlreq@pagewidth}{2in}
- \addtolength{\jlreq@pageheight}{2in}
-\fi
-
-
-\ifx l\jlreq@engine
- \def\jlreq@expand@speciallength#1{%
- % zhやzwを\zhや\zwにする.
- \directlua{
- local act = string.char(92)
- local s = [[#1]]
- s = s:gsub("zw",act .. "zw"):gsub("zh",act .. "zh")
- tex.print(s)
- }%
- }
-\else
- \def\jlreq@expand@speciallength#1{#1}
-\fi
-\def\jlreq@speciallength#1{\dimexpr\jlreq@expand@speciallength{#1}\relax}
-
-%.. 二段組み用パラメータ
-\setlength{\columnsep}{\jlreq@speciallength{\jlreq@option@column@gap}}
-\setlength{\columnseprule}{0pt}
-
-%.. 傍注(4.2.7)
-\begingroup
- \footnotesize
- \setlength{\jlreq@tempdima}{\jlreq@speciallength{\jlreq@option@sidenote@length}}
- \jlreq@tempdimb=1\zw
- \divide\jlreq@tempdima\jlreq@tempdimb
- \multiply\jlreq@tempdima\jlreq@tempdimb
- \edef\jlreq@do{
- \noexpand\setlength{\noexpand\marginparwidth}{\the\jlreq@tempdima}
- \noexpand\setlength{\noexpand\marginparpush}{\the\dimexpr 0.5\zw\relax} % 同上:4.2.7.g
- }
- \expandafter\endgroup
-\jlreq@do
-\ifdim\marginparwidth>0pt
- \setlength{\marginparsep}{2\zw} % フォントサイズ×2(4.2.7:特に問題に~e)
-\else
- \setlength{\marginparsep}{0pt}
-\fi
-
-\ifdim\marginparwidth>0pt
- \ifnum 0\ifdim\marginparwidth>25\zw 1\fi\ifdim\marginparwidth<15\zw 1\fi>0
- \jlreq@note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).}
- \fi
-\fi
-% 縦書きの時は脚注に固定
-% (TODO: 頭注)
-\if@tate\@mparswitchfalse\fi
-
-\setlength{\topskip}{1\zw} % フォントサイズと一致させる
-\ifx\jlreq@option@headfoot@verticalpos\@empty
- \if@tate\def\jlreq@option@headfoot@verticalpos{1zw}
- \else\def\jlreq@option@headfoot@verticalpos{2zw}\fi
-\fi
-\setlength{\headsep}{\jlreq@speciallength{\jlreq@option@headfoot@verticalpos}}
-\ifdim\headsep<1\zw\relax\jlreq@note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi
-\setlength{\headheight}{1\zw}
-
-% \textwidthと\textheightのデフォルト値は縦横ともに0.75倍(調整が入る).
-%.. \textwidth:文字送り方向の行長
-% 二段の場合は最初の段の頭から次の段の後まで
-% 一度\textwidthに一行の長さの文字数を入れる(段組の場合でも)
-\newif\ifjlreq@determine@kihonhanmen@warning@first
-\jlreq@determine@kihonhanmen@warning@firsttrue
-\def\jlreq@determine@kihonhanmen@warning{
- \ifjlreq@determine@kihonhanmen@warning@first
- \jlreq@note{基本版面は,a. サイズの決定 b. 仕上りサイズに対する基本版面の配置位置の決定 という手順で行う (2.4.1).}
- \jlreq@determine@kihonhanmen@warning@firstfalse
- \fi
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@determine@kihonhanmen@warning}
-\jlreq@aftercls@addtodeleteif{\ifjlreq@determine@kihonhanmen@warning@first}
-\@tempdima=1\zw
-\ifx\jlreq@option@line@length\@empty
- \if@tate
- \ifnum 0\ifx\jlreq@option@head@space\@empty 1\fi\ifx\jlreq@option@foot@space\@empty 1\fi>0
- \setlength{\textwidth}{0.75\paperheight}
- \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
- \else
- \jlreq@determine@kihonhanmen@warning
- \setlength{\textwidth}{\dimexpr\paperheight - \jlreq@option@head@space - \jlreq@option@foot@space \relax}
- \fi
- \else
- \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0
- \setlength{\textwidth}{0.75\paperwidth}
- \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
- \else
- \jlreq@determine@kihonhanmen@warning
- \setlength{\textwidth}{\dimexpr\paperwidth - \jlreq@option@gutter - \jlreq@option@fore@edge\relax}
- \fi
- \fi
- \if@twocolumn
- \addtolength{\textwidth}{\dimexpr-2\marginparwidth - 2\marginparsep\relax}
- \setlength{\textwidth}{\dimexpr(\textwidth - \columnsep)/2\relax}
- \else
- \addtolength{\textwidth}{\dimexpr-\marginparwidth - \marginparsep\relax}
- \fi
-\else
- \setlength{\textwidth}{\jlreq@speciallength{\jlreq@option@line@length}}
- \divide\textwidth\@tempdima
- \if@tate
- \ifnum\number\textwidth>52
- \jlreq@note{一行の長さは52文字以下が望ましい (2.4.2.c 注2).}
- \fi
- \else
- \ifnum\number\textwidth>40
- \jlreq@note{一行の長さは40文字以下が望ましい (2.4.2.c 注2).}
- \fi
- \fi
- \multiply\textwidth\@tempdima
-\fi
-\if@twocolumn
- \setlength{\textwidth}{\dimexpr2\textwidth + \columnsep\relax}
-\fi
-
-
-%.. \textheight:行送り方向の長さ
-% 一番上(直後に\topskip由来が入る)から最終行のベースラインまでの長さ.
-% \topskipが十分ある時は先頭行のベースラインから最終行のベースライン+\topskip
-\def\jlreq@adjusttextheight{
- \addtolength{\textheight}{-\topskip}
- \divide\textheight\baselineskip \multiply\textheight\baselineskip
- \addtolength{\textheight}{\topskip}
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@adjusttextheight}
-\ifx\jlreq@option@number@of@lines\@empty
- \if@tate
- \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0
- \setlength{\textheight}{0.75\paperwidth}
- \jlreq@adjusttextheight
- \else
- \jlreq@determine@kihonhanmen@warning
- \setlength{\textheight}{\dimexpr\paperwidth - \jlreq@option@gutter - \jlreq@option@fore@edge + \topskip - 1\zw\relax}
- \fi
- \else
- \ifnum 0\ifx\jlreq@option@head@space\@empty 1\fi\ifx\jlreq@option@foot@space\@empty 1\fi>0
- \setlength{\textheight}{0.75\paperheight}
- \jlreq@adjusttextheight
- \else
- \jlreq@determine@kihonhanmen@warning
- \setlength{\textheight}{\dimexpr\paperheight + 2\topskip - 1\zh - \Cht - \jlreq@option@head@space - \jlreq@option@foot@space\relax}
- \fi
- \fi
-\else
- \setlength{\textheight}{\dimexpr\numexpr\jlreq@option@number@of@lines\relax\baselineskip - \baselineskip + \topskip\relax}
-\fi
-
-%.. 横
-\def\jlreq@setsidemargin@by@gutter#1{
- \if@tate
- \setlength{\evensidemargin}{#1}
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax}
- \addtolength{\evensidemargin}{\Cdp}
- \else
- \setlength{\oddsidemargin}{#1}
- \if@twocolumn
- \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax}
- \fi
- \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax}
- \fi
-}
-\def\jlreq@setsidemargin@by@fore@edge#1{
- \jlreq@setsidemargin@by@gutter{#1}
- \@tempdima=\evensidemargin
- \evensidemargin=\oddsidemargin
- \oddsidemargin=\@tempdima
- \ifjlreq@determine@kihonhanmen@warning@first
- \jlreq@note{基本版面の配置はのどの空き量を指定する (2.4.1.b).}
- \fi
-}
-
-\ifx\jlreq@option@gutter\@empty
- \ifx\jlreq@option@fore@edge\@empty
- % 中央配置
- \if@tate
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax}
- \else
- \if@twocolumn
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax}
- \else
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax}
- \fi
- \fi
- \setlength{\oddsidemargin}{.5\oddsidemargin}
- \ifnum0\if@twocolumn1\fi\if@tate1\fi>0
- \setlength{\evensidemargin}{\oddsidemargin}
- \else
- \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax}
- \fi
- \else
- \jlreq@setsidemargin@by@fore@edge{\jlreq@speciallength{\jlreq@option@fore@edge}}
- \fi
-\else
- \jlreq@setsidemargin@by@gutter{\jlreq@speciallength{\jlreq@option@gutter}}
- \ifx\jlreq@option@fore@edge\@empty\else
- \ifjlreq@determine@kihonhanmen@warning@first\else
- \ClassWarningNoLine{jlreq}{fore_edge is ignored}
- \fi
- \fi
-\fi
-\addtolength{\oddsidemargin}{-1in}
-\addtolength{\evensidemargin}{-1in}
-
-%.. 縦
-% \topmarginに全体の頭からテキストの頭までの長さを入れる
-% 天の値からtopmarginを設定する
-\def\jlreq@settopmarginbyhead#1{
- \if@tate
- \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in\relax}
- \if@twocolumn
- \addtolength{\topmargin}{\dimexpr\marginparwidth + \marginparsep\relax}
- \fi
- \jlreq@note{縦組の場合は地の空き量を指定する (2.4.1.b).}
- \else
- \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in - \topskip + \Cht\relax}
- \fi
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyhead}
-% 地の値から
-\def\jlreq@settopmarginbyfoot#1{
- \if@tate
- \setlength{\topmargin}{\dimexpr\paperheight - \textwidth - \headsep - \headheight - 1in - #1 - \marginparsep - \marginparwidth\relax}
- \else
- \jlreq@note{横組の場合は天の空き量を指定する (2.4.1.b).}
- \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - 1in - #1\relax}
- \fi
-}
-\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyfoot}
-\ifx\jlreq@option@head@space\@empty
- \ifx\jlreq@option@foot@space\@empty
- \if@tate
- \if@twocolumn
- \jlreq@settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - 2\marginparwidth - 2\marginparsep)/2\relax}
- \else
- \jlreq@settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - \marginparwidth - \marginparsep)/2\relax}
- \fi
- \else
- \jlreq@settopmarginbyhead{\dimexpr(\paperheight - (\textheight - \topskip + 1\zh))/2\relax}
- \fi
- \else
- \jlreq@settopmarginbyfoot{\jlreq@speciallength{\jlreq@option@foot@space}}
- \fi
-\else
- \ifx\jlreq@option@foot@space\@empty
- \jlreq@settopmarginbyhead{\jlreq@speciallength{\jlreq@option@head@space}}
- \else
- % 両方指定されていたら,縦書きは地を,横書きは天を使う
- \if@tate
- \jlreq@settopmarginbyfoot{\jlreq@speciallength{\jlreq@option@foot@space}}
- \ifx\jlreq@option@line@length\@empty\else
- \ClassWarningNoLine{jlreq}{head_space is ignored}
- \fi
- \else
- \jlreq@settopmarginbyhead{\jlreq@speciallength{\jlreq@option@head@space}}
- \ifx\jlreq@option@number@of@lines\@empty\else
- \ClassWarningNoLine{jlreq}{foot_space is ignored}
- \fi
- \fi
- \fi
-\fi
-
-%.. 下
-\setlength{\footskip}{\dimexpr\headsep + 1\zw\relax}
-% \maxdepth + \topskip = フォントサイズ×1.5(だってさ)
-\setlength{\maxdepth}{\dimexpr1.5\zw - \topskip\relax}
-
-%. 見出し関係 (4.1)
-% \clear***page
-\newcommand*{\cleartooddpage}{%
- \clearpage
- \ifodd\c@page\else
- \hbox{}%
- \newpage
- \if@twocolumn\hbox{}\newpage\fi
- \fi
-}
-\newcommand*{\cleartoevenpage}{%
- \clearpage
- \ifodd\c@page
- \hbox{}%
- \newpage
- \if@twocolumn\hbox{}\newpage\fi
- \fi
-}
-
-% 扉見出しと別行見出しについては,\<csname> -> \jlreq@headingcs@csname -> 本体と
-% 二段構えで展開されるようにする.一度の展開で\parが出るのを防ぐため.
-% 一度展開を\longなしマクロに渡されると破綻するので.(そういうパッケージが存在する.)
-
-% jlreq@heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される.
-% #1=*または空(見出し命令に*がついていたかで分岐),#2=ラベル,#3=running head
-% デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる.
-
-% 見出しの直前に実行される
-\newcommand*{\jlreq@hook@beforeheadings}[1]{}
-% 見出し名一覧を格納する
-\def\jlreq@heading@allheadings{}
-
-% 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
-% 結果は\jlreq@resultに入る.
-\def\jlreq@heading@make@l@#1#2#3{%
- \@ifundefined{l@#1}{%
- % 長さは適当に計測する
- \begingroup
- % ちょっと大きめで計測しておく
- \csname c@#1\endcsname=9
- \setbox\jlreq@tempboxa=\hbox{#3}%
- \jlreq@tempdima=\wd\jlreq@tempboxa
- \csname c@#1\endcsname=26
- \setbox\jlreq@tempboxa=\hbox{#3}%
- \ifdim\jlreq@tempdima<\wd\jlreq@tempboxa
- \jlreq@tempdima=\wd\jlreq@tempboxa
- \fi
- % \numexprは四捨五入
- \jlreq@tempdimb=\dimexpr\the\numexpr\jlreq@tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@result}{%
- \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq@tempdimb}}%
- }%
- }%
- \expandafter\endgroup
- \jlreq@do
- }{\def\jlreq@result{}}%
-}
-
-\def\jlreq@heading@make@maketoc#1#2{%
- % 目次への出力をするマクロ.外部に切り出しておく.
- \@ifundefined{jlreq@heading@maketoc@#1}{%
- % {1 = *}{2 = ラベル}{3 = running head}
- \expandafter\def\csname jlreq@heading@maketoc@#1\endcsname##1##2##3{%
- \ifnum0\jlreq@ifempty{##1}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0\else
- \csname #1mark\endcsname{##3}%
- \addcontentsline{toc}{#1}{\protect\numberline{##2}##3}%
- \fi
- }%
- }{}%
-}
-%.. 中/半扉見出し
-% addcontentslineに渡すやつ:番号出すのと出さないの
-\newcommand{\DeclareTobiraHeading}[3]{%
- \def\jlreq@do{\@removeelement{#1}}%
- \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}%
- \appto{\jlreq@heading@allheadings}{,#1}%
- \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
- \expandafter\edef\csname jlreq@heading@setting@#1\endcsname{\unexpanded{#3}}%
- \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewTobiraHeading}%
- \@ifundefined{c@#1}{\newcounter{#1}}{}%
- \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
- \jlreq@heading@make@maketoc{#1}{#2}%
- \begingroup
- \let\jlreq@contents@label@format=\@undefined
- \let\jlreq@format=\@undefined
- \edef\jlreq@label@format{\expandonce{\csname the#1\endcsname}}%
- \def\jlreq@heading@clearpage{\clearpage\hbox{}\clearpage}%
- \def\jlreq@pagestyle{empty}%
- \jlreq@parsekeyval[DeclareTobiraHeading:#1]{
- {label_format}{\def\jlreq@label@format{##1}}
- {format}{\def\jlreq@format####1####2{##1}}
- {pagestyle}{\def\jlreq@pagestyle{##1}}
- {type}[han,naka]{%
- \jlreq@switch{##1}{
- {han}{\def\jlreq@heading@clearpage{\clearpage}}
- {naka}{\def\jlreq@heading@clearpage{\clearpage\hbox{}\clearpage}}
- }%
- }
- }{#3}%
- \def\jlreq@do{}%
- \ifx\jlreq@format\@undefined
- \def\jlreq@format##1##2{##1##2}%
- \fi
- \edef\jlreq@formatwlabel{\noexpand\jlreq@format{\expandonce{\jlreq@label@format}}}%
- \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
- \eappto\jlreq@do{\expandonce{\jlreq@result}}%
- \edef\jlreq@do{%
- \expandonce{\jlreq@do}%
- \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}[####1]####2{%
- \unexpanded{\ifnum#2>\c@secnumdepth\else}%
- \unexpanded{\refstepcounter{#1}}%
- \noexpand\fi
- \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{}{\expandonce{\jlreq@label@format}}{####1}%
- \unexpanded{\ifnum#2>\c@secnumdepth\relax}%
- \expandonce{\jlreq@format{}{##1}}%
- \noexpand\else
- \expandafter\expandonce\expandafter{\jlreq@formatwlabel{##2}}%
- \noexpand\fi
- \noexpand\@afterheading
- \expandonce{\jlreq@heading@clearpage}%
- \unexpanded{\if@restonecol\twocolumn\fi}%
- }%
- \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}####1{%
- \expandonce{\jlreq@format{}{##1}}%
- \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq@label@format}}{####1}%
- \noexpand\@afterheading
- \expandonce{\jlreq@heading@clearpage}%
- \unexpanded{\if@restonecol\twocolumn\fi}%
- }%
- \noexpand\def\expandonce{\csname jlreq@headingcs@#1\endcsname}{%
- % 改丁.これでよいのかな.
- \unexpanded{\if@twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage}%
- \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq@pagestyle}}\fi
- \noexpand\secdef{\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}}}%
- \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\newcommand{\NewTobiraHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareTobiraHeading{#1}{#2}{#3}}%
-}
-\newcommand{\RenewTobiraHeading}[3]{%
- \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareTobiraHeading{#1}{#2}{#3}}%
-}
-\newcommand{\ProvideTobiraHeading}[3]{%
- \@ifundefined{#1}{\DeclareTobiraHeading{#1}{#2}{#3}}{}%
-}
-
-%.. 別行見出し
-% \jlreq@BlockHeading@start:別行見出しを出力する命令.
-% \jlreq@BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = フォーマット関連}{5 = 全体フォーマット}*{見出し}[副題]
-% スペース関連={配置:lcr(左中央右)}{字下げ(寸法)}{字上げ(寸法)}{前空き}{後空き}{行取りの行数}{空か*か,偶数ページでも改ページを許可するならば空}
-% 前/後空きはprefixにa:/s:/r:が入る.r:は空きがその値そのものになる.a:/s:は行取りに加えて入る.a:で指定された空きはページ行頭では入らない
-% 後空きの時はs:は指定できない.
-% フォーマット関連:
-% フォーマット関連={ラベルのみのフォーマット}{ラベルフォーマット}{見出し文字列フォーマット}{見出し文字列フォーマット(ラベル無し)}{副題フォーマット}{副題フォーマット(ラベル無し)}{見出し全体のフォーマット}
-% 見出しそのものは「全体フォーマット」に従い出力される.パラメータトークン#1を含み,#1=見出し本体:スペース関連と上の「見出し全体のフォーマット」に基づいて整形される.
-% 見出し全体のフォーマット内では#1=ラベル,#2=見出し文字列,#3=副題,それぞれ各々のフォーマットに基づき整形される.
-% ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題
-% ラベルのみのフォーマットは目次に使われる.
-\newcommand{\jlreq@BlockHeading@start}[5]{%
- \edef\jlreq@BlockHeading@start@format{\unexpanded{#4}}% この二つは\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
- \edef\jlreq@BlockHeading@start@totalformat{\unexpanded{#5}}%
- \jlreq@BlockHeading@start@{#1}{#2}{#3}%
-}
-% {1 = 命令}{2 = レベル}{3 = スペース関連}
-\newcommand{\jlreq@BlockHeading@start@}[3]{%
- \@ifstar{\@dblarg{\jlreq@BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq@BlockHeading@start@@{#1}{#2}{#3}{}}}%
-}
-% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}[5 = running head]{6 = 見出し}
-\long\def\jlreq@BlockHeading@start@@#1#2#3#4[#5]#6{%
- \jlreq@ifnextchar[{\jlreq@BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq@BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}%
-}
-
-% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題]
-\long\def\jlreq@BlockHeading@start@@@#1#2#3#4#5#6[#7]{%
- \edef\jlreq@do{\unexpanded{\jlreq@BlockHeading@start@@@@{#1}{#2}{#3}}{\expandonce{\jlreq@BlockHeading@start@format}}{\expandonce{\jlreq@BlockHeading@start@totalformat}}}%
- \jlreq@do{#4}{#5}{#6}{#7}%
-}
-
-% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = フォーマット群}{5 = 全フォーマット}{6 = *}{7 = running head}{8 = 見出し}{9 = 副題}
-\long\def\jlreq@BlockHeading@start@@@@#1#2#3#4#5#6#7#8#9{%
- \edef\jlreq@tempa##1##2##3##4##5##6##7{%
- \unexpanded{\jlreq@BlockHeading@start@makeoutput{#1}{#2}}{{##1}{##2}{##3}}\unexpanded{{#4}{#6}{#7}{#8}{#9}}%
- \unexpanded{\def\jlreq@tempb}{{##4}{##5}{##6}{##7}}% 縦方向空き
- }%
- \jlreq@tempa#3%
- \global\advance\jlreq@BlockHeading@spaces@current@count by 1
- \appto\jlreq@BlockHeading@spaces@current@sequence{_#1}%
- \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@output@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
- \expandonce{\jlreq@resultb}%
- }%
- \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@space@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
- \expandonce{\jlreq@tempb}%
- }%
- \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@format@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
- \unexpanded{#5}%
- }%
- \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
- \expandonce{\jlreq@resulta}%
- }%
- \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count\endcsname{}%
- \ifx\jlreq@BlockHeading@spaces@headingslist\@empty
- \expandafter\jlreq@BlockHeading@spaces@outputwospace
- \expandafter\ignorespaces
- \else
- \expandafter\jlreq@BlockHeading@start@afterheading
- \fi
-}
-
-\def\jlreq@BlockHeading@start@afterheading{\futurelet\jlreq@nextchar\jlreq@BlockHeading@start@afterheading@}
-\edef\jlreq@BlockHeading@start@afterheading@{%
- \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@BlockHeading@start@afterheading@@}%
- \unexpanded{\else\expandafter\jlreq@BlockHeading@start@afterheading@@@\fi}%
-}
-% スペースを読み飛ばす
-\expandafter\def\expandafter\jlreq@BlockHeading@start@afterheading@@\space{\jlreq@BlockHeading@start@afterheading}
-\def\jlreq@BlockHeading@start@afterheading@@@{%
- \def\jlreq@do{\jlreq@BlockHeading@spaces@output}%
- \@for\@tempa:=\jlreq@BlockHeading@allheadings\do{%
- \expandafter\ifx\csname\@tempa\endcsname\jlreq@nextchar\def\jlreq@do{}\fi
- }%
- % \jlreq@BlockHeading@HeadingSpaces@ignoretokens内のものは特別扱いする
- \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@BlockHeading@HeadingSpaces@ignoretokens\do{%
- \expandafter\ifx\@tempa\jlreq@nextchar
- \def\jlreq@do{\jlreq@BlockHeading@start@afterheading@saveafter@cs}%
- \fi
- }%
- \jlreq@do
-}
-
-% コントロールシークエンスを保存
-\def\jlreq@BlockHeading@start@afterheading@saveafter@cs#1{%
- \csgappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{#1}%
- \jlreq@BlockHeading@start@afterheading@saveafter@option
-}
-% オプションがあれば保存
-\def\jlreq@BlockHeading@start@afterheading@saveafter@option{%
- \@ifnextchar[{\jlreq@BlockHeading@start@afterheading@saveafter@option@}{\jlreq@BlockHeading@start@afterheading@saveafter@arguments}%
-}
-\def\jlreq@BlockHeading@start@afterheading@saveafter@option@[#1]{%
- \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{[#1]}}%
- \jlreq@BlockHeading@start@afterheading@saveafter@arguments
-}
-% 引数を保存し続けるループ
-\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments{%
- \jlreq@ifnextchar\bgroup{\jlreq@BlockHeading@start@afterheading@saveafter@arguments@}{\jlreq@BlockHeading@start@afterheading}%
-}
-\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments@#1{%
- \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{{#1}}}%
- \jlreq@BlockHeading@start@afterheading@saveafter@arguments
-}
-
-% 特別扱いしたいマクロを並べる
-\def\jlreq@BlockHeading@HeadingSpaces@ignoretokens{\label}
-
-% \jlreq@resultaにaux吐き出しとかを入れて,\jlreq@resultbに出力を入れる(縦方向調整なし)
-% {1 = 命令}{2 = レベル}{3 = スペース関連(横方向のみ)}{4 = フォーマット群}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題}
-\long\def\jlreq@BlockHeading@start@makeoutput#1#2#3#4#5#6#7#8{%
- \begingroup
- \ifnum0\jlreq@ifempty{#5}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0
- \def\jlreq@tempc{*}%
- \else
- \def\jlreq@tempc{}%
- \fi
- \long\def\jlreq@tempa##1##2##3##4##5##6##7{%
- \long\def\jlreq@tempa{##1}% 素のラベルのフォーマットを取り出す
- \edef\jlreq@tempb{\unexpanded{{##2}{##3}{##4}{##5}{##6}{##7}}{\expandonce{\jlreq@tempc}}}% 残り
- }%
- \jlreq@tempa#4%
- \expandafter\jlreq@BlockHeading@start@makeoutput@@\jlreq@tempb{#7}{#8}%
- \edef\jlreq@do{\noexpand\jlreq@BlockHeading@start@makeoutput@\unexpanded{#3}{\expandonce{\jlreq@result}}}%
- \jlreq@do
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@resulta}{%
- \expandafter\if\jlreq@tempc *\else\unexpanded{\refstepcounter{#1}}\fi
- \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{\unexpanded{#5}}{\expandonce{\jlreq@tempa}}{\unexpanded{#6}}%
- }%
- \unexpanded{\def\jlreq@resultb}{%
- \expandonce{\jlreq@result}%
- }%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-
-% {1 = 配置(clr)}{2 = 字下げ}{3 = 字上げ}{4 = 出力}
-\long\def\jlreq@BlockHeading@start@makeoutput@#1#2#3#4{%
- \edef\jlreq@result{%
- \noexpand\noindent
- \jlreq@ifempty{#2}{}{\unexpanded{\hskip #2}}%
- \noexpand\vbox{%
- \noexpand\noindent
- \ifx#1c\noexpand\centering\fi
- \ifx#1r\noexpand\raggedleft\fi
- \jlreq@ifempty{#2}{}{\unexpanded{\hsize=\dimexpr\hsize - #2\relax}}%
- \jlreq@ifempty{#3}{}{\unexpanded{\hsize=\dimexpr\hsize - #3\relax}}%
- \unexpanded{#4}}%
- }%
-}
-
-% {1 = ラベルフォーマット}{2 = 見出し文字列フォーマット}{3 = 見出し文字列フォーマット(ラベル無し)}{4 = 副題フォーマット}{5 = 副題フォーマット(ラベル無し)}{6 = 全体フォーマット}{7 = *}{8 = 見出し}{9 = 副題}
-% \jlreq@resultに出力対象を入れる
-\long\def\jlreq@BlockHeading@start@makeoutput@@#1#2#3#4#5#6#7#8#9{%
- \begingroup
- % \jlreq@tempaに{ラベル}{見出し}{副題}という形のものを入れる
- \jlreq@ifempty{#7}{%
- % ラベルあり
- \long\def\jlreq@tempa{#1}%
- \long\def\jlreq@tempb##1{#2}%
- \jlreq@ifempty{#9}{\def\jlreq@tempc##1{}}{\long\def\jlreq@tempc##1{#4}}%
- }{%
- \long\def\jlreq@tempa{}%
- \long\def\jlreq@tempb##1{#3}%
- \jlreq@ifempty{#9}{\def\jlreq@tempc##1{}}{\long\def\jlreq@tempc##1{#5}}%
- }%
- \edef\jlreq@tempa{{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb{#8}}}{\expandonce{\jlreq@tempc{#9}}}}%
- \long\def\jlreq@tempb##1##2##3{#6}%
- \edef\jlreq@tempa{\noexpand\expandonce{\noexpand\jlreq@tempb\expandonce{\jlreq@tempa}}}%
- \edef\jlreq@do{\unexpanded{\def\jlreq@result}{\jlreq@tempa}}%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\def\jlreq@BlockHeading@start@removecolumn#1:{#1}
-
-% 空き指定を解釈する.a:10pt -> \jlreq@resulta=a,\jlreq@resultb=10pt
-\def\jlreq@BlockHeading@start@analyzespace#1:#2\jlreq@endmark{%
- \jlreq@ifempty{#1}{%
- \def\jlreq@resulta{}%
- \def\jlreq@resultb{}%
- }{%
- \let\jlreq@resulta=#1%
- \edef\jlreq@resultb{\expandonce{\jlreq@BlockHeading@start@removecolumn#2}}%
- }%
-}
-
-% 行取り処理
-% {1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}{4 = 偶数ページ改ページするなら空}{5 = 出力}
-\long\def\jlreq@BlockHeading@start@gyodori#1#2#3#4#5{{%
- \par
- \jlreq@ifempty{#4}{\jlreq@setcurrentpage}{}%
- \setbox\jlreq@tempboxa=\vbox{#5}%
- % \jlreq@tempskip(a/b)に前/後ろに入れるべき値を入れる
- % #1がa:ならばその値は\jlreq@tempskipaには足さず\jlreq@tempskipcに入れておく
- \jlreq@tempskipa=0pt
- \jlreq@tempskipc=0pt
- \jlreq@BlockHeading@start@analyzespace#1:\jlreq@endmark
- \let\jlreq@maeakitype=\jlreq@resulta
- \let\jlreq@maeaki=\jlreq@resultb
- \jlreq@BlockHeading@start@analyzespace#2:\jlreq@endmark
- \let\jlreq@ushiroakitype=\jlreq@resulta
- \let\jlreq@ushiroaki=\jlreq@resultb
- \def\jlreq@lines{#3}%
- % 両方強制指定の場合は行数を無視する.
- \ifx r\jlreq@maeakitype\ifx r\jlreq@ushiroakitype\def\jlreq@lines{}\fi\fi
- \setbox\jlreq@tempboxb=\hbox{阿}%
- \ifx\jlreq@lines\@empty
- \ifx\jlreq@maeaki\@empty\else
- \jlreq@tempskipa=\glueexpr\jlreq@maeaki\relax
- \fi
- \ifx\jlreq@ushiroaki\@empty\else
- \jlreq@tempskipb=\glueexpr\jlreq@ushiroaki\relax
- \fi
- \else
- % 行取り時の前後の空きを足した値を\jlreq@tempdimaに入れる
- \jlreq@tempdima=\glueexpr(#3\baselineskip - \baselineskip - \ht\jlreq@tempboxa - \dp\jlreq@tempboxa)\relax
- \ifx\jlreq@maeakitype\@empty
- \jlreq@tempskipa=\glueexpr(\jlreq@tempdima + \dp\jlreq@tempboxb - \ht\jlreq@tempboxb)/2\relax
- \else
- \ifx a\jlreq@maeakitype
- \jlreq@tempskipa=\glueexpr(\jlreq@tempdima + \dp\jlreq@tempboxb - \ht\jlreq@tempboxb)/2\relax
- \jlreq@tempskipc=\glueexpr\jlreq@maeaki\relax
- \fi
- \ifx s\jlreq@maeakitype
- \jlreq@tempskipa=\glueexpr(\jlreq@tempdima + \dp\jlreq@tempboxb - \ht\jlreq@tempboxb)/2 + \jlreq@maeaki\relax
- \jlreq@tempdima=\dimexpr\jlreq@tempdima + \jlreq@maeaki\relax
- \fi
- \ifx r\jlreq@maeakitype
- \jlreq@tempskipa=\glueexpr\jlreq@maeaki\relax
- \jlreq@tempdima=\dimexpr\jlreq@tempdima + \baselineskip - \dp\jlreq@tempboxb\relax
- \fi
- \fi
- \ifx\jlreq@ushiroakitype\@empty
- \jlreq@tempskipb=\glueexpr\jlreq@tempdima - \jlreq@tempskipa\relax
- \else
- \ifx a\jlreq@ushiroakitype
- \jlreq@tempskipb=\glueexpr\jlreq@tempdima - \jlreq@tempskipa + \jlreq@ushiroaki\relax
- \fi
- \ifx r\jlreq@ushiroakitype
- \jlreq@tempskipb=\glueexpr\jlreq@ushiroaki\relax
- \jlreq@tempskipa=\glueexpr\jlreq@tempdima - \jlreq@tempskipb + \baselineskip - \ht\jlreq@tempboxb\relax
- \fi
- \fi
- \fi
- \jlreq@ifgluezero\jlreq@tempskipc{}{\vskip\jlreq@tempskipc\relax}%
- \ifx r\jlreq@maeakitype\prevdepth=-1000pt\fi
- \setbox\jlreq@tempboxa=\vbox{%
- \jlreq@ifgluezero\jlreq@tempskipa{}{\vskip\jlreq@tempskipa}%
- \unvbox\jlreq@tempboxa}%
- \dp\jlreq@tempboxa=\dimexpr\dp\jlreq@tempboxa + \ht\jlreq@tempboxa\relax
- \ht\jlreq@tempboxa=0pt
- \box\jlreq@tempboxa
- \jlreq@ifempty{#4}{\ifodd\jlreq@currentpage\nobreak\fi}{\nobreak}%
- \ifx r\jlreq@ushiroakitype\prevdepth=-1000pt\else\prevdepth=0pt\fi
- \jlreq@ifgluezero\jlreq@tempskipb{}{\vskip\jlreq@tempskipb}%
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@parhook@gyodori}{%
- \noexpand\parskip=\the\parskip
- \unexpanded{\def\jlreq@parhook@gyodori{}}%
- }%
- \unexpanded{\parskip=0pt plus 1pt}%
- }%
-\expandafter}\jlreq@do}
-\PushPostHook{par}{\jlreq@parhook@gyodori}
-\def\jlreq@parhook@gyodori{}
-
-% 行取り情報をゲットだぜ
-% \jlreq@resultに{1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}を入れる
-% #2#3#4はそれぞれ前空き,後ろ開き,トータル行数のデフォルト値
-% *つきは\setkeys*を使う.[]はkeyvalのファミリー.
-\def\jlreq@BlockHeading@gyodori@parsekeyval{%
- \@ifstar{\jlreq@BlockHeading@gyodori@parsekeyval@{*}}{\jlreq@BlockHeading@gyodori@parsekeyval@{}}%
-}
-\def\jlreq@BlockHeading@gyodori@parsekeyval@#1{%
- \@ifnextchar[{\jlreq@BlockHeading@gyodori@parsekeyval@@{#1}}{\jlreq@BlockHeading@gyodori@parsekeyval@@{#1}[jlreq@key]}%
-}
-\def\jlreq@BlockHeading@gyodori@parsekeyval@@#1[#2]#3#4#5#6{%
- \begingroup
- \def\jlreq@lines{#6}%
- \def\jlreq@before@space{}%
- \def\jlreq@before@lines{}%
- \def\jlreq@after@space{}%
- \def\jlreq@after@lines{}%
- \jlreq@parsekeyval#1[#2]{
- {lines}{\def\jlreq@lines{##1}}
- {before_space}{\def\jlreq@before@space{##1}}
- {after_space}{\def\jlreq@after@space{##1}}
- {before_lines}{%
- \jlreq@iffirsttoken@ignorespaces{##1}{*}%
- {\edef\jlreq@before@lines{s:\expandonce{\@gobble ##1}}}%
- {\def\jlreq@before@lines{a:##1}}%
- }
- {after_lines}{\def\jlreq@after@lines{##1}}
- }{#3}%
- % before/after_lines優先
- \ifx\jlreq@before@space\@empty\else\edef\jlreq@before@space{r:\expandonce{\jlreq@before@space}}\fi
- \ifx\jlreq@before@lines\@empty\else\edef\jlreq@before@space{\expandonce{\jlreq@before@lines}\baselineskip}\fi
- \ifx\jlreq@before@space\@empty\def\jlreq@before@space{#4}\fi
- \ifx\jlreq@after@space\@empty\else\edef\jlreq@after@space{r:\expandonce{\jlreq@after@space}}\fi
- \ifx\jlreq@after@lines\@empty\else\edef\jlreq@after@space{a:\expandonce{\jlreq@after@lines}\baselineskip}\fi
- \ifx\jlreq@after@space\@empty\def\jlreq@after@space{#5}\fi
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@result}{{\expandonce{\jlreq@before@space}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@lines}}}%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-
-% \DeclareBlockHeading{命令名}{レベル}{設定}
-\def\jlreq@BlockHeading@allheadings{}% 別行見出し一覧
-\newcommand{\DeclareBlockHeading}[3]{%
- \def\jlreq@do{\@removeelement{#1}}%
- \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}%
- \appto\jlreq@heading@allheadings{,#1}%
- \expandafter\jlreq@do\expandafter{\jlreq@BlockHeading@allheadings}{\jlreq@BlockHeading@allheadings}%
- \appto\jlreq@BlockHeading@allheadings{,#1}%
- \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
- \expandafter\edef\csname jlreq@heading@setting@#1\endcsname{\unexpanded{#3}}%
- \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewBlockHeading}%
- \@ifundefined{c@#1}{\newcounter{#1}}{}%
- \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
- \jlreq@heading@make@maketoc{#1}{#2}%
- \begingroup
- \def\jlreq@font{}%
- \def\jlreq@subtitle@font{}%
- \def\jlreq@indent{0\zw}%
- \def\jlreq@end@indent{0\zw}%
- \def\jlreq@align{l}%
- \edef\jlreq@format{\unexpanded{##1##2##3}}%
- \edef\jlreq@heading@text@format{\unexpanded{##1}}%
- \def\jlreq@pagebreak{}%
- \def\jlreq@label@format{\@seccntformat{#1}}%
- \newif\ifjlreq@hang\jlreq@hangtrue
- \def\jlreq@after@label@space{1\zw}%
- \def\jlreq@second@heading@text@indent@wlabel{0pt}%
- \def\jlreq@second@heading@text@indent@wolabel{0pt}%
- \edef\jlreq@subtitle@format{\unexpanded{---##1---}}%
- \def\jlreq@subtitle@indent{1\zw}%
- \def\jlreq@afterindent{\@afterindenttrue}%
- \def\jlreq@allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空,そうでないなら*
- \newif\ifjlreq@subtitle@break\jlreq@subtitle@breaktrue
- \def\jlreq@subtitle@indent{1\zw}%
- \def\jlreq@column@spanning{false}%
- \newif\ifjlreq@column@spanning@possible\jlreq@column@spanning@possiblefalse
- % a,bみたいなのをaとbにわける.カンマがなければbは空.引数を{a}{b}として##2を呼び出す.
- \def\jlreq@parsecomma##1##2{%
- \def\jlreq@tempa####1####2{##2}%
- \def\@tempa####1,####2\jlreq@endmark{%
- \jlreq@ifempty{####2}{%
- \def\@tempa{}%
- }{%
- \def\@tempa########1,\jlreq@endmark{\def\@tempa{########1}}%
- \@tempa####2\jlreq@endmark
- }%
- \edef\@tempa{\unexpanded{\jlreq@tempa{####1}}{\expandonce{\@tempa}}}%
- \edef\jlreq@do{\jlreq@expandtwice{\@tempa}}%
- }%
- \@tempa##1,\jlreq@endmark
- \jlreq@do
- }%
- \jlreq@parsekeyval[BlockHeading:#1]{
- {lines}{}
- {before_space}{}
- {after_space}{}
- {before_lines}{}
- {after_lines}{}
- {font}{\def\jlreq@font{##1}}
- {subtitle_font}{\def\jlreq@subtitle@font{##1}}
- {indent}{\def\jlreq@indent{##1}}
- {end_indent}{\def\jlreq@end@indent{##1}}
- {align}[left,center,right]{%
- \jlreq@switch{##1}{
- {left}{\def\jlreq@align{l}}
- {center}{\def\jlreq@align{c}}
- {right}{\def\jlreq@align{r}}
- }%
- }
- {format}{\edef\jlreq@format{\unexpanded{##1}}}
- {after_label_space}{\def\jlreq@after@label@space{##1}}
- {second_heading_text_indent,heading_text_second_indent}{%
- \jlreq@parsecomma{##1}{%
- \jlreq@iffirsttoken{####1}{*}{%
- \jlreq@hangfalse
- \edef\jlreq@second@heading@text@indent@wlabel{\expandonce{\@gobble ####1}}%
- }{%
- \jlreq@hangtrue
- \def\jlreq@second@heading@text@indent@wlabel{####1}%
- }%
- \jlreq@ifempty{####2}{%
- \let\jlreq@second@heading@text@indent@wolabel=\jlreq@second@heading@text@indent@wlabel
- }{%
- \def\jlreq@second@heading@text@indent@wolabel{####2}%
- }%
- }%
- }
- {label_format}{\edef\jlreq@label@format{\unexpanded{##1}}}
- {subtitle_format}{\edef\jlreq@subtitle@format{\unexpanded{##1}}}
- {subtitle_indent}{\def\jlreq@subtitle@indent{##1}}
- {subtitle_break}[true,false]{\csname jlreq@subtitle@break##1\endcsname}
- {afterindent}[true,false]{\edef\jlreq@afterindent{\expandonce{\csname @afterindent##1\endcsname}}}
- {allowbreak_if_evenpage}[true,false]{%
- \jlreq@switch{##1}{
- {true}{\def\jlreq@allowbreak@evenpage{}}
- {false}{\def\jlreq@allowbreak@evenpage{*}}
- }%
- }
- {pagebreak}[clearpage,cleardoublepage,clearcolumn,nariyuki,begin_with_odd_page,begin_with_even_page]{%
- \jlreq@switch{##1}{
- {clearpage}{\def\jlreq@pagebreak{\clearpage}\jlreq@column@spanning@possibletrue}
- {cleardoublepage}{\def\jlreq@pagebreak{\cleardoublepage}\jlreq@column@spanning@possibletrue}
- {clearcolumn}{\if@twocolumn\def\jlreq@pagebreak{\newpage}\else\def\jlreq@pagebreak{}\fi\jlreq@column@spanning@possiblefalse}
- {begin_with_even_page}{\def\jlreq@pagebreak{\cleartoevenpage}\jlreq@column@spanning@possibletrue}
- {begin_with_odd_page}{\def\jlreq@pagebreak{\cleartooddpage}\jlreq@column@spanning@possibletrue}
- {nariyuki}{\def\jlreq@pagebreak{}\jlreq@column@spanning@possiblefalse}
- }%
- }
- % 後々数字を受け付けるようになったりするかもしれないので……
- {column_spanning}{%
- \jlreq@tempatrue % validな入力に対してfalse
- \jlreq@ifempty{##1}{}{%
- \jlreq@ifnumber{##1}{% 数字の時はtrueに回す
- \jlreq@tempafalse
- \def\jlreq@column@spanning{true}%
- }{%
- \jlreq@switch{##1}{%
- {true}{\jlreq@tempafalse\def\jlreq@column@spanning{true}}
- {false}{\jlreq@tempafalse\def\jlreq@column@spanning{false}}
- }%
- }%
- }%
- \ifjlreq@tempa\ClassWarningNoLine{jlreq}{Invalid input `##1' for column_spanning in BlockHeading #1}\fi
- }
- }{#3}%
- \def\jlreq@do{}% 初期化.これに最終処理を入れていく.
- % 入力チェック
- \ifthenelse{\equal{\jlreq@column@spanning}{true}}{%
- \ifjlreq@column@spanning@possible\else
- \ClassWarningNoLine{jlreq}{column_spanning can be used only with `pagebreak=nariyuki' or `pagebreak=clearcolumn' (in BlockHeading #1)}%
- \def\jlreq@column@spanning{false}%
- \fi
- }{}%
- \edef\jlreq@format{\expandonce{\jlreq@font}\expandonce{\jlreq@format}}%
- % 空き量などの調整を含んだラベル
- \edef\jlreq@label@format@modified{%
- \noexpand\noindent
- \unexpanded{\setbox\jlreq@tempboxa=\hbox}{\expandonce{\jlreq@label@format}}%
- \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq@after@label@space}) + (\expandonce{\jlreq@second@heading@text@indent@wlabel})%
- \ifjlreq@hang
- +\wd\jlreq@tempboxa\relax
- \else
- \relax
- \unexpanded{\edef\jlreq@BlockHeading@start@labellength{\the\wd\jlreq@tempboxa}}%
- \fi
- \box\jlreq@tempboxa
- }%
- \edef\jlreq@heading@text@format@wlabel{%
- \ifdim\dimexpr\jlreq@after@label@space\relax=0pt\else
- \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq@after@label@space}\noexpand\relax}%
- \fi
- \expandonce{\jlreq@heading@text@format}%
- }%
- \edef\jlreq@heading@text@format@wolabel{%
- \ifdim\dimexpr\jlreq@second@heading@text@indent@wolabel\relax=0pt\else
- \noexpand\hangindent=\noexpand\dimexpr\expandonce{\jlreq@second@heading@text@indent@wolabel}\noexpand\relax
- \fi
- \expandonce{\jlreq@heading@text@format}%
- }%
- \def\jlreq@make@subtitle@format##1##2{%
- \edef##1{%
- \ifjlreq@subtitle@break\unexpanded{{\par}\hangafter=0}\fi
- \unexpanded{\hangindent=\dimexpr\hangindent + }(\expandonce{\jlreq@subtitle@indent}) ##2\noexpand\relax
- \ifdim\jlreq@subtitle@indent=0pt\else
- \ifjlreq@subtitle@break\else\unexpanded{\hspace*}{\expandonce{\jlreq@subtitle@indent}}\fi
- \fi
- \unexpanded{\nobreak\noindent}%
- {\ifx\jlreq@subtitle@font\@empty\else\expandonce{\jlreq@subtitle@font}\fi\expandonce{\jlreq@subtitle@format}}%
- }%
- }%
- \jlreq@make@subtitle@format\jlreq@subtitle@format@wlabel{%
- - (\expandonce{\jlreq@second@heading@text@indent@wlabel})%
- \ifjlreq@hang\else + (\noexpand\jlreq@BlockHeading@start@labellength)\fi
- }%
- \jlreq@make@subtitle@format\jlreq@subtitle@format@wolabel{- (\expandonce{\jlreq@second@heading@text@indent@wolabel})}%
- \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
- \eappto\jlreq@do{\expandonce{\jlreq@result}}%
- \jlreq@BlockHeading@gyodori@parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
- \let\jlreq@spaceset=\jlreq@result
- \edef\jlreq@totalformat{\unexpanded{##1}\expandonce{\jlreq@afterindent}\noexpand\@afterheading}%
- \if@twocolumn
- \ifthenelse{\equal{\jlreq@column@spanning}{true}}{%
- \def\@tempa##1##2##3{%
- % 前開きが常に入ってしまうので,a:の時は除去する
- \jlreq@iffirsttoken{##1}{a}{\def\jlreq@spaceset{{}{##2}{##3}}}{}
- \edef\jlreq@totalformat{%
- \noexpand\twocolumn[%
- % 普段自動で入る\topskipと\baselineskipを手動で入れる
- \jlreq@iffirsttoken{##1}{r}{}{\unexpanded{\vskip\topskip\relax}}%
- \unexpanded{####1}%
- \jlreq@iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
- ]%
- }%
- }%
- \expandafter\@tempa\jlreq@spaceset
- }{}%
- \fi
- \edef\jlreq@do{%
- \expandonce{\jlreq@do}%
- \noexpand\edef\expandonce{\csname jlreq@headingcs@#1\endcsname}{\noexpand\unexpanded{%
- \noexpand\jlreq@hook@beforeheadings{#1}%
- \expandonce{\jlreq@pagebreak}%
- \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}%
- {{\expandonce{\jlreq@align}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@end@indent}}\expandonce{\jlreq@spaceset}{\expandonce{\jlreq@allowbreak@evenpage}}}%
- {%
- {\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@label@format@modified}}%
- {\expandonce{\jlreq@heading@text@format@wlabel}}{\expandonce{\jlreq@heading@text@format@wolabel}}%
- {\expandonce{\jlreq@subtitle@format@wlabel}}{\expandonce{\jlreq@subtitle@format@wolabel}}%
- {\expandonce{\jlreq@format}}%
- }%
- {\expandonce{\jlreq@totalformat}}%
- }}%
- \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\newcommand{\NewBlockHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareBlockHeading{#1}{#2}{#3}}%
-}
-\newcommand{\RenewBlockHeading}[3]{%
- \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareBlockHeading{#1}{#2}{#3}}%
-}
-\newcommand{\ProvideBlockHeading}[3]{%
- \@ifundefined{#1}{\DeclareBlockHeading{#1}{#2}{#3}}{}%
-}
-
-%.. 別行見出しが連続した場合の処理
-% 設定値保存に次のマクロを使う
-% \jlreq@BlockHeading@spaces@headingslist
-% : スペースを考慮しないとならない見出しのリスト.,_chapter_section_subsection,_section_subsection,...みたいな感じ
-% \jlreq@BlockHeading@spaces@setlist@<見出し名リスト>
-% : 見出し名リストが続いたときの空き関連設定.<見出し名リスト>は_chapter_section_subsectionみたいなやつ.
-% {***}{***}...というリスト.各々の***は次のどれか.
-% 最初:全体への指定.{前空き}{後ろ空き}{行数}
-% _{前空き}{後ろ空き}{行数}:見出しに対する指定.先頭が_*の場合は,デフォルト設定をロードしてからということ.
-% それ以外:空き量
-% 最初や最後に空き量指定がある場合は,全体への指定に組み込むことにする.
-%
-% 現在状況保存に以下のマクロを使う
-% \jlreq@BlockHeading@spaces@current@sequence
-% : 現在どのような見出しが続いているかリスト.
-% \jlreq@BlockHeading@spaces@current@space@<n>
-% : 現在処理中のn番目の見出しに対する空き情報.{前空き}{後ろ空き}{トータル行数}{偶数ページbreak情報}.n=1から始まる.
-% \jlreq@BlockHeading@spaces@current@output@<n>
-% : 現在処理中のn番目の見出しの中身.
-% \jlreq@BlockHeading@spaces@current@format@<n>
-% : 現在処理中のn番目の見出しのフォーマット.行取りマクロを包み込むようにする.
-% \jlreq@BlockHeading@spaces@current@before@<n>
-% : n番目の見出しの前に出すもの
-% \jlreq@BlockHeading@spaces@current@after@<n>
-% : n番目の見出しの後ろに出すもの
-% \jlreq@BlockHeading@spaces@current@count
-% : 現在いくつ目の連続する見出しを処理しているかのカウンター
-\newcount\jlreq@BlockHeading@spaces@current@count
-\jlreq@BlockHeading@spaces@current@count=0
-\def\jlreq@BlockHeading@spaces@current@sequence{}
-\def\jlreq@BlockHeading@spaces@headingslist{}
-
-\newcommand{\SetBlockHeadingSpaces}[1]{%
- \begingroup
- % 現段階の情報をクリアする
- \@for\jlreq@tempa:=\jlreq@BlockHeading@spaces@headingslist\do{%
- \expandafter\let\csname jlreq@BlockHeading@spaces@setlist@\jlreq@tempa\endcsname=\@undefined
- }%
- \def\jlreq@BlockHeading@spaces@headingslist{}%
- \def\jlreq@tempa{}% 見出しリスト
- \def\jlreq@tempb{}% 設定リスト \def\jlreq@BlockHeading@spaces@***{{**}{**}...}ってのを入れる
- \jlreq@SetBlockHeadingSpaces#1\jlreq@endmark
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@BlockHeading@spaces@headingslist}{\expandonce{\jlreq@tempa}}%
- \expandonce{\jlreq@tempb}%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-\def\jlreq@SetBlockHeadingSpaces{% カンマを無視する処理
- \@ifnextchar,{\expandafter\jlreq@SetBlockHeadingSpaces@\@gobble}{\jlreq@SetBlockHeadingSpaces@}%
-}
-\def\jlreq@SetBlockHeadingSpaces@{%
- \@ifnextchar[{\jlreq@SetBlockHeadingSpaces@@}{\jlreq@SetBlockHeadingSpaces@@[]}%
-}
-\def\jlreq@SetBlockHeadingSpaces@@[#1]#2{%
- \jlreq@ifendmark{#2}{}{%
- \def\jlreq@headings{}% 見出し名リスト
- \jlreq@BlockHeading@gyodori@parsekeyval[BlockHeadingSpaces]{#1}{}{}{}%
- \let\jlreq@totalset=\jlreq@result% 上の#1に対応する設定
- \def\jlreq@set{}% 個々の設定
- \def\jlreq@lastdimen{}% 最後の寸法
- \def\jlreq@do##1##2##3{%
- \jlreq@ifempty{##1}{\jlreq@tempatrue}{\jlreq@tempafalse}% 前開きが空ならば\jlreq@tempatrue
- \jlreq@ifempty{##2}{\jlreq@tempbtrue}{\jlreq@tempbfalse}% 後ろ開きが空ならば\jlreq@tempbtrue
- }%
- \expandafter\jlreq@do\jlreq@totalset
- \jlreq@SetBlockHeadingSpaces@@@{#2}%
- \eappto\jlreq@tempa{,\expandonce{\jlreq@headings}}% \jlreq@tempaに\jlreq@headingsを追加
- \ifjlreq@tempb
- \ifx\jlreq@lastdimen\@empty\else % 最後が寸法だったので\jlreq@SetBlockHeadingSpaces@totalsetを改変
- \def\jlreq@do##1##2##3{%
- \edef\jlreq@totalset{{\unexpanded{##1}}{r:\expandonce{\jlreq@lastdimen}}{\unexpanded{##3}}}%
- }%
- \expandafter\jlreq@do\jlreq@totalset
- \fi
- \else
- \eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}%
- \fi
- \eappto\jlreq@tempb{%
- \noexpand\@ifundefined{jlreq@BlockHeading@spaces@setlist@\jlreq@headings}{}{%
- \noexpand\ClassError{jlrqe}{The spaces for \jlreq@headings\space is defined more than once (in SetBlockHeadingSpaces)}{\noexpand\@ehc}%
- }%
- \noexpand\def\expandonce{\csname jlreq@BlockHeading@spaces@setlist@\jlreq@headings\endcsname}{{\expandonce{\jlreq@totalset}}\expandonce{\jlreq@set}}%
- }%
- \jlreq@SetBlockHeadingSpaces
- }%
-}
-\def\jlreq@SetBlockHeadingSpaces@@@#1{%
- \@for\@tempa:=#1\do{%
- \expandafter\jlreq@iffirsttoken@ignorespaces\expandafter{\@tempa}{_}{%
- \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi%
- \def\jlreq@lastdimen{}%
- \expandafter\jlreq@SetBlockHeadingSpaces@@@@\@tempa{\jlreq@endmark}%
- }{%
- \ifjlreq@tempa
- % 最初が寸法なので,全体の設定(\jlreq@totalset)に組み込む.
- \def\jlreq@do##1##2##3{%
- \edef\jlreq@totalset{{r:\expandonce{\@tempa}}{\unexpanded{##2}}{\unexpanded{##3}}}%
- }%
- \expandafter\jlreq@do\jlreq@totalset
- \else
- \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi
- \let\jlreq@lastdimen=\@tempa
- \fi
- }%
- \jlreq@tempafalse
- }%
-}
-\def\jlreq@SetBlockHeadingSpaces@@@@#1#{%
- \expandafter\jlreq@ifcontains\expandafter{\@gobble #1}{_}{%
- \ClassWarning{jlreq}{Unusual heading name `\@gobble #1' is found. You forgot a comma? (in SetBlockHeadingSpaces)}%
- }{}%
- \jlreq@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)}%
- }}{}%
- \appto\jlreq@headings{#1}%
- \jlreq@SetBlockHeadingSpaces@@@@@
-}
-\def\jlreq@SetBlockHeadingSpaces@@@@@#1{%
- % 空っぽの場合は{_{r:0pt}{r:0pt}{}}
- \jlreq@ifendmark{#1}{\appto\jlreq@set{{_{r:0pt}{r:0pt}{}}}}{%
- \jlreq@iffirsttoken{#1}{*}{% *始まりの場合は{_*{}{}{}}
- \expandafter\jlreq@BlockHeading@gyodori@parsekeyval\expandafter{\@gobble #1}{}{}{}%
- \eappto\jlreq@set{{_*\expandonce{\jlreq@result}}}%
- }{% それ以外の場合は{_{}{}{}}
- \jlreq@BlockHeading@gyodori@parsekeyval{#1}{}{}{}%
- \eappto\jlreq@set{{_\expandonce{\jlreq@result}}}%
- }%
- \@gobble % \jlreq@endmarkを食う
- }%
-}
-
-% 現在の情報に基づき出力
-\def\jlreq@BlockHeading@spaces@output{%
- \@ifundefined{jlreq@BlockHeading@spaces@setlist@\jlreq@BlockHeading@spaces@current@sequence}{%
- \jlreq@BlockHeading@spaces@outputwospace
- }{%
- \expandafter\expandafter\expandafter\jlreq@BlockHeading@spaces@output@\csname jlreq@BlockHeading@spaces@setlist@\jlreq@BlockHeading@spaces@current@sequence\endcsname\jlreq@endmark
- }%
-}
-
-% 連続スペース情報とか無視して各々の見出しを出力する
-\def\jlreq@BlockHeading@spaces@outputwospace{%
- \begingroup
- \jlreq@tempcnta=0
- \def\jlreq@do{}%
- \jlreq@BlockHeading@spaces@outputwospace@
- \jlreq@BlockHeading@spaces@clear
- \expandafter\endgroup
- \jlreq@do
-}
-\def\jlreq@BlockHeading@spaces@outputwospace@{%
- \ifnum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count
- \advance\jlreq@tempcnta by 1
- \eappto\jlreq@do{\csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}}%
- \edef\jlreq@tempa{%
- \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
- }%
- \jlreq@tempa
- \edef\jlreq@tempb{%
- \noexpand\expandonce{\noexpand\jlreq@tempa{%
- \noexpand\jlreq@BlockHeading@start@gyodori
- \csexpandonce{jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
- {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
- }}%
- }%
- \eappto\jlreq@do{\jlreq@tempb\csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}}%
- \expandafter\jlreq@BlockHeading@spaces@outputwospace@
- \fi
-}
-
-\def\jlreq@BlockHeading@spaces@output@#1#2\jlreq@endmark{%
- \def\jlreq@result{}%
- \jlreq@tempcnta=0
- \jlreq@BlockHeading@spaces@output@@#2\jlreq@endmark
- \jlreq@tempatrue % 周りの行取り処理が必要か
- \jlreq@ifempty{#1}{\jlreq@tempafalse}{}%
- \ifthenelse{\equal{#1}{{}{}{}}}{\jlreq@tempafalse}{}%
- \edef\jlreq@do{%
- \ifjlreq@tempa
- \unexpanded{\jlreq@BlockHeading@start@gyodori#1}{*}{%
- \expandonce{\jlreq@result}%
- }%
- \else
- \expandonce{\jlreq@result}%
- \fi
- }%
- \jlreq@BlockHeading@spaces@clear
- \jlreq@do
-}
-% jlreq@resultに出力すべきものを入れていく
-\def\jlreq@BlockHeading@spaces@output@@#1{%
- \jlreq@ifendmark{#1}{}{%
- \jlreq@iffirsttoken@ignorespaces{#1}{_}{%
- \advance\jlreq@tempcnta by 1
- \expandafter\jlreq@BlockHeading@spaces@output@@@\expandafter{\@gobble #1}%
- }{%
- \appto\jlreq@result{\vskip\glueexpr #1\relax}%
- }%
- \jlreq@BlockHeading@spaces@output@@
- }%
-}
-\def\jlreq@BlockHeading@spaces@output@@@#1{%
- \edef\jlreq@do{%
- \noexpand\jlreq@BlockHeading@spaces@output@@@@
- \jlreq@iffirsttoken@ignorespaces{#1}{*}{{*}\expandonce{\@gobble #1}}{{}#1}%
- \csexpandonce{jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
- {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
- }%
- \jlreq@do
-}
-% #1: デフォルト値を使うならば*,#2#3#4が設定された値,#5#6#7がデフォルト値,#8は偶数ページの,#9が出力
-\def\jlreq@BlockHeading@spaces@output@@@@#1#2#3#4#5#6#7#8#9{%
- \edef\jlreq@tempa{%
- \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
- }%
- \jlreq@tempa
- \edef\jlreq@tempb{%
- \noexpand\expandonce{\noexpand\jlreq@tempa{%
- \noexpand\jlreq@BlockHeading@start@gyodori
- \jlreq@ifempty{#1}{\unexpanded{{#2}{#3}{#4}}}{%
- {\jlreq@ifempty{#2}{\unexpanded{#5}}{\unexpanded{#2}}}%
- {\jlreq@ifempty{#3}{\unexpanded{#6}}{\unexpanded{#3}}}%
- {\jlreq@ifempty{#4}{\unexpanded{#7}}{\unexpanded{#4}}}%
- }\unexpanded{{#8}{#9}}%
- }}%
- }%
- \eappto\jlreq@result{%
- \csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}%
- \jlreq@tempb
- \csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}%
- }%
-}
-
-% 連続見出しスペース調整用のデータをすべてクリアする
-\def\jlreq@BlockHeading@spaces@clear{%
- \begingroup
- \jlreq@tempcnta=0
- \@whilenum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count\do{%
- \advance\jlreq@tempcnta by 1
- \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta\endcsname=\@undefined
- \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta\endcsname=\@undefined
- \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta\endcsname=\@undefined
- \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta\endcsname=\@undefined
- }%
- \gdef\jlreq@BlockHeading@spaces@current@sequence{}%
- \global\jlreq@BlockHeading@spaces@current@count=0
- \endgroup
-}
-
-%.. 同行見出し
-% {1 = 命令名}{2 = レベル}{3 = ラベルフォーマット}{4 = ラベルありフォーマット}{5 = ラベルなしフォーマット}
-% 4,5は見出し文字列が#1になる.
-\long\def\jlreq@RuninHeading@start#1#2#3#4#5{%
- \edef\jlreq@RuninHeading@start@format@label{\unexpanded{#3}}%
- \edef\jlreq@RuninHeading@start@format@wlabel{\unexpanded{#4}}%
- \edef\jlreq@RuninHeading@start@format@wolabel{\unexpanded{#5}}%
- \@ifstar{\@dblarg{\jlreq@RuninHeading@start@{#1}{#2}{*}}}{\@dblarg{\jlreq@RuninHeading@start@{#1}{#2}{}}}%
-}
-% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}
-\long\def\jlreq@RuninHeading@start@#1#2#3[#4]#5{%
- \edef\jlreq@do{\noexpand\jlreq@RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}{\expandonce{\jlreq@RuninHeading@start@format@label}}{\expandonce{\jlreq@RuninHeading@start@format@wlabel}}{\expandonce{\jlreq@RuninHeading@start@format@wolabel}}}%
- \jlreq@do
-}
-% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}{6 = ラベルフォーマット}{7 = ラベルありフォーマット}{8 = ラベルなしフォーマット}
-\long\def\jlreq@RuninHeading@start@@#1#2#3#4#5#6#7#8{%
- \if@noskipsec\leavevmode\fi
- \begingroup
- \def\jlreq@do{\global\@noskipsectrue}%
- \ifnum0\jlreq@ifempty{#3}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0
- \def\jlreq@tempa##1{#8}%
- \else
- \appto\jlreq@do{\refstepcounter{#1}}%
- \def\jlreq@tempa##1{#7}%
- \fi
- \par
- \eappto\jlreq@do{%
- \noexpand\everypar{%
- \noexpand\if@noskipsec
- \unexpanded{\global\@noskipsecfalse}%
- \unexpanded{{\setbox\jlreq@tempboxa\lastbox}}%
- \noexpand\begingroup
- \expandonce{\jlreq@tempa{#5}}%
- \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{#3}{#6}{#4}%
- \noexpand\endgroup
- \noexpand\else
- \unexpanded{\everypar{}}%
- \noexpand\fi
- }%
- }%
- \expandafter\endgroup
- \jlreq@do
- \ignorespaces
-}
-
-% \DeclareRuninHeading{命令名}{レベル}{設定}
-\newcommand*{\DeclareRuninHeading}[3]{%
- \def\jlreq@do{\@removeelement{#1}}%
- \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}%
- \appto\jlreq@heading@allheadings{,#1}%
- \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
- \expandafter\edef\csname jlreq@heading@setting@#1\endcsname{\unexpanded{#3}}%
- \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewRuninHeading}%
- \@ifundefined{c@#1}{\newcounter{#1}}{}%
- \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
- \@ifundefined{l@#1}{\expandafter\def\csname l@#1\endcsname{\@dottedtocline{#2}{0\zw}{2\zw}}}{}%
- \jlreq@heading@make@maketoc{#1}{#2}%
- \begingroup
- \def\jlreq@font{\normalfont\normalsize}%
- \def\jlreq@indent{0\zw}%
- \def\jlreq@after@label@space{1\zw}%
- \def\jlreq@mark{}%
- \def\jlreq@label@font{}%
- \def\jlreq@label@format{\@seccntformat{#1}}%
- \def\jlreq@after@space{1\zw}%
- \jlreq@parsekeyval[RuninHeading:#1]{%
- {font}{\def\jlreq@font{##1}}
- {indent}{\def\jlreq@indent{##1}}
- {mark}{\def\jlreq@mark{##1}}
- {label_format}{\def\jlreq@label@format{##1}}
- {after_label_space}{
- \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_label_space in Runin Heading #1 should be not negative}\fi
- \def\jlreq@after@label@space{##1}
- }
- {after_space}{%
- \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_space in Runin Heading #1 should be not negative}\fi
- \def\jlreq@after@space{##1}%
- }
- }{#3}%
- \newif\ifjlreq@indent@zero
- \jlreq@ifgluezero{\glueexpr\jlreq@indent\relax}{\jlreq@indent@zerotrue}{\jlreq@indent@zerofalse}%
- \newif\ifjlreq@after@space@zero
- \jlreq@ifgluezero{\glueexpr\jlreq@after@space\relax}{\jlreq@after@space@zerotrue}{\jlreq@after@space@zerofalse}%
- \newif\ifjlreq@after@label@space@zero
- \jlreq@ifgluezero{\glueexpr\jlreq@after@label@space\relax}{\jlreq@after@label@spacefalse}%
- \edef\jlreq@format@wlabel{{%
- \ifjlreq@indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@indent}\noexpand\relax\fi
- \expandonce{\jlreq@font}%
- \expandonce{\jlreq@label@format}%
- \ifjlreq@after@label@space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@after@label@space}\noexpand\relax\fi
- ####1%
- \ifjlreq@after@space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@after@space}\noexpand\relax\fi
- }}%
- \edef\jlreq@format@wolabel{{%
- \ifjlreq@indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@indent}\noexpand\relax\fi
- \expandonce{\jlreq@font}%
- ####1%
- \ifjlreq@after@space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@after@space}\noexpand\relax\fi
- }}%
- \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
- \edef\jlreq@do{%
- \expandonce{\jlreq@result}%
- % パラメータトークンを含むので,\edefして\unexpandedで包む
- \noexpand\edef\expandonce{\csname #1\endcsname}{%
- \noexpand\unexpanded{%
- \unexpanded{\jlreq@hook@beforeheadings{#1}}%
- \unexpanded{\jlreq@RuninHeading@start{#1}{#2}}{\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@format@wlabel}}{\expandonce{\jlreq@format@wolabel}}%
- }%
- }%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-\newcommand*{\NewRuninHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareRuninHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\RenewRuninHeading}[3]{%
- \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareRuninHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\ProvideRuninHeading}[3]{%
- \@ifundefined{#1}{\DeclareRuninHeading{#1}{#2}{#3}}{}%
-}
-
-%.. 窓見出し
-\def\jlreq@CutinHeading@start#1#2#3#4#5#6#7{%
- \par
- \ifnum\hangafter=1
- \jlreq@CutinHeading@start@{#2}{#3}{#4}{#5}{#6}{#7}%
- \else
- \ClassError{jlreq}{Can not use \expandafter\string\csname#1\endcsname\space here}{\@ehc}%
- \fi
-}
-% 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト
-\def\jlreq@CutinHeading@start@#1#2#3#4#5#6{%
- % 一行で処理したときの見出し長さを計測
- \begingroup
- \setbox\@tempboxa=\hbox{#1#6}%
- \@tempdima=\wd\@tempboxa
- % 何行必要かを\jlreq@CutinHeading@linecountに入れる
- \ifdim\@tempdima>#5\def\jlreq@CutinHeading@linecount{3}%
- \else\ifdim\@tempdima>#4\def\jlreq@CutinHeading@linecount{2}%
- \else\def\jlreq@CutinHeading@linecount{1}\fi\fi
- % \@tempdimaが実際の一行の長さに近い
- \divide\@tempdima by \jlreq@CutinHeading@linecount
- % \jlreq@resultboxに見出し部分を,\jlreq@CutinHeading@linecountに見出し自身に何行使うかを入れる
- \ifnum\jlreq@CutinHeading@linecount=1\relax
- \setbox\jlreq@resultbox=\vbox{\parindent=0pt\rightskip=0pt\leftskip=0pt\hbox{#1#6}}%
- \def\jlreq@CutinHeading@linecount{2}%
- \else
- \jlreq@inlinenote@determinelength{#6}{#1}{}{\jlreq@CutinHeading@linecount}{\jlreq@CutinHeading@linecount}{\@tempdima}{\linewidth}%
- \def\jlreq@CutinHeading@linecount{3}%
- \fi
- % 普通の一行の高さ/深さに合わせて見出しのボックスを作る
- \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq@CutinHeading@linecount - 1\relax\baselineskip + 1\zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq@resultbox\vskip 0pt plus 1fill minus 1fill}%
- % 高さを通常の一行のそれにする
- \setbox\jlreq@tempboxa=\hbox{阿}%
- \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa - \ht\jlreq@tempboxa\relax
- \ht\@tempboxa=\ht\jlreq@tempboxa
- \noindent
- \hspace*{#2}%
- \copy\@tempboxa
- \hspace*{#3}%
- \par
- % でかい見出しボックスの分をキャンセルする空きを入れる
- % \baselineskip - \ht\jlreq@tempboxaはTeXが挿入するスキップの分
- \vskip -\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq@tempboxa\relax\relax
- \edef\jlreq@do{%
- \noexpand\hangindent=\the\dimexpr#2 + \wd\@tempboxa + #3\relax\relax
- \noexpand\hangafter=-\jlreq@CutinHeading@linecount\relax
- }%
- \expandafter\endgroup
- \jlreq@do
- \prevdepth=0pt
- % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す).
- \def\par{%
- \ifvmode\jlreq@tempatrue\else\jlreq@tempafalse\fi
- \jlreq@tempcnta=\hangafter\relax
- \jlreq@tempdima=\hangindent\relax
- \@@par
- \ifjlreq@tempa\else\advance\jlreq@tempcnta by \prevgraf\relax\fi
- \ifnum\jlreq@tempcnta<0
- \hangafter=\jlreq@tempcnta\relax
- \hangindent=\jlreq@tempdima\relax
- \else
- \@restorepar
- \fi
- }%
- \@afterindentfalse
- \@afterheading
- \ignorespaces
-}
-
-\newcommand*{\DeclareCutinHeading}[3]{%
- \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
- \expandafter\def\csname jlreq@heading@setting@#1\endcsname{#3}%
- \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewCutinHeading}%
- \begingroup
- \def\jlreq@fontcommand{\sffamily\bfseries}%
- \def\jlreq@onelinemax{6\zw}%
- \def\jlreq@twolinemax{20\zw}%
- \def\jlreq@indent{0\zw}%
- \def\jlreq@after@space{1\zw}%
- \jlreq@parsekeyval[CutinHeading:#1]{
- {font}{\def\jlreq@fontcommand{##1}}
- {onelinemax}{\def\jlreq@onelinemax{##1}}
- {twolinemax}{\def\jlreq@twolinemax{##1}}
- {indent}{\def\jlreq@indent{##1}}
- {after_space}{\def\jlreq@after@space{##1}}
- }{#3}%
- \ifthenelse{\lengthtest{\jlreq@after@space < 0.99\zw} \OR \lengthtest{\jlreq@after@space > 2.01\zw}}{%
- \jlreq@note{窓見出しと本文との空き量は,基本版面の文字サイズの全角以上,2倍未満とする (4.1.10.c).}%
- }{}%
- \edef\jlreq@do{%
- \noexpand\def\expandonce{\csname #1\endcsname}{%
- \noexpand\jlreq@CutinHeading@start{#1}{\expandonce{\jlreq@fontcommand}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@onelinemax}}{\expandonce{\jlreq@twolinemax}}%
- }%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-\newcommand*{\NewCutinHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareCutinHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\RenewCutinHeading}[3]{%
- \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareCutinHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\ProvideCutinHeading}[3]{%
- \@ifundefined{#1}{\DeclareCutinHeading{#1}{#2}{#3}}{}%
-}
-
-\newcommand{\ModifyHeading}[2]{%
- \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}%
- \edef\jlreq@do{\csexpandonce{jlreq@heading@type@#1}{#1}{\csexpandonce{jlreq@heading@level@#1}}{\csexpandonce{jlreq@heading@setting@#1},\unexpanded{#2}}}%
- \jlreq@do
-}
-% 見出し#1をマクロ#2に保存する
-\newcommand{\SaveHeading}[2]{%
- \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}%
- \edef#2{%
- \csexpandonce{jlreq@heading@type@#1}{\unexpanded{#1}}{\csexpandonce{jlreq@heading@level@#1}}{\csexpandonce{jlreq@heading@setting@#1}}%
- }%
-}
-
-\newcommand*{\jlreq@keepbaselineskip}[1]{%
- \begingroup
- \edef\jlreq@do{\unexpanded{#1}\noexpand\baselineskip=\the\baselineskip}%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\newcommand*\jlreq@HeadingType[1]{%
- \ifcsname jlreq@heading@type@#1\endcsname
- \jlreq@HeadingType@{#1}{\RenewTobiraHeading}{TobiraHeading}{%
- \jlreq@HeadingType@{#1}{\RenewBlockHeading}{BlockHeading}{%
- \jlreq@HeadingType@{#1}{\RenewRuninHeading}{RuninHeading}{%
- \jlreq@HeadingType@{#1}{\RenewCutinHeading}{CutinHeading}{%
- UnknownHeading}}}}%
- \else
- UndefinedHeading%
- \fi
-}
-\newcommand*\jlreq@HeadingType@[2]{%
- \expandafter\expandafter\expandafter\ifx\csname jlreq@heading@type@#1\endcsname#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
-}
-
-% 全ての見出しにマクロ#1を適用する.
-\def\jlreq@heading@execmacro@toallheadings#1{%
- \begingroup
- \def\jlreq@do{}%
- \ifx\jlreq@heading@allheadings\@undefined
- \jlreq@heading@execmacro@toallheadings@{#1}{chapter,part,section,subsection,subsubsection,paragraph,subparagraph}%
- \else
- \def\@tempa{\jlreq@heading@execmacro@toallheadings@{#1}}%
- \expandafter\@tempa\expandafter{\jlreq@heading@allheadings}%
- \fi
- \expandafter\endgroup
- \jlreq@do
-}
-
-\def\jlreq@heading@execmacro@toallheadings@#1#2{
- \@for\jlreq@tempa:=#2\do{%
- \@ifundefined{\jlreq@tempa}{}{%
- \eappto\jlreq@do{\noexpand#1{\expandonce{\jlreq@tempa}}}%
- }%
- }%
-}
-\def\jlreq@clearheadingmarks#1{%
- \@ifundefined{#1mark}{}{%
- \expandafter\let\csname#1mark\endcsname=\@gobble
- }%
-}
-
-%.. 各種定義
-\setcounter{secnumdepth}{3}
-\newcounter{part}
-\jlreq@switch{\jlreq@article@type}{
- {article}{\newcounter{section}}
- {\newcounter{chapter}\newcounter{section}[chapter]}% book, report
-}
-\newcounter{subsection}[section]
-\newcounter{subsubsection}[subsection]
-\newcounter{paragraph}[subsubsection]
-\newcounter{subparagraph}[paragraph]
-\renewcommand*{\@seccntformat}[1]{\csname the#1\endcsname}
-
-\if@tate
- \renewcommand{\thepart}{\jlreq@Kanji{part}}
- \ifthenelse{\equal{\jlreq@article@type}{article}}{}{\renewcommand{\thechapter}{\jlreq@Kanji{chapter}}}
- \renewcommand{\thesection}{\jlreq@rensuji{\@arabic\c@section}}
- \renewcommand{\thesubsection}{\jlreq@rensuji{\@alph\c@subsection}}
- \renewcommand{\thesubsubsection}{\jlreq@rensuji{\@arabic\c@subsubsection}}
- \renewcommand{\theparagraph}{(\jlreq@rensuji{\@arabic\c@paragraph})}
- \renewcommand{\thesubparagraph}{(\jlreq@rensuji{\@arabic\c@subparagraph})}
-
- \ifthenelse{\equal{\jlreq@article@type}{article}}{
- \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE}},indent=4\zw,lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
- \if@twoside\ModifyHeading{part}{allowbreak_if_evenpage=true}\fi
- }
- {% book, report
- \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\zw}},format={\null\vfill {\Huge\hspace*{2\zw}#1#2}\vspace*{2\jlreq@gol}}}
- \NewBlockHeading{chapter}{0}{indent=2\zw,lines=6,label_format={第\thechapter 章},font={\huge},after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\Large}}}
- \if@twoside\ModifyHeading{chapter}{allowbreak_if_evenpage=true}\fi
- \renewcommand{\thechapter}{\jlreq@Kanji{chapter}}
- }
- \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large}},indent=6\zw,lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
- \if@twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi
- \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large}},indent=8\zw,lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
- \if@twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi
- \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize}},indent=10\zw,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
- \if@twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi
- \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize}}}
- \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}},indent=1\zw}
-\else% yoko
- \renewcommand{\thepart}{\Roman{part}}
- \renewcommand{\thesubsection}{\thesection .\arabic{subsection}}
- \renewcommand{\thesubsubsection}{\thesubsection .\arabic{subsubsection}}
- \renewcommand{\theparagraph}{\thesubsubsection .\arabic{paragraph}}
- \renewcommand{\thesubparagraph}{\theparagraph .\arabic{subparagraph}}
- \ifthenelse{\equal{\jlreq@article@type}{article}}{
- \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\sffamily\bfseries}},label_format={第\thepart 部},lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
- \renewcommand{\thesection}{\arabic{section}}
- }
- {% book, report
- \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@gol}},format={\null\vfil {\Huge\sffamily\bfseries #1#2}\vfil}}
- \NewBlockHeading{chapter}{0}{%
- font={\jlreq@keepbaselineskip{\huge\sffamily\bfseries}},
- label_format={第\thechapter 章},
- lines=5,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},
- subtitle_font={\jlreq@keepbaselineskip{\Large}}}
- \renewcommand{\thechapter}{\arabic{chapter}}
- \renewcommand{\thesection}{\thechapter.\arabic{section}}
- }
- \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\sffamily\bfseries}},lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
- \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\sffamily\bfseries}},lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
- \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
- \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=1\zw}
- \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=2\zw}
-\fi
-
-\ifthenelse{\equal{\jlreq@article@type}{article}}{}{% book, report
- \if@openright
- \ModifyHeading{part}{type=naka}
- \if@tate
- \ModifyHeading{chapter}{pagebreak=begin_with_even_page}
- \else
- \ModifyHeading{chapter}{pagebreak=begin_with_odd_page}
- \fi
- \else
- \ModifyHeading{part}{type=han}
- \ModifyHeading{chapter}{pagebreak=clearpage}
- \fi
-}
-\jlreq@switch{\jlreq@article@type}{
- {book}{%
- \renewcommand{\jlreq@heading@maketoc@chapter}[3]{%
- \jlreq@ifempty{#1}{%
- \chaptermark{#3}%
- \ifnum0\if@mainmatter\else1\fi\ifnum\jlreq@heading@level@chapter>\c@secnumdepth 1\fi>0
- \addcontentsline{toc}{chapter}{#3}%
- \else
- \addcontentsline{toc}{chapter}{\protect\numberline{#2}#3}%
- \fi
- }{}%
- }
- }
- {report}{
- \renewcommand{\jlreq@heading@maketoc@chapter}[3]{%
- \jlreq@ifempty{#1}{%
- \chaptermark{#3}%
- \ifnum0\ifnum\jlreq@heading@level@chapter>\c@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)
-\newcommand*\jlreq@referencemark@format[1]{#1}
-\newif\ifjlreqadjustreferencemark
-\jlreqadjustreferencemarktrue
-\jlreq@jlreqsetup@add{reference_mark}[inline,interlinear]{
- \def\jlreq@referencemark{#1}
- \ifthenelse{\equal{\jlreq@referencemark}{inline}}{
- \def\jlreq@notemark##1{%
- \jlreq@ifydir{%
- \hbox{}\hbox{\@textsuperscript{\normalfont\jlreq@referencemark@format{##1}}}\hbox{}%
- }{%
- \setbox\@tempboxa=\hbox{\scriptsize\jlreq@referencemark@format{##1}}%
- \raise\dimexpr.5\jlreq@gol - \ht\@tempboxa\relax\box\@tempboxa
- }%
- }
- \def\jlreq@hook@prenote{\inhibitglue}
- \def\jlreq@hook@postnote{\inhibitglue}
- }{% reference_mark=interlinear
- \def\jlreq@notemark##1{{%
- \setbox\@tempboxa=\hbox{\scriptsize\jlreq@referencemark@format{##1}}%
- \@tempdima=\wd\@tempboxa
- % 行頭に来たときに頭を天にそろえる処理.
- \ifjlreqadjustreferencemark
- \jlreq@savepos@for@rest@linewidth
- \ifdim\jlreq@current@linewidth<\wd\@tempboxa
- \@tempdima=\jlreq@current@linewidth
- \fi
- \fi
- \setbox\jlreq@tempboxb=\hbox{阿}%
- \setbox\jlreq@tempboxa=\hbox to\z@{\hskip-\@tempdima\raise\dimexpr\ht\jlreq@tempboxb + \dp\@tempboxa\relax\box\@tempboxa\hss}%
- \dp\jlreq@tempboxa=0pt\ht\jlreq@tempboxa=0pt\box\jlreq@tempboxa%
- }}%
- \ifx l\jlreq@engine
- \def\jlreq@hook@prenote{%
- \jlreq@lastnodechar=\lastnodechar\relax
- \ifnum\lastnodechar>-1\inhibitglue\fi
- }
- \else
- % (u)platexの時は代入すると\inhibitglueが効かなくなる
- \def\jlreq@hook@prenote{%
- \ifnum\lastnodechar>-1\inhibitglue\fi
- \jlreq@lastnodechar=\lastnodechar\relax
- }
- \fi
- \def\jlreq@hook@postnote{\jlreq@fixjfm}
- }
-}
-\jlreqsetup{reference_mark=inline}
-% \@footnotemarkをシンプルなものにする
-\def\jlreq@setdefaultnotemark#1#2{%
- \def#1{%
- \leavevmode
- \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
- #2%
- \ifhmode\spacefactor\@x@sf\fi
- \relax}%
-}
-\jlreq@setdefaultnotemark\@footnotemark\@makefnmark
-
-%.. 脚注(4.2.5)
-% (縦書きの時は傍注,4.2.6)
-% 罫線の前は行間分,最大+文字サイズ分伸びる(4.2.5.g)
-\setlength{\skip\footins}{\dimexpr\baselineskip - 1\jlreq@gol \relax plus 1\jlreq@gol}
-% 罫線の長さは,基本版面で設定した行長にもよるが,行長の1/3くらいにする.
-\def\jlreq@footnote@rulewidth{.333\textwidth}
-\begingroup
- \footnotesize
- \edef\jlreq@do{
- \unexpanded{\setlength{\footnotesep}}{\the\dimexpr .7\baselineskip\relax}% 何でかわからん……
- \unexpanded{\def\footnoterule}{%
- % この罫線は,表罫(おもてけい)とする.
- \unexpanded{\hrule width \jlreq@footnote@rulewidth height \jlreq@omotekeiwidth}%
- % 脚注の行間よりやや広くする(4.2.5.f)
- \noexpand\kern\the\dimexpr 1.5\dimexpr\baselineskip - 1\zh\relax\relax
- }
- }
-\expandafter\endgroup
-\jlreq@do
-
-% インデントの計算:脚注の長さが文字の整数倍になるように字下げする(4.2.5.b)
-\jlreq@jlreqsetup@add{footnote_indent}{%
- \if@tate\else
- \ifdim\dimexpr#1\relax=0pt\else\jlreq@note{脚注は,一般にその前に区切りのための罫線を挿入するので,字下げは行わなくてよい(4.2.5.b).}\fi
- \fi
- \begingroup
- \footnotesize
- \jlreq@footnoteindent=\dimexpr#1\relax
- \@tempdima=\dimexpr\textwidth - \jlreq@footnoteindent\relax
- \@tempdimb=1\zw
- \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
- \edef\jlreq@do{\noexpand\jlreq@footnoteindent=\the\dimexpr\textwidth - \@tempdima\relax}%
- \expandafter\endgroup
- \jlreq@do
-}
-\if@tate
- \jlreqsetup{footnote_indent=1\zw}% 根拠なし
-\else
- \jlreqsetup{footnote_indent=0pt}% (4.2.5.b)
-\fi
-
-\newcommand{\@makefntext}[1]{\jlreq@makefntext{#1}}
-\jlreq@jlreqsetup@add{footnote_second_indent}{%
- \if@tate\else
- \ifthenelse{
- \( \lengthtest{0.99\zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < 1.01\zw} \) \OR
- \( \lengthtest{-1.01\zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < -0.99\zw} \)
- }{}{\jlreq@note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
- \fi
- \ifdim\dimexpr #1\relax<0pt
- \def\jlreq@makefntext{}
- \else
- \def\jlreq@makefntext{\addtolength{\leftskip}{\glueexpr #1\relax}}
- \fi
- \long\edef\jlreq@makefntext##1{\expandonce{\jlreq@makefntext}%
- \unexpanded{%
- \addtolength{\leftskip}{\jlreq@footnoteindent}%
- \parindent=1\zw
- \noindent
- \hskip-\glueexpr #1\relax
- \jlreq@referencemark@format{\@thefnmark}%
- \hskip\glueexpr 1\zw\relax
- }##1%
- }
-}
-\jlreqsetup{footnote_second_indent=1\zw}
-
-\jlreq@jlreqsetup@add{footnotetext_indent}{
- \ClassWarningNoLine{jlreq}{footnotetext_indent was removed}
-}
-
-\ifx l\jlreq@engine
- \fnfixbottomtrue
-\fi
-
-% \footnoteと\footnotemarkの前後に\jlreq@hook@prenote/\jlreq@hook@postnoteを入れる
-\jlreq@saveoriginalcs{\footnote}
-\jlreq@saveoriginalcs{\footnotemark}
-\def\footnote{%
- \jlreq@hook@prenote
- \@ifnextchar[{\jlreq@footnote@impl@woption}{\jlreq@footnote@impl@wooption}%
-}
-\def\footnotemark{%
- \jlreq@hook@prenote
- \@ifnextchar[{\jlreq@footnotemark@impl@woption}{\jlreq@footnotemark@impl@wooption}%
-}
-\if@tate
- % 縦組の傍注は,その見開き内に付いている合印に対応する注を,奇数ページの左端にそろえて配置する.多段組では最下段の左端にそろえて配置する.(4.2.6.a)
- % 必要ならば\footnoteを\footnotemarkと\footnotetextにわけ,\footnotetextをアウトプット時まで遅延することで実現する.
- \def\jlreq@footnote@delayfootnoteslist{}
- \preto\@opcol{%
- \expandafter\gdef\expandafter\jlreq@footnote@delayfootnoteslist\expandafter{\expandafter}%
- \jlreq@footnote@delayfootnoteslist
- }
- % \jlreq@footnote@delayfootnote@delay#1#2#3:#1ページ目に\footnotetext[#2]{#3}を出す
- % \jlreq@footnote@delayfootnote@page:何ページ目に\footnotetextを入れるかを\jlreq@resultcntに入れる.その場での場合は-1.
- \if@twocolumn
- \def\jlreq@footnote@delayfootnote@page{%
- \jlreq@setcurrentpage
- \jlreq@resultcnt=\numexpr\jlreq@currentpage\ifodd\jlreq@currentpage\else + 1\fi\relax
- % このページに表示&上の段処理済みだと\output内では間に合わない
- \ifnum\jlreq@resultcnt=\value{page}\if@firstcolumn\else\jlreq@resultcnt=-1 \fi\fi
- }
- \long\def\jlreq@footnote@delayfootnote@delay#1#2#3{%
- % 二段組みの場合は上段を組んだ直後に\footnotetextを挿入(そのページの下段に入る)
- \ifnum 0\if@firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0
- \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}{#3}}}%
- \else
- \footnotetext[#2]{#3}%
- \fi
- }
- \else
- \def\jlreq@footnote@delayfootnote@page{%
- \jlreq@setcurrentpage
- \ifodd\jlreq@currentpage
- \jlreq@resultcnt=-1
- \else
- \jlreq@resultcnt=\numexpr\jlreq@currentpage+1\relax
- \fi
- }
- \long\def\jlreq@footnote@delayfootnote@delay#1#2#3{%
- % 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入.
- \ifnum\numexpr#1 - 1\relax>\value{page}%
- \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}{#3}}}%
- \else
- \footnotetext[#2]{#3}%
- \fi
- }
- \fi
- \def\jlreq@footnote@delayfootnote@immediate#1#2#3{%
- \ifnum #1<\jlreq@currentpage
- \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}{#3}}}%
- \else
- \footnotetext[#2]{#3}%
- \fi
- }
- \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@delay
- \def\jlreq@footnote@flushdelayfootnoteslist{%
- \ifx\jlreq@footnote@delayfootnoteslist\@empty\else
- \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@immediate
- \jlreq@setcurrentpage
- \expandafter\gdef\expandafter\jlreq@footnote@delayfootnoteslist\expandafter{\expandafter}%
- \jlreq@footnote@delayfootnoteslist
- \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@delay
- \fi
- }
- \AtEndDocument{\jlreq@footnote@flushdelayfootnoteslist}
- \preto\newpage{\jlreq@footnote@flushdelayfootnoteslist}
- \long\def\jlreq@footnote@impl@woption[#1]#2{%
- \jlreq@footnote@delayfootnote@page
- \ifnum\jlreq@resultcnt=-1
- \jlreq@useoriginalcs{\footnote}[#1]{#2}%
- \else
- \jlreq@useoriginalcs{\footnotemark}[#1]%
- \xappto\jlreq@footnote@delayfootnoteslist{\noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{\unexpanded{#1}}{\unexpanded{#2}}}%
- \fi
- \jlreq@hook@postnote
- }
- \long\def\jlreq@footnote@impl@wooption#1{%
- \jlreq@footnote@delayfootnote@page
- \ifnum\jlreq@resultcnt=-1
- \jlreq@useoriginalcs{\footnote}{#1}%
- \else
- \jlreq@useoriginalcs{\footnotemark}%
- \xappto\jlreq@footnote@delayfootnoteslist{\noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{\the\value{footnote}}{\unexpanded{#1}}}%
- \fi
- \jlreq@hook@postnote
- }
-\else
- \long\def\jlreq@footnote@impl@woption[#1]#2{%
- \jlreq@useoriginalcs{\footnote}[#1]{#2}%
- \jlreq@hook@postnote
- }
- \long\def\jlreq@footnote@impl@wooption#1{%
- \jlreq@useoriginalcs{\footnote}{#1}%
- \jlreq@hook@postnote
- }
-\fi
-\long\def\jlreq@footnotemark@impl@woption[#1]{%
- \jlreq@useoriginalcs{\footnotemark}[#1]%
- \jlreq@hook@postnote
-}
-\long\def\jlreq@footnotemark@impl@wooption{%
- \jlreq@useoriginalcs{\footnotemark}%
- \jlreq@hook@postnote
-}
-
-% 合印
-\renewcommand*{\@makefnmark}{%
- \jlreq@ifydir{\jlreq@notemark{\@thefnmark}}{\hbox{\jlreq@notemark{\@thefnmark}}}%
-}
-% 4.2.2注3
-\if@tate
- \renewcommand*{\thefootnote}{\jlreq@open@bracket@before@space\inhibitglue(\jlreq@rensuji{\@arabic\c@footnote})\inhibitglue}
-\else
- \renewcommand*{\thefootnote}{\arabic{footnote}\hbox{})\inhibitglue}
-\fi
-\ifthenelse{\equal{\jlreq@article@type}{article}}{}{\@addtoreset{footnote}{chapter}}
-
-
-%.. 後注(4.2.4)
-\def\jlreq@endnotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
-\def\jlreq@endnotecounter{footnote}% 後注用のカウンタ名
-% 文字サイズは\footnotesizeを使う
-\newdimen\jlreq@endnote@prepostspace
-% 前の分との間は行間分空ける(4.2.4.f)
-\jlreq@endnote@prepostspace=\dimexpr\baselineskip - 1\jlreq@gol\relax
-\newdimen\jlreq@endnote@indent
-% 現在の後注一覧を,\jlreq@endnote@textsに{{合印1}{後注1}}{{合印2}{後注2}}...の形で保持する
-\def\jlreq@endnote@texts{}
-\long\def\jlreq@endnote@addtext#1#2{\xappto\jlreq@endnote@texts{\unexpanded{{{#1}{#2}}}}}
-% \endnote自身は後で定義する
-\def\jlreq@endnote@impl{\jlreq@hook@prenote\@ifnextchar[{\jlreq@endnote}{\jlreq@endnote[]}}
-\def\endnotemark{\jlreq@hook@prenote\@ifnextchar[{\jlreq@endnotemark}{\jlreq@endnotemark[]}}
-\def\endnotetext{\@ifnextchar[{\jlreq@endnotetext}{\jlreq@endnotetext[]}}
-\long\def\jlreq@endnote[#1]#2{\jlreq@endnotemark[#1]\@endnotetext{#2}\jlreq@hook@postnote}
-\def\jlreq@endnotemark[#1]{%
- \jlreq@ifempty{#1}{%
- \stepcounter{\jlreq@endnotecounter}%
- \expandafter\protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq@endnotecounter\endcsname #1\relax
- \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
- \endgroup
- }%
- \@endnotemark
- \jlreq@hook@postnote
-}
-\jlreq@setdefaultnotemark\@endnotemark\@makeendmark
-\long\def\jlreq@endnotetext[#1]#2{%
- \jlreq@ifempty{#1}{%
- \expandafter\protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq@endnotecounter\endcsname #1\relax
- \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
- \endgroup
- }%
- \@endnotetext{#2}%
-}
-\long\def\@endnotetext#1{%
- \expandafter\let\expandafter\jlreq@tempa\expandafter=\csname\jlreq@endnotemarkname\endcsname
- \expandafter\jlreq@endnote@addtext\expandafter{\jlreq@tempa}{#1}%
-}
-\long\def\jlreq@theendnotes#1{%
- \jlreq@ifendmark{#1}{}{%
- \jlreq@output@endnotes#1
- \jlreq@theendnotes
- }%
-}
-\long\def\jlreq@output@endnotes#1#2{%
- \expandafter\def\csname\jlreq@endnotemarkname\endcsname{#1}%
- \item\@makeendtext{#2}%
-}
-
-\newcommand*{\theendnotes}{%
- \ifx\jlreq@endnote@texts\@empty\else
- \let\jlreq@tempa=\jlreq@endnote@texts
- \gdef\jlreq@endnote@texts{}%
- \edef\jlreq@endnote@beforeafterspace{\the\dimexpr\baselineskip - 1\jlreq@gol\relax plus \the\dimexpr 1\jlreq@gol\relax}%
- \begingroup
- \par
- \footnotesize
- % 後注の長さを文字サイズの整数倍にする(4.2.4.b)
- \jlreq@tempdima=\dimexpr\linewidth - \jlreq@endnote@indent - \leftskip\relax
- \@tempdimb=1\jlreq@mol
- \divide\jlreq@tempdima\@tempdimb\multiply\jlreq@tempdima\@tempdimb
- \begin{list}{}{%
- \itemsep=0pt\relax
- \parsep=0pt\relax
- \partopsep=0pt\relax
- \topsep=0pt\relax
- \leftmargin=\dimexpr\linewidth - \jlreq@tempdima + \jlreq@endnote@second@indent\relax
- \itemindent=0pt\relax
- \topsep=\jlreq@endnote@beforeafterspace
- }%
- \expandafter\jlreq@theendnotes\jlreq@tempa\jlreq@endmark
- \end{list}
- \endgroup
- \par
- \fi
-}
-% 4.2.4.b
-\jlreq@endnote@indent=2\jlreq@mol
-\jlreq@jlreqsetup@add{endnote_second_indent}{
- \def\jlreq@endnote@second@indent{#1}
- \ifthenelse{
- \( \lengthtest{0.99\zw < #1} \AND \lengthtest{#1 < 1.01\zw} \) \OR
- \( \lengthtest{1.99\zw < #1} \AND \lengthtest{#1 < 2.01\zw} \)
- }{}{\jlreq@note{後注が2行以上となった場合,後注の2行目以下の字下げは,1行目より,後注の文字サイズの2倍又は全角とする (4.2.4.d).}}
-}
-\jlreqsetup{endnote_second_indent=2\zw}
-\newcommand{\@makeendtext}[1]{\parindent 1\zw
- \hskip\glueexpr-\jlreq@endnote@second@indent\relax\csname\jlreq@endnotemarkname\endcsname\hskip\glueexpr1\zw\relax#1}% 見出し出力と一文字分の空き(4.2.4.c)
-\let\@makeendmark=\@makefnmark
-
-% \theendnoteの出力を仕込む
-\apptocmd{\jlreq@hook@beforeheadings}{\jlreq@endnote@hook@beforeheadings{#1}}{}{}
-
-\jlreq@jlreqsetup@add{endnote_position}{
- \def\jlreq@endnote@hook@beforeheadings##1{}
- \jlreq@tempafalse % headingsが指定された
- \jlreq@tempbfalse % paragraphが指定された
- % \jlreq@tempcにセクション名たちを入れていく
- \def\jlreq@tempc{}
- \@for\jlreq@tempa:=#1\do{
- \jlreq@switch{\jlreq@tempa}{
- {headings}{\jlreq@tempatrue}
- {paragraph}{
- \jlreq@tempatrue% _paragraphの時は_headingsも有効にする
- \jlreq@tempbtrue
- }
- {
- \expandafter\jlreq@iffirsttoken@ignorespaces\expandafter{\jlreq@tempa}{_}{
- \edef\jlreq@tempc{\jlreq@tempc,\expandafter\@gobble\jlreq@tempa}
- }{
- \ClassError{jlreq}{Invalid value \jlreq@tempa\space in endnote_position}{\@ehc}
- }
- }
- }
- }
-
- \ifjlreq@tempb
- \edef\endnote{\unexpanded{\def\par{\@restorepar\theendnotes\par}}\expandonce{\jlreq@endnote@impl}}
- \else
- \let\endnote=\jlreq@endnote@impl
- \fi
-
- \ifjlreq@tempa
- \apptocmd{\jlreq@endnote@hook@beforeheadings}{\theendnotes}{}{}
- \else
- \@for\@tempa:=\jlreq@tempc\do{
- \ifx\@tempa\@empty\else
- \edef\jlreq@do{%
- \unexpanded{\def\jlreq@endnote@hook@beforeheadings##1}{\expandonce{\jlreq@endnote@hook@beforeheadings{##1}}%
- \unexpanded{\def\@tempa}{\@tempa}\unexpanded{\def\@tempb{##1}}%
- \unexpanded{\ifx\@tempa\@tempb\theendnotes\fi}%
- }
- }
- \jlreq@do
- \fi
- }
- \fi
-}
-\jlreqsetup{endnote_position=headings}
-\AtEndDocument{\theendnotes}
-
-
-% (1) \footnoteとかと同じ形式 sidenote_type=number
-% (2) 文中にマークを入れて,傍注には見出しが入る sidenote_type=symbol
-% (3) 文中は強調文字列,傍注には見出しが入る sidenote_type=symbol
-% (4) 文中は何も無し,傍注には見出しが入る sidenote_type=symbol
-
-% (1) では\sidenote[]{}を定義
-% (2) では\sidenote{見出し}{注中身}を定義
-% \marginparwidth>0ptの時のみ定義する
-\ifdim\marginparwidth>0pt \expandafter\@firstofone\else\expandafter\@gobble\fi
-{
- \def\jlreq@sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
- \long\def\@sidenotetext#1{%
- \marginpar{\reset@font\footnotesize
- \color@begingroup
- \@makesidetext{#1}%
- \color@endgroup
- }%
- }
- \jlreq@setdefaultnotemark\@sidenotemark\@makesidemark
- \def\jlreq@sidenotecounter{footnote}% 傍注用のカウンタ名
- \jlreq@jlreqsetup@add{sidenote_type}[number,symbol]{\def\jlreq@sidenote@type{#1}}
- \jlreqsetup{sidenote_type=number}
- \jlreq@jlreqsetup@addtofinally{
- \ifthenelse{\equal{\jlreq@sidenote@type}{number}}{
- \def\sidenote{\jlreq@hook@prenote\@ifnextchar[{\jlreq@sidenote}{\jlreq@sidenote[]}}
- \def\sidenotemark{\jlreq@hook@prenote\@ifnextchar[{\jlreq@sidenotemark}{\jlreq@sidenotemark[]}}
- \def\sidenotetext{\@ifnextchar[{\jlreq@sidenotetext}{\jlreq@sidenotetext[]}}
- \long\def\jlreq@sidenote[#1]#2{\jlreq@sidenotemark[#1]\@sidenotetext{#2}\jlreq@hook@postnote}
- \def\jlreq@sidenotemark[#1]{%
- \jlreq@ifempty{#1}{%
- \stepcounter{\jlreq@sidenotecounter}%
- \expandafter\protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq@sidenotecounter\endcsname #1\relax
- \expandafter\unrestored@protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
- \endgroup
- }%
- \@sidenotemark
- \jlreq@hook@postnote
- }
- \long\def\jlreq@sidenotetext[#1]#2{%
- \jlreq@ifempty{#1}{%
- \expandafter\protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq@sidenotecounter\endcsname#1\relax
- \expandafter\unrestored@protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
- \endgroup
- }%
- \@sidenotetext{#2}%
- }
- % \hspace{0.5\jlreq@mol}の部分は二分空きにする例もある(4.2.7.g)
- \ifx l\jlreq@engine
- \long\def\@makesidetext#1{\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
- \else
- % thefootnote = \inhibitglue (...だと\inhibitglueが効かないので空白を挟む
- \long\def\@makesidetext#1{ \kern-1\zw\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
- \fi
- \let\@makesidemark=\@makefnmark
- }{% sidenote_type = symbol
- \long\def\sidenote#1#2{\jlreq@sidenote{#1}{#2}}
- \def\sidenotemark#1{\jlreq@sidenotemark{#1}}
- \long\def\sidenotetext#1#2{\jlreq@sidenotetext{#1}{#2}}
- \long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\jlreq@sidenotetext{#1}{#2}}
- \edef\jlreq@sidenotemark#1{%
- {\unexpanded{\reset@font\jlreq@sidenote@keywordfont}#1}%
- \noexpand\jlreq@hook@prenote
- \ifx\jlreq@sidenote@defaultmark\@empty\else
- \expandafter\edef\expandonce{\csname\jlreq@sidenotemarkname\endcsname}{\expandonce{\jlreq@sidenote@defaultmark}}%
- \noexpand\@sidenotemark
- \fi
- }
- % カスタマイズできるべき?
- \long\def\jlreq@sidenotetext#1#2{%
- \expandafter\def\csname\jlreq@sidenotemarkname\endcsname{\inhibitglue\null{\reset@font\sffamily\bfseries\inhibitglue #1}}%
- \@sidenotetext{#2}%
- }
- \long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1}
- \let\@makesidemark=\@makefnmark
-
- \apptocmd{\sidenote}{\jlreq@hook@postnote}{}{}
- \apptocmd{\sidenotemark}{\jlreq@hook@postnote}{}{}
- }
- }
- \jlreq@jlreqsetup@add{sidenote_symbol}{\def\jlreq@sidenote@defaultmark{#1}}
- \jlreq@jlreqsetup@add{sidenote_keyword_font}{\def\jlreq@sidenote@keywordfont{#1}}
- \jlreqsetup{sidenote_symbol=*,sidenote_keyword_font={}}
-}
-
-%.. 割注(3.4)
-\def\inlinenotesize{.6\jlreq@jafontsize} % 割注の文字サイズ
-\let\jlreq@inlinenote@autolinebreak=\\% 計測時は\linebreakより\\の方が安定する.悩ましい…….
-
-\newcommand{\jlreq@inlinenote@kakkofontsize}{%
- \fontsize{\dimexpr\inlinenotesize * 2\relax}{\dimexpr \inlinenotesize * 2\relax}%
- \selectfont
-}
-
-\newcommand{\jlreq@inlinenote@fontsize}{%
- \fontsize{\inlinenotesize}{\inlinenotesize}%
- \selectfont
-}
-
-% 割注を入れるための命令.\inlinenote{割注}で使う.
-% 改行位置は自動で計算されるが,常に正しいとは限らない.
-% \inlinenote*は自動で改行されない.\\で改行位置を指定する.
-\newif\ifjlreq@in@inlinenote
-\jlreq@in@inlinenotefalse
-\newcommand*{\inlinenote}{%
- \ifjlreq@in@inlinenote\ClassError{jlreq}{\string\inlinenote\space can't be nested}{\@ehc}\fi
- \jlreq@in@inlinenotetrue
- \ifvmode\leavevmode\fi
- \@ifstar\jlreq@inlinenote@noauto\jlreq@inlinenote@auto}
-\let\warichu=\inlinenote
-
-\newcommand*{\jlreq@inlinenote@auto}[1]{%
- % 割注初め括弧の前の場所を保存
- \jlreq@savepos@for@rest@linewidth
- % \jlreq@tempdimbに,現在行の残り長さを入れる
- \jlreq@tempdimb=\jlreq@rest@linewidth
- % 括弧の分を引いたものが,割注の使える長さ
- \setbox\@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue\jlreq@open@bracket@before@space(\inhibitglue}%
- \addtolength{\jlreq@tempdimb}{-\wd\@tempboxa}%
- \ifdim\jlreq@tempdimb<0pt\jlreq@tempdimb=\linewidth\fi
- {%
- \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue \jlreq@open@bracket@before@space(}%
- \jlreq@box@putcenter\jlreq@tempboxa
- }%
- % 「初回」時はここに強制改行を入れる.これにより現在位置の取得がより正しくなる……といいなぁ
- \jlreq@savepos@iflabelundefined{\\}{}%
- % 割注内の\baselineskipを保存(後で使う).
- {\jlreq@inlinenote@fontsize\xdef\jlreq@inlinenote@baselineskip{\the\baselineskip}}%
- % 普通に並べた長さを計測し,その半分から始める
- \setbox\@tempboxa=\hbox{\jlreq@inlinenote@fontsize #1}%
- \jlreq@tempdimc=\wd\@tempboxa
- \divide\jlreq@tempdimc by 2\relax
- % \@tempcntbに,この長さで計測した場合の行数を入れる
- \ifdim\jlreq@tempdimc<\jlreq@tempdimb\@tempcntb=2\relax
- \else
- \jlreq@tempdima=\dimexpr\jlreq@tempdimc - \jlreq@tempdimb\relax
- \divide\jlreq@tempdima\linewidth
- \@tempcntb=\number\jlreq@tempdima
- \multiply\@tempcntb by 2\relax
- \advance\@tempcntb by 4\relax
- \fi
- % \jlreq@parshapeargに\parshapeに指定する書式の最後以外を入れる.
- \ifnum\@tempcntb>2\relax
- \edef\jlreq@parshapearg{0pt \the\jlreq@tempdimb\space 0pt \the\jlreq@tempdimb}%
- \@tempcnta=4\relax
- \@whilenum\@tempcnta<\@tempcntb\do{%
- \edef\jlreq@parshapearg{\jlreq@parshapearg\space 0pt \the\linewidth\space 0pt \the\linewidth}%
- \advance\@tempcnta by 2\relax
- }%
- \setlength{\jlreq@tempdimc}{\dimexpr\jlreq@tempdimc - \jlreq@tempdimb - \linewidth * \numexpr(\@tempcntb - 4)/2\relax\relax}%
- \else
- \def\jlreq@parshapearg{}%
- \fi
- % 行数を伸ばしつつ良いところを探していく
- \@whilenum\@tempcntb<1001\do{%
- \ifnum\@tempcntb>2\jlreq@tempdimb=\linewidth\fi
- \edef\@tempb{\the\@tempcntb}%
- \jlreq@inlinenote@determinelength{#1}{\jlreq@inlinenote@fontsize}{\jlreq@parshapearg}{2}{\@tempb}{\jlreq@tempdimc}{\jlreq@tempdimb}%
- \@tempcntb=\@tempb
- \ifnum\@tempcntb>999\relax% ループが長すぎる
- \global\setbox\jlreq@resultbox=\voidb@x%
- \@tempcntb=1001\relax
- \fi
- \ifvoid\jlreq@resultbox\else% 成功
- \edef\jlreq@inlinenote@lines{\the\@tempcntb}% 行数を保存
- \@tempcntb=1001\relax
- \fi
- \advance\@tempcntb by 2\relax
- \edef\jlreq@parshapearg{\jlreq@parshapearg 0pt \the\jlreq@tempdimb 0pt \the\jlreq@tempdimb}%
- }%
- \ifvoid\jlreq@resultbox
- \ClassWarning{jlreq}{\string\warichu\space failed, may be a bug}%
- \else
- \@tempcnta=0
- \splittopskip=0pt\relax
- \splitmaxdepth=\maxdimen
- % 現在行の残り長さを思い出す
- \jlreq@tempdimb=\jlreq@rest@linewidth
- \setbox\@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue\jlreq@open@bracket@before@space(\inhibitglue}%
- \addtolength{\jlreq@tempdimb}{-\wd\@tempboxa}%
- \setbox\@tempboxa=\box\jlreq@resultbox
- \@whilenum\@tempcnta<\jlreq@inlinenote@lines\do{%
- \ifnum\@tempcnta>0 \jlreq@inlinenote@autolinebreak\fi
- % \jlreq@tempdimaに今の行の長さを入れる
- \ifnum\@tempcnta<\numexpr\jlreq@inlinenote@lines - 2\relax
- \ifnum\@tempcnta=0\jlreq@tempdima=\jlreq@tempdimb
- \else\jlreq@tempdima=\linewidth\fi
- \else
- % 最終行は自然長に任せる
- \jlreq@tempdima=-1pt\relax
- \fi
- {%
- \edef\@tempa{\the\vbadness}%
- \vbadness=10000
- \setbox\jlreq@tempboxa=\vsplit\@tempboxa to \dimexpr\jlreq@inlinenote@baselineskip*2\relax
- \vbadness=\@tempa\relax
- \jlreq@getlastbox{\jlreq@tempboxa}%
- \setbox\jlreq@tempboxb=\box\jlreq@resultbox
- \jlreq@getlastbox{\jlreq@tempboxa}%
- \setbox\jlreq@tempboxa=\box\jlreq@resultbox
- \ifdim\jlreq@tempdima>0pt\relax
- \setbox\jlreq@tempboxa=\vbox{\jlreq@inlinenote@fontsize
- \hbox to \jlreq@tempdima{\unhbox\jlreq@tempboxa}%
- \hbox to \jlreq@tempdima{\unhbox\jlreq@tempboxb}}%
- \else
- \setbox\jlreq@tempboxa=\vbox{\jlreq@inlinenote@fontsize
- \hbox{\unhbox\jlreq@tempboxa}%
- \hbox{\unhbox\jlreq@tempboxb}}%
- \fi
- \jlreq@box@putcenter\jlreq@tempboxa
- }%
- \advance\@tempcnta by 2\relax
- }%
- \fi
- \jlreq@inlinenote@endnote
-}
-
-\newcommand*{\jlreq@inlinenote@noauto}[1]{%
- \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue\jlreq@open@bracket@before@space(}%
- \inhibitglue\jlreq@box@putcenter\jlreq@tempboxa
- \jlreq@inlinenote@noauto@#1\\\jlreq@endmark\jlreq@endmark
- \jlreq@inlinenote@endnote
-}
-
-\def\jlreq@inlinenote@noauto@#1\\#2#3\jlreq@endmark{%
- \jlreq@inlinenote@noauto@@#1&\jlreq@endmark\jlreq@endmark
- \jlreq@ifendmark{#2}{}{\linebreak\jlreq@inlinenote@noauto@#2#3\jlreq@endmark}%
-}
-
-\def\jlreq@inlinenote@noauto@@#1&#2#3\jlreq@endmark{%
- \jlreq@ifendmark{#2}{%
- \setbox\@tempboxa=\hbox{\jlreq@inlinenote@fontsize #1}%
- \jlreq@tempdimc=\wd\@tempboxa
- \divide\jlreq@tempdimc by 2\relax
- \jlreq@inlinenote@determinelength{#1}{\jlreq@inlinenote@fontsize}{}{2}{2}{\jlreq@tempdimc}{\maxdimen}%
- \ifvoid\jlreq@resultbox\else
- {%
- \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@fontsize\box\jlreq@resultbox}%
- \jlreq@box@putcenter\jlreq@tempboxa
- }%
- \fi
- \def\jlreq@next{}%
- }{%
- \def\jlreq@next{\jlreq@inlinenote@noauto@@@{#1}#2#3}%
- }%
- \jlreq@next
-}
-
-\def\jlreq@inlinenote@noauto@@@#1#2&\jlreq@endmark{%
- \setbox\@tempboxa=\hbox{\jlreq@inlinenote@fontsize\vbox{\hbox{#1}\hbox{#2}}}%
- \jlreq@box@putcenter\@tempboxa
-}
-
-\newcommand{\jlreq@inlinenote@endnote}{%
- \jlreq@in@inlinenotefalse
- {%
- \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize)}%
- \jlreq@box@putcenter\jlreq@tempboxa
- \inhibitglue
- }%
-}
-
-% \jlreq@inlinenote@determinelength{テキスト(1)}{フォントとか指定(2)}{\parshape指定(3)}{調整に使う行数(4)}{成功行数(5)}{最小長さ(6)}{最大長さ(7)}
-% 次を満たす長さXの最小値を求める(ただし#6 <= X <= #7)
-% #1を
-% * #5 - #4行目までは#3の指定に従う
-% * それ以降はX
-% として整形した際に,#5行以内に収まる.
-% \jlreq@resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
-\newcommand{\jlreq@inlinenote@determinelength}[7]{%
-% \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
- \@tempcnta=1\relax
- \def\@tempa{}%
- % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq@tempdima.
- \@whilenum\@tempcnta<#4\do{%
- \expandafter\def\expandafter\@tempa\expandafter{\@tempa 0pt \the\jlreq@tempdima}%
- \advance\@tempcnta by 1\relax
- }%
- \@tempcnta=0
- \jlreq@tempdima=#6\relax
- % \jlreq@tempdimaを少しずつ伸ばしていく
- \@whilenum\@tempcnta<1000\do{%
- \ifnum\@tempcnta>999\relax% ループが長すぎる
- \global\setbox\jlreq@resultbox=\voidb@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@tempdima = \the\jlreq@tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}%
- \fi
- \jlreq@getlastbox{\@tempboxa}%
- \setbox\jlreq@tempboxa=\box\jlreq@resultbox
- \ifnum\@tempcntb<#5\relax% 行数が達していないならOK
-% \message{行数 = \the\@tempcntb により確定}
- % #5行になるまで空の水平ボックスを加えていく.
- \global\setbox\jlreq@resultbox=\vbox{#2%
- \unvbox\@tempboxa\hbox{\unhbox\jlreq@tempboxa\unskip\unskip\unpenalty}%
- \@whilenum\@tempcntb<#5\do{\hbox{}\advance\@tempcntb by 1}}%
- \@tempcnta=1001\relax
- \else
- % そうでない場合は最後の二行の長さを比較する
- \jlreq@getlastbox{\@tempboxa}%
- \setbox\jlreq@tempboxb=\box\jlreq@resultbox
-% \message{最終行の長さ \the\wd\jlreq@tempboxa, その前の長さ \the\wd\jlreq@tempboxb}%
- \ifdim\wd\jlreq@tempboxa>\wd\jlreq@tempboxb
- \advance\jlreq@tempdima by 0.3pt\relax% 0.3ptに意味はない
- \else
- % 後ろが短いのでOK
- \global\setbox\jlreq@resultbox=\vbox{#2\unvbox\@tempboxa\box\jlreq@tempboxb\box\jlreq@tempboxa}%
- \jlreq@resultdimen=\jlreq@tempdima
- \@tempcnta=1001\relax
- \fi
- \fi
- \ifdim\jlreq@tempdima>#7\relax
- \global\setbox\jlreq@resultbox=\box\voidb@x
- \@tempcnta=1001\relax
- \fi
- \advance\@tempcnta by 1\relax
- }%
-}
-
-%. ページスタイル.
-% メモ:
-% 2.6.1.cの後半が前半と整合的でないように見える……
-% 柱:両柱と片柱(2.6.3)
-\@tempdima=\jlreq@speciallength{\jlreq@headfoot@sidemargin}
-\ifthenelse{\lengthtest{\@tempdima=0pt} \OR \(\lengthtest{0.99\zw < \@tempdima} \AND \lengthtest{\@tempdima < 1.01\zw}\)}{}{
- \jlreq@note{ノンブルまたは柱は,基本版面の左右にそろえるか,全角アキだけ寄せた位置に配置する (2.6.1.b).}
-}
-
-% bottom-leftみたいなのを解釈する.入力の順番はどっちでも良いが,出力は<top/bottom><left/right>の順番
-% #1 = bottom-leftみたいなのを{bottom}{left}に変換し,#2に代入,#3はデフォルト値,出力形式で入れる
-\newcommand*{\jlreq@pagestyle@parse@position}[3]{%
- \begingroup
- \jlreq@pagestyle@parse@position@#1-\jlreq@endmark
- % \jlreq@tempcに縦方向を,\jlreq@tempdに横方向を入れる
- \def\jlreq@tempc{}\def\jlreq@tempd{}%
- \jlreq@pagestyle@parse@position@@{\jlreq@tempa}%
- \jlreq@pagestyle@parse@position@@{\jlreq@tempb}%
- \ifx\jlreq@tempc\@empty\edef\jlreq@tempc{\expandafter\@firstoftwo#3}\fi
- \ifx\jlreq@tempd\@empty\edef\jlreq@tempd{\expandafter\@secondoftwo#3}\fi
- \edef\jlreq@do{\unexpanded{\def#2}{{\jlreq@tempc}{\jlreq@tempd}}}%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\def\jlreq@pagestyle@parse@position@#1-#2\jlreq@endmark{%
- \def\jlreq@tempa{#1}\def\jlreq@tempb{#2}%
- \jlreq@ifempty{#2}{%
- \ifx\jlreq@tempb\@empty\ClassError{jlreq}{Invalid position: #1}{\@ehc}\fi
- }{%
- \def\@tempa##1-{\def\jlreq@tempb{##1}}%
- \@tempa#2\relax
- }%
-}
-
-\newcommand*\jlreq@pagestyle@parse@position@@[1]{%
- \jlreq@switch{#1}{
- {top}{\def\jlreq@tempc{#1}}
- {bottom}{\def\jlreq@tempc{#1}}
- {left}{\def\jlreq@tempd{#1}}
- {right}{\def\jlreq@tempd{#1}}
- {center}{\def\jlreq@tempd{#1}}
- {gutter}{\if@tate\def\jlreq@tempd{right}\else\def\jlreq@tempd{left}\fi}
- {fore_edge}{\if@tate\def\jlreq@tempd{left}\else\def\jlreq@tempd{right}\fi}
- {\ClassError{jlreq}{Invalid position: #1}{\@ehc}}
- }%
-}
-
-% レベル#1より低いレベルの見出しの**markを\markboth{}{}にする
-\def\jlreq@pagestyle@setclearmark#1{%
- \@for\@tempa:=\jlreq@heading@allheadings\do{%
- \@ifundefined{\@tempa}{}{%
- \ifnum\csname jlreq@heading@level@\@tempa\endcsname<#1\relax\expandafter\def\csname\@tempa mark\endcsname##1{\markboth{}{}}\fi
- }%
- }%
-}
-
-% odd_running_head=_sectionのように下線から始まる場合,その値の見出し命令を柱に出すようにする.
-% 要するに\ps@***に\sectionmarkを定義するように仕込む.
-% 常にodd=rightmark,even=leftmarkになる.
-% 場所指定は奇数ページの方.偶数ページは反対になる.
-% mark_format={_chapter={第\thechapter 章\quad #1}}のような形.
-% このとき\ps@***で\def\chaptermark#1{\markboth{第\thechapter 章\quad #1}{}}とか定義される.
-% \markbothか\markrightかはoddかevenかに依存.
-% odd=とかeven=とかも仕込めるようにしたけど
-% あまり意味がない気がしてきた.oddやevenが優先される.
-\newcommand*{\DeclarePageStyle}[2]{%
- \expandafter\edef\csname jlreq@pagestyle@setting@#1\endcsname{\unexpanded{#2}}%
- \begingroup
- \def\jlreq@nombre@position{}%
- \def\jlreq@running@head@position{}%
- \def\jlreq@nombre{\thepage}%
- \def\jlreq@odd@running@head{}%
- \def\jlreq@even@running@head{}%
- \def\jlreq@command{}%
- \def\jlreq@mark@format{}%
- \def\jlreq@font{}%
- % 柱とノンブルの間
- \def\jlreq@gap{1.5\zw}%
- \newif\ifjlreq@clearmarkcommand\jlreq@clearmarkcommandtrue
- \newif\ifjlreq@pstate\jlreq@pstatefalse % PageStyleTATE
- \jlreq@parsekeyval[PageStyle:#1]{
- *{tate}{\jlreq@pstatetrue}
- *{yoko}{\jlreq@pstatefalse}
- {nombre_position}{\def\jlreq@nombre@position{##1}}
- {running_head_position}{\def\jlreq@running@head@position{##1}}
- {nombre}{\def\jlreq@nombre{##1}}
- {odd_running_head}{\def\jlreq@odd@running@head{##1}}
- {even_running_head}{\def\jlreq@even@running@head{##1}}
- {font}{\def\jlreq@font{##1}}
- {mark_format}{\edef\jlreq@mark@format{\unexpanded{##1}}}
- {command}{\edef\jlreq@command{\unexpanded{##1}}}
- {gap}{\def\jlreq@gap{##1}}
- % trueにすると,\ps@***実行時にまず\***markを全て\@gobbleにする.
- {clear_markcommand}[true,false]{\csname jlreq@clearmarkcommand##1\endcsname}
- }{#2}%
- \def\jlreq@markdefinition{}%
- % \jlreq@makemark{odd/even}running_headの中身\jlreq@endmark\jlreq@endmark
- % として使う.running_headの中身が_から始まる時に,次を実行する.
- % * \jlreq@[even/odd]@running@headを\leftmarkや\rightmarkに書き換える
- % * \jlreq@markdefinitionに\***markを定義するマクロを入れる.
- % * \jlreq@[even/odd]@running@head@levelに見出しのレベルを入れる.
- \def\jlreq@makemark##1##2##3\jlreq@endmark{%
- \ifx_##2%
- \@ifundefined{##2}{%
- \ClassError{jlreq}{Unknown Heading `##2' (in PageStyle #1)}{\@ehc}%
- }{}%
- \ifthenelse{\equal{##1}{even}}{%
- \def\jlreq@even@running@head{\leftmark}%
- }{%
- \def\jlreq@odd@running@head{\rightmark}%
- }%
- \@ifundefined{jlreq@heading@setting@##3}{}{%
- \expandafter\edef\csname jlreq@##1@running@head@level\endcsname{\csname jlreq@heading@level@##3\endcsname}%
- }%
- % mark_formatを調べる
- \def\jlreq@tempa####1{%
- \jlreq@tempafalse
- \edef\jlreq@result{\expandonce{\csname the##3\endcsname}\noexpand\quad\unexpanded{########1}}%
- \jlreq@parsekeyval*{
- {##1}{\edef\jlreq@result{\unexpanded{########1}}\jlreq@tempatrue}
- {##2##3}{\ifjlreq@tempa\else\edef\jlreq@result{\unexpanded{########1}}\fi}
- }{####1}%
- }%
- \expandafter\jlreq@tempa\expandafter{\jlreq@mark@format}%
- \ifthenelse{\equal{##1}{even}}{%
- \def\jlreq@markcommand{\markboth}%
- \def\jlreq@markcommandafter{{}}%
- }{%
- \def\jlreq@markcommand{\markright}%
- \def\jlreq@markcommandafter{}%
- }%
- \eappto\jlreq@markdefinition{%
- \noexpand\def\expandonce{\csname ##3mark\endcsname}\unexpanded{####1}{\expandonce{\jlreq@markcommand}%
- {\expandonce{\jlreq@result}}\expandonce{\jlreq@markcommandafter}}%
- }%
- \fi
- \jlreq@ifendmark{##2}{}{\@gobble}%
- }%
- \def\jlreq@even@running@head@level{}%
- \def\@tempb{\jlreq@makemark{even}}%
- \expandafter\@tempb\jlreq@even@running@head\jlreq@endmark\jlreq@endmark
- \def\jlreq@odd@running@head@level{}%
- \def\@tempb{\jlreq@makemark{odd}}%
- \expandafter\@tempb\jlreq@odd@running@head\jlreq@endmark\jlreq@endmark
- \ifx\jlreq@odd@running@head@level\@empty\else\ifx\jlreq@even@running@head@level\@empty\else
- \ifnum\jlreq@odd@running@head@level<\jlreq@even@running@head@level
- % 見出しを出す場合:evenに章などの高いレベルの見出しを出す(2.6.3.a)
- \jlreq@note{偶数ページには奇数ページよりアウトラインレベルの高い見出しを入れる (ページスタイル #1内,2.6.3.a).}%
- \fi
- \fi\fi
- % \jlreq@tempa = min{\jlreq@odd@running@head@level,\jlreq@even@running@head@level}
- \let\jlreq@tempa=\jlreq@odd@running@head@level
- \ifx\jlreq@tempa\@empty
- \let\jlreq@tempa=\jlreq@even@running@head@level
- \else
- \ifx\jlreq@even@running@head@level\@empty\else\ifnum\jlreq@tempa>\jlreq@even@running@head@level
- \let\jlreq@tempa=\jlreq@even@running@head@level
- \fi\fi
- \fi
- \ifx\jlreq@tempa\@empty\else
- \eappto\jlreq@markdefinition{\noexpand\jlreq@pagestyle@setclearmark{\expandonce{\jlreq@tempa}}}%
- \fi
- % \jlreq@[even/odd][head/foot]に入れていく.tateか否かで場合分け.
- \ifjlreq@pstate\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
- \ifx\jlreq@nombre@position\@empty\def\jlreq@nombre@position{0pt}\fi
- \ifx\jlreq@running@head@position\@empty\def\jlreq@running@head@position{0pt}\fi
- \if@tate\else
- \jlreq@note{ノンブルおよび柱を縦組にして配置するのは縦組の場合のみである (ページスタイル #1 内,2.6.1).}%
- \fi
- % 柱とノンブルを入れる箱を作る(\jlreq@resultを展開すると\setboxするマクロがでる)
- \def\jlreq@make@tatebox##1{%
- \edef\jlreq@result{%
- \unexpanded{\setbox\jlreq@tempboxa=\hbox to }%
- \unexpanded{\dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{ - \topskip + 1\zh}\fi\noexpand\relax
- {\unexpanded{\tate\adjustbaseline}%
- \ifx##1\@empty\else
- \noexpand\hspace{\unexpanded{\dimexpr\headsep + \headheight + }%
- \if@tate\else\unexpanded{\topskip - \Cht + }\fi
- \expandonce{\jlreq@running@head@position}\noexpand\relax}%
- \expandonce{##1}%
- \fi
- \ifx\jlreq@nombre\@empty\else
- \noexpand\hfill
- \expandonce{\jlreq@nombre}%
- \ifdim\dimexpr\jlreq@nombre@position\relax=0pt\else
- \unexpanded{\hspace{\dimexpr\jlreq@nombre@position\relax}}%
- \fi
- \fi
- }%
- % Overfull防止
- \ifx l\jlreq@engine
- \unexpanded{\wd\jlreq@tempboxa=\headheight}%
- \else
- \unexpanded{\ht\jlreq@tempboxa=\headheight\dp\jlreq@tempboxa=0pt}%
- \fi
- }%
- }%
- % 左に配置するヘッダ.##1は柱の中身を入れたマクロ.(一回展開で正しくでてくる.)
- \def\jlreq@make@lefthead##1{%
- \jlreq@make@tatebox{##1}%
- \edef\jlreq@lefthead{%
- \expandonce{\jlreq@result}%
- \noexpand\hspace{\noexpand\dimexpr
- \if@tate\unexpanded{-\Cdp}\fi - \unexpanded{\headsep - 1\zw}%
- \noexpand\relax}%
- \unexpanded{\box\jlreq@tempboxa\hfil}%
- }%
- }%
- % 右に配置するヘッダ.
- \def\jlreq@make@righthead##1{%
- \jlreq@make@tatebox{##1}%
- \edef\jlreq@righthead{%
- \expandonce{\jlreq@result}%
- \noexpand\hspace{\unexpanded{\dimexpr\textwidth}
- \if@tate\unexpanded{- \topskip + \Cht}\fi
- \unexpanded{ + \headsep}%
- \noexpand\relax}%
- \unexpanded{\box\jlreq@tempboxa\hss}%
- }%
- }%
- \if@tate
- \jlreq@make@lefthead{\jlreq@odd@running@head}%
- \let\jlreq@oddhead=\jlreq@lefthead
- \jlreq@make@righthead{\jlreq@even@running@head}%
- \let\jlreq@evenhead=\jlreq@righthead
- \else
- \jlreq@make@righthead{\jlreq@odd@running@head}%
- \let\jlreq@oddhead=\jlreq@righthead
- \jlreq@make@lefthead{\jlreq@even@running@head}%
- \let\jlreq@evenhead=\jlreq@lefthead
- \fi
- \let\jlreq@oddfoot=\@empty
- \let\jlreq@evenfoot=\@empty
- }{% yoko
- % \jlreq@nombre@positoinと\jlreq@running@head@positionの中身を{bottom}{center}みたいに変換する.
- \ifx\jlreq@nombre@position\@empty\def\jlreq@nombre@position{bottom-center}\fi
- \expandafter\jlreq@pagestyle@parse@position\expandafter{\jlreq@nombre@position}{\jlreq@nombre@position}{{bottom}{center}}%
- \ifx\jlreq@running@head@position\@empty\def\jlreq@running@head@position{top-center}\fi
- \expandafter\jlreq@pagestyle@parse@position\expandafter{\jlreq@running@head@position}{\jlreq@running@head@position}{{top}{center}}%
- \ifthenelse{\(
- \boolean{@tate} \AND \(
- \equal{\expandafter\@secondoftwo\jlreq@nombre@position}{right} \OR
- \equal{\expandafter\@secondoftwo\jlreq@running@head@position}{right}
- \)\) \OR \(
- \(\NOT \boolean{@tate}\) \AND \(
- \equal{\expandafter\@secondoftwo\jlreq@nombre@position}{left} \OR
- \equal{\expandafter\@secondoftwo\jlreq@running@head@position}{left}
- \)
- \)}{%
- \if@twoside
- \jlreq@note{柱やノンブルは,左ページでは,基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか,基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内,2.6.1.b).}%
- \fi
- }{}%
- {\jlreq@font
- \ifthenelse{\lengthtest{\jlreq@gap < 1.49\zw} \OR \( \lengthtest{\jlreq@gap > 1.51\zw} \AND \lengthtest{\jlreq@gap < 1.99\zw} \) \OR \lengthtest{\jlreq@gap > 2.01\zw}}{\jlreq@note{ノンブルと柱との空き量は文字サイズの2倍又は1.5倍とする (ページスタイル #1 内,2.6.1.c).}}{}%
- }%
- % ##2を##1 = left/center/rightの場所,##4を##3の場所に置く.被った場合は##2を外側にする.
- % 戻り値は\jlreq@result
- \def\jlreq@setheadfoot##1##2##3##4{%
- % 左,真ん中,右に置くもの(対応するものがなければ空)をそれぞれ格納する.
- \def\jlreq@left{}\def\jlreq@center{}\def\jlreq@right{}%
- % \ifjlreq@tempa = if(##1 == ##3 && ##2 != "" && ##4 != "")
- \jlreq@tempatrue
- \jlreq@ifempty{##2}{\jlreq@tempafalse}{}%
- \jlreq@ifempty{##4}{\jlreq@tempafalse}{}%
- \ifthenelse{\equal{##1}{##3}}{}{\jlreq@tempafalse}%
- \ifjlreq@tempa
- \ifthenelse{\equal{##1}{right}}{%
- \edef\jlreq@right{\unexpanded{##4}\noexpand\hspace{\expandonce{\jlreq@gap}}\unexpanded{##2}}%
- }{%
- \expandafter\edef\csname jlreq@##1\endcsname{\unexpanded{##2}\noexpand\hspace{\expandonce{\jlreq@gap}}\unexpanded{##4}}%
- }%
- \else
- \jlreq@ifempty{##2}{}{\expandafter\def\csname jlreq@##1\endcsname{##2}}%
- \jlreq@ifempty{##4}{}{\expandafter\def\csname jlreq@##3\endcsname{##4}}%
- \fi
- % フォント命令を挿入
- \ifx\jlreq@font\@empty\else
- \ifx\jlreq@left\@empty\else\edef\jlreq@left{{\expandonce{\jlreq@font}\expandonce{\jlreq@left}}}\fi
- \ifx\jlreq@center\@empty\else\edef\jlreq@center{{\expandonce{\jlreq@font}\expandonce{\jlreq@center}}}\fi
- \ifx\jlreq@right\@empty\else\edef\jlreq@right{{\expandonce{\jlreq@font}\expandonce{\jlreq@right}}}\fi
- \fi
- % \jlreq@setheadfoot@に回して処理
- \edef\jlreq@do{\noexpand\jlreq@setheadfoot@{\expandonce{\jlreq@left}}{\expandonce{\jlreq@center}}{\expandonce{\jlreq@right}}}%
- \jlreq@do
- }%
- % ##1 ##2 ##3と並んだヘッダを作る,戻り値は\jlreq@result
- \def\jlreq@setheadfoot@##1##2##3{%
- % - \Cdpは端にそろえるための補正
- \jlreq@ifempty{##1}{\def\jlreq@left{}}{\edef\jlreq@left{\noexpand\hspace{\dimexpr\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate - \Cdp\fi\relax}\unexpanded{##1}}}%
- % +\topskip - \Chtは\jlreq@headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正.
- \jlreq@ifempty{##3}{\def\jlreq@right{}}{\edef\jlreq@right{\unexpanded{##3}\noexpand\hspace{\dimexpr\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate + \topskip - \Cht\fi\relax}}}%
- \jlreq@ifempty{##2}{%
- \edef\jlreq@result{\expandonce{\jlreq@left}\hfil\expandonce{\jlreq@right}}%
- \jlreq@ifempty{##1}{\jlreq@ifempty{##3}{\def\jlreq@result{}}{}}{}%
- }{%
- \ifx\jlreq@left\@empty\else\edef\jlreq@left{\noexpand\hbox to 0pt{\expandonce{\jlreq@left}\hss}}\fi
- \ifx\jlreq@right\@empty\else\edef\jlreq@right{\noexpand\hbox to 0pt{\hss\expandonce{\jlreq@right}}}\fi
- \edef\jlreq@result{\expandonce{\jlreq@left}\hfil\unexpanded{##2}\hfil\expandonce{\jlreq@right}}%
- }%
- }%
- % \nombre@<top/bottom>を定義
- \def\jlreq@nombre@top{}\def\jlreq@nombre@bottom{}%
- \expandafter\edef\csname jlreq@nombre@\expandafter\@firstoftwo\jlreq@nombre@position\endcsname{\expandonce{\jlreq@nombre}}%
- % \odd@running@head@<top/bottom>を定義
- \def\jlreq@odd@running@head@top{}\def\jlreq@odd@running@head@bottom{}%
- \expandafter\edef\csname jlreq@odd@running@head@\expandafter\@firstoftwo\jlreq@running@head@position\endcsname{\expandonce{\jlreq@odd@running@head}}%
- % \@oddheadを定義
- \edef\jlreq@do{\noexpand\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}{\expandonce{\jlreq@nombre@top}}{\expandafter\@secondoftwo\jlreq@running@head@position}{\expandonce{\jlreq@odd@running@head@top}}}%
- \jlreq@do\let\jlreq@oddhead=\jlreq@result
- % \@oddfootを定義
- \edef\jlreq@do{\noexpand\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}{\expandonce{\jlreq@nombre@bottom}}{\expandafter\@secondoftwo\jlreq@running@head@position}{\expandonce{\jlreq@odd@running@head@bottom}}}%
- \jlreq@do\let\jlreq@oddfoot=\jlreq@result
- % ##1 = {}{}の後ろを逆にする
- \def\getoppositeposition##1{%
- \jlreq@switch{\expandafter\@secondoftwo##1}{
- {center}{\def\jlreq@tempe{center}}
- {right}{\def\jlreq@tempe{left}}
- {left}{\def\jlreq@tempe{right}}
- }%
- \edef##1{{\expandafter\@firstoftwo##1}{\jlreq@tempe}}%
- }%
- \getoppositeposition\jlreq@nombre@position
- \getoppositeposition\jlreq@running@head@position
- % 上と同じことをする
- % \nombre@<top/bottom>を定義
- \def\jlreq@nombre@top{}\def\jlreq@nombre@bottom{}%
- \expandafter\edef\csname jlreq@nombre@\expandafter\@firstoftwo\jlreq@nombre@position\endcsname{\expandonce{\jlreq@nombre}}%
- % \even@running@head@<top/bottom>を定義
- \def\jlreq@even@running@head@top{}\def\jlreq@even@running@head@bottom{}%
- \expandafter\edef\csname jlreq@even@running@head@\expandafter\@firstoftwo\jlreq@running@head@position\endcsname{\expandonce{\jlreq@even@running@head}}%
- % \@evenheadを定義
- \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@top}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@even@running@head@top}}}%
- \jlreq@do\let\jlreq@evenhead=\jlreq@result
- % \@evenfootを定義
- \edef\jlreq@do{\unexpanded{\jlreq@setheadfoot{\expandafter\@secondoftwo\jlreq@nombre@position}}{\expandonce{\jlreq@nombre@bottom}}\unexpanded{{\expandafter\@secondoftwo\jlreq@running@head@position}}{\expandonce{\jlreq@even@running@head@bottom}}}%
- \jlreq@do\let\jlreq@evenfoot=\jlreq@result
- }%
- % 傍注がある場合はその分を調整
- % \hbox to ***{+++}というのがあるが,+++は空でなければ\hfillを含むのでUndefullすることはない.
- \ifdim\marginparwidth>0pt \ifjlreq@pstate\else
- \if@tate
- \def\jlreq@do##1{%
- \ifx##1\@empty\else
- \edef##1{%
- \unexpanded{\raise-\dimexpr\marginparwidth+\marginparsep\relax\hbox to \textwidth}{\expandonce{##1}}%
- }%
- \fi
- }%
- \jlreq@do\jlreq@oddfoot
- \jlreq@do\jlreq@evenfoot
- \else
- \if@twocolumn
- \def\jlreq@do##1{%
- \ifx##1\@empty\else
- \edef##1{%
- \unexpanded{\hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}}%
- \noexpand\hbox to \unexpanded{\dimexpr\textwidth + 2\marginparwidth + 2\marginparsep\relax}{\expandonce{##1}}%
- \unexpanded{\hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}}%
- }%
- \fi
- }%
- \jlreq@do\jlreq@oddhead
- \jlreq@do\jlreq@oddfoot
- \jlreq@do\jlreq@evenhead
- \jlreq@do\jlreq@evenfoot
- \else
- % 奇数ページ
- \def\jlreq@do##1{%
- \ifx##1\@empty\else
- \edef##1{%
- \noexpand\hbox to \unexpanded{\dimexpr\textwidth + \marginparwidth + \marginparsep\relax}{\expandonce{##1}}%
- \unexpanded{\hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}}%
- }%
- \fi
- }%
- \jlreq@do\jlreq@oddhead
- \jlreq@do\jlreq@oddfoot
- % 偶数ページ
- \def\jlreq@do##1{%
- \ifx##1\@empty\else
- \edef##1{%
- \unexpanded{\hspace*{-\dimexpr\marginparwidth+\marginparsep\relax}}%
- \noexpand\hbox to \unexpanded{\dimexpr\textwidth + \marginparwidth + \marginparsep\relax}{\expandonce{##1}}%
- }%
- \fi
- }%
- \jlreq@do\jlreq@evenhead
- \jlreq@do\jlreq@evenfoot
- \fi
- \fi
- \fi\fi
- \edef\jlreq@do{%
- \noexpand\def\expandonce{\csname ps@#1\endcsname}{%
- \unexpanded{\def\jlreq@current@pagestyle{#1}}%
- \ifjlreq@clearmarkcommand\unexpanded{\jlreq@heading@execmacro@toallheadings\jlreq@clearheadingmarks}\fi
- \unexpanded{\let\@mkboth=\markboth}%
- \unexpanded{\def\@oddhead}{\expandonce{\jlreq@oddhead}}%
- \unexpanded{\def\@oddfoot}{\expandonce{\jlreq@oddfoot}}%
- \unexpanded{\def\@evenhead}{\expandonce{\jlreq@evenhead}}%
- \unexpanded{\def\@evenfoot}{\expandonce{\jlreq@evenfoot}}%
- }%
- % \jlreq@markdefinition/\jlreq@commandは引数トークンを持つ可能性がある
- \noexpand\edef\expandonce{\csname ps@#1\endcsname}{%
- \noexpand\csexpandonce{ps@#1}%
- \noexpand\unexpanded{%
- \expandonce{\jlreq@markdefinition}%
- \expandonce{\jlreq@command}%
- }%
- }%
- }%
- \expandafter\endgroup
- \jlreq@do
-}
-
-\newcommand*{\NewPageStyle}[2]{%
- \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
-}
-\newcommand*{\RenewPageStyle}[2]{%
- \@ifundefined{ps@#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclarePageStyle{#1}{#2}}%
-}
-\newcommand*{\ProvidePageStyle}[2]{%
- \@ifundefined{ps@#1}{\DeclarePageStyle{#1}{#2}}{}%
-}
-\newcommand*{\ModifyPageStyle}[2]{%
- \begingroup
- \@ifundefined{jlreq@pagestyle@setting@#1}{\ClassError{jlreq}{Unknown pagestyle: #1}{\@ehc}}{}%
- \expandafter\let\expandafter\setting\expandafter=\csname jlreq@pagestyle@setting@#1\endcsname
- \edef\jlreq@do{\noexpand\RenewPageStyle{#1}{\expandonce{\setting},\unexpanded{#2}}}%
- \expandafter\endgroup
- \jlreq@do
-}
-
-%.. 各種定義
-\RenewPageStyle{empty}{nombre={},odd_running_head={},even_running_head={}}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{
- \if@twoside
- \NewPageStyle{headings}{odd_running_head={_subsection},even_running_head={_section}}
- \else
- \NewPageStyle{headings}{odd_running_head={_section},even_running_head={}}
- \fi
-}{% book, article
- \if@twoside
- \NewPageStyle{headings}{odd_running_head={_section},even_running_head={_chapter}}
- \else
- \NewPageStyle{headings}{odd_running_head={_chapter},even_running_head={}}
- \fi
- \ModifyPageStyle{headings}{mark_format={_chapter={第\thechapter 章\quad #1}}}
-}
-\if@tate
- \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},clear_markcommand=false}
- \NewPageStyle{myheadings}{nombre=\thepage,odd_running_head=\rightmark,even_running_head=\leftmark,clear_markcommand=false}
- \if@twoside
- \ModifyPageStyle{plain}{nombre_position={top-left}}
- \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-left,running_head_position=top-left}
- \ModifyPageStyle{myheadings}{nombre_position=bottom-left,running_head_position=top-left}
- \else
- \ModifyPageStyle{plain}{nombre_position={top-center}}
- \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center}
- \ModifyPageStyle{myheadings}{nombre_position=bottom-center,running_head_position=top-center}
- \fi
-\else% yoko
- \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},nombre_position={bottom-center},clear_markcommand=false}
- \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center}
- \NewPageStyle{myheadings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center,odd_running_head=\rightmark,even_running_head=\leftmark,clear_markcommand=false}
-\fi
-\ModifyPageStyle{plain}{font=\small}
-\ModifyPageStyle{headings}{font=\small}
-\ModifyPageStyle{myheadings}{font=\small}
-
-%. フロート関連
-% 4.3.3.dの例,縦組みの時だけど横にも適用……
-\setlength{\floatsep}{1\jlreq@gol plus 1\jlreq@gol}
-\setlength{\textfloatsep}{1\jlreq@gol plus \baselineskip}
-\intextsep=\textfloatsep
-\dblfloatsep=\floatsep
-\dbltextfloatsep=\textfloatsep
-% 残りはデフォルトにしておく.
-
-% 4.3.1 注4
-\newlength\abovecaptionskip
-\newlength\belowcaptionskip
-\newcommand{\@makecaption}[2]{{%
- \reset@font\small
- \vskip\abovecaptionskip
- \edef\jlreq@do{\unexpanded{\def\jlreq@tempa##1}{\expandonce{\jlreq@makecaption@label@format}}}%
- \jlreq@do
- \jlreq@ifempty{#1}{}{%
- \edef\jlreq@tempa{{\noexpand\jlreq@@makecaption@label@font\expandonce{\jlreq@tempa{#1}}\unexpanded{\hskip \glueexpr\jlreq@makecaption@after@label@space\relax}}}%
- }%
- \appto\jlreq@tempa{{\jlreq@@makecaption@font #2}}%
- \setbox\@tempboxa=\hbox{\jlreq@tempa}%
- \@ifundefined{@currenvir}{%
- \@ifundefined{@captype}%
- {\def\jlreq@tempb{}}%
- {\let\jlreq@tempb=\@captype}%
- }{\let\jlreq@tempb=\@currenvir}%
- \@ifundefined{jlreq@caption@align@\jlreq@tempb}%
- {\let\jlreq@align=\jlreq@caption@align}%
- {\expandafter\let\expandafter\jlreq@align\csname jlreq@caption@align@\jlreq@tempb\endcsname}%
- \ifdim\wd\@tempboxa>\hsize\relax
- {%
- \ifx c\jlreq@align\centering\fi
- \ifx r\jlreq@align\raggedleft\fi
- \jlreq@tempa\par
- }%
- \else
- \global\@minipagefalse
- \hbox to\hsize{%
- \ifnum0\ifx c\jlreq@align 1\fi\ifx r\jlreq@align 1\fi>0 \hfil\fi
- \unhbox\@tempboxa
- \ifnum0\ifx c\jlreq@align 1\fi\ifx l\jlreq@align 1\fi>0 \hfil\fi
- }%
- \fi
- \vskip\belowcaptionskip}}
-\jlreq@jlreqsetup@add{caption_font}{\def\jlreq@@makecaption@font{#1}}
-\jlreq@jlreqsetup@add{caption_label_font}{\def\jlreq@@makecaption@label@font{#1}}
-\jlreq@jlreqsetup@add{caption_label_format}{\edef\jlreq@makecaption@label@format{\unexpanded{#1}}}
-\jlreq@jlreqsetup@add{caption_after_label_space}{\def\jlreq@makecaption@after@label@space{#1}}
-\def\jlreq@caption@setalign#1#2{%
- \jlreq@switch{#2}{
- {center}{\let#1=c}
- {left}{\let#1=l}
- {right}{\let#1=r}
- {top}{\let#1=l}
- {bottom}{\let#1=r}
- }%
-}
-\jlreq@jlreqsetup@add{caption_align}{%
- \jlreq@parsekeyval@nokey{%
- \jlreq@ifempty{##1}{}{%
- \jlreq@switch{##1}{%
- {center}{\let\jlreq@caption@align=c}
- {left}{\let\jlreq@caption@align=l}
- {right}{\let\jlreq@caption@align=r}
- {top}{\let\jlreq@caption@align=l}
- {bottom}{\let\jlreq@caption@align=r}
- {\expandafter\jlreq@caption@setalign\csname jlreq@caption@align@##1\endcsname{##2}}
- }%
- }%
- }{#1}%
-}
-\jlreqsetup{caption_font={\sffamily\bfseries},caption_label_font={\sffamily\bfseries},caption_after_label_space=1\zw,caption_label_format={#1},caption_align=center}
-% 特に根拠のない値
-\setlength\abovecaptionskip{.5\jlreq@gol}
-\setlength\belowcaptionskip{0pt}
-
-%.. figure環境
-\newcounter{figure}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
- \renewcommand{\thefigure}{\@arabic\c@figure}
-}{%
- \@addtoreset{figure}{chapter}
- \renewcommand{\thefigure}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@figure}
-}
-\newcommand*{\fps@figure}{h}
-\newcommand*{\ftype@figure}{1}
-\newcommand*{\ext@figure}{lof}
-\newcommand*{\fnum@figure}{\figurename\thefigure}
-\newenvironment{figure}{\@float{figure}}{\end@float}
-\newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat}
-\newcommand*{\listfigurename}{図目次}
-\newcommand{\figurename}{図}
-
-%.. table環境
-\newcounter{table}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
- \renewcommand{\thetable}{\@arabic\c@table}
-}{%
- \@addtoreset{table}{chapter}
- \renewcommand{\thetable}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@table}
-}
-\newcommand*{\fps@table}{h}
-\newcommand*{\ftype@table}{2}
-\newcommand*{\ext@table}{lot}
-\newcommand*{\fnum@table}{\tablename\thetable}
-\newenvironment{table}{\@float{table}}{\end@float}
-\newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat}
-\newcommand{\listtablename}{表目次}
-\newcommand{\tablename}{表}
-
-%. タイトル周り
-\newenvironment{titlepage}{%
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse\newpage
- \fi
- \thispagestyle{empty}%
- \setcounter{page}{1}%
-}{%
- \if@restonecol\twocolumn\else\newpage\fi
- \if@twoside\else
- \setcounter{page}{1}%
- \fi
-}
-
-\if@titlepage
- \newcommand{\maketitle}{%
- % jarticleとかからあまり変更していない
- \begin{titlepage}%
- \let\footnotesize\small
- \let\footnoterule\relax
- \let\footnote\thanks
- \null\vfil
- \vskip 4\baselineskip
- \begin{center}%
- {\LARGE \@title \par}%
- \vskip\baselineskip%
- {\Large
- \lineskip .75em%
- % 縦書き時には表組み内でも縦書きにするようにする
- \if@tate
- \let\jlreq@temporary@original@ialign=\ialign
- \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
- \fi
- \begin{tabular}[t]{c}%
- \@author
- \end{tabular}\par}%
- \vskip\baselineskip
- {\large\@date\par}%
- \end{center}\par
- \vfil{\centering\@thanks}\vfil\null
- \end{titlepage}%
- \jlreq@endofmaketitle
- }
-\else
- \newcommand{\maketitle}{%
- \par
- \begingroup
- \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
- \renewcommand{\@makefnmark}{\hbox{%
- \jlreq@iftdir{\yoko}{}%
- \rlap{\@textsuperscript{\normalfont\@thefnmark}}%
- }}%
- \renewcommand{\jlreq@referencemark@format}[1]{\@makefnmark}% うーん
- \if@twocolumn
- \ifnum\col@number=\@ne
- \@maketitle
- \else
- \twocolumn[\@maketitle]%
- \fi
- \else
- \newpage
- \global\@topnum\z@
- \@maketitle
- \fi
- % \pagestyle{empty}の時はそのまま.
- \ifnum0\ifx\@oddhead\@empty\else1\fi\ifx\@evenhead\@empty\else1\fi>0
- \thispagestyle{plain}%
- \fi
- \@thanks
- \endgroup
- \jlreq@endofmaketitle
- }
-\fi
-% いろいろクリアする.
-\def\jlreq@endofmaketitle{%
- \setcounter{footnote}{0}%
- \global\let\thanks\relax
- \global\let\maketitle\relax
- \global\let\p@thanks\relax
- \global\let\@thanks\@empty
- \global\let\@author\@empty
- \global\let\@date\@empty
- \global\let\@title\@empty
- \global\let\title\relax
- \global\let\author\relax
- \global\let\date\relax
- \global\let\and\relax
-}%
-% \vskipを\baselineskipにしてみた.
-\def\@maketitle{%
- \newpage\null
- \vskip 2\baselineskip%
- \begin{center}%
- {\jlreq@keepbaselineskip{\LARGE}\@title\par}%
- \vskip\baselineskip
- {\jlreq@keepbaselineskip{\large}%
- \lineskip .5\zh
- % 縦書き時には表組み内でも縦書きにするようにする
- \if@tate
- \let\jlreq@temporary@original@ialign=\ialign
- \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
- \fi
- \begin{tabular}[t]{c}%
- \@author
- \end{tabular}%
- \par
- }%
- \ifx\@date\@empty\else
- \vskip\baselineskip
- {\jlreq@keepbaselineskip{\large}\@date}%
- \fi
- \end{center}%
- \par
- \vskip\baselineskip
- \ifvoid\jlreq@abstractbox\else\unvbox\jlreq@abstractbox\fi
-}
-
-%.. abstract
-\def\jlreq@parhook@abstract{}
-\ifthenelse{\equal{\jlreq@article@type}{book}}{}{% article,report
- \newbox\jlreq@abstractbox
- \newcommand*{\abstractname}{概要}
- \if@titlepage
- % articleとかjarticleとかと同じ
- \newenvironment{abstract}{%
- \titlepage
- \null\vfil
- \@beginparpenalty\@lowpenalty
- \begin{center}%
- {\sffamily\bfseries\abstractname}%
- \@endparpenalty\@M
- \end{center}%
- \par
- }{%
- \par\vfil\null\endtitlepage
- }
- \else
- \newenvironment{abstract}{%
- \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0
- \ifjlreq@preamble
- \ifx l\jlreq@engine\else
- \def\jlreq@parhook@abstract{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}%
- \PushPostHook{par}{\jlreq@parhook@abstract}%
- \fi
- \fi
- % とりあえず全部ボックスに入れる.
- \global\setbox\jlreq@abstractbox=\vtop\bgroup
- \ifjlreq@preamble
- % preamble後っぽく振る舞う
- \@noskipsecfalse
- % \@nodocumentが入っているので一時的に無効化
- \everypar{}%
- \fi
- \if@twocolumn
- \parindent=0pt
- \hsize=\textwidth
- % 後で\@maketitleとともに呼び出されるときは\twcolumn[***]で呼び出される.
- \begin{minipage}[b]{\textwidth}%
- \fi
- \bgroup
- \small
- \parindent=1\zw
- \begin{center}%
- {\sffamily\bfseries\abstractname}%
- \end{center}%
- \list{}{%
- \listparindent\parindent
- \itemindent\listparindent
- \labelwidth\z@
- \labelsep\z@
- \leftmargin=2\zw
- \rightmargin\leftmargin
- \@tempdima=1\zw
- \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
- \@tempdimc=\@tempdimb
- \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
- \ifdim\@tempdimb=\@tempdimc\else\@tempdimb=\dimexpr\@tempdimb - 1\zw\relax\fi
- \leftmargin=\dimexpr\leftmargin + (\@tempdimc - \@tempdimb)/2\relax
- \rightmargin=\dimexpr\rightmargin + (\@tempdimc - \@tempdimb)/2\relax
- \parsep\z@ \@plus.1\zh
- }%
- \item\relax
- \else
- \section*{\abstractname}%
- \fi
- }{%
- \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0
- \endlist
- \egroup
- \vspace{\baselineskip}%
- \if@twocolumn
- \end{minipage}
- \fi
- \egroup
- \fi
- \ifjlreq@preamble
- \ifx l\jlreq@engine\else
- \def\jlreq@parhook@abstract{}%
- \fi
- \else
- \unvbox\jlreq@abstractbox
- \fi
- }
- \fi
-}
-%. 箇条書き.cf. JISX4051 8.4
-% 用語定義型
-\newenvironment{description}{\list{}{%
- \setlength{\leftmargin}{0\zw}% 下げない
- \setlength{\labelwidth}{0\zw}%
- \setlength{\labelsep}{1\zw}
-% \addtolength{\leftmargin}{\leftskip}% たぶんこの二行いらない……
-% \addtolength{\leftmargin}{\labelsep}%
- \let\makelabel=\descriptionlabel
-% 同行じゃない場合はこんな感じ?
-% \let\jlreq@original@@item=\@item
-% \def\@item[##1]{\jlreq@original@@item[##1]\mbox{}\par
- }}{\endlist}
-\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\bfseries #1}
-
-% enumerateとitemize
-% 見出しが一つ上のレベルからどのくらいずれているかを入れる.
-% (見出しは2\zwの箱に右/下詰めで入る.)
-\setlength\leftmargini{2\zw}
-\setlength\leftmarginii{1\zw}
-\setlength\leftmarginiii{1\zw}
-\setlength\leftmarginiv{1\zw}
-\setlength\leftmarginv{1\zw}
-\setlength\leftmarginvi{1\zw}
-
-%.. 箇条書き
-\jlreq@jlreqsetup@add{itemization_beforeafter_space}{
- \begingroup
- \def\jlreq@do{}%
- \def\jlreq@keyvallist{}%
- \@for\@tempa:=#1\do{%
- \expandafter\jlreq@ifcontains\expandafter{\@tempa}{=}{%
- \expandafter\appto\expandafter\jlreq@keyvallist\expandafter{\@tempa,}%
- }{%
- \@for\@tempb:=i,ii,iii,iv,v,vi\do{%
- \eappto\jlreq@do{\noexpand\def\expandonce{\csname jlreq@itemization@beforeafter@space@\@tempb\endcsname}{\expandonce{\@tempa}}}%
- }%
- }%
- }%
- \def\jlreq@tempa{%
- \jlreq@parsekeyval{%
- {i}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@i{####1}}}
- {ii}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@ii{####1}}}
- {iii}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@iii{####1}}}
- {iv}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@iv{####1}}}
- {v}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@v{####1}}}
- {vi}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@vi{####1}}}
- }%
- }%
- \expandafter\jlreq@tempa\expandafter{\jlreq@keyvallist}%
- \expandafter\endgroup
- \jlreq@do
-}
-\jlreq@jlreqsetup@add{itemization_itemsep}{\def\jlreq@itemization@itemsep{#1}}
-\jlreqsetup{itemization_beforeafter_space={0pt,i=.5\baselineskip},itemization_itemsep=0pt}
-% enumerate, itemize用初期化
-\def\jlreq@init@list{%
- \setlength{\labelwidth}{2\zw}%
- \setlength{\partopsep}{0pt}%
- \setlength{\itemsep}{\dimexpr\jlreq@itemization@itemsep\relax}%
- \setlength{\parsep}{0pt}%
- \setlength{\listparindent}{\parindent}%
-% itemizeは直後ベタ,enumerateは直後全角空き.
- \ifthenelse{\equal{\@currenvir}{itemize}}{%
- \setlength{\labelsep}{0\zw}%
- }{%
- \setlength{\labelsep}{1\zw}%
- }%
- % \labelsepだけあけるのは一つ目(ラベルの直後)のみ
- \setlength{\itemindent}{\labelsep}%
-}
-
-\def\@listi{%
- \jlreq@init@list
- \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@i\relax}%
- \setlength{\leftmargin}{\leftmargini}%
-}
-\let\@listI\@listi
-\def\@listii{%
- \jlreq@init@list
- \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@ii\relax}%
- \setlength{\leftmargin}{\leftmarginii}%
-}
-\def\@listiii{%
- \jlreq@init@list
- \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@iii\relax}%
- \setlength{\leftmargin}{\leftmarginiii}%
-}
-\def\@listiv{%
- \jlreq@init@list
- \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@iv\relax}%
- \setlength{\leftmargin}{\leftmarginiv}%
-}
-\def\@listv{%
- \jlreq@init@list
- \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@v\relax}%
- \setlength{\leftmargin}{\leftmarginv}%
-}
-\def\@listvi{%
- \jlreq@init@list
- \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@vi\relax}%
- \setlength{\leftmargin}{\leftmarginvi}%
-}
-
-\if@tate
- \renewcommand{\theenumi}{\jlreq@Kanji{enumi}}
- \renewcommand{\theenumii}{\jlreq@rensuji{\@arabic\c@enumii}}
- \renewcommand{\theenumiii}{\jlreq@rensuji{\@arabic\c@enumiii}}
- \renewcommand{\theenumiv}{\jlreq@rensuji{\@arabic\c@enumiv}}
- \newcommand{\labelenumi}{\theenumi}
- \newcommand{\labelenumii}{\theenumii}
- \newcommand{\labelenumiii}{\theenumiii}
- \newcommand{\labelenumiv}{\theenumiv}
-\else
- \renewcommand{\theenumi}{\@arabic\c@enumi}
- \renewcommand{\theenumii}{\@alph\c@enumii}
- \renewcommand{\theenumiii}{\@roman\c@enumiii}
- \renewcommand{\theenumiv}{\@Alph\c@enumiv}
- \newcommand{\labelenumi}{\theenumi.}
- \newcommand{\labelenumii}{(\theenumii)}
- \newcommand{\labelenumiii}{\theenumiii.}
- \newcommand{\labelenumiv}{\theenumiv.}
-\fi
-\renewcommand{\p@enumii}{\theenumi}
-\renewcommand{\p@enumiii}{\theenumi(\theenumii)}
-\renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
-
-\newcommand{\labelitemi}{\hbox to 1\zw{\hss\textbullet\hss}}
-%\newcommand{\labelitemi}{•}
-\if@tate
- \newcommand{\labelitemii}{○}
- \newcommand{\labelitemiii}{*}
-\else
- \newcommand{\labelitemii}{\hbox to 1\zw{\hss\textendash\hss}}
- \newcommand{\labelitemiii}{\hbox to 1\zw{\hss\textasteriskcentered\hss}}
-\fi
-\newcommand{\labelitemiv}{\hbox to 1\zw{\hss ・\hss}}
-
-% 引用系.3.5.2の例.
-\jlreq@jlreqsetup@add{quote_indent}{\def\jlreq@quote@indent{#1}}
-\jlreq@jlreqsetup@add{quote_end_indent}{\def\jlreq@quote@end@indent{#1}}
-\jlreq@jlreqsetup@add{quote_fontsize}[normalsize,small,footnotesize,scriptsize,tiny,]{\jlreq@ifempty{#1}{\def\jlreq@quote@fontsize{}}{\edef\jlreq@quote@fontsize{\expandonce{\csname #1\endcsname}}}}
-\jlreq@jlreqsetup@add{quote_beforeafter_space}{\def\jlreq@quote@beforeafter@space{#1}}
-\jlreqsetup{quote_indent=2\zw,quote_end_indent=0pt,quote_fontsize=,quote_beforeafter_space=0pt}
-
-\newenvironment{verse}
- {\let\\\@centercr
- \list{}{\itemsep\z@ \itemindent -2\jlreq@mol
- \listparindent\itemindent
- \labelwidth\z@
- \labelsep\z@
- \leftmargin=\dimexpr\jlreq@quote@indent\relax
- \addtolength{\leftmargin}{2\jlreq@mol}%
- \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
- \jlreq@quote@fontsize
- \@tempdima=1\zw
- \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
- \@tempdimc=\@tempdimb
- \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
- \topsep=\dimexpr\jlreq@quote@beforeafter@space\relax
- \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax}%
- \item\relax}{\endlist}
-\newenvironment{quotation}
- {\list{}{%
- \leftmargin=\dimexpr\jlreq@quote@indent\relax
- \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
- \jlreq@quote@fontsize
- \@tempdima=1\zw
- \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
- \@tempdimc=\@tempdimb
- \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
- \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax
- \listparindent\parindent
- \itemindent\listparindent
- \labelwidth\z@
- \labelsep\z@
- \topsep=\dimexpr\jlreq@quote@beforeafter@space\relax
- \parsep\z@ \@plus.1\jlreq@gol}%
- \item\relax}{\endlist}
-\newenvironment{quote}
- {\list{}{%
- \leftmargin=\dimexpr\jlreq@quote@indent\relax
- \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
- \jlreq@quote@fontsize
- \@tempdima=1\zw
- \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
- \@tempdimc=\@tempdimb
- \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
- \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax
- \labelwidth\z@
- \itemindent\z@
- \topsep=\jlreq@speciallength{\jlreq@quote@beforeafter@space}%
- \listparindent\z@}%
- \item\relax}{\endlist}
-
-%. 表関係 4.4
-% 表内の行間を0にする(4.4.3.f)
-\jlreq@saveoriginalcs{\tabular}
-\jlreq@saveoriginalcs{\endtabular}
-\preto\tabular{\begingroup\appto\@arrayparboxrestore{\baselineskip=0pt\lineskip=0pt}}
-\appto\endtabular{\endgroup}
-% 4.4.3.e
-\setlength\tabcolsep{.5\zh}
-\setlength\arraycolsep{.5\zw}
-% 4.4.3.j
-\setlength\arrayrulewidth{\jlreq@omotekeiwidth} % 4.4.3.c
-\setlength\doublerulesep{2pt}
-\setlength\tabbingsep{\labelsep}
-\skip\@mpfootins=\skip\footins
-\setlength\fboxsep{.3\zw}
-\setlength\fboxrule{\jlreq@omotekeiwidth} % 根拠はない
-% 後で
-\ifthenelse{\equal{\jlreq@article@type}{article}}{%
- \renewcommand{\theequation}{\@arabic\c@equation}
-}{%
- \@addtoreset{equation}{chapter}
- \renewcommand{\theequation}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@equation}
-}
-
-%. 目次
-\setcounter{tocdepth}{3}
-\newcommand{\@pnumwidth}{2\jlreq@mol}
-\newcommand{\@tocrmarg}{2.55em}
-\newcommand{\@dotsep}{2} % 狭くしてみた
-\newskip\toclineskip
-\setlength\toclineskip{0\jlreq@gol plus .02\jlreq@gol}
-% tarticleから
-\newdimen\@lnumwidth
-\def\numberline#1{\hbox to\@lnumwidth{#1\hfil}}
-\def\addcontentsline#1#2#3{%
- \protected@write\@auxout{%
- \let\label\@gobble\let\index\@gobble\let\glossary\@gobble
- \if@tate
- \@temptokena{\jlreq@rensuji{\thepage}}%
- \else
- \@temptokena{\thepage}%
- \fi
- }{\string\@writefile{#1}{\protect\contentsline{#2}{#3}{\the\@temptokena}}}%
-}
-
-\newcount\jlreq@top@contents % トップ見出しを入れる.レベルと同じ値.
-\jlreq@top@contents=-100
-\newcommand*{\jlreq@set@top@contents}[1]{%
- \ifnum\jlreq@top@contents=-100
- \jlreq@top@contents=#1\relax
- \fi
-}
-\ifthenelse{\equal{\jlreq@article@type}{article}}{
- \newcommand{\tableofcontents}{%
- \jlreq@top@contents=-100\relax
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse
- \fi
- \section*{\contentsname}%
- \@mkboth{\contentsname}{\contentsname}%
- \@starttoc{toc}%
- \if@restonecol\twocolumn\fi
- }
-}{% book, report
- \newcommand{\tableofcontents}{%
- \jlreq@top@contents=-100\relax
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse
- \fi
- \chapter*{\contentsname}%
- \@mkboth{\contentsname}{\contentsname}%
- \@starttoc{toc}%
- \if@restonecol\twocolumn\fi
- }
-}
-% JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
-% 文字の大きさは全て同じ(\normalsize)にする.
-% 見出しのレベルがあがると1文字分ずつ字下げしていく.
-% 第三引数は,上からの幅に加え更にトップの見出しからの差による補正(プラス)が入る.
-% 補正には\jlreq@top@contentsを使う.
-% 「トップ」というか,一番最初に現れた見出しを入れる.
-% リーダーは.から・に変更しました.
-\def\@dottedtocline#1#2#3#4#5{%
- \jlreq@set@top@contents{#1}%
- \ifnum #1>\c@tocdepth \else
- \vskip\toclineskip
- {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
- \parindent #2\relax\@afterindenttrue
- \interlinepenalty\@M
- \leavevmode
- \@lnumwidth #3\relax
- \@tempcnta=#1\relax
- \advance\@tempcnta by -\jlreq@top@contents
- \@tempdima=1\jlreq@mol
- \multiply \@tempdima by \@tempcnta
- \advance\leftskip \@lnumwidth \hbox{}\hskip -\leftskip
- \advance\leftskip\@tempdima
- {#4}\nobreak
- \leaders\hbox{$\m@th\mkern \@dotsep mu$\null\inhibitglue ・\inhibitglue\null$\m@th\mkern \@dotsep mu$}%
- \hfill\nobreak
- \hb@xt@\@pnumwidth{\hss\normalfont\normalcolor #5}%
- \par}%
- \fi}
-
-% listoffigures
-\newcommand{\listoffigures}{%
- \jlreq@top@contents=-100
- \section*{\listfigurename}%
- \@mkboth{\listfigurename}{\listfigurename}%
- \@starttoc{lof}%
-}
-\newcommand*{\l@figure}{\@dottedtocline{1}{0\jlreq@gol}{2\jlreq@gol}}
-\newcommand{\listoftables}{%
- \jlreq@top@contents=-100
- \section*{\listtablename}%
- \@mkboth{\listtablename}{\listtablename}%
- \@starttoc{lot}%
-}
-\let\l@table\l@figure
-
-%. 文献,そのまま
-\newdimen\bibindent
-\setlength\bibindent{2\jlreq@mol}
-\newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
-\newenvironment{thebibliography}[1]{%
- \jlreq@oldfontcommand@enable
- \section*{\refname}%
- \@mkboth{\refname}{\refname}%
- \list{\@biblabel{\@arabic\c@enumiv}}%
- {\settowidth\labelwidth{\@biblabel{#1}}%
- \leftmargin\labelwidth
- \advance\leftmargin\labelsep
- \itemindent=0pt
- \@openbib@code
- \usecounter{enumiv}%
- \let\p@enumiv\@empty
- \renewcommand\theenumiv{\@arabic\c@enumiv}}%
- \sloppy
- \clubpenalty4000
- \@clubpenalty\clubpenalty
- \widowpenalty4000%
- \sfcode`\.\@m
-}{%
- \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
- \endlist
- \jlreq@oldfontcommand@disable
-}
-\let\@openbib@code\@empty
-\if@tate
- \def\@cite#1#2{\jlreq@rensuji{[{#1\if@tempswa , #2\fi}]}}
- \def\@biblabel#1{\jlreq@rensuji{[#1]}}
-\fi
-
-%. 索引
-\newif\ifjlreq@resttate
-\newenvironment{theindex}{%
- \jlreq@oldfontcommand@enable
- \jlreq@iftdir{\clearpage\yoko\jlreq@resttatetrue}{\jlreq@resttatefalse}% 常に横書きにする
- \if@twocolumn\@restonecolfalse\else\@restonecoltrue\fi
- \columnseprule\z@ \columnsep 2\jlreq@mol
- \twocolumn[\section*{\indexname}]%
- \@mkboth{\indexname}{\indexname}%
- \thispagestyle{plain}%
- \parindent\z@
- \parskip\z@ \@plus .03\jlreq@gol\relax
- \let\item\@idxitem
-}{%
- \if@restonecol\onecolumn\else\clearpage\fi
- \ifjlreq@resttate\tate\fi
- \jlreq@oldfontcommand@disable
-}
-\newcommand{\@idxitem}{\par\hangindent 4\jlreq@mol}
-\newcommand{\subitem}{\@idxitem \hspace*{2\jlreq@mol}}
-\newcommand{\subsubitem}{\@idxitem \hspace*{3\jlreq@mol}}
-\newcommand{\indexspace}{\par \vskip 1\jlreq@gol \@plus .5\jlreq@gol \@minus .3\jlreq@gol\relax}
-
-
-%. 前付,後付,付録
-\ifthenelse{\equal{\jlreq@article@type}{book}}{
- \newif\if@mainmatter
- \@mainmattertrue
- \newcommand*{\frontmatter}{%
- \cleardoublepage
- \@mainmatterfalse
- \let\jlreq@pagestyle@atmain\jlreq@current@pagestyle
- \SaveHeading{chapter}{\jlreq@heading@chapter@atmain}%
- \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
- \pagestyle{plain}%
- \pagenumbering{roman}}
- \newcommand*{\mainmatter}{%
- \cleardoublepage
- \@mainmattertrue
- \@ifundefined{jlreq@pagestyle@atmain}{}{%
- \expandafter\pagestyle\expandafter{\jlreq@pagestyle@atmain}%
- }%
- \@ifundefined{jlreq@heading@chapter@atmain}{}{\jlreq@heading@chapter@atmain}%
- \setcounter{chapter}{0}%
- \pagenumbering{arabic}}
- \newcommand*{\backmatter}{%
- \if@openright
- \cleardoublepage
- \else
- \clearpage
- \fi
- \ifthenelse{\equal{\jlreq@article@type}{article}}{}{%book, report
- \SaveHeading{chapter}{\jlreq@heading@chapter@atmain}%
- \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
- }%
- \pagestyle{plain}%
- \@mainmatterfalse
- \setcounter{chapter}{0}}
-}{}
-\newcommand*{\appendix}{\par
- \setcounter{section}{0}%
-}
-
-\ifthenelse{\equal{\jlreq@article@type}{article}}{
- \appto\appendix{%
- \setcounter{subsection}{0}%
- \if@tate
- \def\thesection{\jlreq@rensuji{\Alph{section}}}%
- \else
- \def\thesection{\Alph{section}}%
- \fi
- }
-}{%book, report
- \appto\appendix{%
- \setcounter{chapter}{0}%
- \if@tate
- \def\thechapter{\jlreq@rensuji{\Alph{chapter}}}%
- \else
- \def\thechapter{\Alph{chapter}}%
- \fi
- \ModifyHeading{chapter}{label_format={付録\thechapter}}%
- \ifx\jlreq@current@pagestyle\@undefined\else
- \ifthenelse{\equal{\jlreq@current@pagestyle}{headings}}{%
- \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
- \ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
- }{}%
- \fi
- }
-}
-
-%. その他諸々
-%.. 縦中横
-\DeclareRobustCommand*{\tatechuyoko}[1]{%
- \jlreq@ifydir{\ClassError{jlreq}{\string\tatechuyoko\space is not allowed in yoko mode}{\@ehc}}{}%
- \jlreq@lastnodechar=\lastnodechar
- \ifvmode\leavevmode\fi
- % 前のJFM glue
- \ifnum\jlreq@lastnodechar=-1\else
- \inhibitglue
- \jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{阿}%
- \jlreq@ifgluezero\jlreq@resultskip{}{\hskip\jlreq@resultskip}%
- \fi
- \hbox{\yoko
- \setbox\jlreq@tempboxa=\hbox{阿}%
- \vrule width 0pt height \ht\jlreq@tempboxa depth \dp\jlreq@tempboxa #1}%
- \futurelet\jlreq@nextchar\jlreq@tatechuyoko@
-}
-\def\jlreq@tatechuyoko@{%
- \begingroup
- \def\jlreq@do{}%
- \jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
- \expandafter\jlreq@ifletter\expandafter{\jlreq@tempa}{%
- \jlreq@calc@jfmglue{阿}{\jlreq@tempa}%
- \edef\jlreq@do{%
- \noexpand\hskip\the\jlreq@resultskip\space
- \noexpand\inhibitglue
- }%
- }{}%
- \expandafter\endgroup
- \jlreq@do
-}
-
-% 日にち
-\newif\if西暦
-\def\西暦{\西暦true}
-\def\和暦{\西暦false}
-% #1年#2月#3日 #4は\numberとか\kansujiとか
-\def\jlreq@wareki#1#2#3#4{%
- \jlreq@warekiyear{#1}{#2}{#3}{#4}%
- #4#2月#4#3日%
-}
-\def\jlreq@warekiyear#1#2#3#4{%
- % 昭和:1989年1月7日まで
- \ifnum0\ifnum#1<1988 1\fi\ifnum#1=1989 \ifnum#2=1 \ifnum#3<8 1\fi\fi\fi>0
- 昭和\jlreq@warekiyear@{#1}{1926}{#4}%
- % 平成:2019年4月末日まで
- \else%\ifnum0\ifnum#1<2019 1\fi\ifnum#1=1989 \ifnum#2<5 1\fi\fi>0
- 平成\jlreq@warekiyear@{#1}{1989}{#4}%
-% \else
-% 新元号\jlreq@warekiyear@{#1}{2019}{#4}%
- \fi%\fi
-}
-\def\jlreq@warekiyear@#1#2#3{\ifnum#1=#2 元年\else #3\numexpr#1-#2+1\relax 年\fi}
-\def\today{%
- \if西暦
- \jlreq@iftdir{%
- \kansuji\year 年%
- \kansuji\month 月%
- \kansuji\day 日%
- }{%
- \number\year 年%
- \number\month 月%
- \number\day 日%
- }%
- \else
- \jlreq@iftdir{%
- \jlreq@wareki{\year}{\month}{\day}{\kansuji}%
- }{%
- \jlreq@wareki{\year}{\month}{\day}{\number}%
- }%
- \fi
-}
-\jlreq@jlreqsetup@add{year_style}[seireki,wareki]{%
- \jlreq@switch{#1}{%
- {seireki}{\西暦true}
- {wareki}{\西暦false}
- }
-}
-\if@tate
- \jlreqsetup{year_style=wareki}
-\else
- \jlreqsetup{year_style=seireki}
-\fi
-
-% 時刻
-\hour=\time \divide\hour by 60
-\minute=\numexpr\time - 60*\hour\relax
-
-%.. 定理環境
-\jlreq@saveoriginalcs{\@begintheorem}
-\jlreq@saveoriginalcs{\@opargbegintheorem}
-\def\@begintheorem#1#2{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
- \trivlist\labelsep=1\zw
- \itemindent=\dimexpr\jlreq@theorem@indent\relax
- \item[\hskip \labelsep{\sffamily\bfseries #1\ #2}]}
-\def\@opargbegintheorem#1#2#3{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
- \trivlist\labelsep=1\zw
- \itemindent=\dimexpr\jlreq@theorem@indent\relax
- \item[\hskip \labelsep{\sffamily\bfseries #1\ #2(#3)}]}
-\AtEndOfPackageFile*{amsthm}{%
- \jlreq@saveoriginalcs{\proof}%
- \jlreq@saveoriginalcs{\endproof}%
- \edef\jlreq@do{
- \unexpanded{\def\jlreq@proof[#1]}{%
- \unexpanded{\labelsep=1\zw}%
- \expandonce{\proof[{\reset@font\sffamily\bfseries #1\inhibitglue}\nopunct]}%
- }
- }
- \jlreq@do
- \def\proof{\@ifnextchar[{\jlreq@proof}{\jlreq@proof[\proofname]}}
- \renewcommand{\proofname}{証明}
- \jlreq@setupamsthm
- \theoremstyle{jlreq}
-}
-\def\jlreq@setupamsthm{
- \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\normalfont}{\dimexpr\jlreq@theorem@indent\relax}{\sffamily\bfseries}{}{1\zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{(##3)}}
-}
-\jlreq@jlreqsetup@add{theorem_beforeafter_space}{
- \def\jlreq@theorem@beforeafter@space{#1}
- \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
-}
-\jlreq@jlreqsetup@add{theorem_indent}{
- \def\jlreq@theorem@indent{#1}
- \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
-}
-\jlreqsetup{theorem_beforeafter_space=1\baselineskip,theorem_indent=0pt}
-
-
-% デフォルト設定
-\newcommand{\contentsname}{目次}
-\newcommand{\refname}{参考文献}
-\newcommand{\indexname}{索引}
-\pagestyle{plain}
-\pagenumbering{arabic}
-\if@twocolumn
- \twocolumn
- \sloppy
- \flushbottom
-\else
- \onecolumn
- \raggedbottom
-\fi
-\endinput
-
-
+%% Japanese document class based on requirements for Japanese text layout
+%%
+%% The package is distributed under the BSD 2-Clause License
+%%
+%%
+% (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/)
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{jlreq}[2018/08/08 jlreq]
+\RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
+\RequirePackage{jlreq-helpers}
+
+\newcommand*{\jlreq@undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
+% クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
+\newcommand*{\jlreq@aftercls@addtodeletecs}[1]{%
+ \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefcs{#1}{\jlreq@undeferr}}%
+}
+\newcommand*{\jlreq@aftercls@addtodeleteif}[1]{%
+ \appto\jlreq@aftercls@deletecslist{\jlreq@helper@undefif{#1}{\jlreq@undeferr}}%
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeletecs}
+\jlreq@aftercls@addtodeletecs{\jlreq@aftercls@addtodeleteif}
+\AtEndOfClass{%
+ \jlreq@aftercls@deletecslist
+ \jlreq@helper@undefcs{\jlreq@aftercls@deletecslist}{\jlreq@undeferr}%
+ \undef{\jlreq@undeferr}%
+}
+
+% preambleにいるかのスイッチ
+\newif\ifjlreq@preamble
+\jlreq@preambletrue
+\AtBeginDocument{\jlreq@preamblefalse}
+
+\def\jlreq@saveoriginalcs#1{%
+ \ifx#1\relax
+ \ClassError{jlreq}{Trying to save \string#1 but it's not defined, may be a bug}{\@ehc}%
+ \fi
+ \expandafter\ifx\csname jlreq@original@\expandafter\@gobble\string#1\endcsname\relax\else
+ \ClassError{jlreq}{Trying to save \string#1 twice, may be a bug}{\@ehc}%
+ \fi
+ \expandafter\let\csname jlreq@original@\expandafter\@gobble\string#1\endcsname=#1
+}
+\def\jlreq@useoriginalcs#1{%
+ \ifcsname jlreq@original@\expandafter\@gobble\string#1\endcsname\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {\csname jlreq@original@\expandafter\@gobble\string#1\endcsname}%
+ {#1}%
+}
+
+%. オプションの定義
+% オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する)
+% ものは\jlreq@option@<key>に格納する.
+% _とかは@に変換する.
+% 引数無しの\DeclareOptionX
+\newcommand*{\jlreq@DeclareOption}[2]{%
+ \DeclareOptionX{#1}{%
+ \jlreq@ifempty{##1}{}{\ClassError{jlreq}{The option #1 should have no value}{\@ehc}}%
+ #2%
+ }
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@DeclareOption}
+% エンジン類
+\jlreq@DeclareOption{uplatex}{\let\jlreq@engine=u}
+\jlreq@DeclareOption{platex}{\let\jlreq@engine=p}
+\jlreq@DeclareOption{lualatex}{\let\jlreq@engine=l}
+
+% 文書のタイプ
+\newcommand*\jlreq@article@type{article}
+\define@choicekey{jlreq.cls}{article_type}{article,report,book}{\renewcommand*{\jlreq@article@type}{#1}}
+\jlreq@DeclareOption{article}{\renewcommand*{\jlreq@article@type}{article}}
+\jlreq@DeclareOption{report}{\renewcommand*{\jlreq@article@type}{report}}
+\jlreq@DeclareOption{book}{\renewcommand*{\jlreq@article@type}{book}}
+
+%.. 基本版面.まずは紙サイズ.
+\def\jlreq@switchpapersize{}
+\jlreq@aftercls@addtodeletecs{\jlreq@switchpapersize}
+% \jlreq@addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦}
+
+\def\jlreq@addpapersize#1#2{%
+ \@ifnextchar[{\jlreq@addpapersize@{#1}{#2}}{\jlreq@addpapersize@@{#1}{#2}}
+}
+\def\jlreq@addpapersize@#1#2[#3]{%
+ \edef\@tempa{\unexpanded{\jlreq@addpapersize@@{#1}{#2}}\csexpandonce{jlreq@helper@papersizelist@#3}}%
+ \@tempa
+}
+\newcommand*{\jlreq@addpapersize@@}[4]{%
+ \@for\@tempa:=#1\do{%
+ \eappto\jlreq@switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}%
+ }%
+ \@for\@tempa:=#2\do{%
+ \expandafter\jlreq@DeclareOption\expandafter{\@tempa}{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}%
+ }%
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize}
+\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@}
+\jlreq@aftercls@addtodeletecs{\jlreq@addpapersize@@}
+\DeclareOptionX{paper}{
+ \edef\jlreq@do{%
+ \unexpanded{\jlreq@switch{#1}}{\expandonce{\jlreq@switchpapersize}}%
+ [\unexpanded{%
+ \jlreq@helper@dividebycomma{#1}%
+ \ifjlreq@result
+ \setlength{\paperwidth}{\dimexpr\jlreq@resulta\relax}%
+ \setlength{\paperheight}{\dimexpr\jlreq@resultb\relax}%
+ \else
+ \ClassError{jlreq}{The paper #1 is unknown}{\@ehc}%
+ \fi
+ }]%
+ }%
+ \jlreq@do
+}
+% 紙サイズ一覧.b*はJIS B.
+\jlreq@addpapersize{a0,A0}{}[a0]
+\jlreq@addpapersize{a1,A1}{}[a1]
+\jlreq@addpapersize{a2,A2}{}[a2]
+\jlreq@addpapersize{a3,A3}{a3paper}[a3]
+\jlreq@addpapersize{a4,A4}{a4paper}[a4]
+\jlreq@addpapersize{a5,A5}{a5paper}[a5]
+\jlreq@addpapersize{a6,A6}{a6paper}[a6]
+\jlreq@addpapersize{a7,A7}{}[a7]
+\jlreq@addpapersize{a8,A8}{}[a8]
+\jlreq@addpapersize{a9,A9}{}[a9]
+\jlreq@addpapersize{a10,A10}{}[a10]
+
+\jlreq@addpapersize{b0,B0}{}[b0]
+\jlreq@addpapersize{b1,B1}{}[b1]
+\jlreq@addpapersize{b2,B2}{}[b2]
+\jlreq@addpapersize{b3,B3}{}[b3]
+\jlreq@addpapersize{b4,B4}{b4paper}[b4]
+\jlreq@addpapersize{b5,B5}{b5paper}[b5]
+\jlreq@addpapersize{b6,B6}{b6paper}[b6]
+\jlreq@addpapersize{b7,B7}{}[b7]
+\jlreq@addpapersize{b8,B8}{}[b8]
+\jlreq@addpapersize{b9,B9}{}[b9]
+\jlreq@addpapersize{b10,B10}{}[b10]
+
+\jlreq@addpapersize{c2,C2}{}[c2]
+\jlreq@addpapersize{c3,C3}{}[c3]
+\jlreq@addpapersize{c4,C4}{}[c4]
+\jlreq@addpapersize{c5,C5}{}[c5]
+\jlreq@addpapersize{c6,C6}{}[c6]
+\jlreq@addpapersize{c7,C7}{}[c7]
+\jlreq@addpapersize{c8,C8}{}[c8]
+
+\jlreq@addpapersize{a4var}{}[a4var]
+\jlreq@addpapersize{b5var}{}[b5var]
+
+\jlreq@addpapersize{letter}{letterpaper}[letter]
+\jlreq@addpapersize{legal}{legalpaper}[legal]
+\jlreq@addpapersize{executive}{executivepaper}[executive]
+\jlreq@addpapersize{hagaki}{}[hagaki]
+
+
+%.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a)
+\newcommand*{\jlreq@option@fontsize}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@fontsize}
+\DeclareOptionX{fontsize}{\renewcommand*{\jlreq@option@fontsize}{#1}}
+\jlreq@DeclareOption{10pt}{\renewcommand*{\jlreq@option@fontsize}{10pt}}
+\jlreq@DeclareOption{11pt}{\renewcommand*{\jlreq@option@fontsize}{11pt}}
+\jlreq@DeclareOption{12pt}{\renewcommand*{\jlreq@option@fontsize}{12pt}}
+\newcommand*{\jlreq@option@jafontsize}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@jafontsize}
+\DeclareOptionX{jafontsize}{\renewcommand*{\jlreq@option@jafontsize}{#1}}
+\newcommand*{\jlreq@option@jafontscale}{1}
+\DeclareOptionX{jafontscale}{\renewcommand*{\jlreq@option@jafontscale}{#1}}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@jafontscale}
+%.. 行の長さ
+\newcommand*{\jlreq@option@line@length}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@line@length}
+\DeclareOptionX{line_length}{\renewcommand*{\jlreq@option@line@length}{#1}}
+%.. 1ページあたりの行数
+\newcommand*{\jlreq@option@number@of@lines}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@number@of@lines}
+\DeclareOptionX{number_of_lines}{\renewcommand*{\jlreq@option@number@of@lines}{#1}}
+
+% 地の空き量,のどの空き量で配置位置を決める(2.4.1.b)省略されたら中央配置.
+%.. 天
+\newcommand*{\jlreq@option@head@space}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@head@space}
+\DeclareOptionX{head_space}{\renewcommand*{\jlreq@option@head@space}{#1}}
+
+%.. 地
+\newcommand*{\jlreq@option@foot@space}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@foot@space}
+\DeclareOptionX{foot_space}{\renewcommand*{\jlreq@option@foot@space}{#1}}
+%.. のど
+\newcommand*{\jlreq@option@gutter}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@gutter}
+\DeclareOptionX{gutter}{\renewcommand*{\jlreq@option@gutter}{#1}}
+%.. 小口
+\newcommand*{\jlreq@option@fore@edge}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@fore@edge}
+\DeclareOptionX{fore_edge}{\renewcommand*{\jlreq@option@fore@edge}{#1}}
+
+%.. 柱とノンブル
+\newcommand*{\jlreq@option@headfoot@verticalpos}{}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@headfoot@verticalpos}
+% 本文とヘッダ/フッタの間の空き
+\DeclareOptionX{headfoot_verticalposition}{\renewcommand*{\jlreq@option@headfoot@verticalpos}{#1}}
+% 柱やノンブルの左右の空き
+\newcommand*{\jlreq@headfoot@sidemargin}{0pt}
+\DeclareOptionX{headfoot_sidemargin}{\renewcommand*{\jlreq@headfoot@sidemargin}{#1}}
+
+%.. 段間
+\newcommand*{\jlreq@option@column@gap}{2zw}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@column@gap}
+\DeclareOptionX{column_gap}{\renewcommand*{\jlreq@option@column@gap}{#1}}
+
+%.. 行送り,指定無しの場合は文字サイズの1.7倍とする.(1.5から2倍が好ましい:2.4.2.d 注3)
+\newcommand*{\jlreq@option@baselineskip}{17zw/10}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@baselineskip}
+\DeclareOptionX{baselineskip}{\def\jlreq@option@baselineskip{#1}}
+\DeclareOptionX{linegap}{\def\jlreq@option@baselineskip{1zw + #1}}
+
+%.. 組み方系
+% 行頭に括弧が来たときの配置:3.1.5
+% 段落頭指定_折り返し行頭指定 で与える.
+\newcommand*{\jlreq@open@bracket@pos}{zenkaku_tentsuki}
+\define@choicekey{jlreq.cls}{open_bracket_pos}{zenkaku_tentsuki,zenkakunibu_nibu,nibu_tentsuki}{\renewcommand*{\jlreq@open@bracket@pos}{#1}}
+% ぶら下げ組みをするか:3.8.2 注1
+\newif\ifjlreq@burasage\jlreq@burasagefalse
+\jlreq@DeclareOption{hanging_punctuation}{\jlreq@burasagetrue}
+
+%.. 注
+% 傍注のタイプ
+\newcommand*{\jlreq@option@sidenote@length}{0pt}
+\jlreq@aftercls@addtodeletecs{\jlreq@option@sidenote@length}
+\DeclareOptionX{sidenote_length}{\renewcommand*{\jlreq@option@sidenote@length}{#1}}
+
+%.. もろもろ
+\newif\if@restonecol\@restonecolfalse
+\newif\if@titlepage\@titlepagefalse
+\newif\ifjlreq@option@titlepage \jlreq@option@titlepagefalse % titlepageかnotitlepageかが指定された
+\newif\if@landscape\@landscapefalse
+\newif\if@tate \@tatefalse
+\jlreq@DeclareOption{landscape}{\@landscapetrue}
+\jlreq@DeclareOption{tombo}{\ClassWarningNoLine{jlreq}{The option `tombo' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq@DeclareOption{tombow}{\ClassWarningNoLine{jlreq}{The option `tombow' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq@DeclareOption{mentuke}{\ClassWarningNoLine{jlreq}{The option `mentuke' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq@DeclareOption{tate}{\@tatetrue}
+
+\newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された
+\jlreq@aftercls@addtodeleteif{\ifjlreq@option@twoside}
+\jlreq@DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue}
+\jlreq@DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue}
+\jlreq@DeclareOption{onecolumn}{\@twocolumnfalse}
+\jlreq@DeclareOption{twocolumn}{\@twocolumntrue}
+\jlreq@DeclareOption{titlepage}{\jlreq@option@titlepagetrue\@titlepagetrue}
+\jlreq@DeclareOption{notitlepage}{\jlreq@option@titlepagetrue\@titlepagefalse}
+\jlreq@DeclareOption{draft}{\setlength\overfullrule{5pt}}
+\jlreq@DeclareOption{final}{\setlength\overfullrule{0pt}}
+\newif\if@openright
+\newif\ifjlreq@option@open \jlreq@option@openfalse % openrightかopenanyが指定された
+\jlreq@aftercls@addtodeleteif{\ifjlreq@option@open}
+\jlreq@DeclareOption{openright}{\@openrighttrue\jlreq@option@opentrue}
+\jlreq@DeclareOption{openany}{\@openrightfalse\jlreq@option@opentrue}
+\jlreq@DeclareOption{leqno}{\input{leqno.clo}}
+\jlreq@DeclareOption{fleqn}{\input{fleqn.clo}}
+
+\newcommand*{\jlreq@note}[1]{}
+\jlreq@DeclareOption{jlreq_notes}{\renewcommand*{\jlreq@note}[1]{\message{^^JJLReq note: ##1^^J}}}
+
+\ExecuteOptionsX{article_type=article,paper=a4,open_bracket_pos=zenkaku_tentsuki,onecolumn,final}
+% \@removeelementを一旦置き換えてから\ProcessOptionsXを実行する
+\let\jlreq@temporary@original@@removeelement=\@removeelement
+\let\@removeelement=\jlreq@helper@removeelement
+\ProcessOptionsX\relax
+\let\@removeelement=\jlreq@temporary@original@@removeelement
+\let\jlreq@temporary@original@@removeelement=\@undefined
+
+\ifjlreq@option@titlepage\else
+ \ifthenelse{\equal{\jlreq@article@type}{article}}{\@titlepagefalse}{\@titlepagetrue}
+\fi
+\ifjlreq@option@open\else
+ \ifthenelse{\equal{\jlreq@article@type}{book}}{\@openrighttrue}{\@openrightfalse}
+\fi
+% articleではopenrightは効かない.
+\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+ \if@openright
+ \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article}
+ \@openrightfalse
+ \fi
+}{}
+\ifjlreq@option@twoside\else
+ \ifthenelse{\equal{\jlreq@article@type}{book}}{\@twosidetrue}{\@twosidefalse}
+\fi
+
+\def\jlreq@jlreqsetup@keyvallist{}
+\def\jlreq@jlreqsetup@finally{}
+\newcommand{\jlreqsetup}[1]{%
+ \begingroup
+ \edef\jlreq@do{\unexpanded{\jlreq@parsekeyval[jlreqsetup]}{\expandonce{\jlreq@jlreqsetup@keyvallist}}}%
+ \expandafter\endgroup
+ \jlreq@do{#1}%
+ \jlreq@jlreqsetup@finally
+}
+% \jlreqsetupの項目に加えるマクロ.\jlreq@jlreqsetup@add{key}{action}とするとkeyに対して定義できる.
+% action内ではvalが#1として取得できる.(従ってaction内でマクロを定義する際には##1を使う必要がある.)
+\newcommand{\jlreq@jlreqsetup@add}[1]{%
+ \@ifnextchar[{\jlreq@jlreqsetup@add@{#1}}{\jlreq@jlreqsetup@add@@{#1}}%
+}
+\long\def\jlreq@jlreqsetup@add@#1[#2]#3{%
+ \eappto\jlreq@jlreqsetup@keyvallist{\unexpanded{{#1}[#2]{#3}}}%
+}
+\long\def\jlreq@jlreqsetup@add@@#1#2{%
+ \eappto\jlreq@jlreqsetup@keyvallist{\unexpanded{{#1}{#2}}}%
+}
+% \jlreqsetupの最後に必ず実行される処理を入れる.
+\newcommand\jlreq@jlreqsetup@addtofinally[1]{\eappto\jlreq@jlreqsetup@finally{\unexpanded{#1}}}
+\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add}
+\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add@}
+\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@add@@}
+\jlreq@aftercls@addtodeletecs{\jlreq@jlreqsetup@addtofinally}
+\@onlypreamble\jlreqsetup
+
+% エンジンの設定
+\ifx\jlreq@engine\@undefined
+ \jlreq@helper@guessengine
+ \let\jlreq@engine=\jlreq@result
+\fi
+
+
+% 必要パッケージのロード
+\ifx l\jlreq@engine
+ \RequirePackage{luatexja}
+ \directlua{jlreq = {}}
+\fi
+
+% (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので,
+% これ以前には和文は使えない.
+\ifx l\jlreq@engine\else
+ \epTeXinputencoding utf8
+ \def\zw{zw}\def\zh{zh}
+ % http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1508&parent=8435
+ \if@tate\AtEndPreamble{\par}\fi
+\fi
+\if@tate
+ \AtBeginDocument{\tate\message{《縦組モード》}\adjustbaseline}
+\fi
+
+% \jlreq@gol(Gyo Okuri Length), \jlreq@mol (Moji Okuri Length)を定義
+\let\jlreq@gol=\zh
+\let\jlreq@mol=\zw
+
+%. helper2(エンジン依存系:和文文字を含むものもこれ以降)
+% #1のboxを今の真ん中に配置する.
+\def\jlreq@box@putcenter#1{%
+ \begingroup
+ \jlreq@tempdima=\dimexpr(\ht#1 - \dp#1)/2\relax
+ \setbox\jlreq@tempboxa=\hbox{阿}%
+ \edef\jlreq@do{%
+ \noexpand\lower\the\dimexpr(\jlreq@tempdima - (\ht\jlreq@tempboxa - \dp\jlreq@tempboxa)/2)\relax\unexpanded{\box#1}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% #1の先頭が文字か
+\long\def\jlreq@ifletter#1{%
+ \jlreq@iffirsttoken{#1}{ }{\@secondoftwo}{%
+ \expandafter\expandafter\expandafter\jlreq@helper@ifletter\jlreq@getfirsttoken#1\jlreq@uniqtoken{}\jlreq@endmark@
+ }%
+}
+
+\long\def\jlreq@helper@ifletter#1{%
+ \ifnum
+ 0%
+ \ifcat 阿\noexpand #11\fi
+ \ifcat あ\noexpand #11\fi
+ \ifcat (\noexpand #11\fi
+ \ifcat A\noexpand #11\fi
+ \ifcat 1\noexpand #11\fi
+ >0
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo
+ \fi
+}
+
+
+% 組方向を判定
+% \jlreq@if(y|t)(dir|box)を定義する.
+\ifx l\jlreq@engine\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{
+ \def\jlreq@ifydir{\ifnum\ltjgetparameter{direction}=4 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ \def\jlreq@iftdir{\ifnum\numexpr\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8\relax=3 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ \def\jlreq@ifybox#1{\ifnum\ltjgetparameter{boxdir}{#1}=4 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ \def\jlreq@iftbox#1{\ifnum\numexpr\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8\relax=3 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+}{
+ \def\jlreq@ifydir{\ifydir\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ \def\jlreq@iftdir{\iftdir\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ \def\jlreq@ifybox#1{\ifybox#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+ \def\jlreq@iftbox#1{\iftbox#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+}
+
+% 左ページであるか
+% #1 : odd or even or ページ数
+\def\jlreq@ifleftpage#1{%
+ \ifthenelse{\(\boolean{@tate} \AND
+ \(\equal{#1}{odd} \OR \(\(\NOT \equal{#1}{even}\) \AND \isodd{#1}\)\)
+ \) \OR \(\(\NOT \boolean{@tate}\) \AND
+ \(\equal{#1}{even} \OR \(\(\NOT \equal{#1}{odd}\) \AND \(\NOT \isodd{#1}\)\)\)
+ \)}%
+}
+
+\ifx l\jlreq@engine
+ \newcommand*{\jlreq@getpostbreakpenalty}[1]{\ltjgetparameter{postbreakpenalty}{#1}}
+\else
+ \newcommand*{\jlreq@getpostbreakpenalty}[1]{\postbreakpenalty#1}
+\fi
+
+% 現在行の残りを得る.
+\ifx l\jlreq@engine
+ % 以下のコードはおかしい.
+ \newcommand*{\jlreq@calc@current@linewidth@onecolumn}{%
+ \dimexpr\zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \@totalleftmargin -
+ \ifodd\jlreq@currentpage
+ \oddsidemargin
+ \else
+ \evensidemargin
+ \fi
+ \iftombow - 1in\fi
+ - 1in - \hoffset\relax
+ }
+\else
+ \newcommand*{\jlreq@calc@current@linewidth@onecolumn}{%
+ \dimexpr
+ \jlreq@ifydir{%
+ \zposx{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp - \hoffset
+ \ifodd\jlreq@currentpage
+ - \oddsidemargin
+ \else
+ - \evensidemargin
+ \fi
+ }{%
+ \ifdim\pdfpagewidth=0pt
+ \paperheight
+ \else
+ \pdfpageheight
+ \fi
+ - \topmargin - \headheight - \headsep - \voffset
+ - \zposy{jlreq@rest@width.pos.\the\jlreq@zref@reference@count} sp
+ }%
+ \iftombow - 1in\fi
+ - \@totalleftmargin - 1in
+ \relax
+ }
+\fi
+\newcommand*{\jlreq@calc@current@linewidth}{%
+ \dimexpr\jlreq@calc@current@linewidth@onecolumn
+ \if@twocolumn
+ \ifdim\jlreq@calc@current@linewidth@onecolumn<\dimexpr\linewidth+\columnsep\relax\else
+ - \linewidth - \columnsep
+ \fi
+ \fi
+ \relax
+}
+
+\newdimen\jlreq@current@linewidth
+\newdimen\jlreq@rest@linewidth
+% この命令以降,次にこの命令を実行する前まで\jlreq@current@linewidth/\jlreq@rest@linewidthで
+% この行の行頭からの長さ/残りの長さが取得できる
+\newcommand*{\jlreq@savepos@for@rest@linewidth}{%
+ \jlreq@setcurrentpage
+ \global\advance\jlreq@zref@reference@count by 1\relax
+ \zsavepos{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}%
+ \global\jlreq@current@linewidth=\jlreq@calc@current@linewidth
+ \global\jlreq@rest@linewidth=\dimexpr\linewidth - \jlreq@current@linewidth\relax
+ \edef\jlreq@savepos@iflabelundefined{\noexpand\zref@ifrefundefined{jlreq@rest@width.pos.\the\jlreq@zref@reference@count}}%
+}
+
+\ifx l\jlreq@engine
+ \newcommand*{\lastnodechar}{\directlua{luatexja.pltx_composite_last_node_char()}}% undocumentedな機能を使っている
+\fi
+
+% #1と#2の間に入るjmglue((x)kanjiskipも)を\jlreq@resultskipに入れる
+\ifx l\jlreq@engine
+ \newcommand*{\jlreq@calc@jfmglue}[2]{%
+ \begingroup
+ \setbox\jlreq@tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
+ \setbox\jlreq@tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
+ \edef\jlreq@do{\noexpand\jlreq@resultskip=\the\dimexpr\wd\jlreq@tempboxb - \wd\jlreq@tempboxa\relax\noexpand\relax}%
+ \jlreq@do
+ \directlua{
+ local width = 0
+ local stretch = 0
+ local shrink = 0
+ local n = tex.box["jlreq@tempboxb"].head
+ while n do
+ % すべてのglueの和を計算する.
+ if n.id == node.id("glue") then
+ width = width + n.width
+ stretch = stretch + n.stretch
+ shrink = shrink + n.shrink
+ end
+ n = n.next
+ end
+ tex.setglue("jlreq@tempskipa",width,stretch,shrink)
+ }%
+ % TeXで計測した物と一致していなければTeXでの方を信じる
+ \ifdim\jlreq@resultskip=\jlreq@tempskipa
+ \edef\jlreq@do{\noexpand\jlreq@resultskip=\the\jlreq@tempskipa\relax}%
+ \fi
+ \expandafter\endgroup
+ \jlreq@do
+ }
+\else
+ \newcommand*{\jlreq@calc@jfmglue}[2]{%
+ \begingroup
+ \setbox\jlreq@tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
+ \setbox\jlreq@tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
+ \edef\jlreq@do{\noexpand\jlreq@resultskip=\the\dimexpr\wd\jlreq@tempboxb - \wd\jlreq@tempboxa\relax\noexpand\relax}%
+ \expandafter\endgroup
+ \jlreq@do
+ }
+\fi
+
+\newcount\jlreq@lastnodechar
+% \jlreq@fixjfm<次の文字>の形で使う.
+% jlreq@lastnodecharに入っている値と次のトークン(\futureletで得る)の間に入るJFMグルー等を挿入する
+\newcommand*{\jlreq@fixjfm}{%
+ \begingroup
+ \ifnum\jlreq@lastnodechar>-1
+ \def\jlreq@do{\futurelet\jlreq@nextchar\jlreq@insertjfm}%
+ \else\def\jlreq@do{}\fi
+ \expandafter\endgroup
+ \jlreq@do
+}
+% \jlreq@nextcharと\jlreq@lastnodecharの間のJFMグルーを挿入
+\def\jlreq@insertjfm{%
+ \ifnum\jlreq@getpostbreakpenalty{\jlreq@lastnodechar}=0\else\penalty\jlreq@getpostbreakpenalty{\jlreq@lastnodechar}\fi
+ \begingroup
+ \def\jlreq@do{}%
+ \jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
+ \expandafter\jlreq@ifletter\expandafter{\jlreq@tempa}{%
+ \jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{\jlreq@tempa}%
+% \message{fixjfm Insert: \the\jlreq@resultskip}%
+ \edef\jlreq@do{%
+ \noexpand\hskip\the\jlreq@resultskip\space
+ \noexpand\inhibitglue
+ }%
+ }{}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\ifx l\jlreq@engine
+ \newcommand*{\jlreq@divide}[2]{%
+ \jlreq@resultdimen=\directlua{tex.print(tostring(\strip@pt\dimexpr #1\relax/\strip@pt\dimexpr #2\relax) .. "pt ")}%
+ }
+\else
+ \let\jlreq@divide=\jlreq@helper@divide
+\fi
+
+%. 基本設定
+\providecommand*{\jlreq@kanjiskip}{0pt plus 0.25\zw minus 0pt}
+\providecommand*{\jlreq@xkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
+\ifx l\jlreq@engine
+ \ltjsetparameter{kanjiskip=\jlreq@kanjiskip}
+ \ltjsetparameter{xkanjiskip=\jlreq@xkanjiskip}
+\else
+ \kanjiskip=\jlreq@kanjiskip
+ \xkanjiskip=\jlreq@xkanjiskip
+\fi
+
+% 文字クラスのリスト(必要なものだけ)
+% 開き括弧(文字クラス1)
+\edef\jlreq@charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq@engine\else ⦅〘〖«〝\fi}
+% 閉じ括弧(文字クラス2)
+\edef\jlreq@charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq@engine\else⦆〙〗»〟\fi}
+% ハイフン(文字クラス3)
+\edef\jlreq@charlist@hyphens{‐〜\ifx p\jlreq@engine\else ゠–\fi}
+% 区切り約物(文字クラス4)
+\edef\jlreq@charlist@dividingpunctuationmarks{!?\ifx p\jlreq@engine\else ‼⁇⁈⁉\fi}
+% 中点類(文字クラス5)
+\edef\jlreq@charlist@middlenodes{・:;}
+% 句点類(文字クラス6)
+\edef\jlreq@charlist@fullstops{。.}
+% 読点類(文字クラス7)
+\edef\jlreq@charlist@commas{、,}
+% 分離禁止文字(文字クラス8)
+\edef\jlreq@charlist@inseparablecharacters{—…‥\ifx p\jlreq@engine\else 〳〴〵\fi}
+% 繰返し記号(文字クラス9)
+\edef\jlreq@charlist@iterationmarks{ヽヾゝゞ々\ifx p\jlreq@engine\else 〻\fi}
+% 長音記号(文字クラス10)
+\edef\jlreq@charlist@prolongedsoundmark{ー}
+% 小書きの仮名(文字クラス11)
+\edef\jlreq@charlist@smallkana{ぁぃぅぇぉァィゥェォっゃゅょゎッャュョヮヵヶ\ifx p\jlreq@engine\else ゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ\fi}%ㇷ゚
+% 前置省略記号(文字クラス12)
+\edef\jlreq@charlist@prefixedabbreviations{¥$£#\ifx p\jlreq@engine\else €№\fi}
+% 平仮名(文字クラス15)
+\edef\jlreq@charlist@hiragana{あいうえおかがきぎくぐけげこごさざしじすずせぜそぞただちぢつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもやゆよらりるれろわゐゑをん\ifx p\jlreq@engine\else ゔ\fi}% か゚き゚く゚け゚こ゚
+% 片仮名(文字クラス16)
+\edef\jlreq@charlist@katakana{アイウエオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモヤユヨラリルレロワヰヱヲンヴ\ifx p\jlreq@engine\else ヷヸヹヺ\fi}% カ゚キ゚ク゚ケ゚コ゚セ゚ツ゚ト゚
+
+\ifx l\jlreq@engine
+ \newcommand*{\jlreq@setpostbreakpenalty@}[2]{\ltjsetparameter{postbreakpenalty={`#1,#2}}}
+ \newcommand*{\jlreq@setprebreakpenalty@}[2]{\ltjsetparameter{prebreakpenalty={`#1,#2}}}
+ \newcommand*{\jlreq@addjaxspmode@}[2]{%
+ \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
+ \jlreq@switch{#2}{
+ {pre}{%
+ \ifnum\jlreq@tempcnta=2
+ \ltjsetparameter{jaxspmode={`#1,allow}}%
+ \else\ifnum\jlreq@tempcnta=0
+ \ltjsetparameter{jaxspmode={`#1,preonly}}%
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq@tempcnta=1
+ \ltjsetparameter{jaxspmode={`#1,allow}}%
+ \else\ifnum\jlreq@tempcnta=0
+ \ltjsetparameter{jaxspmode={`#1,postonly}}%
+ \fi\fi
+ }
+ }%
+ }
+ \newcommand*{\jlreq@deljaxspmode@}[2]{%
+ \jlreq@tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
+ \jlreq@switch{#2}{
+ {pre}{%
+ \ifnum\jlreq@tempcnta=2
+ \ltjsetparameter{jaxspmode={`#1,postonly}}%
+ \else\ifnum\jlreq@tempcnta=1
+ \ltjsetparameter{jaxspmode={`#1,inhibit}}%
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq@tempcnta=3
+ \ltjsetparameter{jaxspmode={`#1,preonly}}%
+ \else\ifnum\jlreq@tempcnta=2
+ \ltjsetparameter{jaxspmode={`#1,inhibit}}%
+ \fi\fi
+ }
+ }%
+ }
+\else
+ \newcommand*{\jlreq@setpostbreakpenalty@}[2]{\postbreakpenalty`#1=#2}
+ \newcommand*{\jlreq@setprebreakpenalty@}[2]{\prebreakpenalty`#1=#2}
+ \newcommand*{\jlreq@addjaxspmode@}[2]{%
+ \jlreq@tempcnta=\inhibitxspcode`#1
+ \jlreq@switch{#2}{
+ {pre}{%
+ \ifnum\jlreq@tempcnta=1
+ \inhibitxspcode`#1=3
+ \else\ifnum\jlreq@tempcnta=0
+ \inhibitxspcode`#1=2
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq@tempcnta=2
+ \inhibitxspcode`#1=3
+ \else\ifnum\jlreq@tempcnta=0
+ \inhibitxspcode`#1=1
+ \fi\fi
+ }
+ }%
+ }
+ \newcommand*{\jlreq@deljaxspmode@}[2]{%
+ \jlreq@tempcnta=\inhibitxspcode`#1
+ \jlreq@switch{#2}{
+ {pre}{%
+ \ifnum\jlreq@tempcnta=3
+ \inhibitxspcode`#1=1
+ \else\ifnum\jlreq@tempcnta=2
+ \inhibitxspcode`#1=0
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq@tempcnta=3
+ \inhibitxspcode`#1=2
+ \else\ifnum\jlreq@tempcnta=1
+ \inhibitxspcode`#1=0
+ \fi\fi
+ }
+ }%
+ }
+\fi
+% #1{...}{#3}を...が#2のリストに対して適用.
+\newcommand*\jlreq@iterateapply[3]{%
+ \edef\jlreq@tempa{#2}%
+ \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@tempa\do{%
+ \expandafter#1\expandafter{\@tempa}{#3}%
+ }%
+}
+\def\jlreq@setpostbreakpenalty{\jlreq@iterateapply{\jlreq@setpostbreakpenalty@}}
+\def\jlreq@setprebreakpenalty{\jlreq@iterateapply{\jlreq@setprebreakpenalty@}}
+\def\jlreq@addjaxspmode{\jlreq@iterateapply{\jlreq@addjaxspmode@}}
+\def\jlreq@deljaxspmode{\jlreq@iterateapply{\jlreq@deljaxspmode@}}
+
+\jlreq@aftercls@addtodeletecs{\jlreq@iterateapply}
+\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty}
+\jlreq@aftercls@addtodeletecs{\jlreq@setpostbreakpenalty@}
+\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty}
+\jlreq@aftercls@addtodeletecs{\jlreq@setprebreakpenalty@}
+\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode}
+\jlreq@aftercls@addtodeletecs{\jlreq@addjaxspmode@}
+\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode}
+\jlreq@aftercls@addtodeletecs{\jlreq@deljaxspmode@}
+
+% 行末禁則
+\jlreq@setpostbreakpenalty{\jlreq@charlist@openingbrackets}{10000}
+\jlreq@setpostbreakpenalty{\jlreq@charlist@prefixedabbreviations}{10000}
+
+% 行頭禁則
+\jlreq@setprebreakpenalty{\jlreq@charlist@closingbrackets}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@hyphens}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@dividingpunctuationmarks}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@middlenodes}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@fullstops}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@commas}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@iterationmarks}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@prolongedsoundmark}{10000}
+\jlreq@setprebreakpenalty{\jlreq@charlist@smallkana}{10000}
+
+% xkanjiskip
+\jlreq@addjaxspmode{\jlreq@charlist@iterationmarks}{pre}
+\jlreq@addjaxspmode{\jlreq@charlist@iterationmarks}{post}
+\jlreq@addjaxspmode{\jlreq@charlist@prolongedsoundmark}{pre}
+\jlreq@addjaxspmode{\jlreq@charlist@prolongedsoundmark}{post}
+\jlreq@addjaxspmode{\jlreq@charlist@smallkana}{pre}
+\jlreq@addjaxspmode{\jlreq@charlist@smallkana}{post}
+\jlreq@addjaxspmode{\jlreq@charlist@hiragana}{pre}
+\jlreq@addjaxspmode{\jlreq@charlist@hiragana}{post}
+\jlreq@addjaxspmode{\jlreq@charlist@katakana}{pre}
+\jlreq@addjaxspmode{\jlreq@charlist@katakana}{post}
+\jlreq@addjaxspmode{\jlreq@charlist@dividingpunctuationmarks}{post}
+
+% 分割禁止(分離禁止文字は特定の並びで分割禁止だが,とりあえず一括で禁止しておく.)
+\jlreq@setprebreakpenalty{\jlreq@charlist@inseparablecharacters}{10000}
+% ¥100とか70%とか……
+
+%.. 文字範囲
+\ifx u\jlreq@engine
+ % \kcatcodeの設定
+ \def\jlreq@setkcatcode#1#2{\@for\@tempa:=#1\do{\kcatcode"\@tempa=#2\relax}}
+ \jlreq@aftercls@addtodeletecs{\jlreq@setkcatcode}
+ % LuaTeX-jaのデフォルトのままに近い設定をする
+ % 範囲1&8
+ \jlreq@setkcatcode{80}{15} % Latin-1 Supplement,どうしよう……
+ \jlreq@setkcatcode{100,180,250,2B0,300,1E00}{15}
+ % 範囲2
+ \jlreq@setkcatcode{370,400,1F00}{18}
+ % 範囲3
+ \jlreq@setkcatcode{2000,2070,20A0,20D0,2100,2150,2190,2200,2300,2400,2500,2580,25A0,2600,2700,2900,2980,2B00}{18}
+ % 範囲4
+ \jlreq@setkcatcode{500,530,590,600,700,750,780,7C0,800,840,8A0,900,980,A00,A80,B00,B80,C00,C80,D00,D80,E00,E80,F00,1000,10A0,1200,1380,13A0,1400,1680,16A0,1700,1720,1740,1760,1780,1800,18B0,1900,1950,1980,19E0,1A00,1A20,1AB0,1B00,1B80,1BC0,1C00,1C50,1C80,1CC0,1CD0,1D00,1D80,1DC0,2400,2440,27C0,27F0,2800,2A00,2C00,4DC0,A4D0,A500,A640,A6A0,A700,A720,A800,A840,A880,A8E0,A900,A930,A960,A980,A9E0,AA00,AA60,AA80,AAE0,AB00,AB30,AB70,ABC0,FB00,FB50,FE00,FE20,FE70,10000,10080,10100,10140,10190,101D0,10280,102A0,102E0,10300,10330,10350,10380,103A0,10400,10450,10480,104B0,10500,10530,10600,10800,10840,10860,10880,108E0,10900,10920,10980,109A0,10A00,10A60,10A80,10AC0,10B00,10B40,10B60,10B80,10C00,10C80,10E60,11000,11080,110D0,11100,11150,11180,111E0,11200,11280,112B0,11300,11400,11480,11580,11600,11660,11680,11700,118A0,11AC0,11C00,11C70,12000,12400,12480,13000,14400,16800,16A40,16AD0,16B00,16F00,16FE0,17000,18800,1B000,1BC00,1BCA0,1D000,1D100,1D200,1D300,1D360,1D400,1D800,1E000,1E800,1E900,1EE00,1F000,1F030,1F0A0,1F100,1F200,1F300,1F600,1F650,1F680,1F700,1F780,1F800,1F900,E000}{15}
+ % 範囲5(Variation Selectors SupplementはLuaTeX-jaではE01F0--E01EFまで範囲5,他は範囲6)
+ \jlreq@setkcatcode{D800,DB80,DC00,E0000,F0000,100000}{15}
+ % 範囲6
+ \jlreq@setkcatcode{3040,30A0,31F0}{17} % Hiragana,Katakana,Katakana Phonetic Extensions
+ \jlreq@setkcatcode{2460,3000,3200,3300,FE10,FE30,FE50,E0100}{18} % Enclosed Alphanumerics,CJK Symbols and Punctuation,Enclosed CJK Letters and Months,CJK Compatibility,Vertical Forms,CJK Compatibility Forms,Small Form Variants,Variation Selectors Supplement
+ \jlreq@setkcatcode{2E80,3190,3400,4E00,F900,20000}{16}
+ % 範囲7
+ \jlreq@setkcatcode{A000,A490}{18} % Yi Syllables,Yi Radicals
+ \jlreq@setkcatcode{1100,3130,AC00,D7B0}{19} % Hangul Jamo,Hangul Compatibility Jamo,Hangul Syllables,Hangul Jamo Extended-B
+ \jlreq@setkcatcode{2F00,2FF0,3100,31A0,31C0,A830}{16}
+\fi
+
+% フォントサイズを設定
+\newdimen\jlreq@fontsize
+\newdimen\jlreq@jafontsize
+\ifx l\jlreq@engine
+ % Q,zw,zhが正しく扱われるようになる.\dimexprつきに展開される.
+ \def\jlreq@expand@optionfontsize#1{%
+ \dimexpr\directlua{
+ local act = string.char(92)
+ local s = [[#1]]
+ s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax")
+ tex.print(s)
+ }\relax
+ }%
+\else
+ \def\jlreq@expand@optionfontsize#1{\dimexpr#1\relax}
+\fi
+\jlreq@aftercls@addtodeletecs{\jlreq@expand@optionfontsize}
+\ifx\jlreq@option@fontsize\@empty
+ \ifx\jlreq@option@jafontsize\@empty
+ \jlreq@fontsize=10pt
+ \jlreq@jafontsize=\jlreq@option@jafontscale\jlreq@fontsize
+ \else
+ \setlength{\jlreq@jafontsize}{\jlreq@expand@optionfontsize{\jlreq@option@jafontsize}}
+ \jlreq@divide{\jlreq@jafontsize}{\jlreq@option@jafontscale pt}
+ \jlreq@fontsize=\jlreq@resultdimen
+ \fi
+\else
+ \setlength{\jlreq@fontsize}{\jlreq@expand@optionfontsize{\jlreq@option@fontsize}}
+ \ifx\jlreq@option@jafontsize\@empty
+ \jlreq@jafontsize=\jlreq@option@jafontscale\jlreq@fontsize
+ \else
+ \setlength{\jlreq@jafontsize}{\jlreq@expand@optionfontsize{\jlreq@option@jafontsize}}
+ \fi
+\fi
+%. フォント
+\RequirePackage{lmodern}
+
+%.. 古いフォントコマンド
+\DeclareOldFontCommand{\jlreq@oldfontcommand@mc}{\normalfont\mcfamily}{\mathmc}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@gt}{\normalfont\gtfamily}{\mathgt}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@tt}{\normalfont\ttfamily}{\mathtt}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@bf}{\normalfont\bfseries}{\mathbf}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@sl}{\normalfont\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\jlreq@oldfontcommand@sc}{\normalfont\scshape}{\@nomath\sc}
+\newcommand*{\jlreq@oldfontcommand@enable}{%
+ \let\mc=\jlreq@oldfontcommand@mc
+ \let\gt=\jlreq@oldfontcommand@gt
+ \let\rm=\jlreq@oldfontcommand@rm
+ \let\sf=\jlreq@oldfontcommand@sf
+ \let\tt=\jlreq@oldfontcommand@tt
+ \let\bf=\jlreq@oldfontcommand@bf
+ \let\it=\jlreq@oldfontcommand@it
+ \let\sl=\jlreq@oldfontcommand@sl
+ \let\sc=\jlreq@oldfontcommand@sc
+}
+\newcommand*{\jlreq@oldfontcommand@disable}{%
+ \let\mc=\@undefined
+ \let\gt=\@undefined
+ \let\rm=\@undefined
+ \let\sf=\@undefined
+ \let\tt=\@undefined
+ \let\bf=\@undefined
+ \let\it=\@undefined
+ \let\sl=\@undefined
+ \let\sc=\@undefined
+}
+
+\DeclareRobustCommand*{\cal}{\@fontswitch\relax\mathcal}
+\DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal}
+
+%.. 和文
+% ダミー
+\def\@ptsize{0}
+% JFMに関連する設定
+\ifx l\jlreq@engine
+ % この値は後でjfm-jlreq内で読む
+ \directlua{jlreq.open_bracket_pos = [[\jlreq@open@bracket@pos]]}
+ \ifjlreq@burasage\directlua{jlreq.burasage = true}\else\directlua{jlreq.burasage = false}\fi
+ % \item後の行頭括弧のために仕込み.
+ \jlreq@saveoriginalcs{\list}
+ \jlreq@saveoriginalcs{\endlist}
+ \PushPostHook{par}{\jlreq@parhook@atbeginlist}
+ \pretocmd{\list}{\def\jlreq@parhook@atbeginlist{\ltjfakeparbegin}}{}{}
+ \apptocmd{\endlist}{\def\jlreq@parhook@atbeginlist{}}{}{}
+ \def\jlreq@parhook@atbeginlist{}
+\else
+ % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処.
+ % 行頭括弧に対して\inhibitglueを入れたりする命令を作る
+ % \jlreq@charlist@openingbracketsの各括弧に対して,\ifx\jlreq@nextchar 「1\fiみたいなのが並んだのを作る
+ \def\jlreq@tempa{}
+ \def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar#11\fi}\jlreq@do}}
+ \expandafter\jlreq@do\jlreq@charlist@openingbrackets\jlreq@endmark
+ % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる.
+ \ifthenelse{\equal{\jlreq@open@bracket@pos}{nibu_tentsuki}}{
+ \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\hskip -.5\zw\inhibitglue}\noexpand\fi}
+ }{% zenkakunibu_nibu,zenkaku_tentsuki
+ \edef\jlreq@openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
+ }
+ % source special対策
+ \def\jlreq@openbracket@hook{\ifx\jlreq@nextchar\special\expandafter\jlreq@openbracket@hook@@\else\expandafter\jlreq@openbracket@hook@\fi}
+ \def\jlreq@openbracket@hook@@#1#2{#1{#2}\futurelet\jlreq@nextchar\jlreq@openbracket@hook}
+ \def\jlreq@jfmname@prefix{}
+ \jlreq@aftercls@addtodeletecs{\jlreq@jfmname@prefix}
+ \ifjlreq@burasage\edef\jlreq@jfmname@prefix{b\jlreq@jfmname@prefix}\fi
+ \ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{\edef\jlreq@jfmname@prefix{\jlreq@jfmname@prefix z}}{}
+ \ifx u\jlreq@engine\edef\jlreq@jfmname@prefix{u\jlreq@jfmname@prefix}\fi
+ \edef\jlreq@jfmname{\jlreq@jfmname@prefix jlreq} % JFMの名前
+ \edef\jlreq@jfmnameg{\jlreq@jfmname@prefix jlreqg} % ゴシックなJFMの名前
+ \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}}
+\fi
+
+% 行頭の括弧は \jlreq@open@bracket@before@space \inhibitglue 「みたいにする.
+\ifthenelse{\equal{\jlreq@open@bracket@pos}{zenkakunibu_nibu}}{
+ \def\jlreq@open@bracket@before@space{\hskip\glueexpr-.5\zw\relax}
+}{
+ \def\jlreq@open@bracket@before@space{}
+}
+
+\ifx l\jlreq@engine
+ \RequirePackage{luatexja-adjust}
+ \ltjenableadjust[lineend=extended,priority=true]
+ \ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=10}}
+ \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=-30}}
+\fi
+
+\ifx p\jlreq@engine
+ \def\jlreq@yokokanjiencoding{JY1}
+ \def\jlreq@tatekanjiencoding{JT1}
+\fi
+\ifx u\jlreq@engine
+ \def\jlreq@yokokanjiencoding{JY2}
+ \def\jlreq@tatekanjiencoding{JT2}
+\fi
+\ifx l\jlreq@engine
+ \def\jlreq@yokokanjiencoding{JY3}
+ \def\jlreq@tatekanjiencoding{JT3}
+\fi
+\expandafter\let\csname \jlreq@yokokanjiencoding/mc/m/n/10\endcsname\relax
+\expandafter\let\csname \jlreq@tatekanjiencoding/mc/m/n/10\endcsname\relax
+\jlreq@divide{\jlreq@jafontsize}{\jlreq@fontsize}
+\edef\jlreq@jafontscale{\strip@pt\jlreq@resultdimen}
+\jlreq@aftercls@addtodeletecs{\jlreq@jafontscale}
+\ifx l\jlreq@engine
+ \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreq;script=latn;-kern}{}
+ \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont:jfm=jlreq;script=latn;-kern}{}
+ \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreqv;script=latn;-kern}{}
+ \DeclareFontShape{JT3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont:jfm=jlreqv;script=latn;-kern}{}
+\else
+ \DeclareFontShape{\jlreq@yokokanjiencoding}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmname}{}
+ \DeclareFontShape{\jlreq@yokokanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg}{}
+ \DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmname-v}{}
+ \DeclareFontShape{\jlreq@tatekanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg-v}{}
+\fi
+\@for\jlreq@encoding:=\jlreq@yokokanjiencoding,\jlreq@tatekanjiencoding\do{
+ \@for\jlreq@shape:=n,it,sl,sc\do{
+ \@for\jlreq@series:=m,b,bx,sb,c\do{
+ \ifthenelse{\equal{\jlreq@shape}{n} \AND \equal{\jlreq@series}{m}}{}{
+ \DeclareFontShape{\jlreq@encoding}{gt}{\jlreq@series}{\jlreq@shape}{<->ssub*gt/m/n}{}
+ }
+ }
+ \@for\jlreq@series:=bx,b,sb\do{
+ \DeclareFontShape{\jlreq@encoding}{mc}{\jlreq@series}{\jlreq@shape}{<->ssub*gt/m/n}{}
+ }
+ \@for\jlreq@series:=m,c\do{
+ \ifthenelse{\equal{\jlreq@shape}{n} \AND \equal{\jlreq@series}{m}}{}{
+ \DeclareFontShape{\jlreq@encoding}{mc}{\jlreq@series}{\jlreq@shape}{<->ssub*mc/m/n}{}
+ }
+ }
+ }
+}
+
+% 和文ファミリと欧文ファミリの連動
+\DeclareRobustCommand\rmfamily{%
+ \not@math@alphabet\rmfamily\mathrm
+ \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
+\DeclareRobustCommand\sffamily{%
+ \not@math@alphabet\sffamily\mathsf
+ \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
+\DeclareRobustCommand\ttfamily{%
+ \not@math@alphabet\ttfamily\mathtt
+ \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
+
+% 数式フォント設定
+\ifx l\jlreq@engine\else
+ \DeclareSymbolFont{mincho}{\jlreq@yokokanjiencoding}{mc}{m}{n}
+ \DeclareSymbolFontAlphabet{\mathmc}{mincho}
+ \SetSymbolFont{mincho}{bold}{\jlreq@yokokanjiencoding}{gt}{m}{n}
+ \jfam\symmincho
+ \DeclareMathAlphabet{\mathgt}{\jlreq@yokokanjiencoding}{gt}{m}{n}
+\fi
+\AtBeginDocument{%
+ \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
+ \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
+}
+
+% 和文間隔
+\DeclareRobustCommand*\ {\futurelet\jlreq@nextchar\jlreq@zenkakuspace@ignorespaces}
+% 後続の空白を無視する処理
+\edef\jlreq@zenkakuspace@ignorespaces{%
+ \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@zenkakuspace@ignorespaces@\else\expandafter\jlreq@zenkakuspace@main\fi}%
+}
+\expandafter\def\expandafter\jlreq@zenkakuspace@ignorespaces@\space{\ }
+\def\jlreq@tempa{}
+\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifnum\lastnodechar=`#1 1\fi}\jlreq@do}}
+\expandafter\jlreq@do\jlreq@charlist@dividingpunctuationmarks\jlreq@endmark
+\edef\@tempa{\noexpand\ifnum0\expandonce{\jlreq@tempa}>0 }
+\expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq@zenkakuspace@main\expandafter{\@tempa
+ \hskip 1\zw\hbox{}%
+ \jlreq@lastnodechar=` 
+ \expandafter\jlreq@fixjfm
+ \else\expandafter \fi
+}
+\ifx l\jlreq@engine
+ {
+ \catcode` =\active
+ \global\let =\jlreq@zenkakuspace@main
+ }
+ \AtBeginDocument{\catcode` =\active}
+\fi
+
+% \jaspace
+\DeclareRobustCommand*{\jaspace}[1]{%
+ \ifcsname jlreq@jaspace@#1\endcsname\csname jlreq@jaspace@#1\endcsname
+ \else\ClassError{jlreq}{unknown jaspace: #1}{\@ehc}\fi
+}
+\def\jlreq@jaspace@zenkaku{\hskip\glueexpr 1\zw\relax}
+\def\jlreq@jaspace@nibu{\hskip\glueexpr .5\zw\relax}
+\def\jlreq@jaspace@shibu{\hskip\glueexpr .25\zw\relax}
+
+% 区切り約物.\? みたいな命令を作る.直後の空きが自動で入る.
+% \?*とすると文中の?として扱われる.
+\def\jlreq@tempa{}
+\def\jlreq@do#1{\jlreq@ifendmark{#1}{}{\appto\jlreq@tempa{\ifx\jlreq@nextchar #11\fi}\jlreq@do}}
+\expandafter\jlreq@do\jlreq@charlist@closingbrackets\jlreq@endmark
+\edef\jlreq@dividingpunctuationmarkscommand{%
+ \noexpand\ifnum 0\expandonce{\jlreq@tempa}>0 \unexpanded{\expandafter\ignorespaces\else\expandafter\ \fi}%
+}
+\def\jlreq@do#1{%
+ \jlreq@ifendmark{#1}{}{
+ \expandafter\DeclareRobustCommand\expandafter*\csname #1\endcsname{%
+ \jlreq@ifstar
+ {\hskip .25\zw #1\hskip .25\zw\ignorespaces}%
+ {#1\futurelet\jlreq@nextchar\jlreq@dividingpunctuationmarkscommand}%
+ }
+ \jlreq@do
+ }
+}
+\expandafter\jlreq@do\jlreq@charlist@dividingpunctuationmarks\jlreq@endmark
+
+% \baselineskipの計算
+% いったん文字サイズを変更((u)platexの際にzh/zwをきちんとするため)
+\@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@fontsize}%
+\newdimen\jlreq@baselineskip
+\ifx l\jlreq@engine
+ \setlength{\jlreq@baselineskip}{%
+ \dimexpr\directlua{
+ local act = string.char(92)
+ local s = [[\jlreq@option@baselineskip]]
+ s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw")
+ tex.print(s)
+ }\relax
+ }%
+\else
+ \setlength{\jlreq@baselineskip}{\dimexpr\jlreq@option@baselineskip\relax}
+\fi
+\ifdim\jlreq@fontsize>\jlreq@baselineskip
+ \ClassError{jlreq}{The baselineskip is less than fontsize}{\@ehc}%
+\fi
+\ifthenelse{\lengthtest{\jlreq@baselineskip<1.5\zw} \OR \lengthtest{\jlreq@baselineskip>2\zw}}{
+ \jlreq@note{行間は二分以上全角以下が望ましい (2.4.2.d 注3).}
+}{}
+
+\emergencystretch 3\jlreq@gol
+
+%.. 文字サイズ変更
+\def\jlreq@setfontsizehook{}
+\jlreq@saveoriginalcs{\set@fontsize}
+\apptocmd{\set@fontsize}{\expandafter\def\expandafter\size@update\expandafter{\size@update\jlreq@setfontsizehook}}{}{}
+\appto\jlreq@setfontsizehook{\ifdim\parindent>0pt \setlength{\parindent}{1\zw}\fi}
+\ifx l\jlreq@engine
+ \@tempskipa=\ltjgetparameter{kanjiskip}
+ \ifdim\@tempskipa=\maxdimen\else
+ \appto\jlreq@setfontsizehook{%
+ \ltj@setpar@global
+ \ltjsetkanjiskip\jlreq@kanjiskip
+ \@tempskipa=\ltjgetparameter{xkanjiskip}%
+ \ifdim\@tempskipa>0pt
+ \ltjsetxkanjiskip\jlreq@xkanjiskip
+ \fi
+ }
+ \fi
+\else
+ \appto\jlreq@setfontsizehook{%
+ \kanjiskip=\jlreq@kanjiskip
+ \ifdim\xkanjiskip>0pt
+ \xkanjiskip=\jlreq@xkanjiskip
+ \fi
+ }
+\fi
+
+% \jafontsize
+\ifdim\jlreq@fontsize=\jlreq@jafontsize
+ \let\jafontsize=\fontsize
+\else
+ \def\@tempa#1{
+ \DeclareRobustCommand*{\jafontsize}[2]{%
+ \begingroup
+ \jlreq@iffloat{##1}{%
+ \edef\jlreq@do{\noexpand\fontsize{\strip@pt\dimexpr#1\dimexpr##1pt\relax\relax}}%
+ }{%
+ \edef\jlreq@do{\noexpand\fontsize{\the\dimexpr#1\dimexpr##1\relax\relax}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do{##2}%
+ }
+ }
+ \jlreq@divide{\jlreq@fontsize}{\jlreq@jafontsize}
+ \edef\jlreq@do{\noexpand\@tempa{\strip@pt\jlreq@resultdimen}}
+ \jlreq@do
+\fi
+
+\renewcommand{\normalsize}{%
+ \@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@baselineskip}%
+ \abovedisplayskip 1.1\jlreq@fontsize \@plus .3\jlreq@fontsize \@minus .4\jlreq@fontsize
+ \abovedisplayshortskip \z@ \@plus .3\jlreq@fontsize
+ \belowdisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize
+ \belowdisplayshortskip \belowdisplayskip
+ \let\@listi\@listI}
+
+\if@tate\tate\fi % ここで発行しておく
+\mcfamily\selectfont\normalsize
+\setbox\jlreq@tempboxa\hbox{阿}
+\setlength\Cht{\ht\jlreq@tempboxa}
+\setlength\Cdp{\dp\jlreq@tempboxa}
+\setlength\Cwd{\wd\jlreq@tempboxa}
+\setlength\Cvs{\baselineskip}
+\setlength\Chs{\wd\jlreq@tempboxa}
+
+% 4.1.3.a
+% 2.5.2 \baselineskipは一定の方がよい?
+% \@listiは再定義しないようにした.(\normalsizeと共用でJLReq通りだと思う.)
+\newcommand{\footnotesize}{%
+ \@setfontsize\footnotesize{.8\jlreq@fontsize}{\dimexpr 115\jlreq@baselineskip/170\relax}% 脚注文字サイズの二分より少し小さい値を行間に: 4.2.5.e
+ \abovedisplayskip .6\jlreq@fontsize \@plus.2\jlreq@fontsize \@minus.4\jlreq@fontsize
+ \abovedisplayshortskip \z@ \@plus.1\jlreq@fontsize
+ \belowdisplayshortskip .3\jlreq@fontsize \@plus.1\jlreq@fontsize \@minus.2\jlreq@fontsize
+ \belowdisplayskip \abovedisplayskip}
+% tsize10.cloの引数を,そのまま\jlreq@fontsize/\jlreq@baselineskipでスケーリングしているだけ.
+\newcommand{\small}{%
+ % jsarticleのもの
+ \@setfontsize\small{.9\jlreq@fontsize}{\dimexpr 13\jlreq@baselineskip/17\relax}%
+ \abovedisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize
+ \abovedisplayshortskip \z@ \@plus.3\jlreq@fontsize
+ \belowdisplayshortskip \abovedisplayshortskip
+ \belowdisplayskip \abovedisplayskip}
+\newcommand{\scriptsize}{\@setfontsize\scriptsize{\dimexpr 7\jlreq@fontsize/10\relax}{\dimexpr 8\jlreq@baselineskip/17\relax}}
+\newcommand{\tiny}{\@setfontsize\tiny{\dimexpr 5\jlreq@fontsize/10\relax}{\dimexpr 6\jlreq@baselineskip/17\relax}}
+\newcommand{\large}{\@setfontsize\large{\dimexpr12\jlreq@fontsize/10\relax}{\jlreq@baselineskip}}
+\newcommand{\Large}{\@setfontsize\Large{\dimexpr14\jlreq@fontsize/10\relax}{\dimexpr 21\jlreq@baselineskip/17\relax}}
+\newcommand{\LARGE}{\@setfontsize\LARGE{\dimexpr17\jlreq@fontsize/10\relax}{\dimexpr 25\jlreq@baselineskip/17\relax}}
+\newcommand{\huge}{\@setfontsize\huge{2\jlreq@fontsize}{\dimexpr 28\jlreq@baselineskip/17\relax}}
+\newcommand{\Huge}{\@setfontsize\Huge{\dimexpr 25\jlreq@fontsize/10\relax}{\dimexpr 33\jlreq@baselineskip/17\relax}}
+
+%. plextから一部拝借
+% オプションも*もない\rensuji(コピペ)
+\DeclareRobustCommand{\jlreq@rensuji}[1]{%
+ \ifvmode\leavevmode\fi
+ \jlreq@ifydir{\hbox{#1}}{%
+ \hskip 0pt plus 0.25\zw minus 0pt % \rensujiskipは固定値
+ \setbox\jlreq@tempboxa=\hbox{\yoko#1}%
+ \@tempdima=\dimexpr\ht\jlreq@tempboxa+\dp\jlreq@tempboxa\relax
+ \vrule\@width\z@ \@height.5\@tempdima \@depth.5\@tempdima
+ \hbox to 1\zw{\yoko\hss#1\hss}%
+ \hskip 0pt plus 0.25\zw minus 0pt
+}}
+\def\jlreq@Kanji#1{\expandafter\kansuji\csname c@#1\endcsname}
+
+% このあたりはtarticleと同じ
+\setlength\lineskip{.1\zh}
+\setlength\normallineskip{.1\zh}
+\renewcommand{\baselinestretch}{}
+\setlength\parskip{0\p@ \@plus \p@}
+\setlength\parindent{1\zw}
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+
+% 変数定義(他にも散らばっているけど)
+% 罫線の太さ(4.4.3.c 注1)
+\newdimen\jlreq@omotekeiwidth
+\jlreq@omotekeiwidth=0.12mm
+\newdimen\jlreq@chuubusokeiwidth
+\jlreq@chuubusokeiwidth=0.25mm
+\newdimen\jlreq@urakeiwidth
+\jlreq@urakeiwidth=0.4mm
+% 脚注のインデント
+\newdimen\jlreq@footnoteindent
+
+%\RequirePackage{jlreq-debug}
+
+%. ページレイアウト
+% landscapeの場合縦横をひっくり返す
+\if@landscape
+ \jlreq@swap{\paperwidth}{\paperheight}
+\fi
+
+% \pdfpagewidthとか設定
+\ifx l\jlreq@engine
+ \let\jlreq@pagewidth=\pagewidth
+ \let\jlreq@pageheight=\pageheight
+\else
+ \let\jlreq@pagewidth=\pdfpagewidth
+ \let\jlreq@pageheight=\pdfpageheight
+\fi
+\setlength{\jlreq@pagewidth}{\paperwidth}
+\setlength{\jlreq@pageheight}{\paperheight}
+\iftombow
+ \addtolength{\jlreq@pagewidth}{2in}
+ \addtolength{\jlreq@pageheight}{2in}
+\fi
+
+
+\ifx l\jlreq@engine
+ \def\jlreq@expand@speciallength#1{%
+ % zhやzwを\zhや\zwにする.
+ \directlua{
+ local act = string.char(92)
+ local s = [[#1]]
+ s = s:gsub("zw",act .. "zw"):gsub("zh",act .. "zh")
+ tex.print(s)
+ }%
+ }
+\else
+ \def\jlreq@expand@speciallength#1{#1}
+\fi
+\def\jlreq@speciallength#1{\dimexpr\jlreq@expand@speciallength{#1}\relax}
+
+%.. 二段組み用パラメータ
+\setlength{\columnsep}{\jlreq@speciallength{\jlreq@option@column@gap}}
+\setlength{\columnseprule}{0pt}
+
+%.. 傍注(4.2.7)
+\begingroup
+ \footnotesize
+ \setlength{\jlreq@tempdima}{\jlreq@speciallength{\jlreq@option@sidenote@length}}
+ \jlreq@tempdimb=1\zw
+ \divide\jlreq@tempdima\jlreq@tempdimb
+ \multiply\jlreq@tempdima\jlreq@tempdimb
+ \edef\jlreq@do{
+ \noexpand\setlength{\noexpand\marginparwidth}{\the\jlreq@tempdima}
+ \noexpand\setlength{\noexpand\marginparpush}{\the\dimexpr 0.5\zw\relax} % 同上:4.2.7.g
+ }
+ \expandafter\endgroup
+\jlreq@do
+\ifdim\marginparwidth>0pt
+ \setlength{\marginparsep}{2\zw} % フォントサイズ×2(4.2.7:特に問題に~e)
+\else
+ \setlength{\marginparsep}{0pt}
+\fi
+
+\ifdim\marginparwidth>0pt
+ \ifnum 0\ifdim\marginparwidth>25\zw 1\fi\ifdim\marginparwidth<15\zw 1\fi>0
+ \jlreq@note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).}
+ \fi
+\fi
+% 縦書きの時は脚注に固定
+% (TODO: 頭注)
+\if@tate\@mparswitchfalse\fi
+
+\setlength{\topskip}{1\zw} % フォントサイズと一致させる
+\ifx\jlreq@option@headfoot@verticalpos\@empty
+ \if@tate\def\jlreq@option@headfoot@verticalpos{1zw}
+ \else\def\jlreq@option@headfoot@verticalpos{2zw}\fi
+\fi
+\setlength{\headsep}{\jlreq@speciallength{\jlreq@option@headfoot@verticalpos}}
+\ifdim\headsep<1\zw\relax\jlreq@note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi
+\if@tate
+ \if@twocolumn
+ \addtolength{\headsep}{\dimexpr\marginparwidth + \marginparsep\relax}
+ \fi
+\else
+ \addtolength{\headsep}{-\dimexpr\topskip - \Cht\relax}
+\fi
+\setlength{\headheight}{1\zw}
+
+% \textwidthと\textheightのデフォルト値は縦横ともに0.75倍(調整が入る).
+%.. \textwidth:文字送り方向の行長
+% 二段の場合は最初の段の頭から次の段の後まで
+% 一度\textwidthに一行の長さの文字数を入れる(段組の場合でも)
+\newif\ifjlreq@determine@kihonhanmen@warning@first
+\jlreq@determine@kihonhanmen@warning@firsttrue
+\def\jlreq@determine@kihonhanmen@warning{
+ \ifjlreq@determine@kihonhanmen@warning@first
+ \jlreq@note{基本版面は,a. サイズの決定 b. 仕上りサイズに対する基本版面の配置位置の決定 という手順で行う (2.4.1).}
+ \jlreq@determine@kihonhanmen@warning@firstfalse
+ \fi
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@determine@kihonhanmen@warning}
+\jlreq@aftercls@addtodeleteif{\ifjlreq@determine@kihonhanmen@warning@first}
+\@tempdima=1\zw
+\ifx\jlreq@option@line@length\@empty
+ \if@tate
+ \ifnum 0\ifx\jlreq@option@head@space\@empty 1\fi\ifx\jlreq@option@foot@space\@empty 1\fi>0
+ \setlength{\textwidth}{0.75\paperheight}
+ \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
+ \else
+ \jlreq@determine@kihonhanmen@warning
+ \setlength{\textwidth}{\dimexpr\paperheight - \jlreq@option@head@space - \jlreq@option@foot@space \relax}
+ \fi
+ \else
+ \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0
+ \setlength{\textwidth}{0.75\paperwidth}
+ \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
+ \else
+ \jlreq@determine@kihonhanmen@warning
+ \setlength{\textwidth}{\dimexpr\paperwidth - \jlreq@option@gutter - \jlreq@option@fore@edge\relax}
+ \fi
+ \fi
+ \if@twocolumn
+ \addtolength{\textwidth}{\dimexpr-2\marginparwidth - 2\marginparsep\relax}
+ \setlength{\textwidth}{\dimexpr(\textwidth - \columnsep)/2\relax}
+ \else
+ \addtolength{\textwidth}{\dimexpr-\marginparwidth - \marginparsep\relax}
+ \fi
+\else
+ \setlength{\textwidth}{\jlreq@speciallength{\jlreq@option@line@length}}
+ \divide\textwidth\@tempdima
+ \if@tate
+ \ifnum\number\textwidth>52
+ \jlreq@note{一行の長さは52文字以下が望ましい (2.4.2.c 注2).}
+ \fi
+ \else
+ \ifnum\number\textwidth>40
+ \jlreq@note{一行の長さは40文字以下が望ましい (2.4.2.c 注2).}
+ \fi
+ \fi
+ \multiply\textwidth\@tempdima
+\fi
+\if@twocolumn
+ \setlength{\textwidth}{\dimexpr2\textwidth + \columnsep\relax}
+\fi
+
+
+%.. \textheight:行送り方向の長さ
+% 一番上(直後に\topskip由来が入る)から最終行のベースラインまでの長さ.
+% \topskipが十分ある時は先頭行のベースラインから最終行のベースライン+\topskip
+\def\jlreq@adjusttextheight{
+ \addtolength{\textheight}{-\topskip}
+ \divide\textheight\baselineskip \multiply\textheight\baselineskip
+ \addtolength{\textheight}{\topskip}
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@adjusttextheight}
+\ifx\jlreq@option@number@of@lines\@empty
+ \if@tate
+ \ifnum 0\ifx\jlreq@option@gutter\@empty 1\fi\ifx\jlreq@option@fore@edge\@empty 1\fi>0
+ \setlength{\textheight}{0.75\paperwidth}
+ \jlreq@adjusttextheight
+ \else
+ \jlreq@determine@kihonhanmen@warning
+ \setlength{\textheight}{\dimexpr\paperwidth - \jlreq@option@gutter - \jlreq@option@fore@edge + \topskip - 1\zw\relax}
+ \fi
+ \else
+ \ifnum 0\ifx\jlreq@option@head@space\@empty 1\fi\ifx\jlreq@option@foot@space\@empty 1\fi>0
+ \setlength{\textheight}{0.75\paperheight}
+ \jlreq@adjusttextheight
+ \else
+ \jlreq@determine@kihonhanmen@warning
+ \setlength{\textheight}{\dimexpr\paperheight + 2\topskip - 1\zh - \Cht - \jlreq@option@head@space - \jlreq@option@foot@space\relax}
+ \fi
+ \fi
+\else
+ \setlength{\textheight}{\dimexpr\numexpr\jlreq@option@number@of@lines\relax\baselineskip - \baselineskip + \topskip\relax}
+\fi
+
+%.. 横
+\def\jlreq@setsidemargin@by@gutter#1{
+ \if@tate
+ \setlength{\evensidemargin}{#1}
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax}
+ \addtolength{\evensidemargin}{\Cdp}
+ \else
+ \setlength{\oddsidemargin}{#1}
+ \if@twocolumn
+ \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax}
+ \fi
+ \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax}
+ \fi
+}
+\def\jlreq@setsidemargin@by@fore@edge#1{
+ \jlreq@setsidemargin@by@gutter{#1}
+ \@tempdima=\evensidemargin
+ \evensidemargin=\oddsidemargin
+ \oddsidemargin=\@tempdima
+ \ifjlreq@determine@kihonhanmen@warning@first
+ \jlreq@note{基本版面の配置はのどの空き量を指定する (2.4.1.b).}
+ \fi
+}
+
+\ifx\jlreq@option@gutter\@empty
+ \ifx\jlreq@option@fore@edge\@empty
+ % 中央配置
+ \if@tate
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax}
+ \else
+ \if@twocolumn
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax}
+ \else
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax}
+ \fi
+ \fi
+ \setlength{\oddsidemargin}{.5\oddsidemargin}
+ \ifnum0\if@twocolumn1\fi\if@tate1\fi>0
+ \setlength{\evensidemargin}{\oddsidemargin}
+ \else
+ \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax}
+ \fi
+ \else
+ \jlreq@setsidemargin@by@fore@edge{\jlreq@speciallength{\jlreq@option@fore@edge}}
+ \fi
+\else
+ \jlreq@setsidemargin@by@gutter{\jlreq@speciallength{\jlreq@option@gutter}}
+ \ifx\jlreq@option@fore@edge\@empty\else
+ \ifjlreq@determine@kihonhanmen@warning@first\else
+ \ClassWarningNoLine{jlreq}{fore_edge is ignored}
+ \fi
+ \fi
+\fi
+\addtolength{\oddsidemargin}{-1in}
+\addtolength{\evensidemargin}{-1in}
+
+%.. 縦
+% \topmarginに全体の頭からテキストの頭までの長さを入れる
+% 天の値からtopmarginを設定する
+\def\jlreq@settopmarginbyhead#1{
+ \if@tate
+ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in\relax}
+ \if@twocolumn
+ \addtolength{\topmargin}{\dimexpr\marginparwidth + \marginparsep\relax}
+ \fi
+ \jlreq@note{縦組の場合は地の空き量を指定する (2.4.1.b).}
+ \else
+ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - 1in - \topskip + \Cht\relax}
+ \fi
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyhead}
+% 地の値から
+\def\jlreq@settopmarginbyfoot#1{
+ \if@tate
+ \setlength{\topmargin}{\dimexpr\paperheight - \textwidth - \headsep - \headheight - 1in - #1 - \marginparsep - \marginparwidth\relax}
+ \else
+ \jlreq@note{横組の場合は天の空き量を指定する (2.4.1.b).}
+ \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - 1in - #1\relax}
+ \fi
+}
+\jlreq@aftercls@addtodeletecs{\jlreq@settopmarginbyfoot}
+\ifx\jlreq@option@head@space\@empty
+ \ifx\jlreq@option@foot@space\@empty
+ \if@tate
+ \if@twocolumn
+ \jlreq@settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - 2\marginparwidth - 2\marginparsep)/2\relax}
+ \else
+ \jlreq@settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - \marginparwidth - \marginparsep)/2\relax}
+ \fi
+ \else
+ \jlreq@settopmarginbyhead{\dimexpr(\paperheight - (\textheight - \topskip + 1\zh))/2\relax}
+ \fi
+ \else
+ \jlreq@settopmarginbyfoot{\jlreq@speciallength{\jlreq@option@foot@space}}
+ \fi
+\else
+ \ifx\jlreq@option@foot@space\@empty
+ \jlreq@settopmarginbyhead{\jlreq@speciallength{\jlreq@option@head@space}}
+ \else
+ % 両方指定されていたら,縦書きは地を,横書きは天を使う
+ \if@tate
+ \jlreq@settopmarginbyfoot{\jlreq@speciallength{\jlreq@option@foot@space}}
+ \ifx\jlreq@option@line@length\@empty\else
+ \ClassWarningNoLine{jlreq}{head_space is ignored}
+ \fi
+ \else
+ \jlreq@settopmarginbyhead{\jlreq@speciallength{\jlreq@option@head@space}}
+ \ifx\jlreq@option@number@of@lines\@empty\else
+ \ClassWarningNoLine{jlreq}{foot_space is ignored}
+ \fi
+ \fi
+ \fi
+\fi
+
+%.. 下
+\setlength{\footskip}{\dimexpr\headsep + \if@tate\marginparwidth + \marginparsep\else\topskip - \Cht\fi + \headheight\relax}
+% \maxdepth + \topskip = フォントサイズ×1.5(だってさ)
+\setlength{\maxdepth}{\dimexpr1.5\zw - \topskip\relax}
+
+%. 見出し関係 (4.1)
+% \clear***page
+\newcommand*{\cleartooddpage}{%
+ \clearpage
+ \ifodd\c@page\else
+ \hbox{}%
+ \newpage
+ \if@twocolumn\hbox{}\newpage\fi
+ \fi
+}
+\newcommand*{\cleartoevenpage}{%
+ \clearpage
+ \ifodd\c@page
+ \hbox{}%
+ \newpage
+ \if@twocolumn\hbox{}\newpage\fi
+ \fi
+}
+
+% 扉見出しと別行見出しについては,\<csname> -> \jlreq@headingcs@csname -> 本体と
+% 二段構えで展開されるようにする.一度の展開で\parが出るのを防ぐため.
+% 一度展開を\longなしマクロに渡されると破綻するので.(そういうパッケージが存在する.)
+
+% jlreq@heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される.
+% #1=*または空(見出し命令に*がついていたかで分岐),#2=ラベル,#3=running head
+% デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる.
+
+% 見出しの直前に実行される
+\newcommand*{\jlreq@hook@beforeheadings}[1]{}
+% 見出し名一覧を格納する
+\def\jlreq@heading@allheadings{}
+
+% 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
+% 結果は\jlreq@resultに入る.
+\def\jlreq@heading@make@l@#1#2#3{%
+ \@ifundefined{l@#1}{%
+ % 長さは適当に計測する
+ \begingroup
+ % ちょっと大きめで計測しておく
+ \csname c@#1\endcsname=9
+ \setbox\jlreq@tempboxa=\hbox{#3}%
+ \jlreq@tempdima=\wd\jlreq@tempboxa
+ \csname c@#1\endcsname=26
+ \setbox\jlreq@tempboxa=\hbox{#3}%
+ \ifdim\jlreq@tempdima<\wd\jlreq@tempboxa
+ \jlreq@tempdima=\wd\jlreq@tempboxa
+ \fi
+ % \numexprは四捨五入
+ \jlreq@tempdimb=\dimexpr\the\numexpr\jlreq@tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@result}{%
+ \noexpand\def\expandonce{\csname l@#1\endcsname}{\unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq@tempdimb}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ }{\def\jlreq@result{}}%
+}
+
+\def\jlreq@heading@make@maketoc#1#2{%
+ % 目次への出力をするマクロ.外部に切り出しておく.
+ \@ifundefined{jlreq@heading@maketoc@#1}{%
+ % {1 = *}{2 = ラベル}{3 = running head}
+ \expandafter\def\csname jlreq@heading@maketoc@#1\endcsname##1##2##3{%
+ \ifnum0\jlreq@ifempty{##1}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0\else
+ \csname #1mark\endcsname{##3}%
+ \addcontentsline{toc}{#1}{\protect\numberline{##2}##3}%
+ \fi
+ }%
+ }{}%
+}
+%.. 中/半扉見出し
+% addcontentslineに渡すやつ:番号出すのと出さないの
+\newcommand{\DeclareTobiraHeading}[3]{%
+ \def\jlreq@do{\@removeelement{#1}}%
+ \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}%
+ \appto{\jlreq@heading@allheadings}{,#1}%
+ \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
+ \expandafter\edef\csname jlreq@heading@setting@#1\endcsname{\unexpanded{#3}}%
+ \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewTobiraHeading}%
+ \@ifundefined{c@#1}{\newcounter{#1}}{}%
+ \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
+ \jlreq@heading@make@maketoc{#1}{#2}%
+ \begingroup
+ \let\jlreq@contents@label@format=\@undefined
+ \let\jlreq@format=\@undefined
+ \edef\jlreq@label@format{\expandonce{\csname the#1\endcsname}}%
+ \def\jlreq@heading@clearpage{\clearpage\hbox{}\clearpage}%
+ \def\jlreq@pagestyle{empty}%
+ \jlreq@parsekeyval[DeclareTobiraHeading:#1]{
+ {label_format}{\def\jlreq@label@format{##1}}
+ {format}{\def\jlreq@format####1####2{##1}}
+ {pagestyle}{\def\jlreq@pagestyle{##1}}
+ {type}[han,naka]{%
+ \jlreq@switch{##1}{
+ {han}{\def\jlreq@heading@clearpage{\clearpage}}
+ {naka}{\def\jlreq@heading@clearpage{\clearpage\hbox{}\clearpage}}
+ }%
+ }
+ }{#3}%
+ \def\jlreq@do{}%
+ \ifx\jlreq@format\@undefined
+ \def\jlreq@format##1##2{##1##2}%
+ \fi
+ \edef\jlreq@formatwlabel{\noexpand\jlreq@format{\expandonce{\jlreq@label@format}}}%
+ \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
+ \eappto\jlreq@do{\expandonce{\jlreq@result}}%
+ \edef\jlreq@do{%
+ \expandonce{\jlreq@do}%
+ \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}[####1]####2{%
+ \unexpanded{\ifnum#2>\c@secnumdepth\else}%
+ \unexpanded{\refstepcounter{#1}}%
+ \noexpand\fi
+ \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{}{\expandonce{\jlreq@label@format}}{####1}%
+ \unexpanded{\ifnum#2>\c@secnumdepth\relax}%
+ \expandonce{\jlreq@format{}{##1}}%
+ \noexpand\else
+ \expandafter\expandonce\expandafter{\jlreq@formatwlabel{##2}}%
+ \noexpand\fi
+ \noexpand\@afterheading
+ \expandonce{\jlreq@heading@clearpage}%
+ \unexpanded{\if@restonecol\twocolumn\fi}%
+ }%
+ \noexpand\def\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}####1{%
+ \expandonce{\jlreq@format{}{##1}}%
+ \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq@label@format}}{####1}%
+ \noexpand\@afterheading
+ \expandonce{\jlreq@heading@clearpage}%
+ \unexpanded{\if@restonecol\twocolumn\fi}%
+ }%
+ \noexpand\def\expandonce{\csname jlreq@headingcs@#1\endcsname}{%
+ % 改丁.これでよいのかな.
+ \unexpanded{\if@twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage}%
+ \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq@pagestyle}}\fi
+ \noexpand\secdef{\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}}}%
+ \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\newcommand{\NewTobiraHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareTobiraHeading{#1}{#2}{#3}}%
+}
+\newcommand{\RenewTobiraHeading}[3]{%
+ \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareTobiraHeading{#1}{#2}{#3}}%
+}
+\newcommand{\ProvideTobiraHeading}[3]{%
+ \@ifundefined{#1}{\DeclareTobiraHeading{#1}{#2}{#3}}{}%
+}
+
+%.. 別行見出し
+% \jlreq@BlockHeading@start:別行見出しを出力する命令.
+% \jlreq@BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = フォーマット関連}{5 = 全体フォーマット}*{見出し}[副題]
+% スペース関連={配置:lcr(左中央右)}{字下げ(寸法)}{字上げ(寸法)}{前空き}{後空き}{行取りの行数}{空か*か,偶数ページでも改ページを許可するならば空}
+% 前/後空きはprefixにa:/s:/r:が入る.r:は空きがその値そのものになる.a:/s:は行取りに加えて入る.a:で指定された空きはページ行頭では入らない
+% 後空きの時はs:は指定できない.
+% フォーマット関連:
+% フォーマット関連={ラベルのみのフォーマット}{ラベルフォーマット}{見出し文字列フォーマット}{見出し文字列フォーマット(ラベル無し)}{副題フォーマット}{副題フォーマット(ラベル無し)}{見出し全体のフォーマット}
+% 見出しそのものは「全体フォーマット」に従い出力される.パラメータトークン#1を含み,#1=見出し本体:スペース関連と上の「見出し全体のフォーマット」に基づいて整形される.
+% 見出し全体のフォーマット内では#1=ラベル,#2=見出し文字列,#3=副題,それぞれ各々のフォーマットに基づき整形される.
+% ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題
+% ラベルのみのフォーマットは目次に使われる.
+\newcommand{\jlreq@BlockHeading@start}[5]{%
+ \edef\jlreq@BlockHeading@start@format{\unexpanded{#4}}% この二つは\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
+ \edef\jlreq@BlockHeading@start@totalformat{\unexpanded{#5}}%
+ \jlreq@BlockHeading@start@{#1}{#2}{#3}%
+}
+% {1 = 命令}{2 = レベル}{3 = スペース関連}
+\newcommand{\jlreq@BlockHeading@start@}[3]{%
+ \@ifstar{\@dblarg{\jlreq@BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq@BlockHeading@start@@{#1}{#2}{#3}{}}}%
+}
+% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}[5 = running head]{6 = 見出し}
+\long\def\jlreq@BlockHeading@start@@#1#2#3#4[#5]#6{%
+ \jlreq@ifnextchar[{\jlreq@BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq@BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}%
+}
+
+% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題]
+\long\def\jlreq@BlockHeading@start@@@#1#2#3#4#5#6[#7]{%
+ \edef\jlreq@do{\unexpanded{\jlreq@BlockHeading@start@@@@{#1}{#2}{#3}}{\expandonce{\jlreq@BlockHeading@start@format}}{\expandonce{\jlreq@BlockHeading@start@totalformat}}}%
+ \jlreq@do{#4}{#5}{#6}{#7}%
+}
+
+% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = フォーマット群}{5 = 全フォーマット}{6 = *}{7 = running head}{8 = 見出し}{9 = 副題}
+\long\def\jlreq@BlockHeading@start@@@@#1#2#3#4#5#6#7#8#9{%
+ \edef\jlreq@tempa##1##2##3##4##5##6##7{%
+ \unexpanded{\jlreq@BlockHeading@start@makeoutput{#1}{#2}}{{##1}{##2}{##3}}\unexpanded{{#4}{#6}{#7}{#8}{#9}}%
+ \unexpanded{\def\jlreq@tempb}{{##4}{##5}{##6}{##7}}% 縦方向空き
+ }%
+ \jlreq@tempa#3%
+ \global\advance\jlreq@BlockHeading@spaces@current@count by 1
+ \appto\jlreq@BlockHeading@spaces@current@sequence{_#1}%
+ \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@output@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
+ \expandonce{\jlreq@resultb}%
+ }%
+ \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@space@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
+ \expandonce{\jlreq@tempb}%
+ }%
+ \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@format@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
+ \unexpanded{#5}%
+ }%
+ \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@BlockHeading@spaces@current@count\endcsname{%
+ \expandonce{\jlreq@resulta}%
+ }%
+ \expandafter\xdef\csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count\endcsname{}%
+ \ifx\jlreq@BlockHeading@spaces@headingslist\@empty
+ \expandafter\jlreq@BlockHeading@spaces@outputwospace
+ \expandafter\ignorespaces
+ \else
+ \expandafter\jlreq@BlockHeading@start@afterheading
+ \fi
+}
+
+\def\jlreq@BlockHeading@start@afterheading{\futurelet\jlreq@nextchar\jlreq@BlockHeading@start@afterheading@}
+\edef\jlreq@BlockHeading@start@afterheading@{%
+ \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq@nextchar\expandafter\jlreq@BlockHeading@start@afterheading@@}%
+ \unexpanded{\else\expandafter\jlreq@BlockHeading@start@afterheading@@@\fi}%
+}
+% スペースを読み飛ばす
+\expandafter\def\expandafter\jlreq@BlockHeading@start@afterheading@@\space{\jlreq@BlockHeading@start@afterheading}
+\def\jlreq@BlockHeading@start@afterheading@@@{%
+ \def\jlreq@do{\jlreq@BlockHeading@spaces@output}%
+ \@for\@tempa:=\jlreq@BlockHeading@allheadings\do{%
+ \expandafter\ifx\csname\@tempa\endcsname\jlreq@nextchar\def\jlreq@do{}\fi
+ }%
+ % \jlreq@BlockHeading@HeadingSpaces@ignoretokens内のものは特別扱いする
+ \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq@BlockHeading@HeadingSpaces@ignoretokens\do{%
+ \expandafter\ifx\@tempa\jlreq@nextchar
+ \def\jlreq@do{\jlreq@BlockHeading@start@afterheading@saveafter@cs}%
+ \fi
+ }%
+ \jlreq@do
+}
+
+% コントロールシークエンスを保存
+\def\jlreq@BlockHeading@start@afterheading@saveafter@cs#1{%
+ \csgappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{#1}%
+ \jlreq@BlockHeading@start@afterheading@saveafter@option
+}
+% オプションがあれば保存
+\def\jlreq@BlockHeading@start@afterheading@saveafter@option{%
+ \@ifnextchar[{\jlreq@BlockHeading@start@afterheading@saveafter@option@}{\jlreq@BlockHeading@start@afterheading@saveafter@arguments}%
+}
+\def\jlreq@BlockHeading@start@afterheading@saveafter@option@[#1]{%
+ \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{[#1]}}%
+ \jlreq@BlockHeading@start@afterheading@saveafter@arguments
+}
+% 引数を保存し続けるループ
+\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments{%
+ \jlreq@ifnextchar\bgroup{\jlreq@BlockHeading@start@afterheading@saveafter@arguments@}{\jlreq@BlockHeading@start@afterheading}%
+}
+\def\jlreq@BlockHeading@start@afterheading@saveafter@arguments@#1{%
+ \csxappto{jlreq@BlockHeading@spaces@current@after@\the\jlreq@BlockHeading@spaces@current@count}{\unexpanded{{#1}}}%
+ \jlreq@BlockHeading@start@afterheading@saveafter@arguments
+}
+
+% 特別扱いしたいマクロを並べる
+\def\jlreq@BlockHeading@HeadingSpaces@ignoretokens{\label}
+
+% \jlreq@resultaにaux吐き出しとかを入れて,\jlreq@resultbに出力を入れる(縦方向調整なし)
+% {1 = 命令}{2 = レベル}{3 = スペース関連(横方向のみ)}{4 = フォーマット群}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題}
+\long\def\jlreq@BlockHeading@start@makeoutput#1#2#3#4#5#6#7#8{%
+ \begingroup
+ \ifnum0\jlreq@ifempty{#5}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0
+ \def\jlreq@tempc{*}%
+ \else
+ \def\jlreq@tempc{}%
+ \fi
+ \long\def\jlreq@tempa##1##2##3##4##5##6##7{%
+ \long\def\jlreq@tempa{##1}% 素のラベルのフォーマットを取り出す
+ \edef\jlreq@tempb{\unexpanded{{##2}{##3}{##4}{##5}{##6}{##7}}{\expandonce{\jlreq@tempc}}}% 残り
+ }%
+ \jlreq@tempa#4%
+ \expandafter\jlreq@BlockHeading@start@makeoutput@@\jlreq@tempb{#7}{#8}%
+ \edef\jlreq@do{\noexpand\jlreq@BlockHeading@start@makeoutput@\unexpanded{#3}{\expandonce{\jlreq@result}}}%
+ \jlreq@do
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@resulta}{%
+ \expandafter\if\jlreq@tempc *\else\unexpanded{\refstepcounter{#1}}\fi
+ \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{\unexpanded{#5}}{\expandonce{\jlreq@tempa}}{\unexpanded{#6}}%
+ }%
+ \unexpanded{\def\jlreq@resultb}{%
+ \expandonce{\jlreq@result}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% {1 = 配置(clr)}{2 = 字下げ}{3 = 字上げ}{4 = 出力}
+\long\def\jlreq@BlockHeading@start@makeoutput@#1#2#3#4{%
+ \edef\jlreq@result{%
+ \noexpand\noindent
+ \jlreq@ifempty{#2}{}{\unexpanded{\hskip #2}}%
+ \noexpand\vbox{%
+ \noexpand\noindent
+ \ifx#1c\noexpand\centering\fi
+ \ifx#1r\noexpand\raggedleft\fi
+ \jlreq@ifempty{#2}{}{\unexpanded{\hsize=\dimexpr\hsize - #2\relax}}%
+ \jlreq@ifempty{#3}{}{\unexpanded{\hsize=\dimexpr\hsize - #3\relax}}%
+ \unexpanded{#4}}%
+ }%
+}
+
+% {1 = ラベルフォーマット}{2 = 見出し文字列フォーマット}{3 = 見出し文字列フォーマット(ラベル無し)}{4 = 副題フォーマット}{5 = 副題フォーマット(ラベル無し)}{6 = 全体フォーマット}{7 = *}{8 = 見出し}{9 = 副題}
+% \jlreq@resultに出力対象を入れる
+\long\def\jlreq@BlockHeading@start@makeoutput@@#1#2#3#4#5#6#7#8#9{%
+ \begingroup
+ % \jlreq@tempaに{ラベル}{見出し}{副題}という形のものを入れる
+ \jlreq@ifempty{#7}{%
+ % ラベルあり
+ \long\def\jlreq@tempa{#1}%
+ \long\def\jlreq@tempb##1{#2}%
+ \jlreq@ifempty{#9}{\def\jlreq@tempc##1{}}{\long\def\jlreq@tempc##1{#4}}%
+ }{%
+ \long\def\jlreq@tempa{}%
+ \long\def\jlreq@tempb##1{#3}%
+ \jlreq@ifempty{#9}{\def\jlreq@tempc##1{}}{\long\def\jlreq@tempc##1{#5}}%
+ }%
+ \edef\jlreq@tempa{{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb{#8}}}{\expandonce{\jlreq@tempc{#9}}}}%
+ \long\def\jlreq@tempb##1##2##3{#6}%
+ \edef\jlreq@tempa{\noexpand\expandonce{\noexpand\jlreq@tempb\expandonce{\jlreq@tempa}}}%
+ \edef\jlreq@do{\unexpanded{\def\jlreq@result}{\jlreq@tempa}}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\def\jlreq@BlockHeading@start@removecolumn#1:{#1}
+
+% 空き指定を解釈する.a:10pt -> \jlreq@resulta=a,\jlreq@resultb=10pt
+\def\jlreq@BlockHeading@start@analyzespace#1:#2\jlreq@endmark{%
+ \jlreq@ifempty{#1}{%
+ \def\jlreq@resulta{}%
+ \def\jlreq@resultb{}%
+ }{%
+ \let\jlreq@resulta=#1%
+ \edef\jlreq@resultb{\expandonce{\jlreq@BlockHeading@start@removecolumn#2}}%
+ }%
+}
+
+% 行取り処理
+% {1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}{4 = 偶数ページ改ページするなら空}{5 = 出力}
+\long\def\jlreq@BlockHeading@start@gyodori#1#2#3#4#5{{%
+ \par
+ \jlreq@ifempty{#4}{\jlreq@setcurrentpage}{}%
+ \setbox\jlreq@tempboxa=\vbox{#5}%
+ % \jlreq@tempskip(a/b)に前/後ろに入れるべき値を入れる
+ % #1がa:ならばその値は\jlreq@tempskipaには足さず\jlreq@tempskipcに入れておく
+ \jlreq@tempskipa=0pt
+ \jlreq@tempskipc=0pt
+ \jlreq@BlockHeading@start@analyzespace#1:\jlreq@endmark
+ \let\jlreq@maeakitype=\jlreq@resulta
+ \let\jlreq@maeaki=\jlreq@resultb
+ \jlreq@BlockHeading@start@analyzespace#2:\jlreq@endmark
+ \let\jlreq@ushiroakitype=\jlreq@resulta
+ \let\jlreq@ushiroaki=\jlreq@resultb
+ \def\jlreq@lines{#3}%
+ % 両方強制指定の場合は行数を無視する.
+ \ifx r\jlreq@maeakitype\ifx r\jlreq@ushiroakitype\def\jlreq@lines{}\fi\fi
+ \setbox\jlreq@tempboxb=\hbox{阿}%
+ \ifx\jlreq@lines\@empty
+ \ifx\jlreq@maeaki\@empty\else
+ \jlreq@tempskipa=\glueexpr\jlreq@maeaki\relax
+ \fi
+ \ifx\jlreq@ushiroaki\@empty\else
+ \jlreq@tempskipb=\glueexpr\jlreq@ushiroaki\relax
+ \fi
+ \else
+ % 行取り時の前後の空きを足した値を\jlreq@tempdimaに入れる
+ \jlreq@tempdima=\glueexpr(#3\baselineskip - \baselineskip - \ht\jlreq@tempboxa - \dp\jlreq@tempboxa)\relax
+ \ifx\jlreq@maeakitype\@empty
+ \jlreq@tempskipa=\glueexpr(\jlreq@tempdima + \dp\jlreq@tempboxb - \ht\jlreq@tempboxb)/2\relax
+ \else
+ \ifx a\jlreq@maeakitype
+ \jlreq@tempskipa=\glueexpr(\jlreq@tempdima + \dp\jlreq@tempboxb - \ht\jlreq@tempboxb)/2\relax
+ \jlreq@tempskipc=\glueexpr\jlreq@maeaki\relax
+ \fi
+ \ifx s\jlreq@maeakitype
+ \jlreq@tempskipa=\glueexpr(\jlreq@tempdima + \dp\jlreq@tempboxb - \ht\jlreq@tempboxb)/2 + \jlreq@maeaki\relax
+ \jlreq@tempdima=\dimexpr\jlreq@tempdima + \jlreq@maeaki\relax
+ \fi
+ \ifx r\jlreq@maeakitype
+ \jlreq@tempskipa=\glueexpr\jlreq@maeaki\relax
+ \jlreq@tempdima=\dimexpr\jlreq@tempdima + \baselineskip - \dp\jlreq@tempboxb\relax
+ \fi
+ \fi
+ \ifx\jlreq@ushiroakitype\@empty
+ \jlreq@tempskipb=\glueexpr\jlreq@tempdima - \jlreq@tempskipa\relax
+ \else
+ \ifx a\jlreq@ushiroakitype
+ \jlreq@tempskipb=\glueexpr\jlreq@tempdima - \jlreq@tempskipa + \jlreq@ushiroaki\relax
+ \fi
+ \ifx r\jlreq@ushiroakitype
+ \jlreq@tempskipb=\glueexpr\jlreq@ushiroaki\relax
+ \jlreq@tempskipa=\glueexpr\jlreq@tempdima - \jlreq@tempskipb + \baselineskip - \ht\jlreq@tempboxb\relax
+ \fi
+ \fi
+ \fi
+ \jlreq@ifgluezero\jlreq@tempskipc{}{\vskip\jlreq@tempskipc\relax}%
+ \ifx r\jlreq@maeakitype\prevdepth=-1000pt\fi
+ \setbox\jlreq@tempboxa=\vbox{%
+ \jlreq@ifgluezero\jlreq@tempskipa{}{\vskip\jlreq@tempskipa}%
+ \unvbox\jlreq@tempboxa}%
+ \dp\jlreq@tempboxa=\dimexpr\dp\jlreq@tempboxa + \ht\jlreq@tempboxa\relax
+ \ht\jlreq@tempboxa=0pt
+ \box\jlreq@tempboxa
+ \jlreq@ifempty{#4}{\ifodd\jlreq@currentpage\nobreak\fi}{\nobreak}%
+ \ifx r\jlreq@ushiroakitype\prevdepth=-1000pt\else\prevdepth=0pt\fi
+ \jlreq@ifgluezero\jlreq@tempskipb{}{\vskip\jlreq@tempskipb}%
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@parhook@gyodori}{%
+ \noexpand\parskip=\the\parskip
+ \unexpanded{\def\jlreq@parhook@gyodori{}}%
+ }%
+ \unexpanded{\parskip=0pt plus 1pt}%
+ }%
+\expandafter}\jlreq@do}
+\PushPostHook{par}{\jlreq@parhook@gyodori}
+\def\jlreq@parhook@gyodori{}
+
+% 行取り情報をゲットだぜ
+% \jlreq@resultに{1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}を入れる
+% #2#3#4はそれぞれ前空き,後ろ開き,トータル行数のデフォルト値
+% *つきは\setkeys*を使う.[]はkeyvalのファミリー.
+\def\jlreq@BlockHeading@gyodori@parsekeyval{%
+ \@ifstar{\jlreq@BlockHeading@gyodori@parsekeyval@{*}}{\jlreq@BlockHeading@gyodori@parsekeyval@{}}%
+}
+\def\jlreq@BlockHeading@gyodori@parsekeyval@#1{%
+ \@ifnextchar[{\jlreq@BlockHeading@gyodori@parsekeyval@@{#1}}{\jlreq@BlockHeading@gyodori@parsekeyval@@{#1}[jlreq@key]}%
+}
+\def\jlreq@BlockHeading@gyodori@parsekeyval@@#1[#2]#3#4#5#6{%
+ \begingroup
+ \def\jlreq@lines{#6}%
+ \def\jlreq@before@space{}%
+ \def\jlreq@before@lines{}%
+ \def\jlreq@after@space{}%
+ \def\jlreq@after@lines{}%
+ \jlreq@parsekeyval#1[#2]{
+ {lines}{\def\jlreq@lines{##1}}
+ {before_space}{\def\jlreq@before@space{##1}}
+ {after_space}{\def\jlreq@after@space{##1}}
+ {before_lines}{%
+ \jlreq@iffirsttoken@ignorespaces{##1}{*}%
+ {\edef\jlreq@before@lines{s:\expandonce{\@gobble ##1}}}%
+ {\def\jlreq@before@lines{a:##1}}%
+ }
+ {after_lines}{\def\jlreq@after@lines{##1}}
+ }{#3}%
+ % before/after_lines優先
+ \ifx\jlreq@before@space\@empty\else\edef\jlreq@before@space{r:\expandonce{\jlreq@before@space}}\fi
+ \ifx\jlreq@before@lines\@empty\else\edef\jlreq@before@space{\expandonce{\jlreq@before@lines}\baselineskip}\fi
+ \ifx\jlreq@before@space\@empty\def\jlreq@before@space{#4}\fi
+ \ifx\jlreq@after@space\@empty\else\edef\jlreq@after@space{r:\expandonce{\jlreq@after@space}}\fi
+ \ifx\jlreq@after@lines\@empty\else\edef\jlreq@after@space{a:\expandonce{\jlreq@after@lines}\baselineskip}\fi
+ \ifx\jlreq@after@space\@empty\def\jlreq@after@space{#5}\fi
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@result}{{\expandonce{\jlreq@before@space}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@lines}}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% \DeclareBlockHeading{命令名}{レベル}{設定}
+\def\jlreq@BlockHeading@allheadings{}% 別行見出し一覧
+\newcommand{\DeclareBlockHeading}[3]{%
+ \def\jlreq@do{\@removeelement{#1}}%
+ \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}%
+ \appto\jlreq@heading@allheadings{,#1}%
+ \expandafter\jlreq@do\expandafter{\jlreq@BlockHeading@allheadings}{\jlreq@BlockHeading@allheadings}%
+ \appto\jlreq@BlockHeading@allheadings{,#1}%
+ \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
+ \expandafter\edef\csname jlreq@heading@setting@#1\endcsname{\unexpanded{#3}}%
+ \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewBlockHeading}%
+ \@ifundefined{c@#1}{\newcounter{#1}}{}%
+ \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
+ \jlreq@heading@make@maketoc{#1}{#2}%
+ \begingroup
+ \def\jlreq@font{}%
+ \def\jlreq@subtitle@font{}%
+ \def\jlreq@indent{0\zw}%
+ \def\jlreq@end@indent{0\zw}%
+ \def\jlreq@align{l}%
+ \edef\jlreq@format{\unexpanded{##1##2##3}}%
+ \edef\jlreq@heading@text@format{\unexpanded{##1}}%
+ \def\jlreq@pagebreak{}%
+ \def\jlreq@label@format{\@seccntformat{#1}}%
+ \newif\ifjlreq@hang\jlreq@hangtrue
+ \def\jlreq@after@label@space{1\zw}%
+ \def\jlreq@second@heading@text@indent@wlabel{0pt}%
+ \def\jlreq@second@heading@text@indent@wolabel{0pt}%
+ \edef\jlreq@subtitle@format{\unexpanded{---##1---}}%
+ \def\jlreq@subtitle@indent{1\zw}%
+ \def\jlreq@afterindent{\@afterindenttrue}%
+ \def\jlreq@allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空,そうでないなら*
+ \newif\ifjlreq@subtitle@break\jlreq@subtitle@breaktrue
+ \def\jlreq@subtitle@indent{1\zw}%
+ \def\jlreq@column@spanning{false}%
+ \newif\ifjlreq@column@spanning@possible\jlreq@column@spanning@possiblefalse
+ % a,bみたいなのをaとbにわける.カンマがなければbは空.引数を{a}{b}として##2を呼び出す.
+ \def\jlreq@parsecomma##1##2{%
+ \def\jlreq@tempa####1####2{##2}%
+ \def\@tempa####1,####2\jlreq@endmark{%
+ \jlreq@ifempty{####2}{%
+ \def\@tempa{}%
+ }{%
+ \def\@tempa########1,\jlreq@endmark{\def\@tempa{########1}}%
+ \@tempa####2\jlreq@endmark
+ }%
+ \edef\@tempa{\unexpanded{\jlreq@tempa{####1}}{\expandonce{\@tempa}}}%
+ \edef\jlreq@do{\jlreq@expandtwice{\@tempa}}%
+ }%
+ \@tempa##1,\jlreq@endmark
+ \jlreq@do
+ }%
+ \jlreq@parsekeyval[BlockHeading:#1]{
+ {lines}{}
+ {before_space}{}
+ {after_space}{}
+ {before_lines}{}
+ {after_lines}{}
+ {font}{\def\jlreq@font{##1}}
+ {subtitle_font}{\def\jlreq@subtitle@font{##1}}
+ {indent}{\def\jlreq@indent{##1}}
+ {end_indent}{\def\jlreq@end@indent{##1}}
+ {align}[left,center,right]{%
+ \jlreq@switch{##1}{
+ {left}{\def\jlreq@align{l}}
+ {center}{\def\jlreq@align{c}}
+ {right}{\def\jlreq@align{r}}
+ }%
+ }
+ {format}{\edef\jlreq@format{\unexpanded{##1}}}
+ {after_label_space}{\def\jlreq@after@label@space{##1}}
+ {second_heading_text_indent,heading_text_second_indent}{%
+ \jlreq@parsecomma{##1}{%
+ \jlreq@iffirsttoken{####1}{*}{%
+ \jlreq@hangfalse
+ \edef\jlreq@second@heading@text@indent@wlabel{\expandonce{\@gobble ####1}}%
+ }{%
+ \jlreq@hangtrue
+ \def\jlreq@second@heading@text@indent@wlabel{####1}%
+ }%
+ \jlreq@ifempty{####2}{%
+ \let\jlreq@second@heading@text@indent@wolabel=\jlreq@second@heading@text@indent@wlabel
+ }{%
+ \def\jlreq@second@heading@text@indent@wolabel{####2}%
+ }%
+ }%
+ }
+ {label_format}{\edef\jlreq@label@format{\unexpanded{##1}}}
+ {subtitle_format}{\edef\jlreq@subtitle@format{\unexpanded{##1}}}
+ {subtitle_indent}{\def\jlreq@subtitle@indent{##1}}
+ {subtitle_break}[true,false]{\csname jlreq@subtitle@break##1\endcsname}
+ {afterindent}[true,false]{\edef\jlreq@afterindent{\expandonce{\csname @afterindent##1\endcsname}}}
+ {allowbreak_if_evenpage}[true,false]{%
+ \jlreq@switch{##1}{
+ {true}{\def\jlreq@allowbreak@evenpage{}}
+ {false}{\def\jlreq@allowbreak@evenpage{*}}
+ }%
+ }
+ {pagebreak}[clearpage,cleardoublepage,clearcolumn,nariyuki,begin_with_odd_page,begin_with_even_page]{%
+ \jlreq@switch{##1}{
+ {clearpage}{\def\jlreq@pagebreak{\clearpage}\jlreq@column@spanning@possibletrue}
+ {cleardoublepage}{\def\jlreq@pagebreak{\cleardoublepage}\jlreq@column@spanning@possibletrue}
+ {clearcolumn}{\if@twocolumn\def\jlreq@pagebreak{\newpage}\else\def\jlreq@pagebreak{}\fi\jlreq@column@spanning@possiblefalse}
+ {begin_with_even_page}{\def\jlreq@pagebreak{\cleartoevenpage}\jlreq@column@spanning@possibletrue}
+ {begin_with_odd_page}{\def\jlreq@pagebreak{\cleartooddpage}\jlreq@column@spanning@possibletrue}
+ {nariyuki}{\def\jlreq@pagebreak{}\jlreq@column@spanning@possiblefalse}
+ }%
+ }
+ % 後々数字を受け付けるようになったりするかもしれないので……
+ {column_spanning}{%
+ \jlreq@tempatrue % validな入力に対してfalse
+ \jlreq@ifempty{##1}{}{%
+ \jlreq@ifnumber{##1}{% 数字の時はtrueに回す
+ \jlreq@tempafalse
+ \def\jlreq@column@spanning{true}%
+ }{%
+ \jlreq@switch{##1}{%
+ {true}{\jlreq@tempafalse\def\jlreq@column@spanning{true}}
+ {false}{\jlreq@tempafalse\def\jlreq@column@spanning{false}}
+ }%
+ }%
+ }%
+ \ifjlreq@tempa\ClassWarningNoLine{jlreq}{Invalid input `##1' for column_spanning in BlockHeading #1}\fi
+ }
+ }{#3}%
+ \def\jlreq@do{}% 初期化.これに最終処理を入れていく.
+ % 入力チェック
+ \ifthenelse{\equal{\jlreq@column@spanning}{true}}{%
+ \ifjlreq@column@spanning@possible\else
+ \ClassWarningNoLine{jlreq}{column_spanning can be used only with `pagebreak=nariyuki' or `pagebreak=clearcolumn' (in BlockHeading #1)}%
+ \def\jlreq@column@spanning{false}%
+ \fi
+ }{}%
+ \edef\jlreq@format{\expandonce{\jlreq@font}\expandonce{\jlreq@format}}%
+ % 空き量などの調整を含んだラベル
+ \edef\jlreq@label@format@modified{%
+ \noexpand\noindent
+ \unexpanded{\setbox\jlreq@tempboxa=\hbox}{\expandonce{\jlreq@label@format}}%
+ \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq@after@label@space}) + (\expandonce{\jlreq@second@heading@text@indent@wlabel})%
+ \ifjlreq@hang
+ +\wd\jlreq@tempboxa\relax
+ \else
+ \relax
+ \unexpanded{\edef\jlreq@BlockHeading@start@labellength{\the\wd\jlreq@tempboxa}}%
+ \fi
+ \box\jlreq@tempboxa
+ }%
+ \edef\jlreq@heading@text@format@wlabel{%
+ \ifdim\dimexpr\jlreq@after@label@space\relax=0pt\else
+ \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq@after@label@space}\noexpand\relax}%
+ \fi
+ \expandonce{\jlreq@heading@text@format}%
+ }%
+ \edef\jlreq@heading@text@format@wolabel{%
+ \ifdim\dimexpr\jlreq@second@heading@text@indent@wolabel\relax=0pt\else
+ \noexpand\hangindent=\noexpand\dimexpr\expandonce{\jlreq@second@heading@text@indent@wolabel}\noexpand\relax
+ \fi
+ \expandonce{\jlreq@heading@text@format}%
+ }%
+ \def\jlreq@make@subtitle@format##1##2{%
+ \edef##1{%
+ \ifjlreq@subtitle@break\unexpanded{{\par}\hangafter=0}\fi
+ \unexpanded{\hangindent=\dimexpr\hangindent + }(\expandonce{\jlreq@subtitle@indent}) ##2\noexpand\relax
+ \ifdim\jlreq@subtitle@indent=0pt\else
+ \ifjlreq@subtitle@break\else\unexpanded{\hspace*}{\expandonce{\jlreq@subtitle@indent}}\fi
+ \fi
+ \unexpanded{\nobreak\noindent}%
+ {\ifx\jlreq@subtitle@font\@empty\else\expandonce{\jlreq@subtitle@font}\fi\expandonce{\jlreq@subtitle@format}}%
+ }%
+ }%
+ \jlreq@make@subtitle@format\jlreq@subtitle@format@wlabel{%
+ - (\expandonce{\jlreq@second@heading@text@indent@wlabel})%
+ \ifjlreq@hang\else + (\noexpand\jlreq@BlockHeading@start@labellength)\fi
+ }%
+ \jlreq@make@subtitle@format\jlreq@subtitle@format@wolabel{- (\expandonce{\jlreq@second@heading@text@indent@wolabel})}%
+ \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
+ \eappto\jlreq@do{\expandonce{\jlreq@result}}%
+ \jlreq@BlockHeading@gyodori@parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
+ \let\jlreq@spaceset=\jlreq@result
+ \edef\jlreq@totalformat{\unexpanded{##1}\expandonce{\jlreq@afterindent}\noexpand\@afterheading}%
+ \if@twocolumn
+ \ifthenelse{\equal{\jlreq@column@spanning}{true}}{%
+ \def\@tempa##1##2##3{%
+ % 前開きが常に入ってしまうので,a:の時は除去する
+ \jlreq@iffirsttoken{##1}{a}{\def\jlreq@spaceset{{}{##2}{##3}}}{}
+ \edef\jlreq@totalformat{%
+ \noexpand\twocolumn[%
+ % 普段自動で入る\topskipと\baselineskipを手動で入れる
+ \jlreq@iffirsttoken{##1}{r}{}{\unexpanded{\vskip\topskip\relax}}%
+ \unexpanded{####1}%
+ \jlreq@iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
+ ]%
+ }%
+ }%
+ \expandafter\@tempa\jlreq@spaceset
+ }{}%
+ \fi
+ \edef\jlreq@do{%
+ \expandonce{\jlreq@do}%
+ \noexpand\edef\expandonce{\csname jlreq@headingcs@#1\endcsname}{\noexpand\unexpanded{%
+ \noexpand\jlreq@hook@beforeheadings{#1}%
+ \expandonce{\jlreq@pagebreak}%
+ \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}%
+ {{\expandonce{\jlreq@align}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@end@indent}}\expandonce{\jlreq@spaceset}{\expandonce{\jlreq@allowbreak@evenpage}}}%
+ {%
+ {\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@label@format@modified}}%
+ {\expandonce{\jlreq@heading@text@format@wlabel}}{\expandonce{\jlreq@heading@text@format@wolabel}}%
+ {\expandonce{\jlreq@subtitle@format@wlabel}}{\expandonce{\jlreq@subtitle@format@wolabel}}%
+ {\expandonce{\jlreq@format}}%
+ }%
+ {\expandonce{\jlreq@totalformat}}%
+ }}%
+ \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\newcommand{\NewBlockHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareBlockHeading{#1}{#2}{#3}}%
+}
+\newcommand{\RenewBlockHeading}[3]{%
+ \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareBlockHeading{#1}{#2}{#3}}%
+}
+\newcommand{\ProvideBlockHeading}[3]{%
+ \@ifundefined{#1}{\DeclareBlockHeading{#1}{#2}{#3}}{}%
+}
+
+%.. 別行見出しが連続した場合の処理
+% 設定値保存に次のマクロを使う
+% \jlreq@BlockHeading@spaces@headingslist
+% : スペースを考慮しないとならない見出しのリスト.,_chapter_section_subsection,_section_subsection,...みたいな感じ
+% \jlreq@BlockHeading@spaces@setlist@<見出し名リスト>
+% : 見出し名リストが続いたときの空き関連設定.<見出し名リスト>は_chapter_section_subsectionみたいなやつ.
+% {***}{***}...というリスト.各々の***は次のどれか.
+% 最初:全体への指定.{前空き}{後ろ空き}{行数}
+% _{前空き}{後ろ空き}{行数}:見出しに対する指定.先頭が_*の場合は,デフォルト設定をロードしてからということ.
+% それ以外:空き量
+% 最初や最後に空き量指定がある場合は,全体への指定に組み込むことにする.
+%
+% 現在状況保存に以下のマクロを使う
+% \jlreq@BlockHeading@spaces@current@sequence
+% : 現在どのような見出しが続いているかリスト.
+% \jlreq@BlockHeading@spaces@current@space@<n>
+% : 現在処理中のn番目の見出しに対する空き情報.{前空き}{後ろ空き}{トータル行数}{偶数ページbreak情報}.n=1から始まる.
+% \jlreq@BlockHeading@spaces@current@output@<n>
+% : 現在処理中のn番目の見出しの中身.
+% \jlreq@BlockHeading@spaces@current@format@<n>
+% : 現在処理中のn番目の見出しのフォーマット.行取りマクロを包み込むようにする.
+% \jlreq@BlockHeading@spaces@current@before@<n>
+% : n番目の見出しの前に出すもの
+% \jlreq@BlockHeading@spaces@current@after@<n>
+% : n番目の見出しの後ろに出すもの
+% \jlreq@BlockHeading@spaces@current@count
+% : 現在いくつ目の連続する見出しを処理しているかのカウンター
+\newcount\jlreq@BlockHeading@spaces@current@count
+\jlreq@BlockHeading@spaces@current@count=0
+\def\jlreq@BlockHeading@spaces@current@sequence{}
+\def\jlreq@BlockHeading@spaces@headingslist{}
+
+\newcommand{\SetBlockHeadingSpaces}[1]{%
+ \begingroup
+ % 現段階の情報をクリアする
+ \@for\jlreq@tempa:=\jlreq@BlockHeading@spaces@headingslist\do{%
+ \expandafter\let\csname jlreq@BlockHeading@spaces@setlist@\jlreq@tempa\endcsname=\@undefined
+ }%
+ \def\jlreq@BlockHeading@spaces@headingslist{}%
+ \def\jlreq@tempa{}% 見出しリスト
+ \def\jlreq@tempb{}% 設定リスト \def\jlreq@BlockHeading@spaces@***{{**}{**}...}ってのを入れる
+ \jlreq@SetBlockHeadingSpaces#1\jlreq@endmark
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@BlockHeading@spaces@headingslist}{\expandonce{\jlreq@tempa}}%
+ \expandonce{\jlreq@tempb}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+\def\jlreq@SetBlockHeadingSpaces{% カンマを無視する処理
+ \@ifnextchar,{\expandafter\jlreq@SetBlockHeadingSpaces@\@gobble}{\jlreq@SetBlockHeadingSpaces@}%
+}
+\def\jlreq@SetBlockHeadingSpaces@{%
+ \@ifnextchar[{\jlreq@SetBlockHeadingSpaces@@}{\jlreq@SetBlockHeadingSpaces@@[]}%
+}
+\def\jlreq@SetBlockHeadingSpaces@@[#1]#2{%
+ \jlreq@ifendmark{#2}{}{%
+ \def\jlreq@headings{}% 見出し名リスト
+ \jlreq@BlockHeading@gyodori@parsekeyval[BlockHeadingSpaces]{#1}{}{}{}%
+ \let\jlreq@totalset=\jlreq@result% 上の#1に対応する設定
+ \def\jlreq@set{}% 個々の設定
+ \def\jlreq@lastdimen{}% 最後の寸法
+ \def\jlreq@do##1##2##3{%
+ \jlreq@ifempty{##1}{\jlreq@tempatrue}{\jlreq@tempafalse}% 前開きが空ならば\jlreq@tempatrue
+ \jlreq@ifempty{##2}{\jlreq@tempbtrue}{\jlreq@tempbfalse}% 後ろ開きが空ならば\jlreq@tempbtrue
+ }%
+ \expandafter\jlreq@do\jlreq@totalset
+ \jlreq@SetBlockHeadingSpaces@@@{#2}%
+ \eappto\jlreq@tempa{,\expandonce{\jlreq@headings}}% \jlreq@tempaに\jlreq@headingsを追加
+ \ifjlreq@tempb
+ \ifx\jlreq@lastdimen\@empty\else % 最後が寸法だったので\jlreq@SetBlockHeadingSpaces@totalsetを改変
+ \def\jlreq@do##1##2##3{%
+ \edef\jlreq@totalset{{\unexpanded{##1}}{r:\expandonce{\jlreq@lastdimen}}{\unexpanded{##3}}}%
+ }%
+ \expandafter\jlreq@do\jlreq@totalset
+ \fi
+ \else
+ \eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}%
+ \fi
+ \eappto\jlreq@tempb{%
+ \noexpand\@ifundefined{jlreq@BlockHeading@spaces@setlist@\jlreq@headings}{}{%
+ \noexpand\ClassError{jlrqe}{The spaces for \jlreq@headings\space is defined more than once (in SetBlockHeadingSpaces)}{\noexpand\@ehc}%
+ }%
+ \noexpand\def\expandonce{\csname jlreq@BlockHeading@spaces@setlist@\jlreq@headings\endcsname}{{\expandonce{\jlreq@totalset}}\expandonce{\jlreq@set}}%
+ }%
+ \jlreq@SetBlockHeadingSpaces
+ }%
+}
+\def\jlreq@SetBlockHeadingSpaces@@@#1{%
+ \@for\@tempa:=#1\do{%
+ \expandafter\jlreq@iffirsttoken@ignorespaces\expandafter{\@tempa}{_}{%
+ \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi%
+ \def\jlreq@lastdimen{}%
+ \expandafter\jlreq@SetBlockHeadingSpaces@@@@\@tempa{\jlreq@endmark}%
+ }{%
+ \ifjlreq@tempa
+ % 最初が寸法なので,全体の設定(\jlreq@totalset)に組み込む.
+ \def\jlreq@do##1##2##3{%
+ \edef\jlreq@totalset{{r:\expandonce{\@tempa}}{\unexpanded{##2}}{\unexpanded{##3}}}%
+ }%
+ \expandafter\jlreq@do\jlreq@totalset
+ \else
+ \ifx\jlreq@lastdimen\@empty\else\eappto\jlreq@set{{\expandonce{\jlreq@lastdimen}}}\fi
+ \let\jlreq@lastdimen=\@tempa
+ \fi
+ }%
+ \jlreq@tempafalse
+ }%
+}
+\def\jlreq@SetBlockHeadingSpaces@@@@#1#{%
+ \expandafter\jlreq@ifcontains\expandafter{\@gobble #1}{_}{%
+ \ClassWarning{jlreq}{Unusual heading name `\@gobble #1' is found. You forgot a comma? (in SetBlockHeadingSpaces)}%
+ }{}%
+ \jlreq@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)}%
+ }}{}%
+ \appto\jlreq@headings{#1}%
+ \jlreq@SetBlockHeadingSpaces@@@@@
+}
+\def\jlreq@SetBlockHeadingSpaces@@@@@#1{%
+ % 空っぽの場合は{_{r:0pt}{r:0pt}{}}
+ \jlreq@ifendmark{#1}{\appto\jlreq@set{{_{r:0pt}{r:0pt}{}}}}{%
+ \jlreq@iffirsttoken{#1}{*}{% *始まりの場合は{_*{}{}{}}
+ \expandafter\jlreq@BlockHeading@gyodori@parsekeyval\expandafter{\@gobble #1}{}{}{}%
+ \eappto\jlreq@set{{_*\expandonce{\jlreq@result}}}%
+ }{% それ以外の場合は{_{}{}{}}
+ \jlreq@BlockHeading@gyodori@parsekeyval{#1}{}{}{}%
+ \eappto\jlreq@set{{_\expandonce{\jlreq@result}}}%
+ }%
+ \@gobble % \jlreq@endmarkを食う
+ }%
+}
+
+% 現在の情報に基づき出力
+\def\jlreq@BlockHeading@spaces@output{%
+ \@ifundefined{jlreq@BlockHeading@spaces@setlist@\jlreq@BlockHeading@spaces@current@sequence}{%
+ \jlreq@BlockHeading@spaces@outputwospace
+ }{%
+ \expandafter\expandafter\expandafter\jlreq@BlockHeading@spaces@output@\csname jlreq@BlockHeading@spaces@setlist@\jlreq@BlockHeading@spaces@current@sequence\endcsname\jlreq@endmark
+ }%
+}
+
+% 連続スペース情報とか無視して各々の見出しを出力する
+\def\jlreq@BlockHeading@spaces@outputwospace{%
+ \begingroup
+ \jlreq@tempcnta=0
+ \def\jlreq@do{}%
+ \jlreq@BlockHeading@spaces@outputwospace@
+ \jlreq@BlockHeading@spaces@clear
+ \expandafter\endgroup
+ \jlreq@do
+}
+\def\jlreq@BlockHeading@spaces@outputwospace@{%
+ \ifnum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count
+ \advance\jlreq@tempcnta by 1
+ \eappto\jlreq@do{\csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}}%
+ \edef\jlreq@tempa{%
+ \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
+ }%
+ \jlreq@tempa
+ \edef\jlreq@tempb{%
+ \noexpand\expandonce{\noexpand\jlreq@tempa{%
+ \noexpand\jlreq@BlockHeading@start@gyodori
+ \csexpandonce{jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
+ {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
+ }}%
+ }%
+ \eappto\jlreq@do{\jlreq@tempb\csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}}%
+ \expandafter\jlreq@BlockHeading@spaces@outputwospace@
+ \fi
+}
+
+\def\jlreq@BlockHeading@spaces@output@#1#2\jlreq@endmark{%
+ \def\jlreq@result{}%
+ \jlreq@tempcnta=0
+ \jlreq@BlockHeading@spaces@output@@#2\jlreq@endmark
+ \jlreq@tempatrue % 周りの行取り処理が必要か
+ \jlreq@ifempty{#1}{\jlreq@tempafalse}{}%
+ \ifthenelse{\equal{#1}{{}{}{}}}{\jlreq@tempafalse}{}%
+ \edef\jlreq@do{%
+ \ifjlreq@tempa
+ \unexpanded{\jlreq@BlockHeading@start@gyodori#1}{*}{%
+ \expandonce{\jlreq@result}%
+ }%
+ \else
+ \expandonce{\jlreq@result}%
+ \fi
+ }%
+ \jlreq@BlockHeading@spaces@clear
+ \jlreq@do
+}
+% jlreq@resultに出力すべきものを入れていく
+\def\jlreq@BlockHeading@spaces@output@@#1{%
+ \jlreq@ifendmark{#1}{}{%
+ \jlreq@iffirsttoken@ignorespaces{#1}{_}{%
+ \advance\jlreq@tempcnta by 1
+ \expandafter\jlreq@BlockHeading@spaces@output@@@\expandafter{\@gobble #1}%
+ }{%
+ \appto\jlreq@result{\vskip\glueexpr #1\relax}%
+ }%
+ \jlreq@BlockHeading@spaces@output@@
+ }%
+}
+\def\jlreq@BlockHeading@spaces@output@@@#1{%
+ \edef\jlreq@do{%
+ \noexpand\jlreq@BlockHeading@spaces@output@@@@
+ \jlreq@iffirsttoken@ignorespaces{#1}{*}{{*}\expandonce{\@gobble #1}}{\unexpanded{{}#1}}%
+ \csexpandonce{jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta}%
+ {\csexpandonce{jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta}}%
+ }%
+ \jlreq@do
+}
+% #1: デフォルト値を使うならば*,#2#3#4が設定された値,#5#6#7がデフォルト値,#8は偶数ページの,#9が出力
+\def\jlreq@BlockHeading@spaces@output@@@@#1#2#3#4#5#6#7#8#9{%
+ \edef\jlreq@tempa{%
+ \unexpanded{\long\def\jlreq@tempa##1}{\csexpandonce{jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
+ }%
+ \jlreq@tempa
+ \edef\jlreq@tempb{%
+ \noexpand\expandonce{\noexpand\jlreq@tempa{%
+ \noexpand\jlreq@BlockHeading@start@gyodori
+ \jlreq@ifempty{#1}{\unexpanded{{#2}{#3}{#4}}}{%
+ {\jlreq@ifempty{#2}{\unexpanded{#5}}{\unexpanded{#2}}}%
+ {\jlreq@ifempty{#3}{\unexpanded{#6}}{\unexpanded{#3}}}%
+ {\jlreq@ifempty{#4}{\unexpanded{#7}}{\unexpanded{#4}}}%
+ }\unexpanded{{#8}{#9}}%
+ }}%
+ }%
+ \eappto\jlreq@result{%
+ \csexpandonce{jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta}%
+ \jlreq@tempb
+ \csexpandonce{jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta}%
+ }%
+}
+
+% 連続見出しスペース調整用のデータをすべてクリアする
+\def\jlreq@BlockHeading@spaces@clear{%
+ \begingroup
+ \jlreq@tempcnta=0
+ \@whilenum\jlreq@tempcnta<\jlreq@BlockHeading@spaces@current@count\do{%
+ \advance\jlreq@tempcnta by 1
+ \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@space@\the\jlreq@tempcnta\endcsname=\@undefined
+ \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@output@\the\jlreq@tempcnta\endcsname=\@undefined
+ \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@before@\the\jlreq@tempcnta\endcsname=\@undefined
+ \expandafter\global\expandafter\let\csname jlreq@BlockHeading@spaces@current@after@\the\jlreq@tempcnta\endcsname=\@undefined
+ }%
+ \gdef\jlreq@BlockHeading@spaces@current@sequence{}%
+ \global\jlreq@BlockHeading@spaces@current@count=0
+ \endgroup
+}
+
+%.. 同行見出し
+% {1 = 命令名}{2 = レベル}{3 = ラベルフォーマット}{4 = ラベルありフォーマット}{5 = ラベルなしフォーマット}
+% 4,5は見出し文字列が#1になる.
+\long\def\jlreq@RuninHeading@start#1#2#3#4#5{%
+ \edef\jlreq@RuninHeading@start@format@label{\unexpanded{#3}}%
+ \edef\jlreq@RuninHeading@start@format@wlabel{\unexpanded{#4}}%
+ \edef\jlreq@RuninHeading@start@format@wolabel{\unexpanded{#5}}%
+ \@ifstar{\@dblarg{\jlreq@RuninHeading@start@{#1}{#2}{*}}}{\@dblarg{\jlreq@RuninHeading@start@{#1}{#2}{}}}%
+}
+% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}
+\long\def\jlreq@RuninHeading@start@#1#2#3[#4]#5{%
+ \edef\jlreq@do{\unexpanded{\jlreq@RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}}{\expandonce{\jlreq@RuninHeading@start@format@label}}{\expandonce{\jlreq@RuninHeading@start@format@wlabel}}{\expandonce{\jlreq@RuninHeading@start@format@wolabel}}}%
+ \jlreq@do
+}
+% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}{6 = ラベルフォーマット}{7 = ラベルありフォーマット}{8 = ラベルなしフォーマット}
+\long\def\jlreq@RuninHeading@start@@#1#2#3#4#5#6#7#8{%
+ \if@noskipsec\leavevmode\fi
+ \begingroup
+ \def\jlreq@do{\global\@noskipsectrue}%
+ \ifnum0\jlreq@ifempty{#3}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0
+ \def\jlreq@tempa##1{#8}%
+ \else
+ \appto\jlreq@do{\refstepcounter{#1}}%
+ \def\jlreq@tempa##1{#7}%
+ \fi
+ \par
+ \eappto\jlreq@do{%
+ \noexpand\everypar{%
+ \noexpand\if@noskipsec
+ \unexpanded{\global\@noskipsecfalse}%
+ \unexpanded{{\setbox\jlreq@tempboxa\lastbox}}%
+ \noexpand\begingroup
+ \expandonce{\jlreq@tempa{#5}}%
+ \expandonce{\csname jlreq@heading@maketoc@#1\endcsname}{#3}{#6}{#4}%
+ \noexpand\endgroup
+ \noexpand\else
+ \unexpanded{\everypar{}}%
+ \noexpand\fi
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \ignorespaces
+}
+
+% \DeclareRuninHeading{命令名}{レベル}{設定}
+\newcommand*{\DeclareRuninHeading}[3]{%
+ \def\jlreq@do{\@removeelement{#1}}%
+ \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}%
+ \appto\jlreq@heading@allheadings{,#1}%
+ \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
+ \expandafter\edef\csname jlreq@heading@setting@#1\endcsname{\unexpanded{#3}}%
+ \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewRuninHeading}%
+ \@ifundefined{c@#1}{\newcounter{#1}}{}%
+ \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
+ \@ifundefined{l@#1}{\expandafter\def\csname l@#1\endcsname{\@dottedtocline{#2}{0\zw}{2\zw}}}{}%
+ \jlreq@heading@make@maketoc{#1}{#2}%
+ \begingroup
+ \def\jlreq@font{\normalfont\normalsize}%
+ \def\jlreq@indent{0\zw}%
+ \def\jlreq@after@label@space{1\zw}%
+ \def\jlreq@mark{}%
+ \def\jlreq@label@font{}%
+ \def\jlreq@label@format{\@seccntformat{#1}}%
+ \def\jlreq@after@space{1\zw}%
+ \jlreq@parsekeyval[RuninHeading:#1]{%
+ {font}{\def\jlreq@font{##1}}
+ {indent}{\def\jlreq@indent{##1}}
+ {mark}{\def\jlreq@mark{##1}}
+ {label_format}{\def\jlreq@label@format{##1}}
+ {after_label_space}{
+ \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_label_space in Runin Heading #1 should be not negative}\fi
+ \def\jlreq@after@label@space{##1}
+ }
+ {after_space}{%
+ \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_space in Runin Heading #1 should be not negative}\fi
+ \def\jlreq@after@space{##1}%
+ }
+ }{#3}%
+ \newif\ifjlreq@indent@zero
+ \jlreq@ifgluezero{\glueexpr\jlreq@indent\relax}{\jlreq@indent@zerotrue}{\jlreq@indent@zerofalse}%
+ \newif\ifjlreq@after@space@zero
+ \jlreq@ifgluezero{\glueexpr\jlreq@after@space\relax}{\jlreq@after@space@zerotrue}{\jlreq@after@space@zerofalse}%
+ \newif\ifjlreq@after@label@space@zero
+ \jlreq@ifgluezero{\glueexpr\jlreq@after@label@space\relax}{\jlreq@after@label@spacefalse}%
+ \edef\jlreq@format@wlabel{{%
+ \ifjlreq@indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@indent}\noexpand\relax\fi
+ \expandonce{\jlreq@font}%
+ \expandonce{\jlreq@label@format}%
+ \ifjlreq@after@label@space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@after@label@space}\noexpand\relax\fi
+ ####1%
+ \ifjlreq@after@space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@after@space}\noexpand\relax\fi
+ }}%
+ \edef\jlreq@format@wolabel{{%
+ \ifjlreq@indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@indent}\noexpand\relax\fi
+ \expandonce{\jlreq@font}%
+ ####1%
+ \ifjlreq@after@space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@after@space}\noexpand\relax\fi
+ }}%
+ \jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
+ \edef\jlreq@do{%
+ \expandonce{\jlreq@result}%
+ % パラメータトークンを含むので,\edefして\unexpandedで包む
+ \noexpand\edef\expandonce{\csname #1\endcsname}{%
+ \noexpand\unexpanded{%
+ \unexpanded{\jlreq@hook@beforeheadings{#1}}%
+ \unexpanded{\jlreq@RuninHeading@start{#1}{#2}}{\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@format@wlabel}}{\expandonce{\jlreq@format@wolabel}}%
+ }%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+\newcommand*{\NewRuninHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareRuninHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\RenewRuninHeading}[3]{%
+ \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareRuninHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\ProvideRuninHeading}[3]{%
+ \@ifundefined{#1}{\DeclareRuninHeading{#1}{#2}{#3}}{}%
+}
+
+%.. 窓見出し
+\def\jlreq@CutinHeading@start#1#2#3#4#5#6#7{%
+ \par
+ \ifnum\hangafter=1
+ \jlreq@CutinHeading@start@{#2}{#3}{#4}{#5}{#6}{#7}%
+ \else
+ \ClassError{jlreq}{Can not use \expandafter\string\csname#1\endcsname\space here}{\@ehc}%
+ \fi
+}
+% 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト
+\def\jlreq@CutinHeading@start@#1#2#3#4#5#6{%
+ % 一行で処理したときの見出し長さを計測
+ \begingroup
+ \setbox\@tempboxa=\hbox{#1#6}%
+ \@tempdima=\wd\@tempboxa
+ % 何行必要かを\jlreq@CutinHeading@linecountに入れる
+ \ifdim\@tempdima>#5\def\jlreq@CutinHeading@linecount{3}%
+ \else\ifdim\@tempdima>#4\def\jlreq@CutinHeading@linecount{2}%
+ \else\def\jlreq@CutinHeading@linecount{1}\fi\fi
+ % \@tempdimaが実際の一行の長さに近い
+ \divide\@tempdima by \jlreq@CutinHeading@linecount
+ % \jlreq@resultboxに見出し部分を,\jlreq@CutinHeading@linecountに見出し自身に何行使うかを入れる
+ \ifnum\jlreq@CutinHeading@linecount=1\relax
+ \setbox\jlreq@resultbox=\vbox{\parindent=0pt\rightskip=0pt\leftskip=0pt\hbox{#1#6}}%
+ \def\jlreq@CutinHeading@linecount{2}%
+ \else
+ \jlreq@inlinenote@determinelength{#6}{#1}{}{\jlreq@CutinHeading@linecount}{\jlreq@CutinHeading@linecount}{\@tempdima}{\linewidth}%
+ \def\jlreq@CutinHeading@linecount{3}%
+ \fi
+ % 普通の一行の高さ/深さに合わせて見出しのボックスを作る
+ \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq@CutinHeading@linecount - 1\relax\baselineskip + 1\zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq@resultbox\vskip 0pt plus 1fill minus 1fill}%
+ % 高さを通常の一行のそれにする
+ \setbox\jlreq@tempboxa=\hbox{阿}%
+ \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa - \ht\jlreq@tempboxa\relax
+ \ht\@tempboxa=\ht\jlreq@tempboxa
+ \noindent
+ \hspace*{#2}%
+ \copy\@tempboxa
+ \hspace*{#3}%
+ \par
+ % でかい見出しボックスの分をキャンセルする空きを入れる
+ % \baselineskip - \ht\jlreq@tempboxaはTeXが挿入するスキップの分
+ \vskip -\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq@tempboxa\relax\relax
+ \edef\jlreq@do{%
+ \noexpand\hangindent=\the\dimexpr#2 + \wd\@tempboxa + #3\relax\relax
+ \noexpand\hangafter=-\jlreq@CutinHeading@linecount\relax
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \prevdepth=0pt
+ % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す).
+ \def\par{%
+ \ifvmode\jlreq@tempatrue\else\jlreq@tempafalse\fi
+ \jlreq@tempcnta=\hangafter\relax
+ \jlreq@tempdima=\hangindent\relax
+ \@@par
+ \ifjlreq@tempa\else\advance\jlreq@tempcnta by \prevgraf\relax\fi
+ \ifnum\jlreq@tempcnta<0
+ \hangafter=\jlreq@tempcnta\relax
+ \hangindent=\jlreq@tempdima\relax
+ \else
+ \@restorepar
+ \fi
+ }%
+ \@afterindentfalse
+ \@afterheading
+ \ignorespaces
+}
+
+\newcommand*{\DeclareCutinHeading}[3]{%
+ \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}%
+ \expandafter\def\csname jlreq@heading@setting@#1\endcsname{#3}%
+ \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewCutinHeading}%
+ \begingroup
+ \def\jlreq@fontcommand{\sffamily\bfseries}%
+ \def\jlreq@onelinemax{6\zw}%
+ \def\jlreq@twolinemax{20\zw}%
+ \def\jlreq@indent{0\zw}%
+ \def\jlreq@after@space{1\zw}%
+ \jlreq@parsekeyval[CutinHeading:#1]{
+ {font}{\def\jlreq@fontcommand{##1}}
+ {onelinemax}{\def\jlreq@onelinemax{##1}}
+ {twolinemax}{\def\jlreq@twolinemax{##1}}
+ {indent}{\def\jlreq@indent{##1}}
+ {after_space}{\def\jlreq@after@space{##1}}
+ }{#3}%
+ \ifthenelse{\lengthtest{\jlreq@after@space < 0.99\zw} \OR \lengthtest{\jlreq@after@space > 2.01\zw}}{%
+ \jlreq@note{窓見出しと本文との空き量は,基本版面の文字サイズの全角以上,2倍未満とする (4.1.10.c).}%
+ }{}%
+ \edef\jlreq@do{%
+ \noexpand\def\expandonce{\csname #1\endcsname}{%
+ \noexpand\jlreq@CutinHeading@start{#1}{\expandonce{\jlreq@fontcommand}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@onelinemax}}{\expandonce{\jlreq@twolinemax}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+\newcommand*{\NewCutinHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareCutinHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\RenewCutinHeading}[3]{%
+ \@ifundefined{#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareCutinHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\ProvideCutinHeading}[3]{%
+ \@ifundefined{#1}{\DeclareCutinHeading{#1}{#2}{#3}}{}%
+}
+
+\newcommand{\ModifyHeading}[2]{%
+ \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}%
+ \edef\jlreq@do{\csexpandonce{jlreq@heading@type@#1}{#1}{\csexpandonce{jlreq@heading@level@#1}}{\csexpandonce{jlreq@heading@setting@#1},\unexpanded{#2}}}%
+ \jlreq@do
+}
+% 見出し#1をマクロ#2に保存する
+\newcommand{\SaveHeading}[2]{%
+ \@ifundefined{jlreq@heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}%
+ \edef#2{%
+ \csexpandonce{jlreq@heading@type@#1}{\unexpanded{#1}}{\csexpandonce{jlreq@heading@level@#1}}{\csexpandonce{jlreq@heading@setting@#1}}%
+ }%
+}
+
+\newcommand*{\jlreq@keepbaselineskip}[1]{%
+ \begingroup
+ \edef\jlreq@do{\unexpanded{#1}\noexpand\baselineskip=\the\baselineskip}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\newcommand*\jlreq@HeadingType[1]{%
+ \ifcsname jlreq@heading@type@#1\endcsname
+ \jlreq@HeadingType@{#1}{\RenewTobiraHeading}{TobiraHeading}{%
+ \jlreq@HeadingType@{#1}{\RenewBlockHeading}{BlockHeading}{%
+ \jlreq@HeadingType@{#1}{\RenewRuninHeading}{RuninHeading}{%
+ \jlreq@HeadingType@{#1}{\RenewCutinHeading}{CutinHeading}{%
+ UnknownHeading}}}}%
+ \else
+ UndefinedHeading%
+ \fi
+}
+\newcommand*\jlreq@HeadingType@[2]{%
+ \expandafter\expandafter\expandafter\ifx\csname jlreq@heading@type@#1\endcsname#2\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+}
+
+% 全ての見出しにマクロ#1を適用する.
+\def\jlreq@heading@execmacro@toallheadings#1{%
+ \begingroup
+ \def\jlreq@do{}%
+ \ifx\jlreq@heading@allheadings\@undefined
+ \jlreq@heading@execmacro@toallheadings@{#1}{chapter,part,section,subsection,subsubsection,paragraph,subparagraph}%
+ \else
+ \def\@tempa{\jlreq@heading@execmacro@toallheadings@{#1}}%
+ \expandafter\@tempa\expandafter{\jlreq@heading@allheadings}%
+ \fi
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\def\jlreq@heading@execmacro@toallheadings@#1#2{
+ \@for\jlreq@tempa:=#2\do{%
+ \@ifundefined{\jlreq@tempa}{}{%
+ \eappto\jlreq@do{\noexpand#1{\expandonce{\jlreq@tempa}}}%
+ }%
+ }%
+}
+\def\jlreq@clearheadingmarks#1{%
+ \@ifundefined{#1mark}{}{%
+ \expandafter\let\csname#1mark\endcsname=\@gobble
+ }%
+}
+
+%.. 各種定義
+\setcounter{secnumdepth}{3}
+\newcounter{part}
+\jlreq@switch{\jlreq@article@type}{
+ {article}{\newcounter{section}}
+ {\newcounter{chapter}\newcounter{section}[chapter]}% book, report
+}
+\newcounter{subsection}[section]
+\newcounter{subsubsection}[subsection]
+\newcounter{paragraph}[subsubsection]
+\newcounter{subparagraph}[paragraph]
+\renewcommand*{\@seccntformat}[1]{\csname the#1\endcsname}
+
+\if@tate
+ \renewcommand{\thepart}{\jlreq@Kanji{part}}
+ \ifthenelse{\equal{\jlreq@article@type}{article}}{}{\renewcommand{\thechapter}{\jlreq@Kanji{chapter}}}
+ \renewcommand{\thesection}{\jlreq@rensuji{\@arabic\c@section}}
+ \renewcommand{\thesubsection}{\jlreq@rensuji{\@alph\c@subsection}}
+ \renewcommand{\thesubsubsection}{\jlreq@rensuji{\@arabic\c@subsubsection}}
+ \renewcommand{\theparagraph}{(\jlreq@rensuji{\@arabic\c@paragraph})}
+ \renewcommand{\thesubparagraph}{(\jlreq@rensuji{\@arabic\c@subparagraph})}
+
+ \ifthenelse{\equal{\jlreq@article@type}{article}}{
+ \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE}},indent=4\zw,lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
+ \if@twoside\ModifyHeading{part}{allowbreak_if_evenpage=true}\fi
+ }
+ {% book, report
+ \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\zw}},format={\null\vfill {\Huge\hspace*{2\zw}#1#2}\vspace*{2\jlreq@gol}}}
+ \NewBlockHeading{chapter}{0}{indent=2\zw,lines=6,label_format={第\thechapter 章},font={\huge},after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\Large}}}
+ \if@twoside\ModifyHeading{chapter}{allowbreak_if_evenpage=true}\fi
+ \renewcommand{\thechapter}{\jlreq@Kanji{chapter}}
+ }
+ \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large}},indent=6\zw,lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
+ \if@twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi
+ \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large}},indent=8\zw,lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
+ \if@twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi
+ \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize}},indent=10\zw,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
+ \if@twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi
+ \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize}}}
+ \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}},indent=1\zw}
+\else% yoko
+ \renewcommand{\thepart}{\Roman{part}}
+ \renewcommand{\thesubsection}{\thesection .\arabic{subsection}}
+ \renewcommand{\thesubsubsection}{\thesubsection .\arabic{subsubsection}}
+ \renewcommand{\theparagraph}{\thesubsubsection .\arabic{paragraph}}
+ \renewcommand{\thesubparagraph}{\theparagraph .\arabic{subparagraph}}
+ \ifthenelse{\equal{\jlreq@article@type}{article}}{
+ \NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\sffamily\bfseries}},label_format={第\thepart 部},lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
+ \renewcommand{\thesection}{\arabic{section}}
+ }
+ {% book, report
+ \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq@gol}},format={\null\vfil {\Huge\sffamily\bfseries #1#2}\vfil}}
+ \NewBlockHeading{chapter}{0}{%
+ font={\jlreq@keepbaselineskip{\huge\sffamily\bfseries}},
+ label_format={第\thechapter 章},
+ lines=5,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},
+ subtitle_font={\jlreq@keepbaselineskip{\Large}}}
+ \renewcommand{\thechapter}{\arabic{chapter}}
+ \renewcommand{\thesection}{\thechapter.\arabic{section}}
+ }
+ \NewBlockHeading{section}{1}{font={\jlreq@keepbaselineskip{\Large\sffamily\bfseries}},lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\normalsize}}}
+ \NewBlockHeading{subsection}{2}{font={\jlreq@keepbaselineskip{\large\sffamily\bfseries}},lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\small}}}
+ \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},lines=1,before_lines=1,subtitle_break=false,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}}
+ \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=1\zw}
+ \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize\sffamily\bfseries}},indent=2\zw}
+\fi
+
+\ifthenelse{\equal{\jlreq@article@type}{article}}{}{% book, report
+ \if@openright
+ \ModifyHeading{part}{type=naka}
+ \if@tate
+ \ModifyHeading{chapter}{pagebreak=begin_with_even_page}
+ \else
+ \ModifyHeading{chapter}{pagebreak=begin_with_odd_page}
+ \fi
+ \else
+ \ModifyHeading{part}{type=han}
+ \ModifyHeading{chapter}{pagebreak=clearpage}
+ \fi
+}
+\jlreq@switch{\jlreq@article@type}{
+ {book}{%
+ \renewcommand{\jlreq@heading@maketoc@chapter}[3]{%
+ \jlreq@ifempty{#1}{%
+ \chaptermark{#3}%
+ \ifnum0\if@mainmatter\else1\fi\ifnum\jlreq@heading@level@chapter>\c@secnumdepth 1\fi>0
+ \addcontentsline{toc}{chapter}{#3}%
+ \else
+ \addcontentsline{toc}{chapter}{\protect\numberline{#2}#3}%
+ \fi
+ }{}%
+ }
+ }
+ {report}{
+ \renewcommand{\jlreq@heading@maketoc@chapter}[3]{%
+ \jlreq@ifempty{#1}{%
+ \chaptermark{#3}%
+ \ifnum0\ifnum\jlreq@heading@level@chapter>\c@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)
+\newcommand*\jlreq@referencemark@format[1]{#1}
+\newif\ifjlreqadjustreferencemark
+\jlreqadjustreferencemarktrue
+\jlreq@jlreqsetup@add{reference_mark}[inline,interlinear]{
+ \def\jlreq@referencemark{#1}
+ \ifthenelse{\equal{\jlreq@referencemark}{inline}}{
+ \def\jlreq@notemark##1{%
+ \jlreq@ifydir{%
+ \hbox{}\hbox{\@textsuperscript{\normalfont\jlreq@referencemark@format{##1}}}\hbox{}%
+ }{%
+ \setbox\@tempboxa=\hbox{\scriptsize\jlreq@referencemark@format{##1}}%
+ \raise\dimexpr.5\jlreq@gol - \ht\@tempboxa\relax\box\@tempboxa
+ }%
+ }
+ \def\jlreq@hook@prenote{\inhibitglue}
+ \def\jlreq@hook@postnote{\inhibitglue}
+ }{% reference_mark=interlinear
+ \def\jlreq@notemark##1{{%
+ \setbox\@tempboxa=\hbox{\scriptsize\jlreq@referencemark@format{##1}}%
+ \@tempdima=\wd\@tempboxa
+ % 行頭に来たときに頭を天にそろえる処理.
+ \ifjlreqadjustreferencemark
+ \jlreq@savepos@for@rest@linewidth
+ \ifdim\jlreq@current@linewidth<\wd\@tempboxa
+ \@tempdima=\jlreq@current@linewidth
+ \fi
+ \fi
+ \setbox\jlreq@tempboxb=\hbox{阿}%
+ \setbox\jlreq@tempboxa=\hbox to\z@{\hskip-\@tempdima\raise\dimexpr\ht\jlreq@tempboxb + \dp\@tempboxa\relax\box\@tempboxa\hss}%
+ \dp\jlreq@tempboxa=0pt\ht\jlreq@tempboxa=0pt\box\jlreq@tempboxa%
+ }}%
+ \ifx l\jlreq@engine
+ \def\jlreq@hook@prenote{%
+ \jlreq@lastnodechar=\lastnodechar\relax
+ \ifnum\lastnodechar>-1\inhibitglue\fi
+ }
+ \else
+ % (u)platexの時は代入すると\inhibitglueが効かなくなる
+ \def\jlreq@hook@prenote{%
+ \ifnum\lastnodechar>-1\inhibitglue\fi
+ \jlreq@lastnodechar=\lastnodechar\relax
+ }
+ \fi
+ \def\jlreq@hook@postnote{\jlreq@fixjfm}
+ }
+}
+\jlreqsetup{reference_mark=inline}
+% \@footnotemarkをシンプルなものにする
+\def\jlreq@setdefaultnotemark#1#2{%
+ \def#1{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+ #2%
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax}%
+}
+\jlreq@setdefaultnotemark\@footnotemark\@makefnmark
+
+%.. 脚注(4.2.5)
+% (縦書きの時は傍注,4.2.6)
+% 罫線の前は行間分,最大+文字サイズ分伸びる(4.2.5.g)
+\setlength{\skip\footins}{\dimexpr\baselineskip - 1\jlreq@gol \relax plus 1\jlreq@gol}
+% 罫線の長さは,基本版面で設定した行長にもよるが,行長の1/3くらいにする.
+\def\jlreq@footnote@rulewidth{.333\textwidth}
+\begingroup
+ \footnotesize
+ \edef\jlreq@do{
+ \unexpanded{\setlength{\footnotesep}}{\the\dimexpr .7\baselineskip\relax}% 何でかわからん……
+ \unexpanded{\def\footnoterule}{%
+ % この罫線は,表罫(おもてけい)とする.
+ \unexpanded{\hrule width \jlreq@footnote@rulewidth height \jlreq@omotekeiwidth}%
+ % 脚注の行間よりやや広くする(4.2.5.f)
+ \noexpand\kern\the\dimexpr 1.5\dimexpr\baselineskip - 1\zh\relax\relax
+ }
+ }
+\expandafter\endgroup
+\jlreq@do
+
+% インデントの計算:脚注の長さが文字の整数倍になるように字下げする(4.2.5.b)
+\jlreq@jlreqsetup@add{footnote_indent}{%
+ \if@tate\else
+ \ifdim\dimexpr#1\relax=0pt\else\jlreq@note{脚注は,一般にその前に区切りのための罫線を挿入するので,字下げは行わなくてよい(4.2.5.b).}\fi
+ \fi
+ \begingroup
+ \footnotesize
+ \jlreq@footnoteindent=\dimexpr#1\relax
+ \@tempdima=\dimexpr\textwidth - \jlreq@footnoteindent\relax
+ \@tempdimb=1\zw
+ \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
+ \edef\jlreq@do{\noexpand\jlreq@footnoteindent=\the\dimexpr\textwidth - \@tempdima\relax}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+\if@tate
+ \jlreqsetup{footnote_indent=1\zw}% 根拠なし
+\else
+ \jlreqsetup{footnote_indent=0pt}% (4.2.5.b)
+\fi
+
+\newcommand{\@makefntext}[1]{\jlreq@makefntext{#1}}
+\jlreq@jlreqsetup@add{footnote_second_indent}{%
+ \if@tate\else
+ \ifthenelse{
+ \( \lengthtest{0.99\zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < 1.01\zw} \) \OR
+ \( \lengthtest{-1.01\zw < \dimexpr #1\relax} \AND \lengthtest{\dimexpr #1\relax < -0.99\zw} \)
+ }{}{\jlreq@note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
+ \fi
+ \ifdim\dimexpr #1\relax<0pt
+ \def\jlreq@makefntext{}
+ \else
+ \def\jlreq@makefntext{\addtolength{\leftskip}{\glueexpr #1\relax}}
+ \fi
+ \long\edef\jlreq@makefntext##1{\expandonce{\jlreq@makefntext}%
+ \unexpanded{%
+ \addtolength{\leftskip}{\jlreq@footnoteindent}%
+ \parindent=1\zw
+ \noindent
+ \hskip-\glueexpr #1\relax
+ \jlreq@referencemark@format{\@thefnmark}%
+ \hskip\glueexpr 1\zw\relax
+ }##1%
+ }
+}
+\jlreqsetup{footnote_second_indent=1\zw}
+
+\jlreq@jlreqsetup@add{footnotetext_indent}{
+ \ClassWarningNoLine{jlreq}{footnotetext_indent was removed}
+}
+
+\ifx l\jlreq@engine
+ \fnfixbottomtrue
+\fi
+
+% \footnoteと\footnotemarkの前後に\jlreq@hook@prenote/\jlreq@hook@postnoteを入れる
+\jlreq@saveoriginalcs{\footnote}
+\jlreq@saveoriginalcs{\footnotemark}
+\def\footnote{%
+ \jlreq@hook@prenote
+ \@ifnextchar[{\jlreq@footnote@impl@woption}{\jlreq@footnote@impl@wooption}%
+}
+\def\footnotemark{%
+ \jlreq@hook@prenote
+ \@ifnextchar[{\jlreq@footnotemark@impl@woption}{\jlreq@footnotemark@impl@wooption}%
+}
+\if@tate
+ % 縦組の傍注は,その見開き内に付いている合印に対応する注を,奇数ページの左端にそろえて配置する.多段組では最下段の左端にそろえて配置する.(4.2.6.a)
+ % 必要ならば\footnoteを\footnotemarkと\footnotetextにわけ,\footnotetextをアウトプット時まで遅延することで実現する.
+ \def\jlreq@footnote@delayfootnoteslist{}
+ \preto\@opcol{%
+ \expandafter\gdef\expandafter\jlreq@footnote@delayfootnoteslist\expandafter{\expandafter}%
+ \jlreq@footnote@delayfootnoteslist
+ }
+ % \jlreq@footnote@delayfootnote@delay#1#2#3:#1ページ目に\footnotetext[#2]{#3}を出す
+ % \jlreq@footnote@delayfootnote@page:何ページ目に\footnotetextを入れるかを\jlreq@resultcntに入れる.その場での場合は-1.
+ \if@twocolumn
+ \def\jlreq@footnote@delayfootnote@page{%
+ \jlreq@setcurrentpage
+ \jlreq@resultcnt=\numexpr\jlreq@currentpage\ifodd\jlreq@currentpage\else + 1\fi\relax
+ % このページに表示&上の段処理済みだと\output内では間に合わない
+ \ifnum\jlreq@resultcnt=\value{page}\if@firstcolumn\else\jlreq@resultcnt=-1 \fi\fi
+ }
+ \long\def\jlreq@footnote@delayfootnote@delay#1#2#3{%
+ % 二段組みの場合は上段を組んだ直後に\footnotetextを挿入(そのページの下段に入る)
+ \ifnum 0\if@firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0
+ \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}{#3}}}%
+ \else
+ \footnotetext[#2]{#3}%
+ \fi
+ }
+ \else
+ \def\jlreq@footnote@delayfootnote@page{%
+ \jlreq@setcurrentpage
+ \ifodd\jlreq@currentpage
+ \jlreq@resultcnt=-1
+ \else
+ \jlreq@resultcnt=\numexpr\jlreq@currentpage+1\relax
+ \fi
+ }
+ \long\def\jlreq@footnote@delayfootnote@delay#1#2#3{%
+ % 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入.
+ \ifnum\numexpr#1 - 1\relax>\value{page}%
+ \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}{#3}}}%
+ \else
+ \footnotetext[#2]{#3}%
+ \fi
+ }
+ \fi
+ \def\jlreq@footnote@delayfootnote@immediate#1#2#3{%
+ \ifnum #1<\jlreq@currentpage
+ \xappto\jlreq@footnote@delayfootnoteslist{\unexpanded{\jlreq@footnote@delayfootnote{#1}{#2}{#3}}}%
+ \else
+ \footnotetext[#2]{#3}%
+ \fi
+ }
+ \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@delay
+ \def\jlreq@footnote@flushdelayfootnoteslist{%
+ \ifx\jlreq@footnote@delayfootnoteslist\@empty\else
+ \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@immediate
+ \jlreq@setcurrentpage
+ \expandafter\gdef\expandafter\jlreq@footnote@delayfootnoteslist\expandafter{\expandafter}%
+ \jlreq@footnote@delayfootnoteslist
+ \let\jlreq@footnote@delayfootnote=\jlreq@footnote@delayfootnote@delay
+ \fi
+ }
+ \AtEndDocument{\jlreq@footnote@flushdelayfootnoteslist}
+ \preto\newpage{\jlreq@footnote@flushdelayfootnoteslist}
+ \long\def\jlreq@footnote@impl@woption[#1]#2{%
+ \jlreq@footnote@delayfootnote@page
+ \ifnum\jlreq@resultcnt=-1
+ \jlreq@useoriginalcs{\footnote}[#1]{#2}%
+ \else
+ \jlreq@useoriginalcs{\footnotemark}[#1]%
+ \xappto\jlreq@footnote@delayfootnoteslist{\noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{\unexpanded{#1}}{\unexpanded{#2}}}%
+ \fi
+ \jlreq@hook@postnote
+ }
+ \long\def\jlreq@footnote@impl@wooption#1{%
+ \jlreq@footnote@delayfootnote@page
+ \ifnum\jlreq@resultcnt=-1
+ \jlreq@useoriginalcs{\footnote}{#1}%
+ \else
+ \jlreq@useoriginalcs{\footnotemark}%
+ \xappto\jlreq@footnote@delayfootnoteslist{\noexpand\jlreq@footnote@delayfootnote{\the\jlreq@resultcnt}{\the\value{footnote}}{\unexpanded{#1}}}%
+ \fi
+ \jlreq@hook@postnote
+ }
+\else
+ \long\def\jlreq@footnote@impl@woption[#1]#2{%
+ \jlreq@useoriginalcs{\footnote}[#1]{#2}%
+ \jlreq@hook@postnote
+ }
+ \long\def\jlreq@footnote@impl@wooption#1{%
+ \jlreq@useoriginalcs{\footnote}{#1}%
+ \jlreq@hook@postnote
+ }
+\fi
+\long\def\jlreq@footnotemark@impl@woption[#1]{%
+ \jlreq@useoriginalcs{\footnotemark}[#1]%
+ \jlreq@hook@postnote
+}
+\long\def\jlreq@footnotemark@impl@wooption{%
+ \jlreq@useoriginalcs{\footnotemark}%
+ \jlreq@hook@postnote
+}
+
+% 合印
+\renewcommand*{\@makefnmark}{%
+ \jlreq@ifydir{\jlreq@notemark{\@thefnmark}}{\hbox{\jlreq@notemark{\@thefnmark}}}%
+}
+% 4.2.2注3
+\if@tate
+ \renewcommand*{\thefootnote}{\jlreq@open@bracket@before@space\inhibitglue(\jlreq@rensuji{\@arabic\c@footnote})\inhibitglue}
+\else
+ \renewcommand*{\thefootnote}{\arabic{footnote}\hbox{})\inhibitglue}
+\fi
+\ifthenelse{\equal{\jlreq@article@type}{article}}{}{\@addtoreset{footnote}{chapter}}
+
+
+%.. 後注(4.2.4)
+\def\jlreq@endnotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
+\def\jlreq@endnotecounter{footnote}% 後注用のカウンタ名
+% 文字サイズは\footnotesizeを使う
+\newdimen\jlreq@endnote@prepostspace
+% 前の分との間は行間分空ける(4.2.4.f)
+\jlreq@endnote@prepostspace=\dimexpr\baselineskip - 1\jlreq@gol\relax
+\newdimen\jlreq@endnote@indent
+% 現在の後注一覧を,\jlreq@endnote@textsに{{合印1}{後注1}}{{合印2}{後注2}}...の形で保持する
+\def\jlreq@endnote@texts{}
+\long\def\jlreq@endnote@addtext#1#2{\xappto\jlreq@endnote@texts{\unexpanded{{{#1}{#2}}}}}
+% \endnote自身は後で定義する
+\def\jlreq@endnote@impl{\jlreq@hook@prenote\@ifnextchar[{\jlreq@endnote}{\jlreq@endnote[]}}
+\def\endnotemark{\jlreq@hook@prenote\@ifnextchar[{\jlreq@endnotemark}{\jlreq@endnotemark[]}}
+\def\endnotetext{\@ifnextchar[{\jlreq@endnotetext}{\jlreq@endnotetext[]}}
+\long\def\jlreq@endnote[#1]#2{\jlreq@endnotemark[#1]\@endnotetext{#2}\jlreq@hook@postnote}
+\def\jlreq@endnotemark[#1]{%
+ \jlreq@ifempty{#1}{%
+ \stepcounter{\jlreq@endnotecounter}%
+ \expandafter\protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq@endnotecounter\endcsname #1\relax
+ \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
+ \endgroup
+ }%
+ \@endnotemark
+ \jlreq@hook@postnote
+}
+\jlreq@setdefaultnotemark\@endnotemark\@makeendmark
+\long\def\jlreq@endnotetext[#1]#2{%
+ \jlreq@ifempty{#1}{%
+ \expandafter\protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq@endnotecounter\endcsname #1\relax
+ \expandafter\unrestored@protected@xdef\csname\jlreq@endnotemarkname\endcsname{\csname the\jlreq@endnotecounter\endcsname}%
+ \endgroup
+ }%
+ \@endnotetext{#2}%
+}
+\long\def\@endnotetext#1{%
+ \expandafter\let\expandafter\jlreq@tempa\expandafter=\csname\jlreq@endnotemarkname\endcsname
+ \expandafter\jlreq@endnote@addtext\expandafter{\jlreq@tempa}{#1}%
+}
+\long\def\jlreq@theendnotes#1{%
+ \jlreq@ifendmark{#1}{}{%
+ \jlreq@output@endnotes#1
+ \jlreq@theendnotes
+ }%
+}
+\long\def\jlreq@output@endnotes#1#2{%
+ \expandafter\def\csname\jlreq@endnotemarkname\endcsname{#1}%
+ \item\@makeendtext{#2}%
+}
+
+\newcommand*{\theendnotes}{%
+ \ifx\jlreq@endnote@texts\@empty\else
+ \let\jlreq@tempa=\jlreq@endnote@texts
+ \gdef\jlreq@endnote@texts{}%
+ \edef\jlreq@endnote@beforeafterspace{\the\dimexpr\baselineskip - 1\jlreq@gol\relax plus \the\dimexpr 1\jlreq@gol\relax}%
+ \begingroup
+ \par
+ \footnotesize
+ % 後注の長さを文字サイズの整数倍にする(4.2.4.b)
+ \jlreq@tempdima=\dimexpr\linewidth - \jlreq@endnote@indent - \leftskip\relax
+ \@tempdimb=1\jlreq@mol
+ \divide\jlreq@tempdima\@tempdimb\multiply\jlreq@tempdima\@tempdimb
+ \begin{list}{}{%
+ \itemsep=0pt\relax
+ \parsep=0pt\relax
+ \partopsep=0pt\relax
+ \topsep=0pt\relax
+ \leftmargin=\dimexpr\linewidth - \jlreq@tempdima + \jlreq@endnote@second@indent\relax
+ \itemindent=-\glueexpr\jlreq@endnote@second@indent\relax
+ \topsep=\jlreq@endnote@beforeafterspace\relax
+ \listparindent=1\zw
+ }%
+ \expandafter\jlreq@theendnotes\jlreq@tempa\jlreq@endmark
+ \end{list}%
+ \endgroup
+ \par
+ \fi
+}
+% 4.2.4.b
+\jlreq@endnote@indent=2\jlreq@mol
+\jlreq@jlreqsetup@add{endnote_second_indent}{
+ \def\jlreq@endnote@second@indent{#1}
+ \ifthenelse{
+ \( \lengthtest{0.99\zw < #1} \AND \lengthtest{#1 < 1.01\zw} \) \OR
+ \( \lengthtest{1.99\zw < #1} \AND \lengthtest{#1 < 2.01\zw} \)
+ }{}{\jlreq@note{後注が2行以上となった場合,後注の2行目以下の字下げは,1行目より,後注の文字サイズの2倍又は全角とする (4.2.4.d).}}
+}
+\jlreqsetup{endnote_second_indent=2\zw}
+\newcommand{\@makeendtext}[1]{%
+ \csname\jlreq@endnotemarkname\endcsname
+ \hskip\glueexpr1\zw\relax% 見出し出力と一文字分の空き(4.2.4.c)
+ #1%
+}
+\let\@makeendmark=\@makefnmark
+
+% \theendnoteの出力を仕込む
+\apptocmd{\jlreq@hook@beforeheadings}{\jlreq@endnote@hook@beforeheadings{#1}}{}{}
+
+\jlreq@jlreqsetup@add{endnote_position}{
+ \def\jlreq@endnote@hook@beforeheadings##1{}
+ \jlreq@tempafalse % headingsが指定された
+ \jlreq@tempbfalse % paragraphが指定された
+ % \jlreq@tempcにセクション名たちを入れていく
+ \def\jlreq@tempc{}
+ \@for\jlreq@tempa:=#1\do{
+ \jlreq@switch{\jlreq@tempa}{
+ {headings}{\jlreq@tempatrue}
+ {paragraph}{
+ \jlreq@tempatrue% _paragraphの時は_headingsも有効にする
+ \jlreq@tempbtrue
+ }
+ {
+ \expandafter\jlreq@iffirsttoken@ignorespaces\expandafter{\jlreq@tempa}{_}{
+ \edef\jlreq@tempc{\jlreq@tempc,\expandafter\@gobble\jlreq@tempa}
+ }{
+ \ClassError{jlreq}{Invalid value \jlreq@tempa\space in endnote_position}{\@ehc}
+ }
+ }
+ }
+ }
+
+ \ifjlreq@tempb
+ \edef\endnote{\unexpanded{\def\par{\@restorepar\theendnotes\par}}\expandonce{\jlreq@endnote@impl}}
+ \else
+ \let\endnote=\jlreq@endnote@impl
+ \fi
+
+ \ifjlreq@tempa
+ \apptocmd{\jlreq@endnote@hook@beforeheadings}{\theendnotes}{}{}
+ \else
+ \@for\@tempa:=\jlreq@tempc\do{
+ \ifx\@tempa\@empty\else
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@endnote@hook@beforeheadings##1}{\expandonce{\jlreq@endnote@hook@beforeheadings{##1}}%
+ \unexpanded{\def\@tempa}{\@tempa}\unexpanded{\def\@tempb{##1}}%
+ \unexpanded{\ifx\@tempa\@tempb\theendnotes\fi}%
+ }
+ }
+ \jlreq@do
+ \fi
+ }
+ \fi
+}
+\jlreqsetup{endnote_position=headings}
+\AtEndDocument{\theendnotes}
+
+
+% (1) \footnoteとかと同じ形式 sidenote_type=number
+% (2) 文中にマークを入れて,傍注には見出しが入る sidenote_type=symbol
+% (3) 文中は強調文字列,傍注には見出しが入る sidenote_type=symbol
+% (4) 文中は何も無し,傍注には見出しが入る sidenote_type=symbol
+
+% (1) では\sidenote[]{}を定義
+% (2) では\sidenote{見出し}{注中身}を定義
+% \marginparwidth>0ptの時のみ定義する
+\ifdim\marginparwidth>0pt \expandafter\@firstofone\else\expandafter\@gobble\fi
+{
+ \def\jlreq@sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
+ \long\def\@sidenotetext#1{%
+ \marginpar{\reset@font\footnotesize
+ \color@begingroup
+ \@makesidetext{#1}%
+ \color@endgroup
+ }%
+ }
+ \jlreq@setdefaultnotemark\@sidenotemark\@makesidemark
+ \def\jlreq@sidenotecounter{footnote}% 傍注用のカウンタ名
+ \jlreq@jlreqsetup@add{sidenote_type}[number,symbol]{\def\jlreq@sidenote@type{#1}}
+ \jlreqsetup{sidenote_type=number}
+ \jlreq@jlreqsetup@addtofinally{
+ \ifthenelse{\equal{\jlreq@sidenote@type}{number}}{
+ \def\sidenote{\jlreq@hook@prenote\@ifnextchar[{\jlreq@sidenote}{\jlreq@sidenote[]}}
+ \def\sidenotemark{\jlreq@hook@prenote\@ifnextchar[{\jlreq@sidenotemark}{\jlreq@sidenotemark[]}}
+ \def\sidenotetext{\@ifnextchar[{\jlreq@sidenotetext}{\jlreq@sidenotetext[]}}
+ \long\def\jlreq@sidenote[#1]#2{\jlreq@sidenotemark[#1]\@sidenotetext{#2}\jlreq@hook@postnote}
+ \def\jlreq@sidenotemark[#1]{%
+ \jlreq@ifempty{#1}{%
+ \stepcounter{\jlreq@sidenotecounter}%
+ \expandafter\protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq@sidenotecounter\endcsname #1\relax
+ \expandafter\unrestored@protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
+ \endgroup
+ }%
+ \@sidenotemark
+ \jlreq@hook@postnote
+ }
+ \long\def\jlreq@sidenotetext[#1]#2{%
+ \jlreq@ifempty{#1}{%
+ \expandafter\protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq@sidenotecounter\endcsname#1\relax
+ \expandafter\unrestored@protected@xdef\csname\jlreq@sidenotemarkname\endcsname{\csname the\jlreq@sidenotecounter\endcsname}%
+ \endgroup
+ }%
+ \@sidenotetext{#2}%
+ }
+ % \hspace{0.5\jlreq@mol}の部分は二分空きにする例もある(4.2.7.g)
+ \ifx l\jlreq@engine
+ \long\def\@makesidetext#1{\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
+ \else
+ % thefootnote = \inhibitglue (...だと\inhibitglueが効かないので空白を挟む
+ \long\def\@makesidetext#1{ \kern-1\zw\csname\jlreq@sidenotemarkname\endcsname\hspace{0.5\jlreq@mol}#1}
+ \fi
+ \let\@makesidemark=\@makefnmark
+ }{% sidenote_type = symbol
+ \long\def\sidenote#1#2{\jlreq@sidenote{#1}{#2}}
+ \def\sidenotemark#1{\jlreq@sidenotemark{#1}}
+ \long\def\sidenotetext#1#2{\jlreq@sidenotetext{#1}{#2}}
+ \long\def\jlreq@sidenote#1#2{\jlreq@sidenotemark{#1}\jlreq@sidenotetext{#1}{#2}}
+ \edef\jlreq@sidenotemark#1{%
+ {\unexpanded{\reset@font\jlreq@sidenote@keywordfont}#1}%
+ \noexpand\jlreq@hook@prenote
+ \ifx\jlreq@sidenote@defaultmark\@empty\else
+ \expandafter\edef\expandonce{\csname\jlreq@sidenotemarkname\endcsname}{\expandonce{\jlreq@sidenote@defaultmark}}%
+ \noexpand\@sidenotemark
+ \fi
+ }
+ % カスタマイズできるべき?
+ \long\def\jlreq@sidenotetext#1#2{%
+ \expandafter\def\csname\jlreq@sidenotemarkname\endcsname{\inhibitglue\null{\reset@font\sffamily\bfseries\inhibitglue #1}}%
+ \@sidenotetext{#2}%
+ }
+ \long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq@sidenotemarkname\endcsname}\hspace*{1\jlreq@mol}#1}
+ \let\@makesidemark=\@makefnmark
+
+ \apptocmd{\sidenote}{\jlreq@hook@postnote}{}{}
+ \apptocmd{\sidenotemark}{\jlreq@hook@postnote}{}{}
+ }
+ }
+ \jlreq@jlreqsetup@add{sidenote_symbol}{\def\jlreq@sidenote@defaultmark{#1}}
+ \jlreq@jlreqsetup@add{sidenote_keyword_font}{\def\jlreq@sidenote@keywordfont{#1}}
+ \jlreqsetup{sidenote_symbol=*,sidenote_keyword_font={}}
+}
+
+%.. 割注(3.4)
+\def\inlinenotesize{.6\jlreq@jafontsize} % 割注の文字サイズ
+\let\jlreq@inlinenote@autolinebreak=\\% 計測時は\linebreakより\\の方が安定する.悩ましい…….
+
+\newcommand{\jlreq@inlinenote@kakkofontsize}{%
+ \fontsize{\dimexpr\inlinenotesize * 2\relax}{\dimexpr \inlinenotesize * 2\relax}%
+ \selectfont
+}
+
+\newcommand{\jlreq@inlinenote@fontsize}{%
+ \fontsize{\inlinenotesize}{\inlinenotesize}%
+ \selectfont
+}
+
+% 割注を入れるための命令.\inlinenote{割注}で使う.
+% 改行位置は自動で計算されるが,常に正しいとは限らない.
+% \inlinenote*は自動で改行されない.\\で改行位置を指定する.
+\newif\ifjlreq@in@inlinenote
+\jlreq@in@inlinenotefalse
+\newcommand*{\inlinenote}{%
+ \ifjlreq@in@inlinenote\ClassError{jlreq}{\string\inlinenote\space can't be nested}{\@ehc}\fi
+ \jlreq@in@inlinenotetrue
+ \ifvmode\leavevmode\fi
+ \@ifstar\jlreq@inlinenote@noauto\jlreq@inlinenote@auto}
+\let\warichu=\inlinenote
+
+\newcommand*{\jlreq@inlinenote@auto}[1]{%
+ % 割注初め括弧の前の場所を保存
+ \jlreq@savepos@for@rest@linewidth
+ % \jlreq@tempdimbに,現在行の残り長さを入れる
+ \jlreq@tempdimb=\jlreq@rest@linewidth
+ % 括弧の分を引いたものが,割注の使える長さ
+ \setbox\@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue\jlreq@open@bracket@before@space(\inhibitglue}%
+ \addtolength{\jlreq@tempdimb}{-\wd\@tempboxa}%
+ \ifdim\jlreq@tempdimb<0pt\jlreq@tempdimb=\linewidth\fi
+ {%
+ \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue \jlreq@open@bracket@before@space(}%
+ \jlreq@box@putcenter\jlreq@tempboxa
+ }%
+ % 「初回」時はここに強制改行を入れる.これにより現在位置の取得がより正しくなる……といいなぁ
+ \jlreq@savepos@iflabelundefined{\\}{}%
+ % 割注内の\baselineskipを保存(後で使う).
+ {\jlreq@inlinenote@fontsize\xdef\jlreq@inlinenote@baselineskip{\the\baselineskip}}%
+ % 普通に並べた長さを計測し,その半分から始める
+ \setbox\@tempboxa=\hbox{\jlreq@inlinenote@fontsize #1}%
+ \jlreq@tempdimc=\wd\@tempboxa
+ \divide\jlreq@tempdimc by 2\relax
+ % \@tempcntbに,この長さで計測した場合の行数を入れる
+ \ifdim\jlreq@tempdimc<\jlreq@tempdimb\@tempcntb=2\relax
+ \else
+ \jlreq@tempdima=\dimexpr\jlreq@tempdimc - \jlreq@tempdimb\relax
+ \divide\jlreq@tempdima\linewidth
+ \@tempcntb=\number\jlreq@tempdima
+ \multiply\@tempcntb by 2\relax
+ \advance\@tempcntb by 4\relax
+ \fi
+ % \jlreq@parshapeargに\parshapeに指定する書式の最後以外を入れる.
+ \ifnum\@tempcntb>2\relax
+ \edef\jlreq@parshapearg{0pt \the\jlreq@tempdimb\space 0pt \the\jlreq@tempdimb}%
+ \@tempcnta=4\relax
+ \@whilenum\@tempcnta<\@tempcntb\do{%
+ \edef\jlreq@parshapearg{\jlreq@parshapearg\space 0pt \the\linewidth\space 0pt \the\linewidth}%
+ \advance\@tempcnta by 2\relax
+ }%
+ \setlength{\jlreq@tempdimc}{\dimexpr\jlreq@tempdimc - \jlreq@tempdimb - \linewidth * \numexpr(\@tempcntb - 4)/2\relax\relax}%
+ \else
+ \def\jlreq@parshapearg{}%
+ \fi
+ % 行数を伸ばしつつ良いところを探していく
+ \@whilenum\@tempcntb<1001\do{%
+ \ifnum\@tempcntb>2\jlreq@tempdimb=\linewidth\fi
+ \edef\@tempb{\the\@tempcntb}%
+ \jlreq@inlinenote@determinelength{#1}{\jlreq@inlinenote@fontsize}{\jlreq@parshapearg}{2}{\@tempb}{\jlreq@tempdimc}{\jlreq@tempdimb}%
+ \@tempcntb=\@tempb
+ \ifnum\@tempcntb>999\relax% ループが長すぎる
+ \global\setbox\jlreq@resultbox=\voidb@x%
+ \@tempcntb=1001\relax
+ \fi
+ \ifvoid\jlreq@resultbox\else% 成功
+ \edef\jlreq@inlinenote@lines{\the\@tempcntb}% 行数を保存
+ \@tempcntb=1001\relax
+ \fi
+ \advance\@tempcntb by 2\relax
+ \edef\jlreq@parshapearg{\jlreq@parshapearg 0pt \the\jlreq@tempdimb 0pt \the\jlreq@tempdimb}%
+ }%
+ \ifvoid\jlreq@resultbox
+ \ClassWarning{jlreq}{\string\warichu\space failed, may be a bug}%
+ \else
+ \@tempcnta=0
+ \splittopskip=0pt\relax
+ \splitmaxdepth=\maxdimen
+ % 現在行の残り長さを思い出す
+ \jlreq@tempdimb=\jlreq@rest@linewidth
+ \setbox\@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue\jlreq@open@bracket@before@space(\inhibitglue}%
+ \addtolength{\jlreq@tempdimb}{-\wd\@tempboxa}%
+ \setbox\@tempboxa=\box\jlreq@resultbox
+ \@whilenum\@tempcnta<\jlreq@inlinenote@lines\do{%
+ \ifnum\@tempcnta>0 \jlreq@inlinenote@autolinebreak\fi
+ % \jlreq@tempdimaに今の行の長さを入れる
+ \ifnum\@tempcnta<\numexpr\jlreq@inlinenote@lines - 2\relax
+ \ifnum\@tempcnta=0\jlreq@tempdima=\jlreq@tempdimb
+ \else\jlreq@tempdima=\linewidth\fi
+ \else
+ % 最終行は自然長に任せる
+ \jlreq@tempdima=-1pt\relax
+ \fi
+ {%
+ \edef\@tempa{\the\vbadness}%
+ \vbadness=10000
+ \setbox\jlreq@tempboxa=\vsplit\@tempboxa to \dimexpr\jlreq@inlinenote@baselineskip*2\relax
+ \vbadness=\@tempa\relax
+ \jlreq@getlastbox{\jlreq@tempboxa}%
+ \setbox\jlreq@tempboxb=\box\jlreq@resultbox
+ \jlreq@getlastbox{\jlreq@tempboxa}%
+ \setbox\jlreq@tempboxa=\box\jlreq@resultbox
+ \ifdim\jlreq@tempdima>0pt\relax
+ \setbox\jlreq@tempboxa=\vbox{\jlreq@inlinenote@fontsize
+ \hbox to \jlreq@tempdima{\unhbox\jlreq@tempboxa}%
+ \hbox to \jlreq@tempdima{\unhbox\jlreq@tempboxb}}%
+ \else
+ \setbox\jlreq@tempboxa=\vbox{\jlreq@inlinenote@fontsize
+ \hbox{\unhbox\jlreq@tempboxa}%
+ \hbox{\unhbox\jlreq@tempboxb}}%
+ \fi
+ \jlreq@box@putcenter\jlreq@tempboxa
+ }%
+ \advance\@tempcnta by 2\relax
+ }%
+ \fi
+ \jlreq@inlinenote@endnote
+}
+
+\newcommand*{\jlreq@inlinenote@noauto}[1]{%
+ \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize\inhibitglue\jlreq@open@bracket@before@space(}%
+ \inhibitglue\jlreq@box@putcenter\jlreq@tempboxa
+ \jlreq@inlinenote@noauto@#1\\\jlreq@endmark\jlreq@endmark
+ \jlreq@inlinenote@endnote
+}
+
+\def\jlreq@inlinenote@noauto@#1\\#2#3\jlreq@endmark{%
+ \jlreq@inlinenote@noauto@@#1&\jlreq@endmark\jlreq@endmark
+ \jlreq@ifendmark{#2}{}{\linebreak\jlreq@inlinenote@noauto@#2#3\jlreq@endmark}%
+}
+
+\def\jlreq@inlinenote@noauto@@#1&#2#3\jlreq@endmark{%
+ \jlreq@ifendmark{#2}{%
+ \setbox\@tempboxa=\hbox{\jlreq@inlinenote@fontsize #1}%
+ \jlreq@tempdimc=\wd\@tempboxa
+ \divide\jlreq@tempdimc by 2\relax
+ \jlreq@inlinenote@determinelength{#1}{\jlreq@inlinenote@fontsize}{}{2}{2}{\jlreq@tempdimc}{\maxdimen}%
+ \ifvoid\jlreq@resultbox\else
+ {%
+ \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@fontsize\box\jlreq@resultbox}%
+ \jlreq@box@putcenter\jlreq@tempboxa
+ }%
+ \fi
+ \def\jlreq@next{}%
+ }{%
+ \def\jlreq@next{\jlreq@inlinenote@noauto@@@{#1}#2#3}%
+ }%
+ \jlreq@next
+}
+
+\def\jlreq@inlinenote@noauto@@@#1#2&\jlreq@endmark{%
+ \setbox\@tempboxa=\hbox{\jlreq@inlinenote@fontsize\vbox{\hbox{#1}\hbox{#2}}}%
+ \jlreq@box@putcenter\@tempboxa
+}
+
+\newcommand{\jlreq@inlinenote@endnote}{%
+ \jlreq@in@inlinenotefalse
+ {%
+ \setbox\jlreq@tempboxa=\hbox{\jlreq@inlinenote@kakkofontsize)}%
+ \jlreq@box@putcenter\jlreq@tempboxa
+ \inhibitglue
+ }%
+}
+
+% \jlreq@inlinenote@determinelength{テキスト(1)}{フォントとか指定(2)}{\parshape指定(3)}{調整に使う行数(4)}{成功行数(5)}{最小長さ(6)}{最大長さ(7)}
+% 次を満たす長さXの最小値を求める(ただし#6 <= X <= #7)
+% #1を
+% * #5 - #4行目までは#3の指定に従う
+% * それ以降はX
+% として整形した際に,#5行以内に収まる.
+% \jlreq@resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
+\newcommand{\jlreq@inlinenote@determinelength}[7]{%
+% \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
+ \@tempcnta=1\relax
+ \def\@tempa{}%
+ % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq@tempdima.
+ \@whilenum\@tempcnta<#4\do{%
+ \expandafter\def\expandafter\@tempa\expandafter{\@tempa 0pt \the\jlreq@tempdima}%
+ \advance\@tempcnta by 1\relax
+ }%
+ \@tempcnta=0
+ \jlreq@tempdima=#6\relax
+ % \jlreq@tempdimaを少しずつ伸ばしていく
+ \@whilenum\@tempcnta<1000\do{%
+ \ifnum\@tempcnta>999\relax% ループが長すぎる
+ \global\setbox\jlreq@resultbox=\voidb@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@tempdima = \the\jlreq@tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}%
+ \fi
+ \jlreq@getlastbox{\@tempboxa}%
+ \setbox\jlreq@tempboxa=\box\jlreq@resultbox
+ \ifnum\@tempcntb<#5\relax% 行数が達していないならOK
+% \message{行数 = \the\@tempcntb により確定}
+ % #5行になるまで空の水平ボックスを加えていく.
+ \global\setbox\jlreq@resultbox=\vbox{#2%
+ \unvbox\@tempboxa\hbox{\unhbox\jlreq@tempboxa\unskip\unskip\unpenalty}%
+ \@whilenum\@tempcntb<#5\do{\hbox{}\advance\@tempcntb by 1}}%
+ \@tempcnta=1001\relax
+ \else
+ % そうでない場合は最後の二行の長さを比較する
+ \jlreq@getlastbox{\@tempboxa}%
+ \setbox\jlreq@tempboxb=\box\jlreq@resultbox
+% \message{最終行の長さ \the\wd\jlreq@tempboxa, その前の長さ \the\wd\jlreq@tempboxb}%
+ \ifdim\wd\jlreq@tempboxa>\wd\jlreq@tempboxb
+ \advance\jlreq@tempdima by 0.3pt\relax% 0.3ptに意味はない
+ \else
+ % 後ろが短いのでOK
+ \global\setbox\jlreq@resultbox=\vbox{#2\unvbox\@tempboxa\box\jlreq@tempboxb\box\jlreq@tempboxa}%
+ \jlreq@resultdimen=\jlreq@tempdima
+ \@tempcnta=1001\relax
+ \fi
+ \fi
+ \ifdim\jlreq@tempdima>#7\relax
+ \global\setbox\jlreq@resultbox=\box\voidb@x
+ \@tempcnta=1001\relax
+ \fi
+ \advance\@tempcnta by 1\relax
+ }%
+}
+
+%. ページスタイル.
+% メモ:
+% 2.6.1.cの後半が前半と整合的でないように見える……
+% 柱:両柱と片柱(2.6.3)
+\@tempdima=\jlreq@speciallength{\jlreq@headfoot@sidemargin}
+\ifthenelse{\lengthtest{\@tempdima=0pt} \OR \(\lengthtest{0.99\zw < \@tempdima} \AND \lengthtest{\@tempdima < 1.01\zw}\)}{}{
+ \jlreq@note{ノンブルまたは柱は,基本版面の左右にそろえるか,全角アキだけ寄せた位置に配置する (2.6.1.b).}
+}
+
+%.. 場所指定解析
+% bottom-leftみたいなのを解釈する.入力の順番はどっちでも良いが,出力は<top/bottom><left/right>の順番
+% #1 = bottom-leftみたいなのを{bottom}{left}に変換し,#2に代入,#3はデフォルト値,出力形式で入れる
+\newcommand*{\jlreq@pagestyle@parse@position}[3]{%
+ \jlreq@ifempty{#1}{\def#2{#3}}%
+ {%
+ \begingroup
+ \jlreq@pagestyle@parse@position@#1-\jlreq@endmark
+ % \jlreq@tempcに縦方向を,\jlreq@tempdに横方向を入れる
+ \def\jlreq@tempc{}\def\jlreq@tempd{}%
+ \jlreq@pagestyle@parse@position@@{\jlreq@tempa}%
+ \jlreq@pagestyle@parse@position@@{\jlreq@tempb}%
+ \ifx\jlreq@tempc\@empty\edef\jlreq@tempc{\expandafter\@firstoftwo#3}\fi
+ \ifx\jlreq@tempd\@empty\edef\jlreq@tempd{\expandafter\@secondoftwo#3}\fi
+ \edef\jlreq@do{\unexpanded{\def#2}{{\jlreq@tempc}{\jlreq@tempd}}}%
+ \expandafter\endgroup
+ \jlreq@do
+ }%
+}
+
+\def\jlreq@pagestyle@parse@position@#1-#2\jlreq@endmark{%
+ \def\jlreq@tempa{#1}\def\jlreq@tempb{#2}%
+ \jlreq@ifempty{#2}{%
+ \ifx\jlreq@tempb\@empty\ClassError{jlreq}{Invalid position: #1}{\@ehc}\fi
+ }{%
+ \def\@tempa##1-{\def\jlreq@tempb{##1}}%
+ \@tempa#2\relax
+ }%
+}
+
+\newcommand*\jlreq@pagestyle@parse@position@@[1]{%
+ \jlreq@switch{#1}{
+ {top}{\def\jlreq@tempc{#1}}
+ {bottom}{\def\jlreq@tempc{#1}}
+ {left}{\def\jlreq@tempd{#1}}
+ {right}{\def\jlreq@tempd{#1}}
+ {center}{\def\jlreq@tempd{#1}}
+ {gutter}{\if@tate\def\jlreq@tempd{right}\else\def\jlreq@tempd{left}\fi}
+ {fore_edge}{\if@tate\def\jlreq@tempd{left}\else\def\jlreq@tempd{right}\fi}
+ {\ClassError{jlreq}{Invalid position: #1}{\@ehc}}
+ }%
+}
+
+% レベル#1より低いレベルの見出しの**markを\markboth{}{}にする
+\def\jlreq@pagestyle@setclearmark#1{%
+ \@for\@tempa:=\jlreq@heading@allheadings\do{%
+ \@ifundefined{\@tempa}{}{%
+ \ifnum\csname jlreq@heading@level@\@tempa\endcsname<#1\relax\expandafter\def\csname\@tempa mark\endcsname##1{\markboth{}{}}\fi
+ }%
+ }%
+}
+
+% #1のleftとrightを入れ替えて#1に代入
+\def\jlreq@reverse@leftright#1{%
+ \jlreq@switch{#1}{
+ {left}{\def#1{right}}
+ {right}{\def#1{left}}
+ }%
+}
+
+%.. マークの拡張
+% 三つ以上のマークを保持するために,markを次のようにする
+% <マーク1>\jlreq@extramark{{<マーク2>}{<マーク3>}...}
+\def\jlreq@extramark#1{}
+
+% #1番目の\leftmarkや\rightmarkを取得する.\leftmark/\rightmarkの実装に強く依存している.
+\def\jlreq@extraleftmark#1{\jlreq@getextramark{#1}{\leftmark}}%
+\def\jlreq@extrarightmark#1{\jlreq@getextramark{#1}{\rightmark}}%
+\def\jlreq@getextramark#1#2{\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\jlreq@getextramark@#2\jlreq@extramark\jlreq@endmark{#1}}
+\def\jlreq@getextramark@#1\jlreq@extramark#2\jlreq@endmark#3{%
+ \jlreq@ifempty{#2}{}{\jlreq@getextramark@@{#3}#2}%
+}
+\def\jlreq@getextramark@@#1#2#3\jlreq@extramark{\jlreq@getextramark@@@{#1}#2\jlreq@endmark}
+\def\jlreq@getextramark@@@#1#2{%
+ \jlreq@ifendmark{#2}{}{%
+ \ifnum#1=1 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {\jlreq@getextramark@@@@{#2}}{\expandafter\jlreq@getextramark@@@\expandafter{\the\numexpr #1-1\relax}}%
+ }%
+}
+\def\jlreq@getextramark@@@@#1#2\jlreq@endmark{#1}
+
+% トークン列#1に必要ならば\jlre@extramarkを加え,#2に代入
+\def\jlreq@addextramarkcommand#1#2{%
+ \jlreq@ifcontains{#1}{\jlreq@extramark}{\edef#2{\unexpanded{#1}}}{\edef#2{\unexpanded{#1\jlreq@extramark{}}}}%
+}
+\def\jlreq@addextramarkcommand@tothemark{%
+ \begingroup
+ \expandafter\expandafter\expandafter\jlreq@addextramarkcommand\expandafter\expandafter\expandafter{\expandafter\@firstoftwo\@themark}{\jlreq@tempa}%
+ \expandafter\expandafter\expandafter\jlreq@addextramarkcommand\expandafter\expandafter\expandafter{\expandafter\@secondoftwo\@themark}{\jlreq@tempb}%
+ \edef\jlreq@do{\unexpanded{\def\@themark}{{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}}}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% #1番目を#2に置き換える
+\def\jlreq@setextraleftmark#1#2{%
+ \let\jlreq@extramark@=\jlreq@extramark
+ \begingroup
+ \jlreq@addextramarkcommand@tothemark
+ \def\jlreq@extramark##1{\noexpand\jlreq@extramark{\jlreq@changeargument{##1}{#1}{#2}}}%
+ \protected@edef\jlreq@tempa{\expandafter\@firstoftwo\@themark}%
+ \def\jlreq@extramark{\noexpand\jlreq@extramark}%
+ \protected@edef\jlreq@tempb{\expandafter\@secondoftwo\@themark}%
+ \edef\@themark{{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}}%
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@extramark{\noexpand\jlreq@extramark}}%
+ \noexpand\markboth\expandonce{\@themark}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \let\jlreq@extramark=\jlreq@extramark@
+}
+\def\jlreq@setextrarightmark#1#2{%
+ \let\jlreq@extramark@=\jlreq@extramark
+ \begingroup
+ \jlreq@addextramarkcommand@tothemark
+ \def\jlreq@extramark{\noexpand\jlreq@extramark}%
+ \protected@edef\jlreq@tempa{\expandafter\@firstoftwo\@themark}%
+ \def\jlreq@extramark##1{\noexpand\jlreq@extramark{\jlreq@changeargument{##1}{#1}{#2}}}%
+ \protected@edef\jlreq@tempb{\expandafter\@secondoftwo\@themark}%
+ \edef\@themark{{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}}%
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@extramark{\noexpand\jlreq@extramark}}%
+ \noexpand\markright{\expandonce{\jlreq@tempb}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \let\jlreq@extramark=\jlreq@extramark@
+}
+
+% #1内の#2番目を#3に取り替える.\jlreq@changeargument{{arg1}{arg2}...{argk}}{n}{arg}
+% k < nならば{}を加えた後{arg}を最後につける
+\def\jlreq@changeargument#1#2#3{%
+ \jlreq@changeargument@{#2}{#3}#1\jlreq@endmark
+}
+\def\jlreq@changeargument@#1#2#3{%
+ \jlreq@ifendmark{#3}{%
+ \ifnum#1>0 \expandafter\@firstofone\else\expandafter\@gobble\fi
+ {\jlreq@changeargument@@{#1}{#2}}%
+ }{%
+ \ifnum#1=1 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {{#2}}{{#3}}%
+ \expandafter\jlreq@changeargument@\expandafter{\the\numexpr #1 - 1\relax}{#2}%
+ }%
+}
+\def\jlreq@changeargument@@#1#2{%
+ \ifnum#1<2 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{{#2}}{%
+ {}\expandafter\jlreq@changeargument@@\expandafter{\the\numexpr #1 -1 \relax}{#2}%
+ }%
+}
+
+% \jlreq@cleararguments{k}{{arg1}...{argn}}を{arg1}...{argk}{}...{}にする
+\def\jlreq@cleararguments#1#2{\jlreq@cleararguments@{#1}#2\jlreq@endmark}
+\def\jlreq@cleararguments@#1#2{\jlreq@ifendmark{#2}{}{%
+ \ifnum#1<1 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
+ {{}}{{#2}}%
+ \expandafter\jlreq@cleararguments@\expandafter{\the\numexpr #1 - 1\relax}%
+ }%
+}
+% ...\jlreq@extramark{...}を\jlreq@extramark{...}のみにする.
+\def\jlreq@getextramarkpart#1{\jlreq@getextramarkpart@#1\jlreq@extramark\jlreq@endmark}
+\def\jlreq@getextramarkpart@#1\jlreq@extramark#2\jlreq@endmark{\jlreq@ifempty{#2}{}{\jlreq@getextramarkpart@@#2}}
+\def\jlreq@getextramarkpart@@#1\jlreq@extramark{\jlreq@extramark{#1}}
+
+% #1番目以降を空にする
+\def\jlreq@clearleftextramarks#1{%
+ \let\jlreq@extramark@=\jlreq@extramark
+ \begingroup
+ \def\jlreq@extramark##1{\noexpand\jlreq@extramark{\jlreq@cleararguments{#1}{##1}}}%
+ \protected@edef\jlreq@tempa{\expandafter\@firstoftwo\@themark}%
+ \edef\jlreq@tempb{\expandafter\expandafter\expandafter\expandonce\expandafter\expandafter\expandafter{\expandafter\@secondoftwo\@themark}}%
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@extramark{\noexpand\jlreq@extramark}}%
+ \noexpand\markboth{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \let\jlreq@extramark=\jlreq@extramark@
+}
+\def\jlreq@clearrightextramarks#1{%
+ \let\jlreq@extramark@=\jlreq@extramark
+ \begingroup
+ \edef\jlreq@tempa{\expandafter\expandafter\expandafter\expandonce\expandafter\expandafter\expandafter{\expandafter\@firstoftwo\@themark}}%
+ \def\jlreq@extramark##1{\noexpand\jlreq@extramark{\jlreq@cleararguments{#1}{##1}}}%
+ \protected@edef\jlreq@tempb{\expandafter\@secondoftwo\@themark}%
+ \edef\jlreq@do{%
+ \unexpanded{\def\jlreq@extramark{\noexpand\jlreq@extramark}}%
+ \noexpand\markboth{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \let\jlreq@extramark=\jlreq@extramark@
+}
+
+\def\jlreq@markboth#1#2{%
+ \let\jlreq@extramark@=\jlreq@extramark
+ \def\jlreq@extramark{\noexpand\jlreq@extramark}%
+ \begingroup
+ \protected@edef\jlreq@tempa{\expandafter\@firstoftwo\@themark}%
+ \protected@edef\jlreq@tempa{\unexpanded{#1}\expandafter\jlreq@getextramarkpart\expandafter{\jlreq@tempa}}%
+ \protected@edef\jlreq@tempb{\expandafter\@secondoftwo\@themark}%
+ \protected@edef\jlreq@tempb{\unexpanded{#2}\expandafter\jlreq@getextramarkpart\expandafter{\jlreq@tempb}}%
+ \edef\jlreq@do{%
+ \noexpand\markboth{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@tempb}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \let\jlreq@extramark=\jlreq@extramark@
+}
+\def\jlreq@markright#1{%
+ \let\jlreq@extramark@=\jlreq@extramark
+ \def\jlreq@extramark{\noexpand\jlreq@extramark}%
+ \begingroup
+ \protected@edef\jlreq@tempb{\expandafter\@secondoftwo\@themark}%
+ \protected@edef\jlreq@tempb{\unexpanded{#1}\expandafter\jlreq@getextramarkpart\expandafter{\jlreq@tempb}}%
+ \edef\jlreq@do{%
+ \noexpand\markright{\expandonce{\jlreq@tempb}}%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+ \let\jlreq@extramark=\jlreq@extramark@
+}
+
+%.. \DeclarePageStyle内で使うもの
+% mark情報の取得を行う.
+% #1の中身をみて,#2 = 何段目見出しか,#3 = odd/even,\csname #4@<見出し命令名>\endcsnameに必要情報を追加し,#5の見出し命令名リストに追加
+% #1@heading@levelにレベルを入れる
+\def\jlreq@pagestyle@setmark#1#2#3#4#5{%
+ \begingroup
+ \expandafter\jlreq@iffirsttoken\expandafter{#1}{_}{%
+ \ifthenelse{\equal{#3}{odd}}{\let\jlreq@leftright=r}{\let\jlreq@leftright=l}%
+ \edef\jlreq@do{%
+ \unexpanded{\def#1}{%
+ \ifx l\jlreq@leftright
+ \ifnum#2=0 \noexpand\leftmark\else\unexpanded{\jlreq@extraleftmark{#2}}\fi
+ \else
+ \ifnum#2=0 \noexpand\rightmark\else\unexpanded{\jlreq@extrarightmark{#2}}\fi
+ \fi
+ }%
+ }%
+ \edef\jlreq@headingname{\expandafter\@gobble#1}% 見出し命令名
+ \edef\jlreq@tempa{\noexpand\@removeelement{\expandonce{\jlreq@headingname}}}%
+ \expandafter\jlreq@tempa\expandafter{#5}{#5}%
+ \@ifundefined{#4@\jlreq@headingname}{\expandafter\def\csname #4@\jlreq@headingname\endcsname{}}{}%
+ \eappto\jlreq@do{%
+ \noexpand\let\expandonce{\csname\expandafter\@gobble\string #1@heading@level\endcsname}=\expandonce{\csname jlreq@heading@level@\jlreq@headingname\endcsname}%
+ \unexpanded{\def#5}{\expandonce{#5},\expandonce{\jlreq@headingname}}%
+ \noexpand\appto\expandonce{\csname #4@\jlreq@headingname\endcsname}{{{\ifnum#2=0 #3\fi}{#2}{\ifx r\jlreq@leftright r\else l\fi}}}%
+ }%
+ }{\def\jlreq@do{}}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% \def\<見出し>mark#1{...}というのを\jlreq@resultに入れる,
+% #1:*ならばextramarkを使う
+% #2: 見出し命令名,#3: mark_format
+% #4: {{mark_formatからさらに調べるやつ (odd|even)}{マークの何番目か.extraでない場合は0}{l or r(leftかrightか)}}の並び
+\def\jlreq@pagestyle@make@headingmark#1#2#3#4{%
+ \begingroup
+ \@for\jlreq@i:=0,1,2\do{%
+ \expandafter\def\csname jlreq@leftmark@\jlreq@i\endcsname{}%
+ \expandafter\def\csname jlreq@rightmark@\jlreq@i\endcsname{}%
+ }%
+ \jlreq@pagestyle@make@headingmark@{#2}{#3}#4\jlreq@endmark
+ \def\jlreq@do{}% とりあえず#1markの中身を入れていく
+ % leftを設定する時は対応するrightを空にする.
+ \expandafter\ifx\csname jlreq@leftmark@0\endcsname\@empty
+ \expandafter\ifx\csname jlreq@rightmark@0\endcsname\@empty\else
+ \eappto\jlreq@do{\jlreq@ifempty{#1}{\noexpand\markright}{\noexpand\jlreq@markright}{\csexpandonce{jlreq@rightmark@0}}}%
+ \fi
+ \else
+ \eappto\jlreq@do{\jlreq@ifempty{#1}{\noexpand\markboth}{\noexpand\jlreq@markboth}{\csexpandonce{jlreq@leftmark@0}}{\csexpandonce{jlreq@rightmark@0}}}%
+ \fi
+ \@for\jlreq@i:=1,2\do{%
+ \expandafter\ifx\csname jlreq@leftmark@\jlreq@i\endcsname\@empty
+ \expandafter\ifx\csname jlreq@rightmark@\jlreq@i\endcsname\@empty\else
+ \eappto\jlreq@do{\noexpand\jlreq@setextrarightmark{\jlreq@i}{\csexpandonce{jlreq@rightmark@\jlreq@i}}}%
+ \fi
+ \else
+ \eappto\jlreq@do{%
+ \noexpand\jlreq@setextraleftmark{\jlreq@i}{\csexpandonce{jlreq@leftmark@\jlreq@i}}%
+ \noexpand\jlreq@setextrarightmark{\jlreq@i}{\csexpandonce{jlreq@rightmark@\jlreq@i}}%
+ }%
+ \fi
+ }%
+ \ifx\jlreq@do\@empty\else
+ \edef\jlreq@do{%
+ \unexpanded{\edef\jlreq@result}{\noexpand\unexpanded{%
+ \noexpand\def\expandonce{\csname #2mark\endcsname}\unexpanded{##1}{%
+ \expandonce{\jlreq@do}%
+ }}%
+ }%
+ }%
+ \fi
+ \expandafter\endgroup
+ \jlreq@do
+}%
+\def\jlreq@pagestyle@make@headingmark@#1#2#3{%
+ \jlreq@ifendmark{#3}{}{\jlreq@pagestyle@make@headingmark@@{#1}{#2}#3}%
+}
+
+\def\jlreq@pagestyle@make@headingmark@@#1#2#3#4#5{%
+ % \jlreq@tempbに\***markの定義を入れる
+ \edef\jlreq@tempb{\expandonce{\csname the#1\endcsname}\noexpand\quad\unexpanded{##1}}%
+ \jlreq@parsekeyval@nokey{%
+ \jlreq@ifempty{##1}{}{\ifthenelse{\equal{##1}{#3}}{\edef\jlreq@tempb{\unexpanded{##2}}}{}}%
+ \ifthenelse{\equal{##1}{_#1}}{\edef\jlreq@tempb{\unexpanded{##2}}}{}%
+ }{#2}%
+ \ifx l#5%
+ \expandafter\edef\csname jlreq@leftmark@#4\endcsname{\expandonce{\jlreq@tempb}}%
+ \else
+ \expandafter\edef\csname jlreq@rightmark@#4\endcsname{\expandonce{\jlreq@tempb}}%
+ \fi
+ \jlreq@pagestyle@make@headingmark@{#1}{#2}%
+}
+
+% #2 #3 #4と並んだヘッダを作り#1に入れる.#1,#2,#3はコンロトールシークエンスの名前とする.
+\def\jlreq@pagestyle@setheadfoot#1#2#3#4{%
+ \begingroup
+ \edef\jlreq@do{\noexpand\jlreq@pagestyle@setheadfoot@{\unexpanded{#1}}{\csexpandonce{#2}}{\csexpandonce{#3}}{\csexpandonce{#4}}}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% \edef内だと,#1 != 0ptならば\hskip \dimexpr#1\relaxになる
+\def\jlreq@pagestyle@hskip#1{%
+ \ifdim\dimexpr#1\relax=0pt \expandafter\@gobble\else\expandafter\@firstofone\fi
+ {\noexpand\hskip\noexpand\dimexpr#1\noexpand\relax}%
+}
+\def\jlreq@pagestyle@setheadfoot@#1#2#3#4{%
+ \begingroup
+ % - \Cdpは端にそろえるための補正
+ \jlreq@ifempty{#2}{\def\jlreq@left{}}{\edef\jlreq@left{\jlreq@pagestyle@hskip{\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate - \Cdp\fi}\unexpanded{#2}}}%
+ % +\topskip - \Chtは\jlreq@headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正.
+ \jlreq@ifempty{#4}{\def\jlreq@right{}}{\edef\jlreq@right{\unexpanded{#4}\jlreq@pagestyle@hskip{\jlreq@expand@speciallength{\jlreq@headfoot@sidemargin}\if@tate + \topskip - \Cht\fi}}}%
+ \jlreq@ifempty{#3}{%
+ \edef\jlreq@do{\unexpanded{\def#1}{\expandonce{\jlreq@left}\hfil\expandonce{\jlreq@right}}}%
+ \jlreq@ifempty{#2}{\jlreq@ifempty{#4}{\def\jlreq@do{\def#1{}}}{}}{}%
+ }{% #3を完全に真ん中に配置するために左右の幅を0にしておく
+ \ifx\jlreq@left\@empty\else\edef\jlreq@left{\noexpand\hbox to 0pt{\expandonce{\jlreq@left}\noexpand\hss}}\fi
+ \ifx\jlreq@right\@empty\else\edef\jlreq@right{\noexpand\hbox to 0pt{\noexpand\hss\expandonce{\jlreq@right}}}\fi
+ \edef\jlreq@do{%
+ \unexpanded{\def#1}{\expandonce{\jlreq@left}\hfil\unexpanded{#3}\hfil\expandonce{\jlreq@right}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}%
+
+% #1の左右に傍注調整用の空白を入れて#1に代入する
+\def\jlreq@pagestyle@addsidenotemargin@left#1{%
+ \jlreq@pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{}{\marginparwidth+\marginparsep}%
+}
+\def\jlreq@pagestyle@addsidenotemargin@right#1{
+ \jlreq@pagestyle@addsidenotemargin@{#1}{}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}%
+}
+\def\jlreq@pagestyle@addsidenotemargin@bothside#1{
+ \jlreq@pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}{2\marginparwidth+2\marginparsep}%
+}
+% #2: 左,#3:右,#4:#2 + #3
+\def\jlreq@pagestyle@addsidenotemargin@#1#2#3#4{%
+ \ifx#1\@empty\else
+ \edef#1{%
+ \jlreq@ifempty{#2}{}{\unexpanded{\hskip-\dimexpr #2\relax}}%
+ \unexpanded{\hbox to \dimexpr\textwidth + #4\relax}{\expandonce{#1}}%
+ \jlreq@ifempty{#3}{}{\unexpanded{\hskip-\dimexpr #3\relax}}%
+ }%
+ \fi
+}
+
+% #1から空かつ#4が空でないならば#2に#3と#4の中身を追加し,#4を空にする.引数は全てコントロールシークエンス
+\def\jlreq@pagestyle@addifempty#1#2#3#4{%
+ \ifx#1\@empty\ifx#4\@empty\else\eappto#2{\expandonce{#3}\expandonce{#4}}\def#4{}\fi\fi
+}
+
+% #1: ターゲットなコントロールシークエンスの名前,#2:*ならばreverseする,#3:空き
+% #1に入っている{柱1}{柱2}... という並びから,実際に出力する柱を構築する.
+% 間に空白を入れる.
+\def\jlreq@pagestyle@make@runninghead#1#2#3{%
+ \expandafter\ifx\csname #1\endcsname\@empty\expandafter\@gobble\else\expandafter\@firstofone\fi{%
+ \edef\jlreq@do{%
+ \noexpand\jlreq@tempbtrue % 最初の処理かフラグ
+ \unexpanded{\jlreq@pagestyle@make@runninghead@{#1}{#2}{#3}}\csexpandonce{#1}\noexpand\jlreq@endmark
+ }%
+ \expandafter\def\csname #1\endcsname{}%
+ \jlreq@do
+ }%
+}
+\def\jlreq@pagestyle@make@runninghead@#1#2#3#4#5{%
+ \ifnum\numexpr\jlreq@ifendmark{#5}{1}{0}*\ifjlreq@tempb 1\else 0\fi\relax=1 \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{%
+ \jlreq@ifempty{#2}{\csappto}{\cspreto}{#1}{#4}%
+ }{%
+ \jlreq@ifempty{#2}{\cseappto}{\csepreto}{#1}{%
+ % 空でない柱が既に出力されたかフラグをたてる
+ \ifjlreq@tempb\noexpand\jlreq@tempafalse\fi
+ \unexpanded{\protected@edef\jlreq@tempa{#4}}%
+ \unexpanded{\ifx\jlreq@tempa\@empty\else}%
+ \noexpand\ifjlreq@tempa
+ \jlreq@ifempty{#2}%
+ {\unexpanded{\hskip\glueexpr #3\relax\jlreq@tempa}}%
+ {\unexpanded{\jlreq@tempa\hskip\glueexpr #3\relax}}%
+ \unexpanded{\else
+ \jlreq@tempa\jlreq@tempatrue
+ \fi}%
+ \noexpand\fi
+ }%
+ \jlreq@tempbfalse
+ \jlreq@ifendmark{#5}{}{\jlreq@pagestyle@make@runninghead@{#1}{#2}{#3}{#5}}%
+ }%
+}
+
+%.. \DeclarePageStyle
+\newcommand{\DeclarePageStyle}[2]{%
+ \expandafter\edef\csname jlreq@pagestyle@setting@#1\endcsname{\unexpanded{#2}}%
+ \begingroup
+ \def\jlreq@nombre@i@position{}%
+ \def\jlreq@nombre@i{\thepage}%
+ \def\jlreq@running@head@i@position{}%
+ \def\jlreq@odd@running@head@i{}%
+ \def\jlreq@even@running@head@i{}%
+ \def\jlreq@command{}%
+ \def\jlreq@mark@format{}%
+ \def\jlreq@font{}%
+ % 柱とノンブルの間
+ \def\jlreq@gap{1.5\zw}%
+ \def\jlreq@nombre@gap{}%
+ \def\jlreq@running@head@gap{}%
+ \newif\ifjlreq@clearmarkcommand\jlreq@clearmarkcommandtrue
+ \newif\ifjlreq@pstate\jlreq@pstatefalse % PageStyleTATE
+ \@for\jlreq@i:=ii,iii\do{%
+ \expandafter\def\csname jlreq@nombre@\jlreq@i @position\endcsname{}%
+ \expandafter\def\csname jlreq@running@head@\jlreq@i @position\endcsname{}%
+ \expandafter\def\csname jlreq@nombre@\jlreq@i\endcsname{}%
+ \expandafter\def\csname jlreq@odd@running@head@\jlreq@i\endcsname{}%
+ \expandafter\def\csname jlreq@even@running@head@\jlreq@i\endcsname{}%
+ }%
+ \jlreq@parsekeyval[PageStyle:#1]{
+ *{tate}{\jlreq@pstatetrue}
+ *{yoko}{\jlreq@pstatefalse}
+ {nombre}{\def\jlreq@nombre@i{##1}}
+ {nombre_position}{\def\jlreq@nombre@i@position{##1}}
+ {running_head_position}{\def\jlreq@running@head@i@position{##1}}
+ {odd_running_head}{\def\jlreq@odd@running@head@i{##1}}
+ {even_running_head}{\def\jlreq@even@running@head@i{##1}}
+ {font}{\def\jlreq@font{##1}}
+ {mark_format}{\edef\jlreq@mark@format{\unexpanded{##1}}}
+ {command}{\edef\jlreq@command{\unexpanded{##1}}}
+ {gap}{\def\jlreq@gap{##1}}
+ {nombre_gap}{\def\jlreq@nombre@gap{##1}}
+ {running_head_gap}{\def\jlreq@running@head@gap{##1}}
+ % trueにすると,\ps@***実行時にまず\***markを全て\@gobbleにする.
+ {clear_markcommand}[true,false]{\csname jlreq@clearmarkcommand##1\endcsname}
+ % 二つ目
+ {nombre_ii}{\def\jlreq@nombre@ii{##1}}
+ {nombre_ii_position}{\def\jlreq@nombre@ii@position{##1}}
+ {running_head_ii_position}{\def\jlreq@running@head@ii@position{##1}}
+ {odd_running_head_ii}{\def\jlreq@odd@running@head@ii{##1}}
+ {even_running_head_ii}{\def\jlreq@even@running@head@ii{##1}}
+ % 三つ目
+ {nombre_iii}{\def\jlreq@nombre@iii{##1}}
+ {nombre_iii_position}{\def\jlreq@nombre@iii@position{##1}}
+ {running_head_iii_position}{\def\jlreq@running@head@iii@position{##1}}
+ {odd_running_head_iii}{\def\jlreq@odd@running@head@iii{##1}}
+ {even_running_head_iii}{\def\jlreq@even@running@head@iii{##1}}
+ }{#2}%
+ % ノンブル同士の間や柱同士の間のデフォルトはノンブルと柱の間の空き量
+ \ifx\jlreq@nombre@gap\@empty\let\jlreq@nombre@gap=\jlreq@gap\fi
+ \ifx\jlreq@running@head@gap\@empty\let\jlreq@running@head@gap=\jlreq@gap\fi
+ % _iiが存在するか調べて\ifjlreq@headii@existに入れる
+ \newif\ifjlreq@headii@exist
+ \jlreq@headii@existfalse
+ \@for\jlreq@tempa:=\jlreq@odd@running@head@ii,\jlreq@odd@running@head@ii\do{%
+ \expandafter\ifx\jlreq@tempa\@empty\else\jlreq@headii@existtrue\fi
+ }%
+ % markの処理
+ % (odd|even)_running_head(_ii)が_<見出し命令>で与えられている場合,次のようにする.
+ % * \jlreq@(odd|even)@running@head(@ii)をマーク出力命令(\(left|right)mark or \jlreq@extra(left|right)mark{<num>})に書き換える
+ % - evenの場合はleft,oddの場合はright.
+ % - @iiがなければ\(left|right)mark,@iiがあれば\jlreq@extra(left|right)mark{1}
+ % * 例えば_<見出し命令>が_sectionならば,\jlreq@markdata@sectionに{{<I1>}{<I2>}{<I3>}}を追加する.ここで<I1>,<I2>,<I3>は
+ % - I1: @iiが無いときにodd or even
+ % - I2: @iiが無ければ0,あれば1.
+ % - I3: マーク出力命令がleftかrightか.(上述のようにoddかevenかで判定される.)
+ % * 他にも_sectionが指定されている柱があれば,\jlreq@markdata@sectionにさらに追加で加えていく.
+ % * \jlreq@(odd|even)@running@head(@ii)@heading@levelに<見出し命令>のレベルを入れる.レベルが不明な時は\relaxになる.
+ % また,\jlreq@headingmarklistに<見出し命令>の一覧を入れる.
+ \def\jlreq@headingmarklist{}%
+ \@for\jlreq@parity:=odd,even\do{%
+ \@for\jlreq@i:=0,1,2\do{%
+ % \jlreq@pagestyle@setmarkが上の処理を行う.
+ \edef\jlreq@next{\noexpand\jlreq@pagestyle@setmark{\expandonce{\csname jlreq@\jlreq@parity @running@head@\@roman\numexpr\jlreq@i + 1\relax\endcsname}}{\expandonce{\jlreq@i}}{\expandonce{\jlreq@parity}}{jlreq@markdata}{\noexpand\jlreq@headingmarklist}}%
+ \jlreq@next
+ }%
+ }%
+ % \jlreq@minimumlevelに見出しの最低レベルを入れる.
+ \let\jlreq@minimumlevel=\@undefined
+ \def\jlreq@markdefinecommand{}%
+ \@for\jlreq@heading:=\jlreq@headingmarklist\do{%
+ \ifx\jlreq@heading\@empty\else
+ \expandafter\let\expandafter\jlreq@level\csname jlreq@heading@level@\jlreq@heading\endcsname
+ \ifx\jlreq@level\relax\else
+ \ifx\jlreq@minimumlevel\@undefined\let\jlreq@minimumlevel=\jlreq@level
+ \else\ifnum\jlreq@minimumlevel>\jlreq@level\space\let\jlreq@minimumlevel=\jlreq@level\fi\fi
+ \fi
+ % \jlreq@markdata@<見出し命令>にある情報とmark_formatをもとに,\<見出し命令>markを定義するマクロを作成,\jlreq@markdefinecommandに入れる.
+ \edef\jlreq@next{\noexpand\jlreq@pagestyle@make@headingmark{\ifjlreq@headii@exist *\fi}{\expandonce{\jlreq@heading}}{\expandonce{\jlreq@mark@format}}{\csexpandonce{jlreq@markdata@\jlreq@heading}}}%
+ \jlreq@next
+ \eappto\jlreq@markdefinecommand{\expandonce{\jlreq@result}}%
+ \fi
+ }%
+ \ifx\jlreq@minimumlevel\@undefined\else
+ \eappto\jlreq@markdefinecommand{\noexpand\jlreq@pagestyle@setclearmark{\expandonce{\jlreq@minimumlevel}}}%
+ \fi
+ % 見出しを出す場合:evenに章などの高いレベルの見出しを出す(2.6.3.a)
+ \@ifundefined{jlreq@odd@running@head@i@heading@level}{}{\@ifundefined{jlreq@even@running@head@i@heading@level}{}{%
+ \ifnum\jlreq@odd@running@head@i@heading@level<\jlreq@even@running@head@i@heading@level
+ \jlreq@note{偶数ページには奇数ページよりアウトラインレベルの高い見出しを入れる (ページスタイル #1内,2.6.3.a).}%
+ \fi
+ }}%
+ % \jlreq@oddhead,\jlreq@oddfoot,\jlreq@evenhead,\jlreq@evenfootに必要なものを入れる.
+ \ifjlreq@pstate\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{% tate
+ % headの方に処理を入れる.footは空.
+ \def\jlreq@oddfoot{}\def\jlreq@evenfoot{}%
+ \jlreq@for@noexpand\jlreq@position:=\jlreq@nombre@i@position,\jlreq@running@head@i@position\do{%
+ \expandafter\ifx\jlreq@position\@empty\expandafter\def\jlreq@position{0pt}\fi
+ }%
+ \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq@nombre@gap}\noexpand\relax}%
+ \jlreq@pagestyle@addifempty{\jlreq@nombre@iii@position}{\jlreq@nombre@ii}{\jlreq@gapcs}{\jlreq@nombre@iii}%
+ \jlreq@pagestyle@addifempty{\jlreq@nombre@ii@position}{\jlreq@nombre@i}{\jlreq@gapcs}{\jlreq@nombre@ii}%
+ \edef\jlreq@gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq@running@head@gap}\noexpand\relax}%
+ \jlreq@pagestyle@addifempty{\jlreq@running@head@iii@position}{\jlreq@odd@running@head@ii}{\jlreq@gapcs}{\jlreq@odd@running@head@iii}%
+ \jlreq@pagestyle@addifempty{\jlreq@running@head@ii@position}{\jlreq@odd@running@head@i}{\jlreq@gapcs}{\jlreq@odd@running@head@ii}%
+ \jlreq@pagestyle@addifempty{\jlreq@running@head@iii@position}{\jlreq@even@running@head@ii}{\jlreq@gapcs}{\jlreq@even@running@head@iii}%
+ \jlreq@pagestyle@addifempty{\jlreq@running@head@ii@position}{\jlreq@even@running@head@i}{\jlreq@gapcs}{\jlreq@even@running@head@ii}%
+ \def\jlreq@nombre@contents{}% ノンブルを入れる(下の方に出力)
+ \@for\jlreq@i:=i,ii,iii\do{%
+ \expandafter\let\expandafter\jlreq@position\csname jlreq@nombre@\jlreq@i @position\endcsname
+ \expandafter\ifx\csname jlreq@nombre@\jlreq@i\endcsname\@empty\else
+ \jlreq@ifgluezero{\glueexpr\jlreq@position\relax}{\def\jlreq@position{}}{}%
+ \eappto\jlreq@nombre@contents{%
+ \noexpand\hbox to 0pt{\hss
+ \ifx\jlreq@position\@empty\else\unexpanded{\hskip \glueexpr}\expandonce{\jlreq@position}\noexpand\relax\fi
+ \csexpandonce{jlreq@nombre@\jlreq@i}%
+ }%
+ }%
+ \fi
+ }%
+ % \jlreq@(odd|even)@contentsに柱を入れる(上の方に出力)
+ \@for\jlreq@parity:=odd,even\do{%
+ \expandafter\def\csname jlreq@\jlreq@parity @contents\endcsname{}%
+ \@for\jlreq@i:=i,ii,iii\do{%
+ \expandafter\let\expandafter\jlreq@position\csname jlreq@running@head@\jlreq@i @position\endcsname
+ \expandafter\ifx\csname jlreq@\jlreq@parity @running@head@\jlreq@i\endcsname\@empty\else
+ \jlreq@ifgluezero{\glueexpr\jlreq@position\relax}{\def\jlreq@position{}}{}%
+ \expandafter\eappto\csname jlreq@\jlreq@parity @contents\endcsname{%
+ \noexpand\hbox to 0pt{\unexpanded{\hskip\glueexpr\headsep + \headheight}%
+ \if@tate\else\unexpanded{+ \topskip - \Cht}\fi
+ \ifx\jlreq@position\@empty\else + \expandonce{\jlreq@position}\fi\noexpand\relax
+ \csexpandonce{jlreq@\jlreq@parity @running@head@\jlreq@i}\hss
+ }%
+ }%
+ \fi
+ }%
+ % \jlreq@(odd|even)headの構築
+ \expandafter\edef\csname jlreq@\jlreq@parity head\endcsname{%
+ \unexpanded{\setbox\jlreq@tempboxa=\hbox to \dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax
+ {%
+ \unexpanded{\tate\adjustbaseline}%
+ \csexpandonce{jlreq@\jlreq@parity @contents}%
+ \noexpand\hfil
+ \expandonce{\jlreq@nombre@contents}%
+ }%
+ % Underful対策
+ \ifx l\jlreq@engine
+ \unexpanded{\wd\jlreq@tempboxa=\headheight}%
+ \else
+ \unexpanded{\ht\jlreq@tempboxa=\headheight\dp\jlreq@tempboxa=0pt}%
+ \fi
+ }%
+ }%
+ % \jlreq@tempboxaに入っているボックスを正しく配置する
+ \edef\jlreq@lefthead@adjustbox{%
+ \noexpand\hskip\noexpand\dimexpr\if@tate\unexpanded{- \Cdp}\fi - \unexpanded{\headsep - 1\zw\relax}%
+ \unexpanded{\box\jlreq@tempboxa\hfil}%
+ }%
+ \edef\jlreq@righthead@adjustbox{%
+ \noexpand\hskip\unexpanded{\dimexpr\textwidth}\if@tate\unexpanded{- \topskip + \Cht}\fi\unexpanded{ + \headsep\relax}%
+ \unexpanded{\box\jlreq@tempboxa\hss}%
+ }%
+ \if@tate
+ \eappto\jlreq@oddhead{\expandonce{\jlreq@lefthead@adjustbox}}%
+ \eappto\jlreq@evenhead{\expandonce{\jlreq@righthead@adjustbox}}%
+ \else
+ \eappto\jlreq@oddhead{\expandonce{\jlreq@righthead@adjustbox}}%
+ \eappto\jlreq@evenhead{\expandonce{\jlreq@lefthead@adjustbox}}%
+ \fi
+ }{% yoko
+ % 場所を正規化する.
+ \def\jlreq@nombre@i@position@default{{bottom}{center}}%
+ \def\jlreq@running@head@i@position@default{{top}{center}}%
+ % iiの位置は指定されていない場合はiのそれに合わせる
+ \@for\jlreq@tempa:=jlreq@nombre,jlreq@running@head\do{%
+ \@for\jlreq@i:=ii,iii\do{%
+ \expandafter\ifx\csname\jlreq@tempa @\jlreq@i @position\endcsname\@empty
+ \expandafter\let\csname\jlreq@tempa @\jlreq@i @position\expandafter\endcsname\csname\jlreq@tempa @i@position\endcsname
+ \fi
+ \expandafter\edef\csname\jlreq@tempa @\jlreq@i @position@default\endcsname{\csname\jlreq@tempa @i@position@default\endcsname}%
+ }%
+ }%
+ \@for\jlreq@tempa:=jlreq@nombre@i@position,jlreq@nombre@ii@position,jlreq@nombre@iii@position,jlreq@running@head@i@position,jlreq@running@head@ii@position,jlreq@running@head@iii@position\do{%
+ \edef\jlreq@next{\noexpand\jlreq@pagestyle@parse@position{\csexpandonce{\jlreq@tempa}}{\expandonce{\csname\jlreq@tempa\endcsname}}{\csexpandonce{\jlreq@tempa @default}}}%
+ \jlreq@next
+ }%
+ \ifthenelse{\(
+ \boolean{@tate} \AND \(
+ \equal{\expandafter\@secondoftwo\jlreq@nombre@i@position}{right} \OR
+ \equal{\expandafter\@secondoftwo\jlreq@running@head@i@position}{right}
+ \)\) \OR \(
+ \(\NOT \boolean{@tate}\) \AND \(
+ \equal{\expandafter\@secondoftwo\jlreq@nombre@i@position}{left} \OR
+ \equal{\expandafter\@secondoftwo\jlreq@running@head@i@position}{left}
+ \)
+ \)}{%
+ \if@twoside
+ \jlreq@note{柱やノンブルは,左ページでは,基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか,基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内,2.6.1.b).}%
+ \fi
+ }{}%
+ {\jlreq@font
+ \ifthenelse{\lengthtest{\jlreq@gap < 1.49\zw} \OR \( \lengthtest{\jlreq@gap > 1.51\zw} \AND \lengthtest{\jlreq@gap < 1.99\zw} \) \OR \lengthtest{\jlreq@gap > 2.01\zw}}{\jlreq@note{ノンブルと柱との空き量は文字サイズの2倍又は1.5倍とする (ページスタイル #1 内,2.6.1.c).}}{}%
+ }%
+ % 初期化
+ \@for\jlreq@parity:=odd,even\do{%
+ \@for\jlreq@vert:=top,bottom\do{%
+ \@for\jlreq@hor:=left,center,right\do{%
+ \@for\jlreq@type:=nombre,running@head\do{%
+ \expandafter\def\csname jlreq@\jlreq@type @\jlreq@parity @\jlreq@vert @\jlreq@hor\endcsname{}%
+ }%
+ }%
+ }%
+ % ページが左か右か
+ \jlreq@ifleftpage{\jlreq@parity}{\def\jlreq@pagehor{left}}{\def\jlreq@pagehor{right}}%
+ % \jlreq@(running@head|nombre)@(odd|even)@(top|bottom)@(left|center|right)に入れていく
+ % 左ページではノンブルが左(2.6.1.c),i,ii,...はiが左になるようにする.
+ \@for\jlreq@i:=i,ii,iii\do{%
+ % nombre
+ \expandafter\ifx\csname jlreq@nombre@\jlreq@i\endcsname\@empty\else
+ \edef\jlreq@position{\csname jlreq@nombre@\jlreq@i @position\endcsname}%
+ \edef\jlreq@vert{\expandafter\@firstoftwo\jlreq@position}%
+ \edef\jlreq@hor{\expandafter\@secondoftwo\jlreq@position}%
+ \ifthenelse{\equal{\jlreq@parity}{even}}{\jlreq@reverse@leftright{\jlreq@hor}}{}%
+ \jlreq@ifleftpage{\jlreq@parity}{\let\jlreq@addtocs=\cseappto}{\let\jlreq@addtocs\csepreto}%
+ \edef\jlreq@csname{jlreq@nombre@\jlreq@parity @\jlreq@vert @\jlreq@hor}%
+ \expandafter\ifx\csname\jlreq@csname\endcsname\@empty\else\jlreq@addtocs{\jlreq@csname}{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@nombre@gap}\noexpand\relax}\fi
+ \jlreq@addtocs{\jlreq@csname}{\csexpandonce{jlreq@nombre@\jlreq@i}}%
+ \fi
+ % running@head
+ % 一度「紙面の外から」の順番で{A}{B}{C}と入れる
+ \expandafter\ifx\csname jlreq@\jlreq@parity @running@head@\jlreq@i \endcsname\@empty\else
+ \edef\jlreq@position{\csname jlreq@running@head@\jlreq@i @position\endcsname}%
+ \edef\jlreq@vert{\expandafter\@firstoftwo\jlreq@position}%
+ \edef\jlreq@hor{\expandafter\@secondoftwo\jlreq@position}%
+ \ifthenelse{\equal{\jlreq@parity}{even}}{\jlreq@reverse@leftright{\jlreq@hor}}{}%
+ \ifthenelse{\equal{\jlreq@hor}{\jlreq@pagehor}}{\let\jlreq@addtocs=\eappto}{\let\jlreq@addtocs=\epreto}%
+ \expandafter\jlreq@addtocs\csname jlreq@running@head@\jlreq@parity @\jlreq@vert @\jlreq@hor\endcsname{{\csexpandonce{jlreq@\jlreq@parity @running@head@\jlreq@i}}}%
+ \fi
+ }%
+ \@for\jlreq@vert:=top,bottom\do{%
+ \@for\jlreq@hor:=left,center,right\do{%
+ \ifthenelse{\equal{\jlreq@hor}{right}}{\def\jlreq@tempa{*}}{\def\jlreq@tempa{}}%
+ \edef\jlreq@do{\noexpand\jlreq@pagestyle@make@runninghead{jlreq@running@head@\jlreq@parity @\jlreq@vert @\jlreq@hor}{\expandonce{\jlreq@tempa}}{\expandonce{\jlreq@running@head@gap}}}%
+ \jlreq@do
+ }%
+ }%
+ % ノンブルと柱を結合し,必要ならばフォント設定をする.
+ \@for\jlreq@vert:=top,bottom\do{%
+ \@for\jlreq@hor:=left,center,right\do{%
+ \edef\jlreq@csname{jlreq@\jlreq@parity @\jlreq@vert @\jlreq@hor}%
+ \edef\jlreq@runheadcsname{jlreq@running@head@\jlreq@parity @\jlreq@vert @\jlreq@hor}%
+ \edef\jlreq@nombrecsname{jlreq@nombre@\jlreq@parity @\jlreq@vert @\jlreq@hor}%
+ \ifnum 0\expandafter\ifx\csname\jlreq@runheadcsname\endcsname\@empty 1\fi\expandafter\ifx\csname\jlreq@nombrecsname\endcsname\@empty 1\fi>0
+ \expandafter\edef\csname\jlreq@csname\endcsname{\csexpandonce{\jlreq@runheadcsname}\csexpandonce{\jlreq@nombrecsname}}%
+ \else
+ \jlreq@ifleftpage{\jlreq@parity}{\let\jlreq@addtocs=\cseappto}{\let\jlreq@addtocs=\csepreto}%
+ % 柱+空きを\jlreq@tempaに入れる
+ \def\jlreq@tempa{}%
+ \ifthenelse{\equal{\jlreq@pagehor}{\jlreq@hor}}{%
+ \jlreq@addtocs{jlreq@tempa}{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq@gap}\noexpand\relax}%
+ \jlreq@addtocs{jlreq@tempa}{\csexpandonce{\jlreq@runheadcsname}}%
+ }{%
+ % 柱が空ならば柱とノンブルの空きを入れない.
+ \jlreq@addtocs{jlreq@tempa}{\unexpanded{\ifdim\wd\jlreq@tempboxa=0pt \else\hskip\glueexpr}\expandonce{\jlreq@gap}\unexpanded{\relax\fi}}%
+ \jlreq@addtocs{jlreq@tempa}{\copy\jlreq@tempboxa}%
+ \epreto\jlreq@tempa{\unexpanded{\setbox\jlreq@tempboxa=\hbox}{\csexpandonce{\jlreq@runheadcsname}}}%
+ }%
+ \expandafter\edef\csname\jlreq@csname\endcsname{\csexpandonce{jlreq@nombre@\jlreq@parity @\jlreq@vert @\jlreq@hor}}%
+ \jlreq@addtocs{\jlreq@csname}{\expandonce{\jlreq@tempa}}%
+ \fi
+ \ifx\jlreq@font\@empty\else\expandafter\ifx\csname\jlreq@csname\endcsname\@empty\else
+ \expandafter\edef\csname\jlreq@csname\endcsname{{\expandonce{\jlreq@font}\csexpandonce{\jlreq@csname}}}%
+ \fi\fi
+ }%
+ }%
+ }%
+ % 四カ所構築
+ \jlreq@pagestyle@setheadfoot{\jlreq@oddhead}{jlreq@odd@top@left}{jlreq@odd@top@center}{jlreq@odd@top@right}%
+ \jlreq@pagestyle@setheadfoot{\jlreq@oddfoot}{jlreq@odd@bottom@left}{jlreq@odd@bottom@center}{jlreq@odd@bottom@right}%
+ \jlreq@pagestyle@setheadfoot{\jlreq@evenhead}{jlreq@even@top@left}{jlreq@even@top@center}{jlreq@even@top@right}%
+ \jlreq@pagestyle@setheadfoot{\jlreq@evenfoot}{jlreq@even@bottom@left}{jlreq@even@bottom@center}{jlreq@even@bottom@right}%
+ % 傍注用調整
+ \ifdim\marginparwidth>0pt
+ \if@tate\else
+ \if@twocolumn
+ \jlreq@pagestyle@addsidenotemargin@bothside{\jlreq@oddhead}%
+ \jlreq@pagestyle@addsidenotemargin@bothside{\jlreq@oddfoot}%
+ \jlreq@pagestyle@addsidenotemargin@bothside{\jlreq@evenhead}%
+ \jlreq@pagestyle@addsidenotemargin@bothside{\jlreq@evenfoot}%
+ \else
+ \jlreq@pagestyle@addsidenotemargin@right{\jlreq@oddhead}%
+ \jlreq@pagestyle@addsidenotemargin@right{\jlreq@oddfoot}%
+ \jlreq@pagestyle@addsidenotemargin@left{\jlreq@evenhead}%
+ \jlreq@pagestyle@addsidenotemargin@left{\jlreq@evenfoot}%
+ \fi
+ \fi
+ \fi
+ }%
+ \edef\jlreq@do{%
+ \noexpand\edef\expandonce{\csname ps@#1\endcsname}{%
+ \noexpand\unexpanded{%
+ \unexpanded{\def\jlreq@current@pagestyle{#1}}%
+ \ifjlreq@clearmarkcommand\unexpanded{\jlreq@heading@execmacro@toallheadings\jlreq@clearheadingmarks}\fi
+ \ifjlreq@headii@exist
+ \unexpanded{\let\@mkboth=\jlreq@markboth}%
+ \else
+ \unexpanded{\let\@mkboth=\markboth}%
+ \fi
+ \unexpanded{\def\@oddhead}{\expandonce{\jlreq@oddhead}}%
+ \unexpanded{\def\@oddfoot}{\expandonce{\jlreq@oddfoot}}%
+ \unexpanded{\def\@evenhead}{\expandonce{\jlreq@evenhead}}%
+ \unexpanded{\def\@evenfoot}{\expandonce{\jlreq@evenfoot}}%
+ \expandonce{\jlreq@markdefinecommand}%
+ \expandonce{\jlreq@command}%
+ }%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+\newcommand*{\NewPageStyle}[2]{%
+ \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
+}
+\newcommand*{\RenewPageStyle}[2]{%
+ \@ifundefined{ps@#1}{\@latex@error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclarePageStyle{#1}{#2}}%
+}
+\newcommand*{\ProvidePageStyle}[2]{%
+ \@ifundefined{ps@#1}{\DeclarePageStyle{#1}{#2}}{}%
+}
+\newcommand*{\ModifyPageStyle}[2]{%
+ \begingroup
+ \@ifundefined{jlreq@pagestyle@setting@#1}{\ClassError{jlreq}{Unknown pagestyle: #1}{\@ehc}}{}%
+ \expandafter\let\expandafter\setting\expandafter=\csname jlreq@pagestyle@setting@#1\endcsname
+ \edef\jlreq@do{\noexpand\RenewPageStyle{#1}{\expandonce{\setting},\unexpanded{#2}}}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+%.. 各種定義
+\RenewPageStyle{empty}{nombre={},odd_running_head={},even_running_head={}}
+\ifthenelse{\equal{\jlreq@article@type}{article}}{
+ \if@twoside
+ \NewPageStyle{headings}{odd_running_head={_subsection},even_running_head={_section}}
+ \else
+ \NewPageStyle{headings}{odd_running_head={_section},even_running_head={}}
+ \fi
+}{% book, article
+ \if@twoside
+ \NewPageStyle{headings}{odd_running_head={_section},even_running_head={_chapter}}
+ \else
+ \NewPageStyle{headings}{odd_running_head={_chapter},even_running_head={}}
+ \fi
+ \ModifyPageStyle{headings}{mark_format={_chapter={第\thechapter 章\quad #1}}}
+}
+\if@tate
+ \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},clear_markcommand=false}
+ \NewPageStyle{myheadings}{nombre=\thepage,odd_running_head=\rightmark,even_running_head=\leftmark,clear_markcommand=false}
+ \if@twoside
+ \ModifyPageStyle{plain}{nombre_position={top-left}}
+ \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-left,running_head_position=top-left}
+ \ModifyPageStyle{myheadings}{nombre_position=bottom-left,running_head_position=top-left}
+ \else
+ \ModifyPageStyle{plain}{nombre_position={top-center}}
+ \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center}
+ \ModifyPageStyle{myheadings}{nombre_position=bottom-center,running_head_position=top-center}
+ \fi
+\else% yoko
+ \RenewPageStyle{plain}{nombre=\thepage,odd_running_head={},even_running_head={},nombre_position={bottom-center},clear_markcommand=false}
+ \ModifyPageStyle{headings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center}
+ \NewPageStyle{myheadings}{nombre=\thepage,nombre_position=bottom-center,running_head_position=top-center,odd_running_head=\rightmark,even_running_head=\leftmark,clear_markcommand=false}
+\fi
+\ModifyPageStyle{plain}{font=\small}
+\ModifyPageStyle{headings}{font=\small}
+\ModifyPageStyle{myheadings}{font=\small}
+
+%. フロート関連
+% 4.3.3.dの例,縦組みの時だけど横にも適用……
+\setlength{\floatsep}{1\jlreq@gol plus 1\jlreq@gol}
+\setlength{\textfloatsep}{1\jlreq@gol plus \baselineskip}
+\intextsep=\textfloatsep
+\dblfloatsep=\floatsep
+\dbltextfloatsep=\textfloatsep
+% 残りはデフォルトにしておく.
+
+% 4.3.1 注4
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+\newcommand{\@makecaption}[2]{{%
+ \reset@font\small
+ \vskip\abovecaptionskip
+ \edef\jlreq@do{\unexpanded{\def\jlreq@tempa##1}{\expandonce{\jlreq@makecaption@label@format}}}%
+ \jlreq@do
+ \jlreq@ifempty{#1}{}{%
+ \edef\jlreq@tempa{{\noexpand\jlreq@@makecaption@label@font\expandonce{\jlreq@tempa{#1}}\unexpanded{\hskip \glueexpr\jlreq@makecaption@after@label@space\relax}}}%
+ }%
+ \appto\jlreq@tempa{{\jlreq@@makecaption@font #2}}%
+ \setbox\@tempboxa=\hbox{\jlreq@tempa}%
+ \@ifundefined{@currenvir}{%
+ \@ifundefined{@captype}%
+ {\def\jlreq@tempb{}}%
+ {\let\jlreq@tempb=\@captype}%
+ }{\let\jlreq@tempb=\@currenvir}%
+ \@ifundefined{jlreq@caption@align@\jlreq@tempb}%
+ {\let\jlreq@align=\jlreq@caption@align}%
+ {\expandafter\let\expandafter\jlreq@align\csname jlreq@caption@align@\jlreq@tempb\endcsname}%
+ \ifdim\wd\@tempboxa>\hsize\relax
+ {%
+ \ifx c\jlreq@align\centering\fi
+ \ifx r\jlreq@align\raggedleft\fi
+ \jlreq@tempa\par
+ }%
+ \else
+ \global\@minipagefalse
+ \hbox to\hsize{%
+ \ifnum0\ifx c\jlreq@align 1\fi\ifx r\jlreq@align 1\fi>0 \hfil\fi
+ \unhbox\@tempboxa
+ \ifnum0\ifx c\jlreq@align 1\fi\ifx l\jlreq@align 1\fi>0 \hfil\fi
+ }%
+ \fi
+ \vskip\belowcaptionskip}}
+\jlreq@jlreqsetup@add{caption_font}{\def\jlreq@@makecaption@font{#1}}
+\jlreq@jlreqsetup@add{caption_label_font}{\def\jlreq@@makecaption@label@font{#1}}
+\jlreq@jlreqsetup@add{caption_label_format}{\edef\jlreq@makecaption@label@format{\unexpanded{#1}}}
+\jlreq@jlreqsetup@add{caption_after_label_space}{\def\jlreq@makecaption@after@label@space{#1}}
+\def\jlreq@caption@setalign#1#2{%
+ \jlreq@switch{#2}{
+ {center}{\let#1=c}
+ {left}{\let#1=l}
+ {right}{\let#1=r}
+ {top}{\let#1=l}
+ {bottom}{\let#1=r}
+ }%
+}
+\jlreq@jlreqsetup@add{caption_align}{%
+ \jlreq@parsekeyval@nokey{%
+ \jlreq@ifempty{##1}{}{%
+ \jlreq@switch{##1}{%
+ {center}{\let\jlreq@caption@align=c}
+ {left}{\let\jlreq@caption@align=l}
+ {right}{\let\jlreq@caption@align=r}
+ {top}{\let\jlreq@caption@align=l}
+ {bottom}{\let\jlreq@caption@align=r}
+ {\expandafter\jlreq@caption@setalign\csname jlreq@caption@align@##1\endcsname{##2}}
+ }%
+ }%
+ }{#1}%
+}
+\jlreqsetup{caption_font={\sffamily\bfseries},caption_label_font={\sffamily\bfseries},caption_after_label_space=1\zw,caption_label_format={#1},caption_align=center}
+% 特に根拠のない値
+\setlength\abovecaptionskip{.5\jlreq@gol}
+\setlength\belowcaptionskip{0pt}
+
+%.. figure環境
+\newcounter{figure}
+\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+ \renewcommand{\thefigure}{\@arabic\c@figure}
+}{%
+ \@addtoreset{figure}{chapter}
+ \renewcommand{\thefigure}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@figure}
+}
+\newcommand*{\fps@figure}{h}
+\newcommand*{\ftype@figure}{1}
+\newcommand*{\ext@figure}{lof}
+\newcommand*{\fnum@figure}{\figurename\thefigure}
+\newenvironment{figure}{\@float{figure}}{\end@float}
+\newenvironment{figure*}{\@dblfloat{figure}}{\end@dblfloat}
+\newcommand*{\listfigurename}{図目次}
+\newcommand{\figurename}{図}
+
+%.. table環境
+\newcounter{table}
+\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+ \renewcommand{\thetable}{\@arabic\c@table}
+}{%
+ \@addtoreset{table}{chapter}
+ \renewcommand{\thetable}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@table}
+}
+\newcommand*{\fps@table}{h}
+\newcommand*{\ftype@table}{2}
+\newcommand*{\ext@table}{lot}
+\newcommand*{\fnum@table}{\tablename\thetable}
+\newenvironment{table}{\@float{table}}{\end@float}
+\newenvironment{table*}{\@dblfloat{table}}{\end@dblfloat}
+\newcommand{\listtablename}{表目次}
+\newcommand{\tablename}{表}
+
+%. タイトル周り
+\newenvironment{titlepage}{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse\newpage
+ \fi
+ \thispagestyle{empty}%
+ \setcounter{page}{1}%
+}{%
+ \if@restonecol\twocolumn\else\newpage\fi
+ \if@twoside\else
+ \setcounter{page}{1}%
+ \fi
+}
+
+\if@titlepage
+ \newcommand{\maketitle}{%
+ % jarticleとかからあまり変更していない
+ \begin{titlepage}%
+ \let\footnotesize\small
+ \let\footnoterule\relax
+ \let\footnote\thanks
+ \null\vfil
+ \vskip 4\baselineskip
+ \begin{center}%
+ {\LARGE \@title \par}%
+ \vskip\baselineskip%
+ {\Large
+ \lineskip .75em%
+ % 縦書き時には表組み内でも縦書きにするようにする
+ \if@tate
+ \let\jlreq@temporary@original@ialign=\ialign
+ \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
+ \fi
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}\par}%
+ \vskip\baselineskip
+ {\large\@date\par}%
+ \end{center}\par
+ \vfil{\centering\@thanks}\vfil\null
+ \end{titlepage}%
+ \jlreq@endofmaketitle
+ }
+\else
+ \newcommand{\maketitle}{%
+ \par
+ \begingroup
+ \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
+ \renewcommand{\@makefnmark}{\hbox{%
+ \jlreq@iftdir{\yoko}{}%
+ \rlap{\@textsuperscript{\normalfont\@thefnmark}}%
+ }}%
+ \renewcommand{\jlreq@referencemark@format}[1]{\@makefnmark}% うーん
+ \if@twocolumn
+ \ifnum\col@number=\@ne
+ \@maketitle
+ \else
+ \twocolumn[\@maketitle]%
+ \fi
+ \else
+ \newpage
+ \global\@topnum\z@
+ \@maketitle
+ \fi
+ % \pagestyle{empty}の時はそのまま.
+ \ifnum0\ifx\@oddhead\@empty\else1\fi\ifx\@evenhead\@empty\else1\fi>0
+ \thispagestyle{plain}%
+ \fi
+ \@thanks
+ \endgroup
+ \jlreq@endofmaketitle
+ }
+\fi
+% いろいろクリアする.
+\def\jlreq@endofmaketitle{%
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\p@thanks\relax
+ \global\let\@thanks\@empty
+ \global\let\@author\@empty
+ \global\let\@date\@empty
+ \global\let\@title\@empty
+ \global\let\title\relax
+ \global\let\author\relax
+ \global\let\date\relax
+ \global\let\and\relax
+}%
+% \vskipを\baselineskipにしてみた.
+\def\@maketitle{%
+ \newpage\null
+ \vskip 2\baselineskip%
+ \begin{center}%
+ {\jlreq@keepbaselineskip{\LARGE}\@title\par}%
+ \vskip\baselineskip
+ {\jlreq@keepbaselineskip{\large}%
+ \lineskip .5\zh
+ % 縦書き時には表組み内でも縦書きにするようにする
+ \if@tate
+ \let\jlreq@temporary@original@ialign=\ialign
+ \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq@temporary@original@ialign}}{}{}%
+ \fi
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}%
+ \par
+ }%
+ \ifx\@date\@empty\else
+ \vskip\baselineskip
+ {\jlreq@keepbaselineskip{\large}\@date}%
+ \fi
+ \end{center}%
+ \par
+ \vskip\baselineskip
+ \ifvoid\jlreq@abstractbox\else\unvbox\jlreq@abstractbox\fi
+}
+
+%.. abstract
+\def\jlreq@parhook@abstract{}
+\ifthenelse{\equal{\jlreq@article@type}{book}}{}{% article,report
+ \newbox\jlreq@abstractbox
+ \newcommand*{\abstractname}{概要}
+ \if@titlepage
+ % articleとかjarticleとかと同じ
+ \newenvironment{abstract}{%
+ \titlepage
+ \null\vfil
+ \@beginparpenalty\@lowpenalty
+ \begin{center}%
+ {\sffamily\bfseries\abstractname}%
+ \@endparpenalty\@M
+ \end{center}%
+ \par
+ }{%
+ \par\vfil\null\endtitlepage
+ }
+ \else
+ \newenvironment{abstract}{%
+ \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0
+ \ifjlreq@preamble
+ \ifx l\jlreq@engine\else
+ \def\jlreq@parhook@abstract{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}%
+ \PushPostHook{par}{\jlreq@parhook@abstract}%
+ \fi
+ \fi
+ % とりあえず全部ボックスに入れる.
+ \global\setbox\jlreq@abstractbox=\vtop\bgroup
+ \ifjlreq@preamble
+ % preamble後っぽく振る舞う
+ \@noskipsecfalse
+ % \@nodocumentが入っているので一時的に無効化
+ \everypar{}%
+ \fi
+ \if@twocolumn
+ \parindent=0pt
+ \hsize=\textwidth
+ % 後で\@maketitleとともに呼び出されるときは\twcolumn[***]で呼び出される.
+ \begin{minipage}[b]{\textwidth}%
+ \fi
+ \bgroup
+ \small
+ \parindent=1\zw
+ \begin{center}%
+ {\sffamily\bfseries\abstractname}%
+ \end{center}%
+ \list{}{%
+ \listparindent\parindent
+ \itemindent\listparindent
+ \labelwidth\z@
+ \labelsep\z@
+ \leftmargin=2\zw
+ \rightmargin\leftmargin
+ \@tempdima=1\zw
+ \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
+ \@tempdimc=\@tempdimb
+ \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
+ \ifdim\@tempdimb=\@tempdimc\else\@tempdimb=\dimexpr\@tempdimb - 1\zw\relax\fi
+ \leftmargin=\dimexpr\leftmargin + (\@tempdimc - \@tempdimb)/2\relax
+ \rightmargin=\dimexpr\rightmargin + (\@tempdimc - \@tempdimb)/2\relax
+ \parsep\z@ \@plus.1\zh
+ }%
+ \item\relax
+ \else
+ \section*{\abstractname}%
+ \fi
+ }{%
+ \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0
+ \endlist
+ \egroup
+ \vspace{\baselineskip}%
+ \if@twocolumn
+ \end{minipage}
+ \fi
+ \egroup
+ \fi
+ \ifjlreq@preamble
+ \ifx l\jlreq@engine\else
+ \def\jlreq@parhook@abstract{}%
+ \fi
+ \else
+ \unvbox\jlreq@abstractbox
+ \fi
+ }
+ \fi
+}
+%. 箇条書き.cf. JISX4051 8.4
+% 用語定義型
+\newenvironment{description}{\list{}{%
+ \setlength{\leftmargin}{0\zw}% 下げない
+ \setlength{\labelwidth}{0\zw}%
+ \setlength{\labelsep}{1\zw}
+% \addtolength{\leftmargin}{\leftskip}% たぶんこの二行いらない……
+% \addtolength{\leftmargin}{\labelsep}%
+ \let\makelabel=\descriptionlabel
+% 同行じゃない場合はこんな感じ?
+% \let\jlreq@original@@item=\@item
+% \def\@item[##1]{\jlreq@original@@item[##1]\mbox{}\par
+ }}{\endlist}
+\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\bfseries #1}
+
+% enumerateとitemize
+% 見出しが一つ上のレベルからどのくらいずれているかを入れる.
+% (見出しは2\zwの箱に右/下詰めで入る.)
+\setlength\leftmargini{2\zw}
+\setlength\leftmarginii{1\zw}
+\setlength\leftmarginiii{1\zw}
+\setlength\leftmarginiv{1\zw}
+\setlength\leftmarginv{1\zw}
+\setlength\leftmarginvi{1\zw}
+
+%.. 箇条書き
+\jlreq@jlreqsetup@add{itemization_beforeafter_space}{
+ \begingroup
+ \def\jlreq@do{}%
+ \def\jlreq@keyvallist{}%
+ \@for\@tempa:=#1\do{%
+ \expandafter\jlreq@ifcontains\expandafter{\@tempa}{=}{%
+ \expandafter\appto\expandafter\jlreq@keyvallist\expandafter{\@tempa,}%
+ }{%
+ \@for\@tempb:=i,ii,iii,iv,v,vi\do{%
+ \eappto\jlreq@do{\noexpand\def\expandonce{\csname jlreq@itemization@beforeafter@space@\@tempb\endcsname}{\expandonce{\@tempa}}}%
+ }%
+ }%
+ }%
+ \def\jlreq@tempa{%
+ \jlreq@parsekeyval{%
+ {i}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@i{####1}}}
+ {ii}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@ii{####1}}}
+ {iii}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@iii{####1}}}
+ {iv}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@iv{####1}}}
+ {v}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@v{####1}}}
+ {vi}{\appto\jlreq@do{\def\jlreq@itemization@beforeafter@space@vi{####1}}}
+ }%
+ }%
+ \expandafter\jlreq@tempa\expandafter{\jlreq@keyvallist}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+\jlreq@jlreqsetup@add{itemization_itemsep}{\def\jlreq@itemization@itemsep{#1}}
+\jlreqsetup{itemization_beforeafter_space={0pt,i=.5\baselineskip},itemization_itemsep=0pt}
+% enumerate, itemize用初期化
+\def\jlreq@init@list{%
+ \setlength{\labelwidth}{2\zw}%
+ \setlength{\partopsep}{0pt}%
+ \setlength{\itemsep}{\dimexpr\jlreq@itemization@itemsep\relax}%
+ \setlength{\parsep}{0pt}%
+ \setlength{\listparindent}{\parindent}%
+% itemizeは直後ベタ,enumerateは直後全角空き.
+ \ifthenelse{\equal{\@currenvir}{itemize}}{%
+ \setlength{\labelsep}{0\zw}%
+ }{%
+ \setlength{\labelsep}{1\zw}%
+ }%
+ % \labelsepだけあけるのは一つ目(ラベルの直後)のみ
+ \setlength{\itemindent}{\labelsep}%
+}
+
+\def\@listi{%
+ \jlreq@init@list
+ \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@i\relax}%
+ \setlength{\leftmargin}{\leftmargini}%
+}
+\let\@listI\@listi
+\def\@listii{%
+ \jlreq@init@list
+ \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@ii\relax}%
+ \setlength{\leftmargin}{\leftmarginii}%
+}
+\def\@listiii{%
+ \jlreq@init@list
+ \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@iii\relax}%
+ \setlength{\leftmargin}{\leftmarginiii}%
+}
+\def\@listiv{%
+ \jlreq@init@list
+ \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@iv\relax}%
+ \setlength{\leftmargin}{\leftmarginiv}%
+}
+\def\@listv{%
+ \jlreq@init@list
+ \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@v\relax}%
+ \setlength{\leftmargin}{\leftmarginv}%
+}
+\def\@listvi{%
+ \jlreq@init@list
+ \setlength{\topsep}{\dimexpr\jlreq@itemization@beforeafter@space@vi\relax}%
+ \setlength{\leftmargin}{\leftmarginvi}%
+}
+
+\if@tate
+ \renewcommand{\theenumi}{\jlreq@Kanji{enumi}}
+ \renewcommand{\theenumii}{\jlreq@rensuji{\@arabic\c@enumii}}
+ \renewcommand{\theenumiii}{\jlreq@rensuji{\@arabic\c@enumiii}}
+ \renewcommand{\theenumiv}{\jlreq@rensuji{\@arabic\c@enumiv}}
+ \newcommand{\labelenumi}{\theenumi}
+ \newcommand{\labelenumii}{\theenumii}
+ \newcommand{\labelenumiii}{\theenumiii}
+ \newcommand{\labelenumiv}{\theenumiv}
+\else
+ \renewcommand{\theenumi}{\@arabic\c@enumi}
+ \renewcommand{\theenumii}{\@alph\c@enumii}
+ \renewcommand{\theenumiii}{\@roman\c@enumiii}
+ \renewcommand{\theenumiv}{\@Alph\c@enumiv}
+ \newcommand{\labelenumi}{\theenumi.}
+ \newcommand{\labelenumii}{(\theenumii)}
+ \newcommand{\labelenumiii}{\theenumiii.}
+ \newcommand{\labelenumiv}{\theenumiv.}
+\fi
+\renewcommand{\p@enumii}{\theenumi}
+\renewcommand{\p@enumiii}{\theenumi(\theenumii)}
+\renewcommand{\p@enumiv}{\p@enumiii\theenumiii}
+
+\newcommand{\labelitemi}{\hbox to 1\zw{\hss\textbullet\hss}}
+%\newcommand{\labelitemi}{•}
+\if@tate
+ \newcommand{\labelitemii}{○}
+ \newcommand{\labelitemiii}{*}
+\else
+ \newcommand{\labelitemii}{\hbox to 1\zw{\hss\textendash\hss}}
+ \newcommand{\labelitemiii}{\hbox to 1\zw{\hss\textasteriskcentered\hss}}
+\fi
+\newcommand{\labelitemiv}{\hbox to 1\zw{\hss ・\hss}}
+
+% 引用系.3.5.2の例.
+\jlreq@jlreqsetup@add{quote_indent}{\def\jlreq@quote@indent{#1}}
+\jlreq@jlreqsetup@add{quote_end_indent}{\def\jlreq@quote@end@indent{#1}}
+\jlreq@jlreqsetup@add{quote_fontsize}[normalsize,small,footnotesize,scriptsize,tiny,]{\jlreq@ifempty{#1}{\def\jlreq@quote@fontsize{}}{\edef\jlreq@quote@fontsize{\expandonce{\csname #1\endcsname}}}}
+\jlreq@jlreqsetup@add{quote_beforeafter_space}{\def\jlreq@quote@beforeafter@space{#1}}
+\jlreqsetup{quote_indent=2\zw,quote_end_indent=0pt,quote_fontsize=,quote_beforeafter_space=0pt}
+
+\newenvironment{verse}
+ {\let\\\@centercr
+ \list{}{\itemsep\z@ \itemindent -2\jlreq@mol
+ \listparindent\itemindent
+ \labelwidth\z@
+ \labelsep\z@
+ \leftmargin=\dimexpr\jlreq@quote@indent\relax
+ \addtolength{\leftmargin}{2\jlreq@mol}%
+ \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
+ \jlreq@quote@fontsize
+ \@tempdima=1\zw
+ \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
+ \@tempdimc=\@tempdimb
+ \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
+ \topsep=\dimexpr\jlreq@quote@beforeafter@space\relax
+ \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax}%
+ \item\relax}{\endlist}
+\newenvironment{quotation}
+ {\list{}{%
+ \leftmargin=\dimexpr\jlreq@quote@indent\relax
+ \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
+ \jlreq@quote@fontsize
+ \@tempdima=1\zw
+ \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
+ \@tempdimc=\@tempdimb
+ \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
+ \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax
+ \listparindent\parindent
+ \itemindent\listparindent
+ \labelwidth\z@
+ \labelsep\z@
+ \topsep=\dimexpr\jlreq@quote@beforeafter@space\relax
+ \parsep\z@ \@plus.1\jlreq@gol}%
+ \item\relax}{\endlist}
+\newenvironment{quote}
+ {\list{}{%
+ \leftmargin=\dimexpr\jlreq@quote@indent\relax
+ \rightmargin=\dimexpr\jlreq@quote@end@indent\relax
+ \jlreq@quote@fontsize
+ \@tempdima=1\zw
+ \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax
+ \@tempdimc=\@tempdimb
+ \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima
+ \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax
+ \labelwidth\z@
+ \itemindent\z@
+ \topsep=\jlreq@speciallength{\jlreq@quote@beforeafter@space}%
+ \listparindent\z@}%
+ \item\relax}{\endlist}
+
+%. 表関係 4.4
+% 表内の行間を0にする(4.4.3.f)
+\jlreq@saveoriginalcs{\tabular}
+\jlreq@saveoriginalcs{\endtabular}
+\preto\tabular{\begingroup\appto\@arrayparboxrestore{\baselineskip=0pt\lineskip=0pt}}
+\appto\endtabular{\endgroup}
+% 4.4.3.e
+\setlength\tabcolsep{.5\zh}
+\setlength\arraycolsep{.5\zw}
+% 4.4.3.j
+\setlength\arrayrulewidth{\jlreq@omotekeiwidth} % 4.4.3.c
+\setlength\doublerulesep{2pt}
+\setlength\tabbingsep{\labelsep}
+\skip\@mpfootins=\skip\footins
+\setlength\fboxsep{.3\zw}
+\setlength\fboxrule{\jlreq@omotekeiwidth} % 根拠はない
+% 後で
+\ifthenelse{\equal{\jlreq@article@type}{article}}{%
+ \renewcommand{\theequation}{\@arabic\c@equation}
+}{%
+ \@addtoreset{equation}{chapter}
+ \renewcommand{\theequation}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@equation}
+}
+
+%. 目次
+\setcounter{tocdepth}{3}
+\newcommand{\@pnumwidth}{2\jlreq@mol}
+\newcommand{\@tocrmarg}{2.55em}
+\newcommand{\@dotsep}{2} % 狭くしてみた
+\newskip\toclineskip
+\setlength\toclineskip{0\jlreq@gol plus .02\jlreq@gol}
+% tarticleから
+\newdimen\@lnumwidth
+\def\numberline#1{\hbox to\@lnumwidth{#1\hfil}}
+\def\addcontentsline#1#2#3{%
+ \protected@write\@auxout{%
+ \let\label\@gobble\let\index\@gobble\let\glossary\@gobble
+ \if@tate
+ \@temptokena{\jlreq@rensuji{\thepage}}%
+ \else
+ \@temptokena{\thepage}%
+ \fi
+ }{\string\@writefile{#1}{\protect\contentsline{#2}{#3}{\the\@temptokena}}}%
+}
+
+\newcount\jlreq@top@contents % トップ見出しを入れる.レベルと同じ値.
+\jlreq@top@contents=-100
+\newcommand*{\jlreq@set@top@contents}[1]{%
+ \ifnum\jlreq@top@contents=-100
+ \jlreq@top@contents=#1\relax
+ \fi
+}
+\ifthenelse{\equal{\jlreq@article@type}{article}}{
+ \newcommand{\tableofcontents}{%
+ \jlreq@top@contents=-100\relax
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \section*{\contentsname}%
+ \@mkboth{\contentsname}{\contentsname}%
+ \@starttoc{toc}%
+ \if@restonecol\twocolumn\fi
+ }
+}{% book, report
+ \newcommand{\tableofcontents}{%
+ \jlreq@top@contents=-100\relax
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\contentsname}%
+ \@mkboth{\contentsname}{\contentsname}%
+ \@starttoc{toc}%
+ \if@restonecol\twocolumn\fi
+ }
+}
+% JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
+% 文字の大きさは全て同じ(\normalsize)にする.
+% 見出しのレベルがあがると1文字分ずつ字下げしていく.
+% 第三引数は,上からの幅に加え更にトップの見出しからの差による補正(プラス)が入る.
+% 補正には\jlreq@top@contentsを使う.
+% 「トップ」というか,一番最初に現れた見出しを入れる.
+% リーダーは.から・に変更しました.
+\def\@dottedtocline#1#2#3#4#5{%
+ \jlreq@set@top@contents{#1}%
+ \ifnum #1>\c@tocdepth \else
+ \vskip\toclineskip
+ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@lnumwidth #3\relax
+ \@tempcnta=#1\relax
+ \advance\@tempcnta by -\jlreq@top@contents
+ \@tempdima=1\jlreq@mol
+ \multiply \@tempdima by \@tempcnta
+ \advance\leftskip \@lnumwidth \hbox{}\hskip -\leftskip
+ \advance\leftskip\@tempdima
+ {#4}\nobreak
+ \leaders\hbox{$\m@th\mkern \@dotsep mu$\null\inhibitglue ・\inhibitglue\null$\m@th\mkern \@dotsep mu$}%
+ \hfill\nobreak
+ \hb@xt@\@pnumwidth{\hss\normalfont\normalcolor #5}%
+ \par}%
+ \fi}
+
+% listoffigures
+\newcommand{\listoffigures}{%
+ \jlreq@top@contents=-100
+ \section*{\listfigurename}%
+ \@mkboth{\listfigurename}{\listfigurename}%
+ \@starttoc{lof}%
+}
+\newcommand*{\l@figure}{\@dottedtocline{1}{0\jlreq@gol}{2\jlreq@gol}}
+\newcommand{\listoftables}{%
+ \jlreq@top@contents=-100
+ \section*{\listtablename}%
+ \@mkboth{\listtablename}{\listtablename}%
+ \@starttoc{lot}%
+}
+\let\l@table\l@figure
+
+%. 文献,そのまま
+\newdimen\bibindent
+\setlength\bibindent{2\jlreq@mol}
+\newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
+\newenvironment{thebibliography}[1]{%
+ \jlreq@oldfontcommand@enable
+ \section*{\refname}%
+ \@mkboth{\refname}{\refname}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \itemindent=0pt
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty\clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m
+}{%
+ \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist
+ \jlreq@oldfontcommand@disable
+}
+\let\@openbib@code\@empty
+\if@tate
+ \def\@cite#1#2{\jlreq@rensuji{[{#1\if@tempswa , #2\fi}]}}
+ \def\@biblabel#1{\jlreq@rensuji{[#1]}}
+\fi
+
+%. 索引
+\newif\ifjlreq@resttate
+\newenvironment{theindex}{%
+ \jlreq@oldfontcommand@enable
+ \jlreq@iftdir{\clearpage\yoko\jlreq@resttatetrue}{\jlreq@resttatefalse}% 常に横書きにする
+ \if@twocolumn\@restonecolfalse\else\@restonecoltrue\fi
+ \columnseprule\z@ \columnsep 2\jlreq@mol
+ \twocolumn[\section*{\indexname}]%
+ \@mkboth{\indexname}{\indexname}%
+ \thispagestyle{plain}%
+ \parindent\z@
+ \parskip\z@ \@plus .03\jlreq@gol\relax
+ \let\item\@idxitem
+}{%
+ \if@restonecol\onecolumn\else\clearpage\fi
+ \ifjlreq@resttate\tate\fi
+ \jlreq@oldfontcommand@disable
+}
+\newcommand{\@idxitem}{\par\hangindent 4\jlreq@mol}
+\newcommand{\subitem}{\@idxitem \hspace*{2\jlreq@mol}}
+\newcommand{\subsubitem}{\@idxitem \hspace*{3\jlreq@mol}}
+\newcommand{\indexspace}{\par \vskip 1\jlreq@gol \@plus .5\jlreq@gol \@minus .3\jlreq@gol\relax}
+
+
+%. 前付,後付,付録
+\ifthenelse{\equal{\jlreq@article@type}{book}}{
+ \newif\if@mainmatter
+ \@mainmattertrue
+ \newcommand*{\frontmatter}{%
+ \cleardoublepage
+ \@mainmatterfalse
+ \let\jlreq@pagestyle@atmain\jlreq@current@pagestyle
+ \SaveHeading{chapter}{\jlreq@heading@chapter@atmain}%
+ \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
+ \pagestyle{plain}%
+ \pagenumbering{roman}}
+ \newcommand*{\mainmatter}{%
+ \cleardoublepage
+ \@mainmattertrue
+ \@ifundefined{jlreq@pagestyle@atmain}{}{%
+ \expandafter\pagestyle\expandafter{\jlreq@pagestyle@atmain}%
+ }%
+ \@ifundefined{jlreq@heading@chapter@atmain}{}{\jlreq@heading@chapter@atmain}%
+ \setcounter{chapter}{0}%
+ \pagenumbering{arabic}}
+ \newcommand*{\backmatter}{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \ifthenelse{\equal{\jlreq@article@type}{article}}{}{%book, report
+ \SaveHeading{chapter}{\jlreq@heading@chapter@atmain}%
+ \ModifyHeading{chapter}{label_format={},after_label_space=0pt}%
+ }%
+ \pagestyle{plain}%
+ \@mainmatterfalse
+ \setcounter{chapter}{0}}
+}{}
+\newcommand*{\appendix}{\par
+ \setcounter{section}{0}%
+}
+
+\ifthenelse{\equal{\jlreq@article@type}{article}}{
+ \appto\appendix{%
+ \setcounter{subsection}{0}%
+ \if@tate
+ \def\thesection{\jlreq@rensuji{\Alph{section}}}%
+ \else
+ \def\thesection{\Alph{section}}%
+ \fi
+ }
+}{%book, report
+ \appto\appendix{%
+ \setcounter{chapter}{0}%
+ \if@tate
+ \def\thechapter{\jlreq@rensuji{\Alph{chapter}}}%
+ \else
+ \def\thechapter{\Alph{chapter}}%
+ \fi
+ \ModifyHeading{chapter}{label_format={付録\thechapter}}%
+ \ifx\jlreq@current@pagestyle\@undefined\else
+ \ifthenelse{\equal{\jlreq@current@pagestyle}{headings}}{%
+ \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
+ \ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
+ }{}%
+ \fi
+ }
+}
+
+%. その他諸々
+%.. 縦中横
+\DeclareRobustCommand*{\tatechuyoko}[1]{%
+ \jlreq@ifydir{\ClassError{jlreq}{\string\tatechuyoko\space is not allowed in yoko mode}{\@ehc}}{}%
+ \jlreq@lastnodechar=\lastnodechar
+ \ifvmode\leavevmode\fi
+ % 前のJFM glue
+ \ifnum\jlreq@lastnodechar=-1\else
+ \inhibitglue
+ \jlreq@calc@jfmglue{\char\jlreq@lastnodechar}{阿}%
+ \jlreq@ifgluezero\jlreq@resultskip{}{\hskip\jlreq@resultskip}%
+ \fi
+ \hbox{\yoko
+ \setbox\jlreq@tempboxa=\hbox{阿}%
+ \vrule width 0pt height \ht\jlreq@tempboxa depth \dp\jlreq@tempboxa #1}%
+ \futurelet\jlreq@nextchar\jlreq@tatechuyoko@
+}
+\def\jlreq@tatechuyoko@{%
+ \begingroup
+ \def\jlreq@do{}%
+ \jlreq@getfirsttoken@expandmacros{\jlreq@nextchar}{\jlreq@tempa}%
+ \expandafter\jlreq@ifletter\expandafter{\jlreq@tempa}{%
+ \jlreq@calc@jfmglue{阿}{\jlreq@tempa}%
+ \edef\jlreq@do{%
+ \noexpand\hskip\the\jlreq@resultskip\space
+ \noexpand\inhibitglue
+ }%
+ }{}%
+ \expandafter\endgroup
+ \jlreq@do
+}
+
+% 日にち
+\newif\if西暦
+\def\西暦{\西暦true}
+\def\和暦{\西暦false}
+% #1年#2月#3日 #4は\numberとか\kansujiとか
+\def\jlreq@wareki#1#2#3#4{%
+ \jlreq@warekiyear{#1}{#2}{#3}{#4}%
+ #4#2月#4#3日%
+}
+\def\jlreq@warekiyear#1#2#3#4{%
+ % 昭和:1989年1月7日まで
+ \ifnum0\ifnum#1<1988 1\fi\ifnum#1=1989 \ifnum#2=1 \ifnum#3<8 1\fi\fi\fi>0
+ 昭和\jlreq@warekiyear@{#1}{1926}{#4}%
+ % 平成:2019年4月末日まで
+ \else%\ifnum0\ifnum#1<2019 1\fi\ifnum#1=1989 \ifnum#2<5 1\fi\fi>0
+ 平成\jlreq@warekiyear@{#1}{1989}{#4}%
+% \else
+% 新元号\jlreq@warekiyear@{#1}{2019}{#4}%
+ \fi%\fi
+}
+\def\jlreq@warekiyear@#1#2#3{\ifnum#1=#2 元年\else #3\numexpr#1-#2+1\relax 年\fi}
+\def\today{%
+ \if西暦
+ \jlreq@iftdir{%
+ \kansuji\year 年%
+ \kansuji\month 月%
+ \kansuji\day 日%
+ }{%
+ \number\year 年%
+ \number\month 月%
+ \number\day 日%
+ }%
+ \else
+ \jlreq@iftdir{%
+ \jlreq@wareki{\year}{\month}{\day}{\kansuji}%
+ }{%
+ \jlreq@wareki{\year}{\month}{\day}{\number}%
+ }%
+ \fi
+}
+\jlreq@jlreqsetup@add{year_style}[seireki,wareki]{%
+ \jlreq@switch{#1}{%
+ {seireki}{\西暦true}
+ {wareki}{\西暦false}
+ }
+}
+\if@tate
+ \jlreqsetup{year_style=wareki}
+\else
+ \jlreqsetup{year_style=seireki}
+\fi
+
+% 時刻
+\hour=\time \divide\hour by 60
+\minute=\numexpr\time - 60*\hour\relax
+
+%.. 定理環境
+\jlreq@saveoriginalcs{\@begintheorem}
+\jlreq@saveoriginalcs{\@opargbegintheorem}
+\def\@begintheorem#1#2{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
+ \trivlist\labelsep=1\zw
+ \itemindent=\dimexpr\jlreq@theorem@indent\relax
+ \item[\hskip \labelsep{\sffamily\bfseries #1\ #2}]}
+\def\@opargbegintheorem#1#2#3{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax
+ \trivlist\labelsep=1\zw
+ \itemindent=\dimexpr\jlreq@theorem@indent\relax
+ \item[\hskip \labelsep{\sffamily\bfseries #1\ #2(#3)}]}
+\AtEndOfPackageFile*{amsthm}{%
+ \jlreq@saveoriginalcs{\proof}%
+ \jlreq@saveoriginalcs{\endproof}%
+ \edef\jlreq@do{
+ \unexpanded{\def\jlreq@proof[#1]}{%
+ \unexpanded{\labelsep=1\zw}%
+ \expandonce{\proof[{\reset@font\sffamily\bfseries #1\inhibitglue}\nopunct]}%
+ }
+ }
+ \jlreq@do
+ \def\proof{\@ifnextchar[{\jlreq@proof}{\jlreq@proof[\proofname]}}
+ \renewcommand{\proofname}{証明}
+ \jlreq@setupamsthm
+ \theoremstyle{jlreq}
+}
+\def\jlreq@setupamsthm{
+ \newtheoremstyle{jlreq}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\dimexpr\jlreq@theorem@beforeafter@space\relax}{\normalfont}{\dimexpr\jlreq@theorem@indent\relax}{\sffamily\bfseries}{}{1\zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{(##3)}}
+}
+\jlreq@jlreqsetup@add{theorem_beforeafter_space}{
+ \def\jlreq@theorem@beforeafter@space{#1}
+ \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
+}
+\jlreq@jlreqsetup@add{theorem_indent}{
+ \def\jlreq@theorem@indent{#1}
+ \@ifpackageloaded{amsthm}{\jlreq@setupamsthm}{}
+}
+\jlreqsetup{theorem_beforeafter_space=1\baselineskip,theorem_indent=0pt}
+
+
+% デフォルト設定
+\newcommand{\contentsname}{目次}
+\newcommand{\refname}{参考文献}
+\newcommand{\indexname}{索引}
+\pagestyle{plain}
+\pagenumbering{arabic}
+\if@twocolumn
+ \twocolumn
+ \sloppy
+ \flushbottom
+\else
+ \onecolumn
+ \raggedbottom
+\fi
+\endinput
+
+
diff --git a/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua b/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua
index d4ff74d1997..299b4ea1789 100644
--- a/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua
+++ b/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua
@@ -1,1195 +1,1195 @@
---[[
-3.1.3
-3.1.6.a
-]]
-
---[[
-優先順位は,第n段階を3 - nに対応させる.
- 段階 1, 2, 3, 4, 5, 6
-priority 2, 1, 0,-1,-2,-3
-xkanjiskipは{1,-3},kanjiskip={0,0}
-\ltjsetparameter{stretch_priority={kanjiskip=1,xkanjiskip=-3}}
-\ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=0}}
-]]
-
-local stretch_width = 0.25 -- 空き第四段階の空き量
-
-local hyphen_glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, stretch_width, 0, priority = {-1,0}},
- [9] = {0, 0, 0},
- [10] = {0, 0, 0},
- [11] = {0, 0, 0},
- [12] = {0, stretch_width, 0, priority = {-1,0}},
- [13] = {0, stretch_width, 0, priority = {-1,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
- [15] = {0, stretch_width, 0, priority = {-1,0}},
- [16] = {0, stretch_width, 0, priority = {-1,0}},
- [0] = {0, stretch_width, 0, priority = {-1,0}},
- [27] = {0, stretch_width, 0, priority = {-1,0}},
---[[
- [20] = {0, 0, 0},
- [21] = {0, 0, 0},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},
- [30] = {0, 0, 0},
-]]
-}
-
-local jfm = {
- dir = 'yoko',
- zw = 1.0,
- zh = 1.0,
- version = 3,
- -- 文字クラス4,9,10,11,15,16,19との間は(x)kanjiskipで調整する.
- kanjiskip = {0, 0.25, 0},
- xkanjiskip = {0.25, 0.25, 0.125},
-
- -- alignは適当
- [1] = { -- 初め括弧類
- chars = {'(', '〔', '[', '{', '〈', '《', '「', '『', '【', '⦅', '〘', '〖', '«', '〝',
- '‘', '“'},
- width = 0.5,height = 0.88,depth = 0.12,
- align = 'right',
- glue = {
- [1] = {0, 0, 0},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0, 0},
- [9] = {0, 0, 0},
- [10] = {0, 0, 0},
- [11] = {0, 0, 0},
- [12] = {0, 0, 0},
- [13] = {0, 0, 0},
- [14] = {0, 0, 0},
- [15] = {0, 0, 0},
- [16] = {0, 0, 0},
- [0] = {0, 0, 0},
- [27] = {0, 0, 0},
---[[
- [20] = {0, 0, 0},
- [21] = {0, 0, 0},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},
- [30] = {0, 0, 0},
- -- [22][23] 注1
- ]]
- },
- },
-
- [2] = { -- 終わり括弧類
- chars = { ')', '〕', ']', '}', '〉', '》', '」', '』', '】', '⦆', '〙', '〗', '»', '〟',
- '’', '”'},
- width = 0.5,height = 0.88,depth = 0.12,
- align = 'left',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [301] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [302] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [4] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [9] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [10] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [11] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [12] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [13] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
- [15] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [16] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [0] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [27] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [22] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [23] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [24] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [25] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [26] = {0.5, 0, 0, ratio = 0, priority = {0,-2}},
- [28] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [29] = {0, 0, 0},
- [30] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- ]]
- },
- end_adjust = {0.5,0},
- },
-
- -- [3*]はハイフン類.幅が違うので分ける.
- [300] = {
- chars = {'‐'},
- width = 0.25,height = 0.88,depth = 0.12,
- align = 'middle',
- glue = hyphen_glue,-- 上の方で定義
- },
-
- [301] = {
- chars = {'゠', '–'},
- width = 0.5,height = 0.88,depth = 0.12,
- align = 'middle',
- glue = hyphen_glue,
- },
-
- [302] = {
- chars = {'〜'},
- width = 1,height = 0.88,depth = 0.12,
- align = 'middle',
- glue = hyphen_glue,
- },
-
- [4] = { -- 区切り約物
- chars = {'!', '?', '‼', '⁇', '⁈', '⁉'},
- width = 1,height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, stretch_width, 0.25, ratio = 1, priority = {-1,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, stretch_width, 0, priority = {-1,0}},
- [9] = {0, 0, 0},
- [10] = {0, 0, 0},
- [11] = {0, 0, 0},
- [12] = {0, stretch_width, 0, priority = {-1,0}},
- [13] = {0, stretch_width, 0, priority = {-1,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
- [15] = {0, stretch_width, 0, priority = {-1,0}},
- [16] = {0, stretch_width, 0, priority = {-1,0}},
- [0] = {0, stretch_width, 0, priority = {-1,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},
- [30] = {0, 0, 0},
- ]]
- },
- },
-
- [5] = { -- 中点類
- chars = {'・', ':',
- ';'
- },
- width = 0.5,height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [2] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [300] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [301] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [302] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [4] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [5] = {0.5, 0, 0.5, ratio = 0.5, priority = {0,-1}},
- [6] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [7] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [8] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [9] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [10] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [11] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [12] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [13] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [14] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [15] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [16] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [0] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- [27] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
- --[[
- [20] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [21] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [22] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [23] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [24] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [25] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [26] = {0.25, 0, 0, ratio = 0, priority = {0,-1}},
- [28] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [29] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- [30] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
- ]]
- },
- end_adjust = {0.25,0}, -- 0.25 -> 0は詰め,優先順位は第三段階
- },
-
- [6] = { -- 句点類
- chars = {'。',
- '.'}, -- 縦書きでは使わない
- width = 0.5,height = 0.88,depth = 0.12,
- align = 'left',
- glue = {
- [1] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [2] = {0, 0, 0},
- [300] = {0.5, 0, 0, ratio = 0},
- [301] = {0.5, 0, 0, ratio = 0},
- [302] = {0.5, 0, 0, ratio = 0},
- [4] = {0.5, 0, 0, ratio = 0},
- [5] = {0.75, 0, 0.25, ratio = 0.33333333, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [9] = {0.5, 0, 0, ratio = 0},
- [10] = {0.5, 0, 0, ratio = 0},
- [11] = {0.5, 0, 0, ratio = 0},
- [12] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [13] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [14] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [15] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [16] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [0] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- [27] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.5, 0, 0, ratio = 0},
- [22] = {0.5, 0, 0, ratio = 0},
- [23] = {0.5, 0, 0, ratio = 0},
- [24] = {0.5, 0, 0, ratio = 0},
- [25] = {0.5, 0, 0, ratio = 0},
- [26] = {0.5, 0, 0, ratio = 0},
- [28] = {0.5, 0, 0, ratio = 0},
- [29] = {0.5, 0, 0, ratio = 0},
- [30] = {0.5, 0, 0, ratio = 0},
- ]]
- },
- end_adjust = {0.5, 0},
- },
-
- [7] = { -- 読点類
- chars = {'、',
- ','}, -- 縦書きでは使わない
- width = 0.5,height = 0.88,depth = 0.12,
- align = 'left',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [301] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [302] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [4] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [5] = {0.75, 0, 0.75, ratio = 0.33333333, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [9] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [10] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [11] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [12] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [13] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [14] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [15] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [16] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [0] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- [27] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [22] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [23] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [24] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [25] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [26] = {0.5, 0, 0, ratio = 0, priority = {0,-2}},
- [28] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [29] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- [30] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
- ]]
- },
- end_adjust = {0.5, 0},
- },
-
- [8] = { -- 分離禁止文字
- chars = {'—', '…', '‥', '〳', '〴', '〵'},
- width = 1,height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0, 0}, -- 空き注4
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [27] = {0, 0.25, 0, priority = {0,0}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [9] = { -- 繰返し記号
- chars = {'ヽ', 'ヾ', 'ゝ', 'ゞ', '々', '〻'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, stretch_width, 0, priority = {-1,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
--- [0] = {0, 0.25, 0, priority = {0,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [10] = { -- 長音記号
- chars = {'ー'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, stretch_width, 0, priority = {-1,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
--- [0] = {0, 0.25, 0, priority = {0,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [11] = { -- 小書きの仮名
- chars = {'ぁ', 'ぃ', 'ぅ', 'ぇ', 'ぉ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'っ', 'ゃ', 'ゅ', 'ょ', 'ゎ', 'ゕ', 'ゖ', 'ッ', 'ャ', 'ュ', 'ョ', 'ヮ', 'ヵ', 'ヶ', 'ㇰ', 'ㇱ', 'ㇲ', 'ㇳ', 'ㇴ', 'ㇵ', 'ㇶ', 'ㇷ', 'ㇸ', 'ㇹ', 'ㇺ', 'ㇻ', 'ㇼ', 'ㇽ', 'ㇾ', 'ㇿ', 'ㇷ゚'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, stretch_width, 0, priority = {-1,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
--- [0] = {0, 0.25, 0, priority = {0,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [12] = { -- 前置省略記号
- chars = {'¥', '$', '£', '#', '€', '№'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
--- [8] = {0, 0.25, 0, priority = {0,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [27] = {0, 0.25, 0, priority = {0,0}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0, 0, 0},
- [25] = {0, 0.25, 0, priority = {0,0}},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [13] = { -- 後置省略記号
- chars = {'°', '′', '″', '℃', '¢', '%', '‰', '㏋', 'ℓ', '㌃', '㌍', '㌔', '㌘', '㌢', '㌣', '㌦', '㌧', '㌫', '㌶', '㌻', '㍉', '㍊', '㍍', '㍑', '㍗', '㎎', '㎏', '㎜', '㎝', '㎞', '㎡', '㏄'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
--- [8] = {0, 0.25, 0, priority = {0,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [27] = {0, 0.25, 0, priority = {0,0}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0, 0.25, 0, priority = {0,0}},
- [25] = {0, 0.25, 0, priority = {0,0}},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [14] = { -- 和字間隔
- chars = {' '},
- align = 'middle',
- width= 1,height = 0.88,depth = 0.12,
- glue = {
- [1] = {0, stretch_width, 0, priority = {-1,0}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, stretch_width, 0, priority = {-1,0}},
- [9] = {0, 0, 0},
- [10] = {0, 0, 0},
- [11] = {0, 0, 0},
- [12] = {0, stretch_width, 0, priority = {-1,0}},
- [13] = {0, stretch_width, 0, priority = {-1,0}},
- [14] = {0, stretch_width, 0, priority = {-1,0}},
- [15] = {0, stretch_width, 0, priority = {-1,0}},
- [16] = {0, stretch_width, 0, priority = {-1,0}},
- [0] = {0, stretch_width, 0, priority = {-1,0}},
- [27] = {0, stretch_width, 0, priority = {-1,0}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0, 0, 0},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},
- [30] = {0, 0, 0},
- ]]
- },
- },
-
- [15] = { -- 平仮名
- chars = {'あ', 'い', 'う', 'え', 'お', 'か', 'が', 'き', 'ぎ', 'く', 'ぐ', 'け', 'げ', 'こ', 'ご', 'さ', 'ざ', 'し', 'じ', 'す', 'ず', 'せ', 'ぜ', 'そ', 'ぞ', 'た', 'だ', 'ち', 'ぢ', 'つ', 'づ', 'て', 'で', 'と', 'ど', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ば', 'ぱ', 'ひ', 'び', 'ぴ', 'ふ', 'ぶ', 'ぷ', 'へ', 'べ', 'ぺ', 'ほ', 'ぼ', 'ぽ', 'ま', 'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ', 'ら', 'り', 'る', 'れ', 'ろ', 'わ', 'ゐ', 'ゑ', 'を', 'ん', 'ゔ', 'か゚', 'き゚', 'く゚', 'け゚', 'こ゚'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
--- [8] = {0, 0.25, 0, priority = {0,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
--- [0] = {0, 0.25, 0, priority = {0,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- ]]
- --[[
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- [16] = { -- 片仮名
- chars = {'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'ガ', 'キ', 'ギ', 'ク', 'グ', 'ケ', 'ゲ', 'コ', 'ゴ', 'サ', 'ザ', 'シ', 'ジ', 'ス', 'ズ', 'セ', 'ゼ', 'ソ', 'ゾ', 'タ', 'ダ', 'チ', 'ヂ', 'ツ', 'ヅ', 'テ', 'デ', 'ト', 'ド', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'バ', 'パ', 'ヒ', 'ビ', 'ピ', 'フ', 'ブ', 'プ', 'ヘ', 'ベ', 'ペ', 'ホ', 'ボ', 'ポ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ヰ', 'ヱ', 'ヲ', 'ン', 'ヴ', 'ヷ', 'ヸ', 'ヹ', 'ヺ', 'カ゚', 'キ゚', 'ク゚', 'ケ゚', 'コ゚', 'セ゚', 'ツ゚', 'ト゚'},
- height = 0.88,depth = 0.12,
- align = 'middle',
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
--- [8] = {0, 0.25, 0, priority = {0,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
--- [0] = {0, 0.25, 0, priority = {0,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- ]]
- --[[
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
- --[[
- [17] = { -- 等号類
- chars = {'=', '≠', '≒', '≃', '≅', '≈', '≡', '≢', '<', '>', '≦', '≧', '≪', '≫', '≶', '≷', '⋚', '⋛', '∧', '∨', '⌅', '⌆', '⊂', '⊃', '⊄', '⊅', '⊆', '⊇', '⊊', '⊋', '∈', '∋', '∉', '∪', '∩', '∥', '∦', '⇒', '⇔', '↔', '∽', '∝', '⊥', '⊕', '⊗'},
- align = 'middle',
- width = 1,
- },
-
- [18] = { -- 演算記号
- chars = {'+', '-', '×', '÷', '±', '∓'},
- align = 'middle',
- width = 1,
- },
- ]]
-
- -- [19] -- 漢字等:「その他の和文」として[0]で扱う
- [0] = { -- = [19]
- left = 0,
- align = 'middle',
- width = 1,height = 0.88,depth = 0.12,
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
--- [8] = {0, 0.25, 0, priority = {0,0}},
--- [9] = {0, 0.25, 0, priority = {0,0}},
--- [10] = {0, 0.25, 0, priority = {0,0}},
--- [11] = {0, 0.25, 0, priority = {0,0}},
--- [12] = {0, 0.25, 0, priority = {0,0}},
--- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
--- [15] = {0, 0.25, 0, priority = {0,0}},
--- [16] = {0, 0.25, 0, priority = {0,0}},
--- [0] = {0, 0.25, 0, priority = {0,0}},
--- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- --[[
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- ]]
- },
- },
-
-
- --[[
- [20] = { -- 合印中の文字
- glue = {
- [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0, 0.25, 0, priority = {0,0}},
- [10] = {0, 0.25, 0, priority = {0,0}},
- [11] = {0, 0.25, 0, priority = {0,0}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0, 0.25, 0, priority = {0,0}},
- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0, 0.25, 0, priority = {0,0}},
- [25] = {0, 0.25, 0, priority = {0,0}},
- [26] = {0, 0, 0},
- [27] = {0, 0.25, 0, priority = {0,0}},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- },
- },
-
- [21] = {-- 親文字群中の文字(添え字付き)
- glue = {
- [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [20] = {0, 0, 0},
- [21] = {0, 0, 0},-- 注9,空け注5
- [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [24] = {0, 0.25, 0, priority = {0,0}},
- [25] = {0, 0.25, 0, priority = {0,0}},
- [26] = {0, 0, 0},
- [27] = {0, 0.25, 0, priority = {0,0}},
- [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},表6と表3が整合的でない
- [29] = {0, 0, 0},
- [30] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- },
- },
-
- [22] = { -- 親文字群中の文字(熟語ルビ以外のルビ付き)
- glue = {
- [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0, 0.25, 0, priority = {0,0}},
- [10] = {0, 0.25, 0, priority = {0,0}},
- [11] = {0, 0.25, 0, priority = {0,0}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0, 0.25, 0, priority = {0,0}},
- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}}, -- 空け注10
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- },
- },
-
- [23] = { -- 親文字群中の文字(熟語ルビ付き)
- glue = {
- [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0, 0.25, 0, priority = {0,0}},
- [10] = {0, 0.25, 0, priority = {0,0}},
- [11] = {0, 0.25, 0, priority = {0,0}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0, 0.25, 0, priority = {0,0}},
- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},-- 空け注7
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [26] = {0, 0, 0},
- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- },
- },
-
- [24] = { -- 連数字中の文字
- chars = {' ', ',', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'},
- glue = {
- [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0, 0},-- 空け注8
- [14] = {0, 0, 0},
- [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [24] = {0, 0, 0},
- [25] = {0.25, 0, 0, ratio = 0},
- [26] = {0, 0, 0},
- [27] = {0, 0, 0},-- 空け注9
- [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [29] = {0, 0, 0},
- [30] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- }
- },
-
- [25] = { -- 単位記号中の文字
- chars = {' ', '(', ')', '/', '1', '2', '3', '4', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'Ω', 'μ', '℧', 'Å', '−', '・'},
- glue = {
- [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},-- 注12
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [27] = {0, 0, 0},
- [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [29] = {0, 0, 0},
- [30] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- }
- },
-
- [26] = { -- 欧文間隔
- chars = {' '},
- glue = { -- 表3の方には記述がないのは何故?
- [1] = {0.5, 0, 0.5, ratio = 1},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0, 0},
- [9] = {0, 0, 0},
- [10] = {0, 0, 0},
- [11] = {0, 0, 0},
- [12] = {0, 0, 0},
- [13] = {0, 0, 0},
- [14] = {0, 0, 0},
- [15] = {0, 0, 0},
- [16] = {0, 0, 0},
- [0] = {0, 0, 0},
- [21] = {0, 0, 0},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [27] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},-- 注13, (空け)注4
- [30] = {0, 0, 0},
- }
- },
-]]
- [27] = {-- 欧文
- chars = {'alchar'},
- glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
- [2] = {0, 0, 0},
- [300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
--- [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
--- [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
--- [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},-- 空け注10
- [14] = {0, 0, 0},
--- [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
--- [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
--- [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
--- [27] = {0, 0, 0, ratio = 0, priority = {1,0}},
---[[
- [20] = {0, 0, 0},
- [21] = {0, 0.25, 0, priority = {0,0}},
- [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [24] = {0, 0, 0},
- [25] = {0.25, 0, 0.125, ratio = 0, priority = {0,-1}},
- [26] = {0, 0, 0},
- [27] = {0, 0, 0},
- [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
- [29] = {0, 0, 0},
- [30] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
---]]
- }
- },
---[[
- [28] = { -- 割注始め括弧類
- chars = {'(', '〔', '['},
- glue = {
- [1] = {0, 0, 0},
- [2] = {0, 0, 0},
- [3] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0, 0, 0},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0, 0},
- [9] = {0, 0, 0},-- 注14
- [10] = {0, 0, 0},-- 注15
- [11] = {0, 0, 0},-- 注16
- [12] = {0, 0, 0},
- [13] = {0, 0, 0},
- [14] = {0, 0, 0},
- [15] = {0, 0, 0},
- [16] = {0, 0, 0},
- [0] = {0, 0, 0},
- [20] = {0, 0, 0},
- [21] = {0, 0, 0},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0}, -- 注13, (空け)注4
- [27] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},
- [30] = {0, 0, 0},
- }
- },
-
- [29] = { -- 割注終わり括弧類
- chars = {')', '〕', ']'},
- glue = {
- [1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [3] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0, 0.25, 0, priority = {0,0}},
- [10] = {0, 0.25, 0, priority = {0,0}},
- [11] = {0, 0.25, 0, priority = {0,0}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0, 0.25, 0, priority = {0,0}},
- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 1}, priority = {1,-3},
- [25] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [26] = {0, 0, 0},
- [27] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- }
- },
-
- [30] = { -- 縦中横中の文字
- glue = {
- [1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}},
- [2] = {0, 0, 0},
- [3] = {0, 0, 0},
- [4] = {0, 0, 0},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
- [6] = {0, 0, 0},
- [7] = {0, 0, 0},
- [8] = {0, 0.25, 0, priority = {0,0}},
- [9] = {0, 0.25, 0, priority = {0,0}},
- [10] = {0, 0.25, 0, priority = {0,0}},
- [11] = {0, 0.25, 0, priority = {0,0}},
- [12] = {0, 0.25, 0, priority = {0,0}},
- [13] = {0, 0.25, 0, priority = {0,0}},
- [14] = {0, 0, 0},
- [15] = {0, 0.25, 0, priority = {0,0}},
- [16] = {0, 0.25, 0, priority = {0,0}},
- [0] = {0, 0.25, 0, priority = {0,0}},
- [20] = {0, 0, 0},
- [21] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [22] = {0, 0.25, 0, priority = {0,0}},
- [23] = {0, 0.25, 0, priority = {0,0}},
- [24] = {0.25, 0.25, 0.125, ratio = 1}, priority = {1,-3},
- [25] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [26] = {0, 0, 0},
- [27] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
- [28] = {0, 0.25, 0, priority = {0,0}},
- [29] = {0, 0, 0},
- [30] = {0, 0.25, 0, priority = {0,0}},
- }
- },
- ]]
-
- [90] = { -- 行頭
- chars = {'parbdd','boxbdd'},
- glue = {
- [1] = {0, 0, 0}, -- 行頭括弧はベタ組
- },
- },
-}
-
-local function add_space(before,after,glueorkern,space,ratio)
- if jfm[before][glueorkern] == nil then jfm[before][glueorkern] = {} end
- if jfm[before][glueorkern][after] == nil then jfm[before][glueorkern][after] = {0} end
- local origratio = jfm[before][glueorkern][after].ratio
- if origratio == nil then origratio = 0.5 end
- jfm[before][glueorkern][after].ratio = (jfm[before][glueorkern][after][1] * origratio + space * ratio) / (jfm[before][glueorkern][after][1] + ratio)
- jfm[before][glueorkern][after][1] = jfm[before][glueorkern][after][1] + space
-end
-
-if jlreq ~= nil then
- if type(jlreq.open_bracket_pos) == "string" then
- local r = jlreq.open_bracket_pos:find("_")
- local danraku = jlreq.open_bracket_pos:sub(1,r - 1)
- local orikaeshi = jlreq.open_bracket_pos:sub(r + 1)
-
- -- 折り返し行頭の開き括弧を二分下げる……つもり
- if orikaeshi == "nibu" then
- -- widthを二分増やし,その代わりJFMグルーを二分減らす
- jfm[1].width = jfm[1].width + 0.5
- for k,v in pairs(jfm) do
- if type(k) == "number" then
- add_space(k,1,"glue",-0.5,1)
- end
- end
- end
-
- -- 段落行頭の下げ
- if danraku == "zenkakunibu" then
- add_space(90,1,"glue",0.5,1)
- elseif danraku == "nibu" then
- add_space(90,1,"glue",-0.5,1)
- end
- end
-
- -- ぶら下げ組を有効にする.
- if jlreq.burasage == true then
- for _,class in ipairs({6,7}) do
- table.insert(jfm[class].end_adjust,-0.5)
- end
- end
-end
-
-
-luatexja.jfont.define_jfm(jfm)
+--[[
+3.1.3
+3.1.6.a
+]]
+
+--[[
+優先順位は,第n段階を3 - nに対応させる.
+ 段階 1, 2, 3, 4, 5, 6
+priority 2, 1, 0,-1,-2,-3
+xkanjiskipは{1,-3},kanjiskip={0,0}
+\ltjsetparameter{stretch_priority={kanjiskip=1,xkanjiskip=-3}}
+\ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=0}}
+]]
+
+local stretch_width = 0.25 -- 空き第四段階の空き量
+
+local hyphen_glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, stretch_width, 0, priority = {-1,0}},
+ [9] = {0, 0, 0},
+ [10] = {0, 0, 0},
+ [11] = {0, 0, 0},
+ [12] = {0, stretch_width, 0, priority = {-1,0}},
+ [13] = {0, stretch_width, 0, priority = {-1,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+ [15] = {0, stretch_width, 0, priority = {-1,0}},
+ [16] = {0, stretch_width, 0, priority = {-1,0}},
+ [0] = {0, stretch_width, 0, priority = {-1,0}},
+ [27] = {0, stretch_width, 0, priority = {-1,0}},
+--[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0, 0},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},
+ [30] = {0, 0, 0},
+]]
+}
+
+local jfm = {
+ dir = 'yoko',
+ zw = 1.0,
+ zh = 1.0,
+ version = 3,
+ -- 文字クラス4,9,10,11,15,16,19との間は(x)kanjiskipで調整する.
+ kanjiskip = {0, 0.25, 0},
+ xkanjiskip = {0.25, 0.25, 0.125},
+
+ -- alignは適当
+ [1] = { -- 初め括弧類
+ chars = {'(', '〔', '[', '{', '〈', '《', '「', '『', '【', '⦅', '〘', '〖', '«', '〝',
+ '‘', '“'},
+ width = 0.5,height = 0.88,depth = 0.12,
+ align = 'right',
+ glue = {
+ [1] = {0, 0, 0},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
+ [10] = {0, 0, 0},
+ [11] = {0, 0, 0},
+ [12] = {0, 0, 0},
+ [13] = {0, 0, 0},
+ [14] = {0, 0, 0},
+ [15] = {0, 0, 0},
+ [16] = {0, 0, 0},
+ [0] = {0, 0, 0},
+ [27] = {0, 0, 0},
+--[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0, 0},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},
+ [30] = {0, 0, 0},
+ -- [22][23] 注1
+ ]]
+ },
+ },
+
+ [2] = { -- 終わり括弧類
+ chars = { ')', '〕', ']', '}', '〉', '》', '」', '』', '】', '⦆', '〙', '〗', '»', '〟',
+ '’', '”'},
+ width = 0.5,height = 0.88,depth = 0.12,
+ align = 'left',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [301] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [302] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [4] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [9] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [10] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [11] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [12] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [13] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+ [15] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [16] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [0] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [27] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [22] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [23] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [24] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [25] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [26] = {0.5, 0, 0, ratio = 0, priority = {0,-2}},
+ [28] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [29] = {0, 0, 0},
+ [30] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ ]]
+ },
+ end_adjust = {0.5,0},
+ },
+
+ -- [3*]はハイフン類.幅が違うので分ける.
+ [300] = {
+ chars = {'‐'},
+ width = 0.25,height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = hyphen_glue,-- 上の方で定義
+ },
+
+ [301] = {
+ chars = {'゠', '–'},
+ width = 0.5,height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = hyphen_glue,
+ },
+
+ [302] = {
+ chars = {'〜'},
+ width = 1,height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = hyphen_glue,
+ },
+
+ [4] = { -- 区切り約物
+ chars = {'!', '?', '‼', '⁇', '⁈', '⁉'},
+ width = 1,height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, stretch_width, 0.25, ratio = 1, priority = {-1,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, stretch_width, 0, priority = {-1,0}},
+ [9] = {0, 0, 0},
+ [10] = {0, 0, 0},
+ [11] = {0, 0, 0},
+ [12] = {0, stretch_width, 0, priority = {-1,0}},
+ [13] = {0, stretch_width, 0, priority = {-1,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+ [15] = {0, stretch_width, 0, priority = {-1,0}},
+ [16] = {0, stretch_width, 0, priority = {-1,0}},
+ [0] = {0, stretch_width, 0, priority = {-1,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},
+ [30] = {0, 0, 0},
+ ]]
+ },
+ },
+
+ [5] = { -- 中点類
+ chars = {'・', ':',
+ ';'
+ },
+ width = 0.5,height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [2] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [300] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [301] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [302] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [4] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [5] = {0.5, 0, 0.5, ratio = 0.5, priority = {0,-1}},
+ [6] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [7] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [8] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [9] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [10] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [11] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [12] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [13] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [14] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [15] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [16] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [0] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ [27] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}},
+ --[[
+ [20] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [21] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [22] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [23] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [24] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [25] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [26] = {0.25, 0, 0, ratio = 0, priority = {0,-1}},
+ [28] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [29] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ [30] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}},
+ ]]
+ },
+ end_adjust = {0.25,0}, -- 0.25 -> 0は詰め,優先順位は第三段階
+ },
+
+ [6] = { -- 句点類
+ chars = {'。',
+ '.'}, -- 縦書きでは使わない
+ width = 0.5,height = 0.88,depth = 0.12,
+ align = 'left',
+ glue = {
+ [1] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [2] = {0, 0, 0},
+ [300] = {0.5, 0, 0, ratio = 0},
+ [301] = {0.5, 0, 0, ratio = 0},
+ [302] = {0.5, 0, 0, ratio = 0},
+ [4] = {0.5, 0, 0, ratio = 0},
+ [5] = {0.75, 0, 0.25, ratio = 0.33333333, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [9] = {0.5, 0, 0, ratio = 0},
+ [10] = {0.5, 0, 0, ratio = 0},
+ [11] = {0.5, 0, 0, ratio = 0},
+ [12] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [13] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [14] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [15] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [16] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [0] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ [27] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.5, 0, 0, ratio = 0},
+ [22] = {0.5, 0, 0, ratio = 0},
+ [23] = {0.5, 0, 0, ratio = 0},
+ [24] = {0.5, 0, 0, ratio = 0},
+ [25] = {0.5, 0, 0, ratio = 0},
+ [26] = {0.5, 0, 0, ratio = 0},
+ [28] = {0.5, 0, 0, ratio = 0},
+ [29] = {0.5, 0, 0, ratio = 0},
+ [30] = {0.5, 0, 0, ratio = 0},
+ ]]
+ },
+ end_adjust = {0.5, 0},
+ },
+
+ [7] = { -- 読点類
+ chars = {'、',
+ ','}, -- 縦書きでは使わない
+ width = 0.5,height = 0.88,depth = 0.12,
+ align = 'left',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [301] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [302] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [4] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [5] = {0.75, 0, 0.75, ratio = 0.33333333, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [9] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [10] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [11] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [12] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [13] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [14] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [15] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [16] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [0] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ [27] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [22] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [23] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [24] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [25] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [26] = {0.5, 0, 0, ratio = 0, priority = {0,-2}},
+ [28] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [29] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ [30] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}},
+ ]]
+ },
+ end_adjust = {0.5, 0},
+ },
+
+ [8] = { -- 分離禁止文字
+ chars = {'—', '…', '‥', '〳', '〴', '〵'},
+ width = 1,height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0}, -- 空き注4
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [27] = {0, 0.25, 0, priority = {0,0}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [9] = { -- 繰返し記号
+ chars = {'ヽ', 'ヾ', 'ゝ', 'ゞ', '々', '〻'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, stretch_width, 0, priority = {-1,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+-- [0] = {0, 0.25, 0, priority = {0,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [10] = { -- 長音記号
+ chars = {'ー'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, stretch_width, 0, priority = {-1,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+-- [0] = {0, 0.25, 0, priority = {0,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [11] = { -- 小書きの仮名
+ chars = {'ぁ', 'ぃ', 'ぅ', 'ぇ', 'ぉ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'っ', 'ゃ', 'ゅ', 'ょ', 'ゎ', 'ゕ', 'ゖ', 'ッ', 'ャ', 'ュ', 'ョ', 'ヮ', 'ヵ', 'ヶ', 'ㇰ', 'ㇱ', 'ㇲ', 'ㇳ', 'ㇴ', 'ㇵ', 'ㇶ', 'ㇷ', 'ㇸ', 'ㇹ', 'ㇺ', 'ㇻ', 'ㇼ', 'ㇽ', 'ㇾ', 'ㇿ', 'ㇷ゚'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, stretch_width, 0, priority = {-1,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+-- [0] = {0, 0.25, 0, priority = {0,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [12] = { -- 前置省略記号
+ chars = {'¥', '$', '£', '#', '€', '№'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+-- [8] = {0, 0.25, 0, priority = {0,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [27] = {0, 0.25, 0, priority = {0,0}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0, 0, 0},
+ [25] = {0, 0.25, 0, priority = {0,0}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [13] = { -- 後置省略記号
+ chars = {'°', '′', '″', '℃', '¢', '%', '‰', '㏋', 'ℓ', '㌃', '㌍', '㌔', '㌘', '㌢', '㌣', '㌦', '㌧', '㌫', '㌶', '㌻', '㍉', '㍊', '㍍', '㍑', '㍗', '㎎', '㎏', '㎜', '㎝', '㎞', '㎡', '㏄'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+-- [8] = {0, 0.25, 0, priority = {0,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [27] = {0, 0.25, 0, priority = {0,0}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0, 0.25, 0, priority = {0,0}},
+ [25] = {0, 0.25, 0, priority = {0,0}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [14] = { -- 和字間隔
+ chars = {' '},
+ align = 'middle',
+ width= 1,height = 0.88,depth = 0.12,
+ glue = {
+ [1] = {0, stretch_width, 0, priority = {-1,0}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, stretch_width, 0, priority = {-1,0}},
+ [9] = {0, 0, 0},
+ [10] = {0, 0, 0},
+ [11] = {0, 0, 0},
+ [12] = {0, stretch_width, 0, priority = {-1,0}},
+ [13] = {0, stretch_width, 0, priority = {-1,0}},
+ [14] = {0, stretch_width, 0, priority = {-1,0}},
+ [15] = {0, stretch_width, 0, priority = {-1,0}},
+ [16] = {0, stretch_width, 0, priority = {-1,0}},
+ [0] = {0, stretch_width, 0, priority = {-1,0}},
+ [27] = {0, stretch_width, 0, priority = {-1,0}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0, 0},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},
+ [30] = {0, 0, 0},
+ ]]
+ },
+ },
+
+ [15] = { -- 平仮名
+ chars = {'あ', 'い', 'う', 'え', 'お', 'か', 'が', 'き', 'ぎ', 'く', 'ぐ', 'け', 'げ', 'こ', 'ご', 'さ', 'ざ', 'し', 'じ', 'す', 'ず', 'せ', 'ぜ', 'そ', 'ぞ', 'た', 'だ', 'ち', 'ぢ', 'つ', 'づ', 'て', 'で', 'と', 'ど', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ば', 'ぱ', 'ひ', 'び', 'ぴ', 'ふ', 'ぶ', 'ぷ', 'へ', 'べ', 'ぺ', 'ほ', 'ぼ', 'ぽ', 'ま', 'み', 'む', 'め', 'も', 'や', 'ゆ', 'よ', 'ら', 'り', 'る', 'れ', 'ろ', 'わ', 'ゐ', 'ゑ', 'を', 'ん', 'ゔ', 'か゚', 'き゚', 'く゚', 'け゚', 'こ゚'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+-- [8] = {0, 0.25, 0, priority = {0,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+-- [0] = {0, 0.25, 0, priority = {0,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ ]]
+ --[[
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ [16] = { -- 片仮名
+ chars = {'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'ガ', 'キ', 'ギ', 'ク', 'グ', 'ケ', 'ゲ', 'コ', 'ゴ', 'サ', 'ザ', 'シ', 'ジ', 'ス', 'ズ', 'セ', 'ゼ', 'ソ', 'ゾ', 'タ', 'ダ', 'チ', 'ヂ', 'ツ', 'ヅ', 'テ', 'デ', 'ト', 'ド', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'バ', 'パ', 'ヒ', 'ビ', 'ピ', 'フ', 'ブ', 'プ', 'ヘ', 'ベ', 'ペ', 'ホ', 'ボ', 'ポ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ヰ', 'ヱ', 'ヲ', 'ン', 'ヴ', 'ヷ', 'ヸ', 'ヹ', 'ヺ', 'カ゚', 'キ゚', 'ク゚', 'ケ゚', 'コ゚', 'セ゚', 'ツ゚', 'ト゚'},
+ height = 0.88,depth = 0.12,
+ align = 'middle',
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+-- [8] = {0, 0.25, 0, priority = {0,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+-- [0] = {0, 0.25, 0, priority = {0,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ ]]
+ --[[
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+ --[[
+ [17] = { -- 等号類
+ chars = {'=', '≠', '≒', '≃', '≅', '≈', '≡', '≢', '<', '>', '≦', '≧', '≪', '≫', '≶', '≷', '⋚', '⋛', '∧', '∨', '⌅', '⌆', '⊂', '⊃', '⊄', '⊅', '⊆', '⊇', '⊊', '⊋', '∈', '∋', '∉', '∪', '∩', '∥', '∦', '⇒', '⇔', '↔', '∽', '∝', '⊥', '⊕', '⊗'},
+ align = 'middle',
+ width = 1,
+ },
+
+ [18] = { -- 演算記号
+ chars = {'+', '-', '×', '÷', '±', '∓'},
+ align = 'middle',
+ width = 1,
+ },
+ ]]
+
+ -- [19] -- 漢字等:「その他の和文」として[0]で扱う
+ [0] = { -- = [19]
+ left = 0,
+ align = 'middle',
+ width = 1,height = 0.88,depth = 0.12,
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+-- [8] = {0, 0.25, 0, priority = {0,0}},
+-- [9] = {0, 0.25, 0, priority = {0,0}},
+-- [10] = {0, 0.25, 0, priority = {0,0}},
+-- [11] = {0, 0.25, 0, priority = {0,0}},
+-- [12] = {0, 0.25, 0, priority = {0,0}},
+-- [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+-- [15] = {0, 0.25, 0, priority = {0,0}},
+-- [16] = {0, 0.25, 0, priority = {0,0}},
+-- [0] = {0, 0.25, 0, priority = {0,0}},
+-- [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ --[[
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ ]]
+ },
+ },
+
+
+ --[[
+ [20] = { -- 合印中の文字
+ glue = {
+ [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0, 0.25, 0, priority = {0,0}},
+ [10] = {0, 0.25, 0, priority = {0,0}},
+ [11] = {0, 0.25, 0, priority = {0,0}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0, 0.25, 0, priority = {0,0}},
+ [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0, 0.25, 0, priority = {0,0}},
+ [25] = {0, 0.25, 0, priority = {0,0}},
+ [26] = {0, 0, 0},
+ [27] = {0, 0.25, 0, priority = {0,0}},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ },
+ },
+
+ [21] = {-- 親文字群中の文字(添え字付き)
+ glue = {
+ [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [20] = {0, 0, 0},
+ [21] = {0, 0, 0},-- 注9,空け注5
+ [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [24] = {0, 0.25, 0, priority = {0,0}},
+ [25] = {0, 0.25, 0, priority = {0,0}},
+ [26] = {0, 0, 0},
+ [27] = {0, 0.25, 0, priority = {0,0}},
+ [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},表6と表3が整合的でない
+ [29] = {0, 0, 0},
+ [30] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ },
+ },
+
+ [22] = { -- 親文字群中の文字(熟語ルビ以外のルビ付き)
+ glue = {
+ [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0, 0.25, 0, priority = {0,0}},
+ [10] = {0, 0.25, 0, priority = {0,0}},
+ [11] = {0, 0.25, 0, priority = {0,0}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0, 0.25, 0, priority = {0,0}},
+ [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}}, -- 空け注10
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ },
+ },
+
+ [23] = { -- 親文字群中の文字(熟語ルビ付き)
+ glue = {
+ [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0, 0.25, 0, priority = {0,0}},
+ [10] = {0, 0.25, 0, priority = {0,0}},
+ [11] = {0, 0.25, 0, priority = {0,0}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0, 0.25, 0, priority = {0,0}},
+ [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},-- 空け注7
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [27] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ },
+ },
+
+ [24] = { -- 連数字中の文字
+ chars = {' ', ',', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'},
+ glue = {
+ [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0, 0},-- 空け注8
+ [14] = {0, 0, 0},
+ [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [24] = {0, 0, 0},
+ [25] = {0.25, 0, 0, ratio = 0},
+ [26] = {0, 0, 0},
+ [27] = {0, 0, 0},-- 空け注9
+ [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [29] = {0, 0, 0},
+ [30] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ }
+ },
+
+ [25] = { -- 単位記号中の文字
+ chars = {' ', '(', ')', '/', '1', '2', '3', '4', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'Ω', 'μ', '℧', 'Å', '−', '・'},
+ glue = {
+ [1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},-- 注12
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [24] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [27] = {0, 0, 0},
+ [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [29] = {0, 0, 0},
+ [30] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ }
+ },
+
+ [26] = { -- 欧文間隔
+ chars = {' '},
+ glue = { -- 表3の方には記述がないのは何故?
+ [1] = {0.5, 0, 0.5, ratio = 1},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
+ [10] = {0, 0, 0},
+ [11] = {0, 0, 0},
+ [12] = {0, 0, 0},
+ [13] = {0, 0, 0},
+ [14] = {0, 0, 0},
+ [15] = {0, 0, 0},
+ [16] = {0, 0, 0},
+ [0] = {0, 0, 0},
+ [21] = {0, 0, 0},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [27] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},-- 注13, (空け)注4
+ [30] = {0, 0, 0},
+ }
+ },
+]]
+ [27] = {-- 欧文
+ chars = {'alchar'},
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}},
+ [2] = {0, 0, 0},
+ [300] = {0, 0, 0},
+ [301] = {0, 0, 0},
+ [302] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+-- [9] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+-- [10] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+-- [11] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},-- 空け注10
+ [14] = {0, 0, 0},
+-- [15] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+-- [16] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+-- [0] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+-- [27] = {0, 0, 0, ratio = 0, priority = {1,0}},
+--[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0.25, 0, priority = {0,0}},
+ [22] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [23] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [24] = {0, 0, 0},
+ [25] = {0.25, 0, 0.125, ratio = 0, priority = {0,-1}},
+ [26] = {0, 0, 0},
+ [27] = {0, 0, 0},
+ [28] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+ [29] = {0, 0, 0},
+ [30] = {0.25, 0.25, 0.125, ratio = 0, priority = {1,-3}},
+--]]
+ }
+ },
+--[[
+ [28] = { -- 割注始め括弧類
+ chars = {'(', '〔', '['},
+ glue = {
+ [1] = {0, 0, 0},
+ [2] = {0, 0, 0},
+ [3] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},-- 注14
+ [10] = {0, 0, 0},-- 注15
+ [11] = {0, 0, 0},-- 注16
+ [12] = {0, 0, 0},
+ [13] = {0, 0, 0},
+ [14] = {0, 0, 0},
+ [15] = {0, 0, 0},
+ [16] = {0, 0, 0},
+ [0] = {0, 0, 0},
+ [20] = {0, 0, 0},
+ [21] = {0, 0, 0},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0}, -- 注13, (空け)注4
+ [27] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},
+ [30] = {0, 0, 0},
+ }
+ },
+
+ [29] = { -- 割注終わり括弧類
+ chars = {')', '〕', ']'},
+ glue = {
+ [1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [3] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0, 0.25, 0, priority = {0,0}},
+ [10] = {0, 0.25, 0, priority = {0,0}},
+ [11] = {0, 0.25, 0, priority = {0,0}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0, 0.25, 0, priority = {0,0}},
+ [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 1}, priority = {1,-3},
+ [25] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [27] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ }
+ },
+
+ [30] = { -- 縦中横中の文字
+ glue = {
+ [1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}},
+ [2] = {0, 0, 0},
+ [3] = {0, 0, 0},
+ [4] = {0, 0, 0},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0.25, 0, priority = {0,0}},
+ [9] = {0, 0.25, 0, priority = {0,0}},
+ [10] = {0, 0.25, 0, priority = {0,0}},
+ [11] = {0, 0.25, 0, priority = {0,0}},
+ [12] = {0, 0.25, 0, priority = {0,0}},
+ [13] = {0, 0.25, 0, priority = {0,0}},
+ [14] = {0, 0, 0},
+ [15] = {0, 0.25, 0, priority = {0,0}},
+ [16] = {0, 0.25, 0, priority = {0,0}},
+ [0] = {0, 0.25, 0, priority = {0,0}},
+ [20] = {0, 0, 0},
+ [21] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [22] = {0, 0.25, 0, priority = {0,0}},
+ [23] = {0, 0.25, 0, priority = {0,0}},
+ [24] = {0.25, 0.25, 0.125, ratio = 1}, priority = {1,-3},
+ [25] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [26] = {0, 0, 0},
+ [27] = {0.25, 0.25, 0.125, ratio = 1, priority = {1,-3}},
+ [28] = {0, 0.25, 0, priority = {0,0}},
+ [29] = {0, 0, 0},
+ [30] = {0, 0.25, 0, priority = {0,0}},
+ }
+ },
+ ]]
+
+ [90] = { -- 行頭
+ chars = {'parbdd','boxbdd'},
+ glue = {
+ [1] = {0, 0, 0}, -- 行頭括弧はベタ組
+ },
+ },
+}
+
+local function add_space(before,after,glueorkern,space,ratio)
+ if jfm[before][glueorkern] == nil then jfm[before][glueorkern] = {} end
+ if jfm[before][glueorkern][after] == nil then jfm[before][glueorkern][after] = {0} end
+ local origratio = jfm[before][glueorkern][after].ratio
+ if origratio == nil then origratio = 0.5 end
+ jfm[before][glueorkern][after].ratio = (jfm[before][glueorkern][after][1] * origratio + space * ratio) / (jfm[before][glueorkern][after][1] + ratio)
+ jfm[before][glueorkern][after][1] = jfm[before][glueorkern][after][1] + space
+end
+
+if jlreq ~= nil then
+ if type(jlreq.open_bracket_pos) == "string" then
+ local r = jlreq.open_bracket_pos:find("_")
+ local danraku = jlreq.open_bracket_pos:sub(1,r - 1)
+ local orikaeshi = jlreq.open_bracket_pos:sub(r + 1)
+
+ -- 折り返し行頭の開き括弧を二分下げる……つもり
+ if orikaeshi == "nibu" then
+ -- widthを二分増やし,その代わりJFMグルーを二分減らす
+ jfm[1].width = jfm[1].width + 0.5
+ for k,v in pairs(jfm) do
+ if type(k) == "number" then
+ add_space(k,1,"glue",-0.5,1)
+ end
+ end
+ end
+
+ -- 段落行頭の下げ
+ if danraku == "zenkakunibu" then
+ add_space(90,1,"glue",0.5,1)
+ elseif danraku == "nibu" then
+ add_space(90,1,"glue",-0.5,1)
+ end
+ end
+
+ -- ぶら下げ組を有効にする.
+ if jlreq.burasage == true then
+ for _,class in ipairs({6,7}) do
+ table.insert(jfm[class].end_adjust,-0.5)
+ end
+ end
+end
+
+
+luatexja.jfont.define_jfm(jfm)
diff --git a/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua b/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua
index dcced2f4e3d..f7e657ae1c2 100644
--- a/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua
+++ b/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreqv.lua
@@ -1,1423 +1,1423 @@
-local jfm={
- [0]={
- ["align"]="middle",
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [14]={ 0, 0, 0 },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["left"]=0,
- ["width"]=1,
- },
- {
- ["align"]="right",
- ["chars"]={ "(", "〔", "[", "{", "〈", "《", "「", "『", "【", "⦅", "〘", "〖", "«", "〝", "‘", "“" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={ 0, 0, 0 },
- { 0, 0, 0 },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={ 0, 0, 0 },
- [9]={ 0, 0, 0 },
- [10]={ 0, 0, 0 },
- [11]={ 0, 0, 0 },
- [12]={ 0, 0, 0 },
- [13]={ 0, 0, 0 },
- [14]={ 0, 0, 0 },
- [15]={ 0, 0, 0 },
- [16]={ 0, 0, 0 },
- [27]={ 0, 0, 0 },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=0.5,
- },
- {
- ["align"]="left",
- ["chars"]={ ")", "〕", "]", "}", "〉", "》", "」", "』", "】", "⦆", "〙", "〗", "»", "〟", "’", "”" },
- ["depth"]=0.5,
- ["end_adjust"]={ 0.5, 0 },
- ["glue"]={
- [0]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- { 0, 0, 0 },
- [4]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [9]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [10]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [11]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [12]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [13]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [15]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [16]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [27]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [300]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [301]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [302]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- },
- ["height"]=0.5,
- ["width"]=0.5,
- },
- [4]={
- ["align"]="middle",
- ["chars"]={ "!", "?", "‼", "⁇", "⁈", "⁉" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [9]={ 0, 0, 0 },
- [10]={ 0, 0, 0 },
- [11]={ 0, 0, 0 },
- [12]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [13]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [15]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [16]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=1,
- },
- [5]={
- ["align"]="middle",
- ["chars"]={ "・", ":", ";" },
- ["depth"]=0.5,
- ["end_adjust"]={ 0.25, 0 },
- ["glue"]={
- [0]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- {
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- {
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [4]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [5]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -1 },
- ["ratio"]=0.5,
- },
- [6]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [7]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [8]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [9]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [10]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [11]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [12]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [13]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [14]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [15]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [16]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [27]={
- 0.25,
- 0.25,
- 0.25,
- ["priority"]={ -1, -1 },
- ["ratio"]=0,
- },
- [300]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [301]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- [302]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0,
- },
- },
- ["height"]=0.5,
- ["width"]=0.5,
- },
- [6]={
- ["align"]="left",
- ["chars"]={ "。", "." },
- ["depth"]=0.5,
- ["end_adjust"]={ 0.5, 0 },
- ["glue"]={
- [0]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- {
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- { 0, 0, 0 },
- [4]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- [5]={
- 0.75,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=0.33333333,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [9]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- [10]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- [11]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- [12]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [13]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [14]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [15]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [16]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [27]={
- 0.5,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- ["ratio"]=0,
- },
- [300]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- [301]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- [302]={
- 0.5,
- 0,
- 0,
- ["ratio"]=0,
- },
- },
- ["height"]=0.5,
- ["width"]=0.5,
- },
- [7]={
- ["align"]="left",
- ["chars"]={ "、", "," },
- ["depth"]=0.5,
- ["end_adjust"]={ 0.5, 0 },
- ["glue"]={
- [0]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- { 0, 0, 0 },
- [4]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [5]={
- 0.75,
- 0,
- 0.75,
- ["priority"]={ 0, -1 },
- ["ratio"]=0.33333333,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [9]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [10]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [11]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [12]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [13]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [14]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [15]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [16]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [27]={
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=0,
- },
- [300]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [301]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- [302]={
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=0,
- },
- },
- ["height"]=0.5,
- ["width"]=0.5,
- },
- [8]={
- ["align"]="middle",
- ["chars"]={ "—", "…", "‥", "〳", "〴", "〵" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={ 0, 0, 0 },
- [14]={ 0, 0, 0 },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=1,
- },
- [9]={
- ["align"]="middle",
- ["chars"]={ "ヽ", "ヾ", "ゝ", "ゞ", "々", "〻" },
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [10]={
- ["align"]="middle",
- ["chars"]={ "ー" },
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [11]={
- ["align"]="middle",
- ["chars"]={ "ぁ", "ぃ", "ぅ", "ぇ", "ぉ", "ァ", "ィ", "ゥ", "ェ", "ォ", "っ", "ゃ", "ゅ", "ょ", "ゎ", "ゕ", "ゖ", "ッ", "ャ", "ュ", "ョ", "ヮ", "ヵ", "ヶ", "ㇰ", "ㇱ", "ㇲ", "ㇳ", "ㇴ", "ㇵ", "ㇶ", "ㇷ", "ㇸ", "ㇹ", "ㇺ", "ㇻ", "ㇼ", "ㇽ", "ㇾ", "ㇿ", "ㇷ゚" },
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [12]={
- ["align"]="middle",
- ["chars"]={ "¥", "$", "£", "#", "€", "№" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- {
- 0.5,
- 0,
- 0.5,
- ["priority"]={ 0, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [14]={ 0, 0, 0 },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [13]={
- ["align"]="middle",
- ["chars"]={ "°", "′", "″", "℃", "¢", "%", "‰", "㏋", "ℓ", "㌃", "㌍", "㌔", "㌘", "㌢", "㌣", "㌦", "㌧", "㌫", "㌶", "㌻", "㍉", "㍊", "㍍", "㍑", "㍗", "㎎", "㎏", "㎜", "㎝", "㎞", "㎡", "㏄" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [14]={
- ["align"]="middle",
- ["chars"]={ " " },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- {
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [9]={ 0, 0, 0 },
- [10]={ 0, 0, 0 },
- [11]={ 0, 0, 0 },
- [12]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [13]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [15]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [16]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=1,
- },
- [15]={
- ["align"]="middle",
- ["chars"]={ "あ", "い", "う", "え", "お", "か", "が", "き", "ぎ", "く", "ぐ", "け", "げ", "こ", "ご", "さ", "ざ", "し", "じ", "す", "ず", "せ", "ぜ", "そ", "ぞ", "た", "だ", "ち", "ぢ", "つ", "づ", "て", "で", "と", "ど", "な", "に", "ぬ", "ね", "の", "は", "ば", "ぱ", "ひ", "び", "ぴ", "ふ", "ぶ", "ぷ", "へ", "べ", "ぺ", "ほ", "ぼ", "ぽ", "ま", "み", "む", "め", "も", "や", "ゆ", "よ", "ら", "り", "る", "れ", "ろ", "わ", "ゐ", "ゑ", "を", "ん", "ゔ", "か゚", "き゚", "く゚", "け゚", "こ゚" },
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [14]={ 0, 0, 0 },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [16]={
- ["align"]="middle",
- ["chars"]={ "ア", "イ", "ウ", "エ", "オ", "カ", "ガ", "キ", "ギ", "ク", "グ", "ケ", "ゲ", "コ", "ゴ", "サ", "ザ", "シ", "ジ", "ス", "ズ", "セ", "ゼ", "ソ", "ゾ", "タ", "ダ", "チ", "ヂ", "ツ", "ヅ", "テ", "デ", "ト", "ド", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "バ", "パ", "ヒ", "ビ", "ピ", "フ", "ブ", "プ", "ヘ", "ベ", "ペ", "ホ", "ボ", "ポ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ヰ", "ヱ", "ヲ", "ン", "ヴ", "ヷ", "ヸ", "ヹ", "ヺ", "カ゚", "キ゚", "ク゚", "ケ゚", "コ゚", "セ゚", "ツ゚", "ト゚" },
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [14]={ 0, 0, 0 },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [27]={
- ["chars"]={ "alchar" },
- ["depth"]=0.5,
- ["glue"]={
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- [12]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- [13]={
- 0,
- 0.25,
- 0,
- ["priority"]={ 0, 0 },
- },
- [14]={ 0, 0, 0 },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [90]={
- ["chars"]={ "parbdd", "boxbdd" },
- ["depth"]=0.5,
- ["glue"]={
- { 0, 0, 0 },
- },
- ["height"]=0.5,
- },
- [300]={
- ["align"]="middle",
- ["chars"]={ "‐" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [9]={ 0, 0, 0 },
- [10]={ 0, 0, 0 },
- [11]={ 0, 0, 0 },
- [12]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [13]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [15]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [16]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=0.25,
- },
- [301]={
- ["align"]="middle",
- ["chars"]={ "゠", "–" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [9]={ 0, 0, 0 },
- [10]={ 0, 0, 0 },
- [11]={ 0, 0, 0 },
- [12]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [13]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [15]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [16]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=0.5,
- },
- [302]={
- ["align"]="middle",
- ["chars"]={ "〜" },
- ["depth"]=0.5,
- ["glue"]={
- [0]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- {
- 0.5,
- 0.25,
- 0.5,
- ["priority"]={ -1, -2 },
- ["ratio"]=1,
- },
- { 0, 0, 0 },
- [4]={ 0, 0, 0 },
- [5]={
- 0.25,
- 0,
- 0.25,
- ["priority"]={ 0, -1 },
- ["ratio"]=1,
- },
- [6]={ 0, 0, 0 },
- [7]={ 0, 0, 0 },
- [8]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [9]={ 0, 0, 0 },
- [10]={ 0, 0, 0 },
- [11]={ 0, 0, 0 },
- [12]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [13]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [14]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [15]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [16]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [27]={
- 0,
- 0.25,
- 0,
- ["priority"]={ -1, 0 },
- },
- [300]={ 0, 0, 0 },
- [301]={ 0, 0, 0 },
- [302]={ 0, 0, 0 },
- },
- ["height"]=0.5,
- ["width"]=1,
- },
- ["dir"]="tate",
- ["kanjiskip"]={ 0, 0.25, 0 },
- ["version"]=3,
- ["xkanjiskip"]={ 0.25, 0.25, 0.125 },
- ["zh"]=1,
- ["zw"]=1,
-}
-local function add_space(before,after,glueorkern,space,ratio)
- if jfm[before][glueorkern] == nil then jfm[before][glueorkern] = {} end
- if jfm[before][glueorkern][after] == nil then jfm[before][glueorkern][after] = {0} end
- local origratio = jfm[before][glueorkern][after].ratio
- if origratio == nil then origratio = 0.5 end
- jfm[before][glueorkern][after].ratio = (jfm[before][glueorkern][after][1] * origratio + space * ratio) / (jfm[before][glueorkern][after][1] + ratio)
- jfm[before][glueorkern][after][1] = jfm[before][glueorkern][after][1] + space
-end
-
-if jlreq ~= nil then
- if type(jlreq.open_bracket_pos) == "string" then
- local r = jlreq.open_bracket_pos:find("_")
- local danraku = jlreq.open_bracket_pos:sub(1,r - 1)
- local orikaeshi = jlreq.open_bracket_pos:sub(r + 1)
-
- -- 折り返し行頭の開き括弧を二分下げる……つもり
- if orikaeshi == "nibu" then
- -- widthを二分増やし,その代わりJFMグルーを二分減らす
- jfm[1].width = jfm[1].width + 0.5
- for k,v in pairs(jfm) do
- if type(k) == "number" then
- add_space(k,1,"glue",-0.5,1)
- end
- end
- end
-
- -- 段落行頭の下げ
- if danraku == "zenkakunibu" then
- add_space(90,1,"glue",0.5,1)
- elseif danraku == "nibu" then
- add_space(90,1,"glue",-0.5,1)
- end
- end
-
- -- ぶら下げ組を有効にする.
- if jlreq.burasage == true then
- for _,class in ipairs({6,7}) do
- table.insert(jfm[class].end_adjust,-0.5)
- end
- end
-end
-luatexja.jfont.define_jfm(jfm)
+local jfm={
+ [0]={
+ ["align"]="middle",
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [14]={ 0, 0, 0 },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["left"]=0,
+ ["width"]=1,
+ },
+ {
+ ["align"]="right",
+ ["chars"]={ "(", "〔", "[", "{", "〈", "《", "「", "『", "【", "⦅", "〘", "〖", "«", "〝", "‘", "“" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={ 0, 0, 0 },
+ { 0, 0, 0 },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={ 0, 0, 0 },
+ [9]={ 0, 0, 0 },
+ [10]={ 0, 0, 0 },
+ [11]={ 0, 0, 0 },
+ [12]={ 0, 0, 0 },
+ [13]={ 0, 0, 0 },
+ [14]={ 0, 0, 0 },
+ [15]={ 0, 0, 0 },
+ [16]={ 0, 0, 0 },
+ [27]={ 0, 0, 0 },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=0.5,
+ },
+ {
+ ["align"]="left",
+ ["chars"]={ ")", "〕", "]", "}", "〉", "》", "」", "』", "】", "⦆", "〙", "〗", "»", "〟", "’", "”" },
+ ["depth"]=0.5,
+ ["end_adjust"]={ 0.5, 0 },
+ ["glue"]={
+ [0]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ { 0, 0, 0 },
+ [4]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [9]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [10]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [11]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [12]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [13]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [15]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [16]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [27]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [300]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [301]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [302]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ },
+ ["height"]=0.5,
+ ["width"]=0.5,
+ },
+ [4]={
+ ["align"]="middle",
+ ["chars"]={ "!", "?", "‼", "⁇", "⁈", "⁉" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [9]={ 0, 0, 0 },
+ [10]={ 0, 0, 0 },
+ [11]={ 0, 0, 0 },
+ [12]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [13]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [15]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [16]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=1,
+ },
+ [5]={
+ ["align"]="middle",
+ ["chars"]={ "・", ":", ";" },
+ ["depth"]=0.5,
+ ["end_adjust"]={ 0.25, 0 },
+ ["glue"]={
+ [0]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ {
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ {
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [4]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [5]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0.5,
+ },
+ [6]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [7]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [8]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [9]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [10]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [11]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [12]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [13]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [14]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [15]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [16]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [27]={
+ 0.25,
+ 0.25,
+ 0.25,
+ ["priority"]={ -1, -1 },
+ ["ratio"]=0,
+ },
+ [300]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [301]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ [302]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0,
+ },
+ },
+ ["height"]=0.5,
+ ["width"]=0.5,
+ },
+ [6]={
+ ["align"]="left",
+ ["chars"]={ "。", "." },
+ ["depth"]=0.5,
+ ["end_adjust"]={ 0.5, 0 },
+ ["glue"]={
+ [0]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ {
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ { 0, 0, 0 },
+ [4]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ [5]={
+ 0.75,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0.33333333,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [9]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ [10]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ [11]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ [12]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [13]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [14]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [15]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [16]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [27]={
+ 0.5,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ ["ratio"]=0,
+ },
+ [300]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ [301]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ [302]={
+ 0.5,
+ 0,
+ 0,
+ ["ratio"]=0,
+ },
+ },
+ ["height"]=0.5,
+ ["width"]=0.5,
+ },
+ [7]={
+ ["align"]="left",
+ ["chars"]={ "、", "," },
+ ["depth"]=0.5,
+ ["end_adjust"]={ 0.5, 0 },
+ ["glue"]={
+ [0]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ { 0, 0, 0 },
+ [4]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [5]={
+ 0.75,
+ 0,
+ 0.75,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=0.33333333,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [9]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [10]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [11]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [12]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [13]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [14]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [15]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [16]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [27]={
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=0,
+ },
+ [300]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [301]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ [302]={
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=0,
+ },
+ },
+ ["height"]=0.5,
+ ["width"]=0.5,
+ },
+ [8]={
+ ["align"]="middle",
+ ["chars"]={ "—", "…", "‥", "〳", "〴", "〵" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={ 0, 0, 0 },
+ [14]={ 0, 0, 0 },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=1,
+ },
+ [9]={
+ ["align"]="middle",
+ ["chars"]={ "ヽ", "ヾ", "ゝ", "ゞ", "々", "〻" },
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [10]={
+ ["align"]="middle",
+ ["chars"]={ "ー" },
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [11]={
+ ["align"]="middle",
+ ["chars"]={ "ぁ", "ぃ", "ぅ", "ぇ", "ぉ", "ァ", "ィ", "ゥ", "ェ", "ォ", "っ", "ゃ", "ゅ", "ょ", "ゎ", "ゕ", "ゖ", "ッ", "ャ", "ュ", "ョ", "ヮ", "ヵ", "ヶ", "ㇰ", "ㇱ", "ㇲ", "ㇳ", "ㇴ", "ㇵ", "ㇶ", "ㇷ", "ㇸ", "ㇹ", "ㇺ", "ㇻ", "ㇼ", "ㇽ", "ㇾ", "ㇿ", "ㇷ゚" },
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [12]={
+ ["align"]="middle",
+ ["chars"]={ "¥", "$", "£", "#", "€", "№" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ {
+ 0.5,
+ 0,
+ 0.5,
+ ["priority"]={ 0, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [14]={ 0, 0, 0 },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [13]={
+ ["align"]="middle",
+ ["chars"]={ "°", "′", "″", "℃", "¢", "%", "‰", "㏋", "ℓ", "㌃", "㌍", "㌔", "㌘", "㌢", "㌣", "㌦", "㌧", "㌫", "㌶", "㌻", "㍉", "㍊", "㍍", "㍑", "㍗", "㎎", "㎏", "㎜", "㎝", "㎞", "㎡", "㏄" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [14]={
+ ["align"]="middle",
+ ["chars"]={ " " },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ {
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [9]={ 0, 0, 0 },
+ [10]={ 0, 0, 0 },
+ [11]={ 0, 0, 0 },
+ [12]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [13]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [15]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [16]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=1,
+ },
+ [15]={
+ ["align"]="middle",
+ ["chars"]={ "あ", "い", "う", "え", "お", "か", "が", "き", "ぎ", "く", "ぐ", "け", "げ", "こ", "ご", "さ", "ざ", "し", "じ", "す", "ず", "せ", "ぜ", "そ", "ぞ", "た", "だ", "ち", "ぢ", "つ", "づ", "て", "で", "と", "ど", "な", "に", "ぬ", "ね", "の", "は", "ば", "ぱ", "ひ", "び", "ぴ", "ふ", "ぶ", "ぷ", "へ", "べ", "ぺ", "ほ", "ぼ", "ぽ", "ま", "み", "む", "め", "も", "や", "ゆ", "よ", "ら", "り", "る", "れ", "ろ", "わ", "ゐ", "ゑ", "を", "ん", "ゔ", "か゚", "き゚", "く゚", "け゚", "こ゚" },
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [14]={ 0, 0, 0 },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [16]={
+ ["align"]="middle",
+ ["chars"]={ "ア", "イ", "ウ", "エ", "オ", "カ", "ガ", "キ", "ギ", "ク", "グ", "ケ", "ゲ", "コ", "ゴ", "サ", "ザ", "シ", "ジ", "ス", "ズ", "セ", "ゼ", "ソ", "ゾ", "タ", "ダ", "チ", "ヂ", "ツ", "ヅ", "テ", "デ", "ト", "ド", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "バ", "パ", "ヒ", "ビ", "ピ", "フ", "ブ", "プ", "ヘ", "ベ", "ペ", "ホ", "ボ", "ポ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ヰ", "ヱ", "ヲ", "ン", "ヴ", "ヷ", "ヸ", "ヹ", "ヺ", "カ゚", "キ゚", "ク゚", "ケ゚", "コ゚", "セ゚", "ツ゚", "ト゚" },
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [14]={ 0, 0, 0 },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [27]={
+ ["chars"]={ "alchar" },
+ ["depth"]=0.5,
+ ["glue"]={
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ [12]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ [13]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ 0, 0 },
+ },
+ [14]={ 0, 0, 0 },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [90]={
+ ["chars"]={ "parbdd", "boxbdd" },
+ ["depth"]=0.5,
+ ["glue"]={
+ { 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ },
+ [300]={
+ ["align"]="middle",
+ ["chars"]={ "‐" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [9]={ 0, 0, 0 },
+ [10]={ 0, 0, 0 },
+ [11]={ 0, 0, 0 },
+ [12]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [13]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [15]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [16]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=0.25,
+ },
+ [301]={
+ ["align"]="middle",
+ ["chars"]={ "゠", "–" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [9]={ 0, 0, 0 },
+ [10]={ 0, 0, 0 },
+ [11]={ 0, 0, 0 },
+ [12]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [13]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [15]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [16]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=0.5,
+ },
+ [302]={
+ ["align"]="middle",
+ ["chars"]={ "〜" },
+ ["depth"]=0.5,
+ ["glue"]={
+ [0]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ {
+ 0.5,
+ 0.25,
+ 0.5,
+ ["priority"]={ -1, -2 },
+ ["ratio"]=1,
+ },
+ { 0, 0, 0 },
+ [4]={ 0, 0, 0 },
+ [5]={
+ 0.25,
+ 0,
+ 0.25,
+ ["priority"]={ 0, -1 },
+ ["ratio"]=1,
+ },
+ [6]={ 0, 0, 0 },
+ [7]={ 0, 0, 0 },
+ [8]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [9]={ 0, 0, 0 },
+ [10]={ 0, 0, 0 },
+ [11]={ 0, 0, 0 },
+ [12]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [13]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [14]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [15]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [16]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [27]={
+ 0,
+ 0.25,
+ 0,
+ ["priority"]={ -1, 0 },
+ },
+ [300]={ 0, 0, 0 },
+ [301]={ 0, 0, 0 },
+ [302]={ 0, 0, 0 },
+ },
+ ["height"]=0.5,
+ ["width"]=1,
+ },
+ ["dir"]="tate",
+ ["kanjiskip"]={ 0, 0.25, 0 },
+ ["version"]=3,
+ ["xkanjiskip"]={ 0.25, 0.25, 0.125 },
+ ["zh"]=1,
+ ["zw"]=1,
+}
+local function add_space(before,after,glueorkern,space,ratio)
+ if jfm[before][glueorkern] == nil then jfm[before][glueorkern] = {} end
+ if jfm[before][glueorkern][after] == nil then jfm[before][glueorkern][after] = {0} end
+ local origratio = jfm[before][glueorkern][after].ratio
+ if origratio == nil then origratio = 0.5 end
+ jfm[before][glueorkern][after].ratio = (jfm[before][glueorkern][after][1] * origratio + space * ratio) / (jfm[before][glueorkern][after][1] + ratio)
+ jfm[before][glueorkern][after][1] = jfm[before][glueorkern][after][1] + space
+end
+
+if jlreq ~= nil then
+ if type(jlreq.open_bracket_pos) == "string" then
+ local r = jlreq.open_bracket_pos:find("_")
+ local danraku = jlreq.open_bracket_pos:sub(1,r - 1)
+ local orikaeshi = jlreq.open_bracket_pos:sub(r + 1)
+
+ -- 折り返し行頭の開き括弧を二分下げる……つもり
+ if orikaeshi == "nibu" then
+ -- widthを二分増やし,その代わりJFMグルーを二分減らす
+ jfm[1].width = jfm[1].width + 0.5
+ for k,v in pairs(jfm) do
+ if type(k) == "number" then
+ add_space(k,1,"glue",-0.5,1)
+ end
+ end
+ end
+
+ -- 段落行頭の下げ
+ if danraku == "zenkakunibu" then
+ add_space(90,1,"glue",0.5,1)
+ elseif danraku == "nibu" then
+ add_space(90,1,"glue",-0.5,1)
+ end
+ end
+
+ -- ぶら下げ組を有効にする.
+ if jlreq.burasage == true then
+ for _,class in ipairs({6,7}) do
+ table.insert(jfm[class].end_adjust,-0.5)
+ end
+ end
+end
+luatexja.jfont.define_jfm(jfm)