texlive[52169] Master/texmf-dist: jlreq (24sep19)
commits+karl at tug.org
commits+karl at tug.org
Tue Sep 24 22:05:50 CEST 2019
Revision: 52169
http://tug.org/svn/texlive?view=revision&revision=52169
Author: karl
Date: 2019-09-24 22:05:49 +0200 (Tue, 24 Sep 2019)
Log Message:
-----------
jlreq (24sep19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
trunk/Master/texmf-dist/doc/latex/jlreq/README.md
trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
trunk/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua
Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README-ja.md 2019-09-24 20:05:49 UTC (rev 52169)
@@ -1,450 +1,454 @@
-# 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`というよくあるオプションを受け付けます.
-
-標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.なお,本ドキュメントでは[日本語組版処理の要件](https://www.w3.org/TR/jlreq/ja/)における用語を断りなく使います.
-
-### `\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形式で行います.ただし,クラスオプションではLaTeXの実装により,本来可能な入力が受け付けられないがケースあります.多くの場合は空白を除くことにより解決します.
-
-以下では次の用法を使います.
-
-* `[A/B]`:AまたはBです.`[A/B/C]`等も同様.
-* `<寸法>`:TeXが認識する寸法です.簡単な式(`10pt+10pt`のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)`\jlreqsetup`内のような場所では,常に`\zw`や`\zh`により全角幅が記述できます.以下,たとえば`Q`が利用可能な場合は`<寸法;Q>`のように記述します.
- - `Q`:0.25mmと解釈されます.
- - `zw`, `zh`:全角幅として解釈されます.
-* `<コード>`:LaTeXのコードです.
-* `<フォント設定コード>`:`\Large`や`\bfseries`のようなフォント設定の命令です.`\Large\bfseries`のように複数指定することもできます.
-
-
-### 基本版面
-クラスオプションです.
-
-* `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`:ぶら下げ組をします.
-
-### 逆ノンブル
-クラスオプションです.
-* `use_reverse_pagination`:逆ノンブルの機能を利用可能にします.`jlreqreversepage`という「読み取り専用のカウンタ」が定義されます.(本物のカウンタではありません.)`\arabic`などの命令や`\value`が適用可能です.また`\thejlreqreversepage`が`\arabic{jlreqreversepage}`として定義されます.
-
-### 注関係
-`\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=\normalsize,table=\Large`とすると,table環境内では`\Large`が適用され,そのほかの環境内では`\normalsize`が適用されます.他の設定も同様です.
-* `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]`:キャプションの場所を指定します.
-
-### 引用
-`quote / quotation / verse`環境の挙動を`\jlreqsetup`で指定できます.
-* `quote_indent=<寸法>`:字下げを指定します.デフォルトは2\zwです.一行の長さが文字サイズの整数倍になるように調整されます.
-* `quote_end_indent=<寸法>`:字上げを指定します.デフォルトは0\zwです.
-* `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=<寸法>`:定理環境の前後の空きを指定します.
-
-### 前付きなど
-`\fontmatter` / `\mainmatter` / `\backmatter` / `\appendix`での処理を`\jlreqsetup`で指定できます.
-* `frontmatter_pagebreak=[cleardoublepage/clearpage/]`:`\frontmatter`実行時の改ページを実行する命令名を指定します.空にすると何もしません.
-* `frontmatter_counter={<カウンタ名>={value=<値>, the=<コード>, restore=[true/false]},...}`:`\frontmatter`時でのカウンタの操作を指定します.例えば`chapter={value=0,the={[\arabic{chapter]}}`とすると,`chapter`カウンタの値が`0`になり,`\thechapter`が`[\arabic{chapter}]`となります.デフォルトでは`\mainmatter`時に値と`\the<カウンタ名>`の定義を戻しますが,`restore=false`とするとこの動きが抑制されます.
-* `frontmatter_heading={<見出し命令名>={<設定>},...}`:見出し命令の動きを変更します.`\Delare***Heading`で指定できる項目の他以下を受け付けます.
- - `heading_type=[Tobira/Block/Runin/Cutin/Modify]`:見出しの種類です.`Modify`が指定された場合は`\ModifyHeading`での変更となります.
- - `heading_level=<数値>`:見出し命令のレベルを設定します.指定されなかった場合は,`\frontmatter`実行時の値が使われます.`heading_type=Modify`の時は無視されます.
- - `restore=[true/false]`:`true`が指定されると,`\mainmatter`で元の定義を復帰します.デフォルトは`true`です.
-* `frontmatter_pagestyle={<ページスタイル名>[,restore=[true/false]]}`:`\frontmatter`実行時にここで指定されたページスタイルへと切り替えます.デフォルトでは`\mainmatter`時にもとのページスタイルに戻しますが,`restore=false`を指定すると戻しません.
-* `frontmatter_pagination={<ページ番号指定>[,continuous,independent]}`:ページ番号の出力形式を,`frontmatter_pagination=roman`のようにLaTeXの命令名で指定します.更に`continuous`が指定されると通しノンブルとなります.`independent`で別ノンブルです.
-* `frontmatter_precode=<コード>`:`\frontmatter`時に最初に実行されるコードです.
-* `frontmatter_postcode=<コード>`:`\frontmatter`時に最後に実行されるコードです.
-
-`frontmatter`を`mainmatter`や`backmatter`,`appendix`へと変えた設定も存在します.ただし,以下のような違いがあります.
-* `restore=[true/false]`は無効な設定です.
-* `mainmatter_pagination`に`continuous`と`independent`は指定できません.
-* `appendix_pagebreak`,`appendix_pagestyle`,`appendix_pagination`はありません.
-
-
-## 見出し
-新しい見出しを`\New***Heading`という命令で作ることができます(***には見出しの種類に応じた文字列が入る).書式はすべて
-
-```
-\New***Heading{<命令名>}{<レベル>}{<設定>}
-```
-
-となっています.また,`\Renew***Heading`,`\Provide***Heading`,`\Declare***Heading`も同時に用意されます.それぞれ
-
-* `\Renew***Heading`:指定した名前の命令が定義されていなければエラー.
-* `\Provide***Heading`:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.
-* `\Declare***Heading`:指定した名前の命令が定義されているか否かによらず新しく見出し命令を定義する.
-
-となっています.
-
-### 扉見出し
-`\NewTobiraHeading`で作成します.通常のクラスファイルにおける`\section`等と同じ書式の命令ができます.設定は以下の通り.
-
-* `type=[han/naka]`:`han`だと半扉見出しを,`naka`だと中扉見出しを作ります.
-* `pagestyle=<ページスタイル名>`:見出し箇所のページスタイルを指定します.
-* `label_format=<コード>`:ラベルを出力する命令を指定します.たとえば`label_format={第\thechapter 章}`のように指定します.
-* `format=<コード>`:実際に出力する書式を指定します.`format={\null\vfil {\Huge\bfseries #1#2}}`のようにします.`#1`はラベルに,`#2`は見出し文字列に置き換えられます.この中では`\jlreqHeadingLabel`,`\jlreqHeadingText`という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば`format={[\jlreqHeadingLabel{Label=#1}]}`と指定されていれば,ラベルが空でない時には`[Label=<ラベル>]`を,そうでなければ`[]`を出力します.
-* `number=[true/false]`:採番を行うかを指定します.ただし,`number=false`の場合でも対応するカウンタは定義されます.また`\the<カウンタ名>`の変更もされないので,必要ならば再定義が必要になります.
-
-### 別行見出し
-`\NewBlockHeading`で作成します.`\<命令名>*[running head]{見出し文字列}[副題]`という書式の命令を作成します.設定は以下の通り.
-
-#### 書式関連
-* `font=<フォント設定コード>`:見出しのフォントを指定します.
-* `subtitle_font=<フォント設定コード>`:副題のフォントを指定します.
-* `label_format=<コード>`:ラベルのフォーマットを指定します.`label_format={第\thechapter 章}`などのようにします.
-* `subtitle_format=<コード>`:副題のフォーマットを指定します.`subtitle_format={「#1」}`のようにします.`#1`は副題自身に置き換えられます.
-* `format=<コード>`:見出し全体のフォーマットを指定します.`#1`がラベル,`#2`が見出し文字列,`#3`が副題に置き換えられます.内部では`\jlreqHeadingLabel`,`\jlreqHeadingText`,`\jlreqHeadingSubtitle`という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列,副題が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば`format={[\jlreqHeadingLabel{Label=#1}]}`と指定されていれば,ラベルが空でない時には`[Label=<ラベル>]`を,そうでなければ`[]`を出力します.なお,実際に`#1`が置き換えられるのはラベル自身ではなく,それに空きの調整などが入ったコードです.従って,予期しない結果を得ることもあり得ます.`#2`,`#3`も同様です.
-
-#### インデント関連
-* `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_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.`subtitle_break=true`の時のみ有効です.
-
-#### その他
-* `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`の時には無視されます.
-* `number=[true/false]`:採番を行うかを指定します.`\NewTobiraHeading`と同様の注意が必要です.
-
-#### 行取り
-行取りの指定は以下のいずれかの方法で行うことができます.
-
-* 行数を指定し,その中央に配置します.`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[<オプション>]{<引数>}…{<引数>}`という形のもののみが挟まれている場合は,見出しが連続していると判断されます.
-
-### 同行見出し
-`\NewRuninHeading`で作成します.通常の文書クラスにおける`\section`と同様の,`\<命令名>*[running head]{見出し文字列}`という書式の命令が作成されます.設定は以下の通り.
-
-* `font=<フォント設定コード>`:見出しのフォントを指定します.
-* `indent=<寸法>` 見出し文字列全体の字下げ量を指定します.
-* `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
-* `label_format=<コード>`:ラベルのフォーマットを指定します.`label_format={\theparagraph}`などのようにします.
-* `number=[true/false]':採番を行うかを指定します.`\NewTobiraHeading`と同様の注意が必要です.
-
-### 窓見出し
-`\NewCutinHeading`で作成します.`\<命令名>{見出し文字列}`という書式の命令を作成します.設定は以下の通り.
-
-* `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の中身を元に戻す.
-```
-のように使います.
-
-## ページスタイル
-```
-\NewPageStyle{<ページスタイル名>}{<設定>}
-```
-によりページスタイルを定義することができます.`<設定>`はkeyval形式です.定義したページスタイルは`\pagestyle`で適用できます.設定は以下の通り.
-
-* `yoko`:横書きで上下に出力します.デフォルト.
-* `tate`:縦書きで小口側に出力します.
-* `running_head_font=<フォント設定命令>`:柱のフォントを指定します.
-* `nombre_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_ii_font`でフォント設定もできます.指定方法は`nombre`や`nombre_position`と同じです.`odd_running_head_ii`,`even_running_head_ii`,`running_head_ii_position`,`running_head_ii_font`もあります.`nombre_ii_position`や`running_head_ii_position`が指定されなかった場合,`yoko`指定時にはそれぞれ`nombre_position`および`running_head_position`と同じ位置に設定されます.`tate`指定時は一つ目のノンブルや柱に続く場所に表示されます.
-
-
-`\RenewPageStyle`,`\ProvidePageStyle`,`\DeclarePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です.
-
-## JFM
-以下のような独自のJFMを使います.パッケージによっては,パッケージ独自のJFMや,また標準のJFMを使うように設定がし直される場合があります.本クラスファイルで使用するJFMを使う場合には,パッケージオプションなどを適切に与えて設定をする必要があります.
-
-### 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を使います.本クラスファイルは,LuaTeX-ja標準の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-08-08
- - `\DeclarePageStyle`に`nombre_ii`等を追加.
- - バグ修正.
- - `\jlreqsetup`に`footnote_second_indent`と`endnote_second_indent`を追加.
-* 2018-08-15
- - バグ修正.
-* 2018-09-01
- - `\mag`が`1000`でない場合も動くようにした(つもり).
- - バグ修正.
-* 2018-12-10
- - 見出し命令を作る命令に`number=[true/false]`を追加.
- - `\frontmatter`等の挙動を設定できるようにした.
- - `\jlreqHeadingLabel`等を扉見出しと別行見出しの`format`内で使えるようにした.
- - バグ修正
-* 2019-01-15
- - `\NewPageStyle`に`nombre_font`などを追加.`font`もまだ有効だが以降非推奨とする.
- - `\NewBlockHeading`の`format`に`#1`が含まれてもエラーが起こらないようにした.
- - `\jlreqsetup`の`caption_label_format`などを拡張.
- - バグ修正.
-* 2019-04-01
- - 逆ノンブルを利用可能にするクラスオプション`use_reverse_pagination`を追加.
- - `zref`パッケージの利用をやめた.
- - 新元号を追加.
- - バグ修正.
-* 2019-05-07
- - わずかな誤差で行数が減ってしまうのを防ぐために,`\textwidth`と`\textheight`を少しだけ増やした.
- - `\DeclarePageStyle`内の`running_head_ii`などの実装を変更.
- - バグ修正
-
-
---------------
-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`というよくあるオプションを受け付けます.
+
+標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.なお,本ドキュメントでは[日本語組版処理の要件](https://www.w3.org/TR/jlreq/ja/)における用語を断りなく使います.
+
+### `\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形式で行います.ただし,クラスオプションではLaTeXの実装により,本来可能な入力が受け付けられないがケースあります.多くの場合は空白を除くことにより解決します.
+
+以下では次の用法を使います.
+
+* `[A/B]`:AまたはBです.`[A/B/C]`等も同様.
+* `<寸法>`:TeXが認識する寸法です.簡単な式(`10pt+10pt`のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)`\jlreqsetup`内のような場所では,常に`\zw`や`\zh`により全角幅が記述できます.以下,たとえば`Q`が利用可能な場合は`<寸法;Q>`のように記述します.
+ - `Q`:0.25mmと解釈されます.
+ - `zw`, `zh`:全角幅として解釈されます.
+* `<コード>`:LaTeXのコードです.
+* `<フォント設定コード>`:`\Large`や`\bfseries`のようなフォント設定の命令です.`\Large\bfseries`のように複数指定することもできます.
+
+
+### 基本版面
+クラスオプションです.
+
+* `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`:ぶら下げ組をします.
+
+### 逆ノンブル
+クラスオプションです.
+* `use_reverse_pagination`:逆ノンブルの機能を利用可能にします.`jlreqreversepage`という「読み取り専用のカウンタ」が定義されます.(本物のカウンタではありません.)`\arabic`などの命令や`\value`が適用可能です.また`\thejlreqreversepage`が`\arabic{jlreqreversepage}`として定義されます.
+
+### 注関係
+`\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=\normalsize,table=\Large`とすると,table環境内では`\Large`が適用され,そのほかの環境内では`\normalsize`が適用されます.他の設定も同様です.
+* `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]`:キャプションの場所を指定します.
+
+### 引用
+`quote / quotation / verse`環境の挙動を`\jlreqsetup`で指定できます.
+* `quote_indent=<寸法>`:字下げを指定します.デフォルトは2\zwです.一行の長さが文字サイズの整数倍になるように調整されます.
+* `quote_end_indent=<寸法>`:字上げを指定します.デフォルトは0\zwです.
+* `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=<寸法>`:定理環境の前後の空きを指定します.
+
+### 前付きなど
+`\fontmatter` / `\mainmatter` / `\backmatter` / `\appendix`での処理を`\jlreqsetup`で指定できます.
+* `frontmatter_pagebreak=[cleardoublepage/clearpage/]`:`\frontmatter`実行時の改ページを実行する命令名を指定します.空にすると何もしません.
+* `frontmatter_counter={<カウンタ名>={value=<値>, the=<コード>, restore=[true/false]},...}`:`\frontmatter`時でのカウンタの操作を指定します.例えば`chapter={value=0,the={[\arabic{chapter]}}`とすると,`chapter`カウンタの値が`0`になり,`\thechapter`が`[\arabic{chapter}]`となります.デフォルトでは`\mainmatter`時に値と`\the<カウンタ名>`の定義を戻しますが,`restore=false`とするとこの動きが抑制されます.
+* `frontmatter_heading={<見出し命令名>={<設定>},...}`:見出し命令の動きを変更します.`\Delare***Heading`で指定できる項目の他以下を受け付けます.
+ - `heading_type=[Tobira/Block/Runin/Cutin/Modify]`:見出しの種類です.`Modify`が指定された場合は`\ModifyHeading`での変更となります.
+ - `heading_level=<数値>`:見出し命令のレベルを設定します.指定されなかった場合は,`\frontmatter`実行時の値が使われます.`heading_type=Modify`の時は無視されます.
+ - `restore=[true/false]`:`true`が指定されると,`\mainmatter`で元の定義を復帰します.デフォルトは`true`です.
+* `frontmatter_pagestyle={<ページスタイル名>[,restore=[true/false]]}`:`\frontmatter`実行時にここで指定されたページスタイルへと切り替えます.デフォルトでは`\mainmatter`時にもとのページスタイルに戻しますが,`restore=false`を指定すると戻しません.
+* `frontmatter_pagination={<ページ番号指定>[,continuous,independent]}`:ページ番号の出力形式を,`frontmatter_pagination=roman`のようにLaTeXの命令名で指定します.更に`continuous`が指定されると通しノンブルとなります.`independent`で別ノンブルです.
+* `frontmatter_precode=<コード>`:`\frontmatter`時に最初に実行されるコードです.
+* `frontmatter_postcode=<コード>`:`\frontmatter`時に最後に実行されるコードです.
+
+`frontmatter`を`mainmatter`や`backmatter`,`appendix`へと変えた設定も存在します.ただし,以下のような違いがあります.
+* `restore=[true/false]`は無効な設定です.
+* `mainmatter_pagination`に`continuous`と`independent`は指定できません.
+* `appendix_pagebreak`,`appendix_pagestyle`,`appendix_pagination`はありません.
+
+
+## 見出し
+新しい見出しを`\New***Heading`という命令で作ることができます(***には見出しの種類に応じた文字列が入る).書式はすべて
+
+```
+\New***Heading{<命令名>}{<レベル>}{<設定>}
+```
+
+となっています.また,`\Renew***Heading`,`\Provide***Heading`,`\Declare***Heading`も同時に用意されます.それぞれ
+
+* `\Renew***Heading`:指定した名前の命令が定義されていなければエラー.
+* `\Provide***Heading`:指定した名前の命令が定義されていない場合に限り見出し命令の定義が行われる.
+* `\Declare***Heading`:指定した名前の命令が定義されているか否かによらず新しく見出し命令を定義する.
+
+となっています.
+
+### 扉見出し
+`\NewTobiraHeading`で作成します.通常のクラスファイルにおける`\section`等と同じ書式の命令ができます.設定は以下の通り.
+
+* `type=[han/naka]`:`han`だと半扉見出しを,`naka`だと中扉見出しを作ります.
+* `pagestyle=<ページスタイル名>`:見出し箇所のページスタイルを指定します.
+* `label_format=<コード>`:ラベルを出力する命令を指定します.たとえば`label_format={第\thechapter 章}`のように指定します.
+* `format=<コード>`:実際に出力する書式を指定します.`format={\null\vfil {\Huge\bfseries #1#2}}`のようにします.`#1`はラベルに,`#2`は見出し文字列に置き換えられます.この中では`\jlreqHeadingLabel`,`\jlreqHeadingText`という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば`format={[\jlreqHeadingLabel{Label=#1}]}`と指定されていれば,ラベルが空でない時には`[Label=<ラベル>]`を,そうでなければ`[]`を出力します.
+* `number=[true/false]`:採番を行うかを指定します.ただし,`number=false`の場合でも対応するカウンタは定義されます.また`\the<カウンタ名>`の変更もされないので,必要ならば再定義が必要になります.
+
+### 別行見出し
+`\NewBlockHeading`で作成します.`\<命令名>*[running head]{見出し文字列}[副題]`という書式の命令を作成します.設定は以下の通り.
+
+#### 書式関連
+* `font=<フォント設定コード>`:見出しのフォントを指定します.
+* `subtitle_font=<フォント設定コード>`:副題のフォントを指定します.
+* `label_format=<コード>`:ラベルのフォーマットを指定します.`label_format={第\thechapter 章}`などのようにします.
+* `subtitle_format=<コード>`:副題のフォーマットを指定します.`subtitle_format={「#1」}`のようにします.`#1`は副題自身に置き換えられます.
+* `format=<コード>`:見出し全体のフォーマットを指定します.`#1`がラベル,`#2`が見出し文字列,`#3`が副題に置き換えられます.内部では`\jlreqHeadingLabel`,`\jlreqHeadingText`,`\jlreqHeadingSubtitle`という命令が利用可能です.いずれも引数を一つとる命令で,それぞれラベル,見出し文字列,副題が空ならば空に,そうでなければ与えられた引数自身を出力します.例えば`format={[\jlreqHeadingLabel{Label=#1}]}`と指定されていれば,ラベルが空でない時には`[Label=<ラベル>]`を,そうでなければ`[]`を出力します.なお,実際に`#1`が置き換えられるのはラベル自身ではなく,それに空きの調整などが入ったコードです.従って,予期しない結果を得ることもあり得ます.`#2`,`#3`も同様です.
+
+#### インデント関連
+* `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_indent=*1\zw`のように先頭に`*`をつけるとラベルの頭を起点としての指定になります.`subtitle_break=true`の時のみ有効です.
+
+#### その他
+* `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`の時には無視されます.
+* `number=[true/false]`:採番を行うかを指定します.`\NewTobiraHeading`と同様の注意が必要です.
+
+#### 行取り
+行取りの指定は以下のいずれかの方法で行うことができます.
+
+* 行数を指定し,その中央に配置します.`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[<オプション>]{<引数>}…{<引数>}`という形のもののみが挟まれている場合は,見出しが連続していると判断されます.
+
+### 同行見出し
+`\NewRuninHeading`で作成します.通常の文書クラスにおける`\section`と同様の,`\<命令名>*[running head]{見出し文字列}`という書式の命令が作成されます.設定は以下の通り.
+
+* `font=<フォント設定コード>`:見出しのフォントを指定します.
+* `indent=<寸法>` 見出し文字列全体の字下げ量を指定します.
+* `after_label_space=<寸法>`:ラベル後,見出し文字列までの空きを指定します.
+* `label_format=<コード>`:ラベルのフォーマットを指定します.`label_format={\theparagraph}`などのようにします.
+* `number=[true/false]':採番を行うかを指定します.`\NewTobiraHeading`と同様の注意が必要です.
+
+### 窓見出し
+`\NewCutinHeading`で作成します.`\<命令名>{見出し文字列}`という書式の命令を作成します.設定は以下の通り.
+
+* `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の中身を元に戻す.
+```
+のように使います.
+
+## ページスタイル
+```
+\NewPageStyle{<ページスタイル名>}{<設定>}
+```
+によりページスタイルを定義することができます.`<設定>`はkeyval形式です.定義したページスタイルは`\pagestyle`で適用できます.設定は以下の通り.
+
+* `yoko`:横書きで上下に出力します.デフォルト.
+* `tate`:縦書きで小口側に出力します.
+* `running_head_font=<フォント設定命令>`:柱のフォントを指定します.
+* `nombre_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_ii_font`でフォント設定もできます.指定方法は`nombre`や`nombre_position`と同じです.`odd_running_head_ii`,`even_running_head_ii`,`running_head_ii_position`,`running_head_ii_font`もあります.`nombre_ii_position`や`running_head_ii_position`が指定されなかった場合,`yoko`指定時にはそれぞれ`nombre_position`および`running_head_position`と同じ位置に設定されます.`tate`指定時は一つ目のノンブルや柱に続く場所に表示されます.
+
+
+`\RenewPageStyle`,`\ProvidePageStyle`,`\DeclarePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です.
+
+## JFM
+以下のような独自のJFMを使います.パッケージによっては,パッケージ独自のJFMや,また標準のJFMを使うように設定がし直される場合があります.本クラスファイルで使用するJFMを使う場合には,パッケージオプションなどを適切に与えて設定をする必要があります.
+
+### 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を使います.本クラスファイルは,LuaTeX-ja標準の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-08-08
+ - `\DeclarePageStyle`に`nombre_ii`等を追加.
+ - バグ修正.
+ - `\jlreqsetup`に`footnote_second_indent`と`endnote_second_indent`を追加.
+* 2018-08-15
+ - バグ修正.
+* 2018-09-01
+ - `\mag`が`1000`でない場合も動くようにした(つもり).
+ - バグ修正.
+* 2018-12-10
+ - 見出し命令を作る命令に`number=[true/false]`を追加.
+ - `\frontmatter`等の挙動を設定できるようにした.
+ - `\jlreqHeadingLabel`等を扉見出しと別行見出しの`format`内で使えるようにした.
+ - バグ修正
+* 2019-01-15
+ - `\NewPageStyle`に`nombre_font`などを追加.`font`もまだ有効だが以降非推奨とする.
+ - `\NewBlockHeading`の`format`に`#1`が含まれてもエラーが起こらないようにした.
+ - `\jlreqsetup`の`caption_label_format`などを拡張.
+ - バグ修正.
+* 2019-04-01
+ - 逆ノンブルを利用可能にするクラスオプション`use_reverse_pagination`を追加.
+ - `zref`パッケージの利用をやめた.
+ - 新元号を追加.
+ - バグ修正.
+* 2019-05-07
+ - わずかな誤差で行数が減ってしまうのを防ぐために,`\textwidth`と`\textheight`を少しだけ増やした.
+ - `\DeclarePageStyle`内の`running_head_ii`などの実装を変更.
+ - バグ修正
+* 2019-09-24
+ - `\@cite`と`\@biblabel`を再定義していたのをやめた.
+ - 別行見出しの前に`\allowbreak`を追加.
+ - バグ修正.
+
+
+--------------
+Noriyuki Abe
+https://github.com/abenori/jlreq
Modified: trunk/Master/texmf-dist/doc/latex/jlreq/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/README.md 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/README.md 2019-09-24 20:05:49 UTC (rev 52169)
@@ -1,122 +1,125 @@
-# 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` to generate JFM files. Move the files as follows:
-
-* *.tfm -> $TEXMF/fonts/tfm/public/jlreq
-* *.vf -> $TEXMF/fonts/vf/public/jlreq
-* jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq
-* jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq
-
-The other way to install is just to run `make install`. It will install all files in `$TEXMFHOME`.
-
-## Usage
-See [README-ja.md](README-ja.md) (in Japanese).
-
-## 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`.
-* 2018-08-15
- - Fixed bugs.
-* 2018-09-01
- - jlreq works with unusual `\mag`.
- - Fixed bugs.
-* 2018-12-10
- - Added `number=[true/false]` to `\New***Heading`.
- - Added options for `\frontmatter` etc in `\jlreqsetup`.
- - Made `\jlreqHeadingLabel` etc available in `format` in `\NewTobiraHeading` and `\NewBlockHeading`.
- - Fixed bugs.
-* 2019-01-15
- - Added `nombre_font` etc to `\NewPageStyle`. `font` is deprecated.
- - `format` without `#1` is allowed in `\NewBlockHeading`.
- - Extended `caption_label_format` etc. in `\jlreqsetup`.
- - Fixed bugs.
-* 2019-04-01
- - Added `use_reverse_pagination` to the class option.
- - Stopped to use `zref` package.
- - New regnal year.
- - Fixed bugs.
-* 2019-05-07
- - Added a small length to `\textwidth` and `\textheight'.
- - Changed the implementation of `running_head_ii` etc. in `\DeclarePageStyle`.
- - 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` to generate JFM files. Move the files as follows:
+
+* *.tfm -> $TEXMF/fonts/tfm/public/jlreq
+* *.vf -> $TEXMF/fonts/vf/public/jlreq
+* jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq
+* jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq
+
+The other way to install is just to run `make install`. It will install all files in `$TEXMFHOME`.
+
+## Usage
+See [README-ja.md](README-ja.md) (in Japanese).
+
+## 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`.
+* 2018-08-15
+ - Fixed bugs.
+* 2018-09-01
+ - jlreq works with unusual `\mag`.
+ - Fixed bugs.
+* 2018-12-10
+ - Added `number=[true/false]` to `\New***Heading`.
+ - Added options for `\frontmatter` etc in `\jlreqsetup`.
+ - Made `\jlreqHeadingLabel` etc available in `format` in `\NewTobiraHeading` and `\NewBlockHeading`.
+ - Fixed bugs.
+* 2019-01-15
+ - Added `nombre_font` etc to `\NewPageStyle`. `font` is deprecated.
+ - `format` without `#1` is allowed in `\NewBlockHeading`.
+ - Extended `caption_label_format` etc. in `\jlreqsetup`.
+ - Fixed bugs.
+* 2019-04-01
+ - Added `use_reverse_pagination` to the class option.
+ - Stopped to use `zref` package.
+ - New regnal year.
+ - Fixed bugs.
+* 2019-05-07
+ - Added a small length to `\textwidth` and `\textheight`.
+ - Changed the implementation of `running_head_ii` etc. in `\DeclarePageStyle`.
+ - Fixed bugs.
+* 2019-09-24
+ - Deleted the (re-)definitions of `\@cite` and `\@biblabel`.
+ - Added `\allowbreak` before block headings.
+ - Fixed bugs.
+
+--------------
+Noriyuki Abe
+https://github.com/abenori/jlreq
Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq-ja.html 2019-09-24 20:05:49 UTC (rev 52169)
@@ -102,9 +102,9 @@
<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>
+<div class="sourceCode" id="cb1"><pre class="sourceCode latex"><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></div>
<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>
+<div class="sourceCode" id="cb2"><pre class="sourceCode latex"><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></div>
<p>とします.</p>
<p>その他,<code>oneside / twoside / onecolumn / twocolumn / titlepage / notitlepage / draft / final / openright / openany / leqno / fleqn</code>というよくあるオプションを受け付けます.</p>
<p>標準的な文書クラスと同じように中身を書くことができますが,次のような命令が追加 / 拡張されています.なお,本ドキュメントでは<a href="https://www.w3.org/TR/jlreq/ja/">日本語組版処理の要件</a>における用語を断りなく使います.</p>
@@ -117,7 +117,7 @@
<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>
+<div class="sourceCode" id="cb3"><pre class="sourceCode latex"><code class="sourceCode latex"><a class="sourceLine" id="cb3-1" data-line-number="1">刊行できる<span class="fu">\sidenote</span>{原稿}{印刷などの方法により……}を入手する仕事である.</a></code></pre></div>
<p>とします.後の説明も参照してください.</p>
<h3 id="endnote"><code>\endnote</code></h3>
<p>後注を指定します.<code>\footnote</code>と同様の書式です.デフォルトでは,注自身の出力は見出し直前に行われます.この動作は<code>\jlreqsetup</code>に<code>endnote_position</code>を渡すことで制御できます.詳しくは後の注関係の説明をご覧ください.また<code>\theendnotes</code>を実行するとその場に出力をします.</p>
@@ -136,7 +136,7 @@
<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>
+<div class="sourceCode" id="cb5"><pre class="sourceCode latex"><code class="sourceCode latex"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="bu">\usepackage</span>[balance]{<span class="ex">nidanfloat</span>}</a></code></pre></div>
<p>とするとこの処理が行われます.ただし,最終ページでの<code>\newpage</code>や<code>\clearpage</code>が正しく動作しません.詳しくは<code>nidanfloat</code>パッケージのマニュアルをご覧ください.</p></li>
<li><p>フォントを設定する機能は有していません.和文フォントは,LuaLaTeX利用時は<code>luatexja-fontspec</code>や<code>luatexja-preset</code>(いずれもLuaTeX-jaパッケージに付属)により設定することができます.dvipdfmxを使う場合は,<a href="https://github.com/zr-tex8r/PXchfon">PXchfon</a>での設定が可能です.</p></li>
</ul>
@@ -305,10 +305,10 @@
</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>
+<div class="sourceCode" id="cb7"><pre class="sourceCode latex"><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>
+<a class="sourceLine" id="cb7-4" data-line-number="4">}</a></code></pre></div>
<p>のように使います.この意味は次の通りです.</p>
<ul>
<li><code>\part</code>,<code>\section</code>,<code>\subsection</code>という順番で見出しが掲げられていて,その前後が見出しでない場合は,<code>\part</code>は三行取り+前に一行空き,<code>\section</code>と<code>\subsection</code>は二行取りとなります.</li>
@@ -343,14 +343,14 @@
</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>
+<div class="sourceCode" id="cb8"><pre class="sourceCode latex"><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></div>
<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>
+<div class="sourceCode" id="cb9"><pre class="sourceCode latex"><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>
+<a class="sourceLine" id="cb9-4" data-line-number="4"><span class="fu">\restoresection</span> <span class="co">% \sectionの中身を元に戻す.</span></a></code></pre></div>
<p>のように使います.</p>
<h2 id="ページスタイル">ページスタイル</h2>
<pre><code>\NewPageStyle{<ページスタイル名>}{<設定>}
@@ -542,6 +542,12 @@
<li><code>\DeclarePageStyle</code>内の<code>running_head_ii</code>などの実装を変更.</li>
<li>バグ修正</li>
</ul></li>
+<li>2019-09-24
+<ul>
+<li><code>\@cite</code>と<code>\@biblabel</code>を再定義していたのをやめた.</li>
+<li>別行見出しの前に<code>\allowbreak</code>を追加.</li>
+<li>バグ修正.</li>
+</ul></li>
</ul>
<hr />
<p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p>
Modified: trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/doc/latex/jlreq/jlreq.html 2019-09-24 20:05:49 UTC (rev 52169)
@@ -211,10 +211,16 @@
</ul></li>
<li>2019-05-07
<ul>
-<li>Added a small length to <code>\textwidth</code> and `\textheight'.</li>
+<li>Added a small length to <code>\textwidth</code> and <code>\textheight</code>.</li>
<li>Changed the implementation of <code>running_head_ii</code> etc. in <code>\DeclarePageStyle</code>.</li>
<li>Fixed bugs.</li>
</ul></li>
+<li>2019-09-24
+<ul>
+<li>Deleted the (re-)definitions of <code>\@cite</code> and <code>\@biblabel</code>.</li>
+<li>Added <code>\allowbreak</code> before block headings.</li>
+<li>Fixed bugs.</li>
+</ul></li>
</ul>
<hr />
<p>Noriyuki Abe <a href="https://github.com/abenori/jlreq" class="uri">https://github.com/abenori/jlreq</a></p>
Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq-helpers.sty 2019-09-24 20:05:49 UTC (rev 52169)
@@ -60,7 +60,7 @@
% #1が\jlreq at endmarkか
\long\def\jlreq at ifendmark#1{\jlreq at iffirsttoken{#1}{\jlreq at endmark}}
-% 条件.\jlreq at if{ifnum\@count=1 \fi}{<TRUE>}{<FALSE>}みたいに使う
+% 条件.\jlreq at if{\ifnum\@count=1 \fi}{<TRUE>}{<FALSE>}みたいに使う
\def\jlreq at if@endmark{\jlreq at if@endmark}
\def\jlreq at if#1{\jlreq at if@#1\jlreq at if@endmark}
\@gobbletwo\if\if
@@ -383,11 +383,11 @@
% オレオレラベル……
% \jlreq at reference@ref{ラベル名}{デフォルト値}
-\def\jlreq at reference@ref#1{\jlreq at if{\expandafter\ifx\csname jlreq at reference@#1\endcsname\fi}{\csname jlreq at reference@#1\endcsname}}
+\def\jlreq at reference@ref#1{\jlreq at if{\expandafter\unless\expandafter\ifx\csname jlreq at reference@#1\endcsname\relax\fi}{\csname jlreq at reference@#1\endcsname}}
% \jlreq at reference@label{ラベル名}{値}
\def\jlreq at reference@label#1#2{\protected at write\@auxout{}{\string\@newl at bel{jlreq at reference}{#1}{#2}}}%
\def\jlreq at reference@immediate at write#1#2{\immediate\write\@auxout{\string\@newl at bel{jlreq at reference}{#1}{#2}}}%
-\def\jlreq at reference@ifexist#1{\jlreq at if{\expandafter\ifx\csname jlreq at reference@#1\endcsname\fi}}
+\def\jlreq at reference@ifexist#1{\jlreq at if{\expandafter\unless\expandafter\ifx\csname jlreq at reference@#1\endcsname\relax\fi}}
% 自動生成されるラベル用の番号
\newcount\jlreq at reference@count
Modified: trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/tex/latex/jlreq/jlreq.cls 2019-09-24 20:05:49 UTC (rev 52169)
@@ -1,5877 +1,5890 @@
-%% 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}[2019/05/07 jlreq]
-\RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
-\RequirePackage{jlreq-helpers}
-
-\newcommand*{\jlreq at undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
-% クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
-\newcommand*{\jlreq at aftercls@addtodeletecs}[1]{%
- \appto\jlreq at aftercls@deletecslist{\jlreq at helper@undefcs{#1}{\jlreq at undeferr}}%
-}
-\newcommand*{\jlreq at aftercls@addtodeleteif}[1]{%
- \appto\jlreq at aftercls@deletecslist{\jlreq at helper@undefif{#1}{\jlreq at undeferr}}%
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeletecs}
-\jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeleteif}
-\AtEndOfClass{%
- \jlreq at aftercls@deletecslist
- \jlreq at helper@undefcs{\jlreq at aftercls@deletecslist}{\jlreq at undeferr}%
- \undef{\jlreq at undeferr}%
-}
-
-% preambleにいるかのスイッチ
-\newif\ifjlreq at preamble
-\jlreq at preambletrue
-\AtBeginDocument{\jlreq at preamblefalse}
-
-\def\jlreq at saveoriginalcs#1{%
- \ifx#1\relax
- \ClassError{jlreq}{Trying to save \string#1 but it's not defined, may be a bug}{\@ehc}%
- \fi
- \expandafter\ifx\csname jlreq at 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 at original@\expandafter\@gobble\string#1\endcsname=#1
-}
-\def\jlreq at useoriginalcs#1{%
- \jlreq at if{\ifcsname jlreq at original@\expandafter\@gobble\string#1\endcsname\fi}%
- {\csname jlreq at original@\expandafter\@gobble\string#1\endcsname}%
- {#1}%
-}
-
-%. オプションの定義
-% オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する)
-% ものは\jlreq at option@<key>に格納する.
-% _とかは@に変換する.
-% 引数無しの\DeclareOptionX
-\newcommand*{\jlreq at DeclareOption}[2]{%
- \DeclareOptionX{#1}{%
- \jlreq at ifempty{##1}{}{\ClassError{jlreq}{The option #1 should have no value}{\@ehc}}%
- #2%
- }
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at DeclareOption}
-% エンジン類
-\jlreq at DeclareOption{uplatex}{\let\jlreq at engine=u}
-\jlreq at DeclareOption{platex}{\let\jlreq at engine=p}
-\jlreq at DeclareOption{lualatex}{\let\jlreq at engine=l}
-
-% 文書のタイプ
-\newcommand*\jlreq at article@type{article}
-\define at choicekey{jlreq.cls}{article_type}{article,report,book}{\renewcommand*{\jlreq at article@type}{#1}}
-\jlreq at DeclareOption{article}{\renewcommand*{\jlreq at article@type}{article}}
-\jlreq at DeclareOption{report}{\renewcommand*{\jlreq at article@type}{report}}
-\jlreq at DeclareOption{book}{\renewcommand*{\jlreq at article@type}{book}}
-
-%.. 基本版面.まずは紙サイズ.
-\def\jlreq at switchpapersize{}
-\jlreq at aftercls@addtodeletecs{\jlreq at switchpapersize}
-% \jlreq at addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦}
-
-\def\jlreq at addpapersize#1#2{%
- \@ifnextchar[{\jlreq at addpapersize@{#1}{#2}}{\jlreq at addpapersize@@{#1}{#2}}%
-}
-\def\jlreq at addpapersize@#1#2[#3]{%
- \edef\@tempa{\unexpanded{\jlreq at addpapersize@@{#1}{#2}}\csexpandonce{jlreq at helper@papersizelist@#3}}%
- \@tempa
-}
-\newcommand*{\jlreq at addpapersize@@}[4]{%
- \@for\@tempa:=#1\do{%
- \eappto\jlreq at switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}%
- }%
- \@for\@tempa:=#2\do{%
- \expandafter\jlreq at DeclareOption\expandafter{\@tempa}{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}%
- }%
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize}
-\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize@}
-\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize@@}
-\DeclareOptionX{paper}{
- \edef\jlreq at do{%
- \unexpanded{\jlreq at switch{#1}}{\expandonce{\jlreq at switchpapersize}}%
- [\unexpanded{%
- \jlreq at helper@dividebycomma{#1}%
- \ifjlreq at result
- \setlength{\paperwidth}{\dimexpr\jlreq at resulta\relax}%
- \setlength{\paperheight}{\dimexpr\jlreq at resultb\relax}%
- \else
- \ClassError{jlreq}{The paper #1 is unknown}{\@ehc}%
- \fi
- }]%
- }%
- \jlreq at do
-}
-% 紙サイズ一覧.b*はJIS B.
-\jlreq at addpapersize{a0,A0}{}[a0]
-\jlreq at addpapersize{a1,A1}{}[a1]
-\jlreq at addpapersize{a2,A2}{}[a2]
-\jlreq at addpapersize{a3,A3}{a3paper}[a3]
-\jlreq at addpapersize{a4,A4}{a4paper}[a4]
-\jlreq at addpapersize{a5,A5}{a5paper}[a5]
-\jlreq at addpapersize{a6,A6}{a6paper}[a6]
-\jlreq at addpapersize{a7,A7}{}[a7]
-\jlreq at addpapersize{a8,A8}{}[a8]
-\jlreq at addpapersize{a9,A9}{}[a9]
-\jlreq at addpapersize{a10,A10}{}[a10]
-
-\jlreq at addpapersize{b0,B0}{}[b0]
-\jlreq at addpapersize{b1,B1}{}[b1]
-\jlreq at addpapersize{b2,B2}{}[b2]
-\jlreq at addpapersize{b3,B3}{}[b3]
-\jlreq at addpapersize{b4,B4}{b4paper}[b4]
-\jlreq at addpapersize{b5,B5}{b5paper}[b5]
-\jlreq at addpapersize{b6,B6}{b6paper}[b6]
-\jlreq at addpapersize{b7,B7}{}[b7]
-\jlreq at addpapersize{b8,B8}{}[b8]
-\jlreq at addpapersize{b9,B9}{}[b9]
-\jlreq at addpapersize{b10,B10}{}[b10]
-
-\jlreq at addpapersize{c2,C2}{}[c2]
-\jlreq at addpapersize{c3,C3}{}[c3]
-\jlreq at addpapersize{c4,C4}{}[c4]
-\jlreq at addpapersize{c5,C5}{}[c5]
-\jlreq at addpapersize{c6,C6}{}[c6]
-\jlreq at addpapersize{c7,C7}{}[c7]
-\jlreq at addpapersize{c8,C8}{}[c8]
-
-\jlreq at addpapersize{a4var}{}[a4var]
-\jlreq at addpapersize{b5var}{}[b5var]
-
-\jlreq at addpapersize{letter}{letterpaper}[letter]
-\jlreq at addpapersize{legal}{legalpaper}[legal]
-\jlreq at addpapersize{executive}{executivepaper}[executive]
-\jlreq at addpapersize{hagaki}{}[hagaki]
-
-
-%.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a)
-\newcommand*{\jlreq at option@fontsize}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@fontsize}
-\DeclareOptionX{fontsize}{\renewcommand*{\jlreq at option@fontsize}{#1}}
-\jlreq at DeclareOption{10pt}{\renewcommand*{\jlreq at option@fontsize}{10pt}}
-\jlreq at DeclareOption{11pt}{\renewcommand*{\jlreq at option@fontsize}{11pt}}
-\jlreq at DeclareOption{12pt}{\renewcommand*{\jlreq at option@fontsize}{12pt}}
-\newcommand*{\jlreq at option@jafontsize}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@jafontsize}
-\DeclareOptionX{jafontsize}{\renewcommand*{\jlreq at option@jafontsize}{#1}}
-\newcommand*{\jlreq at option@jafontscale}{1}
-\DeclareOptionX{jafontscale}{\renewcommand*{\jlreq at option@jafontscale}{#1}}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@jafontscale}
-%.. 行の長さ
-\newcommand*{\jlreq at option@line at length}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@line at length}
-\DeclareOptionX{line_length}{\renewcommand*{\jlreq at option@line at length}{#1}}
-%.. 1ページあたりの行数
-\newcommand*{\jlreq at option@number at of@lines}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@number at of@lines}
-\DeclareOptionX{number_of_lines}{\renewcommand*{\jlreq at option@number at of@lines}{#1}}
-
-% 地の空き量,のどの空き量で配置位置を決める(2.4.1.b)省略されたら中央配置.
-%.. 天
-\newcommand*{\jlreq at option@head at space}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@head at space}
-\DeclareOptionX{head_space}{\renewcommand*{\jlreq at option@head at space}{#1}}
-
-%.. 地
-\newcommand*{\jlreq at option@foot at space}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@foot at space}
-\DeclareOptionX{foot_space}{\renewcommand*{\jlreq at option@foot at space}{#1}}
-%.. のど
-\newcommand*{\jlreq at option@gutter}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@gutter}
-\DeclareOptionX{gutter}{\renewcommand*{\jlreq at option@gutter}{#1}}
-%.. 小口
-\newcommand*{\jlreq at option@fore at edge}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@fore at edge}
-\DeclareOptionX{fore_edge}{\renewcommand*{\jlreq at option@fore at edge}{#1}}% 昔にこっちにしていたので残している
-\DeclareOptionX{fore-edge}{\renewcommand*{\jlreq at option@fore at edge}{#1}}
-
-%.. 柱とノンブル
-\newcommand*{\jlreq at option@headfoot at verticalpos}{}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@headfoot at verticalpos}
-% 本文とヘッダ/フッタの間の空き
-\DeclareOptionX{headfoot_verticalposition}{\renewcommand*{\jlreq at option@headfoot at verticalpos}{#1}}
-% 柱やノンブルの左右の空き
-\newcommand*{\jlreq at headfoot@sidemargin}{0pt}
-\DeclareOptionX{headfoot_sidemargin}{\renewcommand*{\jlreq at headfoot@sidemargin}{#1}}
-
-%.. 段間
-\newcommand*{\jlreq at option@column at gap}{2zw}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@column at gap}
-\DeclareOptionX{column_gap}{\renewcommand*{\jlreq at option@column at gap}{#1}}
-
-%.. 行送り,指定無しの場合は文字サイズの1.7倍とする.(1.5から2倍が好ましい:2.4.2.d 注3)
-\newcommand*{\jlreq at option@baselineskip}{17zw/10}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@baselineskip}
-\DeclareOptionX{baselineskip}{\def\jlreq at option@baselineskip{#1}}
-\DeclareOptionX{linegap}{\def\jlreq at option@baselineskip{1zw + #1}}
-
-%.. 組み方系
-% 行頭に括弧が来たときの配置:3.1.5
-% 段落頭指定_折り返し行頭指定 で与える.
-\newcommand*{\jlreq at open@bracket at pos}{zenkaku_tentsuki}
-\define at choicekey{jlreq.cls}{open_bracket_pos}{zenkaku_tentsuki,zenkakunibu_nibu,nibu_tentsuki}{\renewcommand*{\jlreq at open@bracket at pos}{#1}}
-% ぶら下げ組みをするか:3.8.2 注1
-\newif\ifjlreq at burasage\jlreq at burasagefalse
-\jlreq at DeclareOption{hanging_punctuation}{\jlreq at burasagetrue}
-
-%.. 注
-% 傍注のタイプ
-\newcommand*{\jlreq at option@sidenote at length}{0pt}
-\jlreq at aftercls@addtodeletecs{\jlreq at option@sidenote at length}
-\DeclareOptionX{sidenote_length}{\renewcommand*{\jlreq at option@sidenote at length}{#1}}
-
-%.. 逆ノンブル
-\newif\ifjlreq at option@use at reverse@pagination
-\jlreq at aftercls@addtodeleteif{\ifjlreq at option@use at reverse@pagination}
-\jlreq at option@use at reverse@paginationfalse
-\jlreq at DeclareOption{use_reverse_pagination}{\jlreq at option@use at reverse@paginationtrue}
-
-%.. もろもろ
-\newif\if at restonecol\@restonecolfalse
-\newif\if at titlepage\@titlepagefalse
-\newif\if at landscape\@landscapefalse
-\newif\if at tate \@tatefalse
-\newif\ifjlreq at option@titlepage \jlreq at option@titlepagefalse % titlepageかnotitlepageかが指定された
-\jlreq at aftercls@addtodeleteif{\ifjlreq at option@titlepage}
-\jlreq at DeclareOption{landscape}{\@landscapetrue}
-\jlreq at DeclareOption{tombo}{\ClassWarningNoLine{jlreq}{The option `tombo' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
-\jlreq at DeclareOption{tombow}{\ClassWarningNoLine{jlreq}{The option `tombow' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
-\jlreq at DeclareOption{mentuke}{\ClassWarningNoLine{jlreq}{The option `mentuke' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
-\jlreq at DeclareOption{tate}{\@tatetrue}
-
-\newif\ifjlreq at option@twoside\jlreq at option@twosidefalse % onesideかtwosideが指定された
-\jlreq at aftercls@addtodeleteif{\ifjlreq at option@twoside}
-\jlreq at DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse\jlreq at option@twosidetrue}
-\jlreq at DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue\jlreq at option@twosidetrue}
-\jlreq at DeclareOption{onecolumn}{\@twocolumnfalse}
-\jlreq at DeclareOption{twocolumn}{\@twocolumntrue}
-\jlreq at DeclareOption{titlepage}{\jlreq at option@titlepagetrue\@titlepagetrue}
-\jlreq at DeclareOption{notitlepage}{\jlreq at option@titlepagetrue\@titlepagefalse}
-\jlreq at DeclareOption{draft}{\setlength\overfullrule{5pt}}
-\jlreq at DeclareOption{final}{\setlength\overfullrule{0pt}}
-\newif\if at openright
-\newif\ifjlreq at option@open \jlreq at option@openfalse % openrightかopenanyが指定された
-\jlreq at aftercls@addtodeleteif{\ifjlreq at option@open}
-\jlreq at DeclareOption{openright}{\@openrighttrue\jlreq at option@opentrue}
-\jlreq at DeclareOption{openany}{\@openrightfalse\jlreq at option@opentrue}
-\jlreq at DeclareOption{leqno}{\input{leqno.clo}}
-\jlreq at DeclareOption{fleqn}{\input{fleqn.clo}}
-\newif\ifjlreq at option@enablejfam \jlreq at option@enablejfamtrue
-\jlreq at aftercls@addtodeleteif{\ifjlreq at option@enablejfam}
-\jlreq at DeclareOption{disablejfam}{\jlreq at option@enablejfamfalse}
-
-\newcommand*{\jlreq at note}[1]{}
-\jlreq at DeclareOption{jlreq_notes}{\renewcommand*{\jlreq at note}[1]{\message{^^JJLReq note: ##1^^J}}}
-
-\ExecuteOptionsX{article_type=article,paper=a4,open_bracket_pos=zenkaku_tentsuki,onecolumn,final}
-% \@removeelementを一旦置き換えてから\ProcessOptionsXを実行する
-\let\jlreq at temporary@original@@removeelement=\@removeelement
-\let\@removeelement=\jlreq at helper@removeelement
-\ProcessOptionsX\relax
-\let\@removeelement=\jlreq at temporary@original@@removeelement
-\let\jlreq at temporary@original@@removeelement=\@undefined
-
-\ifjlreq at option@titlepage\else
- \ifthenelse{\equal{\jlreq at article@type}{article}}{\@titlepagefalse}{\@titlepagetrue}
-\fi
-\ifjlreq at option@open\else
- \ifthenelse{\equal{\jlreq at article@type}{book}}{\@openrighttrue}{\@openrightfalse}
-\fi
-% articleではopenrightは効かない.
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
- \if at openright
- \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article}
- \@openrightfalse
- \fi
-}{}
-\ifjlreq at option@twoside\else
- \ifthenelse{\equal{\jlreq at article@type}{book}}{\@twosidetrue}{\@twosidefalse}
-\fi
-
-\def\jlreq at jlreqsetup@keyvallist{}
-\def\jlreq at jlreqsetup@finally{}
-\newcommand{\jlreqsetup}[1]{%
- \begingroup
- \edef\jlreq at do{\unexpanded{\jlreq at parsekeyval[jlreqsetup]}{\expandonce{\jlreq at jlreqsetup@keyvallist}}}%
- \expandafter\endgroup
- \jlreq at do{#1}%
- \jlreq at jlreqsetup@finally
-}
-% \jlreqsetupの項目に加えるマクロ.\jlreq at jlreqsetup@add{key}{action}とするとkeyに対して定義できる.
-% action内ではvalが#1として取得できる.(従ってaction内でマクロを定義する際には##1を使う必要がある.)
-\newcommand{\jlreq at jlreqsetup@add}[1]{%
- \@ifnextchar[{\jlreq at jlreqsetup@add@{#1}}{\jlreq at jlreqsetup@add@@{#1}}%
-}
-\long\def\jlreq at jlreqsetup@add@#1[#2]#3{%
- \eappto\jlreq at jlreqsetup@keyvallist{\unexpanded{{#1}[#2]{#3}}}%
-}
-\long\def\jlreq at jlreqsetup@add@@#1#2{%
- \eappto\jlreq at jlreqsetup@keyvallist{\unexpanded{{#1}{#2}}}%
-}
-% \jlreqsetupの最後に必ず実行される処理を入れる.
-\newcommand\jlreq at jlreqsetup@addtofinally[1]{\eappto\jlreq at jlreqsetup@finally{\unexpanded{#1}}}
-\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@add}
-\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@add@}
-\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@add@@}
-\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@addtofinally}
-\@onlypreamble\jlreqsetup
-
-% エンジンの設定
-\ifx\jlreq at engine\@undefined
- \jlreq at helper@guessengine
- \let\jlreq at engine=\jlreq at result
-\fi
-
-
-% 必要パッケージのロード
-\ifx l\jlreq at engine
- \ifjlreq at option@enablejfam
- \RequirePackage{luatexja}
- \else
- \RequirePackage[disablejfam]{luatexja}
- \fi
- \directlua{jlreq = {}}
-\fi
-
-% (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので,
-% これ以前には和文は使えない.
-\ifx l\jlreq at 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 at tate\AtEndPreamble{\par}\fi
-\fi
-\if at tate
- \AtBeginDocument{\tate\message{《縦組モード》}\adjustbaseline}
-\fi
-
-% \jlreq at gol(Gyo Okuri Length), \jlreq at mol (Moji Okuri Length)を定義
-\let\jlreq at gol=\zh
-\let\jlreq at mol=\zw
-
-%. helper2(エンジン依存系:和文文字を含むものもこれ以降)
-% #1のboxを今の真ん中に配置する.
-\def\jlreq at box@putcenter#1{%
- \begingroup
- \jlreq at tempdima=\dimexpr(\ht#1 - \dp#1)/2\relax
- \setbox\jlreq at tempboxa=\hbox{阿}%
- \edef\jlreq at do{%
- \noexpand\lower\the\dimexpr(\jlreq at tempdima - (\ht\jlreq at tempboxa - \dp\jlreq at tempboxa)/2)\relax\unexpanded{\box#1}%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-% #1の先頭が文字か
-\long\def\jlreq at ifletter#1{%
- \jlreq at iffirsttoken{#1}{ }{\@secondoftwo}{%
- \expandafter\expandafter\expandafter\jlreq at helper@ifletter\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@
- }%
-}
-
-\long\def\jlreq at helper@ifletter#1{%
- \jlreq at if{%
- \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
- \fi}%
-}
-
-
-% 組方向を判定
-% \jlreq at if(y|t)(dir|box)を定義する.
-\jlreq at if{\ifx l\jlreq at engine\fi}{
- \def\jlreq at ifydir{\jlreq at if{\ifnum\ltjgetparameter{direction}=4 \fi}}
- \def\jlreq at iftdir{\jlreq at if{\ifnum\numexpr\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8\relax=3 \fi}}
- \def\jlreq at ifybox#1{\jlreq at if{\ifnum\ltjgetparameter{boxdir}{#1}=4 \fi}}
- \def\jlreq at iftbox#1{\jlreq at if{\ifnum\numexpr\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8\relax=3 \fi}}
-}{
- \def\jlreq at ifydir{\jlreq at if{\ifydir\fi}}
- \def\jlreq at iftdir{\jlreq at if{\iftdir\fi}}
- \def\jlreq at ifybox#1{\jlreq at if{\ifybox#1\fi}}
- \def\jlreq at iftbox#1{\jlreq at if{\iftbox#1\fi}}
-}
-
-% 左ページであるか
-% #1 : odd or even or ページ数
-\def\jlreq at 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 at engine
- \newcommand*{\jlreq at getpostbreakpenalty}[1]{\ltjgetparameter{postbreakpenalty}{#1}}
-\else
- \newcommand*{\jlreq at getpostbreakpenalty}[1]{\postbreakpenalty#1}
-\fi
-
-% 現在行の残りを得る.
-\ifx l\jlreq at engine
- % 以下のコードはLuaTeX-jaのバグ?に依存している
- % https://ja.osdn.net/projects/luatex-ja/ticket/36489
- \newcommand*{\jlreq at calc@current at linewidth@onecolumn}{%
- \dimexpr
- \jlreq at reference@ref{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{0} sp - \@totalleftmargin -
- \ifodd\jlreq at currentpage
- \oddsidemargin
- \else
- \evensidemargin
- \fi
- \iftombow -1in \fi
- - \pdfvariable horigin - \hoffset
- \relax
- }
-\else
- % トンボ出力時にはjlreq-trimmarksであることを仮定する.
- % 新しいpLaTeXに対しては,jlreq-trimmarksは内部の1inを1trueinに書き換える
- \@ifundefined{@tombowreset@@paper}{
- \def\jlreq at tombow@adjust{\iftombow -1in \fi}
- }{
- \def\jlreq at tombow@adjust{\iftombow -1truein \fi}
- }
- \newcommand*{\jlreq at calc@current at linewidth@onecolumn}{%
- \dimexpr
- \jlreq at ifydir{%
- \jlreq at reference@ref{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{0} sp - \hoffset
- \ifodd\jlreq at currentpage
- - \oddsidemargin
- \else
- - \evensidemargin
- \fi
- }{%
- \ifdim\pdfpagewidth=0pt
- \paperheight
- \else
- \pdfpageheight
- \fi
- - \topmargin - \headheight - \headsep - \voffset
- - \jlreq at reference@ref{jlreq at rest@width.pos.Y.\the\jlreq at reference@count}{0} sp
- }%
- \jlreq at tombow@adjust
- - \@totalleftmargin - 1in
- \relax
- }
-\fi
-\newcommand*{\jlreq at calc@current at linewidth}{%
- \dimexpr\jlreq at calc@current at linewidth@onecolumn
- \if at twocolumn
- \ifdim\jlreq at calc@current at linewidth@onecolumn<\dimexpr\linewidth+\columnsep\relax\else
- - \linewidth - \columnsep
- \fi
- \fi
- \relax
-}
-
-\newdimen\jlreq at current@linewidth
-\newdimen\jlreq at rest@linewidth
-% この命令以降,次にこの命令を実行する前まで\jlreq at current@linewidth/\jlreq at rest@linewidthで
-% この行の行頭からの長さ/残りの長さが取得できる
-\jlreq at ifprimitive{\pdfsavepos}{\jlreq at tempatrue}{\jlreq at tempafalse}
-\edef\jlreq at savepos@for at rest@linewidth{\unexpanded{%
- \jlreq at setcurrentpage
- \global\advance\jlreq at reference@count by 1
- }%
- \ifjlreq at tempa
- \unexpanded{%
- \pdfsavepos
- \jlreq at reference@label{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{\noexpand\the\noexpand\pdflastxpos}%
- \jlreq at reference@label{jlreq at rest@width.pos.Y.\the\jlreq at reference@count}{\noexpand\the\noexpand\pdflastypos}%
- }%
- \else
- \unexpanded{%
- \savepos
- \jlreq at reference@label{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{\noexpand\the\noexpand\lastxpos}%
- \jlreq at reference@label{jlreq at rest@width.pos.Y.\the\jlreq at reference@count}{\noexpand\the\noexpand\lastypos}%
- }%
- \fi
- \unexpanded{%
- \global\jlreq at current@linewidth=\jlreq at calc@current at linewidth
- \global\jlreq at rest@linewidth=\dimexpr\linewidth - \jlreq at current@linewidth\relax
- \edef\jlreq at savepos@iflabelundefined{\jlreq at reference@ifexist{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
- }%
-}
-
-\ifx l\jlreq at engine
- \newcommand*{\lastnodechar}{\directlua{luatexja.pltx_composite_last_node_char()}}% undocumentedな機能を使っている
-\fi
-
-% #1と#2の間に入るjmglue((x)kanjiskipも)を\jlreq at resultskipに入れる
-\ifx l\jlreq at engine
- \newcommand*{\jlreq at calc@jfmglue}[2]{%
- \begingroup
- \setbox\jlreq at tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
- \setbox\jlreq at tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
- \edef\jlreq at do{\noexpand\jlreq at resultskip=\the\dimexpr\wd\jlreq at tempboxb - \wd\jlreq at tempboxa\relax\noexpand\relax}%
- \jlreq at do
- \directlua{
- local width = 0
- local stretch = 0
- local shrink = 0
- local n = tex.box["jlreq at 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 at tempskipa",width,stretch,shrink)
- }%
- % TeXで計測した物と一致していなければTeXでの方を信じる
- \ifdim\jlreq at resultskip=\jlreq at tempskipa
- \edef\jlreq at do{\noexpand\jlreq at resultskip=\the\jlreq at tempskipa\relax}%
- \fi
- \expandafter\endgroup
- \jlreq at do
- }
-\else
- \newcommand*{\jlreq at calc@jfmglue}[2]{%
- \begingroup
- \setbox\jlreq at tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
- \setbox\jlreq at tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
- \edef\jlreq at do{\noexpand\jlreq at resultskip=\the\dimexpr\wd\jlreq at tempboxb - \wd\jlreq at tempboxa\relax\noexpand\relax}%
- \expandafter\endgroup
- \jlreq at do
- }
-\fi
-
-\newcount\jlreq at lastnodechar
-% \jlreq at fixjfm<次の文字>の形で使う.
-% jlreq at lastnodecharに入っている値と次のトークン(\futureletで得る)の間に入るJFMグルー等を挿入する
-\newcommand*{\jlreq at fixjfm}{%
- \begingroup
- \ifnum\jlreq at lastnodechar>-1
- \def\jlreq at do{\futurelet\jlreq at nextchar\jlreq at insertjfm}%
- \else\def\jlreq at do{}\fi
- \expandafter\endgroup
- \jlreq at do
-}
-% \jlreq at nextcharと\jlreq at lastnodecharの間のJFMグルーを挿入
-\def\jlreq at insertjfm{%
- \ifnum\jlreq at getpostbreakpenalty{\jlreq at lastnodechar}=0\else\penalty\jlreq at getpostbreakpenalty{\jlreq at lastnodechar}\fi
- \begingroup
- \def\jlreq at do{}%
- \jlreq at getfirsttoken@expandmacros{\jlreq at nextchar}{\jlreq at tempa}%
- \expandafter\jlreq at ifletter\expandafter{\jlreq at tempa}{%
- \jlreq at calc@jfmglue{\char\jlreq at lastnodechar}{\jlreq at tempa}%
-% \message{fixjfm Insert: \the\jlreq at resultskip}%
- \edef\jlreq at do{%
- \noexpand\hskip\the\jlreq at resultskip\space
- \noexpand\inhibitglue
- }%
- }{}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\ifx l\jlreq at engine
- \newcommand*{\jlreq at divide}[2]{%
- \jlreq at resultdimen=\directlua{tex.print(tostring(\strip at pt\dimexpr #1\relax/\strip at pt\dimexpr #2\relax) .. "pt ")}%
- }
-\else
- \let\jlreq at divide=\jlreq at helper@divide
-\fi
-
-%. 基本設定
-\providecommand*{\jlreqkanjiskip}{0pt plus 0.25\zw minus 0pt}
-\providecommand*{\jlreqxkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
-\ifx l\jlreq at engine
- \ltjsetparameter{kanjiskip=\jlreqkanjiskip}
- \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip}
-\else
- \kanjiskip=\jlreqkanjiskip
- \xkanjiskip=\jlreqxkanjiskip
-\fi
-
-% 文字クラスのリスト(必要なものだけ)
-% 開き括弧(文字クラス1)
-\edef\jlreq at charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq at engine\else ⦅〘〖«〝\fi}
-% 閉じ括弧(文字クラス2)
-\edef\jlreq at charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq at engine\else ⦆〙〗»〟\fi}
-% ハイフン(文字クラス3)
-\edef\jlreq at charlist@hyphens{‐〜\ifx p\jlreq at engine\else ゠–\fi}
-% 区切り約物(文字クラス4)
-\edef\jlreq at charlist@dividingpunctuationmarks{!?\ifx p\jlreq at engine\else ‼⁇⁈⁉\fi}
-% 中点類(文字クラス5)
-\edef\jlreq at charlist@middlenodes{・:;}
-% 句点類(文字クラス6)
-\edef\jlreq at charlist@fullstops{。.}
-% 読点類(文字クラス7)
-\edef\jlreq at charlist@commas{、,}
-% 分離禁止文字(文字クラス8)
-\edef\jlreq at charlist@inseparablecharacters{—…‥\ifx p\jlreq at engine\else 〳〴〵\fi}
-% 繰返し記号(文字クラス9)
-\edef\jlreq at charlist@iterationmarks{ヽヾゝゞ々\ifx p\jlreq at engine\else 〻\fi}
-% 長音記号(文字クラス10)
-\edef\jlreq at charlist@prolongedsoundmark{ー}
-% 小書きの仮名(文字クラス11)
-\edef\jlreq at charlist@smallkana{ぁぃぅぇぉァィゥェォっゃゅょゎッャュョヮヵヶ\ifx p\jlreq at engine\else ゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ\fi}%ㇷ゚
-% 前置省略記号(文字クラス12)
-\edef\jlreq at charlist@prefixedabbreviations{¥$£#\ifx p\jlreq at engine\else €№\fi}
-% 平仮名(文字クラス15)
-\edef\jlreq at charlist@hiragana{あいうえおかがきぎくぐけげこごさざしじすずせぜそぞただちぢつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもやゆよらりるれろわゐゑをん\ifx p\jlreq at engine\else ゔ\fi}% か゚き゚く゚け゚こ゚
-% 片仮名(文字クラス16)
-\edef\jlreq at charlist@katakana{アイウエオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモヤユヨラリルレロワヰヱヲンヴ\ifx p\jlreq at engine\else ヷヸヹヺ\fi}% カ゚キ゚ク゚ケ゚コ゚セ゚ツ゚ト゚
-
-\ifx l\jlreq at engine
- \newcommand*{\jlreq at setpostbreakpenalty@}[2]{\ltjsetparameter{postbreakpenalty={`#1,#2}}}
- \newcommand*{\jlreq at setprebreakpenalty@}[2]{\ltjsetparameter{prebreakpenalty={`#1,#2}}}
- \newcommand*{\jlreq at addjaxspmode@}[2]{%
- \jlreq at tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
- \jlreq at switch{#2}{
- {pre}{%
- \ifnum\jlreq at tempcnta=2
- \ltjsetparameter{jaxspmode={`#1,allow}}%
- \else\ifnum\jlreq at tempcnta=0
- \ltjsetparameter{jaxspmode={`#1,preonly}}%
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq at tempcnta=1
- \ltjsetparameter{jaxspmode={`#1,allow}}%
- \else\ifnum\jlreq at tempcnta=0
- \ltjsetparameter{jaxspmode={`#1,postonly}}%
- \fi\fi
- }
- }%
- }
- \newcommand*{\jlreq at deljaxspmode@}[2]{%
- \jlreq at tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
- \jlreq at switch{#2}{
- {pre}{%
- \ifnum\jlreq at tempcnta=2
- \ltjsetparameter{jaxspmode={`#1,postonly}}%
- \else\ifnum\jlreq at tempcnta=1
- \ltjsetparameter{jaxspmode={`#1,inhibit}}%
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq at tempcnta=3
- \ltjsetparameter{jaxspmode={`#1,preonly}}%
- \else\ifnum\jlreq at tempcnta=2
- \ltjsetparameter{jaxspmode={`#1,inhibit}}%
- \fi\fi
- }
- }%
- }
-\else
- \newcommand*{\jlreq at setpostbreakpenalty@}[2]{\postbreakpenalty`#1=#2}
- \newcommand*{\jlreq at setprebreakpenalty@}[2]{\prebreakpenalty`#1=#2}
- \newcommand*{\jlreq at addjaxspmode@}[2]{%
- \jlreq at tempcnta=\inhibitxspcode`#1
- \jlreq at switch{#2}{
- {pre}{%
- \ifnum\jlreq at tempcnta=1
- \inhibitxspcode`#1=3
- \else\ifnum\jlreq at tempcnta=0
- \inhibitxspcode`#1=2
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq at tempcnta=2
- \inhibitxspcode`#1=3
- \else\ifnum\jlreq at tempcnta=0
- \inhibitxspcode`#1=1
- \fi\fi
- }
- }%
- }
- \newcommand*{\jlreq at deljaxspmode@}[2]{%
- \jlreq at tempcnta=\inhibitxspcode`#1
- \jlreq at switch{#2}{
- {pre}{%
- \ifnum\jlreq at tempcnta=3
- \inhibitxspcode`#1=1
- \else\ifnum\jlreq at tempcnta=2
- \inhibitxspcode`#1=0
- \fi\fi
- }
- {post}{%
- \ifnum\jlreq at tempcnta=3
- \inhibitxspcode`#1=2
- \else\ifnum\jlreq at tempcnta=1
- \inhibitxspcode`#1=0
- \fi\fi
- }
- }%
- }
-\fi
-% #1{...}{#3}を...が#2のリストに対して適用.
-\newcommand*\jlreq at iterateapply[3]{%
- \edef\jlreq at tempa{#2}%
- \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq at tempa\do{%
- \expandafter#1\expandafter{\@tempa}{#3}%
- }%
-}
-\def\jlreq at setpostbreakpenalty{\jlreq at iterateapply{\jlreq at setpostbreakpenalty@}}
-\def\jlreq at setprebreakpenalty{\jlreq at iterateapply{\jlreq at setprebreakpenalty@}}
-\def\jlreq at addjaxspmode{\jlreq at iterateapply{\jlreq at addjaxspmode@}}
-\def\jlreq at deljaxspmode{\jlreq at iterateapply{\jlreq at deljaxspmode@}}
-
-\jlreq at aftercls@addtodeletecs{\jlreq at iterateapply}
-\jlreq at aftercls@addtodeletecs{\jlreq at setpostbreakpenalty}
-\jlreq at aftercls@addtodeletecs{\jlreq at setpostbreakpenalty@}
-\jlreq at aftercls@addtodeletecs{\jlreq at setprebreakpenalty}
-\jlreq at aftercls@addtodeletecs{\jlreq at setprebreakpenalty@}
-\jlreq at aftercls@addtodeletecs{\jlreq at addjaxspmode}
-\jlreq at aftercls@addtodeletecs{\jlreq at addjaxspmode@}
-\jlreq at aftercls@addtodeletecs{\jlreq at deljaxspmode}
-\jlreq at aftercls@addtodeletecs{\jlreq at deljaxspmode@}
-
-% 行末禁則
-\jlreq at setpostbreakpenalty{\jlreq at charlist@openingbrackets}{10000}
-\jlreq at setpostbreakpenalty{\jlreq at charlist@prefixedabbreviations}{10000}
-
-% 行頭禁則
-\jlreq at setprebreakpenalty{\jlreq at charlist@closingbrackets}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@hyphens}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@dividingpunctuationmarks}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@middlenodes}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@fullstops}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@commas}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@iterationmarks}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@prolongedsoundmark}{10000}
-\jlreq at setprebreakpenalty{\jlreq at charlist@smallkana}{10000}
-
-% xkanjiskip
-\jlreq at addjaxspmode{\jlreq at charlist@iterationmarks}{pre}
-\jlreq at addjaxspmode{\jlreq at charlist@iterationmarks}{post}
-\jlreq at addjaxspmode{\jlreq at charlist@prolongedsoundmark}{pre}
-\jlreq at addjaxspmode{\jlreq at charlist@prolongedsoundmark}{post}
-\jlreq at addjaxspmode{\jlreq at charlist@smallkana}{pre}
-\jlreq at addjaxspmode{\jlreq at charlist@smallkana}{post}
-\jlreq at addjaxspmode{\jlreq at charlist@hiragana}{pre}
-\jlreq at addjaxspmode{\jlreq at charlist@hiragana}{post}
-\jlreq at addjaxspmode{\jlreq at charlist@katakana}{pre}
-\jlreq at addjaxspmode{\jlreq at charlist@katakana}{post}
-\jlreq at addjaxspmode{\jlreq at charlist@dividingpunctuationmarks}{post}
-
-% 分割禁止(分離禁止文字は特定の並びで分割禁止だが,とりあえず一括で禁止しておく.)
-\jlreq at setprebreakpenalty{\jlreq at charlist@inseparablecharacters}{10000}
-% ¥100とか70%とか……
-
-%.. 文字範囲
-\ifx u\jlreq at engine
- % \kcatcodeの設定
- \def\jlreq at setkcatcode#1#2{\@for\@tempa:=#1\do{\kcatcode"\@tempa=#2\relax}}
- \jlreq at aftercls@addtodeletecs{\jlreq at setkcatcode}
- % LuaTeX-jaのデフォルトのままに近い設定をする
- % 範囲1&8
- \jlreq at setkcatcode{80}{15} % Latin-1 Supplement,どうしよう……
- \jlreq at setkcatcode{100,180,250,2B0,300,1E00}{15}
- % 範囲2
- \jlreq at setkcatcode{370,400,1F00}{18}
- % 範囲3
- \jlreq at setkcatcode{2000,2070,20A0,20D0,2100,2150,2190,2200,2300,2400,2500,2580,25A0,2600,2700,2900,2980,2B00}{18}
- % 範囲4
- \jlreq at 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 at setkcatcode{D800,DB80,DC00,E0000,F0000,100000}{15}
- % 範囲6
- \jlreq at setkcatcode{3040,30A0,31F0}{17} % Hiragana,Katakana,Katakana Phonetic Extensions
- \jlreq at 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 at setkcatcode{2E80,3190,3400,4E00,F900,20000}{16}
- % 範囲7
- \jlreq at setkcatcode{A000,A490}{18} % Yi Syllables,Yi Radicals
- \jlreq at setkcatcode{1100,3130,AC00,D7B0}{19} % Hangul Jamo,Hangul Compatibility Jamo,Hangul Syllables,Hangul Jamo Extended-B
- \jlreq at setkcatcode{2F00,2FF0,3100,31A0,31C0,A830}{16}
-\fi
-
-% フォントサイズを設定
-\newdimen\jlreq at fontsize
-\newdimen\jlreq at jafontsize
-\ifx l\jlreq at engine
- % Q,zw,zhが正しく扱われるようになる.\dimexprつきに展開される.
- \def\jlreq at 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 at expand@optionfontsize#1{\dimexpr#1\relax}
-\fi
-\jlreq at aftercls@addtodeletecs{\jlreq at expand@optionfontsize}
-\ifx\jlreq at option@fontsize\@empty
- \ifx\jlreq at option@jafontsize\@empty
- \jlreq at fontsize=10pt
- \jlreq at jafontsize=\jlreq at option@jafontscale\jlreq at fontsize
- \else
- \setlength{\jlreq at jafontsize}{\jlreq at expand@optionfontsize{\jlreq at option@jafontsize}}
- \jlreq at divide{\jlreq at jafontsize}{\jlreq at option@jafontscale pt}
- \jlreq at fontsize=\jlreq at resultdimen
- \fi
-\else
- \setlength{\jlreq at fontsize}{\jlreq at expand@optionfontsize{\jlreq at option@fontsize}}
- \ifx\jlreq at option@jafontsize\@empty
- \jlreq at jafontsize=\jlreq at option@jafontscale\jlreq at fontsize
- \else
- \setlength{\jlreq at jafontsize}{\jlreq at expand@optionfontsize{\jlreq at option@jafontsize}}
- \fi
-\fi
-%. フォント
-\RequirePackage{lmodern}
-
-%.. 古いフォントコマンド
-\DeclareOldFontCommand{\jlreq at oldfontcommand@mc}{\normalfont\mcfamily}{\mathmc}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@gt}{\normalfont\gtfamily}{\mathgt}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@rm}{\normalfont\rmfamily}{\mathrm}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@sf}{\normalfont\sffamily}{\mathsf}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@tt}{\normalfont\ttfamily}{\mathtt}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@bf}{\normalfont\bfseries}{\mathbf}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@it}{\normalfont\itshape}{\mathit}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@sl}{\normalfont\slshape}{\@nomath\sl}
-\DeclareOldFontCommand{\jlreq at oldfontcommand@sc}{\normalfont\scshape}{\@nomath\sc}
-\newcommand*{\jlreq at oldfontcommand@enable}{%
- \let\mc=\jlreq at oldfontcommand@mc
- \let\gt=\jlreq at oldfontcommand@gt
- \let\rm=\jlreq at oldfontcommand@rm
- \let\sf=\jlreq at oldfontcommand@sf
- \let\tt=\jlreq at oldfontcommand@tt
- \let\bf=\jlreq at oldfontcommand@bf
- \let\it=\jlreq at oldfontcommand@it
- \let\sl=\jlreq at oldfontcommand@sl
- \let\sc=\jlreq at oldfontcommand@sc
-}
-\newcommand*{\jlreq at 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 at engine
- \def\ltj at stdyokojfm{jlreq}
- \def\ltj at stdtatejfm{jlreqv}
- % この値は後でjfm-jlreq内で読む
- \directlua{jlreq.open_bracket_pos = [[\jlreq at open@bracket at pos]]}
- \ifjlreq at burasage\directlua{jlreq.burasage = true}\else\directlua{jlreq.burasage = false}\fi
- % \item後の行頭括弧のために仕込み.
- \jlreq at saveoriginalcs{\list}
- \jlreq at saveoriginalcs{\endlist}
- \PushPostHook{par}{\jlreq at parhook@atbeginlist}
- \pretocmd{\list}{\def\jlreq at parhook@atbeginlist{\ltjfakeparbegin}}{}{}
- \apptocmd{\endlist}{\def\jlreq at parhook@atbeginlist{}}{}{}
- \def\jlreq at parhook@atbeginlist{}
-\else
- % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処.
- % 行頭括弧に対して\inhibitglueを入れたりする命令を作る
- % \jlreq at charlist@openingbracketsの各括弧に対して,\ifx\jlreq at nextchar 「1\fiみたいなのが並んだのを作る
- \def\jlreq at tempa{}
- \def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifx\jlreq at nextchar#11\fi}\jlreq at do}}
- \expandafter\jlreq at do\jlreq at charlist@openingbrackets\jlreq at endmark
- % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる.
- \ifthenelse{\equal{\jlreq at open@bracket at pos}{nibu_tentsuki}}{
- \edef\jlreq at openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 \unexpanded{\hskip -.5\zw\inhibitglue}\noexpand\fi}
- }{% zenkakunibu_nibu,zenkaku_tentsuki
- \edef\jlreq at openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
- }
- % source special対策
- \def\jlreq at openbracket@hook{\ifx\jlreq at nextchar\special\expandafter\jlreq at openbracket@hook@@\else\expandafter\jlreq at openbracket@hook@\fi}
- \def\jlreq at openbracket@hook@@#1#2{#1{#2}\futurelet\jlreq at nextchar\jlreq at openbracket@hook}
- \def\jlreq at jfmname@prefix{}
- \jlreq at aftercls@addtodeletecs{\jlreq at jfmname@prefix}
- \ifjlreq at burasage\edef\jlreq at jfmname@prefix{b\jlreq at jfmname@prefix}\fi
- \ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{\edef\jlreq at jfmname@prefix{\jlreq at jfmname@prefix z}}{}
- \ifx u\jlreq at engine\edef\jlreq at jfmname@prefix{u\jlreq at jfmname@prefix}\fi
- \edef\jlreq at jfmname{\jlreq at jfmname@prefix jlreq} % JFMの名前
- \edef\jlreq at jfmnameg{\jlreq at jfmname@prefix jlreqg} % ゴシックなJFMの名前
- \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq at nextchar\jlreq at openbracket@hook}}
-\fi
-
-% 行頭の括弧は \jlreq at open@bracket at before@space \inhibitglue 「みたいにする.
-\ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{
- \def\jlreq at open@bracket at before@space{\hskip\glueexpr-.5\zw\relax}
-}{
- \def\jlreq at open@bracket at before@space{}
-}
-
-\ifx l\jlreq at 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 at engine
- \def\jlreq at yokokanjiencoding{JY1}
- \def\jlreq at tatekanjiencoding{JT1}
-\fi
-\ifx u\jlreq at engine
- \def\jlreq at yokokanjiencoding{JY2}
- \def\jlreq at tatekanjiencoding{JT2}
-\fi
-\ifx l\jlreq at engine
- \def\jlreq at yokokanjiencoding{JY3}
- \def\jlreq at tatekanjiencoding{JT3}
-\fi
-\jlreq at divide{\jlreq at jafontsize}{\jlreq at fontsize}
-\edef\jlreq at jafontscale{\strip at pt\jlreq at resultdimen}
-\jlreq at aftercls@addtodeletecs{\jlreq at jafontscale}
-\ifx l\jlreq at engine
- \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdmcfont:jfm=jlreq;script=latn;-kern}{}
- \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdgtfont:jfm=jlreq;script=latn;-kern}{}
- \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdmcfont:jfm=jlreqv;script=latn;-kern}{}
- \DeclareFontShape{JT3}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdgtfont:jfm=jlreqv;script=latn;-kern}{}
-\else
- \DeclareFontShape{\jlreq at yokokanjiencoding}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmname}{}
- \DeclareFontShape{\jlreq at yokokanjiencoding}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmnameg}{}
- \DeclareFontShape{\jlreq at tatekanjiencoding}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmname-v}{}
- \DeclareFontShape{\jlreq at tatekanjiencoding}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmnameg-v}{}
-\fi
-\@for\jlreq at encoding:=\jlreq at yokokanjiencoding,\jlreq at tatekanjiencoding\do{
- \@for\jlreq at shape:=n,it,sl,sc\do{
- \@for\jlreq at series:=m,b,bx,sb,c\do{
- \ifthenelse{\equal{\jlreq at shape}{n} \AND \equal{\jlreq at series}{m}}{}{
- \DeclareFontShape{\jlreq at encoding}{gt}{\jlreq at series}{\jlreq at shape}{<->ssub*gt/m/n}{}
- }
- }
- \@for\jlreq at series:=bx,b,sb\do{
- \DeclareFontShape{\jlreq at encoding}{mc}{\jlreq at series}{\jlreq at shape}{<->ssub*gt/m/n}{}
- }
- \@for\jlreq at series:=m,c\do{
- \ifthenelse{\equal{\jlreq at shape}{n} \AND \equal{\jlreq at series}{m}}{}{
- \DeclareFontShape{\jlreq at encoding}{mc}{\jlreq at series}{\jlreq at shape}{<->ssub*mc/m/n}{}
- }
- }
- }
-}
-
-% 和文ファミリと欧文ファミリの連動
-\DeclareRobustCommand\rmfamily{%
- \not at math@alphabet\rmfamily\mathrm
- \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
-\DeclareRobustCommand\sffamily{%
- \not at math@alphabet\sffamily\mathsf
- \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
-\DeclareRobustCommand\ttfamily{%
- \not at math@alphabet\ttfamily\mathtt
- \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
-
-% 数式フォント設定
-\ifjlreq at option@enablejfam
- \ifx l\jlreq at engine\else
- \DeclareSymbolFont{mincho}{\jlreq at yokokanjiencoding}{mc}{m}{n}
- \DeclareSymbolFontAlphabet{\mathmc}{mincho}
- \SetSymbolFont{mincho}{bold}{\jlreq at yokokanjiencoding}{gt}{m}{n}
- \jfam\symmincho
- \DeclareMathAlphabet{\mathgt}{\jlreq at yokokanjiencoding}{gt}{m}{n}
- \fi
- \AtBeginDocument{%
- \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
- \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
- }
-\fi
-
-% 和文間隔
-\DeclareRobustCommand*\ {\futurelet\jlreq at nextchar\jlreq at zenkakuspace@ignorespaces}
-% 後続の空白を無視する処理
-\edef\jlreq at zenkakuspace@ignorespaces{%
- \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq at nextchar\expandafter\jlreq at zenkakuspace@ignorespaces@\else\expandafter\jlreq at zenkakuspace@main\fi}%
-}
-\expandafter\def\expandafter\jlreq at zenkakuspace@ignorespaces@\space{\ }
-\def\jlreq at tempa{}
-\def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifnum\lastnodechar=`#1 1\fi}\jlreq at do}}
-\expandafter\jlreq at do\jlreq at charlist@dividingpunctuationmarks\jlreq at endmark
-\edef\@tempa{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 }
-\expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq at zenkakuspace@main\expandafter{\@tempa
- \hskip 1\zw\hbox{}%
- \jlreq at lastnodechar=`
- \expandafter\jlreq at fixjfm
- \else\expandafter \fi
-}
-\ifx l\jlreq at engine
- {
- \catcode` =\active
- \global\let =\jlreq at zenkakuspace@main
- }
- \AtBeginDocument{\catcode` =\active}
-\fi
-
-% \jaspace
-\DeclareRobustCommand*{\jaspace}[1]{%
- \ifcsname jlreq at jaspace@#1\endcsname\csname jlreq at jaspace@#1\endcsname
- \else\ClassError{jlreq}{unknown jaspace: #1}{\@ehc}\fi
-}
-\def\jlreq at jaspace@zenkaku{\hskip\glueexpr 1\zw\relax}
-\def\jlreq at jaspace@nibu{\hskip\glueexpr .5\zw\relax}
-\def\jlreq at jaspace@shibu{\hskip\glueexpr .25\zw\relax}
-
-% 区切り約物.\? みたいな命令を作る.直後の空きが自動で入る.
-% \?*とすると文中の?として扱われる.
-\def\jlreq at tempa{}
-\def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifx\jlreq at nextchar #11\fi}\jlreq at do}}
-\expandafter\jlreq at do\jlreq at charlist@closingbrackets\jlreq at endmark
-\edef\jlreq at dividingpunctuationmarkscommand{%
- \noexpand\ifnum 0\expandonce{\jlreq at tempa}>0 \unexpanded{\expandafter\ignorespaces\else\expandafter\ \fi}%
-}
-\def\jlreq at do#1{%
- \jlreq at ifendmark{#1}{}{
- \expandafter\DeclareRobustCommand\expandafter*\csname #1\endcsname{%
- \jlreq at ifstar
- {\hskip .25\zw #1\hskip .25\zw\ignorespaces}%
- {#1\futurelet\jlreq at nextchar\jlreq at dividingpunctuationmarkscommand}%
- }
- \jlreq at do
- }
-}
-\expandafter\jlreq at do\jlreq at charlist@dividingpunctuationmarks\jlreq at endmark
-
-% \baselineskipの計算
-% いったん文字サイズを変更((u)platexの際にzh/zwをきちんとするため)
-\@setfontsize\normalsize{\jlreq at fontsize}{\jlreq at fontsize}%
-\newdimen\jlreq at baselineskip
-\ifx l\jlreq at engine
- \setlength{\jlreq at baselineskip}{%
- \dimexpr\directlua{
- local act = string.char(92)
- local s = [[\jlreq at 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 at baselineskip}{\dimexpr\jlreq at option@baselineskip\relax}
-\fi
-\ifdim\jlreq at fontsize>\jlreq at baselineskip
- \ClassError{jlreq}{The baselineskip is less than fontsize}{\@ehc}%
-\fi
-\ifthenelse{\lengthtest{\jlreq at baselineskip<1.5\zw} \OR \lengthtest{\jlreq at baselineskip>2\zw}}{
- \jlreq at note{行間は二分以上全角以下が望ましい (2.4.2.d 注3).}
-}{}
-
-\emergencystretch 3\jlreq at gol
-
-%.. 文字サイズ変更
-\def\jlreq at setfontsizehook{}
-\jlreq at saveoriginalcs{\set at fontsize}
-\apptocmd{\set at fontsize}{\expandafter\def\expandafter\size at update\expandafter{\size at update\jlreq at setfontsizehook}}{}{}
-\appto\jlreq at setfontsizehook{\ifdim\parindent>0pt \setlength{\parindent}{1\zw}\fi}
-\ifx l\jlreq at engine
- \@tempskipa=\ltjgetparameter{kanjiskip}
- \ifdim\@tempskipa=\maxdimen\else
- \appto\jlreq at setfontsizehook{%
- \ltj at setpar@global
- \ltjsetkanjiskip\jlreqkanjiskip
- \@tempskipa=\ltjgetparameter{xkanjiskip}%
- \ifdim\@tempskipa>0pt
- \ltjsetxkanjiskip\jlreqxkanjiskip
- \fi
- }
- \fi
-\else
- \appto\jlreq at setfontsizehook{%
- \kanjiskip=\jlreqkanjiskip
- \ifdim\xkanjiskip>0pt
- \xkanjiskip=\jlreqxkanjiskip
- \fi
- }
-\fi
-
-% \jafontsize
-\ifdim\jlreq at fontsize=\jlreq at jafontsize
- \let\jafontsize=\fontsize
-\else
- \def\@tempa#1{
- \DeclareRobustCommand*{\jafontsize}[2]{%
- \begingroup
- \jlreq at iffloat{##1}{%
- \edef\jlreq at do{\noexpand\fontsize{\strip at pt\dimexpr#1\dimexpr##1pt\relax\relax}}%
- }{%
- \edef\jlreq at do{\noexpand\fontsize{\the\dimexpr#1\dimexpr##1\relax\relax}}%
- }%
- \expandafter\endgroup
- \jlreq at do{##2}%
- }
- }
- \jlreq at divide{\jlreq at fontsize}{\jlreq at jafontsize}
- \edef\jlreq at do{\noexpand\@tempa{\strip at pt\jlreq at resultdimen}}
- \jlreq at do
-\fi
-
-\renewcommand{\normalsize}{%
- \@setfontsize\normalsize{\jlreq at fontsize}{\jlreq at baselineskip}%
- \abovedisplayskip 1.1\jlreq at fontsize \@plus .3\jlreq at fontsize \@minus .4\jlreq at fontsize
- \abovedisplayshortskip \z@ \@plus .3\jlreq at fontsize
- \belowdisplayskip .9\jlreq at fontsize \@plus.3\jlreq at fontsize \@minus.4\jlreq at fontsize
- \belowdisplayshortskip \belowdisplayskip
- \let\@listi\@listI}
-
-\if at tate\tate\fi % ここで発行しておく
-\mcfamily\selectfont\normalsize
-\setbox\jlreq at tempboxa\hbox{阿}
-\setlength\Cht{\ht\jlreq at tempboxa}
-\setlength\Cdp{\dp\jlreq at tempboxa}
-\setlength\Cwd{\wd\jlreq at tempboxa}
-\setlength\Cvs{\baselineskip}
-\setlength\Chs{\wd\jlreq at tempboxa}
-
-% 4.1.3.a
-% 2.5.2 \baselineskipは一定の方がよい?
-% \@listiは再定義しないようにした.(\normalsizeと共用でJLReq通りだと思う.)
-\newcommand{\footnotesize}{%
- \@setfontsize\footnotesize{.8\jlreq at fontsize}{\dimexpr 115\jlreq at baselineskip/170\relax}% 脚注文字サイズの二分より少し小さい値を行間に: 4.2.5.e
- \abovedisplayskip .6\jlreq at fontsize \@plus.2\jlreq at fontsize \@minus.4\jlreq at fontsize
- \abovedisplayshortskip \z@ \@plus.1\jlreq at fontsize
- \belowdisplayshortskip .3\jlreq at fontsize \@plus.1\jlreq at fontsize \@minus.2\jlreq at fontsize
- \belowdisplayskip \abovedisplayskip}
-% tsize10.cloの引数を,そのまま\jlreq at fontsize/\jlreq at baselineskipでスケーリングしているだけ.
-\newcommand{\small}{%
- % jsarticleのもの
- \@setfontsize\small{.9\jlreq at fontsize}{\dimexpr 13\jlreq at baselineskip/17\relax}%
- \abovedisplayskip .9\jlreq at fontsize \@plus.3\jlreq at fontsize \@minus.4\jlreq at fontsize
- \abovedisplayshortskip \z@ \@plus.3\jlreq at fontsize
- \belowdisplayshortskip \abovedisplayshortskip
- \belowdisplayskip \abovedisplayskip}
-\newcommand{\scriptsize}{\@setfontsize\scriptsize{\dimexpr 7\jlreq at fontsize/10\relax}{\dimexpr 8\jlreq at baselineskip/17\relax}}
-\newcommand{\tiny}{\@setfontsize\tiny{\dimexpr 5\jlreq at fontsize/10\relax}{\dimexpr 6\jlreq at baselineskip/17\relax}}
-\newcommand{\large}{\@setfontsize\large{\dimexpr12\jlreq at fontsize/10\relax}{\jlreq at baselineskip}}
-\newcommand{\Large}{\@setfontsize\Large{\dimexpr14\jlreq at fontsize/10\relax}{\dimexpr 21\jlreq at baselineskip/17\relax}}
-\newcommand{\LARGE}{\@setfontsize\LARGE{\dimexpr17\jlreq at fontsize/10\relax}{\dimexpr 25\jlreq at baselineskip/17\relax}}
-\newcommand{\huge}{\@setfontsize\huge{2\jlreq at fontsize}{\dimexpr 28\jlreq at baselineskip/17\relax}}
-\newcommand{\Huge}{\@setfontsize\Huge{\dimexpr 25\jlreq at fontsize/10\relax}{\dimexpr 33\jlreq at baselineskip/17\relax}}
-
-%. plextから一部拝借
-% オプションも*もない\rensuji(コピペ)
-\DeclareRobustCommand{\jlreq at rensuji}[1]{%
- \ifvmode\leavevmode\fi
- \jlreq at ifydir{\hbox{#1}}{%
- \hskip 0pt plus 0.25\zw minus 0pt % \rensujiskipは固定値
- \setbox\jlreq at tempboxa=\hbox{\yoko#1}%
- \@tempdima=\dimexpr\ht\jlreq at tempboxa+\dp\jlreq at 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 at 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 at omotekeiwidth
-\jlreq at omotekeiwidth=0.12mm
-\newdimen\jlreq at chuubusokeiwidth
-\jlreq at chuubusokeiwidth=0.25mm
-\newdimen\jlreq at urakeiwidth
-\jlreq at urakeiwidth=0.4mm
-% 脚注のインデント
-\newdimen\jlreq at footnoteindent
-
-%\RequirePackage{jlreq-debug}
-
-%. ページレイアウト
-% landscapeの場合縦横をひっくり返す
-\if at landscape
- \jlreq at helper@swap at register{\paperwidth}{\paperheight}
-\fi
-
-% \pdfpagewidthとか設定
-\ifx l\jlreq at engine
- \setlength{\pagewidth}{\paperwidth}
- \setlength{\pageheight}{\paperheight}
-\else
- \setlength{\pdfpagewidth}{\paperwidth}
- \setlength{\pdfpageheight}{\paperheight}
-\fi
-
-\ifx l\jlreq at engine
- \def\jlreq at 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 at expand@speciallength#1{#1}
-\fi
-\def\jlreq at speciallength#1{\dimexpr\jlreq at expand@speciallength{#1}\relax}
-
-%.. 二段組み用パラメータ
-\setlength{\columnsep}{\jlreq at speciallength{\jlreq at option@column at gap}}
-\setlength{\columnseprule}{0pt}
-
-%.. 傍注(4.2.7)
-\begingroup
- \footnotesize
- \setlength{\jlreq at tempdima}{\jlreq at speciallength{\jlreq at option@sidenote at length}}
- \jlreq at tempdimb=1\zw
- \divide\jlreq at tempdima\jlreq at tempdimb
- \multiply\jlreq at tempdima\jlreq at tempdimb
- \ifdim\jlreq at tempdima>0pt
- \ifnum 0\ifdim\jlreq at tempdima>25\zw 1\fi\ifdim\jlreq at tempdima<15\zw 1\fi>0
- \jlreq at note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).}
- \fi
- \fi
- \edef\jlreq at do{
- \noexpand\setlength{\noexpand\marginparwidth}{\the\jlreq at tempdima}
- \noexpand\setlength{\noexpand\marginparpush}{\the\dimexpr 0.5\zw\relax} % 同上:4.2.7.g
- }
- \expandafter\endgroup
-\jlreq at do
-\ifdim\marginparwidth>0pt
- \setlength{\marginparsep}{2\zw} % フォントサイズ×2(4.2.7:特に問題に~e)
-\else
- \setlength{\marginparsep}{0pt}
-\fi
-
-% 縦書きの時は脚注に固定
-% (TODO: 頭注)
-\if at tate\@mparswitchfalse\fi
-
-\setlength{\topskip}{1\zw} % フォントサイズと一致させる
-\ifx\jlreq at option@headfoot at verticalpos\@empty
- \if at tate\def\jlreq at option@headfoot at verticalpos{1zw}
- \else\def\jlreq at option@headfoot at verticalpos{2zw}\fi
-\fi
-\setlength{\headsep}{\jlreq at speciallength{\jlreq at option@headfoot at verticalpos}}
-\if at tate\ifdim\headsep<1\zw\relax\jlreq at note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi\fi
-\if at tate
- \if at 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 at determine@kihonhanmen at warning@first
-\jlreq at determine@kihonhanmen at warning@firsttrue
-\def\jlreq at determine@kihonhanmen at warning{
- \ifjlreq at determine@kihonhanmen at warning@first
- \jlreq at note{基本版面は,a. サイズの決定 b. 仕上りサイズに対する基本版面の配置位置の決定 という手順で行う (2.4.1).}
- \jlreq at determine@kihonhanmen at warning@firstfalse
- \fi
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at determine@kihonhanmen at warning}
-\jlreq at aftercls@addtodeleteif{\ifjlreq at determine@kihonhanmen at warning@first}
-\@tempdima=1\zw
-\ifx\jlreq at option@line at length\@empty
- \if at tate
- \ifnum 0\ifx\jlreq at option@head at space\@empty 1\fi\ifx\jlreq at option@foot at space\@empty 1\fi>0
- \setlength{\textwidth}{0.75\paperheight}
- \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
- \else
- \jlreq at determine@kihonhanmen at warning
- \setlength{\textwidth}{\dimexpr\paperheight - \jlreq at option@head at space - \jlreq at option@foot at space \relax}
- \fi
- \else
- \ifnum 0\ifx\jlreq at option@gutter\@empty 1\fi\ifx\jlreq at option@fore at edge\@empty 1\fi>0
- \setlength{\textwidth}{0.75\paperwidth}
- \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
- \else
- \jlreq at determine@kihonhanmen at warning
- \setlength{\textwidth}{\dimexpr\paperwidth - \jlreq at option@gutter - \jlreq at option@fore at edge\relax}
- \fi
- \fi
- \if at twocolumn
- \addtolength{\textwidth}{\dimexpr-2\marginparwidth - 2\marginparsep\relax}
- \setlength{\textwidth}{\dimexpr(\textwidth - \columnsep)/2\relax}
- \else
- \addtolength{\textwidth}{\dimexpr-\marginparwidth - \marginparsep\relax}
- \fi
-\else
- \setlength{\textwidth}{\jlreq at speciallength{\jlreq at option@line at length}}
- \divide\textwidth\@tempdima
- \if at tate
- \ifnum\number\textwidth>52
- \jlreq at note{一行の長さは52文字以下が望ましい (2.4.2.c 注2).}
- \fi
- \else
- \ifnum\number\textwidth>40
- \jlreq at note{一行の長さは40文字以下が望ましい (2.4.2.c 注2).}
- \fi
- \fi
- \multiply\textwidth\@tempdima
-\fi
-\if at twocolumn
- \setlength{\textwidth}{\dimexpr2\textwidth + \columnsep\relax}
-\fi
-\addtolength{\textwidth}{0.0001pt}
-
-
-%.. \textheight:行送り方向の長さ
-% 一番上(直後に\topskip由来が入る)から最終行のベースラインまでの長さ.
-% \topskipが十分ある時は先頭行のベースラインから最終行のベースライン+\topskip
-\def\jlreq at adjusttextheight{
- \addtolength{\textheight}{-\topskip}
- \divide\textheight\baselineskip \multiply\textheight\baselineskip
- \addtolength{\textheight}{\topskip}
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at adjusttextheight}
-\ifx\jlreq at option@number at of@lines\@empty
- \if at tate
- \ifnum 0\ifx\jlreq at option@gutter\@empty 1\fi\ifx\jlreq at option@fore at edge\@empty 1\fi>0
- \setlength{\textheight}{0.75\paperwidth}
- \jlreq at adjusttextheight
- \else
- \jlreq at determine@kihonhanmen at warning
- \setlength{\textheight}{\dimexpr\paperwidth - \jlreq at option@gutter - \jlreq at option@fore at edge + \topskip - 1\zw\relax}
- \fi
- \else
- \ifnum 0\ifx\jlreq at option@head at space\@empty 1\fi\ifx\jlreq at option@foot at space\@empty 1\fi>0
- \setlength{\textheight}{0.75\paperheight}
- \jlreq at adjusttextheight
- \else
- \jlreq at determine@kihonhanmen at warning
- \setlength{\textheight}{\dimexpr\paperheight + 2\topskip - 1\zh - \Cht - \jlreq at option@head at space - \jlreq at option@foot at space\relax}
- \fi
- \fi
-\else
- \setlength{\textheight}{\dimexpr\numexpr\jlreq at option@number at of@lines\relax\baselineskip - \baselineskip + \topskip\relax}
-\fi
-\addtolength{\textheight}{0.0001pt}
-
-%.. 横
-\def\jlreq at setsidemargin@by at gutter#1{
- \if at tate
- \setlength{\evensidemargin}{#1}
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax}
- \addtolength{\evensidemargin}{\Cdp}
- \else
- \setlength{\oddsidemargin}{#1}
- \if at twocolumn
- \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax}
- \fi
- \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax}
- \fi
-}
-\def\jlreq at setsidemargin@by at fore@edge#1{
- \jlreq at setsidemargin@by at gutter{#1}
- \jlreq at helper@swap at register{\oddsidemargin}{\evensidemargin}
- \ifjlreq at determine@kihonhanmen at warning@first
- \jlreq at note{基本版面の配置はのどの空き量を指定する (2.4.1.b).}
- \fi
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at setsidemargin@by at gutter}
-\jlreq at aftercls@addtodeletecs{\jlreq at setsidemargin@by at fore@edge}
-
-\ifx\jlreq at option@gutter\@empty
- \ifx\jlreq at option@fore at edge\@empty
- % 中央配置
- \if at tate
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax}
- \else
- \if at twocolumn
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax}
- \else
- \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax}
- \fi
- \fi
- \setlength{\oddsidemargin}{.5\oddsidemargin}
- \ifnum0\if at twocolumn1\fi\if at tate1\fi>0
- \setlength{\evensidemargin}{\oddsidemargin}
- \else
- \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax}
- \fi
- \else
- \jlreq at setsidemargin@by at fore@edge{\jlreq at speciallength{\jlreq at option@fore at edge}}
- \fi
-\else
- \jlreq at setsidemargin@by at gutter{\jlreq at speciallength{\jlreq at option@gutter}}
- \ifx\jlreq at option@fore at edge\@empty\else
- \ifjlreq at determine@kihonhanmen at warning@first
- \ClassWarningNoLine{jlreq}{fore-edge is ignored}
- \fi
- \fi
-\fi
-\ifx l\jlreq at engine
- \addtolength{\oddsidemargin}{-1in}
- \addtolength{\evensidemargin}{-1in}
-\else
- \addtolength{\oddsidemargin}{-1truein}
- \addtolength{\evensidemargin}{-1truein}
-\fi
-
-%.. 縦
-% \topmarginに全体の頭からテキストの頭までの長さを入れる
-% 天の値からtopmarginを設定する
-\def\jlreq at settopmarginbyhead#1{
- \if at tate
- \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight\relax}
- \if at twocolumn
- \addtolength{\topmargin}{\dimexpr\marginparwidth + \marginparsep\relax}
- \fi
- \jlreq at note{縦組の場合は地の空き量を指定する (2.4.1.b).}
- \else
- \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - \topskip + \Cht\relax}
- \fi
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at settopmarginbyhead}
-% 地の値から
-\def\jlreq at settopmarginbyfoot#1{
- \if at tate
- \setlength{\topmargin}{\dimexpr\paperheight - \textwidth - \headsep - \headheight - #1 - \marginparsep - \marginparwidth\relax}
- \else
- \jlreq at note{横組の場合は天の空き量を指定する (2.4.1.b).}
- \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - #1\relax}
- \fi
-}
-\jlreq at aftercls@addtodeletecs{\jlreq at settopmarginbyfoot}
-\ifx\jlreq at option@head at space\@empty
- \ifx\jlreq at option@foot at space\@empty
- \if at tate
- \if at twocolumn
- \jlreq at settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - 2\marginparwidth - 2\marginparsep)/2\relax}
- \else
- \jlreq at settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - \marginparwidth - \marginparsep)/2\relax}
- \fi
- \else
- \jlreq at settopmarginbyhead{\dimexpr(\paperheight - (\textheight - \topskip + 1\zh))/2\relax}
- \fi
- \else
- \jlreq at settopmarginbyfoot{\jlreq at speciallength{\jlreq at option@foot at space}}
- \fi
-\else
- \ifx\jlreq at option@foot at space\@empty
- \jlreq at settopmarginbyhead{\jlreq at speciallength{\jlreq at option@head at space}}
- \else
- % 両方指定されていたら,縦書きは地を,横書きは天を使う
- \if at tate
- \jlreq at settopmarginbyfoot{\jlreq at speciallength{\jlreq at option@foot at space}}
- \ifx\jlreq at option@line at length\@empty\else
- \ClassWarningNoLine{jlreq}{head_space is ignored}
- \fi
- \else
- \jlreq at settopmarginbyhead{\jlreq at speciallength{\jlreq at option@head at space}}
- \ifx\jlreq at option@number at of@lines\@empty\else
- \ClassWarningNoLine{jlreq}{foot_space is ignored}
- \fi
- \fi
- \fi
-\fi
-\ifx l\jlreq at engine
- \addtolength{\topmargin}{-1in}
-\else
- \addtolength{\topmargin}{-1truein}
-\fi
-%.. 下
-\setlength{\footskip}{\dimexpr\headsep + \if at tate\marginparwidth + \marginparsep\else\topskip - \Cht\fi + \headheight\relax}
-% \maxdepth + \topskip = フォントサイズ×1.5(だってさ)
-\setlength{\maxdepth}{\dimexpr1.5\zw - \topskip\relax}
-
-%. システム設定
-%.. 逆ノンブル
-\ifjlreq at option@use at reverse@pagination
- \AtEndDocument{\clearpage\jlreq at reference@immediate at write{lastpage}{\noexpand\arabic{page}}}%
- \def\c at jlreqreversepage{\numexpr\jlreq at reference@ref{lastpage}{0} - \c at page + 1\relax}
- \def\thejlreqreversepage{\arabic{jlreqreversepage}}
-\fi
-
-%. 見出し関係 (4.1)
-% \clear***page
-\newcommand*{\cleartooddpage}[1][]{%
- \clearpage
- \ifodd\c at page\else
- \jlreq at ifempty{#1}{}{\thispagestyle{#1}}%
- \hbox{}%
- \newpage
- \if at twocolumn\hbox{}\newpage\fi
- \fi
-}
-\newcommand*{\cleartoevenpage}[1][]{%
- \clearpage
- \ifodd\c at page
- \jlreq at ifempty{#1}{}{\thispagestyle{#1}}%
- \hbox{}%
- \newpage
- \if at twocolumn\hbox{}\newpage\fi
- \fi
-}
-
-% 扉見出しと別行見出しについては,\<csname> -> \jlreq at headingcs@csname -> 本体と
-% 二段構えで展開されるようにする.一度の展開で\parが出るのを防ぐため.
-% 一度展開を\longなしマクロに渡されると破綻するので.(そういうパッケージが存在する.)
-
-% jlreq at heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される.
-% #1=*または空(見出し命令に*がついていたかで分岐),#2=ラベル,#3=running head
-% デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる.
-
-% 見出しの直前に実行される
-\newcommand*{\jlreq at hook@beforeheadings}[1]{}
-% 見出し名一覧を格納する
-\def\jlreq at heading@allheadings{}
-
-% 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
-% 結果は\jlreq at resultに入る.
-\def\jlreq at heading@make at l@#1#2#3{%
- \@ifundefined{l@#1}{%
- % 長さは適当に計測する
- \begingroup
- % ちょっと大きめで計測しておく
- \csname c@#1\endcsname=9
- \setbox\jlreq at tempboxa=\hbox{#3}%
- \jlreq at tempdima=\wd\jlreq at tempboxa
- \csname c@#1\endcsname=26
- \setbox\jlreq at tempboxa=\hbox{#3}%
- \ifdim\jlreq at tempdima<\wd\jlreq at tempboxa
- \jlreq at tempdima=\wd\jlreq at tempboxa
- \fi
- % \numexprは四捨五入
- \jlreq at tempdimb=\dimexpr\the\numexpr\jlreq at tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax
- \edef\jlreq at do{%
- \unexpanded{\def\jlreq at result}{%
- \noexpand\def\expandonce{\csname l@#1\endcsname}{%
- \unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq at tempdimb}%
- }%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
- }{\def\jlreq at result{}}%
-}
-
-% \jlreq at heading@make at maketoc{セクション名}{レベル}
-\def\jlreq at heading@make at maketoc#1#2{%
- % 目次への出力をするマクロ.外部に切り出しておく.
- \@ifundefined{jlreq at heading@maketoc@#1}{%
- % {1 = */-}{2 = ラベル}{3 = running head}
- % 1はcounter=falseならば-,星付き命令ならば*,それ以外は空.
- % 1が*または-の時は見出しにはラベルが現れないが,2には常にラベルが入るので,必要ならばここで無視する.
- \expandafter\def\csname jlreq at heading@maketoc@#1\endcsname##1##2##3{%
- \jlreq at iffirsttoken{##1}{*}{}{%
- \csname #1mark\endcsname{##3}%
- \ifnum0\jlreq at iffirsttoken{##1}{-}{1}{}\ifnum #2>\c at secnumdepth 1\fi>0
- \addcontentsline{toc}{#1}{##3}%
- \else
- \addcontentsline{toc}{#1}{\jlreq at ifempty{##2}{}{\protect\numberline{##2}}##3}%
- \fi
- }{}%
- }%
- }{}%
-}
-
-%.. 中/半扉見出し
-% addcontentslineに渡すやつ:番号出すのと出さないの
-\newcommand{\DeclareTobiraHeading}[3]{%
- \def\jlreq at do{\@removeelement{#1}}%
- \expandafter\jlreq at do\expandafter{\jlreq at heading@allheadings}{\jlreq at heading@allheadings}%
- \appto{\jlreq at heading@allheadings}{,#1}%
- \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
- \expandafter\edef\csname jlreq at heading@setting@#1\endcsname{\unexpanded{#3}}%
- \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewTobiraHeading}%
- \@ifundefined{c@#1}{\newcounter{#1}}{}%
- \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
- \jlreq at heading@make at maketoc{#1}{#2}%
- \begingroup
- \let\jlreq at contents@label at format=\@undefined
- \let\jlreq at format=\@undefined
- \edef\jlreq at label@format{\expandonce{\csname the#1\endcsname}}%
- \def\jlreq at heading@clearpage{\clearpage\hbox{}\clearpage}%
- \def\jlreq at pagestyle{empty}%
- \newif\ifjlreq at number \jlreq at numbertrue
- \jlreq at parsekeyval[DeclareTobiraHeading:#1]{
- {label_format}{\def\jlreq at label@format{##1}}
- {format}{\def\jlreq at format####1####2{##1}}
- {pagestyle}{\def\jlreq at pagestyle{##1}}
- {type}[han,naka]{%
- \jlreq at switch{##1}{
- {han}{\def\jlreq at heading@clearpage{\clearpage}}
- {naka}{\def\jlreq at heading@clearpage{\clearpage\hbox{}\clearpage}}
- }%
- }
- {number}[true,false]{\csname jlreq at number##1\endcsname}
- }{#3}%
- \def\jlreq at do{}%
- \ifx\jlreq at format\@undefined
- \def\jlreq at format##1##2{##1##2}%
- \fi
- \edef\jlreq at formatwlabel{\noexpand\jlreq at format{\expandonce{\jlreq at label@format}}}%
- \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
- \eappto\jlreq at do{\expandonce{\jlreq at result}}%
- \edef\jlreq at do{%
- \expandonce{\jlreq at do}%
- \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}[####1]####2{%
- \ifjlreq at number
- \unexpanded{\ifnum#2>\c at secnumdepth\else}%
- \unexpanded{\refstepcounter{#1}}%
- \noexpand\fi
- \fi
- \unexpanded{\jlreq at ifempty{##2}%
- {\long\gdef\jlreqHeadingText####1{}}%
- {\long\gdef\jlreqHeadingText####1{####1}}%
- }%
- \ifjlreq at number
- \unexpanded{\jlreq at if{\ifnum#2>\c at secnumdepth\relax\fi}}{%
- \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
- \expandonce{\jlreq at format{}{##1}}%
- }{%
- \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
- \expandafter\expandonce\expandafter{\jlreq at formatwlabel{##2}}%
- }%
- \else
- \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
- \expandonce{\jlreq at format{}{##1}}%
- \fi
- \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{\ifjlreq at number\else -\fi}{\expandonce{\jlreq at label@format}}{####1}%
- \noexpand\@afterheading
- \expandonce{\jlreq at heading@clearpage}%
- \unexpanded{\if at restonecol\twocolumn\fi}%
- }%
- \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start at s@#1\endcsname}####1{%
- \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
- \unexpanded{\jlreq at ifempty{##1}%
- {\long\gdef\jlreqHeadingText####1{}}%
- {\long\gdef\jlreqHeadingText####1{####1}}%
- }%
- \expandonce{\jlreq at format{}{##1}}
- \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq at label@format}}{####1}%
- \noexpand\@afterheading
- \expandonce{\jlreq at heading@clearpage}%
- \unexpanded{\if at restonecol\twocolumn\fi}%
- }%
- \noexpand\def\expandonce{\csname jlreq at headingcs@#1\endcsname}{%
- % 改丁.これでよいのかな.
- \unexpanded{\if at twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage[empty]}%
- \ifx\jlreq at pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq at pagestyle}}\fi
- \noexpand\secdef{\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq at TobiraHeading@start at s@#1\endcsname}}}%
- \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq at headingcs@#1\endcsname}}%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\newcommand{\NewTobiraHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareTobiraHeading{#1}{#2}{#3}}%
-}
-\newcommand{\RenewTobiraHeading}[3]{%
- \@ifundefined{#1}{\@latex at error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareTobiraHeading{#1}{#2}{#3}}%
-}
-\newcommand{\ProvideTobiraHeading}[3]{%
- \@ifundefined{#1}{\DeclareTobiraHeading{#1}{#2}{#3}}{}%
-}
-
-%.. 別行見出し
-% \jlreq at BlockHeading@start:別行見出しを出力する命令.
-% \jlreq at BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = カウンタ関連}{5 = フォーマット関連}{6 = 全体フォーマット}*{見出し}[副題]
-% カウンタ関連=-,*,無し:-はカウンタ関連を処理しない.*はさらに目次に追加しない(星付き命令と同様).星付きで呼び出された時は常に*同等.
-% スペース関連={配置:lcr(左中央右)}{字下げ(寸法)}{字上げ(寸法)}{前空き}{後空き}{行取りの行数}{空か*か,偶数ページでも改ページを許可するならば空}
-% 前/後空きはprefixにa:/s:/r:が入る.r:は空きがその値そのものになる.a:/s:は行取りに加えて入る.a:で指定された空きはページ行頭では入らない
-% 後空きの時はs:は指定できない.
-% フォーマット関連:
-% フォーマット関連={{ラベルのみのフォーマット}{ラベルフォーマット}{見出し文字列フォーマット}{見出し文字列フォーマット(ラベル無し)}{副題フォーマット}{副題フォーマット(ラベル無し)}}{{前フォーマットラベルあり}{前フォーマットラベルなし}{見出し全体のフォーマット}{後ろフォーマットラベルあり}{後ろフォーマットラベルなし}}
-% 見出しそのものは「全体フォーマット」に従い出力される.パラメータトークン#1を含み,#1=見出し本体:スペース関連と上の「見出し全体のフォーマット」に基づいて整形される.
-% 見出し全体のフォーマット内では#1=ラベル,#2=見出し文字列,#3=副題,それぞれ各々のフォーマットに基づき整形される.
-% ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題
-% ラベルのみのフォーマットは目次に使われる.
-\newcommand{\jlreq at BlockHeading@start}[6]{%
- \if at noskipsec\leavevmode\fi
- % #5と#6は\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
- \edef\jlreq at BlockHeading@start at eachformat{\expandonce{\@firstoftwo#5}}%
- \edef\jlreq at BlockHeading@start at format{\expandonce{\@secondoftwo#5}}
- \edef\jlreq at BlockHeading@start at totalformat{\unexpanded{#6}}%
- \jlreq at BlockHeading@start@{#1}{#2}{#3}{#4}%
-}
-% {1 = 命令}{2 = レベル}{3 = スペース関連}
-\newcommand{\jlreq at BlockHeading@start@}[4]{%
- \@ifstar{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{#4}}}%
-}
-% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}[5 = running head]{6 = 見出し}
-\long\def\jlreq at BlockHeading@start@@#1#2#3#4[#5]#6{%
- \@ifnextchar[{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}%
-}
-
-% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題]
-\long\def\jlreq at BlockHeading@start@@@#1#2#3#4#5#6[#7]{%
- \edef\jlreq at do{\unexpanded{\jlreq at BlockHeading@start@@@@{#1}{#2}{#3}}{\expandonce{\jlreq at BlockHeading@start at totalformat}}}%
- \jlreq at do{#4}{#5}{#6}{#7}%
-}
-
-% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = 全フォーマット}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題}
-\long\def\jlreq at BlockHeading@start@@@@#1#2#3#4#5#6#7#8{%
- \edef\jlreq at tempa##1##2##3##4##5##6##7{%
- \unexpanded{\jlreq at BlockHeading@start at makeoutput{#1}{#2}}{{##1}{##2}{##3}}{\expandonce{\jlreq at BlockHeading@start at eachformat}}{\expandonce{\jlreq at BlockHeading@start at format}}\unexpanded{{#5}{#6}{#7}{#8}}%
- \unexpanded{\def\jlreq at tempb}{{##4}{##5}{##6}}% 縦方向空き
- \noexpand\jlreq at ifempty{##7}{\noexpand\jlreq at tempatrue}{\noexpand\jlreq at tempafalse}% 偶数ページのみで改ページするならば\jlreq at tempatrue
- }%
- \jlreq at tempa#3%
- \global\advance\jlreq at BlockHeading@spaces at current@count by 1
- \gappto\jlreq at BlockHeading@spaces at current@sequence{_#1}%
- % 連続する見出しの間の処理をするために,即時では出力せず,いったんマクロに格納する.
- % \jlreq at BlockHeading@spaces at current@before@<n>
- % \jlreq at BlockHeading@start at gyodori\jlreq at BlockHeading@spaces at current@space@<n>{jlreq at BlockHeading@spaces at current@output@<n>}
- % ↑\jlreq at BlockHeading@spaces at current@format@<n>で整形される.
- % \jlreq at BlockHeading@spaces at current@after@<n>
- % として後に呼び出される.(spaceは書き換えられる可能性がある.)
- \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@output@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
- \expandonce{\jlreq at resultb}%
- }%
- \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@space@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
- \expandonce{\jlreq at tempb}%
- }%
- \def\@tempa##1##2##3{##1}%
- \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
- \expandonce{\@tempa#4}%
- \expandonce{\jlreq at resulta}%
- \ifjlreq at tempa\unexpanded{%
- \jlreq at setcurrentpage
- \edef\jlreq at BlockHeading@currentpage{\the\jlreq at currentpage}%
- }\fi
- }%
- \def\@tempa##1##2##3{##2}%
- \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@format@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
- \expandonce{\@tempa#4}%
- }%
- \def\@tempa##1##2##3{##3}%
- \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
- \expandonce{\jlreq at resultc}%
- \ifjlreq at tempa\unexpanded{%
- \ifx\jlreq at BlockHeading@currentpage\@empty\nobreak\else
- \ifodd\jlreq at BlockHeading@currentpage\nobreak\else\allowbreak\fi
- \fi
- }\else\noexpand\nobreak\fi
- % 現状ここ↓は常に空
- \expandonce{\@tempa#4}%
- }%
- \ifx\jlreq at BlockHeading@spaces at headingslist\@empty
- \expandafter\jlreq at BlockHeading@spaces at outputwospace
- \expandafter\ignorespaces
- \else
- \expandafter\jlreq at BlockHeading@start at afterheading
- \fi
-}
-
-\def\jlreq at BlockHeading@start at afterheading{\futurelet\jlreq at nextchar\jlreq at BlockHeading@start at afterheading@}
-\edef\jlreq at BlockHeading@start at afterheading@{%
- \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq at nextchar\expandafter\jlreq at BlockHeading@start at afterheading@@}%
- \unexpanded{\else\expandafter\jlreq at BlockHeading@start at afterheading@@@\fi}%
-}
-% スペースを読み飛ばす
-\expandafter\def\expandafter\jlreq at BlockHeading@start at afterheading@@\space{\jlreq at BlockHeading@start at afterheading}
-\def\jlreq at BlockHeading@start at afterheading@@@{%
- \def\jlreq at do{\jlreq at BlockHeading@spaces at output}%
- \@for\@tempa:=\jlreq at BlockHeading@allheadings\do{%
- \expandafter\ifx\csname\@tempa\endcsname\jlreq at nextchar\def\jlreq at do{}\fi
- }%
- % \jlreq at BlockHeading@HeadingSpaces at ignoretokens内のものは特別扱いする
- \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq at BlockHeading@HeadingSpaces at ignoretokens\do{%
- \expandafter\ifx\@tempa\jlreq at nextchar
- \def\jlreq at do{\jlreq at BlockHeading@start at afterheading@saveafter at cs}%
- \fi
- }%
- \jlreq at do
-}
-
-% コントロールシークエンスを保存
-\long\def\jlreq at BlockHeading@start at afterheading@saveafter at cs#1{%
- \csgappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{#1}%
- \jlreq at BlockHeading@start at afterheading@saveafter at option
-}
-% オプションがあれば保存
-\def\jlreq at BlockHeading@start at afterheading@saveafter at option{%
- \@ifnextchar[{\jlreq at BlockHeading@start at afterheading@saveafter at option@}{\jlreq at BlockHeading@start at afterheading@saveafter at arguments}%
-}
-\long\def\jlreq at BlockHeading@start at afterheading@saveafter at option@[#1]{%
- \csxappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{\unexpanded{[#1]}}%
- \jlreq at BlockHeading@start at afterheading@saveafter at arguments
-}
-% 引数を保存し続けるループ
-\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments{%
- \futurelet\jlreq at nextchar\jlreq at BlockHeading@start at afterheading@saveafter at arguments@
-}
-\edef\jlreq at BlockHeading@start at afterheading@saveafter at arguments@{%
- \noexpand\ifx\space\unexpanded{\jlreq at nextchar\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@\else\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@\fi}%
-}
-\expandafter\def\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@\space{%
- \csgappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{ }%
- \jlreq at BlockHeading@start at afterheading@saveafter at arguments
-}
-\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@{%
- \jlreq at ifnextchar\bgroup{\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@@}{\jlreq at BlockHeading@start at afterheading}%
-}
-\long\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@@#1{%
- \csxappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{\unexpanded{{#1}}}%
- \jlreq at BlockHeading@start at afterheading@saveafter at arguments
-}
-
-% 特別扱いしたいマクロを並べる
-\def\jlreq at BlockHeading@HeadingSpaces at ignoretokens{\label}
-
-% \jlreq at resulta -> before, \jlreq at resultb -> 本体,\jlreq at resultc -> after
-% {1 = 命令}{2 = レベル}{3 = スペース関連(横方向のみ)}{4 = フォーマット群}{5 = まとめたフォーマット群}{6 = *}{7 = running head}{8 = 見出し}{9 = 副題}
-\long\def\jlreq at BlockHeading@start at makeoutput#1#2#3#4#5#6#7#8#9{%
- \begingroup
- % ラベルがありか否か.\jlreq at tempc = \@emptyならばラベルあり
- \ifnum #2>\c at secnumdepth
- \def\jlreq at tempc{*}%
- \else
- \def\jlreq at tempc{#6}%
- \fi
- \edef\jlreq at tempa{\expandafter\jlreq at BlockHeading@start at geteachformat\expandafter{\jlreq at tempc}#4}% {ラベルフォーマット}{本文フォーマット}{副題フォーマット}
- \edef\jlreq at tempb{\expandafter\jlreq at BlockHeading@start at getformat\expandafter{\jlreq at tempc}#5}% {まとめるフォーマット}
- \edef\jlreq at do{\noexpand\jlreq at BlockHeading@start at makeoutput@@\expandonce{\jlreq at tempa}\expandonce{\jlreq at tempb}\unexpanded{{#8}{#9}}}%
- \jlreq at do
- \edef\jlreq at do{\noexpand\jlreq at BlockHeading@start at makeoutput@\unexpanded{#3}{\expandonce{\jlreq at result}}}%
- \jlreq at do
- % \jlreq at tempa -> 素のラベルフォーマット
- \edef\jlreq at tempa{\jlreq at BlockHeading@start at getonlylabelformat#4}%
- \edef\jlreq at do{%
- \unexpanded{\def\jlreq at resulta}{%
- \ifx\jlreq at tempc\@empty
- \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
- \unexpanded{\refstepcounter{#1}}%
- \else
- \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
- \fi
- \jlreq at ifempty{#8}%
- {\unexpanded{\long\gdef\jlreqHeadingText####1{}}}%
- {\unexpanded{\long\gdef\jlreqHeadingText####1{####1}}}%
- \jlreq at ifempty{#9}%
- {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{}}}%
- {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{####1}}}%
- }%
- \unexpanded{\def\jlreq at resultb}{%
- \expandonce{\jlreq at result}%
- }%
- \unexpanded{\def\jlreq at resultc}{%
- \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{\unexpanded{#6}}{\expandonce{\jlreq at tempa}}{\unexpanded{#7}}%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-% {ラベルフォーマット}{本文フォーマット}{副題フォーマット}に展開される.
-% {1 = 空ならばラベルあり}{2 = ラベルのみのフォーマット}{3 = ラベルフォーマット}{4 = 見出し文字列フォーマット}{5 = 見出し文字列フォーマット(ラベル無し)}{6 = 副題フォーマット}{7 = 副題フォーマット(ラベル無し)}
-\long\def\jlreq at BlockHeading@start at geteachformat#1#2#3#4#5#6#7{%
- \jlreq at ifempty{#1}{\unexpanded{{#3}{#4}{#6}}}{\unexpanded{{}{#5}{#7}}}%
-}
-% {全体フォーマット}に展開される.
-% {1 = 空ならばラベルあり}{2 = 前フォーマットラベルあり}{3 = 前フォーマットラベルなし}{4 = 見出し全体のフォーマット}{5 = 後ろフォーマットラベルあり}{6 = 後ろフォーマットラベルなし}
-\long\def\jlreq at BlockHeading@start at getformat#1#2#3#4#5#6{%
- \jlreq at ifempty{#1}{{\unexpanded{#2#4#6}}}{{\unexpanded{#3#4#6}}}%
-}
-\long\def\jlreq at BlockHeading@start at getonlylabelformat#1#2#3#4#5#6{\unexpanded{#1}}%
-
-% 横方向の空き調整を入れて,\jlreq at resultに返す.
-% {1 = 配置(clr)}{2 = 字下げ}{3 = 字上げ}{4 = 出力}
-\long\def\jlreq at BlockHeading@start at makeoutput@#1#2#3#4{%
- \edef\jlreq at result{%
- \noexpand\noindent
- \jlreq at ifempty{#2}{}{\unexpanded{\hskip #2}}%
- \noexpand\vbox{%
- \noexpand\noindent
- \ifx#1c\noexpand\centering\fi
- \ifx#1r\noexpand\raggedleft\fi
- \jlreq at ifempty{#2}{}{\unexpanded{\hsize=\dimexpr\hsize - #2\relax}}%
- \jlreq at ifempty{#3}{}{\unexpanded{\hsize=\dimexpr\hsize - #3\relax}}%
- \unexpanded{#4}%
- }%
- }%
-}
-
-% {1 = ラベルフォーマット}{2 = 見出し文字列フォーマット}{3 = 副題フォーマット}{4 = 全体フォーマット}{5 = 見出し}{6 = 副題}
-% \jlreq at resultに出力対象を入れる
-\long\def\jlreq at BlockHeading@start at makeoutput@@#1#2#3#4#5#6{%
- \begingroup
- \long\def\jlreq at tempa##1{#2}% 見出し文字列
- \expandafter\def\expandafter\jlreq at tempa\expandafter{\jlreq at tempa{#5}}%
- \jlreq at ifempty{#6}{%
- \def\jlreq at tempb{}%
- }{%
- \long\def\jlreq at tempb##1{#3}% 副題
- \expandafter\def\expandafter\jlreq at tempb\expandafter{\jlreq at tempb{#6}}%
- }%
- \long\def\jlreq at tempc##1##2##3{#4}% 全体のフォーマット
- % 二度展開すると欲しいものが得られる
- \edef\jlreq at tempa{\noexpand\jlreq at tempc{\unexpanded{#1}}{\expandonce{\jlreq at tempa}}{\expandonce{\jlreq at tempb}}}%
- \edef\jlreq at do{%
- \unexpanded{\def\jlreq at result}{\expandafter\expandonce\expandafter{\jlreq at tempa}}%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\def\jlreq at BlockHeading@start at removecolumn#1:{#1}
-
-% 空き指定を解釈する.a:10pt -> \jlreq at resulta=a,\jlreq at resultb=10pt
-\def\jlreq at BlockHeading@start at analyzespace#1:#2\jlreq at endmark{%
- \jlreq at ifempty{#1}{%
- \def\jlreq at resulta{}%
- \def\jlreq at resultb{}%
- }{%
- \let\jlreq at resulta=#1%
- \edef\jlreq at resultb{\expandonce{\jlreq at BlockHeading@start at removecolumn#2}}%
- }%
-}
-
-% 行取り処理.#3が空の時は行取りの処理はしない.(空白挿入は行う.)
-% {1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}{4 = 出力}
-% 最後には\nobreak(と\vskip)が入っている
-\long\def\jlreq at BlockHeading@start at gyodori#1#2#3#4{\par{%
- \setbox\jlreq at tempboxa=\vbox{#4}%
- % \jlreq at tempskip(a/b)に前/後ろに入れるべき値を入れる
- % #1がa:ならばその値は\jlreq at tempskipaには足さず\jlreq at tempskipcに入れておく
- \jlreq at tempskipa=0pt
- \jlreq at tempskipb=0pt
- \jlreq at tempskipc=0pt
- \jlreq at BlockHeading@start at analyzespace#1:\jlreq at endmark
- \let\jlreq at maeakitype=\jlreq at resulta
- \let\jlreq at maeaki=\jlreq at resultb
- \jlreq at BlockHeading@start at analyzespace#2:\jlreq at endmark
- \let\jlreq at ushiroakitype=\jlreq at resulta
- \let\jlreq at ushiroaki=\jlreq at resultb
- \def\jlreq at lines{#3}%
- % 両方強制指定の場合は行数を無視する.
- \ifx r\jlreq at maeakitype\ifx r\jlreq at ushiroakitype\def\jlreq at lines{}\fi\fi
- \setbox\jlreq at tempboxb=\hbox{阿}%
- \ifx\jlreq at lines\@empty
- \ifx\jlreq at maeaki\@empty\else
- \ifx a\jlreq at maeakitype
- \jlreq at tempskipc=\glueexpr\jlreq at maeaki\relax
- \else
- \jlreq at tempskipa=\glueexpr\jlreq at maeaki\relax
- \fi
- \fi
- \ifx\jlreq at ushiroaki\@empty\else
- \jlreq at tempskipb=\glueexpr\jlreq at ushiroaki\relax
- \fi
- \else
- % 行取り時の前後の空きを足した値を\jlreq at tempdimaに入れる
- \jlreq at tempdima=\glueexpr(#3\baselineskip - \baselineskip - \ht\jlreq at tempboxa - \dp\jlreq at tempboxa)\relax
- \ifx\jlreq at maeakitype\@empty
- \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2\relax
- \else
- \ifx a\jlreq at maeakitype
- \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2\relax
- \jlreq at tempskipc=\glueexpr\jlreq at maeaki\relax
- \fi
- \ifx s\jlreq at maeakitype
- \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2 + \jlreq at maeaki\relax
- \jlreq at tempdima=\dimexpr\jlreq at tempdima + \jlreq at maeaki\relax
- \fi
- \ifx r\jlreq at maeakitype
- \jlreq at tempskipa=\glueexpr\jlreq at maeaki\relax
- \jlreq at tempdima=\dimexpr\jlreq at tempdima + \baselineskip - \dp\jlreq at tempboxb\relax
- \fi
- \fi
- \ifx\jlreq at ushiroakitype\@empty
- \jlreq at tempskipb=\glueexpr\jlreq at tempdima - \jlreq at tempskipa\relax
- \else
- \ifx a\jlreq at ushiroakitype
- \jlreq at tempskipb=\glueexpr\jlreq at tempdima - \jlreq at tempskipa + \jlreq at ushiroaki\relax
- \fi
- \ifx r\jlreq at ushiroakitype
- \jlreq at tempskipb=\glueexpr\jlreq at ushiroaki\relax
- \jlreq at tempskipa=\glueexpr\jlreq at tempdima - \jlreq at tempskipb + \baselineskip - \ht\jlreq at tempboxb\relax
- \fi
- \fi
- % \jlreq at tempdimaの利用ここまで
- \fi
- \jlreq at ifgluezero\jlreq at tempskipc{}{\vskip\jlreq at tempskipc\relax}%
- \ifx r\jlreq at maeakitype\prevdepth=-1000pt\fi
- % \jlreq at tempdimb, \jlreq at tempdimcに出力対称の高さを深さを代入
- \jlreq at tempdimb=\ht\jlreq at tempboxa
- \jlreq at tempdimc=\dp\jlreq at tempboxa
- \setbox\jlreq at tempboxa=\vbox{%
- \jlreq at ifgluezero\jlreq at tempskipa{}{\vskip\jlreq at tempskipa}%
- \unvbox\jlreq at tempboxa
- }%
- \ifx\jlreq at lines\@empty
- \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa - \jlreq at tempdimb\relax
- \ht\jlreq at tempboxa=\jlreq at tempdimb
- \box\jlreq at tempboxa
- \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt \else\prevdepth=\jlreq at tempdimc\fi
- % \jlreq at tempdimb, \jlreq at tempdimcの利用ここまで
- \else
- \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa\relax
- \ht\jlreq at tempboxa=0pt
- \box\jlreq at tempboxa
- \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt \else\prevdepth=0pt \fi
- \fi
- \nobreak
- \jlreq at ifgluezero\jlreq at tempskipb{}{\vskip\jlreq at tempskipb}%
- \edef\jlreq at do{%
- \ifdim\parskip=0pt \else
- \unexpanded{\def\jlreq at parhook@gyodori}{%
- \noexpand\parskip=\the\parskip
- \unexpanded{\def\jlreq at parhook@gyodori{}}%
- }%
- \unexpanded{\parskip=0pt plus 1pt}%
- \fi
- }%
- \expandafter}\jlreq at do
-}
-\PushPostHook{par}{\jlreq at parhook@gyodori}
-\def\jlreq at parhook@gyodori{}
-
-% 行取り情報をゲットだぜ
-% \jlreq at resultに{1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}を入れる
-% #2#3#4はそれぞれ前空き,後ろ開き,トータル行数のデフォルト値
-% *つきは\setkeys*を使う.[]はkeyvalのファミリー.
-\def\jlreq at BlockHeading@gyodori at parsekeyval{%
- \@ifstar{\jlreq at BlockHeading@gyodori at parsekeyval@{*}}{\jlreq at BlockHeading@gyodori at parsekeyval@{}}%
-}
-\def\jlreq at BlockHeading@gyodori at parsekeyval@#1{%
- \@ifnextchar[{\jlreq at BlockHeading@gyodori at parsekeyval@@{#1}}{\jlreq at BlockHeading@gyodori at parsekeyval@@{#1}[jlreq at key]}%
-}
-\long\def\jlreq at BlockHeading@gyodori at parsekeyval@@#1[#2]#3#4#5#6{%
- \begingroup
- \def\jlreq at lines{#6}%
- \def\jlreq at before@space{}%
- \def\jlreq at before@lines{}%
- \def\jlreq at after@space{}%
- \def\jlreq at after@lines{}%
- \jlreq at parsekeyval#1[#2]{
- {lines}{\def\jlreq at lines{##1}}
- {before_space}{\def\jlreq at before@space{##1}}
- {after_space}{\def\jlreq at after@space{##1}}
- {before_lines}{%
- \jlreq at ifempty{##1}{\def\jlreq at before@lines{}}{%
- \jlreq at iffirsttoken@ignorespaces{##1}{*}%
- {\edef\jlreq at before@lines{s:\expandonce{\@gobble ##1}}}%
- {\def\jlreq at before@lines{a:##1}}%
- }%
- }
- {after_lines}{\def\jlreq at after@lines{##1}}
- }{#3}%
- % before/after_lines優先
- \ifx\jlreq at before@space\@empty\else\edef\jlreq at before@space{r:\expandonce{\jlreq at before@space}}\fi
- \ifx\jlreq at before@lines\@empty\else\edef\jlreq at before@space{\expandonce{\jlreq at before@lines}\baselineskip}\fi
- \ifx\jlreq at before@space\@empty\def\jlreq at before@space{#4}\fi
- \ifx\jlreq at after@space\@empty\else\edef\jlreq at after@space{r:\expandonce{\jlreq at after@space}}\fi
- \ifx\jlreq at after@lines\@empty\else\edef\jlreq at after@space{a:\expandonce{\jlreq at after@lines}\baselineskip}\fi
- \ifx\jlreq at after@space\@empty\def\jlreq at after@space{#5}\fi
- \edef\jlreq at do{%
- \unexpanded{\def\jlreq at result}{{\expandonce{\jlreq at before@space}}{\expandonce{\jlreq at after@space}}{\expandonce{\jlreq at lines}}}%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\newbox\jlreq at BlockHeading@start at label@box
-% \DeclareBlockHeading{命令名}{レベル}{設定}
-\def\jlreq at BlockHeading@allheadings{}% 別行見出し一覧
-\newcommand{\DeclareBlockHeading}[3]{%
- \def\jlreq at do{\@removeelement{#1}}%
- \expandafter\jlreq at do\expandafter{\jlreq at heading@allheadings}{\jlreq at heading@allheadings}%
- \appto\jlreq at heading@allheadings{,#1}%
- \expandafter\jlreq at do\expandafter{\jlreq at BlockHeading@allheadings}{\jlreq at BlockHeading@allheadings}%
- \appto\jlreq at BlockHeading@allheadings{,#1}%
- \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
- \expandafter\edef\csname jlreq at heading@setting@#1\endcsname{\unexpanded{#3}}%
- \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewBlockHeading}%
- \@ifundefined{c@#1}{\newcounter{#1}}{}%
- \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
- \jlreq at heading@make at maketoc{#1}{#2}%
- \begingroup
- \def\jlreq at font{}%
- \def\jlreq at subtitle@font{}%
- \def\jlreq at indent{0\zw}%
- \def\jlreq at end@indent{0\zw}%
- \def\jlreq at align{l}%
- \edef\jlreq at format{\unexpanded{##1##2##3}}%
- \edef\jlreq at heading@text at format{\unexpanded{##1}}%
- \def\jlreq at pagebreak{}%
- \def\jlreq at label@format{\@seccntformat{#1}}%
- \newif\ifjlreq at second@text at indent@withlabel\jlreq at second@text at indent@withlabeltrue
- \def\jlreq at after@label at space{1\zw}%
- \def\jlreq at second@heading at text@indent at wlabel{0pt}%
- \def\jlreq at second@heading at text@indent at wolabel{0pt}%
- \edef\jlreq at subtitle@format{\unexpanded{---##1---}}%
- \newif\ifjlreq at subtitleindent@withlabel\jlreq at subtitleindent@withlabeltrue
- \def\jlreq at subtitle@indent{1\zw}%
- \def\jlreq at afterindent{\@afterindenttrue}%
- \def\jlreq at allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空,そうでないなら*
- \newif\ifjlreq at subtitle@break\jlreq at subtitle@breaktrue
- \def\jlreq at subtitle@indent{1\zw}%
- \def\jlreq at column@spanning{false}%
- \newif\ifjlreq at column@spanning at possible\jlreq at column@spanning at possiblefalse
- \newif\ifjlreq at number \jlreq at numbertrue
- % a,bみたいなのをaとbにわける.カンマがなければbは空.引数を{a}{b}として##2を呼び出す.
- \def\jlreq at parsecomma##1##2{%
- \jlreq at helper@dividebycomma{##1}%
- \jlreq at if{\ifjlreq at result\fi}{%
- \edef\jlreq at do{\noexpand\jlreq at tempa{\expandonce{\jlreq at resulta}}{\expandonce{\jlreq at resultb}}}%
- }{%
- \edef\jlreq at do{\noexpand\jlreq at tempa{##1}{}}%
- }%
- \def\jlreq at tempa####1####2{##2}%
- \jlreq at do
- }%
- \jlreq at parsekeyval[BlockHeading:#1]{
- {lines}{}
- {before_space}{}
- {after_space}{}
- {before_lines}{}
- {after_lines}{}
- {font}{\def\jlreq at font{##1}}
- {subtitle_font}{\def\jlreq at subtitle@font{##1}}
- {indent}{\def\jlreq at indent{##1}}
- {end_indent}{\def\jlreq at end@indent{##1}}
- {align}[left,center,right]{%
- \jlreq at switch{##1}{
- {left}{\def\jlreq at align{l}}
- {center}{\def\jlreq at align{c}}
- {right}{\def\jlreq at align{r}}
- }%
- }
- {format}{\edef\jlreq at format{\unexpanded{##1}}}
- {after_label_space}{\def\jlreq at after@label at space{##1}}
- {second_heading_text_indent,heading_text_second_indent}{%
- \jlreq at parsecomma{##1}{%
- \jlreq at iffirsttoken{####1}{*}{%
- \jlreq at second@text at indent@withlabelfalse
- \edef\jlreq at second@heading at text@indent at wlabel{\expandonce{\@gobble ####1}}%
- }{%
- \jlreq at second@text at indent@withlabeltrue
- \def\jlreq at second@heading at text@indent at wlabel{####1}%
- }%
- \jlreq at ifempty{####2}{%
- \let\jlreq at second@heading at text@indent at wolabel=\jlreq at second@heading at text@indent at wlabel
- }{%
- \def\jlreq at second@heading at text@indent at wolabel{####2}%
- }%
- }%
- }
- {label_format}{\edef\jlreq at label@format{\unexpanded{##1}}}
- {subtitle_format}{\edef\jlreq at subtitle@format{\unexpanded{##1}}}
- {subtitle_indent}{%
- \jlreq at iffirsttoken{##1}{*}{%
- \jlreq at subtitleindent@withlabelfalse
- \edef\jlreq at subtitle@indent{\expandonce{\@gobble ##1}}%
- }{%
- \jlreq at subtitleindent@withlabeltrue
- \def\jlreq at subtitle@indent{##1}%
- }%
- }
- {subtitle_break}[true,false]{\csname jlreq at subtitle@break##1\endcsname}
- {afterindent}[true,false]{\edef\jlreq at afterindent{\expandonce{\csname @afterindent##1\endcsname}}}
- {allowbreak_if_evenpage}[true,false]{%
- \jlreq at switch{##1}{
- {true}{\def\jlreq at allowbreak@evenpage{}}
- {false}{\def\jlreq at allowbreak@evenpage{*}}
- }%
- }
- {pagebreak}[clearpage,cleardoublepage,clearcolumn,nariyuki,begin_with_odd_page,begin_with_even_page]{%
- \jlreq at switch{##1}{
- {clearpage}{\def\jlreq at pagebreak{\clearpage}\jlreq at column@spanning at possibletrue}
- {cleardoublepage}{\def\jlreq at pagebreak{\cleardoublepage}\jlreq at column@spanning at possibletrue}
- {clearcolumn}{\if at twocolumn\def\jlreq at pagebreak{\newpage}\else\def\jlreq at pagebreak{}\fi\jlreq at column@spanning at possiblefalse}
- {begin_with_even_page}{\def\jlreq at pagebreak{\cleartoevenpage[empty]}\jlreq at column@spanning at possibletrue}
- {begin_with_odd_page}{\def\jlreq at pagebreak{\cleartooddpage[empty]}\jlreq at column@spanning at possibletrue}
- {nariyuki}{\def\jlreq at pagebreak{}\jlreq at column@spanning at possiblefalse}
- }%
- }
- % 後々数字を受け付けるようになったりするかもしれないので……
- {column_spanning}{%
- \jlreq at tempatrue % validな入力に対してfalse
- \jlreq at ifempty{##1}{}{%
- \jlreq at ifnumber{##1}{% 数字の時はtrueに回す
- \jlreq at tempafalse
- \def\jlreq at column@spanning{true}%
- }{%
- \jlreq at switch{##1}{%
- {true}{\jlreq at tempafalse\def\jlreq at column@spanning{true}}
- {false}{\jlreq at tempafalse\def\jlreq at column@spanning{false}}
- }%
- }%
- }%
- \ifjlreq at tempa\ClassWarningNoLine{jlreq}{Invalid input `##1' for column_spanning in BlockHeading #1}\fi
- }
- {number}[true,false]{\csname jlreq at number##1\endcsname}
- }{#3}%
- \def\jlreq at do{}% 初期化.これに最終処理を入れていく.
- % 入力チェック
- \ifthenelse{\equal{\jlreq at column@spanning}{true}}{%
- \ifjlreq at column@spanning at possible\else
- \ClassWarningNoLine{jlreq}{column_spanning can be used only with `pagebreak=nariyuki' or `pagebreak=clearcolumn' (in BlockHeading #1)}%
- \def\jlreq at column@spanning{false}%
- \fi
- }{}%
- % ラベルありフォーマット:前
- \edef\jlreq at pre@format at wlabel{%
- \noexpand\noindent
- \expandonce{\jlreq at font}%
- \ifnum 0\ifjlreq at second@text at indent@withlabel 1\fi\ifjlreq at subtitleindent@withlabel 1\fi>0
- \unexpanded{\setbox\jlreq at BlockHeading@start at label@box=\hbox}{\expandonce{\jlreq at label@format}}%
- \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{\the\wd\jlreq at BlockHeading@start at label@box}}%
- \unexpanded{\def\jlreq at BlockHeading@start at outputlabel{\box\jlreq at BlockHeading@start at label@box}}%
- \else
- \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{0pt}}%
- \unexpanded{\def\jlreq at BlockHeading@start at outputlabel}{\expandonce{\jlreq at label@format}}%
- \fi
- }%
- % ラベルなしフォーマット:前
- \edef\jlreq at pre@format at wolabel{%
- \noexpand\noindent
- \expandonce{\jlreq at font}%
- \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{0pt}}%
- \unexpanded{\def\jlreq at BlockHeading@start at outputlabel}{}%
- }%
- % 空き量などの調整を含んだラベル
- \edef\jlreq at label@format at modified{%
- \noexpand\jlreq at BlockHeading@start at outputlabel
- \unexpanded{\inhibitglue\hbox{}}%
- \ifdim\dimexpr\jlreq at after@label at space\relax=0pt \else
- \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq at after@label at space}\noexpand\relax}%
- \fi
- }%
- \edef\jlreq at heading@text at format@wlabel{%
- \ifnum 0\ifdim\jlreq at second@heading at text@indent at wlabel=0pt \else 1\fi\ifjlreq at second@text at indent@withlabel 1\fi>0
- \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq at second@heading at text@indent at wlabel})%
- \ifjlreq at second@text at indent@withlabel + (\expandonce{\jlreq at after@label at space}) + \unexpanded{\jlreq at BlockHeading@start at labellength}\fi
- \noexpand\relax
- \fi
- \expandonce{\jlreq at heading@text at format}%
- }%
- \edef\jlreq at heading@text at format@wolabel{%
- \ifdim\dimexpr\jlreq at second@heading at text@indent at wolabel\relax=0pt \else
- \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at second@heading at text@indent at wolabel}\noexpand\relax
- \fi
- \expandonce{\jlreq at heading@text at format}%
- }%
- % 副題:ラベルありかなしかはhangindentの扱いだけなので,他はまとめる
- \def\jlreq at make@subtitle at format##1##2{%
- \edef##1{%
- \ifjlreq at subtitle@break
- \noexpand\par
- ##2%
- \unexpanded{\nobreak\noindent}%
- \else
- \ifdim\jlreq at subtitle@indent=0pt \else
- \noexpand\hspace*{\expandonce{\jlreq at subtitle@indent}}%
- \fi
- \fi
- {\expandonce{\jlreq at subtitle@font}\expandonce{\jlreq at subtitle@format}}%
- }%
- }%
- \jlreq at make@subtitle at format\jlreq at subtitle@format at wlabel{%
- \ifjlreq at subtitleindent@withlabel
- \noexpand\hangafter=0
- \unexpanded{\hangindent=\dimexpr}\noexpand\jlreq at BlockHeading@start at labellength + (\expandonce{\jlreq at after@label at space}) + (\expandonce{\jlreq at subtitle@indent})\noexpand\relax
- \else
- \ifdim\jlreq at subtitle@indent=0pt \else
- \noexpand\hangafter=0
- \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at subtitle@indent}\noexpand\relax
- \fi
- \fi
- }%
- \jlreq at make@subtitle at format\jlreq at subtitle@format at wolabel{%
- \ifdim\jlreq at subtitle@indent=0pt \else
- \noexpand\hangafter=0
- \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at subtitle@indent}\noexpand\relax
- \fi
- }%
- \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
- \eappto\jlreq at do{\expandonce{\jlreq at result}}%
- \jlreq at BlockHeading@gyodori at parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
- \let\jlreq at spaceset=\jlreq at result
- \edef\jlreq at totalformat{\unexpanded{##1}}%
- \edef\jlreq at totalformat@after{\expandonce{\jlreq at afterindent}\noexpand\@afterheading}%
- \if at twocolumn
- \ifthenelse{\equal{\jlreq at column@spanning}{true}}{%
- \def\@tempa##1##2##3{%
- % 前開きが常に入ってしまうので,a:の時は除去する
- \jlreq at iffirsttoken{##1}{a}{\def\jlreq at spaceset{{}{##2}{##3}}}{}%
- \edef\jlreq at totalformat{%
- \unexpanded{\jlreq at if{\if at twocolumn\fi}}{%
- \noexpand\twocolumn[{%
- % 普段自動で入る\topskipと\baselineskipを手動で入れる
- \jlreq at iffirsttoken{##1}{r}{}{\unexpanded{\vskip\topskip\relax}}%
- \unexpanded{####1}%
- \jlreq at iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
- }]%
- }{%
- \expandonce{\jlreq at totalformat}
- }%
- }%
- }%
- \expandafter\@tempa\jlreq at spaceset
- \def\jlreq at totalformat@after{}%
- }{%
- }%
- \fi
- \edef\jlreq at do{%
- \expandonce{\jlreq at do}%
- \noexpand\edef\expandonce{\csname jlreq at headingcs@#1\endcsname}{\noexpand\unexpanded{%
- \noexpand\jlreq at hook@beforeheadings{#1}%
- \expandonce{\jlreq at pagebreak}%
- \unexpanded{\jlreq at BlockHeading@start{#1}{#2}}%
- {{\expandonce{\jlreq at align}}{\expandonce{\jlreq at indent}}{\expandonce{\jlreq at end@indent}}\expandonce{\jlreq at spaceset}{\expandonce{\jlreq at allowbreak@evenpage}}}%
- {\ifjlreq at number\else -\fi}%
- {%
- {%
- {\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at label@format at modified}}%
- {\expandonce{\jlreq at heading@text at format@wlabel}}{\expandonce{\jlreq at heading@text at format@wolabel}}%
- {\expandonce{\jlreq at subtitle@format at wlabel}}{\expandonce{\jlreq at subtitle@format at wolabel}}%
- }%
- {%
- {\expandonce{\jlreq at pre@format at wlabel}}{\expandonce{\jlreq at pre@format at wolabel}}%
- {\expandonce{\jlreq at format}}%
- {}{}%
- }%
- }%
- {{}{\expandonce{\jlreq at totalformat}}{\expandonce{\jlreq at totalformat@after}}}%
- }}%
- \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq at headingcs@#1\endcsname}}%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\newcommand{\NewBlockHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareBlockHeading{#1}{#2}{#3}}%
-}
-\newcommand{\RenewBlockHeading}[3]{%
- \@ifundefined{#1}{\@latex at error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareBlockHeading{#1}{#2}{#3}}%
-}
-\newcommand{\ProvideBlockHeading}[3]{%
- \@ifundefined{#1}{\DeclareBlockHeading{#1}{#2}{#3}}{}%
-}
-
-%.. 別行見出しが連続した場合の処理
-% 設定値保存に次のマクロを使う
-% \jlreq at BlockHeading@spaces at headingslist
-% : スペースを考慮しないとならない見出しのリスト.,_chapter_section_subsection,_section_subsection,...みたいな感じ
-% \jlreq at BlockHeading@spaces at setlist@<見出し名リスト>
-% : 見出し名リストが続いたときの空き関連設定.<見出し名リスト>は_chapter_section_subsectionみたいなやつ.
-% {***}{***}...というリスト.各々の***は次のどれか.
-% 最初:全体への指定.{前空き}{後ろ空き}{行数}
-% _{前空き}{後ろ空き}{行数}:見出しに対する指定.先頭が_*の場合は,デフォルト設定をロードしてからということ.
-% それ以外:空き量
-% 最初や最後に空き量指定がある場合は,全体への指定に組み込むことにする.
-%
-% 現在状況保存に以下のマクロを使う
-% \jlreq at BlockHeading@spaces at current@sequence
-% : 現在どのような見出しが続いているかリスト.
-% \jlreq at BlockHeading@spaces at current@space@<n>
-% : 現在処理中のn番目の見出しに対する空き情報.{前空き}{後ろ空き}{トータル行数}{偶数ページbreak情報}.n=1から始まる.
-% \jlreq at BlockHeading@spaces at current@output@<n>
-% : 現在処理中のn番目の見出しの中身.
-% \jlreq at BlockHeading@spaces at current@format@<n>
-% : 現在処理中のn番目の見出しのフォーマット.行取りマクロを包み込むようにする.
-% \jlreq at BlockHeading@spaces at current@before@<n>
-% : n番目の見出しの前に出すもの
-% \jlreq at BlockHeading@spaces at current@after@<n>
-% : n番目の見出しの後ろに出すもの
-% \jlreq at BlockHeading@spaces at current@count
-% : 現在いくつ目の連続する見出しを処理しているかのカウンター
-\newcount\jlreq at BlockHeading@spaces at current@count
-\jlreq at BlockHeading@spaces at current@count=0
-\def\jlreq at BlockHeading@spaces at current@sequence{}
-\def\jlreq at BlockHeading@spaces at headingslist{}
-
-\newcommand{\SetBlockHeadingSpaces}[1]{%
- \begingroup
- % 現段階の情報をクリアする
- \def\jlreq at tempa{}% 見出しリスト
- \def\jlreq at tempb{}% 設定リスト \def\jlreq at BlockHeading@spaces@***{{**}{**}...}ってのを入れる
- \jlreq at SetBlockHeadingSpaces#1\jlreq at endmark
- \edef\jlreq at do{%
- \unexpanded{%
- \@for\@tempa:=\jlreq at BlockHeading@spaces at headingslist\do{%
- \expandafter\let\csname jlreq at BlockHeading@spaces at setlist@\@tempa\endcsname=\@undefined
- }%
- }%
- \unexpanded{\def\jlreq at BlockHeading@spaces at headingslist}{\expandonce{\jlreq at tempa}}%
- \expandonce{\jlreq at tempb}%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-\def\jlreq at SetBlockHeadingSpaces{% カンマを無視する処理
- \@ifnextchar,{\expandafter\jlreq at SetBlockHeadingSpaces@i\@gobble}{\jlreq at SetBlockHeadingSpaces@i}%
-}
-\def\jlreq at SetBlockHeadingSpaces@i{%
- \@ifnextchar[{\jlreq at SetBlockHeadingSpaces@ii}{\jlreq at SetBlockHeadingSpaces@ii[]}%
-}
-\def\jlreq at SetBlockHeadingSpaces@ii[#1]#2{%
- \jlreq at ifendmark{#2}{}{%
- \def\jlreq at headings{}% 見出し名リスト
- \jlreq at BlockHeading@gyodori at parsekeyval[BlockHeadingSpaces]{#1}{}{}{}%
- \let\jlreq at totalset=\jlreq at result% 上の#1に対応する設定
- \def\jlreq at set{}% 個々の設定
- \def\jlreq at lastdimen{}% 最後の寸法
- \def\jlreq at do##1##2##3{%
- \jlreq at ifempty{##1}{\jlreq at tempatrue}{\jlreq at tempafalse}% 前開きが空ならば\jlreq at tempatrue
- \jlreq at ifempty{##2}{\jlreq at tempbtrue}{\jlreq at tempbfalse}% 後ろ開きが空ならば\jlreq at tempbtrue
- }%
- \expandafter\jlreq at do\jlreq at totalset
- \jlreq at SetBlockHeadingSpaces@iii{#2}%
- \eappto\jlreq at tempa{,\expandonce{\jlreq at headings}}% \jlreq at tempaに\jlreq at headingsを追加
- \ifjlreq at tempb
- \ifx\jlreq at lastdimen\@empty\else % 最後が寸法だったので\jlreq at SetBlockHeadingSpaces@totalsetを改変
- \def\jlreq at do##1##2##3{%
- \edef\jlreq at totalset{{\unexpanded{##1}}{r:\expandonce{\jlreq at lastdimen}}{\unexpanded{##3}}}%
- }%
- \expandafter\jlreq at do\jlreq at totalset
- \fi
- \else
- \eappto\jlreq at set{{\expandonce{\jlreq at lastdimen}}}%
- \fi
- \eappto\jlreq at tempb{%
- \noexpand\@ifundefined{jlreq at BlockHeading@spaces at setlist@\jlreq at headings}{}{%
- \noexpand\ClassError{jlreq}{The spaces for \jlreq at headings\space is defined more than once (in SetBlockHeadingSpaces)}{\noexpand\@ehc}%
- }%
- \noexpand\def\expandonce{\csname jlreq at BlockHeading@spaces at setlist@\jlreq at headings\endcsname}{{\expandonce{\jlreq at totalset}}\expandonce{\jlreq at set}}%
- }%
- \jlreq at SetBlockHeadingSpaces
- }%
-}
-\def\jlreq at SetBlockHeadingSpaces@iii#1{%
- \@for\@tempa:=#1\do{%
- \expandafter\jlreq at helper@trim\expandafter{\@tempa}{\@tempa}%
- \expandafter\jlreq at iffirsttoken@ignorespaces\expandafter{\@tempa}{_}{%
- \ifx\jlreq at lastdimen\@empty\else\eappto\jlreq at set{{\expandonce{\jlreq at lastdimen}}}\fi%
- \def\jlreq at lastdimen{}%
- \expandafter\jlreq at SetBlockHeadingSpaces@iv\@tempa{\jlreq at endmark}%
- }{%
- \ifjlreq at tempa
- % 最初が寸法なので,全体の設定(\jlreq at totalset)に組み込む.
- \def\jlreq at do##1##2##3{%
- \edef\jlreq at totalset{{r:\expandonce{\@tempa}}{\unexpanded{##2}}{\unexpanded{##3}}}%
- }%
- \expandafter\jlreq at do\jlreq at totalset
- \else
- \ifx\jlreq at lastdimen\@empty\else\eappto\jlreq at set{{\expandonce{\jlreq at lastdimen}}}\fi
- \let\jlreq at lastdimen=\@tempa
- \fi
- }%
- \jlreq at tempafalse
- }%
-}
-\def\jlreq at SetBlockHeadingSpaces@iv#1#{%
- \expandafter\jlreq at ifcontains\expandafter{\@gobble #1}{_}{%
- \ClassWarning{jlreq}{Unusual heading name `\@gobble #1' is found. You forgot a comma? (in SetBlockHeadingSpaces)}%
- }{}%
- \jlreq at ifendswith{#1}{*}{{%
- \def\@tempa_##1*{\def\@tempa{##1}}%
- \@tempa#1%
- \ClassWarning{jlreq}{The heading name `\@gobble #1' ends with `*'. Do you mean `_\@tempa{*}'? (in SetBlockHeadingSpaces)}%
- }}{}%
- \appto\jlreq at headings{#1}%
- \jlreq at SetBlockHeadingSpaces@v
-}
-\def\jlreq at SetBlockHeadingSpaces@v#1{%
- % 空っぽの場合は{_{r:0pt}{r:0pt}{}}
- \jlreq at ifendmark{#1}{\appto\jlreq at set{{_{r:0pt}{r:0pt}{}}}}{%
- \jlreq at iffirsttoken{#1}{*}{% *始まりの場合は{_*{}{}{}}
- \expandafter\jlreq at BlockHeading@gyodori at parsekeyval\expandafter{\@gobble #1}{}{}{}%
- \eappto\jlreq at set{{_*\expandonce{\jlreq at result}}}%
- }{% それ以外の場合は{_{}{}{}}
- \jlreq at BlockHeading@gyodori at parsekeyval{#1}{}{}{}%
- \eappto\jlreq at set{{_\expandonce{\jlreq at result}}}%
- }%
- \@gobble % \jlreq at endmarkを食う
- }%
-}
-
-% 現在の情報に基づき出力
-\def\jlreq at BlockHeading@spaces at output{%
- \@ifundefined{jlreq at BlockHeading@spaces at setlist@\jlreq at BlockHeading@spaces at current@sequence}{%
- \jlreq at BlockHeading@spaces at outputwospace
- }{%
- \expandafter\expandafter\expandafter\jlreq at BlockHeading@spaces at output@\csname jlreq at BlockHeading@spaces at setlist@\jlreq at BlockHeading@spaces at current@sequence\endcsname\jlreq at endmark
- }%
-}
-
-% 連続スペース情報とか無視して各々の見出しを出力する
-\def\jlreq at BlockHeading@spaces at outputwospace{%
- \begingroup
- \jlreq at tempcnta=0
- \def\jlreq at do{}%
- \jlreq at BlockHeading@spaces at outputwospace@
- \jlreq at BlockHeading@spaces at clear
- \expandafter\endgroup
- \jlreq at do
-}
-\def\jlreq at BlockHeading@spaces at outputwospace@{%
- \ifnum\jlreq at tempcnta<\jlreq at BlockHeading@spaces at current@count
- \advance\jlreq at tempcnta by 1
- \eappto\jlreq at do{\csexpandonce{jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta}}%
- \edef\jlreq at tempa{%
- \unexpanded{\long\def\jlreq at tempa##1}{\csexpandonce{jlreq at BlockHeading@spaces at current@format@\the\jlreq at tempcnta}}%
- }%
- \jlreq at tempa
- \edef\jlreq at tempb{%
- \noexpand\expandonce{\noexpand\jlreq at tempa{%
- \noexpand\jlreq at BlockHeading@start at gyodori
- \csexpandonce{jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta}%
- {\csexpandonce{jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta}}%
- }}%
- }%
- \eappto\jlreq at do{\jlreq at tempb\csexpandonce{jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta}}%
- \expandafter\jlreq at BlockHeading@spaces at outputwospace@
- \fi
-}
-
-\def\jlreq at BlockHeading@spaces at output@#1#2\jlreq at endmark{%
- \def\jlreq at result{}%
- \jlreq at tempcnta=0
- \jlreq at BlockHeading@spaces at output@@#2\jlreq at endmark
- \jlreq at tempatrue % 周りの行取り処理が必要か
- \jlreq at ifempty{#1}{\jlreq at tempafalse}{}%
- \ifthenelse{\equal{#1}{{}{}{}}}{\jlreq at tempafalse}{}%
- \edef\jlreq at do{%
- \ifjlreq at tempa
- \unexpanded{\jlreq at BlockHeading@start at gyodori#1}{%
- \expandonce{\jlreq at result}%
- }%
- \else
- \expandonce{\jlreq at result}%
- \fi
- }%
- \jlreq at BlockHeading@spaces at clear
- \jlreq at do
-}
-% jlreq at resultに出力すべきものを入れていく
-\def\jlreq at BlockHeading@spaces at output@@#1{%
- \jlreq at ifendmark{#1}{}{%
- \jlreq at iffirsttoken@ignorespaces{#1}{_}{%
- \advance\jlreq at tempcnta by 1
- \expandafter\jlreq at BlockHeading@spaces at output@@@\expandafter{\@gobble #1}%
- }{%
- \appto\jlreq at result{\vskip\glueexpr #1\relax}%
- }%
- \jlreq at BlockHeading@spaces at output@@
- }%
-}
-\def\jlreq at BlockHeading@spaces at output@@@#1{%
- \edef\jlreq at do{%
- \noexpand\jlreq at BlockHeading@spaces at output@@@@
- \jlreq at iffirsttoken@ignorespaces{#1}{*}{{*}\expandonce{\@gobble #1}}{\unexpanded{{}#1}}%
- \csexpandonce{jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta}%
- {\csexpandonce{jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta}}%
- }%
- \jlreq at do
-}
-% #1: デフォルト値を使うならば*,#2#3#4が設定された値,#5#6#7がデフォルト値,#8は偶数ページの,#9が出力
-\def\jlreq at BlockHeading@spaces at output@@@@#1#2#3#4#5#6#7#8{%
- \edef\jlreq at tempa{%
- \unexpanded{\long\def\jlreq at tempa##1}{\csexpandonce{jlreq at BlockHeading@spaces at current@format@\the\jlreq at tempcnta}}%
- }%
- \jlreq at tempa
- \edef\jlreq at tempb{%
- \noexpand\expandonce{\noexpand\jlreq at tempa{%
- \noexpand\jlreq at BlockHeading@start at gyodori
- \jlreq at ifempty{#1}{\unexpanded{{#2}{#3}{#4}}}{%
- {\jlreq at ifempty{#2}{\unexpanded{#5}}{\unexpanded{#2}}}%
- {\jlreq at ifempty{#3}{\unexpanded{#6}}{\unexpanded{#3}}}%
- {\jlreq at ifempty{#4}{\unexpanded{#7}}{\unexpanded{#4}}}%
- }\unexpanded{{#8}}%
- }}%
- }%
- \eappto\jlreq at result{%
- \csexpandonce{jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta}%
- \jlreq at tempb
- \csexpandonce{jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta}%
- }%
-}
-
-% 連続見出しスペース調整用のデータをすべてクリアする
-\def\jlreq at BlockHeading@spaces at clear{%
- \begingroup
- \jlreq at tempcnta=0
- \@whilenum\jlreq at tempcnta<\jlreq at BlockHeading@spaces at current@count\do{%
- \advance\jlreq at tempcnta by 1
- \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta\endcsname=\@undefined
- \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta\endcsname=\@undefined
- \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta\endcsname=\@undefined
- \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta\endcsname=\@undefined
- }%
- \gdef\jlreq at BlockHeading@spaces at current@sequence{}%
- \global\jlreq at BlockHeading@spaces at current@count=0
- \endgroup
-}
-
-%.. 同行見出し
-% {1 = 命令名}{2 = レベル}{3 = */-}{4 = ラベルフォーマット}{5 = ラベルありフォーマット}{6 = ラベルなしフォーマット}
-% 4,5は見出し文字列が#1になる.
-\long\def\jlreq at RuninHeading@start#1#2#3#4#5#6{%
- \edef\jlreq at RuninHeading@start at format@label{\unexpanded{#4}}%
- \edef\jlreq at RuninHeading@start at format@wlabel{\unexpanded{#5}}%
- \edef\jlreq at RuninHeading@start at format@wolabel{\unexpanded{#6}}%
- \@ifstar{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{*}}}{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{#3}}}%
-}
-% {1 = 命令名}{2 = レベル}{3 = */-}{4 = running head}{5 = 見出し}
-\long\def\jlreq at RuninHeading@start@#1#2#3[#4]#5{%
- \edef\jlreq at do{\unexpanded{\jlreq at RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}}{\expandonce{\jlreq at RuninHeading@start at format@label}}{\expandonce{\jlreq at RuninHeading@start at format@wlabel}}{\expandonce{\jlreq at RuninHeading@start at format@wolabel}}}%
- \jlreq at do
-}
-% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}{6 = ラベルフォーマット}{7 = ラベルありフォーマット}{8 = ラベルなしフォーマット}
-\long\def\jlreq at RuninHeading@start@@#1#2#3#4#5#6#7#8{%
- \if at noskipsec\leavevmode\fi
- \begingroup
- \def\jlreq at do{\global\@noskipsectrue}%
- \ifnum0\jlreq at ifempty{#3}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0
- \def\jlreq at tempa##1{#8}%
- \else
- \appto\jlreq at do{\refstepcounter{#1}}%
- \def\jlreq at tempa##1{#7}%
- \fi
- \par
- \eappto\jlreq at do{%
- \noexpand\everypar{%
- \noexpand\if at noskipsec
- \unexpanded{\global\@noskipsecfalse}%
- \unexpanded{{\setbox\jlreq at tempboxa\lastbox}}%
- \noexpand\begingroup
- \expandonce{\jlreq at tempa{#5}}%
- \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{#3}{#6}{#4}%
- \noexpand\endgroup
- \noexpand\else
- \unexpanded{\everypar{}}%
- \noexpand\fi
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
- \ignorespaces
-}
-
-% \DeclareRuninHeading{命令名}{レベル}{設定}
-\newcommand*{\DeclareRuninHeading}[3]{%
- \def\jlreq at do{\@removeelement{#1}}%
- \expandafter\jlreq at do\expandafter{\jlreq at heading@allheadings}{\jlreq at heading@allheadings}%
- \appto\jlreq at heading@allheadings{,#1}%
- \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
- \expandafter\edef\csname jlreq at heading@setting@#1\endcsname{\unexpanded{#3}}%
- \expandafter\def\csname jlreq at 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 at heading@make at maketoc{#1}{#2}%
- \begingroup
- \def\jlreq at font{\normalfont\normalsize}%
- \def\jlreq at indent{0\zw}%
- \def\jlreq at after@label at space{1\zw}%
- \def\jlreq at label@font{}%
- \def\jlreq at label@format{\@seccntformat{#1}}%
- \def\jlreq at after@space{1\zw}%
- \newif\ifjlreq at number \jlreq at numbertrue
- \jlreq at parsekeyval[RuninHeading:#1]{%
- {font}{\def\jlreq at font{##1}}
- {indent}{\def\jlreq at indent{##1}}
- {label_format}{\def\jlreq at 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 at after@label at space{##1}%
- }
- {after_space}{%
- \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_space in Runin Heading #1 should be not negative}\fi
- \def\jlreq at after@space{##1}%
- }
- {number}{\csname jlreq at number##1\endcsname}
- }{#3}%
- \newif\ifjlreq at indent@zero
- \jlreq at ifgluezero{\glueexpr\jlreq at indent\relax}{\jlreq at indent@zerotrue}{\jlreq at indent@zerofalse}%
- \newif\ifjlreq at after@space at zero
- \jlreq at ifgluezero{\glueexpr\jlreq at after@space\relax}{\jlreq at after@space at zerotrue}{\jlreq at after@space at zerofalse}%
- \newif\ifjlreq at after@label at space@zero
- \jlreq at ifgluezero{\glueexpr\jlreq at after@label at space\relax}{\jlreq at after@label at spacefalse}%
- \edef\jlreq at format@wlabel{{%
- \ifjlreq at indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at indent}\noexpand\relax\fi
- \expandonce{\jlreq at font}%
- \expandonce{\jlreq at label@format}%
- \ifjlreq at after@label at space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at after@label at space}\noexpand\relax\fi
- ####1%
- \ifjlreq at after@space at zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at after@space}\noexpand\relax\fi
- }}%
- \edef\jlreq at format@wolabel{{%
- \ifjlreq at indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at indent}\noexpand\relax\fi
- \expandonce{\jlreq at font}%
- ####1%
- \ifjlreq at after@space at zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at after@space}\noexpand\relax\fi
- }}%
- \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
- \edef\jlreq at do{%
- \expandonce{\jlreq at result}%
- % パラメータトークンを含むので,\edefして\unexpandedで包む
- \noexpand\edef\expandonce{\csname #1\endcsname}{%
- \noexpand\unexpanded{%
- \unexpanded{\jlreq at hook@beforeheadings{#1}}%
- \unexpanded{\jlreq at RuninHeading@start{#1}{#2}}{\ifjlreq at number\else -\fi}{\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at format@wlabel}}{\expandonce{\jlreq at format@wolabel}}%
- }%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-\newcommand*{\NewRuninHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareRuninHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\RenewRuninHeading}[3]{%
- \@ifundefined{#1}{\@latex at error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareRuninHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\ProvideRuninHeading}[3]{%
- \@ifundefined{#1}{\DeclareRuninHeading{#1}{#2}{#3}}{}%
-}
-
-%.. 窓見出し
-\def\jlreq at CutinHeading@start#1#2#3#4#5#6#7{%
- \if at noskipsec\leavevmode\fi
- \par
- \jlreq at if{\ifnum\hangafter=1 \fi}{%
- \jlreq at CutinHeading@start@{#2}{#3}{#4}{#5}{#6}{#7}%
- }{%
- \ClassError{jlreq}{Can not use \expandafter\string\csname#1\endcsname\space here}{\@ehc}%
- }%
-}
-% 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト
-\def\jlreq at CutinHeading@start@#1#2#3#4#5#6{%
- % 一行で処理したときの見出し長さを計測
- \begingroup
- \setbox\@tempboxa=\hbox{#1#6}%
- \@tempdima=\wd\@tempboxa
- % 何行必要かを\jlreq at CutinHeading@linecountに入れる
- \ifdim\@tempdima>#5\def\jlreq at CutinHeading@linecount{3}%
- \else\ifdim\@tempdima>#4\def\jlreq at CutinHeading@linecount{2}%
- \else\def\jlreq at CutinHeading@linecount{1}\fi\fi
- % \@tempdimaが実際の一行の長さに近い
- \divide\@tempdima by \jlreq at CutinHeading@linecount
- % \jlreq at resultboxに見出し部分を,\jlreq at CutinHeading@linecountに見出し自身に何行使うかを入れる
- \ifnum\jlreq at CutinHeading@linecount=1\relax
- \setbox\jlreq at resultbox=\vbox{\parindent=0pt\rightskip=0pt\leftskip=0pt\hbox{#1#6}}%
- \def\jlreq at CutinHeading@linecount{2}%
- \else
- \jlreq at inlinenote@determinelength{#6}{#1}{}{\jlreq at CutinHeading@linecount}{\jlreq at CutinHeading@linecount}{\@tempdima}{\linewidth}%
- \def\jlreq at CutinHeading@linecount{3}%
- \fi
- % 普通の一行の高さ/深さに合わせて見出しのボックスを作る
- \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq at CutinHeading@linecount - 1\relax\baselineskip + 1\zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq at resultbox\vskip 0pt plus 1fill minus 1fill}%
- % 高さを通常の一行のそれにする
- \setbox\jlreq at tempboxa=\hbox{阿}%
- \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa - \ht\jlreq at tempboxa\relax
- \ht\@tempboxa=\ht\jlreq at tempboxa
- \noindent
- \hspace*{#2}%
- \copy\@tempboxa
- \hspace*{#3}%
- % でかい見出しボックスの分をキャンセルする空きを入れる
- % \baselineskip - \ht\jlreq at tempboxaはTeXが挿入するスキップの分
- \edef\jlreq at do{%
- \noexpand\par
- \noexpand\vskip -\the\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq at tempboxa\relax\relax
- \noexpand\hangindent=\the\dimexpr#2 + \wd\@tempboxa + #3\relax\relax
- \noexpand\hangafter=-\jlreq at CutinHeading@linecount\relax
- }%
- \expandafter\endgroup
- \jlreq at do
- \prevdepth=0pt
- % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す).
- \def\par{%
- \ifvmode\jlreq at tempatrue\else\jlreq at tempafalse\fi
- \jlreq at tempcnta=\hangafter\relax
- \jlreq at tempdima=\hangindent\relax
- \@@par
- \ifjlreq at tempa\else\advance\jlreq at tempcnta by \prevgraf\relax\fi
- \ifnum\jlreq at tempcnta<0
- \hangafter=\jlreq at tempcnta\relax
- \hangindent=\jlreq at tempdima\relax
- \else
- \@restorepar
- \fi
- }%
- \@afterindentfalse
- \@afterheading
- \ignorespaces
-}
-
-\newcommand*{\DeclareCutinHeading}[3]{%
- \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
- \expandafter\def\csname jlreq at heading@setting@#1\endcsname{#3}%
- \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewCutinHeading}%
- \begingroup
- \def\jlreq at fontcommand{\sffamily\bfseries}%
- \def\jlreq at onelinemax{6\zw}%
- \def\jlreq at twolinemax{20\zw}%
- \def\jlreq at indent{0\zw}%
- \def\jlreq at after@space{1\zw}%
- \jlreq at parsekeyval[CutinHeading:#1]{
- {font}{\def\jlreq at fontcommand{##1}}
- {onelinemax}{\def\jlreq at onelinemax{##1}}
- {twolinemax}{\def\jlreq at twolinemax{##1}}
- {indent}{\def\jlreq at indent{##1}}
- {after_space}{\def\jlreq at after@space{##1}}
- }{#3}%
- \ifthenelse{\lengthtest{\jlreq at after@space < 0.99\zw} \OR \lengthtest{\jlreq at after@space > 2.01\zw}}{%
- \jlreq at note{窓見出しと本文との空き量は,基本版面の文字サイズの全角以上,2倍未満とする (4.1.10.c).}%
- }{}%
- \edef\jlreq at do{%
- \noexpand\def\expandonce{\csname #1\endcsname}{%
- \noexpand\jlreq at CutinHeading@start{#1}{\expandonce{\jlreq at fontcommand}}{\expandonce{\jlreq at indent}}{\expandonce{\jlreq at after@space}}{\expandonce{\jlreq at onelinemax}}{\expandonce{\jlreq at twolinemax}}%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-\newcommand*{\NewCutinHeading}[3]{%
- \expandafter\@ifdefinable\csname #1\endcsname{\DeclareCutinHeading{#1}{#2}{#3}}%
-}
-\newcommand*{\RenewCutinHeading}[3]{%
- \@ifundefined{#1}{\@latex at 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 at heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}%
- \edef\jlreq at do{\csexpandonce{jlreq at heading@type@#1}{#1}{\csexpandonce{jlreq at heading@level@#1}}{\csexpandonce{jlreq at heading@setting@#1},\unexpanded{#2}}}%
- \jlreq at do
-}
-% 見出し#1をマクロ#2に保存する
-\newcommand{\SaveHeading}[2]{%
- \@ifundefined{jlreq at heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}%
- \edef#2{%
- \csexpandonce{jlreq at heading@type@#1}{\unexpanded{#1}}{\csexpandonce{jlreq at heading@level@#1}}{\csexpandonce{jlreq at heading@setting@#1}}%
- }%
-}
-
-\newcommand*{\jlreq at keepbaselineskip}[1]{%
- \begingroup
- \edef\jlreq at do{\unexpanded{#1}\noexpand\baselineskip=\the\baselineskip}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\newcommand*{\jlreq at HeadingType}[1]{%
- \ifcsname jlreq at heading@type@#1\endcsname
- \jlreq at HeadingType@{#1}{\RenewTobiraHeading}{TobiraHeading}{%
- \jlreq at HeadingType@{#1}{\RenewBlockHeading}{BlockHeading}{%
- \jlreq at HeadingType@{#1}{\RenewRuninHeading}{RuninHeading}{%
- \jlreq at HeadingType@{#1}{\RenewCutinHeading}{CutinHeading}{%
- UnknownHeading}}}}%
- \else
- UndefinedHeading%
- \fi
-}
-\newcommand*{\jlreq at HeadingType@}[2]{%
- \jlreq at if{\expandafter\expandafter\expandafter\ifx\csname jlreq at heading@type@#1\endcsname#2\fi}%
-}
-
-% 全ての見出しにマクロ#1を適用する.
-\def\jlreq at heading@execmacro at toallheadings#1{%
- \begingroup
- \def\jlreq at do{}%
- \ifx\jlreq at heading@allheadings\@undefined
- \jlreq at heading@execmacro at toallheadings@{#1}{chapter,part,section,subsection,subsubsection,paragraph,subparagraph}%
- \else
- \def\@tempa{\jlreq at heading@execmacro at toallheadings@{#1}}%
- \expandafter\@tempa\expandafter{\jlreq at heading@allheadings}%
- \fi
- \expandafter\endgroup
- \jlreq at do
-}
-
-\def\jlreq at heading@execmacro at toallheadings@#1#2{
- \@for\jlreq at tempa:=#2\do{%
- \@ifundefined{\jlreq at tempa}{}{%
- \eappto\jlreq at do{\noexpand#1{\expandonce{\jlreq at tempa}}}%
- }%
- }%
-}
-\def\jlreq at clearheadingmarks#1{%
- \@ifundefined{#1mark}{}{%
- \expandafter\let\csname#1mark\endcsname=\@gobble
- }%
-}
-
-%.. カウンターの定義(見出し本体はこのファイルの末尾で)
-\setcounter{secnumdepth}{3}
-\newcounter{part}
-\jlreq at switch{\jlreq at 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}
-
-
-%. 注
-% 文字サイズは6ポイントくらい(4.2.3.a)とりあえす\scriptsize
-%.. 合印(4.2.3)
-\newcommand*\jlreq at referencemark@format[1]{#1}
-\newif\ifjlreqadjustreferencemark
-\jlreqadjustreferencemarktrue
-\jlreq at jlreqsetup@add{reference_mark}[inline,interlinear]{
- \def\jlreq at referencemark{#1}
- \ifthenelse{\equal{\jlreq at referencemark}{inline}}{
- \def\jlreq at notemark##1{%
- \jlreq at ifydir{%
- \hbox{}\hbox{\@textsuperscript{\normalfont\jlreq at referencemark@format{##1}}}\hbox{}%
- }{%
- \setbox\@tempboxa=\hbox{\scriptsize\jlreq at referencemark@format{##1}}%
- \raise\dimexpr.5\jlreq at gol - \ht\@tempboxa\relax\box\@tempboxa
- }%
- }
- \def\jlreq at hook@prenote{\inhibitglue}
- \def\jlreq at hook@postnote{\inhibitglue}
- }{% reference_mark=interlinear
- \def\jlreq at notemark##1{{%
- \setbox\@tempboxa=\hbox{\scriptsize\jlreq at referencemark@format{##1}}%
- \@tempdima=\wd\@tempboxa
- % 行頭に来たときに頭を天にそろえる処理.
- \ifjlreqadjustreferencemark
- \jlreq at savepos@for at rest@linewidth
- \ifdim\jlreq at current@linewidth<\wd\@tempboxa
- \@tempdima=\jlreq at current@linewidth
- \fi
- \fi
- \setbox\jlreq at tempboxb=\hbox{阿}%
- \setbox\jlreq at tempboxa=\hbox to\z@{\hskip-\@tempdima\raise\dimexpr\ht\jlreq at tempboxb + \dp\@tempboxa\relax\box\@tempboxa\hss}%
- \dp\jlreq at tempboxa=0pt\ht\jlreq at tempboxa=0pt\box\jlreq at tempboxa%
- }}%
- \ifx l\jlreq at engine
- \def\jlreq at hook@prenote{%
- \jlreq at lastnodechar=\lastnodechar\relax
- \ifnum\jlreq at lastnodechar>-1 \inhibitglue\fi
- }
- \else
- % (u)platexの時は代入すると\inhibitglueが効かなくなる
- \def\jlreq at hook@prenote{%
- \ifnum\lastnodechar>-1 \inhibitglue\fi
- \jlreq at lastnodechar=\lastnodechar\relax
- }
- \fi
- \def\jlreq at hook@postnote{\jlreq at fixjfm}
- }
-}
-% \@footnotemarkをシンプルなものにする
-\def\jlreq at setdefaultnotemark#1#2{%
- \def#1{%
- \leavevmode
- \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
- #2%
- \ifhmode\spacefactor\@x at sf\fi
- \relax}%
-}
-\jlreq at setdefaultnotemark\@footnotemark\@makefnmark
-
-%.. 脚注(4.2.5)
-% (縦書きの時は傍注,4.2.6)
-% 罫線の前は行間分,最大+文字サイズ分伸びる(4.2.5.g)
-\setlength{\skip\footins}{\dimexpr\baselineskip - 1\jlreq at gol \relax plus 1\jlreq at gol}
-% 罫線の長さは,基本版面で設定した行長にもよるが,行長の1/3くらいにする.
-\def\jlreq at footnote@rulewidth{.333\textwidth}
-\begingroup
- \footnotesize
- \edef\jlreq at do{
- \unexpanded{\setlength{\footnotesep}}{\the\dimexpr .7\baselineskip\relax}% 何でかわからん……
- \unexpanded{\def\footnoterule}{%
- % この罫線は,表罫(おもてけい)とする.
- \unexpanded{\hrule width \jlreq at footnote@rulewidth height \jlreq at omotekeiwidth}%
- % 脚注の行間よりやや広くする(4.2.5.f)
- \noexpand\kern\the\dimexpr 1.5\dimexpr\baselineskip - 1\zh\relax\relax
- }
- }
-\expandafter\endgroup
-\jlreq at do
-
-% インデントの計算:脚注の長さが文字の整数倍になるように字下げする(4.2.5.b)
-\jlreq at jlreqsetup@add{footnote_indent}{%
- \if at tate\else
- \ifdim\dimexpr#1\relax=0pt \else\jlreq at note{脚注は,一般にその前に区切りのための罫線を挿入するので,字下げは行わなくてよい(4.2.5.b).}\fi
- \fi
- \begingroup
- \footnotesize
- \jlreq at footnoteindent=\dimexpr#1\relax
- \@tempdima=\dimexpr\textwidth - \jlreq at footnoteindent\relax
- \@tempdimb=1\zw
- \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
- \edef\jlreq at do{\noexpand\jlreq at footnoteindent=\the\dimexpr\textwidth - \@tempdima\relax}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\newcommand{\@makefntext}[1]{\jlreq at makefntext{#1}}
-\jlreq at jlreqsetup@add{footnote_second_indent}{%
- \if at 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 at note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
- \fi
- \ifdim\dimexpr #1\relax<0pt
- \def\jlreq at makefntext{}
- \else
- \def\jlreq at makefntext{\addtolength{\leftskip}{\glueexpr #1\relax}}
- \fi
- \long\edef\jlreq at makefntext##1{\expandonce{\jlreq at makefntext}%
- \unexpanded{%
- \addtolength{\leftskip}{\jlreq at footnoteindent}%
- \parindent=1\zw
- \noindent
- \hskip-\glueexpr #1\relax
- \jlreq at referencemark@format{\@thefnmark}%
- \hskip\glueexpr 1\zw\relax
- }##1%
- }
-}
-
-\jlreq at jlreqsetup@add{footnotetext_indent}{
- \ClassWarningNoLine{jlreq}{footnotetext_indent was removed}
-}
-
-\ifx l\jlreq at engine
- \fnfixbottomtrue
-\fi
-
-% \footnoteと\footnotemarkの前後に\jlreq at hook@prenote/\jlreq at hook@postnoteを入れる
-\jlreq at saveoriginalcs{\footnote}
-\jlreq at saveoriginalcs{\footnotemark}
-\def\footnote{%
- \jlreq at hook@prenote
- \@ifnextchar[{\jlreq at footnote@impl at woption}{\jlreq at footnote@impl at wooption}%
-}
-\def\footnotemark{%
- \jlreq at hook@prenote
- \@ifnextchar[{\jlreq at footnotemark@impl at woption}{\jlreq at footnotemark@impl at wooption}%
-}
-\ifthenelse{\boolean{@tate} \AND \(\boolean{@twoside} \OR \boolean{@twocolumn}\)}{
- % 縦組の傍注は,その見開き内に付いている合印に対応する注を,奇数ページの左端にそろえて配置する.多段組では最下段の左端にそろえて配置する.(4.2.6.a)
- % 必要ならば\footnoteを\footnotemarkと\footnotetextにわけ,\footnotetextをアウトプット時まで遅延することで実現する.
- \def\jlreq at footnote@delayfootnoteslist{}
- \def\jlreq at hook@@opcol{%
- \expandafter\gdef\expandafter\jlreq at footnote@delayfootnoteslist\expandafter{\expandafter}%
- \jlreq at footnote@delayfootnoteslist
- }
- \preto\@opcol{\jlreq at hook@@opcol}
- % \jlreq at footnote@delayfootnote at delay#1#2#3:#1ページ目に\footnotetext[#2]{#3}を出す
- % \jlreq at footnote@delayfootnote at page:何ページ目に\footnotetextを入れるかを\jlreq at resultcntに入れる.その場での場合は-1.
- \if at twocolumn
- \if at twoside
- \def\jlreq at footnote@delayfootnote at page{%
- \jlreq at setcurrentpage
- \jlreq at resultcnt=\numexpr\jlreq at currentpage\ifodd\jlreq at currentpage\else + 1\fi\relax
- % このページに表示&上の段処理済みだと\output内では間に合わない
- \ifnum\jlreq at resultcnt=\value{page}\if at firstcolumn\else\jlreq at resultcnt=-1 \fi\fi
- }
- \else
- \def\jlreq at footnote@delayfootnote at page{%
- \jlreq at setcurrentpage
- \jlreq at resultcnt=\numexpr\jlreq at currentpage\relax
- \ifnum\jlreq at resultcnt=\value{page}\if at firstcolumn\else\jlreq at resultcnt=-1 \fi\fi
- }
- \fi
- \long\def\jlreq at footnote@delayfootnote at delay#1#2#3{%
- % 二段組みの場合は上段を組んだ直後に\footnotetextを挿入(そのページの下段に入る)
- \ifnum 0\if at firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0
- \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}{#3}}}%
- \else
- \footnotetext[#2]{#3}%
- \fi
- }
- \else
- \def\jlreq at footnote@delayfootnote at page{%
- \jlreq at setcurrentpage
- \ifodd\jlreq at currentpage
- \jlreq at resultcnt=-1
- \else
- \jlreq at resultcnt=\numexpr\jlreq at currentpage+1\relax
- \fi
- }
- \long\def\jlreq at footnote@delayfootnote at delay#1#2#3{%
- % 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入.
- \ifnum\numexpr#1 - 1\relax>\value{page}%
- \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}{#3}}}%
- \else
- \footnotetext[#2]{#3}%
- \fi
- }
- \fi
- \def\jlreq at footnote@delayfootnote at immediate#1#2#3{%
- \ifnum #1<\jlreq at currentpage
- \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}{#3}}}%
- \else
- \footnotetext[#2]{#3}%
- \fi
- }
- \let\jlreq at footnote@delayfootnote=\jlreq at footnote@delayfootnote at delay
- \def\jlreq at footnote@flushdelayfootnoteslist{%
- \ifx\jlreq at footnote@delayfootnoteslist\@empty\else
- \let\jlreq at footnote@delayfootnote=\jlreq at footnote@delayfootnote at immediate
- \jlreq at setcurrentpage
- \expandafter\gdef\expandafter\jlreq at footnote@delayfootnoteslist\expandafter{\expandafter}%
- \jlreq at footnote@delayfootnoteslist
- \let\jlreq at footnote@delayfootnote=\jlreq at footnote@delayfootnote at delay
- \fi
- }
- \AtEndDocument{\jlreq at footnote@flushdelayfootnoteslist}
- \preto\newpage{\jlreq at footnote@flushdelayfootnoteslist}
- \long\def\jlreq at footnote@impl at woption[#1]#2{%
- \jlreq at footnote@delayfootnote at page
- \ifnum\jlreq at resultcnt=-1
- \jlreq at useoriginalcs{\footnote}[#1]{#2}%
- \else
- \jlreq at useoriginalcs{\footnotemark}[#1]%
- \xappto\jlreq at footnote@delayfootnoteslist{\noexpand\jlreq at footnote@delayfootnote{\the\jlreq at resultcnt}{\unexpanded{#1}}{\unexpanded{#2}}}%
- \fi
- \jlreq at hook@postnote
- }
- \long\def\jlreq at footnote@impl at wooption#1{%
- \jlreq at footnote@delayfootnote at page
- \ifnum\jlreq at resultcnt=-1
- \jlreq at useoriginalcs{\footnote}{#1}%
- \else
- \jlreq at useoriginalcs{\footnotemark}%
- \xappto\jlreq at footnote@delayfootnoteslist{\noexpand\jlreq at footnote@delayfootnote{\the\jlreq at resultcnt}{\the\value{footnote}}{\unexpanded{#1}}}%
- \fi
- \jlreq at hook@postnote
- }
-}{
- \long\def\jlreq at footnote@impl at woption[#1]#2{%
- \jlreq at useoriginalcs{\footnote}[#1]{#2}%
- \jlreq at hook@postnote
- }
- \long\def\jlreq at footnote@impl at wooption#1{%
- \jlreq at useoriginalcs{\footnote}{#1}%
- \jlreq at hook@postnote
- }
-}
-\long\def\jlreq at footnotemark@impl at woption[#1]{%
- \jlreq at useoriginalcs{\footnotemark}[#1]%
- \jlreq at hook@postnote
-}
-\long\def\jlreq at footnotemark@impl at wooption{%
- \jlreq at useoriginalcs{\footnotemark}%
- \jlreq at hook@postnote
-}
-
-% 合印
-\renewcommand*{\@makefnmark}{%
- \jlreq at ifydir{\jlreq at notemark{\@thefnmark}}{\hbox{\jlreq at notemark{\@thefnmark}}}%
-}
-% 4.2.2注3
-\if at tate
- \renewcommand*{\thefootnote}{\jlreq at open@bracket at before@space\inhibitglue(\jlreq at rensuji{\@arabic\c at footnote})\inhibitglue}
-\else
- \renewcommand*{\thefootnote}{\arabic{footnote}\hbox{})\inhibitglue}
-\fi
-\ifthenelse{\equal{\jlreq at article@type}{article}}{}{\@addtoreset{footnote}{chapter}}
-
-
-%.. 後注(4.2.4)
-\def\jlreq at endnotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
-\def\jlreq at endnotecounter{footnote}% 後注用のカウンタ名
-% 文字サイズは\footnotesizeを使う
-\newdimen\jlreq at endnote@prepostspace
-% 前の分との間は行間分空ける(4.2.4.f)
-\jlreq at endnote@prepostspace=\dimexpr\baselineskip - 1\jlreq at gol\relax
-\newdimen\jlreq at endnote@indent
-% 現在の後注一覧を,\jlreq at endnote@textsに{{合印1}{後注1}}{{合印2}{後注2}}...の形で保持する
-\def\jlreq at endnote@texts{}
-\long\def\jlreq at endnote@addtext#1#2{\xappto\jlreq at endnote@texts{\unexpanded{{{#1}{#2}}}}}
-% \endnote自身は後で定義する
-\def\jlreq at endnote@impl{\jlreq at hook@prenote\@ifnextchar[{\jlreq at endnote}{\jlreq at endnote[]}}
-\def\endnotemark{\jlreq at hook@prenote\@ifnextchar[{\jlreq at endnotemark}{\jlreq at endnotemark[]}}
-\def\endnotetext{\@ifnextchar[{\jlreq at endnotetext}{\jlreq at endnotetext[]}}
-\long\def\jlreq at endnote[#1]#2{\jlreq at endnotemark[#1]\@endnotetext{#2}\jlreq at hook@postnote}
-\def\jlreq at endnotemark[#1]{%
- \jlreq at ifempty{#1}{%
- \stepcounter{\jlreq at endnotecounter}%
- \expandafter\protected at xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq at endnotecounter\endcsname #1\relax
- \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
- \endgroup
- }%
- \@endnotemark
- \jlreq at hook@postnote
-}
-\jlreq at setdefaultnotemark\@endnotemark\@makeendmark
-\long\def\jlreq at endnotetext[#1]#2{%
- \jlreq at ifempty{#1}{%
- \expandafter\protected at xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq at endnotecounter\endcsname #1\relax
- \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
- \endgroup
- }%
- \@endnotetext{#2}%
-}
-\long\def\@endnotetext#1{%
- \expandafter\let\expandafter\jlreq at tempa\expandafter=\csname\jlreq at endnotemarkname\endcsname
- \expandafter\jlreq at endnote@addtext\expandafter{\jlreq at tempa}{#1}%
-}
-\long\def\jlreq at theendnotes#1{%
- \jlreq at ifendmark{#1}{}{%
- \jlreq at output@endnotes#1
- \jlreq at theendnotes
- }%
-}
-\long\def\jlreq at output@endnotes#1#2{%
- \expandafter\def\csname\jlreq at endnotemarkname\endcsname{#1}%
- \item\@makeendtext{#2}%
-}
-
-\newcommand*{\theendnotes}{%
- \ifx\jlreq at endnote@texts\@empty\else
- \let\jlreq at tempa=\jlreq at endnote@texts
- \gdef\jlreq at endnote@texts{}%
- \edef\jlreq at endnote@beforeafterspace{\the\dimexpr\baselineskip - 1\jlreq at gol\relax plus \the\dimexpr 1\jlreq at gol\relax}%
- \begingroup
- \par
- \footnotesize
- % 後注の長さを文字サイズの整数倍にする(4.2.4.b)
- \jlreq at tempdima=\dimexpr\linewidth - \jlreq at endnote@indent - \leftskip\relax
- \@tempdimb=1\jlreq at mol
- \divide\jlreq at tempdima\@tempdimb\multiply\jlreq at tempdima\@tempdimb
- \begin{list}{}{%
- \itemsep=0pt\relax
- \parsep=0pt\relax
- \partopsep=0pt\relax
- \topsep=0pt\relax
- \leftmargin=\dimexpr\linewidth - \jlreq at tempdima + \jlreq at endnote@second at indent\relax
- \itemindent=-\glueexpr\jlreq at endnote@second at indent\relax
- \topsep=\jlreq at endnote@beforeafterspace\relax
- \listparindent=1\zw
- }%
- \expandafter\jlreq at theendnotes\jlreq at tempa\jlreq at endmark
- \end{list}%
- \endgroup
- \par
- \fi
-}
-% 4.2.4.b
-\jlreq at endnote@indent=2\jlreq at mol
-\jlreq at jlreqsetup@add{endnote_second_indent}{
- \def\jlreq at endnote@second at 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 at note{後注が2行以上となった場合,後注の2行目以下の字下げは,1行目より,後注の文字サイズの2倍又は全角とする (4.2.4.d).}}
-}
-\newcommand{\@makeendtext}[1]{%
- \csname\jlreq at endnotemarkname\endcsname
- \hskip\glueexpr1\zw\relax% 見出し出力と一文字分の空き(4.2.4.c)
- #1%
-}
-\let\@makeendmark=\@makefnmark
-
-% \theendnoteの出力を仕込む
-\apptocmd{\jlreq at hook@beforeheadings}{\jlreq at endnote@hook at beforeheadings{#1}}{}{}
-
-\jlreq at jlreqsetup@add{endnote_position}{
- \def\jlreq at endnote@hook at beforeheadings##1{}
- \jlreq at tempafalse % headingsが指定された
- \jlreq at tempbfalse % paragraphが指定された
- % \jlreq at tempcにセクション名たちを入れていく
- \def\jlreq at tempc{}
- \@for\jlreq at tempa:=#1\do{
- \expandafter\jlreq at helper@trim\expandafter{\jlreq at tempa}{\jlreq at tempa}%
- \jlreq at switch{\jlreq at tempa}{
- {headings}{\jlreq at tempatrue}
- {paragraph}{
- \jlreq at tempatrue% _paragraphの時は_headingsも有効にする
- \jlreq at tempbtrue
- }
- {
- \expandafter\jlreq at iffirsttoken@ignorespaces\expandafter{\jlreq at tempa}{_}{
- \edef\jlreq at tempc{\jlreq at tempc,\expandafter\@gobble\jlreq at tempa}
- }{
- \ClassError{jlreq}{Invalid value \jlreq at tempa\space in endnote_position}{\@ehc}
- }
- }
- }
- }
-
- \ifjlreq at tempb
- \edef\endnote{\unexpanded{\def\par{\@restorepar\theendnotes\par}}\expandonce{\jlreq at endnote@impl}}
- \else
- \let\endnote=\jlreq at endnote@impl
- \fi
-
- \ifjlreq at tempa
- \apptocmd{\jlreq at endnote@hook at beforeheadings}{\theendnotes}{}{}
- \else
- \@for\@tempa:=\jlreq at tempc\do{
- \ifx\@tempa\@empty\else
- \edef\jlreq at do{%
- \unexpanded{\def\jlreq at endnote@hook at beforeheadings##1}{\expandonce{\jlreq at endnote@hook at beforeheadings{##1}}%
- \unexpanded{\def\@tempa}{\@tempa}\unexpanded{\def\@tempb{##1}}%
- \unexpanded{\ifx\@tempa\@tempb\theendnotes\fi}%
- }
- }
- \jlreq at do
- \fi
- }
- \fi
-}
-\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 at sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
- \long\def\@sidenotetext#1{%
- \marginpar{\reset at font\footnotesize
- \color at begingroup\normalcolor
- \@makesidetext{#1}%
- \color at endgroup
- }%
- }
- \jlreq at setdefaultnotemark\@sidenotemark\@makesidemark
- \def\jlreq at sidenotecounter{footnote}% 傍注用のカウンタ名
- \jlreq at jlreqsetup@add{sidenote_type}[number,symbol]{\def\jlreq at sidenote@type{#1}}
- \def\jlreq at sidenote@type{number}
- \jlreq at jlreqsetup@addtofinally{
- \ifthenelse{\equal{\jlreq at sidenote@type}{number}}{
- \def\sidenote{\jlreq at hook@prenote\@ifnextchar[{\jlreq at sidenote}{\jlreq at sidenote[]}}
- \def\sidenotemark{\jlreq at hook@prenote\@ifnextchar[{\jlreq at sidenotemark}{\jlreq at sidenotemark[]}}
- \def\sidenotetext{\@ifnextchar[{\jlreq at sidenotetext}{\jlreq at sidenotetext[]}}
- \long\def\jlreq at sidenote[#1]#2{\jlreq at sidenotemark[#1]\@sidenotetext{#2}\jlreq at hook@postnote}
- \def\jlreq at sidenotemark[#1]{%
- \jlreq at ifempty{#1}{%
- \stepcounter{\jlreq at sidenotecounter}%
- \expandafter\protected at xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq at sidenotecounter\endcsname #1\relax
- \expandafter\unrestored at protected@xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
- \endgroup
- }%
- \@sidenotemark
- \jlreq at hook@postnote
- }
- \long\def\jlreq at sidenotetext[#1]#2{%
- \jlreq at ifempty{#1}{%
- \expandafter\protected at xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
- }{%
- \begingroup
- \csname c@\jlreq at sidenotecounter\endcsname#1\relax
- \expandafter\unrestored at protected@xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
- \endgroup
- }%
- \@sidenotetext{#2}%
- }
- % \hspace{0.5\jlreq at mol}の部分は二分空きにする例もある(4.2.7.g)
- \ifx l\jlreq at engine
- \long\def\@makesidetext#1{\csname\jlreq at sidenotemarkname\endcsname\hspace{0.5\jlreq at mol}#1}
- \else
- % thefootnote = \inhibitglue (...だと\inhibitglueが効かないので空白を挟む
- \long\def\@makesidetext#1{ \kern-1\zw\csname\jlreq at sidenotemarkname\endcsname\hspace{0.5\jlreq at mol}#1}
- \fi
- \let\@makesidemark=\@makefnmark
- }{% sidenote_type = symbol
- \long\def\sidenote#1#2{\jlreq at sidenote{#1}{#2}}
- \def\sidenotemark#1{\jlreq at sidenotemark{#1}}
- \long\def\sidenotetext#1#2{\jlreq at sidenotetext{#1}{#2}}
- \long\def\jlreq at sidenote#1#2{\jlreq at sidenotemark{#1}\jlreq at sidenotetext{#1}{#2}}
- \edef\jlreq at sidenotemark#1{%
- {\unexpanded{\reset at font\jlreq at sidenote@keywordfont}#1}%
- \noexpand\jlreq at hook@prenote
- \ifx\jlreq at sidenote@defaultmark\@empty\else
- \expandafter\edef\expandonce{\csname\jlreq at sidenotemarkname\endcsname}{\expandonce{\jlreq at sidenote@defaultmark}}%
- \noexpand\@sidenotemark
- \fi
- }
- % カスタマイズできるべき?
- \long\def\jlreq at sidenotetext#1#2{%
- \expandafter\def\csname\jlreq at sidenotemarkname\endcsname{\inhibitglue\null{\reset at font\sffamily\bfseries\inhibitglue #1}}%
- \@sidenotetext{#2}%
- }
- \long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq at sidenotemarkname\endcsname}\hspace*{1\jlreq at mol}#1}
- \let\@makesidemark=\@makefnmark
-
- \apptocmd{\sidenote}{\jlreq at hook@postnote}{}{}
- \apptocmd{\sidenotemark}{\jlreq at hook@postnote}{}{}
- }
- }
- \jlreq at jlreqsetup@add{sidenote_symbol}{\def\jlreq at sidenote@defaultmark{#1}}
- \jlreq at jlreqsetup@add{sidenote_keyword_font}{\def\jlreq at sidenote@keywordfont{#1}}
-}
-
-%.. 割注(3.4)
-\def\inlinenotesize{.6\jlreq at jafontsize} % 割注の文字サイズ
-\let\jlreq at inlinenote@autolinebreak=\\% 計測時は\linebreakより\\の方が安定する.悩ましい…….
-
-\newcommand{\jlreq at inlinenote@kakkofontsize}{%
- \fontsize{\dimexpr\inlinenotesize * 2\relax}{\dimexpr \inlinenotesize * 2\relax}%
- \selectfont
-}
-
-\newcommand{\jlreq at inlinenote@fontsize}{%
- \fontsize{\inlinenotesize}{\inlinenotesize}%
- \selectfont
-}
-
-% 割注を入れるための命令.\inlinenote{割注}で使う.
-% 改行位置は自動で計算されるが,常に正しいとは限らない.
-% \inlinenote*は自動で改行されない.\\で改行位置を指定する.
-\newif\ifjlreq at in@inlinenote
-\jlreq at in@inlinenotefalse
-\newcommand*{\jlreq at inlinenote@}[1]{%
- \ifjlreq at in@inlinenote\ClassError{jlreq}{\string#1\space can't be nested}{\@ehc}\fi
- \jlreq at in@inlinenotetrue
- \ifvmode\leavevmode\fi
- \@ifstar\jlreq at inlinenote@noauto\jlreq at inlinenote@auto
-}
-\DeclareRobustCommand*{\inlinenote}{\jlreq at inlinenote@{\inlinenote}}
-\DeclareRobustCommand*{\warichu}{\jlreq at inlinenote@{\warichu}}
-
-\newcommand*{\jlreq at inlinenote@auto}[1]{%
- % 割注初め括弧の前の場所を保存
- \jlreq at savepos@for at rest@linewidth
- % \jlreq at tempdimbに,現在行の残り長さを入れる
- \jlreq at tempdimb=\jlreq at rest@linewidth
- % 括弧の分を引いたものが,割注の使える長さ
- \setbox\@tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue\jlreq at open@bracket at before@space(\inhibitglue}%
- \addtolength{\jlreq at tempdimb}{-\wd\@tempboxa}%
- \ifdim\jlreq at tempdimb<0pt\jlreq at tempdimb=\linewidth\fi
- {%
- \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue \jlreq at open@bracket at before@space(}%
- \jlreq at box@putcenter\jlreq at tempboxa
- }%
- % 「初回」時はここに強制改行を入れる.これにより現在位置の取得がより正しくなる……といいなぁ
- \jlreq at savepos@iflabelundefined{\\}{}%
- % 割注内の\baselineskipを保存(後で使う).
- {\jlreq at inlinenote@fontsize\xdef\jlreq at inlinenote@baselineskip{\the\baselineskip}}%
- % 普通に並べた長さを計測し,その半分から始める
- \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize #1}%
- \jlreq at tempdimc=\wd\@tempboxa
- \divide\jlreq at tempdimc by 2\relax
- % \@tempcntbに,この長さで計測した場合の行数を入れる
- \ifdim\jlreq at tempdimc<\jlreq at tempdimb\@tempcntb=2\relax
- \else
- \jlreq at tempdima=\dimexpr\jlreq at tempdimc - \jlreq at tempdimb\relax
- \divide\jlreq at tempdima\linewidth
- \@tempcntb=\numexpr 2*\number\jlreq at tempdima + 4\relax
- \fi
- % \jlreq at parshapeargに\parshapeに指定する書式の最後以外を入れる.
- \ifnum\@tempcntb>2\relax
- \edef\jlreq at parshapearg{0pt \the\jlreq at tempdimb\space 0pt \the\jlreq at tempdimb}%
- \@tempcnta=4\relax
- \@whilenum\@tempcnta<\@tempcntb\do{%
- \edef\jlreq at parshapearg{\jlreq at parshapearg\space 0pt \the\linewidth\space 0pt \the\linewidth}%
- \advance\@tempcnta by 2\relax
- }%
- \setlength{\jlreq at tempdimc}{\dimexpr\jlreq at tempdimc - \jlreq at tempdimb - \linewidth * \numexpr(\@tempcntb - 4)/2\relax\relax}%
- \else
- \def\jlreq at parshapearg{}%
- \fi
- % 行数を伸ばしつつ良いところを探していく
- \@whilenum\@tempcntb<1001\do{%
- \ifnum\@tempcntb>2\jlreq at tempdimb=\linewidth\fi
- \edef\@tempb{\the\@tempcntb}%
- \jlreq at inlinenote@determinelength{#1}{\jlreq at inlinenote@fontsize}{\jlreq at parshapearg}{2}{\@tempb}{\jlreq at tempdimc}{\jlreq at tempdimb}%
- \@tempcntb=\@tempb
- \ifnum\@tempcntb>999\relax% ループが長すぎる
- \global\setbox\jlreq at resultbox=\voidb at x%
- \@tempcntb=1001\relax
- \fi
- \ifvoid\jlreq at resultbox\else% 成功
- \edef\jlreq at inlinenote@lines{\the\@tempcntb}% 行数を保存
- \@tempcntb=1001\relax
- \fi
- \advance\@tempcntb by 2\relax
- \edef\jlreq at parshapearg{\jlreq at parshapearg 0pt \the\jlreq at tempdimb 0pt \the\jlreq at tempdimb}%
- }%
- \ifvoid\jlreq at resultbox
- \ClassWarning{jlreq}{\string\warichu\space failed, may be a bug}%
- \else
- \@tempcnta=0
- \splittopskip=0pt\relax
- \splitmaxdepth=\maxdimen
- % 現在行の残り長さを思い出す
- \jlreq at tempdimb=\jlreq at rest@linewidth
- \setbox\@tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue\jlreq at open@bracket at before@space(\inhibitglue}%
- \addtolength{\jlreq at tempdimb}{-\wd\@tempboxa}%
- \setbox\@tempboxa=\box\jlreq at resultbox
- \@whilenum\@tempcnta<\jlreq at inlinenote@lines\do{%
- \ifnum\@tempcnta>0 \jlreq at inlinenote@autolinebreak\fi
- % \jlreq at tempdimaに今の行の長さを入れる
- \ifnum\@tempcnta<\numexpr\jlreq at inlinenote@lines - 2\relax
- \ifnum\@tempcnta=0\jlreq at tempdima=\jlreq at tempdimb
- \else\jlreq at tempdima=\linewidth\fi
- \else
- % 最終行は自然長に任せる
- \jlreq at tempdima=-1pt\relax
- \fi
- {%
- \edef\@tempa{\the\vbadness}%
- \vbadness=10000
- \setbox\jlreq at tempboxa=\vsplit\@tempboxa to \dimexpr\jlreq at inlinenote@baselineskip*2\relax
- \vbadness=\@tempa\relax
- \jlreq at getlastbox{\jlreq at tempboxa}%
- \setbox\jlreq at tempboxb=\box\jlreq at resultbox
- \jlreq at getlastbox{\jlreq at tempboxa}%
- \setbox\jlreq at tempboxa=\box\jlreq at resultbox
- \ifdim\jlreq at tempdima>0pt\relax
- \setbox\jlreq at tempboxa=\vbox{\jlreq at inlinenote@fontsize
- \hbox to \jlreq at tempdima{\unhbox\jlreq at tempboxa}%
- \hbox to \jlreq at tempdima{\unhbox\jlreq at tempboxb}}%
- \else
- \setbox\jlreq at tempboxa=\vbox{\jlreq at inlinenote@fontsize
- \hbox{\unhbox\jlreq at tempboxa}%
- \hbox{\unhbox\jlreq at tempboxb}}%
- \fi
- \jlreq at box@putcenter\jlreq at tempboxa
- }%
- \advance\@tempcnta by 2\relax
- }%
- \fi
- \jlreq at inlinenote@endnote
-}
-
-\newcommand*{\jlreq at inlinenote@noauto}[1]{%
- \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue\jlreq at open@bracket at before@space(}%
- \inhibitglue\jlreq at box@putcenter\jlreq at tempboxa
- \jlreq at inlinenote@noauto@#1\\\jlreq at endmark\jlreq at endmark
- \jlreq at inlinenote@endnote
-}
-
-\def\jlreq at inlinenote@noauto@#1\\#2#3\jlreq at endmark{%
- \jlreq at inlinenote@noauto@@#1&\jlreq at endmark\jlreq at endmark
- \jlreq at ifendmark{#2}{}{\linebreak\jlreq at inlinenote@noauto@#2#3\jlreq at endmark}%
-}
-
-\def\jlreq at inlinenote@noauto@@#1#3\jlreq at endmark{%
- \jlreq at ifendmark{#2}{%
- \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize #1}%
- \jlreq at tempdimc=\wd\@tempboxa
- \divide\jlreq at tempdimc by 2\relax
- \jlreq at inlinenote@determinelength{#1}{\jlreq at inlinenote@fontsize}{}{2}{2}{\jlreq at tempdimc}{\maxdimen}%
- \ifvoid\jlreq at resultbox\else
- {%
- \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@fontsize\box\jlreq at resultbox}%
- \jlreq at box@putcenter\jlreq at tempboxa
- }%
- \fi
- \def\jlreq at next{}%
- }{%
- \def\jlreq at next{\jlreq at inlinenote@noauto@@@{#1}#2#3}%
- }%
- \jlreq at next
-}
-
-\def\jlreq at inlinenote@noauto@@@#1#2&\jlreq at endmark{%
- \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize\vbox{\hbox{#1}\hbox{#2}}}%
- \jlreq at box@putcenter\@tempboxa
-}
-
-\newcommand{\jlreq at inlinenote@endnote}{%
- \jlreq at in@inlinenotefalse
- {%
- \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize)}%
- \jlreq at box@putcenter\jlreq at tempboxa
- \inhibitglue
- }%
-}
-
-% \jlreq at inlinenote@determinelength{テキスト(1)}{フォントとか指定(2)}{\parshape指定(3)}{調整に使う行数(4)}{成功行数(5)}{最小長さ(6)}{最大長さ(7)}
-% 次を満たす長さXの最小値を求める(ただし#6 <= X <= #7)
-% #1を
-% * #5 - #4行目までは#3の指定に従う
-% * それ以降はX
-% として整形した際に,#5行以内に収まる.
-% \jlreq at resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
-\newcommand{\jlreq at inlinenote@determinelength}[7]{%
- \begingroup
- % \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
- \@tempcnta=1\relax
- \def\@tempa{}%
- % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq at tempdima.
- \@whilenum\@tempcnta<#4\do{%
- \expandafter\def\expandafter\@tempa\expandafter{\@tempa 0pt \the\jlreq at tempdima}%
- \advance\@tempcnta by 1\relax
- }%
- \@tempcnta=0
- \jlreq at tempdima=#6\relax
- % \jlreq at tempdimaを少しずつ伸ばしていく
- \@whilenum\@tempcnta<1000\do{%
- \ifnum\@tempcnta>999\relax% ループが長すぎる
- \global\setbox\jlreq at resultbox=\voidb at x%
- \@tempcnta=1001\relax
- \else
- \setbox\@tempboxa=\vbox{#2%
- \vbadness=10000\hbadness=10000\vfuzz=\maxdimen\hfuzz=\maxdimen
- \parindent=0pt\leftskip=0pt\rightskip=0pt
- \parshape #5 #3 \@tempa 0pt \the\maxdimen
- #1\par\global\@tempcntb=\prevgraf}%
- % \message{\string\jlreq at tempdima = \the\jlreq at tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}%
- \fi
- \jlreq at getlastbox{\@tempboxa}%
- \setbox\jlreq at tempboxa=\box\jlreq at resultbox
- \ifnum\@tempcntb<#5\relax% 行数が達していないならOK
- % \message{行数 = \the\@tempcntb により確定}
- % #5行になるまで空の水平ボックスを加えていく.
- \global\setbox\jlreq at resultbox=\vbox{#2%
- \unvbox\@tempboxa\hbox{\unhbox\jlreq at tempboxa\unskip\unskip\unpenalty}%
- \@whilenum\@tempcntb<#5\do{\hbox{}\advance\@tempcntb by 1}}%
- \@tempcnta=1001\relax
- \else
- % そうでない場合は最後の二行の長さを比較する
- \jlreq at getlastbox{\@tempboxa}%
- \setbox\jlreq at tempboxb=\box\jlreq at resultbox
- % \message{最終行の長さ \the\wd\jlreq at tempboxa, その前の長さ \the\wd\jlreq at tempboxb}%
- \ifdim\wd\jlreq at tempboxa>\wd\jlreq at tempboxb
- \advance\jlreq at tempdima by 0.3pt\relax% 0.3ptに意味はない
- \else
- % 後ろが短いのでOK
- \global\setbox\jlreq at resultbox=\vbox{#2\unvbox\@tempboxa\box\jlreq at tempboxb\box\jlreq at tempboxa}%
- \jlreq at resultdimen=\jlreq at tempdima
- \@tempcnta=1001\relax
- \fi
- \fi
- \ifdim\jlreq at tempdima>#7\relax
- \global\setbox\jlreq at resultbox=\box\voidb at x
- \@tempcnta=1001\relax
- \fi
- \advance\@tempcnta by 1\relax
- }%
- \endgroup
-}
-
-%. ページスタイル.
-% メモ:
-% 2.6.1.cの後半が前半と整合的でないように見える……
-% 柱:両柱と片柱(2.6.3)
-\@tempdima=\jlreq at speciallength{\jlreq at headfoot@sidemargin}
-\ifthenelse{\lengthtest{\@tempdima=0pt} \OR \(\lengthtest{0.99\zw < \@tempdima} \AND \lengthtest{\@tempdima < 1.01\zw}\)}{}{
- \jlreq at note{ノンブルまたは柱は,基本版面の左右にそろえるか,全角アキだけ寄せた位置に配置する (2.6.1.b).}
-}
-
-%.. 場所指定解析
-% bottom-leftみたいなのを解釈する.入力の順番はどっちでも良いが,出力は<top/bottom><left/right>の順番
-% #1 = bottom-leftみたいなのを{bottom}{left}に変換し,#2に代入,#3はデフォルト値,出力形式で入れる
-\newcommand*{\jlreq at pagestyle@parse at position}[3]{%
- \jlreq at ifempty{#1}{\def#2{#3}}%
- {%
- \begingroup
- \jlreq at pagestyle@parse at position@#1-\jlreq at endmark
- % \jlreq at tempcに縦方向を,\jlreq at tempdに横方向を入れる
- \def\jlreq at tempc{}\def\jlreq at tempd{}%
- \jlreq at pagestyle@parse at position@@{\jlreq at tempa}%
- \jlreq at pagestyle@parse at position@@{\jlreq at tempb}%
- \ifx\jlreq at tempc\@empty\edef\jlreq at tempc{\expandafter\@firstoftwo#3}\fi
- \ifx\jlreq at tempd\@empty\edef\jlreq at tempd{\expandafter\@secondoftwo#3}\fi
- \edef\jlreq at do{\unexpanded{\def#2}{{\jlreq at tempc}{\jlreq at tempd}}}%
- \expandafter\endgroup
- \jlreq at do
- }%
-}
-
-\def\jlreq at pagestyle@parse at position@#1-#2\jlreq at endmark{%
- \def\jlreq at tempa{#1}\def\jlreq at tempb{#2}%
- \jlreq at ifempty{#2}{%
- \ifx\jlreq at tempb\@empty\ClassError{jlreq}{Invalid position: #1}{\@ehc}\fi
- }{%
- \def\@tempa##1-{\def\jlreq at tempb{##1}}%
- \@tempa#2\relax
- }%
-}
-
-\newcommand*\jlreq at pagestyle@parse at position@@[1]{%
- \jlreq at switch{#1}{
- {top}{\def\jlreq at tempc{#1}}
- {bottom}{\def\jlreq at tempc{#1}}
- {left}{\def\jlreq at tempd{#1}}
- {right}{\def\jlreq at tempd{#1}}
- {center}{\def\jlreq at tempd{#1}}
- {gutter}{\if at tate\def\jlreq at tempd{right}\else\def\jlreq at tempd{left}\fi}
- {fore_edge}{\if at tate\def\jlreq at tempd{left}\else\def\jlreq at tempd{right}\fi}
- {fore-edge}{\if at tate\def\jlreq at tempd{left}\else\def\jlreq at tempd{right}\fi}
- {\ClassError{jlreq}{Invalid position: #1}{\@ehc}}
- }%
-}
-
-% レベル#1より低いレベルの見出しの**markを\markboth{}{}にする
-\def\jlreq at pagestyle@setclearmark#1{%
- \@for\@tempa:=\jlreq at heading@allheadings\do{%
- \@ifundefined{\@tempa}{}{%
- \@ifundefined{jlreq at heading@level@\@tempa}{}{%
- \ifnum\csname jlreq at heading@level@\@tempa\endcsname<#1\relax\expandafter\def\csname\@tempa mark\endcsname##1{\markboth{}{}}\fi
- }%
- }%
- }%
-}
-
-% #1のleftとrightを入れ替えて#1に代入
-\def\jlreq at reverse@leftright#1{%
- \jlreq at switch{#1}{
- {left}{\def#1{right}}
- {right}{\def#1{left}}
- }%
-}
-
-%.. マークの拡張
-\def\jlreq at markregistername#1{jlreq at extramark@register@#1}
-\def\jlreq at extraleftmark#1{\jlreq at extramark@{#1}{\expandafter\@firstoftwo\botmarks}}
-\def\jlreq at extrarightmark#1{\jlreq at extramark@{#1}{\expandafter\@secondoftwo\firstmarks}}
-\def\jlreq at extramark@#1#2{\jlreq at if{\ifcsname\jlreq at markregistername{#1}\endcsname\fi}%
- {\expandafter\jlreq at extramark@@\expandafter{\csname \jlreq at markregistername{#1}\endcsname}{#2}}%
- {}%
-}
-\def\jlreq at extramark@@#1#2{#2#1\@empty\@empty}
-
-\def\jlreq at setextraleftmark@#1#2{{#2}{\expandafter\@secondoftwo#1}}
-\def\jlreq at setextrarightmark@#1#2{{\expandafter\@firstoftwo#1}{#2}}
-\def\jlreq at setextraleftmark#1#2{\jlreq at setextramark{#1}{#2}{\jlreq at setextraleftmark@}}
-\def\jlreq at setextrarightmark#1#2{\jlreq at setextramark{#1}{#2}{\jlreq at setextrarightmark@}}
-\def\jlreq at setextramark#1#2#3{%
- \jlreq at if{\ifcsname\jlreq at markregistername{#1}\endcsname\fi}{}{%
- \expandafter\newmarks\csname\jlreq at markregistername{#1}\endcsname
- \expandafter\def\csname\jlreq at markregistername{#1}@themark\endcsname{{}{}}%
- }%
- \begingroup
- \let\label\relax
- \let\index\relax
- \let\glossary\relax
- \def\jlreq@@themark at csname{\jlreq at markregistername{#1}@themark}%
- \expandafter\unrestored at protected@xdef\csname\jlreq@@themark at csname\endcsname{%
- \expandafter#3\expandafter{\csname\jlreq@@themark at csname\endcsname}{#2}%
- }%
- \expandafter\expandafter\expandafter\@temptokena\expandafter\expandafter\expandafter{\csname\jlreq@@themark at csname\endcsname}%
- \expandafter\marks\csname\jlreq at markregistername{#1}\endcsname{\the\@temptokena}%
- \endgroup
- \if at nobreak\ifvmode\nobreak\fi\fi
-}
-\let\jlreq at markboth=\markboth
-\let\jlreq at markright=\markright
-
-%.. \DeclarePageStyle内で使うもの
-% mark情報の取得を行う.
-% #1の中身をみて,#2 = 何段目見出しか,#3 = odd/even,\csname #4@<見出し命令名>\endcsnameに必要情報を追加し,#5の見出し命令名リストに追加
-% #1 at heading@levelにレベルを入れる
-\def\jlreq at pagestyle@setmark#1#2#3#4#5{%
- \begingroup
- \expandafter\jlreq at iffirsttoken\expandafter{#1}{_}{%
- \ifthenelse{\equal{#3}{odd}}{\let\jlreq at leftright=r}{\let\jlreq at leftright=l}%
- \edef\jlreq at do{%
- \unexpanded{\def#1}{%
- \ifx l\jlreq at leftright
- \ifnum#2=0 \noexpand\leftmark\else\unexpanded{\jlreq at extraleftmark{#2}}\fi
- \else
- \ifnum#2=0 \noexpand\rightmark\else\unexpanded{\jlreq at extrarightmark{#2}}\fi
- \fi
- }%
- }%
- \edef\jlreq at headingname{\expandafter\@gobble#1}% 見出し命令名
- \edef\jlreq at tempa{\noexpand\@removeelement{\expandonce{\jlreq at headingname}}}%
- \expandafter\jlreq at tempa\expandafter{#5}{#5}%
- \@ifundefined{#4@\jlreq at headingname}{\expandafter\def\csname #4@\jlreq at headingname\endcsname{}}{}%
- \eappto\jlreq at do{%
- \noexpand\let\expandonce{\csname\expandafter\@gobble\string #1 at heading@level\endcsname}=\expandonce{\csname jlreq at heading@level@\jlreq at headingname\endcsname}%
- \unexpanded{\def#5}{\expandonce{#5},\expandonce{\jlreq at headingname}}%
- \noexpand\appto\expandonce{\csname #4@\jlreq at headingname\endcsname}{{{\ifnum#2=0 #3\fi}{#2}{\ifx r\jlreq at leftright r\else l\fi}}}%
- }%
- }{\def\jlreq at do{}}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-% \def\<見出し>mark#1{...}というのを\jlreq at resultに入れる,
-% #1:*ならばextramarkを使う
-% #2: 見出し命令名,#3: mark_format
-% #4: {{mark_formatからさらに調べるやつ (odd|even)}{マークの何番目か.extraでない場合は0}{l or r(leftかrightか)}}の並び
-\def\jlreq at pagestyle@make at headingmark#1#2#3#4{%
- \begingroup
- \@for\jlreq at i:=0,1,2\do{%
- \expandafter\def\csname jlreq at leftmark@\jlreq at i\endcsname{}%
- \expandafter\def\csname jlreq at rightmark@\jlreq at i\endcsname{}%
- }%
- \jlreq at pagestyle@make at headingmark@{#2}{#3}#4\jlreq at endmark
- \def\jlreq at do{}% とりあえず#1markの中身を入れていく
- % leftを設定する時は対応するrightを空にする.
- \expandafter\ifx\csname jlreq at leftmark@0\endcsname\@empty
- \expandafter\ifx\csname jlreq at rightmark@0\endcsname\@empty\else
- \eappto\jlreq at do{\jlreq at ifempty{#1}{\noexpand\markright}{\noexpand\jlreq at markright}{\csexpandonce{jlreq at rightmark@0}}}%
- \fi
- \else
- \eappto\jlreq at do{\jlreq at ifempty{#1}{\noexpand\markboth}{\noexpand\jlreq at markboth}{\csexpandonce{jlreq at leftmark@0}}{\csexpandonce{jlreq at rightmark@0}}}%
- \fi
- \@for\jlreq at i:=1,2\do{%
- \expandafter\ifx\csname jlreq at leftmark@\jlreq at i\endcsname\@empty
- \expandafter\ifx\csname jlreq at rightmark@\jlreq at i\endcsname\@empty\else
- \eappto\jlreq at do{\noexpand\jlreq at setextrarightmark{\jlreq at i}{\csexpandonce{jlreq at rightmark@\jlreq at i}}}%
- \fi
- \else
- \eappto\jlreq at do{%
- \noexpand\jlreq at setextraleftmark{\jlreq at i}{\csexpandonce{jlreq at leftmark@\jlreq at i}}%
- \noexpand\jlreq at setextrarightmark{\jlreq at i}{\csexpandonce{jlreq at rightmark@\jlreq at i}}%
- }%
- \fi
- }%
- \ifx\jlreq at do\@empty\else
- \edef\jlreq at do{%
- \unexpanded{\edef\jlreq at result}{\noexpand\unexpanded{%
- \noexpand\def\expandonce{\csname #2mark\endcsname}\unexpanded{##1}{%
- \expandonce{\jlreq at do}%
- }}%
- }%
- }%
- \fi
- \expandafter\endgroup
- \jlreq at do
-}%
-\def\jlreq at pagestyle@make at headingmark@#1#2#3{%
- \jlreq at ifendmark{#3}{}{\jlreq at pagestyle@make at headingmark@@{#1}{#2}#3}%
-}
-
-\def\jlreq at pagestyle@make at headingmark@@#1#2#3#4#5{%
- % \jlreq at tempbに\***markの定義を入れる
- \edef\jlreq at tempb{%
- \expandonce{\csname the#1\endcsname}%
- \noexpand\ifx\expandonce{\csname the#1\endcsname}\unexpanded{\@empty\else\protect\quad\fi}%
- \unexpanded{##1}%
- }%
- \jlreq at parsekeyval@nokey{%
- \jlreq at ifempty{##1}{}{\ifthenelse{\equal{##1}{#3}}{\edef\jlreq at tempb{\unexpanded{##2}}}{}}%
- \ifthenelse{\equal{##1}{_#1}}{\edef\jlreq at tempb{\unexpanded{##2}}}{}%
- }{#2}%
- \ifx l#5%
- \expandafter\edef\csname jlreq at leftmark@#4\endcsname{\expandonce{\jlreq at tempb}}%
- \else
- \expandafter\edef\csname jlreq at rightmark@#4\endcsname{\expandonce{\jlreq at tempb}}%
- \fi
- \jlreq at pagestyle@make at headingmark@{#1}{#2}%
-}
-
-% #2 #3 #4と並んだヘッダを作り#1に入れる.#1,#2,#3はコンロトールシークエンスの名前とする.
-\def\jlreq at pagestyle@setheadfoot#1#2#3#4{%
- \begingroup
- \edef\jlreq at do{\noexpand\jlreq at pagestyle@setheadfoot@{\unexpanded{#1}}{\csexpandonce{#2}}{\csexpandonce{#3}}{\csexpandonce{#4}}}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-% \edef内だと,#1 != 0ptならば\hskip \dimexpr#1\relaxになる
-\def\jlreq at pagestyle@hskip#1{%
- \ifdim\dimexpr#1\relax=0pt \expandafter\@gobble\else\expandafter\@firstofone\fi
- {\noexpand\hskip\noexpand\dimexpr#1\noexpand\relax}%
-}
-\def\jlreq at pagestyle@setheadfoot@#1#2#3#4{%
- \begingroup
- % - \Cdpは端にそろえるための補正
- \jlreq at ifempty{#2}{\def\jlreq at left{}}{\edef\jlreq at left{\jlreq at pagestyle@hskip{\jlreq at expand@speciallength{\jlreq at headfoot@sidemargin}\if at tate - \Cdp\fi}\unexpanded{#2}}}%
- % +\topskip - \Chtは\jlreq at headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正.
- \jlreq at ifempty{#4}{\def\jlreq at right{}}{\edef\jlreq at right{\unexpanded{#4}\jlreq at pagestyle@hskip{\jlreq at expand@speciallength{\jlreq at headfoot@sidemargin}\if at tate + \topskip - \Cht\fi}}}%
- \jlreq at ifempty{#3}{%
- \edef\jlreq at do{\unexpanded{\def#1}{\expandonce{\jlreq at left}\hfil\expandonce{\jlreq at right}}}%
- \jlreq at ifempty{#2}{\jlreq at ifempty{#4}{\def\jlreq at do{\def#1{}}}{}}{}%
- }{% #3を完全に真ん中に配置するために左右の幅を0にしておく
- \ifx\jlreq at left\@empty\else\edef\jlreq at left{\noexpand\hbox to 0pt{\expandonce{\jlreq at left}\noexpand\hss}}\fi
- \ifx\jlreq at right\@empty\else\edef\jlreq at right{\noexpand\hbox to 0pt{\noexpand\hss\expandonce{\jlreq at right}}}\fi
- \edef\jlreq at do{%
- \unexpanded{\def#1}{\expandonce{\jlreq at left}\hfil\unexpanded{#3}\hfil\expandonce{\jlreq at right}}%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
-}%
-
-% #1の左右に傍注調整用の空白を入れて#1に代入する
-\def\jlreq at pagestyle@addsidenotemargin at left#1{%
- \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{}%
-}
-\def\jlreq at pagestyle@addsidenotemargin at right#1{%
- \jlreq at pagestyle@addsidenotemargin@{#1}{}{\marginparwidth+\marginparsep}%
-}
-\def\jlreq at pagestyle@addsidenotemargin at bothside#1{%
- \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}%
-}
-% #2: 左,#3:右,#4:#2 + #3
-\def\jlreq at pagestyle@addsidenotemargin@#1#2#3{%
- \ifx#1\@empty\else
- \edef#1{%
- \jlreq at ifempty{#2}{}{\unexpanded{\hskip-\dimexpr #2\relax}}%
- \expandonce{#1}%
- \jlreq at ifempty{#3}{}{\unexpanded{\hskip-\dimexpr #3\relax}}%
- }%
- \fi
-}
-
-% #1が空かつ#4が空でないならば#2に#3と#4の中身を追加し,#4を空にする.引数は全てコントロールシークエンス
-\def\jlreq at pagestyle@addifempty#1#2#3#4{%
- \ifx#1\@empty\ifx#4\@empty\else\eappto#2{\expandonce{#3}\expandonce{#4}}\def#4{}\fi\fi
-}
-
-\newif\ifjlreq at PageStyle@first
-% #1に入っている{柱1}{柱2}...{柱n}という並びから,実際に出力する柱を構築する.n>=1を仮定する.
-% 間に空白を入れる.
-% #1: ターゲットなコントロールシークエンスの名前,#2:*ならばreverseする,#3:空き
-\def\jlreq at pagestyle@make at runninghead#1#2#3{%
- \jlreq at if{\expandafter\ifx\csname #1\endcsname\@empty\fi}{}{%
- \edef\jlreq at do{%
- \noexpand\jlreq at tempatrue % 最初の処理かフラグ
- \unexpanded{\jlreq at pagestyle@make at runninghead@{#1}{#2}{#3}}\csexpandonce{#1}\noexpand\jlreq at endmark
- }%
- \expandafter\def\csname #1\endcsname{}%
- \jlreq at do
- % 項目が二つ以上あった.
- \ifjlreq at tempa\else\cspreto{#1}{\jlreq at PageStyle@firsttrue}\fi
- }%
-}
-\def\jlreq at pagestyle@make at runninghead@#1#2#3#4#5{%
- \jlreq at if{\ifnum\numexpr\jlreq at ifendmark{#5\fi}{1}{0}*\ifjlreq at tempa 1\else 0\fi\relax=1 \fi}{%
- % 項目が一つしか無い
- \jlreq at ifempty{#2}{\csappto}{\cspreto}{#1}{#4}%
- }{%
- % 最初の空でない柱に出会うまでは柱の間の空白を入れない.
- % 空でない柱に出会ってないならば\ifjlreq at PageStyle@firstはtrue.
- % 一番最初の\jlreq at PageStyle@firsttrueは後で入れる.
- \jlreq at ifempty{#2}{\csappto}{\cspreto}{#1}{%
- \protected at edef\jlreq at tempa{#4}%
- \ifx\jlreq at tempa\@empty\else
- \ifjlreq at PageStyle@first\else\hskip\glueexpr#3\relax\fi
- \jlreq at tempa
- \jlreq at PageStyle@firstfalse
- \fi
- }%
- \jlreq at tempafalse
- \jlreq at ifendmark{#5}{}{\jlreq at pagestyle@make at runninghead@{#1}{#2}{#3}{#5}}%
- }%
-}
-
-% #1= cs,#2 = フォーマットの入ったcs,#3 = デフォルトフォーマットの入ったcs
-\def\jlreq at pagestyle@applyformat#1#2#3{%
- % デフォルト時に限り,\hbox to ***{空トークン}を避ける
- \ifnum 0\ifx#1\@empty\else 1\fi\ifx#2\relax\else 1\fi>0
- \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\ifx#2\relax\expandonce{#3}\else\expandonce{#2}\fi}}\jlreq at do
- \edef#1{\expandafter\expandonce\expandafter{\expandafter\jlreq at tempa\expandafter{#1}}}%
- \fi
-}
-
-% フォント情報を追加する.#1:制御綴り名,#2:フォント命令の入っている制御綴名,#1に返す
-\def\jlreq at pagestyle@addfont at tocs#1#2{%
- \expandafter\ifx\csname #1\endcsname\@empty\else
- \expandafter\ifx\csname #2\endcsname\@empty\else
- \expandafter\edef\csname #1\endcsname{{\csexpandonce{#2}\csexpandonce{#1}}}%
- \fi
- \fi
-}
-% こちらは#1にトークン列を与える.\edefで展開される.制御綴名#3に代入.
-\def\jlreq at pagestyle@addfont at totokens#1#2#3{%
- \begingroup
- \edef\jlreq at do{\noexpand\edef\expandonce{\csname#3\endcsname}{\unexpanded{#1}}}%
- \expandafter\ifx\csname #2\endcsname\@empty\else
- \edef\jlreq at tempa{#1}%
- \ifx\jlreq at tempa\@empty\else
- \edef\jlreq at do{%
- \noexpand\edef\expandonce{\csname #3\endcsname}{\noexpand\unexpanded{%
- {\csexpandonce{#2}\expandonce{\jlreq at tempa}}%
- }}%
- }%
- \fi
- \fi
- \expandafter\endgroup
- \jlreq at do
-}
-
-%.. \DeclarePageStyle
-\newbox\jlreq at PageStyle@box
-\newcommand{\DeclarePageStyle}[2]{%
- \expandafter\edef\csname jlreq at pagestyle@setting@#1\endcsname{\unexpanded{#2}}%
- \begingroup
- \def\jlreq at nombre@i at position{}%
- \def\jlreq at nombre@i{\thepage}%
- \def\jlreq at running@head at i@position{}%
- \def\jlreq at odd@running at head@i{}%
- \def\jlreq at even@running at head@i{}%
- \def\jlreq at command{}%
- \def\jlreq at mark@format{}%
- \def\jlreq at font{}%
- \def\jlreq at nombre@font{}%
- \def\jlreq at running@head at font{}%
- % フォーマットを空という可能性もあるかもしれないので,デフォルト値は\relaxで表す.
- \let\jlreq at oddheadformat\relax
- \let\jlreq at evenheadformat\relax
- \let\jlreq at oddfootformat\relax
- \let\jlreq at evenfootformat\relax
- % 柱とノンブルの間
- \def\jlreq at gap{1.5\zw}%
- \def\jlreq at nombre@gap{}%
- \def\jlreq at running@head at gap{}%
- \newif\ifjlreq at clearmarkcommand\jlreq at clearmarkcommandtrue
- \newif\ifjlreq at pstate\jlreq at pstatefalse % PageStyleTATE
- \@for\jlreq at i:=ii,iii\do{%
- \expandafter\def\csname jlreq at nombre@\jlreq at i @position\endcsname{}%
- \expandafter\def\csname jlreq at running@head@\jlreq at i @position\endcsname{}%
- \expandafter\def\csname jlreq at nombre@\jlreq at i\endcsname{}%
- \expandafter\def\csname jlreq at odd@running at head@\jlreq at i\endcsname{}%
- \expandafter\def\csname jlreq at even@running at head@\jlreq at i\endcsname{}%
- \expandafter\def\csname jlreq at nombre@\jlreq at i @font\endcsname{}%
- \expandafter\def\csname jlreq at running@head@\jlreq at i @font\endcsname{}%
- }%
- \jlreq at parsekeyval[PageStyle:#1]{
- *{tate}{\jlreq at pstatetrue}
- *{yoko}{\jlreq at pstatefalse}
- {nombre}{\def\jlreq at nombre@i{##1}}
- {nombre_position}{\def\jlreq at nombre@i at position{##1}}
- {running_head_position}{\def\jlreq at running@head at i@position{##1}}
- {odd_running_head}{\def\jlreq at odd@running at head@i{##1}}
- {even_running_head}{\def\jlreq at even@running at head@i{##1}}
- {font}{%
- \def\jlreq at nombre@font{##1}%
- \def\jlreq at running@head at font{##1}%
- }
- {nombre_font}{\def\jlreq at nombre@font{##1}}
- {running_head_font}{\def\jlreq at running@head at font{##1}}
- {mark_format}{\edef\jlreq at mark@format{\unexpanded{##1}}}
- {command}{\edef\jlreq at command{\unexpanded{##1}}}
- {gap}{\def\jlreq at gap{##1}}
- {nombre_gap}{\def\jlreq at nombre@gap{##1}}
- {running_head_gap}{\def\jlreq at running@head at gap{##1}}
- % trueにすると,\ps@***実行時にまず\***markを全て\@gobbleにする.
- {clear_markcommand}[true,false]{\csname jlreq at clearmarkcommand##1\endcsname}
- {odd_head_format}{\edef\jlreq at oddheadformat{\unexpanded{##1}}}
- {even_head_format}{\edef\jlreq at evenheadformat{\unexpanded{##1}}}
- {odd_foot_format}{\edef\jlreq at oddfootformat{\unexpanded{##1}}}
- {even_foot_format}{\edef\jlreq at evenfootformat{\unexpanded{##1}}}
- % 二つ目
- {nombre_ii}{\def\jlreq at nombre@ii{##1}}
- {nombre_ii_position}{\def\jlreq at nombre@ii at position{##1}}
- {running_head_ii_position}{\def\jlreq at running@head at ii@position{##1}}
- {odd_running_head_ii}{\def\jlreq at odd@running at head@ii{##1}}
- {even_running_head_ii}{\def\jlreq at even@running at head@ii{##1}}
- {nombre_ii_font}{\def\jlreq at nombre@ii at font{##1}}
- {running_head_ii_font}{\def\jlreq at running@head at ii@font{##1}}
- % 三つ目
- {nombre_iii}{\def\jlreq at nombre@iii{##1}}
- {nombre_iii_position}{\def\jlreq at nombre@iii at position{##1}}
- {running_head_iii_position}{\def\jlreq at running@head at iii@position{##1}}
- {odd_running_head_iii}{\def\jlreq at odd@running at head@iii{##1}}
- {even_running_head_iii}{\def\jlreq at even@running at head@iii{##1}}
- {nombre_iii_font}{\def\jlreq at nombre@iii at font{##1}}
- {running_head_iii_font}{\def\jlreq at running@head at iii@font{##1}}
- }{#2}%
- % ノンブル同士の間や柱同士の間のデフォルトはノンブルと柱の間の空き量
- \ifx\jlreq at nombre@gap\@empty\let\jlreq at nombre@gap=\jlreq at gap\fi
- \ifx\jlreq at running@head at gap\@empty\let\jlreq at running@head at gap=\jlreq at gap\fi
- % _iiが存在するか調べて\ifjlreq at headii@existに入れる
- \newif\ifjlreq at headii@exist
- \jlreq at headii@existfalse
- \jlreq at for@noexpand\jlreq at tempa:=\jlreq at odd@running at head@ii,\jlreq at odd@running at head@ii\do{%
- \expandafter\ifx\jlreq at tempa\@empty\else\jlreq at headii@existtrue\fi
- }%
- % markの処理
- % (odd|even)_running_head(_ii)が_<見出し命令>で与えられている場合,次のようにする.
- % * \jlreq@(odd|even)@running at head(@ii)をマーク出力命令(\(left|right)mark or \jlreq at extra(left|right)mark{<num>})に書き換える
- % - evenの場合はleft,oddの場合はright.
- % - @iiがなければ\(left|right)mark,@iiがあれば\jlreq at extra(left|right)mark{1}
- % * 例えば_<見出し命令>が_sectionならば,\jlreq at markdata@sectionに{{<I1>}{<I2>}{<I3>}}を追加する.ここで<I1>,<I2>,<I3>は
- % - I1: @iiが無いときにodd or even
- % - I2: @iiが無ければ0,あれば1.
- % - I3: マーク出力命令がleftかrightに応じて l or r.(上述のようにoddかevenかで判定される.)
- % * 他にも_sectionが指定されている柱があれば,\jlreq at markdata@sectionにさらに追加で加えていく.
- % * \jlreq@(odd|even)@running at head(@ii)@heading at levelに<見出し命令>のレベルを入れる.レベルが不明な時は\relaxになる.
- % また,\jlreq at headingmarklistに<見出し命令>の一覧を入れる.
- \def\jlreq at headingmarklist{}%
- \@for\jlreq at parity:=odd,even\do{%
- \@for\jlreq at i:=0,1,2\do{%
- % \jlreq at pagestyle@setmarkが上の処理を行う.
- \edef\jlreq at next{\noexpand\jlreq at pagestyle@setmark{\expandonce{\csname jlreq@\jlreq at parity @running at head@\@roman\numexpr\jlreq at i + 1\relax\endcsname}}{\expandonce{\jlreq at i}}{\expandonce{\jlreq at parity}}{jlreq at markdata}{\noexpand\jlreq at headingmarklist}}%
- \jlreq at next
- }%
- }%
- % \jlreq at minimumlevelに見出しの最低(数値が小さいという意味)レベルを入れる.
- \let\jlreq at minimumlevel=\@undefined
- \def\jlreq at markdefinecommand{}%
- \@for\jlreq at heading:=\jlreq at headingmarklist\do{%
- \ifx\jlreq at heading\@empty\else
- \expandafter\let\expandafter\jlreq at level\csname jlreq at heading@level@\jlreq at heading\endcsname
- \ifx\jlreq at level\relax\else
- \ifx\jlreq at minimumlevel\@undefined\let\jlreq at minimumlevel=\jlreq at level
- \else\ifnum\jlreq at minimumlevel>\jlreq at level\space\let\jlreq at minimumlevel=\jlreq at level\fi\fi
- \fi
- % \jlreq at markdata@<見出し命令>にある情報とmark_formatをもとに,\<見出し命令>markを定義するマクロを作成,\jlreq at markdefinecommandに入れる.
- \edef\jlreq at do{\noexpand\jlreq at pagestyle@make at headingmark{\ifjlreq at headii@exist *\fi}{\expandonce{\jlreq at heading}}{\expandonce{\jlreq at mark@format}}{\csexpandonce{jlreq at markdata@\jlreq at heading}}}%
- \jlreq at do
- \eappto\jlreq at markdefinecommand{\expandonce{\jlreq at result}}%
- \fi
- }%
- \ifx\jlreq at minimumlevel\@undefined\else
- \eappto\jlreq at markdefinecommand{\noexpand\jlreq at pagestyle@setclearmark{\expandonce{\jlreq at minimumlevel}}}%
- \fi
- % 見出しを出す場合:evenに章などの高いレベルの見出しを出す(2.6.3.a)
- \@ifundefined{jlreq at odd@running at head@i at heading@level}{}{\@ifundefined{jlreq at even@running at head@i at heading@level}{}{%
- \ifnum\jlreq at odd@running at head@i at heading@level<\jlreq at even@running at head@i at heading@level
- \jlreq at note{偶数ページには奇数ページよりアウトラインレベルの高い見出しを入れる (ページスタイル #1 内,2.6.3.a).}%
- \fi
- }}%
- % 二番目以降にフォント設定を追加
- \@for\jlreq at i:=ii,iii\do{%
- \@for\jlreq at parity:=odd,even\do{%
- \jlreq at pagestyle@addfont at tocs{jlreq@\jlreq at parity @running at head@\jlreq at i}{jlreq at running@head@\jlreq at i @font}%
- }%
- \jlreq at pagestyle@addfont at tocs{jlreq at nombre@\jlreq at i}{jlreq at nombre@\jlreq at i @font}%
- }%
- % \jlreq at oddhead,\jlreq at oddfoot,\jlreq at evenhead,\jlreq at evenfootに必要なものを入れる.
- \jlreq at if{\ifjlreq at pstate\fi}{% tate
- % headの方に処理を入れる.footは空.
- \def\jlreq at oddfoot{}\def\jlreq at evenfoot{}%
- \jlreq at for@noexpand\jlreq at position:=\jlreq at nombre@i at position,\jlreq at running@head at i@position\do{%
- \expandafter\ifx\jlreq at position\@empty\expandafter\def\jlreq at position{0pt}\fi
- }%
- \edef\jlreq at gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq at nombre@gap}\noexpand\relax}%
- \jlreq at pagestyle@addifempty{\jlreq at nombre@iii at position}{\jlreq at nombre@ii}{\jlreq at gapcs}{\jlreq at nombre@iii}%
- \jlreq at pagestyle@addifempty{\jlreq at nombre@ii at position}{\jlreq at nombre@i}{\jlreq at gapcs}{\jlreq at nombre@ii}%
- \edef\jlreq at gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq at running@head at gap}\noexpand\relax}%
- \jlreq at pagestyle@addifempty{\jlreq at running@head at iii@position}{\jlreq at odd@running at head@ii}{\jlreq at gapcs}{\jlreq at odd@running at head@iii}%
- \jlreq at pagestyle@addifempty{\jlreq at running@head at ii@position}{\jlreq at odd@running at head@i}{\jlreq at gapcs}{\jlreq at odd@running at head@ii}%
- \jlreq at pagestyle@addifempty{\jlreq at running@head at iii@position}{\jlreq at even@running at head@ii}{\jlreq at gapcs}{\jlreq at even@running at head@iii}%
- \jlreq at pagestyle@addifempty{\jlreq at running@head at ii@position}{\jlreq at even@running at head@i}{\jlreq at gapcs}{\jlreq at even@running at head@ii}%
- \def\jlreq at nombre@contents{}% ノンブルを入れる(下の方に出力)
- \@for\jlreq at i:=i,ii,iii\do{%
- \expandafter\let\expandafter\jlreq at position\csname jlreq at nombre@\jlreq at i @position\endcsname
- \expandafter\ifx\csname jlreq at nombre@\jlreq at i\endcsname\@empty\else
- \jlreq at ifgluezero{\glueexpr\jlreq at position\relax}{\def\jlreq at position{}}{}%
- \eappto\jlreq at nombre@contents{%
- \noexpand\hbox to 0pt{\noexpand\hss
- \ifx\jlreq at position\@empty\else\unexpanded{\hskip \glueexpr}\expandonce{\jlreq at position}\noexpand\relax\fi
- \csexpandonce{jlreq at nombre@\jlreq at i}%
- }%
- }%
- \fi
- }%
- \jlreq at pagestyle@addfont at tocs{jlreq at nombre@contents}{jlreq at nombre@font}%
- % \jlreq@(odd|even)@contentsに柱を入れる(上の方に出力)
- \@for\jlreq at parity:=odd,even\do{%
- \expandafter\def\csname jlreq@\jlreq at parity @contents\endcsname{}%
- \@for\jlreq at i:=i,ii,iii\do{%
- \expandafter\let\expandafter\jlreq at position\csname jlreq at running@head@\jlreq at i @position\endcsname
- \expandafter\ifx\csname jlreq@\jlreq at parity @running at head@\jlreq at i\endcsname\@empty\else
- \jlreq at ifgluezero{\glueexpr\jlreq at position\relax}{\def\jlreq at position{}}{}%
- \expandafter\eappto\csname jlreq@\jlreq at parity @contents\endcsname{%
- \noexpand\hbox to 0pt{\unexpanded{\hskip\glueexpr\headsep + \headheight}%
- \if at tate\else\unexpanded{+ \topskip - \Cht}\fi
- \ifx\jlreq at position\@empty\else + \expandonce{\jlreq at position}\fi\noexpand\relax
- \csexpandonce{jlreq@\jlreq at parity @running at head@\jlreq at i}%
- \noexpand\hss
- }%
- }%
- \fi
- }%
- \jlreq at pagestyle@addfont at tocs{jlreq@\jlreq at parity @contents}{jlreq at running@head at font}%
- % \jlreq@(odd|even)headの構築
- % 空き指定には基本版面の文字サイズを使う(2.6.1.c)
- \@ifundefined{jlreq@\jlreq at parity headformat}
- {\def\jlreq at format{####1}}%
- {\expandafter\let\expandafter\jlreq at format\csname jlreq@\jlreq at parity headformat\endcsname}%
- \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\expandonce{\jlreq at format}}}\jlreq at do
- \edef\jlreq at tempb{%
- \csexpandonce{jlreq@\jlreq at parity @contents}%
- \noexpand\hfil
- \expandonce{\jlreq at nombre@contents}%
- }%
- \expandafter\edef\csname jlreq@\jlreq at parity head\endcsname{%
- \unexpanded{\setbox\jlreq at tempboxa=\hbox to \dimexpr\headsep + \headheight + \textheight}\if at tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax
- {%
- \unexpanded{\tate\adjustbaseline}%
- \expandafter\expandonce\expandafter{\expandafter\jlreq at tempa\expandafter{\jlreq at tempb}}%
- }%
- % Underful対策
- \ifx l\jlreq at engine
- \unexpanded{\wd\jlreq at tempboxa=\headheight}%
- \else
- \unexpanded{\ht\jlreq at tempboxa=\headheight\dp\jlreq at tempboxa=0pt}%
- \fi
- }%
- }%
- % \jlreq at tempboxaを正しく配置する
- \edef\jlreq at lefthead@adjustbox{%
- \noexpand\hskip\noexpand\dimexpr\if at tate\unexpanded{- \Cdp}\fi \unexpanded{- \headsep - 1\zw\relax}%
- \unexpanded{\box\jlreq at tempboxa\hfil}%
- }%
- \edef\jlreq at righthead@adjustbox{%
- \noexpand\hskip\unexpanded{\dimexpr\textwidth}\if at tate\unexpanded{- \topskip + \Cht}\fi\unexpanded{ + \headsep\relax}%
- \unexpanded{\box\jlreq at tempboxa\hss}%
- }%
- \if at tate
- \eappto\jlreq at oddhead{\expandonce{\jlreq at lefthead@adjustbox}}%
- \eappto\jlreq at evenhead{\expandonce{\jlreq at righthead@adjustbox}}%
- \else
- \eappto\jlreq at oddhead{\expandonce{\jlreq at righthead@adjustbox}}%
- \eappto\jlreq at evenhead{\expandonce{\jlreq at lefthead@adjustbox}}%
- \fi
- }{% yoko
- % 場所を正規化する.
- \def\jlreq at nombre@i at position@default{{bottom}{center}}%
- \def\jlreq at running@head at i@position at default{{top}{center}}%
- % ii以降の位置は指定されていない場合はiのそれに合わせる
- \@for\jlreq at tempa:=jlreq at nombre,jlreq at running@head\do{%
- \@for\jlreq at i:=ii,iii\do{%
- \expandafter\ifx\csname\jlreq at tempa @\jlreq at i @position\endcsname\@empty
- \expandafter\let\csname\jlreq at tempa @\jlreq at i @position\expandafter\endcsname\csname\jlreq at tempa @i at position\endcsname
- \fi
- \expandafter\edef\csname\jlreq at tempa @\jlreq at i @position at default\endcsname{\csname\jlreq at tempa @i at position@default\endcsname}%
- }%
- }%
- \@for\jlreq at tempa:=jlreq at nombre@i at position,jlreq at nombre@ii at position,jlreq at nombre@iii at position,jlreq at running@head at i@position,jlreq at running@head at ii@position,jlreq at running@head at iii@position\do{%
- \edef\jlreq at next{\noexpand\jlreq at pagestyle@parse at position{\csexpandonce{\jlreq at tempa}}{\expandonce{\csname\jlreq at tempa\endcsname}}{\csexpandonce{\jlreq at tempa @default}}}%
- \jlreq at next
- }%
- \ifthenelse{\(
- \boolean{@tate} \AND \(
- \equal{\expandafter\@secondoftwo\jlreq at nombre@i at position}{right} \OR
- \equal{\expandafter\@secondoftwo\jlreq at running@head at i@position}{right}
- \)\) \OR \(
- \(\NOT \boolean{@tate}\) \AND \(
- \equal{\expandafter\@secondoftwo\jlreq at nombre@i at position}{left} \OR
- \equal{\expandafter\@secondoftwo\jlreq at running@head at i@position}{left}
- \)
- \)}{%
- \if at twoside
- \jlreq at note{柱やノンブルは,左ページでは,基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか,基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内,2.6.1.b).}%
- \fi
- }{}%
- % フォント変更命令に文字出力命令が入っているとエラーになるのを回避するために\setboxでごまかす.
- \setbox\jlreq at tempboxa=\hbox{\jlreq at running@head at font
- \ifthenelse{\lengthtest{\jlreq at gap < 1.49\zw} \OR \( \lengthtest{\jlreq at gap > 1.51\zw} \AND \lengthtest{\jlreq at gap < 1.99\zw} \) \OR \lengthtest{\jlreq at gap > 2.01\zw}}{\jlreq at note{ノンブルと柱との空き量は柱に使用する文字サイズの2倍又は1.5倍とする (ページスタイル #1 内,2.6.1.c).}}{}%
- }%
- % 初期化
- \@for\jlreq at parity:=odd,even\do{%
- \@for\jlreq at vert:=top,bottom\do{%
- \@for\jlreq at hor:=left,center,right\do{%
- \@for\jlreq at type:=nombre,running at head\do{%
- \expandafter\def\csname jlreq@\jlreq at type @\jlreq at parity @\jlreq at vert @\jlreq at hor\endcsname{}%
- }%
- }%
- }%
- % ページが左か右か
- \jlreq at ifleftpage{\jlreq at parity}{\def\jlreq at pagehor{left}}{\def\jlreq at pagehor{right}}%
- % \jlreq@(running at head|nombre)@(odd|even)@(top|bottom)@(left|center|right)に入れていく
- % 左ページではノンブルが左(2.6.1.c),i,ii,...はiが左になるようにする.
- \@for\jlreq at i:=i,ii,iii\do{%
- % nombre
- \expandafter\ifx\csname jlreq at nombre@\jlreq at i\endcsname\@empty\else
- \edef\jlreq at position{\csname jlreq at nombre@\jlreq at i @position\endcsname}%
- \edef\jlreq at vert{\expandafter\@firstoftwo\jlreq at position}%
- \edef\jlreq at hor{\expandafter\@secondoftwo\jlreq at position}%
- \ifthenelse{\equal{\jlreq at parity}{even}}{\jlreq at reverse@leftright{\jlreq at hor}}{}%
- \jlreq at ifleftpage{\jlreq at parity}{\let\jlreq at addtocs=\cseappto}{\let\jlreq at addtocs\csepreto}%
- \edef\jlreq at csname{jlreq at nombre@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
- \expandafter\ifx\csname\jlreq at csname\endcsname\@empty\else\jlreq at addtocs{\jlreq at csname}{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at nombre@gap}\noexpand\relax}\fi
- \jlreq at addtocs{\jlreq at csname}{\csexpandonce{jlreq at nombre@\jlreq at i}}%
- \fi
- % running at head
- % 一度「紙面の外から」の順番で{A}{B}{C}と入れる
- \expandafter\ifx\csname jlreq@\jlreq at parity @running at head@\jlreq at i \endcsname\@empty\else
- \edef\jlreq at position{\csname jlreq at running@head@\jlreq at i @position\endcsname}%
- \edef\jlreq at vert{\expandafter\@firstoftwo\jlreq at position}%
- \edef\jlreq at hor{\expandafter\@secondoftwo\jlreq at position}%
- \ifthenelse{\equal{\jlreq at parity}{even}}{\jlreq at reverse@leftright{\jlreq at hor}}{}%
- \ifthenelse{\equal{\jlreq at hor}{\jlreq at pagehor}}{\let\jlreq at addtocs=\cseappto}{\let\jlreq at addtocs=\csepreto}%
- \edef\jlreq at csname{jlreq at running@head@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
- \jlreq at addtocs{\jlreq at csname}{{\csexpandonce{jlreq@\jlreq at parity @running at head@\jlreq at i}}}%
- \fi
- }%
- % {A}{B}{C}の順だった柱を結合する.本体は\jlreq at pagestyle@make at runninghead.
- \@for\jlreq at vert:=top,bottom\do{%
- \@for\jlreq at hor:=left,center,right\do{%
- \ifthenelse{\equal{\jlreq at hor}{right}}{\def\jlreq at tempa{*}}{\def\jlreq at tempa{}}%
- \edef\jlreq at do{\noexpand\jlreq at pagestyle@make at runninghead{jlreq at running@head@\jlreq at parity @\jlreq at vert @\jlreq at hor}{\expandonce{\jlreq at tempa}}{\expandonce{\jlreq at running@head at gap}}}%
- \jlreq at do
- }%
- }%
- % ノンブルと柱を結合し,必要ならばフォント設定をする.
- \@for\jlreq at vert:=top,bottom\do{%
- \@for\jlreq at hor:=left,center,right\do{%
- \edef\jlreq at csname{jlreq@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
- \edef\jlreq at runheadcsname{jlreq at running@head@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
- \edef\jlreq at nombrecsname{jlreq at nombre@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
- % nombreにフォント設定を追加.
- \expandafter\ifx\csname\jlreq at nombrecsname\endcsname\@empty\else
- \ifx\jlreq at nombre@font\@empty\else
- \expandafter\edef\csname\jlreq at nombrecsname\endcsname{{\expandonce{\jlreq at nombre@font}\csexpandonce{\jlreq at nombrecsname}}}%
- \fi
- \fi
- \jlreq at if{\expandafter\ifx\csname\jlreq at runheadcsname\endcsname\@empty\fi}{%
- % 柱が空:ノンブルのみでよい
- \expandafter\let\csname\jlreq at csname\expandafter\endcsname\csname\jlreq at nombrecsname\endcsname
- }{%
- \jlreq at if{\expandafter\ifx\csname\jlreq at nombrecsname\endcsname\@empty\fi}{%
-% % ノンブルが空.柱のみでよい.
- \jlreq at pagestyle@addfont at tocs{\jlreq at runheadcsname}{jlreq at running@head at font}%
- \expandafter\let\csname\jlreq at csname\expandafter\endcsname\csname\jlreq at runheadcsname\endcsname
- }{%
-% % 両方ある場合:左ページではノンブルが左,右ページではノンブルが右.
- \jlreq at ifleftpage{\jlreq at parity}{%
- \ifthenelse{\equal{\jlreq at hor}{right}}{%
- % <ノンブル><空き><柱>,右寄せ
- % 柱が空出ないときに限り<空き>を入れる.
- \jlreq at pagestyle@addfont at totokens{\unexpanded{\ifdim\wd\jlreq at PageStyle@box=0pt \else\hskip}\expandonce{\jlreq at gap}\unexpanded{\relax\fi}}{jlreq at running@head at font}{jlreq at tempa}%
- \expandafter\edef\csname\jlreq at csname\endcsname{%
- \unexpanded{\setbox\jlreq at PageStyle@box=\hbox}{\expandonce{\jlreq at running@head at font}\csexpandonce{\jlreq at runheadcsname}}%
- \csexpandonce{\jlreq at nombrecsname}\expandonce{\jlreq at tempa}\unexpanded{\box\jlreq at PageStyle@box}%
- }%
- }{%
- % <ノンブル><空き><柱>,左寄せ
- % ノンブルは常に空ではないと仮定する.
- \jlreq at pagestyle@addfont at totokens{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at gap}\noexpand\relax\csexpandonce{\jlreq at runheadcsname}}{jlreq at running@head at font}{jlreq at tempa}%
- \expandafter\edef\csname\jlreq at csname\endcsname{\csexpandonce{\jlreq at nombrecsname}\expandonce{\jlreq at tempa}}%
- }%
- }{%
- \ifthenelse{\equal{\jlreq at hor}{left}}{%
- % <柱><空き><ノンブル>,左寄せ
- \jlreq at pagestyle@addfont at totokens{%
- \unexpanded{\setbox\jlreq at PageStyle@box=\hbox}{\csexpandonce{\jlreq at runheadcsname}}%
- \unexpanded{\copy\jlreq at PageStyle@box\ifdim\wd\jlreq at PageStyle@box=0pt \else\hskip\glueexpr}\expandonce{\jlreq at gap}\unexpanded{\relax\fi}%
- }{jlreq at running@head at font}{jlreq at tempa}%
- \expandafter\edef\csname\jlreq at csname\endcsname{\expandonce{\jlreq at tempa}\csexpandonce{\jlreq at nombrecsname}}%
- }{%
- % <柱><空き><ノンブル>,右寄せ
- \jlreq at pagestyle@addfont at totokens{\csexpandonce{\jlreq at runheadcsname}\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at gap}\noexpand\relax}{jlreq at running@head at font}{jlreq at tempa}%
- \expandafter\edef\csname\jlreq at csname\endcsname{\expandonce{\jlreq at tempa}\csexpandonce{\jlreq at nombrecsname}}%
- }%
- }%
- }%
- }%
- }%
- }%
- }%
- % 四カ所構築
- \jlreq at pagestyle@setheadfoot{\jlreq at oddhead}{jlreq at odd@top at left}{jlreq at odd@top at center}{jlreq at odd@top at right}%
- \jlreq at pagestyle@setheadfoot{\jlreq at oddfoot}{jlreq at odd@bottom at left}{jlreq at odd@bottom at center}{jlreq at odd@bottom at right}%
- \jlreq at pagestyle@setheadfoot{\jlreq at evenhead}{jlreq at even@top at left}{jlreq at even@top at center}{jlreq at even@top at right}%
- \jlreq at pagestyle@setheadfoot{\jlreq at evenfoot}{jlreq at even@bottom at left}{jlreq at even@bottom at center}{jlreq at even@bottom at right}%
- \ifthenelse{\lengthtest{\marginparwidth>0pt} \AND \(\NOT\boolean{@tate}\)}{%
- \def\jlreq at defaultformat{\hss\hbox to \jlreqyokoheadlength{####1}\hss}%
- }{%
- \def\jlreq at defaultformat{####1}%
- }%
- \jlreq at pagestyle@applyformat{\jlreq at oddhead}{\jlreq at oddheadformat}{\jlreq at defaultformat}%
- \jlreq at pagestyle@applyformat{\jlreq at evenhead}{\jlreq at evenheadformat}{\jlreq at defaultformat}%
- \jlreq at pagestyle@applyformat{\jlreq at oddfoot}{\jlreq at oddfootformat}{\jlreq at defaultformat}%
- \jlreq at pagestyle@applyformat{\jlreq at evenfoot}{\jlreq at evenfootformat}{\jlreq at defaultformat}%
- % 傍注用調整
- \ifdim\marginparwidth>0pt
- \if at tate\else
- \if at twocolumn
- \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at oddhead}%
- \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at oddfoot}%
- \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at evenhead}%
- \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at evenfoot}%
- \else
- \jlreq at pagestyle@addsidenotemargin at right{\jlreq at oddhead}%
- \jlreq at pagestyle@addsidenotemargin at right{\jlreq at oddfoot}%
- \jlreq at pagestyle@addsidenotemargin at left{\jlreq at evenhead}%
- \jlreq at pagestyle@addsidenotemargin at left{\jlreq at evenfoot}%
- \fi
- \fi
- \fi
- }%
- \edef\jlreq at do{%
- \noexpand\edef\expandonce{\csname ps@#1\endcsname}{%
- \noexpand\unexpanded{%
- \unexpanded{\def\jlreq at current@pagestyle{#1}}%
- \ifjlreq at clearmarkcommand\unexpanded{\jlreq at heading@execmacro at toallheadings\jlreq at clearheadingmarks}\fi
- \ifjlreq at headii@exist
- \unexpanded{\let\@mkboth=\jlreq at markboth}%
- \else
- \unexpanded{\let\@mkboth=\markboth}%
- \fi
- \unexpanded{\def\@oddhead}{\expandonce{\jlreq at oddhead}}%
- \unexpanded{\def\@oddfoot}{\expandonce{\jlreq at oddfoot}}%
- \unexpanded{\def\@evenhead}{\expandonce{\jlreq at evenhead}}%
- \unexpanded{\def\@evenfoot}{\expandonce{\jlreq at evenfoot}}%
- \expandonce{\jlreq at markdefinecommand}%
- \expandonce{\jlreq at command}%
- }%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\if at tate
- \def\jlreqyokoheadlength{\textheight}
-\else
- \ifdim\marginparwidth>0pt
- \if at twocolumn
- \def\jlreqyokoheadlength{\dimexpr\textwidth + 2\marginparwidth + 2\marginparsep\relax}
- \else
- \def\jlreqyokoheadlength{\dimexpr\textwidth + \marginparwidth + \marginparsep\relax}
- \fi
- \else
- \def\jlreqyokoheadlength{\textwidth}
- \fi
-\fi
-\edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if at tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax}
-
-\newcommand*{\NewPageStyle}[2]{%
- \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
-}
-\newcommand*{\RenewPageStyle}[2]{%
- \@ifundefined{ps@#1}{\@latex at 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 at pagestyle@setting@#1}{\ClassError{jlreq}{Unknown pagestyle: #1}{\@ehc}}{}%
- \expandafter\let\expandafter\setting\expandafter=\csname jlreq at pagestyle@setting@#1\endcsname
- \edef\jlreq at do{\noexpand\RenewPageStyle{#1}{\expandonce{\setting},\unexpanded{#2}}}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-%. フロート関連
-% 4.3.3.dの例,縦組みの時だけど横にも適用……
-\setlength{\floatsep}{1\jlreq at gol plus 1\jlreq at gol}
-\setlength{\textfloatsep}{1\jlreq at gol plus \baselineskip}
-\intextsep=\textfloatsep
-\dblfloatsep=\floatsep
-\dbltextfloatsep=\textfloatsep
-% 残りはデフォルトにしておく.
-
-%. 環境も引数にとる可能性のある\jlreqsetup用マクロ.
-% #3={<設定1>,<環境名>=<設定2>}のようなものを受け付ける.
-% #2に<設定1>が,#2@<環境名>に<設定2>が入る.#1には#2@<環境名>が定義されている<環境名>をカンマ区切りで入れる.
-% \jlreqsetup{X,env=B}の後に\jlreqsetup{Y}を指定すると,env環境に対する設定はYになるようにする.
-% ただし\jlreqsetup{env=C,Y}とした場合はenv環境に対してはC.
-\long\def\jlreq at jlreqsetup@withenv#1#2#3{%
- \@ifundefined{#1}{\expandafter\def\csname #1\endcsname{}}{}%
- \begingroup
- \def\jlreq at do{}%
- \jlreq at parsekeyval@nokey{%
- \ifjlreq at parsekeyval@nokey at novalue{%
- \epreto\jlreq at do{%
- \noexpand\edef\expandonce{\csname #2\endcsname}{\unexpanded{\unexpanded{##1}}}
- \noexpand\def\expandonce{\csname #1\endcsname}{}%
- }%
- \expandafter\@for\expandafter\jlreq at tempa\expandafter:\expandafter=\csname #1\endcsname\do{%
- \epreto\jlreq at do{\noexpand\let\expandonce{\csname #2@\jlreq at tempa\endcsname}\noexpand\@undefined}%
- }%
- }{%
- \eappto\jlreq at do{%
- \noexpand\edef\expandonce{\csname #2@##1\endcsname}{\unexpanded{\unexpanded{##2}}}%
- \unexpanded{\def\jlreq at tempa{\jlreq at helper@removeelement{##1}}}%
- \unexpanded{\expandafter\jlreq at tempa\expandafter}{\expandonce{\csname #1\endcsname}}{\expandonce{\csname #1\endcsname}}%
- \unexpanded{\csappto{#1}{,##1}}%
- }%
- }%
- }{#3}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-% #1@#2が定義されていれば\#1@#2の中身に,そうでなければ\#1の中身に展開される.
-% 展開は\unexpandedで抑制される.
-\def\jlreq at jlreqsetup@withenv at nameuse#1#2{%
- \jlreq at if{\expandafter\ifx\csname #1@#2\endcsname\relax\fi}{\csexpandonce{#1}}{\csexpandonce{#1@#2}}%
-}
-% 4.3.1 注4
-\newlength\abovecaptionskip
-\newlength\belowcaptionskip
-
-%. 図表
-\newcommand{\@makecaption}[2]{{%
- % \jlreq at tempbに現在の環境を入れる.
- \@ifundefined{@currenvir}{%
- \@ifundefined{@captype}%
- {\def\jlreq at tempb{}}%
- {\let\jlreq at tempb=\@captype}%
- }{\let\jlreq at tempb=\@currenvir}%
- \reset at font\small
- \vskip\abovecaptionskip
- \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at label@format at setting}{\jlreq at tempb}}}%
- \jlreq at do
- \setbox\jlreq at tempboxa=\hbox{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at label@font at setting}{\jlreq at tempb}#1}%
- \ifdim\wd\jlreq at tempboxa=0pt
- \edef\jlreq at tempa{{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at font@setting}{\jlreq at tempb}\unexpanded{#2}}}%
- \else
- \edef\jlreq at tempa{%
- {\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at label@font at setting}{\jlreq at tempb}\expandonce{\jlreq at tempa{#1}}}%
- \unexpanded{\hskip\glueexpr}\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at after@label at space@setting}{\jlreq at tempb}\noexpand\relax
- {\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at font@setting}{\jlreq at tempb}\unexpanded{#2}}%
- }%
- \fi
- \setbox\@tempboxa=\hbox{\jlreq at tempa}%
- \edef\jlreq at tempc{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at align@setting}{\jlreq at tempb}}%
- \expandafter\let\expandafter\jlreq at align\jlreq at tempc
- \ifdim\wd\@tempboxa>\hsize\relax
- {%
- \ifx c\jlreq at align\centering\fi
- \ifx r\jlreq at align\raggedleft\fi
- \unhbox\@tempboxa\par
- }%
- \else
- \global\@minipagefalse
- \hbox to\hsize{%
- \ifnum0\ifx c\jlreq at align 1\fi\ifx r\jlreq at align 1\fi>0 \hfil\fi
- \unhbox\@tempboxa
- \ifnum0\ifx c\jlreq at align 1\fi\ifx l\jlreq at align 1\fi>0 \hfil\fi
- }%
- \fi
- \vskip\belowcaptionskip}}
-
-\jlreq at jlreqsetup@add{caption_font}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at font@envlist}{jlreq@@makecaption at font@setting}{#1}}
-\jlreq at jlreqsetup@add{caption_label_font}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at label@font at envlist}{jlreq@@makecaption at label@font at setting}{#1}}
-\jlreq at jlreqsetup@add{caption_label_format}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at label@format at envlist}{jlreq@@makecaption at label@format at setting}{#1}}
-\jlreq at jlreqsetup@add{caption_after_label_space}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at after@label at space@envlist}{jlreq@@makecaption at after@label at space@setting}{#1}}
-
-\def\jlreq@@makecaption at align@clearandsetalign#1{%
- \@for\jlreq at tempa:=\jlreq@@makecaption at align@envlist\do{%
- \ifx\jlreq at tempa\@empty\else
- \eappto\jlreq at generalset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@\jlreq at tempa\endcsname}=\noexpand\@undefined}%
- \fi
- }%
- \appto\jlreq at generalset{%
- \def\jlreq@@makecaption at align@envlist{}%
- \let\jlreq@@makecaption at align@setting=#1%
- }%
-}
-\jlreq at jlreqsetup@add{caption_align}{%
- \@ifundefined{jlreq@@makecaption at align@envlist}{\def\jlreq@@makecaption at align@envlist{}}{}%
- \begingroup
- \def\jlreq at generalset{}\def\jlreq at envset{}%
- \jlreq at parsekeyval@nokey{%
- \jlreq at ifempty{##1}{}{%
- \jlreq at switch{##1}{%
- {center}{\jlreq@@makecaption at align@clearandsetalign{c}}
- {left}{\jlreq@@makecaption at align@clearandsetalign{l}}
- {right}{\jlreq@@makecaption at align@clearandsetalign{r}}
- {top}{\jlreq@@makecaption at align@clearandsetalign{l}}
- {bottom}{\jlreq@@makecaption at align@clearandsetalign{r}}
- {%
- \jlreq at switch{##2}{%
- {center}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=c}}%
- {left}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=l}}%
- {right}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=r}}%
- {top}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=l}}%
- {bottom}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=r}}%
- }%
- \appto\jlreq at envset{%
- \def\jlreq at tempa{\jlreq at helper@removeelement{##1}}%
- \expandafter\jlreq at tempa\expandafter{\jlreq@@makecaption at align@envlist}{\jlreq@@makecaption at align@envlist}%
- \appto\jlreq@@makecaption at align@envlist{,##1}%
- }%
- }%
- }%
- }%
- }{#1}%
- \edef\jlreq at do{\expandonce{\jlreq at generalset}\expandonce{\jlreq at envset}}%
- \expandafter\endgroup
- \jlreq at do
-}
-% 特に根拠のない値
-\setlength\abovecaptionskip{.5\jlreq at gol}
-\setlength\belowcaptionskip{0pt}
-
-%.. figure環境
-\newcounter{figure}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
- \renewcommand{\thefigure}{\@arabic\c at figure}
-}{%
- \@addtoreset{figure}{chapter}
- \renewcommand{\thefigure}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at figure}
-}
-\newcommand*{\fps at figure}{h}
-\newcommand*{\ftype at figure}{1}
-\newcommand*{\ext at figure}{lof}
-\newcommand*{\fnum at figure}{\figurename\thefigure}
-\newenvironment{figure}{\@float{figure}}{\end at float}
-\newenvironment{figure*}{\@dblfloat{figure}}{\end at dblfloat}
-
-%.. table環境
-\newcounter{table}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
- \renewcommand{\thetable}{\@arabic\c at table}
-}{%
- \@addtoreset{table}{chapter}
- \renewcommand{\thetable}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at table}
-}
-\newcommand*{\fps at table}{h}
-\newcommand*{\ftype at table}{2}
-\newcommand*{\ext at table}{lot}
-\newcommand*{\fnum at table}{\tablename\thetable}
-\newenvironment{table}{\@float{table}}{\end at float}
-\newenvironment{table*}{\@dblfloat{table}}{\end at dblfloat}
-
-%. タイトル周り
-\newenvironment{titlepage}{%
- \if at twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse\newpage
- \fi
- \thispagestyle{empty}%
- \setcounter{page}{1}%
-}{%
- \if at restonecol\twocolumn\else\newpage\fi
- \if at twoside\else
- \setcounter{page}{1}%
- \fi
-}
-
-\if at 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 at tate
- \let\jlreq at temporary@original at ialign=\ialign
- \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq at temporary@original at 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 at endofmaketitle
- }
-\else
- \newcommand{\maketitle}{%
- \par
- \begingroup
- \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
- \renewcommand{\@makefnmark}{\hbox{%
- \jlreq at iftdir{\yoko}{}%
- \rlap{\@textsuperscript{\normalfont\@thefnmark}}%
- }}%
- \renewcommand{\jlreq at referencemark@format}[1]{\@makefnmark}% うーん
- \if at twocolumn
- \ifnum\col at 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 at endofmaketitle
- }
-\fi
-% いろいろクリアする.
-\def\jlreq at endofmaketitle{%
- \setcounter{footnote}{0}%
- \global\let\thanks\relax
- \global\let\maketitle\relax
- \global\let\p at 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 at keepbaselineskip{\LARGE}\@title\par}%
- \vskip\baselineskip
- {\jlreq at keepbaselineskip{\large}%
- \lineskip .5\zh
- % 縦書き時には表組み内でも縦書きにするようにする
- \if at tate
- \let\jlreq at temporary@original at ialign=\ialign
- \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq at temporary@original at ialign}}{}{}%
- \fi
- \begin{tabular}[t]{c}%
- \@author
- \end{tabular}%
- \par
- }%
- \ifx\@date\@empty\else
- \vskip\baselineskip
- {\jlreq at keepbaselineskip{\large}\@date}%
- \fi
- \end{center}%
- \par
- \vskip\baselineskip
- \ifvoid\jlreq at abstractbox\else\unvbox\jlreq at abstractbox\fi
-}
-
-%.. abstract
-\def\jlreq at parhook@abstract{}
-\ifthenelse{\equal{\jlreq at article@type}{book}}{}{% article,report
- \newbox\jlreq at abstractbox
- \newcommand*{\abstractname}{概要}
- \if at 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 at twocolumn\else1\fi\ifjlreq at preamble1\fi>0
- \ifjlreq at preamble
- \ifx l\jlreq at engine\else
- \def\jlreq at parhook@abstract{\futurelet\jlreq at nextchar\jlreq at openbracket@hook}%
- \PushPostHook{par}{\jlreq at parhook@abstract}%
- \fi
- \fi
- % とりあえず全部ボックスに入れる.
- \global\setbox\jlreq at abstractbox=\vtop\bgroup
- \ifjlreq at preamble
- % preamble後っぽく振る舞う
- \@noskipsecfalse
- % \@nodocumentが入っているので一時的に無効化
- \everypar{}%
- \fi
- \if at 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 at twocolumn\else1\fi\ifjlreq at preamble1\fi>0
- \endlist
- \egroup
- \vspace{\baselineskip}%
- \if at twocolumn
- \end{minipage}
- \fi
- \egroup
- \fi
- \ifjlreq at preamble
- \ifx l\jlreq at engine\else
- \def\jlreq at parhook@abstract{}%
- \fi
- \else
- \unvbox\jlreq at 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 at original@@item=\@item
-% \def\@item[##1]{\jlreq at original@@item[##1]\mbox{}\par
- }}{\endlist}
-\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\bfseries #1}
-
-%.. 箇条書き
-% #3={<設定1>,i=<設定2>,<環境名>={<設定3>,ii=<設定4>}}のような設定を解釈する.
-% <設定2>は#2 at iに,<設定4>は#2 at ii@<環境名>に格納される.
-% <設定1>の指定はi=<設定1>,..,vi=<設定1>と等価.<設定3>も同様.
-% #1には現在何か値が定義されている環境名をカンマ区切りで入れる.
-\long\def\jlreq at jlreqsetup@itemization#1#2#3{
- \@ifundefined{#1}{\expandafter\def\csname #1\endcsname{}}{}%
- \begingroup
- \def\jlreq at generalset{}%
- \def\jlreq at levelset{}%
- \def\jlreq at envset{}%
- \jlreq at parsekeyval@nokey{%
- \ifjlreq at parsekeyval@nokey at novalue{%
- % 生の値.環境に対するものをクリアし,全ての<i-iv>に同じ値を設定
- % 環境一覧リストもクリア.
- \@for\jlreq at tempa:=i,ii,iii,iv,v,vi\do{%
- \expandafter\@for\expandafter\jlreq at tempb\expandafter:\expandafter=\csname #1\endcsname\do{%
- \ifx\jlreq at tempb\@empty\else
- \eappto\jlreq at generalset{\noexpand\let\expandonce{\csname #2@\jlreq at tempa @\jlreq at tempb\endcsname}\noexpand\@undefined}%
- \fi
- }%
- \eappto\jlreq at generalset{%
- \noexpand\edef\expandonce{\csname #2@\jlreq at tempa\endcsname}{\unexpanded{\unexpanded{##1}}}%
- }%
- }%
- \appto\jlreq at generalset{\expandafter\def\csname #1\endcsname{}}%
- }{%
- \ifthenelse{\equal{##1}{i} \OR \equal{##1}{ii} \OR \equal{##1}{iii} \OR \equal{##1}{iv} \OR \equal{##1}{v} \OR \equal{##1}{vi}}{%
- % i=とかの時,環境に対応するものをクリアし,\#2@##1に値を入れる
- \expandafter\@for\expandafter\jlreq at tempa\expandafter:\expandafter=\csname #1\endcsname\do{
- \ifx\jlreq at tempa\@empty\else
- \epreto\jlreq at envset{\noexpand\let\expandonce{\csname #2@##1@\jlreq at tempa\endcsname}\noexpand\@undefined}%
- \fi
- }%
- \eappto\jlreq at envset{\noexpand\edef\expandonce{\csname #2@##1\endcsname}{\unexpanded{\unexpanded{##2}}}}%
- }{%
- % そうでないとき,環境.##1 = 環境名
- \jlreq at parsekeyval@nokey{%
- \ifjlreq at parsekeyval@nokey at novalue{%
- % i - viまでに全てセットする.
- \@for\jlreq at tempa:=i,ii,iii,iv,v,vi\do{%
- \epreto\jlreq at envset{\noexpand\edef\expandonce{\csname #2@\jlreq at tempa @##1\endcsname}{\unexpanded{\unexpanded{####1}}}}%
- }%
- }{%
- % ピンポイント代入
- \eappto\jlreq at envset{\noexpand\edef\expandonce{\csname #2@####1@##1\endcsname}{\unexpanded{\unexpanded{####2}}}}%
- }%
- }{##2}%
- \eappto\jlreq at envset{%
- \unexpanded{\def\jlreq at tempa{\jlreq at helper@removeelement{##1}}}%
- \unexpanded{\expandafter\jlreq at tempa\expandafter}{\expandonce{\csname #1\endcsname}}{\expandonce{\csname #1\endcsname}}%
- \noexpand\appto\expandonce{\csname #1\endcsname}{\unexpanded{,##1}}%
- }%
- }%
- }%
- }{#3}%
- \edef\jlreq at do{\expandonce{\jlreq at generalset}\expandonce{\jlreq at levelset}\expandonce{\jlreq at envset}}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\def\jlreq at itemization@beforeafter at space@envlist{}
-\jlreq at jlreqsetup@add{itemization_beforeafter_space}{\jlreq at jlreqsetup@itemization{jlreq at itemization@beforeafter at space@envlist}{jlreq at itemization@beforeafter at space@setting}{#1}}
-\jlreq at jlreqsetup@add{itemization_itemsep}{\jlreq at jlreqsetup@withenv{jlreq at itemization@itemsep at envlist}{jlreq at itemization@itemsep at setting}{#1}}
-\jlreq at jlreqsetup@add{itemization_labelsep}{\jlreq at jlreqsetup@withenv{jlreq at itemization@labelsep at envlist}{jlreq at itemization@labelsep at setting}{#1}}
-\jlreq at jlreqsetup@add{itemization_label_length}{\jlreq at jlreqsetup@itemization{jlreq at itemization@label at length@envlist}{jlreq at itemization@label at length@setting}{#1}}
-% enumerate, itemize用初期化,#1 = i,ii,...
-\def\jlreq at init@list#1{%
- \setlength{\partopsep}{0pt}%
- \setlength{\itemsep}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@itemsep at setting}{\@currenvir}}%
- \setlength{\parsep}{0pt}%
- \setlength{\listparindent}{\parindent}%
- \setlength{\labelsep}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@labelsep at setting}{\@currenvir}\relax}%
- \setlength{\labelwidth}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@label at length@setting@#1}{\@currenvir}\relax}%
- \setlength{\topsep}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@beforeafter at space@setting@#1}{\@currenvir}\relax}%
- \setlength{\leftmargin}{\dimexpr\csname leftmargin#1\endcsname}%
- \setlength{\itemindent}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@label at length@setting@#1}{\@currenvir} + \labelsep - \leftmargin\relax}%
-}
-
-\def\@listi{\jlreq at init@list{i}}%
-\let\@listI\@listi
-\def\@listii{\jlreq at init@list{ii}}
-\def\@listiii{\jlreq at init@list{iii}}
-\def\@listiv{\jlreq at init@list{iv}}
-\def\@listv{\jlreq at init@list{v}}
-\def\@listvi{\jlreq at init@list{vi}}
-
-% 引用系.3.5.2の例.
-\jlreq at jlreqsetup@add{quote_indent}{\def\jlreq at quote@indent{#1}}
-\jlreq at jlreqsetup@add{quote_end_indent}{\def\jlreq at quote@end at indent{#1}}
-\jlreq at jlreqsetup@add{quote_fontsize}[normalsize,small,footnotesize,scriptsize,tiny,]{\jlreq at ifempty{#1}{\def\jlreq at quote@fontsize{}}{\edef\jlreq at quote@fontsize{\expandonce{\csname #1\endcsname}}}}
-\jlreq at jlreqsetup@add{quote_beforeafter_space}{\def\jlreq at quote@beforeafter at space{#1}}
-
-\newenvironment{verse}
- {\let\\\@centercr
- \list{}{\itemsep\z@ \itemindent -2\jlreq at mol
- \listparindent\itemindent
- \labelwidth\z@
- \labelsep\z@
- \leftmargin=\dimexpr\jlreq at quote@indent\relax
- \addtolength{\leftmargin}{2\jlreq at mol}%
- \rightmargin=\dimexpr\jlreq at quote@end at indent\relax
- \jlreq at 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 at quote@beforeafter at space\relax
- \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax}%
- \item\relax}{\endlist}
-\newenvironment{quotation}
- {\list{}{%
- \leftmargin=\dimexpr\jlreq at quote@indent\relax
- \rightmargin=\dimexpr\jlreq at quote@end at indent\relax
- \jlreq at 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 at quote@beforeafter at space\relax
- \parsep\z@ \@plus.1\jlreq at gol}%
- \item\relax}{\endlist}
-\newenvironment{quote}
- {\list{}{%
- \leftmargin=\dimexpr\jlreq at quote@indent\relax
- \rightmargin=\dimexpr\jlreq at quote@end at indent\relax
- \jlreq at 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 at speciallength{\jlreq at quote@beforeafter at space}%
- \listparindent\z@}%
- \item\relax}{\endlist}
-
-%. 表関係 4.4
-% 表内の行間を0にする(4.4.3.f)
-\jlreq at saveoriginalcs{\tabular}
-\jlreq at 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 at omotekeiwidth} % 4.4.3.c
-\setlength\doublerulesep{2pt}
-\setlength\tabbingsep{\labelsep}
-\skip\@mpfootins=\skip\footins
-\setlength\fboxsep{.3\zw}
-\setlength\fboxrule{\jlreq at omotekeiwidth} % 根拠はない
-% 後で
-\ifthenelse{\equal{\jlreq at article@type}{article}}{%
- \renewcommand{\theequation}{\@arabic\c at equation}
-}{%
- \@addtoreset{equation}{chapter}
- \renewcommand{\theequation}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at equation}
-}
-
-%. 目次
-\setcounter{tocdepth}{3}
-\newcommand{\@pnumwidth}{2\jlreq at mol}
-\newcommand{\@tocrmarg}{2.55em}
-\newcommand{\@dotsep}{2} % 狭くしてみた
-\newskip\toclineskip
-\setlength\toclineskip{0\jlreq at gol plus .02\jlreq at gol}
-% tarticleから
-\newdimen\@lnumwidth
-\def\numberline#1{\hbox to\@lnumwidth{#1\hfil}}
-\def\addcontentsline#1#2#3{%
- \protected at write\@auxout{%
- \let\label\@gobble\let\index\@gobble\let\glossary\@gobble
- \if at tate
- \@temptokena{\jlreq at rensuji{\thepage}}%
- \else
- \@temptokena{\thepage}%
- \fi
- }{\string\@writefile{#1}{\protect\contentsline{#2}{#3}{\the\@temptokena}}}%
-}
-
-\newcount\jlreq at top@contents % トップ見出しを入れる.レベルと同じ値.
-\jlreq at top@contents=-100
-\newcommand*{\jlreq at set@top at contents}[1]{%
- \ifnum\jlreq at top@contents=-100
- \jlreq at top@contents=#1\relax
- \fi
-}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{
- \newcommand{\tableofcontents}{%
- \jlreq at top@contents=-100\relax
- \if at twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse
- \fi
- \section*{\contentsname}%
- \@mkboth{\contentsname}{\contentsname}%
- \@starttoc{toc}%
- \if at restonecol\twocolumn\fi
- }
-}{% book, report
- \newcommand{\tableofcontents}{%
- \jlreq at top@contents=-100\relax
- \if at twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse
- \fi
- \chapter*{\contentsname}%
- \@mkboth{\contentsname}{\contentsname}%
- \@starttoc{toc}%
- \if at restonecol\twocolumn\fi
- }
-}
-% JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
-% 文字の大きさは全て同じ(\normalsize)にする.
-% 見出しのレベルがあがると1文字分ずつ字下げしていく.
-% 第三引数は,上からの幅に加え更にトップの見出しからの差による補正(プラス)が入る.
-% 補正には\jlreq at top@contentsを使う.
-% 「トップ」というか,一番最初に現れた見出しを入れる.
-% リーダーは.から・に変更しました.
-\def\@dottedtocline#1#2#3#4#5{%
- \jlreq at set@top at contents{#1}%
- \ifnum #1>\c at 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 at top@contents
- \@tempdima=1\jlreq at mol
- \multiply \@tempdima by \@tempcnta
- \advance\leftskip \@lnumwidth \hbox{}\hskip -\leftskip
- \advance\leftskip\@tempdima
- {#4}\nobreak
- \leaders\hbox{$\m at th\mkern \@dotsep mu$\null\inhibitglue ・\inhibitglue\null$\m at th\mkern \@dotsep mu$}%
- \hfill\nobreak
- \hb at xt@\@pnumwidth{\hss\normalfont\normalcolor #5}%
- \par}%
- \fi}
-
-% listoffigures
-\newcommand{\listoffigures}{%
- \jlreq at top@contents=-100
- \section*{\listfigurename}%
- \@mkboth{\listfigurename}{\listfigurename}%
- \@starttoc{lof}%
-}
-\newcommand*{\l at figure}{\@dottedtocline{1}{0\jlreq at gol}{2\jlreq at gol}}
-\newcommand{\listoftables}{%
- \jlreq at top@contents=-100
- \section*{\listtablename}%
- \@mkboth{\listtablename}{\listtablename}%
- \@starttoc{lot}%
-}
-\let\l at table\l at figure
-
-%. 文献,そのまま
-\newdimen\bibindent
-\setlength\bibindent{2\jlreq at mol}
-\newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
-\newenvironment{thebibliography}[1]{%
- \jlreq at oldfontcommand@enable
- \section*{\refname}%
- \@mkboth{\refname}{\refname}%
- \list{\@biblabel{\@arabic\c at enumiv}}%
- {\settowidth\labelwidth{\@biblabel{#1}}%
- \labelsep=1\zw
- \leftmargin\labelwidth
- \advance\leftmargin\labelsep
- \itemindent=0pt
- \@openbib at code
- \usecounter{enumiv}%
- \let\p at enumiv\@empty
- \renewcommand\theenumiv{\@arabic\c at enumiv}}%
- \sloppy
- \clubpenalty4000
- \@clubpenalty\clubpenalty
- \widowpenalty4000%
- \sfcode`\.\@m
-}{%
- \def\@noitemerr{\@latex at warning{Empty `thebibliography' environment}}%
- \endlist
- \jlreq at oldfontcommand@disable
-}
-\let\@openbib at code\@empty
-\if at tate
- \def\@cite#1#2{\jlreq at rensuji{[{#1\if at tempswa , #2\fi}]}}
- \def\@biblabel#1{\jlreq at rensuji{[#1]}}
-\fi
-
-%. 索引
-\newif\ifjlreq at resttate
-\newenvironment{theindex}{%
- \jlreq at oldfontcommand@enable
- \jlreq at iftdir{\clearpage\yoko\jlreq at resttatetrue}{\jlreq at resttatefalse}% 常に横書きにする
- \if at twocolumn\@restonecolfalse\else\@restonecoltrue\fi
- \columnseprule\z@ \columnsep 2\jlreq at mol
- \twocolumn[\section*{\indexname}]%
- \@mkboth{\indexname}{\indexname}%
- \jlreq at theindex@pagestyle
- \parindent\z@
- \parskip\z@ \@plus .03\jlreq at gol\relax
- \let\item\@idxitem
-}{%
- \ifx\jlreq at theindex@savedpagestyle\@undefined\else\expandafter\pagestyle\expandafter{\jlreq at theindex@savedpagestyle}\fi
- \let\jlreq at theindex@savedpagestyle\@undefined
- \if at restonecol\onecolumn\else\clearpage\fi
- \ifjlreq at resttate\tate\fi
- \jlreq at oldfontcommand@disable
-}
-\newcommand{\@idxitem}{\par\hangindent 4\jlreq at mol}
-\newcommand{\subitem}{\@idxitem \hspace*{2\jlreq at mol}}
-\newcommand{\subsubitem}{\@idxitem \hspace*{3\jlreq at mol}}
-\newcommand{\indexspace}{\par \vskip 1\jlreq at gol \@plus .5\jlreq at gol \@minus .3\jlreq at gol\relax}
-\def\jlreq at theindex@pagestyle{}
-\jlreq at jlreqsetup@add{theindex_pagestyle}{
- \def\jlreq at tempa{}% ページスタイル名
- \def\jlreq at theindex@pagestyle{}%
- \jlreq at tempafalse % restore
- \jlreq at parsekeyval@nokey{%
- \ifjlreq at parsekeyval@nokey at novalue{\def\jlreq at tempa{##1}}{%
- \jlreq at switch{##1}{%
- {restore}{\csname jlreq at tempa##2\endcsname}%
- }%
- }%
- }{#1}%
- \eappto\jlreq at theindex@pagestyle{\unexpanded{\let\jlreq at theindex@savedpagestyle}\ifjlreq at tempa\noexpand\jlreq at current@pagestyle\else\noexpand\@undefined\fi}%
- \ifx\jlreq at tempa\@empty\else
- \eappto\jlreq at theindex@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq at tempa}}}%
- \fi
-}
-
-%. 前付,後付,付録
-% \jlreq at matter@heading[restoreする見出し一覧を入れる制御綴]{#2@<見出し命令名>に今の見出しの中身を入れる}{生成する制御綴の名前}{設定}
-\def\jlreq at matter@heading{\@ifnextchar[{\jlreq at matter@heading@}{\jlreq at matter@heading@[]{}}}
-\def\jlreq at matter@heading@[#1]#2#3#4{%
- \begingroup
- \def\jlreq at restoreheadings{}% 復帰させる見出し名(カンマ区切り)
- \def\jlreq at headingscmds{}% \ModiryHeadings**,\RenewHeadings**の塊
- \jlreq at parsekeyval@nokey{%
- % ##1 = 見出し命令名, ##2 = 設定
- \def\jlreq at headingsettings{}% Modifyする中身
- \def\jlreq at declaretype{Modify}%
- \def\jlreq at level{}%
- \jlreq at tempatrue % restore
- \jlreq at parsekeyval@nokey{%
- % 各見出し命令に対する設定を解析
- \ifjlreq at parsekeyval@nokey at novalue{%
- \eappto\jlreq at headingsettings{\unexpanded{####1}}%
- }{%
- \jlreq at switch{####1}{%
- {heading_type}{%
- \lowercase{\def\jlreq at tempa{####2}}%
- \jlreq at switch{\jlreq at tempa}{
- {tobira}{\def\jlreq at declaretype{RenewTobira}}
- {block}{\def\jlreq at declaretype{RenewBlock}}
- {runin}{\def\jlreq at declaretype{RenewRunin}}
- {cutin}{\def\jlreq at declaretype{RenewCutin}}
- {modify}{\def\jlreq at declaretype{Modify}}
- {\ClassError{jlreq}{Unknown heading type `####2'}{\@ehc}}
- }%
- }
- {heading_level}{\def\jlreq at level{####2}}
- {%
- \jlreq at ifempty{#1}{\@firstofone}{%
- \ifthenelse{\equal{####1}{restore}}{%
- \csname jlreq at tempa####2\endcsname\@gobble
- }{\@firstofone}%
- }%
- {\eappto\jlreq at headingsettings{\ifx\jlreq at headingsettings\@empty\else ,\fi\unexpanded{####1={####2}}}}%
- }%
- }%
- }%
- }{##2}%
- \jlreq at ifempty{#1}{}{%
- \ifjlreq at tempa
- \eappto\jlreq at headingscmds{\noexpand\SaveHeading{\unexpanded{##1}}{\expandonce{\csname #2@##1\endcsname}}}%
- \eappto\jlreq at restoreheadings{\ifx\jlreq at restoreheadings\@empty\else ,\fi\unexpanded{##1}}%
- \fi
- }%
- % \jlreq at declareに\ModifyHeadingか\Renew***Headingを入れる
- \edef\jlreq at declare{\expandonce{\csname\jlreq at declaretype Heading\endcsname}{##1}}%
- \ifthenelse{\NOT \equal{\jlreq at declaretype}{Modify}}{%
- \ifx\jlreq at level\@empty
- % \frontmatter時でのレベルを引用する.
- \edef\jlreq at declare{%
- \unexpanded{\edef\jlreq at tempa}{\noexpand\unexpanded{\expandonce{\jlreq at declare}}{\noexpand\expandonce{\expandonce{\csname jlreq at heading@level@##1\endcsname}}}}%
- \noexpand\jlreq at tempa
- }%
- \else
- \eappto\jlreq at declare{{\expandonce{\jlreq at level}}}%
- \fi
- }{}%
- \eappto\jlreq at headingscmds{\expandonce{\jlreq at declare}{\expandonce{\jlreq at headingsettings}}}%
- }{#4}%
- \edef\jlreq at do{%
- \unexpanded{\def#3}{%
- \expandonce{\jlreq at headingscmds}%
- \jlreq at ifempty{#1}{}{\unexpanded{\def#1}{\expandonce{\jlreq at restoreheadings}}}%
- }%
- }%
- \expandafter\endgroup
- \jlreq at do
-}
-
-\def\jlreq at matter@counter at norestore#1#2{%
- \def#1{}%
- \jlreq at parsekeyval@nokey{%
- \jlreq at parsekeyval*{
- {value}{\appto#1{\setcounter{##1}{####1}}}
- {the}{\eappto#1{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
- }{##2}%
- }{#2}%
-}
-
-\ifthenelse{\equal{\jlreq at article@type}{book}}{
- \newif\if at mainmatter
- \@mainmattertrue
- \jlreq at jlreqsetup@add{frontmatter_pagebreak}{%
- \edef\jlreq at frontmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
- }
- \jlreq at jlreqsetup@add{frontmatter_counter}{%
- \def\jlreq at frontmatter@counter{}%
- \def\jlreq at tempa{}% 復帰させるカウンタ名リスト
- \jlreq at parsekeyval@nokey{%
- \def\jlreq at tempb{}% 中身
- \jlreq at tempatrue % restore
- \jlreq at parsekeyval{
- {value}{\appto\jlreq at tempb{\setcounter{##1}{####1}}}
- {restore}{\csname jlreq at tempa####1\endcsname}
- {the}{\eappto\jlreq at tempb{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
- }{##2}%
- \ifjlreq at tempa
- \epreto\jlreq at tempb{%
- \noexpand\let\expandonce{\csname jlreq at frontmatter@savedcounter at the@##1\endcsname}\expandonce{\csname the##1\endcsname}%
- \noexpand\edef\expandonce{\csname jlreq at frontmatter@savedcounter at value@##1\endcsname}{\unexpanded{\the\value{##1}}}%
- }%
- \eappto\jlreq at tempa{\ifx\jlreq at tempa\@empty\else ,\fi\unexpanded{##1}}%
- \fi
- \eappto\jlreq at frontmatter@counter{\expandonce{\jlreq at tempb}}%
- }{#1}%
- \eappto\jlreq at frontmatter@counter{\unexpanded{\def\jlreq at frontmatter@restorecounters}{\expandonce{\jlreq at tempa}}}%
- }
- \jlreq at jlreqsetup@add{frontmatter_heading}{\jlreq at matter@heading[\jlreq at frontmatter@restoreheadings]{jlreq at frontmatter@savedheading}{\jlreq at frontmatter@heading}{#1}}
- \jlreq at jlreqsetup@add{frontmatter_pagestyle}{%
- \def\jlreq at tempa{}% ページスタイル名
- \def\jlreq at frontmatter@pagestyle{}%
- \jlreq at tempatrue % restore
- \jlreq at parsekeyval@nokey{%
- \ifjlreq at parsekeyval@nokey at novalue{\def\jlreq at tempa{##1}}{%
- \jlreq at switch{##1}{%
- {restore}{\csname jlreq at tempa##2\endcsname}%
- }%
- }%
- }{#1}%
- \ifjlreq at tempa
- \appto\jlreq at frontmatter@pagestyle{\let\jlreq at frontmatter@savedpagestyle\jlreq at current@pagestyle}%
- \fi
- \ifx\jlreq at tempa\@empty\else
- \eappto\jlreq at frontmatter@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq at tempa}}}%
- \fi
- }
- \jlreq at jlreqsetup@add{frontmatter_precode}{\edef\jlreq at frontmatter@precode{\unexpanded{#1}}}
- \jlreq at jlreqsetup@add{frontmatter_postcode}{\edef\jlreq at frontmatter@postcode{\unexpanded{#1}}}
- \jlreq at jlreqsetup@add{frontmatter_pagination}{%
- \def\jlreq at pagination@frontmatterstyle{arabic}%
- \let\jlreq at pagination@mainmatterpagecommand=\pagenumbering
- \@for\jlreq at tempa:=#1\do{%
- \expandafter\jlreq at helper@trim\expandafter{\jlreq at tempa}{\jlreq at tempa}%
- \jlreq at switch{\jlreq at tempa}{
- {continuous}{%
- \def\jlreq at pagination@mainmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c at page}}%
- }
- {independent}{\let\jlreq at pagination@mainmatterpagecommand=\pagenumbering}
- {\edef\jlreq at pagination@frontmatterstyle{\jlreq at tempa}}
- }%
- }%
- }
- \newcommand*{\frontmatter}{%
- \jlreq at frontmatter@precode
- \jlreq at frontmatter@pagebreak
- \@mainmatterfalse
- \let\jlreq at frontmatter@savedpagestyle\@undefined
- \jlreq at frontmatter@pagestyle
- \jlreq at frontmatter@counter
- \jlreq at frontmatter@heading
- \expandafter\gdef\expandafter\thepage\expandafter{\csname @\jlreq at pagination@frontmatterstyle\endcsname\c at page}%
- \jlreq at frontmatter@postcode
- }
- \def\jlreq at frontmatter@restorecounters{}
- \def\jlreq at frontmatter@restoreheadings{}
- \def\jlreq at frontmatter@restorecommands{}
- \jlreq at jlreqsetup@add{mainmatter_pagebreak}{%
- \edef\jlreq at mainmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
- }
- \jlreq at jlreqsetup@add{mainmatter_pagestyle}{%
- \edef\jlreq at mainmatter@pagestyle{\jlreq at ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
- }
- \jlreq at jlreqsetup@add{mainmatter_counter}{\jlreq at matter@counter at norestore{\jlreq at mainmatter@counter}{#1}}%
- \jlreq at jlreqsetup@add{mainmatter_heading}{\jlreq at matter@heading{\jlreq at mainmatter@heading}{#1}}%
- \jlreq at jlreqsetup@add{mainmatter_precode}{\edef\jlreq at mainmatter@precode{\unexpanded{#1}}}%
- \jlreq at jlreqsetup@add{mainmatter_postcode}{\edef\jlreq at mainmatter@postcode{\unexpanded{#1}}}%
- \jlreq at jlreqsetup@add{mainmatter_pagination}{%
- \def\jlreq at pagination@mainmatterstyle{#1}%
- }
- \newcommand*{\mainmatter}{%
- \jlreq at mainmatter@precode
- \jlreq at mainmatter@pagebreak
- \@mainmattertrue
- \@ifundefined{jlreq at frontmatter@savedpagestyle}{%
- \jlreq at mainmatter@pagestyle
- }{%
- \expandafter\pagestyle\expandafter{\jlreq at frontmatter@savedpagestyle}%
- }%
- \@for\jlreq at tempa:=\jlreq at frontmatter@restorecounters\do{%
- \setcounter{\jlreq at tempa}{\csname jlreq at frontmatter@savedcounter at value@\jlreq at tempa\endcsname}%
- \expandafter\let\csname the\jlreq at tempa\expandafter\endcsname\csname jlreq at frontmatter@savedcounter at the@\jlreq at tempa\endcsname
- }%
- \jlreq at mainmatter@counter
- \@for\jlreq at tempa:=\jlreq at frontmatter@restoreheadings\do{\csname jlreq at frontmatter@savedheading@\jlreq at tempa\endcsname}
- \jlreq at mainmatter@heading
- \@for\jlreq at tempa:=\jlreq at frontmatter@restorecommands\do{%
- \expandafter\let\csname \jlreq at tempa\expandafter\endcsname\csname jlreq at frontmatter@savedcommand@\jlreq at tempa\endcsname
- }%
- \expandafter\jlreq at pagination@mainmatterpagecommand\expandafter{\jlreq at pagination@mainmatterstyle}%
- \jlreq at mainmatter@postcode
- }
- \jlreq at jlreqsetup@add{backmatter_pagebreak}{%
- \edef\jlreq at backmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
- }
- \jlreq at jlreqsetup@add{backmatter_pagestyle}{%
- \edef\jlreq at backmatter@pagestyle{\jlreq at ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
- }
- \jlreq at jlreqsetup@add{backmatter_counter}{\jlreq at matter@counter at norestore{\jlreq at backmatter@counter}{#1}}%
- \jlreq at jlreqsetup@add{backmatter_heading}{\jlreq at matter@heading{\jlreq at backmatter@heading}{#1}}
- \jlreq at jlreqsetup@add{backmatter_precode}{\edef\jlreq at backmatter@precode{\unexpanded{#1}}}
- \jlreq at jlreqsetup@add{backmatter_postcode}{\edef\jlreq at backmatter@postcode{\unexpanded{#1}}}
- \jlreq at jlreqsetup@add{backmatter_pagination}{
- \let\jlreq at pagination@backmatterpagecommand=\pagenumbering
- \def\jlreq at pagination@backmatterstyle{arabic}%
- \@for\jlreq at tempa:=#1\do{%
- \expandafter\jlreq at helper@trim\expandafter{\jlreq at tempa}{\jlreq at tempa}%
- \jlreq at switch{\jlreq at tempa}{
- {continuous}{%
- \def\jlreq at pagination@backmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c at page}}%
- }
- {independent}{\let\jlreq at pagination@backmatterpagecommand=\pagenumbering}
- {\edef\jlreq at pagination@backmatterstyle{\jlreq at tempa}}
- }%
- }%
- }
- \newcommand*{\backmatter}{%
- \jlreq at backmatter@precode
- \jlreq at backmatter@pagebreak
- \jlreq at backmatter@pagestyle
- \@mainmatterfalse
- \jlreq at backmatter@counter
- \jlreq at backmatter@heading
- \expandafter\jlreq at pagination@backmatterpagecommand\expandafter{\jlreq at pagination@backmatterstyle}%
- \jlreq at backmatter@postcode
- }
-}{}
-
-\jlreq at jlreqsetup@add{appendix_counter}{\jlreq at matter@counter at norestore{\jlreq at appendix@counter}{#1}}
-\jlreq at jlreqsetup@add{appendix_heading}{\jlreq at matter@heading{\jlreq at appendix@heading}{#1}}
-\jlreq at jlreqsetup@add{appendix_precode}{\edef\jlreq at appendix@precode{\unexpanded{#1}}}
-\jlreq at jlreqsetup@add{appendix_postcode}{\edef\jlreq at appendix@postcode{\unexpanded{#1}}}
-\newcommand*{\appendix}{%
- \par
- \jlreq at appendix@precode
- \jlreq at appendix@counter
- \jlreq at appendix@heading
- \jlreq at appendix@postcode
-}
-
-%. その他諸々
-%.. 縦中横
-\edef\@tempa{%
- \unexpanded{%
- \jlreq at ifydir{\ClassError{jlreq}{\string\tatechuyoko\space is not allowed in yoko mode}{\@ehc}}{}%
- \ifvmode\leavevmode\fi
- }%
- \ifx l\jlreq at engine\unexpanded{%
- \jlreq at lastnodechar=\lastnodechar\relax
- \ifnum\jlreq at lastnodechar>-1 \inhibitglue\fi
- }\else\unexpanded{%
- \ifnum\lastnodechar>-1 \inhibitglue\fi
- \jlreq at lastnodechar=\lastnodechar\relax
- }\fi
-}
-
-\expandafter\protected\expandafter\def\expandafter\tatechuyoko\expandafter#\expandafter1\expandafter{%
- \@tempa
- % 前のJFM glue
- \ifnum\jlreq at lastnodechar>-1
- \jlreq at calc@jfmglue{\char\jlreq at lastnodechar}{阿}%
- \jlreq at ifgluezero\jlreq at resultskip{}{\hskip\jlreq at resultskip}%
- \fi
- \hbox{\yoko
- \setbox\jlreq at tempboxa=\hbox{阿}%
- \vrule width 0pt height \ht\jlreq at tempboxa depth \dp\jlreq at tempboxa #1}%
- \futurelet\jlreq at nextchar\jlreq at tatechuyoko@
-}
-\def\jlreq at tatechuyoko@{%
- \begingroup
- \def\jlreq at do{}%
- \jlreq at getfirsttoken@expandmacros{\jlreq at nextchar}{\jlreq at tempa}%
- \expandafter\jlreq at ifletter\expandafter{\jlreq at tempa}{%
- \jlreq at calc@jfmglue{阿}{\jlreq at tempa}%
- \edef\jlreq at do{%
- \noexpand\hskip\the\jlreq at resultskip\space
- \noexpand\inhibitglue
- }%
- }{}%
- \expandafter\endgroup
- \jlreq at do
-}
-
-% 日にち
-\newif\if西暦
-\def\西暦{\西暦true}
-\def\和暦{\西暦false}
-% #1年#2月#3日 #4は\numberとか\kansujiとか
-\def\jlreq at wareki#1#2#3#4{%
- \jlreq at warekiyear{#1}{#2}{#3}{#4}%
- #4#2月#4#3日%
-}
-\def\jlreq at warekiyear#1#2#3#4{%
- % 昭和:1989年1月7日まで
- \ifnum0\ifnum#1<1989 1\fi\ifnum#1=1989 \ifnum#2=1 \ifnum#3<8 1\fi\fi\fi>0
- 昭和\jlreq at warekiyear@{#1}{1926}{#4}%
- % 平成:2019年4月末日まで
- \else\ifnum0\ifnum#1<2019 1\fi\ifnum#1=2019 \ifnum#2<5 1\fi\fi>0
- 平成\jlreq at warekiyear@{#1}{1989}{#4}%
- \else
- 令和\jlreq at warekiyear@{#1}{2019}{#4}%
- \fi\fi
-}
-\def\jlreq at warekiyear@#1#2#3{\ifnum#1=#2 元年\else #3\numexpr#1-#2+1\relax 年\fi}
-\def\today{%
- \if西暦
- \jlreq at iftdir{%
- \kansuji\year 年%
- \kansuji\month 月%
- \kansuji\day 日%
- }{%
- \number\year 年%
- \number\month 月%
- \number\day 日%
- }%
- \else
- \jlreq at iftdir{%
- \jlreq at wareki{\year}{\month}{\day}{\kansuji}%
- }{%
- \jlreq at wareki{\year}{\month}{\day}{\number}%
- }%
- \fi
-}
-\jlreq at jlreqsetup@add{year_style}[seireki,wareki]{%
- \jlreq at switch{#1}{%
- {seireki}{\西暦true}
- {wareki}{\西暦false}
- }
-}
-
-% 時刻
-\hour=\time \divide\hour by 60
-\minute=\numexpr\time - 60*\hour\relax
-
-%.. 定理環境
-\jlreq at saveoriginalcs{\@begintheorem}
-\jlreq at saveoriginalcs{\@opargbegintheorem}
-\def\@begintheorem#1#2{\topsep=\dimexpr\jlreq at theorem@beforeafter at space\relax
- \trivlist\labelsep=1\zw
- \itemindent=\dimexpr\jlreq at theorem@indent\relax
- \item[\hskip \labelsep{\sffamily\bfseries #1\ #2}]}
-\def\@opargbegintheorem#1#2#3{\topsep=\dimexpr\jlreq at theorem@beforeafter at space\relax
- \trivlist\labelsep=1\zw
- \itemindent=\dimexpr\jlreq at theorem@indent\relax
- \item[\hskip \labelsep{\sffamily\bfseries #1\ #2(#3)}]}
-\AtEndOfPackageFile*{amsthm}{%
- \jlreq at saveoriginalcs{\proof}%
- \jlreq at saveoriginalcs{\endproof}%
- \edef\jlreq at do{
- \unexpanded{\def\jlreq at proof[#1]}{%
- \unexpanded{\labelsep=1\zw}%
- \expandonce{\proof[{\reset at font\sffamily\bfseries #1\inhibitglue}\nopunct]}%
- }
- }
- \jlreq at do
- \def\proof{\@ifnextchar[{\jlreq at proof}{\jlreq at proof[\proofname]}}
- \renewcommand{\proofname}{証明}
- \jlreq at setupamsthm
- \theoremstyle{jlreq}
-}
-\def\jlreq at setupamsthm{
- \newtheoremstyle{jlreq}{\dimexpr\jlreq at theorem@beforeafter at space\relax}{\dimexpr\jlreq at theorem@beforeafter at space\relax}{\normalfont}{\dimexpr\jlreq at theorem@indent\relax}{\sffamily\bfseries}{}{1\zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{(##3)}}
-}
-\jlreq at jlreqsetup@add{theorem_beforeafter_space}{
- \def\jlreq at theorem@beforeafter at space{#1}
- \@ifpackageloaded{amsthm}{\jlreq at setupamsthm}{}
-}
-\jlreq at jlreqsetup@add{theorem_indent}{
- \def\jlreq at theorem@indent{#1}
- \@ifpackageloaded{amsthm}{\jlreq at setupamsthm}{}
-}
-
-
-%. デフォルト設定
-%.. 見出し
-\if at tate
- \renewcommand{\thepart}{\jlreq at Kanji{part}}
- \ifthenelse{\equal{\jlreq at article@type}{article}}{}{\renewcommand{\thechapter}{\jlreq at Kanji{chapter}}}
- \renewcommand{\thesection}{\jlreq at rensuji{\@arabic\c at section}}
- \renewcommand{\thesubsection}{\jlreq at rensuji{\@alph\c at subsection}}
- \renewcommand{\thesubsubsection}{\jlreq at rensuji{\@arabic\c at subsubsection}}
- \renewcommand{\theparagraph}{(\jlreq at rensuji{\@arabic\c at paragraph})}
- \renewcommand{\thesubparagraph}{(\jlreq at rensuji{\@arabic\c at subparagraph})}
-
- \ifthenelse{\equal{\jlreq at article@type}{article}}{
- \NewBlockHeading{part}{0}{font={\jlreq at keepbaselineskip{\LARGE}},indent=4\zw,lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\large}}}
- \if at 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 at 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 at keepbaselineskip{\Large}}}
- \if at twoside\ModifyHeading{chapter}{allowbreak_if_evenpage=true}\fi
- \renewcommand{\thechapter}{\jlreq at Kanji{chapter}}
- }
- \NewBlockHeading{section}{1}{font={\jlreq at keepbaselineskip{\Large}},indent=6\zw,lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\normalsize}}}
- \if at twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi
- \NewBlockHeading{subsection}{2}{font={\jlreq at keepbaselineskip{\large}},indent=8\zw,lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\small}}}
- \if at twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi
- \NewBlockHeading{subsubsection}{3}{font={\jlreq at 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 at keepbaselineskip{\scriptsize}}}
- \if at twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi
- \NewRuninHeading{paragraph}{4}{font={\jlreq at keepbaselineskip{\normalsize}}}
- \NewRuninHeading{subparagraph}{5}{font={\jlreq at 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 at article@type}{article}}{
- \NewBlockHeading{part}{0}{font={\jlreq at 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 at keepbaselineskip{\large}}}
- \renewcommand{\thesection}{\arabic{section}}
- }
- {% book, report
- \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq at gol}},format={\null\vfil {\Huge\sffamily\bfseries #1#2}\vfil}}
- \NewBlockHeading{chapter}{0}{%
- font={\jlreq at 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 at keepbaselineskip{\Large}}}
- \renewcommand{\thechapter}{\arabic{chapter}}
- \renewcommand{\thesection}{\thechapter.\arabic{section}}
- }
- \NewBlockHeading{section}{1}{font={\jlreq at keepbaselineskip{\Large\sffamily\bfseries}},lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\normalsize}}}
- \NewBlockHeading{subsection}{2}{font={\jlreq at keepbaselineskip{\large\sffamily\bfseries}},lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\small}}}
- \NewBlockHeading{subsubsection}{3}{font={\jlreq at 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 at keepbaselineskip{\scriptsize}}}
- \NewRuninHeading{paragraph}{4}{font={\jlreq at keepbaselineskip{\normalsize\sffamily\bfseries}},indent=1\zw}
- \NewRuninHeading{subparagraph}{5}{font={\jlreq at keepbaselineskip{\normalsize\sffamily\bfseries}},indent=2\zw}
-\fi
-
-\ifthenelse{\equal{\jlreq at article@type}{article}}{}{% book, report
- \if at openright
- \ModifyHeading{part}{type=naka}
- \if at 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
-}
-
-%.. ページスタイル
-\RenewPageStyle{empty}{nombre={},odd_running_head={},even_running_head={}}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{
- \if at 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 at 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 at 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 at 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}
-
-%.. 注
-\jlreqsetup{reference_mark=inline}
-\if at tate
- \jlreqsetup{footnote_indent=1\zw}% 根拠なし
-\else
- \jlreqsetup{footnote_indent=0pt}% (4.2.5.b)
-\fi
-\jlreqsetup{footnote_second_indent=1\zw}
-\jlreqsetup{endnote_second_indent=2\zw}
-\jlreqsetup{endnote_position=headings}
-\ifdim\marginparwidth>0pt
- \jlreqsetup{sidenote_type=number}
- \jlreqsetup{sidenote_symbol=*,sidenote_keyword_font={}}
-\fi
-
-%.. キャプション
-\jlreqsetup{
- caption_font={\sffamily\bfseries},
- caption_label_font={\sffamily\bfseries},
- caption_after_label_space=1\zw,
- caption_label_format={#1},
- caption_align=center
-}
-
-%.. 箇条書き
-\if at tate
- \renewcommand{\theenumi}{\jlreq at Kanji{enumi}}
- \renewcommand{\theenumii}{\jlreq at rensuji{\@arabic\c at enumii}}
- \renewcommand{\theenumiii}{\jlreq at rensuji{\@arabic\c at enumiii}}
- \renewcommand{\theenumiv}{\jlreq at rensuji{\@arabic\c at enumiv}}
- \newcommand{\labelenumi}{\theenumi}
- \newcommand{\labelenumii}{\theenumii}
- \newcommand{\labelenumiii}{\theenumiii}
- \newcommand{\labelenumiv}{\theenumiv}
-\else
- \renewcommand{\theenumi}{\@arabic\c at enumi}
- \renewcommand{\theenumii}{\@alph\c at enumii}
- \renewcommand{\theenumiii}{\@roman\c at enumiii}
- \renewcommand{\theenumiv}{\@Alph\c at enumiv}
- \newcommand{\labelenumi}{\theenumi.\hspace{.5\zw}}
- \newcommand{\labelenumii}{(\theenumii)\hspace{.5\zw}}
- \newcommand{\labelenumiii}{\theenumiii.\hspace{.5\zw}}
- \newcommand{\labelenumiv}{\theenumiv.\hspace{.5\zw}}
-\fi
-\renewcommand{\p at enumii}{\theenumi}
-\renewcommand{\p at enumiii}{\theenumi(\theenumii)}
-\renewcommand{\p at enumiv}{\p at enumiii\theenumiii}
-
-\newcommand{\labelitemi}{\hbox to 1\zw{\hss\textbullet\hss}}
-%\newcommand{\labelitemi}{•}
-\if at 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}}
-
-% 見出しが一つ上のレベルからどのくらいずれているかを入れる.
-\setlength\leftmargini{2\zw}
-\setlength\leftmarginii{2\zw}
-\setlength\leftmarginiii{1\zw}
-\setlength\leftmarginiv{1\zw}
-\setlength\leftmarginv{1\zw}
-\setlength\leftmarginvi{1\zw}
-\jlreqsetup{
- itemization_beforeafter_space={0pt,i=.5\baselineskip},
- itemization_itemsep=0pt,
- itemization_labelsep={0pt},
- itemization_label_length={1\zw,i=2\zw,ii=2\zw}
-}
-
-%.. 引用
-\jlreqsetup{
- quote_indent=2\zw,
- quote_end_indent=0pt,
- quote_fontsize=,
- quote_beforeafter_space=0pt
-}
-
-%.. その他
-\ifthenelse{\equal{\jlreq at article@type}{book}}{
- \jlreqsetup{
- frontmatter_pagebreak = cleardoublepage,
- frontmatter_pagestyle = {plain,restore = true},
- frontmatter_heading = {chapter={number=false, restore = true}},
- frontmatter_counter = {
- figure = {the = \arabic{figure},restore = true},
- table = {the = \arabic{table},restore = true},
- },
- frontmatter_precode = {},
- frontmatter_postcode = {},
- }
- \jlreqsetup{
- mainmatter_pagebreak = cleardoublepage,
- mainmatter_counter = {
- chapter = {value = 0},
- },
- mainmatter_pagestyle = {},
- mainmatter_heading = {},
- mainmatter_precode = {},
- mainmatter_postcode = {},
- }
- \if at openright
- \jlreqsetup{backmatter_pagebreak=cleardoublepage}
- \else
- \jlreqsetup{backmatter_pagebreak=clearpage}
- \fi
- \jlreqsetup{
- backmatter_pagestyle = plain,
- backmatter_counter = {
- chapter={value = 0, the = {}},
- figure = {value = 0, the = {\arabic{figure}}},
- table = {value = 0, the = {\arabic{table}}}
- },
- backmatter_heading = {chapter = {number = false}},
- backmatter_precode = {},
- backmatter_postcode = {}
- }
- \jlreqsetup{
- frontmatter_pagination = {independent,roman},
- mainmatter_pagination = {arabic},
- backmatter_pagination = {continuous,arabic},
- }
-}{}
-\ifthenelse{\equal{\jlreq at article@type}{article}}{
- \if at tate
- \jlreqsetup{
- appendix_counter = {
- section = {value = 0, the = {\jlreq at rensuji{\Alph{section}}}},
- subsection = {value = 0},
- }
- }
- \else
- \jlreqsetup{
- appendix_counter = {
- section = {value = 0, the = {\Alph{chapter}}},
- subsection = {value = 0},
- }
- }
- \fi
- \jlreqsetup{appendix_heading = {},appendix_precode = {},appendix_postcode = {}}
-}{%book, report
- \if at tate
- \jlreqsetup{
- appendix_counter = {
- chapter = {value = 0, the = {\jlreq at rensuji{\Alph{chapter}}}},
- }
- }
- \else
- \jlreqsetup{
- appendix_counter = {
- chapter = {value = 0, the = {\Alph{chapter}}},
- }
- }
- \fi
- \jlreqsetup{
- appendix_heading = {
- chapter = {label_format = {付録\thechapter}}
- },
- appendix_postcode = {%
- \ifthenelse{\equal{\jlreq at current@pagestyle}{headings}}{%
- \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
- \ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
- }{}%
- },
- appendix_precode = {}
- }
-}
-\jlreqsetup{theindex_pagestyle=plain}
-\jlreqsetup{year_style=seireki}
-\jlreqsetup{theorem_beforeafter_space=1\baselineskip,theorem_indent=0pt}
-
-
-\newcommand{\contentsname}{目次}
-\newcommand{\refname}{参考文献}
-\newcommand{\indexname}{索引}
-\newcommand{\listfigurename}{図目次}
-\newcommand{\figurename}{図}
-\newcommand{\listtablename}{表目次}
-\newcommand{\tablename}{表}
-\pagestyle{plain}
-\pagenumbering{arabic}
-
-%. 最終処理
-\if at 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}[2019/09/24 jlreq]
+\RequirePackage{xkeyval,everyhook,filehook,etoolbox,ifthen}
+\RequirePackage{jlreq-helpers}
+
+\newcommand*{\jlreq at undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}}
+% クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする
+\newcommand*{\jlreq at aftercls@addtodeletecs}[1]{%
+ \appto\jlreq at aftercls@deletecslist{\jlreq at helper@undefcs{#1}{\jlreq at undeferr}}%
+}
+\newcommand*{\jlreq at aftercls@addtodeleteif}[1]{%
+ \appto\jlreq at aftercls@deletecslist{\jlreq at helper@undefif{#1}{\jlreq at undeferr}}%
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeletecs}
+\jlreq at aftercls@addtodeletecs{\jlreq at aftercls@addtodeleteif}
+\AtEndOfClass{%
+ \jlreq at aftercls@deletecslist
+ \jlreq at helper@undefcs{\jlreq at aftercls@deletecslist}{\jlreq at undeferr}%
+ \undef{\jlreq at undeferr}%
+}
+
+% preambleにいるかのスイッチ
+\newif\ifjlreq at preamble
+\jlreq at preambletrue
+\AtBeginDocument{\jlreq at preamblefalse}
+
+\def\jlreq at saveoriginalcs#1{%
+ \ifx#1\relax
+ \ClassError{jlreq}{Trying to save \string#1 but it's not defined, may be a bug}{\@ehc}%
+ \fi
+ \expandafter\ifx\csname jlreq at 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 at original@\expandafter\@gobble\string#1\endcsname=#1
+}
+\def\jlreq at useoriginalcs#1{%
+ \jlreq at if{\ifcsname jlreq at original@\expandafter\@gobble\string#1\endcsname\fi}%
+ {\csname jlreq at original@\expandafter\@gobble\string#1\endcsname}%
+ {#1}%
+}
+
+%. オプションの定義
+% オプション処理の際にしか使わない変数(後でそれを元に別の変数を調整する)
+% ものは\jlreq at option@<key>に格納する.
+% _とかは@に変換する.
+% 引数無しの\DeclareOptionX
+\newcommand*{\jlreq at DeclareOption}[2]{%
+ \DeclareOptionX{#1}{%
+ \jlreq at ifempty{##1}{}{\ClassError{jlreq}{The option #1 should have no value}{\@ehc}}%
+ #2%
+ }
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at DeclareOption}
+% エンジン類
+\jlreq at DeclareOption{uplatex}{\let\jlreq at engine=u}
+\jlreq at DeclareOption{platex}{\let\jlreq at engine=p}
+\jlreq at DeclareOption{lualatex}{\let\jlreq at engine=l}
+
+% 文書のタイプ
+\newcommand*\jlreq at article@type{article}
+\define at choicekey{jlreq.cls}{article_type}{article,report,book}{\renewcommand*{\jlreq at article@type}{#1}}
+\jlreq at DeclareOption{article}{\renewcommand*{\jlreq at article@type}{article}}
+\jlreq at DeclareOption{report}{\renewcommand*{\jlreq at article@type}{report}}
+\jlreq at DeclareOption{book}{\renewcommand*{\jlreq at article@type}{book}}
+
+%.. 基本版面.まずは紙サイズ.
+\def\jlreq at switchpapersize{}
+\jlreq at aftercls@addtodeletecs{\jlreq at switchpapersize}
+% \jlreq at addpapersize{paper=に指定するもの}{単独オプション名}{横}{縦}
+
+\def\jlreq at addpapersize#1#2{%
+ \@ifnextchar[{\jlreq at addpapersize@{#1}{#2}}{\jlreq at addpapersize@@{#1}{#2}}%
+}
+\def\jlreq at addpapersize@#1#2[#3]{%
+ \edef\@tempa{\unexpanded{\jlreq at addpapersize@@{#1}{#2}}\csexpandonce{jlreq at helper@papersizelist@#3}}%
+ \@tempa
+}
+\newcommand*{\jlreq at addpapersize@@}[4]{%
+ \@for\@tempa:=#1\do{%
+ \eappto\jlreq at switchpapersize{{\expandonce{\@tempa}}{\unexpanded{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}}}%
+ }%
+ \@for\@tempa:=#2\do{%
+ \expandafter\jlreq at DeclareOption\expandafter{\@tempa}{\setlength{\paperwidth}{#3}\setlength{\paperheight}{#4}}%
+ }%
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize}
+\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize@}
+\jlreq at aftercls@addtodeletecs{\jlreq at addpapersize@@}
+\DeclareOptionX{paper}{
+ \edef\jlreq at do{%
+ \unexpanded{\jlreq at switch{#1}}{\expandonce{\jlreq at switchpapersize}}%
+ [\unexpanded{%
+ \jlreq at helper@dividebycomma{#1}%
+ \ifjlreq at result
+ \setlength{\paperwidth}{\dimexpr\jlreq at resulta\relax}%
+ \setlength{\paperheight}{\dimexpr\jlreq at resultb\relax}%
+ \else
+ \ClassError{jlreq}{The paper #1 is unknown}{\@ehc}%
+ \fi
+ }]%
+ }%
+ \jlreq at do
+}
+% 紙サイズ一覧.b*はJIS B.
+\jlreq at addpapersize{a0,A0}{}[a0]
+\jlreq at addpapersize{a1,A1}{}[a1]
+\jlreq at addpapersize{a2,A2}{}[a2]
+\jlreq at addpapersize{a3,A3}{a3paper}[a3]
+\jlreq at addpapersize{a4,A4}{a4paper}[a4]
+\jlreq at addpapersize{a5,A5}{a5paper}[a5]
+\jlreq at addpapersize{a6,A6}{a6paper}[a6]
+\jlreq at addpapersize{a7,A7}{}[a7]
+\jlreq at addpapersize{a8,A8}{}[a8]
+\jlreq at addpapersize{a9,A9}{}[a9]
+\jlreq at addpapersize{a10,A10}{}[a10]
+
+\jlreq at addpapersize{b0,B0}{}[b0]
+\jlreq at addpapersize{b1,B1}{}[b1]
+\jlreq at addpapersize{b2,B2}{}[b2]
+\jlreq at addpapersize{b3,B3}{}[b3]
+\jlreq at addpapersize{b4,B4}{b4paper}[b4]
+\jlreq at addpapersize{b5,B5}{b5paper}[b5]
+\jlreq at addpapersize{b6,B6}{b6paper}[b6]
+\jlreq at addpapersize{b7,B7}{}[b7]
+\jlreq at addpapersize{b8,B8}{}[b8]
+\jlreq at addpapersize{b9,B9}{}[b9]
+\jlreq at addpapersize{b10,B10}{}[b10]
+
+\jlreq at addpapersize{c2,C2}{}[c2]
+\jlreq at addpapersize{c3,C3}{}[c3]
+\jlreq at addpapersize{c4,C4}{}[c4]
+\jlreq at addpapersize{c5,C5}{}[c5]
+\jlreq at addpapersize{c6,C6}{}[c6]
+\jlreq at addpapersize{c7,C7}{}[c7]
+\jlreq at addpapersize{c8,C8}{}[c8]
+
+\jlreq at addpapersize{a4var}{}[a4var]
+\jlreq at addpapersize{b5var}{}[b5var]
+
+\jlreq at addpapersize{letter}{letterpaper}[letter]
+\jlreq at addpapersize{legal}{legalpaper}[legal]
+\jlreq at addpapersize{executive}{executivepaper}[executive]
+\jlreq at addpapersize{hagaki}{}[hagaki]
+
+
+%.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a)
+\newcommand*{\jlreq at option@fontsize}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@fontsize}
+\DeclareOptionX{fontsize}{\renewcommand*{\jlreq at option@fontsize}{#1}}
+\jlreq at DeclareOption{10pt}{\renewcommand*{\jlreq at option@fontsize}{10pt}}
+\jlreq at DeclareOption{11pt}{\renewcommand*{\jlreq at option@fontsize}{11pt}}
+\jlreq at DeclareOption{12pt}{\renewcommand*{\jlreq at option@fontsize}{12pt}}
+\newcommand*{\jlreq at option@jafontsize}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@jafontsize}
+\DeclareOptionX{jafontsize}{\renewcommand*{\jlreq at option@jafontsize}{#1}}
+\newcommand*{\jlreq at option@jafontscale}{1}
+\DeclareOptionX{jafontscale}{\renewcommand*{\jlreq at option@jafontscale}{#1}}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@jafontscale}
+%.. 行の長さ
+\newcommand*{\jlreq at option@line at length}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@line at length}
+\DeclareOptionX{line_length}{\renewcommand*{\jlreq at option@line at length}{#1}}
+%.. 1ページあたりの行数
+\newcommand*{\jlreq at option@number at of@lines}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@number at of@lines}
+\DeclareOptionX{number_of_lines}{\renewcommand*{\jlreq at option@number at of@lines}{#1}}
+
+% 地の空き量,のどの空き量で配置位置を決める(2.4.1.b)省略されたら中央配置.
+%.. 天
+\newcommand*{\jlreq at option@head at space}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@head at space}
+\DeclareOptionX{head_space}{\renewcommand*{\jlreq at option@head at space}{#1}}
+
+%.. 地
+\newcommand*{\jlreq at option@foot at space}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@foot at space}
+\DeclareOptionX{foot_space}{\renewcommand*{\jlreq at option@foot at space}{#1}}
+%.. のど
+\newcommand*{\jlreq at option@gutter}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@gutter}
+\DeclareOptionX{gutter}{\renewcommand*{\jlreq at option@gutter}{#1}}
+%.. 小口
+\newcommand*{\jlreq at option@fore at edge}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@fore at edge}
+\DeclareOptionX{fore_edge}{\renewcommand*{\jlreq at option@fore at edge}{#1}}% 昔にこっちにしていたので残している
+\DeclareOptionX{fore-edge}{\renewcommand*{\jlreq at option@fore at edge}{#1}}
+
+%.. 柱とノンブル
+\newcommand*{\jlreq at option@headfoot at verticalpos}{}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@headfoot at verticalpos}
+% 本文とヘッダ/フッタの間の空き
+\DeclareOptionX{headfoot_verticalposition}{\renewcommand*{\jlreq at option@headfoot at verticalpos}{#1}}
+% 柱やノンブルの左右の空き
+\newcommand*{\jlreq at headfoot@sidemargin}{0pt}
+\DeclareOptionX{headfoot_sidemargin}{\renewcommand*{\jlreq at headfoot@sidemargin}{#1}}
+
+%.. 段間
+\newcommand*{\jlreq at option@column at gap}{2zw}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@column at gap}
+\DeclareOptionX{column_gap}{\renewcommand*{\jlreq at option@column at gap}{#1}}
+
+%.. 行送り,指定無しの場合は文字サイズの1.7倍とする.(1.5から2倍が好ましい:2.4.2.d 注3)
+\newcommand*{\jlreq at option@baselineskip}{17zw/10}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@baselineskip}
+\DeclareOptionX{baselineskip}{\def\jlreq at option@baselineskip{#1}}
+\DeclareOptionX{linegap}{\def\jlreq at option@baselineskip{1zw + #1}}
+
+%.. 組み方系
+% 行頭に括弧が来たときの配置:3.1.5
+% 段落頭指定_折り返し行頭指定 で与える.
+\newcommand*{\jlreq at open@bracket at pos}{zenkaku_tentsuki}
+\define at choicekey{jlreq.cls}{open_bracket_pos}{zenkaku_tentsuki,zenkakunibu_nibu,nibu_tentsuki}{\renewcommand*{\jlreq at open@bracket at pos}{#1}}
+% ぶら下げ組みをするか:3.8.2 注1
+\newif\ifjlreq at burasage\jlreq at burasagefalse
+\jlreq at DeclareOption{hanging_punctuation}{\jlreq at burasagetrue}
+
+%.. 注
+% 傍注のタイプ
+\newcommand*{\jlreq at option@sidenote at length}{0pt}
+\jlreq at aftercls@addtodeletecs{\jlreq at option@sidenote at length}
+\DeclareOptionX{sidenote_length}{\renewcommand*{\jlreq at option@sidenote at length}{#1}}
+
+%.. 逆ノンブル
+\newif\ifjlreq at option@use at reverse@pagination
+\jlreq at aftercls@addtodeleteif{\ifjlreq at option@use at reverse@pagination}
+\jlreq at option@use at reverse@paginationfalse
+\jlreq at DeclareOption{use_reverse_pagination}{\jlreq at option@use at reverse@paginationtrue}
+
+%.. もろもろ
+\newif\if at restonecol\@restonecolfalse
+\newif\if at titlepage\@titlepagefalse
+\newif\if at landscape\@landscapefalse
+\newif\if at tate \@tatefalse
+\newif\ifjlreq at option@titlepage \jlreq at option@titlepagefalse % titlepageかnotitlepageかが指定された
+\jlreq at aftercls@addtodeleteif{\ifjlreq at option@titlepage}
+\jlreq at DeclareOption{landscape}{\@landscapetrue}
+\jlreq at DeclareOption{tombo}{\ClassWarningNoLine{jlreq}{The option `tombo' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq at DeclareOption{tombow}{\ClassWarningNoLine{jlreq}{The option `tombow' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq at DeclareOption{mentuke}{\ClassWarningNoLine{jlreq}{The option `mentuke' is not supported by jlreq class. Please use the jlreq-trimmarks package}}
+\jlreq at DeclareOption{tate}{\@tatetrue}
+
+\newif\ifjlreq at option@twoside\jlreq at option@twosidefalse % onesideかtwosideが指定された
+\jlreq at aftercls@addtodeleteif{\ifjlreq at option@twoside}
+\jlreq at DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse\jlreq at option@twosidetrue}
+\jlreq at DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue\jlreq at option@twosidetrue}
+\jlreq at DeclareOption{onecolumn}{\@twocolumnfalse}
+\jlreq at DeclareOption{twocolumn}{\@twocolumntrue}
+\jlreq at DeclareOption{titlepage}{\jlreq at option@titlepagetrue\@titlepagetrue}
+\jlreq at DeclareOption{notitlepage}{\jlreq at option@titlepagetrue\@titlepagefalse}
+\jlreq at DeclareOption{draft}{\setlength\overfullrule{5pt}}
+\jlreq at DeclareOption{final}{\setlength\overfullrule{0pt}}
+\newif\if at openright
+\newif\ifjlreq at option@open \jlreq at option@openfalse % openrightかopenanyが指定された
+\jlreq at aftercls@addtodeleteif{\ifjlreq at option@open}
+\jlreq at DeclareOption{openright}{\@openrighttrue\jlreq at option@opentrue}
+\jlreq at DeclareOption{openany}{\@openrightfalse\jlreq at option@opentrue}
+\jlreq at DeclareOption{leqno}{\input{leqno.clo}}
+\jlreq at DeclareOption{fleqn}{\input{fleqn.clo}}
+\newif\ifjlreq at option@enablejfam \jlreq at option@enablejfamtrue
+\jlreq at aftercls@addtodeleteif{\ifjlreq at option@enablejfam}
+\jlreq at DeclareOption{disablejfam}{\jlreq at option@enablejfamfalse}
+
+\newcommand*{\jlreq at note}[1]{}
+\jlreq at DeclareOption{jlreq_notes}{\renewcommand*{\jlreq at note}[1]{\message{^^JJLReq note: ##1^^J}}}
+
+\ExecuteOptionsX{article_type=article,paper=a4,open_bracket_pos=zenkaku_tentsuki,onecolumn,final}
+% \@removeelementを一旦置き換えてから\ProcessOptionsXを実行する
+\let\jlreq at temporary@original@@removeelement=\@removeelement
+\let\@removeelement=\jlreq at helper@removeelement
+\ProcessOptionsX\relax
+\let\@removeelement=\jlreq at temporary@original@@removeelement
+\let\jlreq at temporary@original@@removeelement=\@undefined
+
+\ifjlreq at option@titlepage\else
+ \ifthenelse{\equal{\jlreq at article@type}{article}}{\@titlepagefalse}{\@titlepagetrue}
+\fi
+\ifjlreq at option@open\else
+ \ifthenelse{\equal{\jlreq at article@type}{book}}{\@openrighttrue}{\@openrightfalse}
+\fi
+% articleではopenrightは効かない.
+\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+ \if at openright
+ \ClassWarningNoLine{jlreq}{The option `openright' is ignored in article}
+ \@openrightfalse
+ \fi
+}{}
+\ifjlreq at option@twoside\else
+ \ifthenelse{\equal{\jlreq at article@type}{book}}{\@twosidetrue}{\@twosidefalse}
+\fi
+
+\def\jlreq at jlreqsetup@keyvallist{}
+\def\jlreq at jlreqsetup@finally{}
+\newcommand{\jlreqsetup}[1]{%
+ \begingroup
+ \edef\jlreq at do{\unexpanded{\jlreq at parsekeyval[jlreqsetup]}{\expandonce{\jlreq at jlreqsetup@keyvallist}}}%
+ \expandafter\endgroup
+ \jlreq at do{#1}%
+ \jlreq at jlreqsetup@finally
+}
+% \jlreqsetupの項目に加えるマクロ.\jlreq at jlreqsetup@add{key}{action}とするとkeyに対して定義できる.
+% action内ではvalが#1として取得できる.(従ってaction内でマクロを定義する際には##1を使う必要がある.)
+\newcommand{\jlreq at jlreqsetup@add}[1]{%
+ \@ifnextchar[{\jlreq at jlreqsetup@add@{#1}}{\jlreq at jlreqsetup@add@@{#1}}%
+}
+\long\def\jlreq at jlreqsetup@add@#1[#2]#3{%
+ \eappto\jlreq at jlreqsetup@keyvallist{\unexpanded{{#1}[#2]{#3}}}%
+}
+\long\def\jlreq at jlreqsetup@add@@#1#2{%
+ \eappto\jlreq at jlreqsetup@keyvallist{\unexpanded{{#1}{#2}}}%
+}
+% \jlreqsetupの最後に必ず実行される処理を入れる.
+\newcommand\jlreq at jlreqsetup@addtofinally[1]{\eappto\jlreq at jlreqsetup@finally{\unexpanded{#1}}}
+\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@add}
+\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@add@}
+\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@add@@}
+\jlreq at aftercls@addtodeletecs{\jlreq at jlreqsetup@addtofinally}
+\@onlypreamble\jlreqsetup
+
+% エンジンの設定
+\ifx\jlreq at engine\@undefined
+ \jlreq at helper@guessengine
+ \let\jlreq at engine=\jlreq at result
+\fi
+
+
+% 必要パッケージのロード
+\ifx l\jlreq at engine
+ \ifjlreq at option@enablejfam
+ \RequirePackage{luatexja}
+ \else
+ \RequirePackage[disablejfam]{luatexja}
+ \fi
+ \RequirePackage{luatexja-adjust}
+ \ltjenableadjust[lineend=extended,priority=true]
+ \ltjsetparameter{stretch_priority={kanjiskip=0,xkanjiskip=10}}
+ \ltjsetparameter{shrink_priority={kanjiskip=0,xkanjiskip=-30}}
+ \directlua{jlreq = {}}
+\fi
+
+% (u)pLaTeXの場合ここで初めて\epTeXinputencodingが発行されるので,
+% これ以前には和文は使えない.
+\ifx l\jlreq at 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 at tate\AtEndPreamble{\par}\fi
+\fi
+\if at tate
+ \AtBeginDocument{\tate\message{《縦組モード》}\adjustbaseline}
+\fi
+
+% \jlreq at gol(Gyo Okuri Length), \jlreq at mol (Moji Okuri Length)を定義
+\let\jlreq at gol=\zh
+\let\jlreq at mol=\zw
+
+%. helper2(エンジン依存系:和文文字を含むものもこれ以降)
+% #1のboxを今の真ん中に配置する.
+\def\jlreq at box@putcenter#1{%
+ \begingroup
+ \jlreq at tempdima=\dimexpr(\ht#1 - \dp#1)/2\relax
+ \setbox\jlreq at tempboxa=\hbox{阿}%
+ \edef\jlreq at do{%
+ \noexpand\lower\the\dimexpr(\jlreq at tempdima - (\ht\jlreq at tempboxa - \dp\jlreq at tempboxa)/2)\relax\unexpanded{\box#1}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+% #1の先頭が文字か
+\long\def\jlreq at ifletter#1{%
+ \jlreq at iffirsttoken{#1}{ }{\@secondoftwo}{%
+ \expandafter\expandafter\expandafter\jlreq at helper@ifletter\jlreq at getfirsttoken#1\jlreq at uniqtoken{}\jlreq at endmark@
+ }%
+}
+
+\long\def\jlreq at helper@ifletter#1{%
+ \jlreq at if{%
+ \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
+ \fi}%
+}
+
+
+% 組方向を判定
+% \jlreq at if(y|t)(dir|box)を定義する.
+\jlreq at if{\ifx l\jlreq at engine\fi}{
+ \def\jlreq at ifydir{\jlreq at if{\ifnum\ltjgetparameter{direction}=4 \fi}}
+ \def\jlreq at iftdir{\jlreq at if{\ifnum\numexpr\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8\relax=3 \fi}}
+ \def\jlreq at ifybox#1{\jlreq at if{\ifnum\ltjgetparameter{boxdir}{#1}=4 \fi}}
+ \def\jlreq at iftbox#1{\jlreq at if{\ifnum\numexpr\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8\relax=3 \fi}}
+}{
+ \def\jlreq at ifydir{\jlreq at if{\ifydir\fi}}
+ \def\jlreq at iftdir{\jlreq at if{\iftdir\fi}}
+ \def\jlreq at ifybox#1{\jlreq at if{\ifybox#1\fi}}
+ \def\jlreq at iftbox#1{\jlreq at if{\iftbox#1\fi}}
+}
+
+% 左ページであるか
+% #1 : odd or even or ページ数
+\def\jlreq at 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 at engine
+ \newcommand*{\jlreq at getpostbreakpenalty}[1]{\ltjgetparameter{postbreakpenalty}{#1}}
+\else
+ \newcommand*{\jlreq at getpostbreakpenalty}[1]{\postbreakpenalty#1}
+\fi
+
+% 現在行の残りを得る.
+\ifx l\jlreq at engine
+ % 以下のコードはLuaTeX-jaのバグ?に依存している
+ % https://ja.osdn.net/projects/luatex-ja/ticket/36489
+ \newcommand*{\jlreq at calc@current at linewidth@onecolumn}{%
+ \dimexpr
+ \jlreq at reference@ref{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{0} sp - \@totalleftmargin -
+ \ifodd\jlreq at currentpage
+ \oddsidemargin
+ \else
+ \evensidemargin
+ \fi
+ \iftombow -1in \fi
+ - \pdfvariable horigin - \hoffset
+ \relax
+ }
+\else
+ % トンボ出力時にはjlreq-trimmarksであることを仮定する.
+ % 新しいpLaTeXに対しては,jlreq-trimmarksは内部の1inを1trueinに書き換える
+ \@ifundefined{@tombowreset@@paper}{
+ \def\jlreq at tombow@adjust{\iftombow -1in \fi}
+ }{
+ \def\jlreq at tombow@adjust{\iftombow -1truein \fi}
+ }
+ \newcommand*{\jlreq at calc@current at linewidth@onecolumn}{%
+ \dimexpr
+ \jlreq at ifydir{%
+ \jlreq at reference@ref{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{0} sp - \hoffset
+ \ifodd\jlreq at currentpage
+ - \oddsidemargin
+ \else
+ - \evensidemargin
+ \fi
+ }{%
+ \ifdim\pdfpagewidth=0pt
+ \paperheight
+ \else
+ \pdfpageheight
+ \fi
+ - \topmargin - \headheight - \headsep - \voffset
+ - \jlreq at reference@ref{jlreq at rest@width.pos.Y.\the\jlreq at reference@count}{0} sp
+ }%
+ \jlreq at tombow@adjust
+ - \@totalleftmargin - 1in
+ \relax
+ }
+\fi
+\newcommand*{\jlreq at calc@current at linewidth}{%
+ \dimexpr\jlreq at calc@current at linewidth@onecolumn
+ \if at twocolumn
+ \ifdim\jlreq at calc@current at linewidth@onecolumn<\dimexpr\linewidth+\columnsep\relax\else
+ - \linewidth - \columnsep
+ \fi
+ \fi
+ \relax
+}
+
+\newdimen\jlreq at current@linewidth
+\newdimen\jlreq at rest@linewidth
+% この命令以降,次にこの命令を実行する前まで\jlreq at current@linewidth/\jlreq at rest@linewidthで
+% この行の行頭からの長さ/残りの長さが取得できる
+\jlreq at ifprimitive{\pdfsavepos}{\jlreq at tempatrue}{\jlreq at tempafalse}
+\edef\jlreq at savepos@for at rest@linewidth{\unexpanded{%
+ \jlreq at setcurrentpage
+ \global\advance\jlreq at reference@count by 1
+ }%
+ \ifjlreq at tempa
+ \unexpanded{%
+ \pdfsavepos
+ \jlreq at reference@label{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{\noexpand\the\noexpand\pdflastxpos}%
+ \jlreq at reference@label{jlreq at rest@width.pos.Y.\the\jlreq at reference@count}{\noexpand\the\noexpand\pdflastypos}%
+ }%
+ \else
+ \unexpanded{%
+ \savepos
+ \jlreq at reference@label{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{\noexpand\the\noexpand\lastxpos}%
+ \jlreq at reference@label{jlreq at rest@width.pos.Y.\the\jlreq at reference@count}{\noexpand\the\noexpand\lastypos}%
+ }%
+ \fi
+ \unexpanded{%
+ \global\jlreq at current@linewidth=\jlreq at calc@current at linewidth
+ \global\jlreq at rest@linewidth=\dimexpr\linewidth - \jlreq at current@linewidth\relax
+ \edef\jlreq at savepos@iflabelundefined{\jlreq at reference@ifexist{jlreq at rest@width.pos.X.\the\jlreq at reference@count}{\noexpand\@secondoftwo}{\noexpand\@firstoftwo}}%
+ }%
+}
+
+\ifx l\jlreq at engine
+ \newcommand*{\lastnodechar}{\directlua{luatexja.pltx_composite_last_node_char()}}% undocumentedな機能を使っている
+\fi
+
+% #1と#2の間に入るjmglue((x)kanjiskipも)を\jlreq at resultskipに入れる
+\ifx l\jlreq at engine
+ \newcommand*{\jlreq at calc@jfmglue}[2]{%
+ \begingroup
+ \setbox\jlreq at tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
+ \setbox\jlreq at tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
+ \edef\jlreq at do{\noexpand\jlreq at resultskip=\the\dimexpr\wd\jlreq at tempboxb - \wd\jlreq at tempboxa\relax\noexpand\relax}%
+ \jlreq at do
+ \directlua{
+ local width = 0
+ local stretch = 0
+ local shrink = 0
+ local n = tex.box["jlreq at 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 at tempskipa",width,stretch,shrink)
+ }%
+ % TeXで計測した物と一致していなければTeXでの方を信じる
+ \ifdim\jlreq at resultskip=\jlreq at tempskipa
+ \edef\jlreq at do{\noexpand\jlreq at resultskip=\the\jlreq at tempskipa\relax}%
+ \fi
+ \expandafter\endgroup
+ \jlreq at do
+ }
+\else
+ \newcommand*{\jlreq at calc@jfmglue}[2]{%
+ \begingroup
+ \setbox\jlreq at tempboxa=\hbox{\inhibitglue #1\inhibitglue\hbox{}\inhibitglue#2\inhibitglue}%
+ \setbox\jlreq at tempboxb=\hbox{\inhibitglue #1#2\inhibitglue}%
+ \edef\jlreq at do{\noexpand\jlreq at resultskip=\the\dimexpr\wd\jlreq at tempboxb - \wd\jlreq at tempboxa\relax\noexpand\relax}%
+ \expandafter\endgroup
+ \jlreq at do
+ }
+\fi
+
+\newcount\jlreq at lastnodechar
+% \jlreq at fixjfm<次の文字>の形で使う.
+% jlreq at lastnodecharに入っている値と次のトークン(\futureletで得る)の間に入るJFMグルー等を挿入する
+\newcommand*{\jlreq at fixjfm}{%
+ \begingroup
+ \ifnum\jlreq at lastnodechar>-1
+ \def\jlreq at do{\futurelet\jlreq at nextchar\jlreq at insertjfm}%
+ \else\def\jlreq at do{}\fi
+ \expandafter\endgroup
+ \jlreq at do
+}
+% \jlreq at nextcharと\jlreq at lastnodecharの間のJFMグルーを挿入
+\def\jlreq at insertjfm{%
+ \ifnum\jlreq at getpostbreakpenalty{\jlreq at lastnodechar}=0\else\penalty\jlreq at getpostbreakpenalty{\jlreq at lastnodechar}\fi
+ \begingroup
+ \def\jlreq at do{}%
+ \jlreq at getfirsttoken@expandmacros{\jlreq at nextchar}{\jlreq at tempa}%
+ \expandafter\jlreq at ifletter\expandafter{\jlreq at tempa}{%
+ \jlreq at calc@jfmglue{\char\jlreq at lastnodechar}{\jlreq at tempa}%
+% \message{fixjfm Insert: \the\jlreq at resultskip}%
+ \edef\jlreq at do{%
+ \noexpand\hskip\the\jlreq at resultskip\space
+ \noexpand\inhibitglue
+ }%
+ }{}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\ifx l\jlreq at engine
+ \newcommand*{\jlreq at divide}[2]{%
+ \jlreq at resultdimen=\directlua{tex.print(tostring(\strip at pt\dimexpr #1\relax/\strip at pt\dimexpr #2\relax) .. "pt ")}%
+ }
+\else
+ \let\jlreq at divide=\jlreq at helper@divide
+\fi
+
+%. 文字関連設定
+% ダミー
+\def\@ptsize{0}
+%.. (x)kanjiskip
+\providecommand*{\jlreqkanjiskip}{0pt plus 0.25\zw minus 0pt}
+\providecommand*{\jlreqxkanjiskip}{0.25\zw plus 0.25\zw minus 0.125\zw}
+\ifx l\jlreq at engine
+ \ltjsetparameter{kanjiskip=\jlreqkanjiskip}
+ \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip}
+\else
+ \kanjiskip=\jlreqkanjiskip
+ \xkanjiskip=\jlreqxkanjiskip
+\fi
+
+% フォントサイズを設定
+\newdimen\jlreq at fontsize
+\newdimen\jlreq at jafontsize
+\ifx l\jlreq at engine
+ % Q,zw,zhが正しく扱われるようになる.\dimexprつきに展開される.
+ \def\jlreq at 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 at expand@optionfontsize#1{\dimexpr#1\relax}
+\fi
+\jlreq at aftercls@addtodeletecs{\jlreq at expand@optionfontsize}
+\ifx\jlreq at option@fontsize\@empty
+ \ifx\jlreq at option@jafontsize\@empty
+ \jlreq at fontsize=10pt
+ \jlreq at jafontsize=\jlreq at option@jafontscale\jlreq at fontsize
+ \else
+ \setlength{\jlreq at jafontsize}{\jlreq at expand@optionfontsize{\jlreq at option@jafontsize}}
+ \jlreq at divide{\jlreq at jafontsize}{\jlreq at option@jafontscale pt}
+ \jlreq at fontsize=\jlreq at resultdimen
+ \fi
+\else
+ \setlength{\jlreq at fontsize}{\jlreq at expand@optionfontsize{\jlreq at option@fontsize}}
+ \ifx\jlreq at option@jafontsize\@empty
+ \jlreq at jafontsize=\jlreq at option@jafontscale\jlreq at fontsize
+ \else
+ \setlength{\jlreq at jafontsize}{\jlreq at expand@optionfontsize{\jlreq at option@jafontsize}}
+ \fi
+\fi
+
+%.. JFM
+\ifx l\jlreq at engine
+ \def\ltj at stdyokojfm{jlreq}
+ \def\ltj at stdtatejfm{jlreqv}
+ % この値は後でjfm-jlreq内で読む
+ \directlua{jlreq.open_bracket_pos = [[\jlreq at open@bracket at pos]]}
+ \ifjlreq at burasage\directlua{jlreq.burasage = true}\else\directlua{jlreq.burasage = false}\fi
+\else
+ \def\jlreq at jfmname@prefix{}
+ \jlreq at aftercls@addtodeletecs{\jlreq at jfmname@prefix}
+ \ifjlreq at burasage\edef\jlreq at jfmname@prefix{b\jlreq at jfmname@prefix}\fi
+ \ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{\edef\jlreq at jfmname@prefix{\jlreq at jfmname@prefix z}}{}
+ \ifx u\jlreq at engine\edef\jlreq at jfmname@prefix{u\jlreq at jfmname@prefix}\fi
+ \edef\jlreq at jfmname{\jlreq at jfmname@prefix jlreq} % JFMの名前
+ \edef\jlreq at jfmnameg{\jlreq at jfmname@prefix jlreqg} % ゴシックなJFMの名前
+ \jlreq at aftercls@addtodeletecs{\jlreq at jfmname}
+ \jlreq at aftercls@addtodeletecs{\jlreq at jfmnameg}
+ \AtBeginDocument{\PushPostHook{par}{\futurelet\jlreq at nextchar\jlreq at openbracket@hook}}
+\fi
+
+% 行頭の括弧は \jlreq at open@bracket at before@space \inhibitglue 「みたいにする.
+\ifthenelse{\equal{\jlreq at open@bracket at pos}{zenkakunibu_nibu}}{
+ \def\jlreq at open@bracket at before@space{\hskip\glueexpr-.5\zw\relax}
+}{
+ \def\jlreq at open@bracket at before@space{}
+}
+
+\ifx p\jlreq at engine
+ \def\jlreq at yokokanjiencoding{JY1}
+ \def\jlreq at tatekanjiencoding{JT1}
+\fi
+\ifx u\jlreq at engine
+ \def\jlreq at yokokanjiencoding{JY2}
+ \def\jlreq at tatekanjiencoding{JT2}
+\fi
+\ifx l\jlreq at engine
+ \def\jlreq at yokokanjiencoding{JY3}
+ \def\jlreq at tatekanjiencoding{JT3}
+\fi
+\jlreq at divide{\jlreq at jafontsize}{\jlreq at fontsize}
+\edef\jlreq at jafontscale{\strip at pt\jlreq at resultdimen}
+\jlreq at aftercls@addtodeletecs{\jlreq at jafontscale}
+\ifx l\jlreq at engine
+ \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdmcfont:jfm=jlreq;script=latn;-kern}{}
+ \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdgtfont:jfm=jlreq;script=latn;-kern}{}
+ \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdmcfont:jfm=jlreqv;script=latn;-kern}{}
+ \DeclareFontShape{JT3}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\ltj at stdgtfont:jfm=jlreqv;script=latn;-kern}{}
+\else
+ \DeclareFontShape{\jlreq at yokokanjiencoding}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmname}{}
+ \DeclareFontShape{\jlreq at yokokanjiencoding}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmnameg}{}
+ \DeclareFontShape{\jlreq at tatekanjiencoding}{mc}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmname-v}{}
+ \DeclareFontShape{\jlreq at tatekanjiencoding}{gt}{m}{n}{<->s*[\jlreq at jafontscale]\jlreq at jfmnameg-v}{}
+\fi
+\@for\jlreq at encoding:=\jlreq at yokokanjiencoding,\jlreq at tatekanjiencoding\do{
+ \@for\jlreq at shape:=n,it,sl,sc\do{
+ \@for\jlreq at series:=m,b,bx,sb,c\do{
+ \ifthenelse{\equal{\jlreq at shape}{n} \AND \equal{\jlreq at series}{m}}{}{
+ \DeclareFontShape{\jlreq at encoding}{gt}{\jlreq at series}{\jlreq at shape}{<->ssub*gt/m/n}{}
+ }
+ }
+ \@for\jlreq at series:=bx,b,sb\do{
+ \DeclareFontShape{\jlreq at encoding}{mc}{\jlreq at series}{\jlreq at shape}{<->ssub*gt/m/n}{}
+ }
+ \@for\jlreq at series:=m,c\do{
+ \ifthenelse{\equal{\jlreq at shape}{n} \AND \equal{\jlreq at series}{m}}{}{
+ \DeclareFontShape{\jlreq at encoding}{mc}{\jlreq at series}{\jlreq at shape}{<->ssub*mc/m/n}{}
+ }
+ }
+ }
+}
+
+%.. 文字クラスのリスト
+% 開き括弧(文字クラス1)
+\edef\jlreq at charlist@openingbrackets{(〔[{〈《「『【‘“\ifx p\jlreq at engine\else ⦅〘〖«〝\fi}
+% 閉じ括弧(文字クラス2)
+\edef\jlreq at charlist@closingbrackets{)〕]}〉》」』】’”\ifx p\jlreq at engine\else ⦆〙〗»〟\fi}
+% ハイフン(文字クラス3)
+\edef\jlreq at charlist@hyphens{‐〜\ifx p\jlreq at engine\else ゠–\fi}
+% 区切り約物(文字クラス4)
+\edef\jlreq at charlist@dividingpunctuationmarks{!?\ifx p\jlreq at engine\else ‼⁇⁈⁉\fi}
+% 中点類(文字クラス5)
+\edef\jlreq at charlist@middlenodes{・:;}
+% 句点類(文字クラス6)
+\edef\jlreq at charlist@fullstops{。.}
+% 読点類(文字クラス7)
+\edef\jlreq at charlist@commas{、,}
+% 分離禁止文字(文字クラス8)
+\edef\jlreq at charlist@inseparablecharacters{—…‥\ifx p\jlreq at engine\else 〳〴〵\fi}
+% 繰返し記号(文字クラス9)
+\edef\jlreq at charlist@iterationmarks{ヽヾゝゞ々\ifx p\jlreq at engine\else 〻\fi}
+% 長音記号(文字クラス10)
+\edef\jlreq at charlist@prolongedsoundmark{ー}
+% 小書きの仮名(文字クラス11)
+\edef\jlreq at charlist@smallkana{ぁぃぅぇぉァィゥェォっゃゅょゎッャュョヮヵヶ\ifx p\jlreq at engine\else ゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ\fi}%ㇷ゚
+% 前置省略記号(文字クラス12)
+\edef\jlreq at charlist@prefixedabbreviations{¥$£#\ifx p\jlreq at engine\else €№\fi}
+% 平仮名(文字クラス15)
+\edef\jlreq at charlist@hiragana{あいうえおかがきぎくぐけげこごさざしじすずせぜそぞただちぢつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもやゆよらりるれろわゐゑをん\ifx p\jlreq at engine\else ゔ\fi}% か゚き゚く゚け゚こ゚
+% 片仮名(文字クラス16)
+\edef\jlreq at charlist@katakana{アイウエオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモヤユヨラリルレロワヰヱヲンヴ\ifx p\jlreq at engine\else ヷヸヹヺ\fi}% カ゚キ゚ク゚ケ゚コ゚セ゚ツ゚ト゚
+
+%.. 行頭括弧調整
+\ifx l\jlreq at endgine
+ % \item後の行頭括弧のために仕込み.
+ \jlreq at saveoriginalcs{\list}
+ \jlreq at saveoriginalcs{\endlist}
+ \PushPostHook{par}{\jlreq at parhook@atbeginlist}
+ \pretocmd{\list}{\def\jlreq at parhook@atbeginlist{\ltjfakeparbegin}}{}{}
+ \apptocmd{\endlist}{\def\jlreq at parhook@atbeginlist{}}{}{}
+ \def\jlreq at parhook@atbeginlist{}
+\else
+ % 非LuaTeXの場合はJFMの入れ替えと\everyparでの処理で対処.
+ % 行頭括弧に対して\inhibitglueを入れたりする命令を作る
+ % \jlreq at charlist@openingbracketsの各括弧に対して,\ifx\jlreq at nextchar 「1\fiみたいなのが並んだのを作る
+ \def\jlreq at tempa{}
+ \def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifx\jlreq at nextchar#11\fi}\jlreq at do}}
+ \expandafter\jlreq at do\jlreq at charlist@openingbrackets\jlreq at endmark
+ % JFM glueの伸び縮みで行頭括弧が揃わないのを防ぐために常に\inhibitglueを入れる.
+ \ifthenelse{\equal{\jlreq at open@bracket at pos}{nibu_tentsuki}}{
+ \edef\jlreq at openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 \unexpanded{\hskip -.5\zw\inhibitglue}\noexpand\fi}
+ }{% zenkakunibu_nibu,zenkaku_tentsuki
+ \edef\jlreq at openbracket@hook@{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 \unexpanded{\inhibitglue}\noexpand\fi}
+ }
+ % source special対策
+ \def\jlreq at openbracket@hook{\ifx\jlreq at nextchar\special\expandafter\jlreq at openbracket@hook@@\else\expandafter\jlreq at openbracket@hook@\fi}
+ \def\jlreq at openbracket@hook@@#1#2{#1{#2}\futurelet\jlreq at nextchar\jlreq at openbracket@hook}
+\fi
+
+%.. 禁則処理
+\ifx l\jlreq at engine
+ \newcommand*{\jlreq at setpostbreakpenalty@}[2]{\ltjsetparameter{postbreakpenalty={`#1,#2}}}
+ \newcommand*{\jlreq at setprebreakpenalty@}[2]{\ltjsetparameter{prebreakpenalty={`#1,#2}}}
+ \newcommand*{\jlreq at addjaxspmode@}[2]{%
+ \jlreq at tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
+ \jlreq at switch{#2}{
+ {pre}{%
+ \ifnum\jlreq at tempcnta=2
+ \ltjsetparameter{jaxspmode={`#1,allow}}%
+ \else\ifnum\jlreq at tempcnta=0
+ \ltjsetparameter{jaxspmode={`#1,preonly}}%
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq at tempcnta=1
+ \ltjsetparameter{jaxspmode={`#1,allow}}%
+ \else\ifnum\jlreq at tempcnta=0
+ \ltjsetparameter{jaxspmode={`#1,postonly}}%
+ \fi\fi
+ }
+ }%
+ }
+ \newcommand*{\jlreq at deljaxspmode@}[2]{%
+ \jlreq at tempcnta=\ltjgetparameter{jaxspmode}{`#1}%
+ \jlreq at switch{#2}{
+ {pre}{%
+ \ifnum\jlreq at tempcnta=2
+ \ltjsetparameter{jaxspmode={`#1,postonly}}%
+ \else\ifnum\jlreq at tempcnta=1
+ \ltjsetparameter{jaxspmode={`#1,inhibit}}%
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq at tempcnta=3
+ \ltjsetparameter{jaxspmode={`#1,preonly}}%
+ \else\ifnum\jlreq at tempcnta=2
+ \ltjsetparameter{jaxspmode={`#1,inhibit}}%
+ \fi\fi
+ }
+ }%
+ }
+\else
+ \newcommand*{\jlreq at setpostbreakpenalty@}[2]{\postbreakpenalty`#1=#2}
+ \newcommand*{\jlreq at setprebreakpenalty@}[2]{\prebreakpenalty`#1=#2}
+ \newcommand*{\jlreq at addjaxspmode@}[2]{%
+ \jlreq at tempcnta=\inhibitxspcode`#1
+ \jlreq at switch{#2}{
+ {pre}{%
+ \ifnum\jlreq at tempcnta=1
+ \inhibitxspcode`#1=3
+ \else\ifnum\jlreq at tempcnta=0
+ \inhibitxspcode`#1=2
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq at tempcnta=2
+ \inhibitxspcode`#1=3
+ \else\ifnum\jlreq at tempcnta=0
+ \inhibitxspcode`#1=1
+ \fi\fi
+ }
+ }%
+ }
+ \newcommand*{\jlreq at deljaxspmode@}[2]{%
+ \jlreq at tempcnta=\inhibitxspcode`#1
+ \jlreq at switch{#2}{
+ {pre}{%
+ \ifnum\jlreq at tempcnta=3
+ \inhibitxspcode`#1=1
+ \else\ifnum\jlreq at tempcnta=2
+ \inhibitxspcode`#1=0
+ \fi\fi
+ }
+ {post}{%
+ \ifnum\jlreq at tempcnta=3
+ \inhibitxspcode`#1=2
+ \else\ifnum\jlreq at tempcnta=1
+ \inhibitxspcode`#1=0
+ \fi\fi
+ }
+ }%
+ }
+\fi
+% #1{...}{#3}を...が#2のリストに対して適用.
+\newcommand*\jlreq at iterateapply[3]{%
+ \edef\jlreq at tempa{#2}%
+ \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq at tempa\do{%
+ \expandafter#1\expandafter{\@tempa}{#3}%
+ }%
+}
+\def\jlreq at setpostbreakpenalty{\jlreq at iterateapply{\jlreq at setpostbreakpenalty@}}
+\def\jlreq at setprebreakpenalty{\jlreq at iterateapply{\jlreq at setprebreakpenalty@}}
+\def\jlreq at addjaxspmode{\jlreq at iterateapply{\jlreq at addjaxspmode@}}
+\def\jlreq at deljaxspmode{\jlreq at iterateapply{\jlreq at deljaxspmode@}}
+
+\jlreq at aftercls@addtodeletecs{\jlreq at iterateapply}
+\jlreq at aftercls@addtodeletecs{\jlreq at setpostbreakpenalty}
+\jlreq at aftercls@addtodeletecs{\jlreq at setpostbreakpenalty@}
+\jlreq at aftercls@addtodeletecs{\jlreq at setprebreakpenalty}
+\jlreq at aftercls@addtodeletecs{\jlreq at setprebreakpenalty@}
+\jlreq at aftercls@addtodeletecs{\jlreq at addjaxspmode}
+\jlreq at aftercls@addtodeletecs{\jlreq at addjaxspmode@}
+\jlreq at aftercls@addtodeletecs{\jlreq at deljaxspmode}
+\jlreq at aftercls@addtodeletecs{\jlreq at deljaxspmode@}
+
+% 行末禁則
+\jlreq at setpostbreakpenalty{\jlreq at charlist@openingbrackets}{10000}
+\jlreq at setpostbreakpenalty{\jlreq at charlist@prefixedabbreviations}{10000}
+
+% 行頭禁則
+\jlreq at setprebreakpenalty{\jlreq at charlist@closingbrackets}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@hyphens}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@dividingpunctuationmarks}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@middlenodes}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@fullstops}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@commas}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@iterationmarks}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@prolongedsoundmark}{10000}
+\jlreq at setprebreakpenalty{\jlreq at charlist@smallkana}{10000}
+
+% xkanjiskip
+\jlreq at addjaxspmode{\jlreq at charlist@iterationmarks}{pre}
+\jlreq at addjaxspmode{\jlreq at charlist@iterationmarks}{post}
+\jlreq at addjaxspmode{\jlreq at charlist@prolongedsoundmark}{pre}
+\jlreq at addjaxspmode{\jlreq at charlist@prolongedsoundmark}{post}
+\jlreq at addjaxspmode{\jlreq at charlist@smallkana}{pre}
+\jlreq at addjaxspmode{\jlreq at charlist@smallkana}{post}
+\jlreq at addjaxspmode{\jlreq at charlist@hiragana}{pre}
+\jlreq at addjaxspmode{\jlreq at charlist@hiragana}{post}
+\jlreq at addjaxspmode{\jlreq at charlist@katakana}{pre}
+\jlreq at addjaxspmode{\jlreq at charlist@katakana}{post}
+\jlreq at addjaxspmode{\jlreq at charlist@dividingpunctuationmarks}{post}
+
+% 分割禁止(分離禁止文字は特定の並びで分割禁止だが,とりあえず一括で禁止しておく.)
+\jlreq at setprebreakpenalty{\jlreq at charlist@inseparablecharacters}{10000}
+% ¥100とか70%とか……
+
+%.. 文字範囲
+\ifx u\jlreq at engine
+ % \kcatcodeの設定
+ \def\jlreq at setkcatcode#1#2{\@for\@tempa:=#1\do{\kcatcode"\@tempa=#2\relax}}
+ \jlreq at aftercls@addtodeletecs{\jlreq at setkcatcode}
+ % LuaTeX-jaのデフォルトのままに近い設定をする
+ % 範囲1&8
+ \jlreq at setkcatcode{80}{15} % Latin-1 Supplement,どうしよう……
+ \jlreq at setkcatcode{100,180,250,2B0,300,1E00}{15}
+ % 範囲2
+ \jlreq at setkcatcode{370,400,1F00}{18}
+ % 範囲3
+ \jlreq at setkcatcode{2000,2070,20A0,20D0,2100,2150,2190,2200,2300,2400,2500,2580,25A0,2600,2700,2900,2980,2B00}{18}
+ % 範囲4
+ \jlreq at 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 at setkcatcode{D800,DB80,DC00,E0000,F0000,100000}{15}
+ % 範囲6
+ \jlreq at setkcatcode{3040,30A0,31F0}{17} % Hiragana,Katakana,Katakana Phonetic Extensions
+ \jlreq at 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 at setkcatcode{2E80,3190,3400,4E00,F900,20000}{16}
+ % 範囲7
+ \jlreq at setkcatcode{A000,A490}{18} % Yi Syllables,Yi Radicals
+ \jlreq at setkcatcode{1100,3130,AC00,D7B0}{19} % Hangul Jamo,Hangul Compatibility Jamo,Hangul Syllables,Hangul Jamo Extended-B
+ \jlreq at setkcatcode{2F00,2FF0,3100,31A0,31C0,A830}{16}
+\fi
+
+%.. フォント
+\RequirePackage{lmodern}
+
+%.. 古いフォントコマンド
+\DeclareOldFontCommand{\jlreq at oldfontcommand@mc}{\normalfont\mcfamily}{\mathmc}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@gt}{\normalfont\gtfamily}{\mathgt}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@tt}{\normalfont\ttfamily}{\mathtt}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@bf}{\normalfont\bfseries}{\mathbf}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@sl}{\normalfont\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\jlreq at oldfontcommand@sc}{\normalfont\scshape}{\@nomath\sc}
+\newcommand*{\jlreq at oldfontcommand@enable}{%
+ \let\mc=\jlreq at oldfontcommand@mc
+ \let\gt=\jlreq at oldfontcommand@gt
+ \let\rm=\jlreq at oldfontcommand@rm
+ \let\sf=\jlreq at oldfontcommand@sf
+ \let\tt=\jlreq at oldfontcommand@tt
+ \let\bf=\jlreq at oldfontcommand@bf
+ \let\it=\jlreq at oldfontcommand@it
+ \let\sl=\jlreq at oldfontcommand@sl
+ \let\sc=\jlreq at oldfontcommand@sc
+}
+\newcommand*{\jlreq at 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}
+
+% 和文ファミリと欧文ファミリの連動
+\DeclareRobustCommand\rmfamily{%
+ \not at math@alphabet\rmfamily\mathrm
+ \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
+\DeclareRobustCommand\sffamily{%
+ \not at math@alphabet\sffamily\mathsf
+ \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
+\DeclareRobustCommand\ttfamily{%
+ \not at math@alphabet\ttfamily\mathtt
+ \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
+
+% 数式フォント設定
+\ifjlreq at option@enablejfam
+ \ifx l\jlreq at engine\else
+ \DeclareSymbolFont{mincho}{\jlreq at yokokanjiencoding}{mc}{m}{n}
+ \DeclareSymbolFontAlphabet{\mathmc}{mincho}
+ \SetSymbolFont{mincho}{bold}{\jlreq at yokokanjiencoding}{gt}{m}{n}
+ \jfam\symmincho
+ \DeclareMathAlphabet{\mathgt}{\jlreq at yokokanjiencoding}{gt}{m}{n}
+ \fi
+ \AtBeginDocument{%
+ \reDeclareMathAlphabet{\mathrm}{\mathrm}{\mathmc}%
+ \reDeclareMathAlphabet{\mathbf}{\mathbf}{\mathgt}%
+ }
+\fi
+
+% 和文間隔
+\DeclareRobustCommand*\ {\futurelet\jlreq at nextchar\jlreq at zenkakuspace@ignorespaces}
+% 後続の空白を無視する処理
+\edef\jlreq at zenkakuspace@ignorespaces{%
+ \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq at nextchar\expandafter\jlreq at zenkakuspace@ignorespaces@\else\expandafter\jlreq at zenkakuspace@main\fi}%
+}
+\expandafter\def\expandafter\jlreq at zenkakuspace@ignorespaces@\space{\ }
+\def\jlreq at tempa{}
+\def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifnum\lastnodechar=`#1 1\fi}\jlreq at do}}
+\expandafter\jlreq at do\jlreq at charlist@dividingpunctuationmarks\jlreq at endmark
+\edef\@tempa{\noexpand\ifnum0\expandonce{\jlreq at tempa}>0 }
+\expandafter\DeclareRobustCommand\expandafter*\expandafter\jlreq at zenkakuspace@main\expandafter{\@tempa
+ \hskip 1\zw\hbox{}%
+ \jlreq at lastnodechar=`
+ \expandafter\jlreq at fixjfm
+ \else\expandafter \fi
+}
+\ifx l\jlreq at engine
+ {
+ \catcode` =\active
+ \global\let =\jlreq at zenkakuspace@main
+ }
+ \AtBeginDocument{\catcode` =\active}
+\fi
+
+% \jaspace
+\DeclareRobustCommand*{\jaspace}[1]{%
+ \ifcsname jlreq at jaspace@#1\endcsname\csname jlreq at jaspace@#1\endcsname
+ \else\ClassError{jlreq}{unknown jaspace: #1}{\@ehc}\fi
+}
+\def\jlreq at jaspace@zenkaku{\hskip\glueexpr 1\zw\relax}
+\def\jlreq at jaspace@nibu{\hskip\glueexpr .5\zw\relax}
+\def\jlreq at jaspace@shibu{\hskip\glueexpr .25\zw\relax}
+
+% 区切り約物.\? みたいな命令を作る.直後の空きが自動で入る.
+% \?*とすると文中の?として扱われる.
+\def\jlreq at tempa{}
+\def\jlreq at do#1{\jlreq at ifendmark{#1}{}{\appto\jlreq at tempa{\ifx\jlreq at nextchar #11\fi}\jlreq at do}}
+\expandafter\jlreq at do\jlreq at charlist@closingbrackets\jlreq at endmark
+\edef\jlreq at dividingpunctuationmarkscommand{%
+ \noexpand\ifnum 0\expandonce{\jlreq at tempa}>0 \unexpanded{\expandafter\ignorespaces\else\expandafter\ \fi}%
+}
+\def\jlreq at do#1{%
+ \jlreq at ifendmark{#1}{}{
+ \expandafter\DeclareRobustCommand\expandafter*\csname #1\endcsname{%
+ \jlreq at ifstar
+ {\hskip .25\zw #1\hskip .25\zw\ignorespaces}%
+ {#1\futurelet\jlreq at nextchar\jlreq at dividingpunctuationmarkscommand}%
+ }
+ \jlreq at do
+ }
+}
+\expandafter\jlreq at do\jlreq at charlist@dividingpunctuationmarks\jlreq at endmark
+
+
+%.. 文字サイズ変更命令の定義
+% \baselineskipの計算
+% いったん文字サイズを変更((u)platexの際にzh/zwをきちんとするため)
+\@setfontsize\normalsize{\jlreq at fontsize}{\jlreq at fontsize}%
+\newdimen\jlreq at baselineskip
+\ifx l\jlreq at engine
+ \setlength{\jlreq at baselineskip}{%
+ \dimexpr\directlua{
+ local act = string.char(92)
+ local s = [[\jlreq at 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 at baselineskip}{\dimexpr\jlreq at option@baselineskip\relax}
+\fi
+\ifdim\jlreq at fontsize>\jlreq at baselineskip
+ \ClassError{jlreq}{The baselineskip is less than fontsize}{\@ehc}%
+\fi
+\ifthenelse{\lengthtest{\jlreq at baselineskip<1.5\zw} \OR \lengthtest{\jlreq at baselineskip>2\zw}}{
+ \jlreq at note{行間は二分以上全角以下が望ましい (2.4.2.d 注3).}
+}{}
+
+\emergencystretch 3\jlreq at gol
+\def\jlreq at setfontsizehook{}
+\jlreq at saveoriginalcs{\set at fontsize}
+\apptocmd{\set at fontsize}{\expandafter\def\expandafter\size at update\expandafter{\size at update\jlreq at setfontsizehook}}{}{}
+\appto\jlreq at setfontsizehook{\ifdim\parindent>0pt \setlength{\parindent}{1\zw}\fi}
+\ifx l\jlreq at engine
+ \@tempskipa=\ltjgetparameter{kanjiskip}
+ \ifdim\@tempskipa=\maxdimen\else
+ \appto\jlreq at setfontsizehook{%
+ \ltj at setpar@global
+ \ltjsetkanjiskip\jlreqkanjiskip
+ \@tempskipa=\ltjgetparameter{xkanjiskip}%
+ \ifdim\@tempskipa>0pt
+ \ltjsetxkanjiskip\jlreqxkanjiskip
+ \fi
+ }
+ \fi
+\else
+ \appto\jlreq at setfontsizehook{%
+ \kanjiskip=\jlreqkanjiskip
+ \ifdim\xkanjiskip>0pt
+ \xkanjiskip=\jlreqxkanjiskip
+ \fi
+ }
+\fi
+
+% \jafontsize
+\ifdim\jlreq at fontsize=\jlreq at jafontsize
+ \let\jafontsize=\fontsize
+\else
+ \def\@tempa#1{
+ \DeclareRobustCommand*{\jafontsize}[2]{%
+ \begingroup
+ \jlreq at iffloat{##1}{%
+ \edef\jlreq at do{\noexpand\fontsize{\strip at pt\dimexpr#1\dimexpr##1pt\relax\relax}}%
+ }{%
+ \edef\jlreq at do{\noexpand\fontsize{\the\dimexpr#1\dimexpr##1\relax\relax}}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do{##2}%
+ }
+ }
+ \jlreq at divide{\jlreq at fontsize}{\jlreq at jafontsize}
+ \edef\jlreq at do{\noexpand\@tempa{\strip at pt\jlreq at resultdimen}}
+ \jlreq at do
+\fi
+
+\renewcommand{\normalsize}{%
+ \@setfontsize\normalsize{\jlreq at fontsize}{\jlreq at baselineskip}%
+ \abovedisplayskip 1.1\jlreq at fontsize \@plus .3\jlreq at fontsize \@minus .4\jlreq at fontsize
+ \abovedisplayshortskip \z@ \@plus .3\jlreq at fontsize
+ \belowdisplayskip .9\jlreq at fontsize \@plus.3\jlreq at fontsize \@minus.4\jlreq at fontsize
+ \belowdisplayshortskip \belowdisplayskip
+ \let\@listi\@listI}
+
+\if at tate\tate\fi % ここで発行しておく
+\mcfamily\selectfont\normalsize
+\setbox\jlreq at tempboxa\hbox{阿}
+\setlength\Cht{\ht\jlreq at tempboxa}
+\setlength\Cdp{\dp\jlreq at tempboxa}
+\setlength\Cwd{\wd\jlreq at tempboxa}
+\setlength\Cvs{\baselineskip}
+\setlength\Chs{\wd\jlreq at tempboxa}
+
+% 4.1.3.a
+% 2.5.2 \baselineskipは一定の方がよい?
+% \@listiは再定義しないようにした.(\normalsizeと共用でJLReq通りだと思う.)
+\newcommand{\footnotesize}{%
+ \@setfontsize\footnotesize{.8\jlreq at fontsize}{\dimexpr 115\jlreq at baselineskip/170\relax}% 脚注文字サイズの二分より少し小さい値を行間に: 4.2.5.e
+ \abovedisplayskip .6\jlreq at fontsize \@plus.2\jlreq at fontsize \@minus.4\jlreq at fontsize
+ \abovedisplayshortskip \z@ \@plus.1\jlreq at fontsize
+ \belowdisplayshortskip .3\jlreq at fontsize \@plus.1\jlreq at fontsize \@minus.2\jlreq at fontsize
+ \belowdisplayskip \abovedisplayskip}
+% tsize10.cloの引数を,そのまま\jlreq at fontsize/\jlreq at baselineskipでスケーリングしているだけ.
+\newcommand{\small}{%
+ % jsarticleのもの
+ \@setfontsize\small{.9\jlreq at fontsize}{\dimexpr 13\jlreq at baselineskip/17\relax}%
+ \abovedisplayskip .9\jlreq at fontsize \@plus.3\jlreq at fontsize \@minus.4\jlreq at fontsize
+ \abovedisplayshortskip \z@ \@plus.3\jlreq at fontsize
+ \belowdisplayshortskip \abovedisplayshortskip
+ \belowdisplayskip \abovedisplayskip}
+\newcommand{\scriptsize}{\@setfontsize\scriptsize{\dimexpr 7\jlreq at fontsize/10\relax}{\dimexpr 8\jlreq at baselineskip/17\relax}}
+\newcommand{\tiny}{\@setfontsize\tiny{\dimexpr 5\jlreq at fontsize/10\relax}{\dimexpr 6\jlreq at baselineskip/17\relax}}
+\newcommand{\large}{\@setfontsize\large{\dimexpr12\jlreq at fontsize/10\relax}{\jlreq at baselineskip}}
+\newcommand{\Large}{\@setfontsize\Large{\dimexpr14\jlreq at fontsize/10\relax}{\dimexpr 21\jlreq at baselineskip/17\relax}}
+\newcommand{\LARGE}{\@setfontsize\LARGE{\dimexpr17\jlreq at fontsize/10\relax}{\dimexpr 25\jlreq at baselineskip/17\relax}}
+\newcommand{\huge}{\@setfontsize\huge{2\jlreq at fontsize}{\dimexpr 28\jlreq at baselineskip/17\relax}}
+\newcommand{\Huge}{\@setfontsize\Huge{\dimexpr 25\jlreq at fontsize/10\relax}{\dimexpr 33\jlreq at baselineskip/17\relax}}
+
+%. plextから一部拝借
+% オプションも*もない\rensuji(コピペ)
+\DeclareRobustCommand{\jlreq at rensuji}[1]{%
+ \ifvmode\leavevmode\fi
+ \jlreq at ifydir{\hbox{#1}}{%
+ \hskip 0pt plus 0.25\zw minus 0pt % \rensujiskipは固定値
+ \setbox\jlreq at tempboxa=\hbox{\yoko#1}%
+ \@tempdima=\dimexpr\ht\jlreq at tempboxa+\dp\jlreq at 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 at 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 at omotekeiwidth
+\jlreq at omotekeiwidth=0.12mm
+\newdimen\jlreq at chuubusokeiwidth
+\jlreq at chuubusokeiwidth=0.25mm
+\newdimen\jlreq at urakeiwidth
+\jlreq at urakeiwidth=0.4mm
+% 脚注のインデント
+\newdimen\jlreq at footnoteindent
+
+%\RequirePackage{jlreq-debug}
+
+%. ページレイアウト
+% landscapeの場合縦横をひっくり返す
+\if at landscape
+ \jlreq at helper@swap at register{\paperwidth}{\paperheight}
+\fi
+
+% \pdfpagewidthとか設定
+\ifx l\jlreq at engine
+ \setlength{\pagewidth}{\paperwidth}
+ \setlength{\pageheight}{\paperheight}
+\else
+ \setlength{\pdfpagewidth}{\paperwidth}
+ \setlength{\pdfpageheight}{\paperheight}
+\fi
+
+\ifx l\jlreq at engine
+ \def\jlreq at 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 at expand@speciallength#1{#1}
+\fi
+\def\jlreq at speciallength#1{\dimexpr\jlreq at expand@speciallength{#1}\relax}
+
+%.. 二段組み用パラメータ
+\setlength{\columnsep}{\jlreq at speciallength{\jlreq at option@column at gap}}
+\setlength{\columnseprule}{0pt}
+
+%.. 傍注(4.2.7)
+\begingroup
+ \footnotesize
+ \setlength{\jlreq at tempdima}{\jlreq at speciallength{\jlreq at option@sidenote at length}}
+ \jlreq at tempdimb=1\zw
+ \divide\jlreq at tempdima\jlreq at tempdimb
+ \multiply\jlreq at tempdima\jlreq at tempdimb
+ \ifdim\jlreq at tempdima>0pt
+ \ifnum 0\ifdim\jlreq at tempdima>25\zw 1\fi\ifdim\jlreq at tempdima<15\zw 1\fi>0
+ \jlreq at note{並列注の字詰め方向の長さ(行長)は,15字から20字くらいである.ケースによっては25字程度にする場合もある (4.2.7).}
+ \fi
+ \fi
+ \edef\jlreq at do{
+ \noexpand\setlength{\noexpand\marginparwidth}{\the\jlreq at tempdima}
+ \noexpand\setlength{\noexpand\marginparpush}{\the\dimexpr 0.5\zw\relax} % 同上:4.2.7.g
+ }
+ \expandafter\endgroup
+\jlreq at do
+\ifdim\marginparwidth>0pt
+ \setlength{\marginparsep}{2\zw} % フォントサイズ×2(4.2.7:特に問題に~e)
+\else
+ \setlength{\marginparsep}{0pt}
+\fi
+
+% 縦書きの時は脚注に固定
+% (TODO: 頭注)
+\if at tate\@mparswitchfalse\fi
+
+\setlength{\topskip}{1\zw} % フォントサイズと一致させる
+\ifx\jlreq at option@headfoot at verticalpos\@empty
+ \if at tate\def\jlreq at option@headfoot at verticalpos{1zw}
+ \else\def\jlreq at option@headfoot at verticalpos{2zw}\fi
+\fi
+\setlength{\headsep}{\jlreq at speciallength{\jlreq at option@headfoot at verticalpos}}
+\if at tate\ifdim\headsep<1\zw\relax\jlreq at note{基本版面との上下方向の最低の空き量を,基本版面の文字サイズの全角アキとする (26.1.a).}\fi\fi
+\if at tate
+ \if at 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 at determine@kihonhanmen at warning@first
+\jlreq at determine@kihonhanmen at warning@firsttrue
+\def\jlreq at determine@kihonhanmen at warning{
+ \ifjlreq at determine@kihonhanmen at warning@first
+ \jlreq at note{基本版面は,a. サイズの決定 b. 仕上りサイズに対する基本版面の配置位置の決定 という手順で行う (2.4.1).}
+ \jlreq at determine@kihonhanmen at warning@firstfalse
+ \fi
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at determine@kihonhanmen at warning}
+\jlreq at aftercls@addtodeleteif{\ifjlreq at determine@kihonhanmen at warning@first}
+\@tempdima=1\zw
+\ifx\jlreq at option@line at length\@empty
+ \if at tate
+ \ifnum 0\ifx\jlreq at option@head at space\@empty 1\fi\ifx\jlreq at option@foot at space\@empty 1\fi>0
+ \setlength{\textwidth}{0.75\paperheight}
+ \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
+ \else
+ \jlreq at determine@kihonhanmen at warning
+ \setlength{\textwidth}{\dimexpr\paperheight - \jlreq at option@head at space - \jlreq at option@foot at space \relax}
+ \fi
+ \else
+ \ifnum 0\ifx\jlreq at option@gutter\@empty 1\fi\ifx\jlreq at option@fore at edge\@empty 1\fi>0
+ \setlength{\textwidth}{0.75\paperwidth}
+ \divide\textwidth\@tempdima\multiply\textwidth\@tempdima
+ \else
+ \jlreq at determine@kihonhanmen at warning
+ \setlength{\textwidth}{\dimexpr\paperwidth - \jlreq at option@gutter - \jlreq at option@fore at edge\relax}
+ \fi
+ \fi
+ \if at twocolumn
+ \addtolength{\textwidth}{\dimexpr-2\marginparwidth - 2\marginparsep\relax}
+ \setlength{\textwidth}{\dimexpr(\textwidth - \columnsep)/2\relax}
+ \else
+ \addtolength{\textwidth}{\dimexpr-\marginparwidth - \marginparsep\relax}
+ \fi
+\else
+ \setlength{\textwidth}{\jlreq at speciallength{\jlreq at option@line at length}}
+ \divide\textwidth\@tempdima
+ \if at tate
+ \ifnum\number\textwidth>52
+ \jlreq at note{一行の長さは52文字以下が望ましい (2.4.2.c 注2).}
+ \fi
+ \else
+ \ifnum\number\textwidth>40
+ \jlreq at note{一行の長さは40文字以下が望ましい (2.4.2.c 注2).}
+ \fi
+ \fi
+ \multiply\textwidth\@tempdima
+\fi
+\if at twocolumn
+ \setlength{\textwidth}{\dimexpr2\textwidth + \columnsep\relax}
+\fi
+\addtolength{\textwidth}{0.0001pt}
+
+
+%.. \textheight:行送り方向の長さ
+% 一番上(直後に\topskip由来が入る)から最終行のベースラインまでの長さ.
+% \topskipが十分ある時は先頭行のベースラインから最終行のベースライン+\topskip
+\def\jlreq at adjusttextheight{
+ \addtolength{\textheight}{-\topskip}
+ \divide\textheight\baselineskip \multiply\textheight\baselineskip
+ \addtolength{\textheight}{\topskip}
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at adjusttextheight}
+\ifx\jlreq at option@number at of@lines\@empty
+ \if at tate
+ \ifnum 0\ifx\jlreq at option@gutter\@empty 1\fi\ifx\jlreq at option@fore at edge\@empty 1\fi>0
+ \setlength{\textheight}{0.75\paperwidth}
+ \jlreq at adjusttextheight
+ \else
+ \jlreq at determine@kihonhanmen at warning
+ \setlength{\textheight}{\dimexpr\paperwidth - \jlreq at option@gutter - \jlreq at option@fore at edge + \topskip - 1\zw\relax}
+ \fi
+ \else
+ \ifnum 0\ifx\jlreq at option@head at space\@empty 1\fi\ifx\jlreq at option@foot at space\@empty 1\fi>0
+ \setlength{\textheight}{0.75\paperheight}
+ \jlreq at adjusttextheight
+ \else
+ \jlreq at determine@kihonhanmen at warning
+ \setlength{\textheight}{\dimexpr\paperheight + 2\topskip - 1\zh - \Cht - \jlreq at option@head at space - \jlreq at option@foot at space\relax}
+ \fi
+ \fi
+\else
+ \setlength{\textheight}{\dimexpr\numexpr\jlreq at option@number at of@lines\relax\baselineskip - \baselineskip + \topskip\relax}
+\fi
+\addtolength{\textheight}{0.0001pt}
+
+%.. 横
+\def\jlreq at setsidemargin@by at gutter#1{
+ \if at tate
+ \setlength{\evensidemargin}{#1}
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight - \evensidemargin + \topskip - \Cht\relax}
+ \addtolength{\evensidemargin}{\Cdp}
+ \else
+ \setlength{\oddsidemargin}{#1}
+ \if at twocolumn
+ \addtolength{\oddsidemargin}{\dimexpr\marginparsep + \marginparwidth\relax}
+ \fi
+ \setlength{\evensidemargin}{\dimexpr\paperwidth - \textwidth - \oddsidemargin\relax}
+ \fi
+}
+\def\jlreq at setsidemargin@by at fore@edge#1{
+ \jlreq at setsidemargin@by at gutter{#1}
+ \jlreq at helper@swap at register{\oddsidemargin}{\evensidemargin}
+ \ifjlreq at determine@kihonhanmen at warning@first
+ \jlreq at note{基本版面の配置はのどの空き量を指定する (2.4.1.b).}
+ \fi
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at setsidemargin@by at gutter}
+\jlreq at aftercls@addtodeletecs{\jlreq at setsidemargin@by at fore@edge}
+
+\ifx\jlreq at option@gutter\@empty
+ \ifx\jlreq at option@fore at edge\@empty
+ % 中央配置
+ \if at tate
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textheight + \topskip\relax}
+ \else
+ \if at twocolumn
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth\relax}
+ \else
+ \setlength{\oddsidemargin}{\dimexpr\paperwidth - \textwidth - \marginparsep - \marginparwidth\relax}
+ \fi
+ \fi
+ \setlength{\oddsidemargin}{.5\oddsidemargin}
+ \ifnum0\if at twocolumn1\fi\if at tate1\fi>0
+ \setlength{\evensidemargin}{\oddsidemargin}
+ \else
+ \setlength{\evensidemargin}{\dimexpr\oddsidemargin + \marginparsep + \marginparwidth\relax}
+ \fi
+ \else
+ \jlreq at setsidemargin@by at fore@edge{\jlreq at speciallength{\jlreq at option@fore at edge}}
+ \fi
+\else
+ \jlreq at setsidemargin@by at gutter{\jlreq at speciallength{\jlreq at option@gutter}}
+ \ifx\jlreq at option@fore at edge\@empty\else
+ \ifjlreq at determine@kihonhanmen at warning@first
+ \ClassWarningNoLine{jlreq}{fore-edge is ignored}
+ \fi
+ \fi
+\fi
+\ifx l\jlreq at engine
+ \addtolength{\oddsidemargin}{-1in}
+ \addtolength{\evensidemargin}{-1in}
+\else
+ \addtolength{\oddsidemargin}{-1truein}
+ \addtolength{\evensidemargin}{-1truein}
+\fi
+
+%.. 縦
+% \topmarginに全体の頭からテキストの頭までの長さを入れる
+% 天の値からtopmarginを設定する
+\def\jlreq at settopmarginbyhead#1{
+ \if at tate
+ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight\relax}
+ \if at twocolumn
+ \addtolength{\topmargin}{\dimexpr\marginparwidth + \marginparsep\relax}
+ \fi
+ \jlreq at note{縦組の場合は地の空き量を指定する (2.4.1.b).}
+ \else
+ \setlength{\topmargin}{\dimexpr #1 - \headsep - \headheight - \topskip + \Cht\relax}
+ \fi
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at settopmarginbyhead}
+% 地の値から
+\def\jlreq at settopmarginbyfoot#1{
+ \if at tate
+ \setlength{\topmargin}{\dimexpr\paperheight - \textwidth - \headsep - \headheight - #1 - \marginparsep - \marginparwidth\relax}
+ \else
+ \jlreq at note{横組の場合は天の空き量を指定する (2.4.1.b).}
+ \setlength{\topmargin}{\dimexpr\paperheight - \textheight + \topskip - 1\zh - \headsep - \headheight - #1\relax}
+ \fi
+}
+\jlreq at aftercls@addtodeletecs{\jlreq at settopmarginbyfoot}
+\ifx\jlreq at option@head at space\@empty
+ \ifx\jlreq at option@foot at space\@empty
+ \if at tate
+ \if at twocolumn
+ \jlreq at settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - 2\marginparwidth - 2\marginparsep)/2\relax}
+ \else
+ \jlreq at settopmarginbyfoot{\dimexpr(\paperheight - \textwidth - \marginparwidth - \marginparsep)/2\relax}
+ \fi
+ \else
+ \jlreq at settopmarginbyhead{\dimexpr(\paperheight - (\textheight - \topskip + 1\zh))/2\relax}
+ \fi
+ \else
+ \jlreq at settopmarginbyfoot{\jlreq at speciallength{\jlreq at option@foot at space}}
+ \fi
+\else
+ \ifx\jlreq at option@foot at space\@empty
+ \jlreq at settopmarginbyhead{\jlreq at speciallength{\jlreq at option@head at space}}
+ \else
+ % 両方指定されていたら,縦書きは地を,横書きは天を使う
+ \if at tate
+ \jlreq at settopmarginbyfoot{\jlreq at speciallength{\jlreq at option@foot at space}}
+ \ifx\jlreq at option@line at length\@empty\else
+ \ClassWarningNoLine{jlreq}{head_space is ignored}
+ \fi
+ \else
+ \jlreq at settopmarginbyhead{\jlreq at speciallength{\jlreq at option@head at space}}
+ \ifx\jlreq at option@number at of@lines\@empty\else
+ \ClassWarningNoLine{jlreq}{foot_space is ignored}
+ \fi
+ \fi
+ \fi
+\fi
+\ifx l\jlreq at engine
+ \addtolength{\topmargin}{-1in}
+\else
+ \addtolength{\topmargin}{-1truein}
+\fi
+%.. 下
+\setlength{\footskip}{\dimexpr\headsep + \if at tate\marginparwidth + \marginparsep\else\topskip - \Cht\fi + \headheight\relax}
+% \maxdepth + \topskip = フォントサイズ×1.5(だってさ)
+\setlength{\maxdepth}{\dimexpr1.5\zw - \topskip\relax}
+
+%. システム設定
+%.. 逆ノンブル
+\ifjlreq at option@use at reverse@pagination
+ \AtEndDocument{\clearpage\jlreq at reference@immediate at write{lastpage}{\noexpand\arabic{page}}}%
+ \def\c at jlreqreversepage{\numexpr\jlreq at reference@ref{lastpage}{0} - \c at page + 1\relax}
+ \def\thejlreqreversepage{\arabic{jlreqreversepage}}
+\fi
+
+%. 見出し関係 (4.1)
+% \clear***page
+\newcommand*{\cleartooddpage}[1][]{%
+ \clearpage
+ \ifodd\c at page\else
+ \jlreq at ifempty{#1}{}{\thispagestyle{#1}}%
+ \hbox{}%
+ \newpage
+ \if at twocolumn\hbox{}\newpage\fi
+ \fi
+}
+\newcommand*{\cleartoevenpage}[1][]{%
+ \clearpage
+ \ifodd\c at page
+ \jlreq at ifempty{#1}{}{\thispagestyle{#1}}%
+ \hbox{}%
+ \newpage
+ \if at twocolumn\hbox{}\newpage\fi
+ \fi
+}
+
+% 扉見出しと別行見出しについては,\<csname> -> \jlreq at headingcs@csname -> 本体と
+% 二段構えで展開されるようにする.一度の展開で\parが出るのを防ぐため.
+% 一度展開を\longなしマクロに渡されると破綻するので.(そういうパッケージが存在する.)
+
+% jlreq at heading@maketoc@<命令名>が\tableofcontents用の出力をするために呼び出される.
+% #1=*または空(見出し命令に*がついていたかで分岐),#2=ラベル,#3=running head
+% デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる.
+
+% 見出しの直前に実行される
+\newcommand*{\jlreq at hook@beforeheadings}[1]{}
+% 見出し名一覧を格納する
+\def\jlreq at heading@allheadings{}
+
+% 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット}
+% 結果は\jlreq at resultに入る.
+\def\jlreq at heading@make at l@#1#2#3{%
+ \@ifundefined{l@#1}{%
+ % 長さは適当に計測する
+ \begingroup
+ % ちょっと大きめで計測しておく
+ \csname c@#1\endcsname=9
+ \setbox\jlreq at tempboxa=\hbox{#3}%
+ \jlreq at tempdima=\wd\jlreq at tempboxa
+ \csname c@#1\endcsname=26
+ \setbox\jlreq at tempboxa=\hbox{#3}%
+ \ifdim\jlreq at tempdima<\wd\jlreq at tempboxa
+ \jlreq at tempdima=\wd\jlreq at tempboxa
+ \fi
+ % \numexprは四捨五入
+ \jlreq at tempdimb=\dimexpr\the\numexpr\jlreq at tempdima/\dimexpr 1\zw\relax + 2\relax\zw\relax
+ \edef\jlreq at do{%
+ \unexpanded{\def\jlreq at result}{%
+ \noexpand\def\expandonce{\csname l@#1\endcsname}{%
+ \unexpanded{\@dottedtocline{#2}{0\zw}}{\the\jlreq at tempdimb}%
+ }%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+ }{\def\jlreq at result{}}%
+}
+
+% \jlreq at heading@make at maketoc{セクション名}{レベル}
+\def\jlreq at heading@make at maketoc#1#2{%
+ % 目次への出力をするマクロ.外部に切り出しておく.
+ \@ifundefined{jlreq at heading@maketoc@#1}{%
+ % {1 = */-}{2 = ラベル}{3 = running head}
+ % 1はcounter=falseならば-,星付き命令ならば*,それ以外は空.
+ % 1が*または-の時は見出しにはラベルが現れないが,2には常にラベルが入るので,必要ならばここで無視する.
+ \expandafter\def\csname jlreq at heading@maketoc@#1\endcsname##1##2##3{%
+ \jlreq at iffirsttoken{##1}{*}{}{%
+ \csname #1mark\endcsname{##3}%
+ \ifnum0\jlreq at iffirsttoken{##1}{-}{1}{}\ifnum #2>\c at secnumdepth 1\fi>0
+ \addcontentsline{toc}{#1}{##3}%
+ \else
+ \addcontentsline{toc}{#1}{\jlreq at ifempty{##2}{}{\protect\numberline{##2}}##3}%
+ \fi
+ }{}%
+ }%
+ }{}%
+}
+
+%.. 中/半扉見出し
+% addcontentslineに渡すやつ:番号出すのと出さないの
+\newcommand{\DeclareTobiraHeading}[3]{%
+ \def\jlreq at do{\@removeelement{#1}}%
+ \expandafter\jlreq at do\expandafter{\jlreq at heading@allheadings}{\jlreq at heading@allheadings}%
+ \appto{\jlreq at heading@allheadings}{,#1}%
+ \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
+ \expandafter\edef\csname jlreq at heading@setting@#1\endcsname{\unexpanded{#3}}%
+ \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewTobiraHeading}%
+ \@ifundefined{c@#1}{\newcounter{#1}}{}%
+ \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
+ \jlreq at heading@make at maketoc{#1}{#2}%
+ \begingroup
+ \let\jlreq at contents@label at format=\@undefined
+ \let\jlreq at format=\@undefined
+ \edef\jlreq at label@format{\expandonce{\csname the#1\endcsname}}%
+ \def\jlreq at heading@clearpage{\clearpage\hbox{}\clearpage}%
+ \def\jlreq at pagestyle{empty}%
+ \newif\ifjlreq at number \jlreq at numbertrue
+ \jlreq at parsekeyval[DeclareTobiraHeading:#1]{
+ {label_format}{\def\jlreq at label@format{##1}}
+ {format}{\def\jlreq at format####1####2{##1}}
+ {pagestyle}{\def\jlreq at pagestyle{##1}}
+ {type}[han,naka]{%
+ \jlreq at switch{##1}{
+ {han}{\def\jlreq at heading@clearpage{\clearpage}}
+ {naka}{\def\jlreq at heading@clearpage{\clearpage\hbox{}\clearpage}}
+ }%
+ }
+ {number}[true,false]{\csname jlreq at number##1\endcsname}
+ }{#3}%
+ \def\jlreq at do{}%
+ \ifx\jlreq at format\@undefined
+ \def\jlreq at format##1##2{##1##2}%
+ \fi
+ \edef\jlreq at formatwlabel{\noexpand\jlreq at format{\expandonce{\jlreq at label@format}}}%
+ \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
+ \eappto\jlreq at do{\expandonce{\jlreq at result}}%
+ \edef\jlreq at do{%
+ \expandonce{\jlreq at do}%
+ \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}[####1]####2{%
+ \ifjlreq at number
+ \unexpanded{\ifnum#2>\c at secnumdepth\else}%
+ \unexpanded{\refstepcounter{#1}}%
+ \noexpand\fi
+ \fi
+ \unexpanded{\jlreq at ifempty{##2}%
+ {\long\gdef\jlreqHeadingText####1{}}%
+ {\long\gdef\jlreqHeadingText####1{####1}}%
+ }%
+ \ifjlreq at number
+ \unexpanded{\jlreq at if{\ifnum#2>\c at secnumdepth\relax\fi}}{%
+ \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+ \expandonce{\jlreq at format{}{##1}}%
+ }{%
+ \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
+ \expandafter\expandonce\expandafter{\jlreq at formatwlabel{##2}}%
+ }%
+ \else
+ \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+ \expandonce{\jlreq at format{}{##1}}%
+ \fi
+ \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{\ifjlreq at number\else -\fi}{\expandonce{\jlreq at label@format}}{####1}%
+ \noexpand\@afterheading
+ \expandonce{\jlreq at heading@clearpage}%
+ \unexpanded{\if at restonecol\twocolumn\fi}%
+ }%
+ \noexpand\def\expandonce{\csname jlreq at TobiraHeading@start at s@#1\endcsname}####1{%
+ \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+ \unexpanded{\jlreq at ifempty{##1}%
+ {\long\gdef\jlreqHeadingText####1{}}%
+ {\long\gdef\jlreqHeadingText####1{####1}}%
+ }%
+ \expandonce{\jlreq at format{}{##1}}
+ \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{*}{\expandonce{\jlreq at label@format}}{####1}%
+ \noexpand\@afterheading
+ \expandonce{\jlreq at heading@clearpage}%
+ \unexpanded{\if at restonecol\twocolumn\fi}%
+ }%
+ \noexpand\def\expandonce{\csname jlreq at headingcs@#1\endcsname}{%
+ % 改丁.これでよいのかな.
+ \unexpanded{\if at twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage[empty]}%
+ \ifx\jlreq at pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq at pagestyle}}\fi
+ \noexpand\secdef{\expandonce{\csname jlreq at TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq at TobiraHeading@start at s@#1\endcsname}}}%
+ \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq at headingcs@#1\endcsname}}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\newcommand{\NewTobiraHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareTobiraHeading{#1}{#2}{#3}}%
+}
+\newcommand{\RenewTobiraHeading}[3]{%
+ \@ifundefined{#1}{\@latex at error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareTobiraHeading{#1}{#2}{#3}}%
+}
+\newcommand{\ProvideTobiraHeading}[3]{%
+ \@ifundefined{#1}{\DeclareTobiraHeading{#1}{#2}{#3}}{}%
+}
+
+%.. 別行見出し
+% \jlreq at BlockHeading@start:別行見出しを出力する命令.
+% \jlreq at BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = カウンタ関連}{5 = フォーマット関連}{6 = 全体フォーマット}*{見出し}[副題]
+% カウンタ関連=-,*,無し:-はカウンタ関連を処理しない.*はさらに目次に追加しない(星付き命令と同様).星付きで呼び出された時は常に*同等.
+% スペース関連={配置:lcr(左中央右)}{字下げ(寸法)}{字上げ(寸法)}{前空き}{後空き}{行取りの行数}{空か*か,偶数ページでも改ページを許可するならば空}
+% 前/後空きはprefixにa:/s:/r:が入る.r:は空きがその値そのものになる.a:/s:は行取りに加えて入る.a:で指定された空きはページ行頭では入らない
+% 後空きの時はs:は指定できない.
+% フォーマット関連:
+% フォーマット関連={{ラベルのみのフォーマット}{ラベルフォーマット}{見出し文字列フォーマット}{見出し文字列フォーマット(ラベル無し)}{副題フォーマット}{副題フォーマット(ラベル無し)}}{{前フォーマットラベルあり}{前フォーマットラベルなし}{見出し全体のフォーマット}{後ろフォーマットラベルあり}{後ろフォーマットラベルなし}}
+% 見出しそのものは「全体フォーマット」に従い出力される.パラメータトークン#1を含み,#1=見出し本体:スペース関連と上の「見出し全体のフォーマット」に基づいて整形される.
+% 見出し全体のフォーマット内では#1=ラベル,#2=見出し文字列,#3=副題,それぞれ各々のフォーマットに基づき整形される.
+% ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題
+% ラベルのみのフォーマットは目次に使われる.
+\newcommand{\jlreq at BlockHeading@start}[6]{%
+ \if at noskipsec\leavevmode\fi
+ % #5と#6は\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる)
+ \edef\jlreq at BlockHeading@start at eachformat{\expandonce{\@firstoftwo#5}}%
+ \edef\jlreq at BlockHeading@start at format{\expandonce{\@secondoftwo#5}}%
+ \edef\jlreq at BlockHeading@start at totalformat{\unexpanded{#6}}%
+ \jlreq at BlockHeading@start@{#1}{#2}{#3}{#4}%
+}
+% {1 = 命令}{2 = レベル}{3 = スペース関連}
+\newcommand{\jlreq at BlockHeading@start@}[4]{%
+ \@ifstar{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq at BlockHeading@start@@{#1}{#2}{#3}{#4}}}%
+}
+% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}[5 = running head]{6 = 見出し}
+\long\def\jlreq at BlockHeading@start@@#1#2#3#4[#5]#6{%
+ \@ifnextchar[{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq at BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}%
+}
+
+% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題]
+\long\def\jlreq at BlockHeading@start@@@#1#2#3#4#5#6[#7]{%
+ \edef\jlreq at do{\unexpanded{\jlreq at BlockHeading@start@@@@{#1}{#2}{#3}}{\expandonce{\jlreq at BlockHeading@start at totalformat}}}%
+ \jlreq at do{#4}{#5}{#6}{#7}%
+}
+
+% {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = 全フォーマット}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題}
+\long\def\jlreq at BlockHeading@start@@@@#1#2#3#4#5#6#7#8{%
+ \edef\jlreq at tempa##1##2##3##4##5##6##7{%
+ \unexpanded{\jlreq at BlockHeading@start at makeoutput{#1}{#2}}{{##1}{##2}{##3}}{\expandonce{\jlreq at BlockHeading@start at eachformat}}{\expandonce{\jlreq at BlockHeading@start at format}}\unexpanded{{#5}{#6}{#7}{#8}}%
+ \unexpanded{\def\jlreq at tempb}{{##4}{##5}{##6}}% 縦方向空き
+ \noexpand\jlreq at ifempty{##7}{\noexpand\jlreq at tempatrue}{\noexpand\jlreq at tempafalse}% 偶数ページのみで改ページするならば\jlreq at tempatrue
+ }%
+ \jlreq at tempa#3%
+ \global\advance\jlreq at BlockHeading@spaces at current@count by 1
+ \gappto\jlreq at BlockHeading@spaces at current@sequence{_#1}%
+ % 連続する見出しの間の処理をするために,即時では出力せず,いったんマクロに格納する.
+ % \jlreq at BlockHeading@spaces at current@before@<n>
+ % \jlreq at BlockHeading@start at gyodori\jlreq at BlockHeading@spaces at current@space@<n>{jlreq at BlockHeading@spaces at current@output@<n>}
+ % ↑\jlreq at BlockHeading@spaces at current@format@<n>で整形される.
+ % \jlreq at BlockHeading@spaces at current@after@<n>
+ % として後に呼び出される.(spaceは書き換えられる可能性がある.)
+ \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@output@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
+ \expandonce{\jlreq at resultb}%
+ }%
+ \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@space@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
+ \expandonce{\jlreq at tempb}%
+ }%
+ \def\@tempa##1##2##3{##1}%
+ \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
+ \noexpand\allowbreak
+ \expandonce{\@tempa#4}%
+ \expandonce{\jlreq at resulta}%
+ \ifjlreq at tempa\unexpanded{%
+ \jlreq at setcurrentpage
+ \edef\jlreq at BlockHeading@currentpage{\the\jlreq at currentpage}%
+ }\fi
+ }%
+ \def\@tempa##1##2##3{##2}%
+ \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@format@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
+ \expandonce{\@tempa#4}%
+ }%
+ \def\@tempa##1##2##3{##3}%
+ \expandafter\xdef\csname jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count\endcsname{%
+ \expandonce{\jlreq at resultc}%
+ \ifjlreq at tempa\unexpanded{%
+ \ifx\jlreq at BlockHeading@currentpage\@empty\nobreak\else
+ \ifodd\jlreq at BlockHeading@currentpage\nobreak\else\allowbreak\fi
+ \fi
+ }\else\noexpand\nobreak\fi
+ \expandonce{\@tempa#4}%
+ }%
+ \ifx\jlreq at BlockHeading@spaces at headingslist\@empty
+ \expandafter\jlreq at BlockHeading@spaces at outputwospace
+ \expandafter\ignorespaces
+ \else
+ \expandafter\jlreq at BlockHeading@start at afterheading
+ \fi
+}
+
+\def\jlreq at BlockHeading@start at afterheading{\futurelet\jlreq at nextchar\jlreq at BlockHeading@start at afterheading@}
+\edef\jlreq at BlockHeading@start at afterheading@{%
+ \noexpand\ifx\expandonce{\space}\unexpanded{\jlreq at nextchar\expandafter\jlreq at BlockHeading@start at afterheading@@}%
+ \unexpanded{\else\expandafter\jlreq at BlockHeading@start at afterheading@@@\fi}%
+}
+% スペースを読み飛ばす
+\expandafter\def\expandafter\jlreq at BlockHeading@start at afterheading@@\space{\jlreq at BlockHeading@start at afterheading}
+\def\jlreq at BlockHeading@start at afterheading@@@{%
+ \def\jlreq at do{\jlreq at BlockHeading@spaces at output}%
+ \@for\@tempa:=\jlreq at BlockHeading@allheadings\do{%
+ \expandafter\ifx\csname\@tempa\endcsname\jlreq at nextchar\def\jlreq at do{}\fi
+ }%
+ % \jlreq at BlockHeading@HeadingSpaces at ignoretokens内のものは特別扱いする
+ \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\jlreq at BlockHeading@HeadingSpaces at ignoretokens\do{%
+ \expandafter\ifx\@tempa\jlreq at nextchar
+ \def\jlreq at do{\jlreq at BlockHeading@start at afterheading@saveafter at cs}%
+ \fi
+ }%
+ \jlreq at do
+}
+
+% コントロールシークエンスを保存
+\long\def\jlreq at BlockHeading@start at afterheading@saveafter at cs#1{%
+ \csgappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{#1}%
+ \jlreq at BlockHeading@start at afterheading@saveafter at option
+}
+% オプションがあれば保存
+\def\jlreq at BlockHeading@start at afterheading@saveafter at option{%
+ \@ifnextchar[{\jlreq at BlockHeading@start at afterheading@saveafter at option@}{\jlreq at BlockHeading@start at afterheading@saveafter at arguments}%
+}
+\long\def\jlreq at BlockHeading@start at afterheading@saveafter at option@[#1]{%
+ \csxappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{\unexpanded{[#1]}}%
+ \jlreq at BlockHeading@start at afterheading@saveafter at arguments
+}
+% 引数を保存し続けるループ
+\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments{%
+ \futurelet\jlreq at nextchar\jlreq at BlockHeading@start at afterheading@saveafter at arguments@
+}
+\edef\jlreq at BlockHeading@start at afterheading@saveafter at arguments@{%
+ \noexpand\ifx\space\unexpanded{\jlreq at nextchar\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@\else\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@\fi}%
+}
+\expandafter\def\expandafter\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@\space{%
+ \csgappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{ }%
+ \jlreq at BlockHeading@start at afterheading@saveafter at arguments
+}
+\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@{%
+ \jlreq at ifnextchar\bgroup{\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@@}{\jlreq at BlockHeading@start at afterheading}%
+}
+\long\def\jlreq at BlockHeading@start at afterheading@saveafter at arguments@@@@#1{%
+ \csxappto{jlreq at BlockHeading@spaces at current@after@\the\jlreq at BlockHeading@spaces at current@count}{\unexpanded{{#1}}}%
+ \jlreq at BlockHeading@start at afterheading@saveafter at arguments
+}
+
+% 特別扱いしたいマクロを並べる
+\def\jlreq at BlockHeading@HeadingSpaces at ignoretokens{\label}
+
+% \jlreq at resulta -> before, \jlreq at resultb -> 本体,\jlreq at resultc -> after
+% {1 = 命令}{2 = レベル}{3 = スペース関連(横方向のみ)}{4 = フォーマット群}{5 = まとめたフォーマット群}{6 = *}{7 = running head}{8 = 見出し}{9 = 副題}
+\long\def\jlreq at BlockHeading@start at makeoutput#1#2#3#4#5#6#7#8#9{%
+ \begingroup
+ % ラベルがありか否か.\jlreq at tempc = \@emptyならばラベルあり
+ \ifnum #2>\c at secnumdepth
+ \def\jlreq at tempc{*}%
+ \else
+ \def\jlreq at tempc{#6}%
+ \fi
+ \edef\jlreq at tempa{\expandafter\jlreq at BlockHeading@start at geteachformat\expandafter{\jlreq at tempc}#4}% {ラベルフォーマット}{本文フォーマット}{副題フォーマット}
+ \edef\jlreq at tempb{\expandafter\jlreq at BlockHeading@start at getformat\expandafter{\jlreq at tempc}#5}% {まとめるフォーマット}
+ \edef\jlreq at do{\noexpand\jlreq at BlockHeading@start at makeoutput@@\expandonce{\jlreq at tempa}\expandonce{\jlreq at tempb}\unexpanded{{#8}{#9}}}%
+ \jlreq at do
+ \edef\jlreq at do{\noexpand\jlreq at BlockHeading@start at makeoutput@\unexpanded{#3}{\expandonce{\jlreq at result}}}%
+ \jlreq at do
+ % \jlreq at tempa -> 素のラベルフォーマット
+ \edef\jlreq at tempa{\jlreq at BlockHeading@start at getonlylabelformat#4}%
+ \edef\jlreq at do{%
+ \unexpanded{\def\jlreq at resulta}{%
+ \ifx\jlreq at tempc\@empty
+ \unexpanded{\long\gdef\jlreqHeadingLabel####1{####1}}%
+ \unexpanded{\refstepcounter{#1}}%
+ \else
+ \unexpanded{\long\gdef\jlreqHeadingLabel####1{}}%
+ \fi
+ \jlreq at ifempty{#8}%
+ {\unexpanded{\long\gdef\jlreqHeadingText####1{}}}%
+ {\unexpanded{\long\gdef\jlreqHeadingText####1{####1}}}%
+ \jlreq at ifempty{#9}%
+ {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{}}}%
+ {\unexpanded{\long\gdef\jlreqHeadingSubtitle####1{####1}}}%
+ }%
+ \unexpanded{\def\jlreq at resultb}{%
+ \expandonce{\jlreq at result}%
+ }%
+ \unexpanded{\def\jlreq at resultc}{%
+ \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{\unexpanded{#6}}{\expandonce{\jlreq at tempa}}{\unexpanded{#7}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+% {ラベルフォーマット}{本文フォーマット}{副題フォーマット}に展開される.
+% {1 = 空ならばラベルあり}{2 = ラベルのみのフォーマット}{3 = ラベルフォーマット}{4 = 見出し文字列フォーマット}{5 = 見出し文字列フォーマット(ラベル無し)}{6 = 副題フォーマット}{7 = 副題フォーマット(ラベル無し)}
+\long\def\jlreq at BlockHeading@start at geteachformat#1#2#3#4#5#6#7{%
+ \jlreq at ifempty{#1}{\unexpanded{{#3}{#4}{#6}}}{\unexpanded{{}{#5}{#7}}}%
+}
+% {全体フォーマット}に展開される.
+% {1 = 空ならばラベルあり}{2 = 前フォーマットラベルあり}{3 = 前フォーマットラベルなし}{4 = 見出し全体のフォーマット}{5 = 後ろフォーマットラベルあり}{6 = 後ろフォーマットラベルなし}
+\long\def\jlreq at BlockHeading@start at getformat#1#2#3#4#5#6{%
+ \jlreq at ifempty{#1}{{\unexpanded{#2#4#6}}}{{\unexpanded{#3#4#6}}}%
+}
+\long\def\jlreq at BlockHeading@start at getonlylabelformat#1#2#3#4#5#6{\unexpanded{#1}}%
+
+% 横方向の空き調整を入れて,\jlreq at resultに返す.
+% {1 = 配置(clr)}{2 = 字下げ}{3 = 字上げ}{4 = 出力}
+\long\def\jlreq at BlockHeading@start at makeoutput@#1#2#3#4{%
+ \edef\jlreq at result{%
+ \noexpand\noindent
+ \jlreq at ifempty{#2}{}{\unexpanded{\hskip #2}}%
+ \noexpand\vbox{%
+ \noexpand\noindent
+ \ifx#1c\noexpand\centering\fi
+ \ifx#1r\noexpand\raggedleft\fi
+ \jlreq at ifempty{#2}{}{\unexpanded{\hsize=\dimexpr\hsize - #2\relax}}%
+ \jlreq at ifempty{#3}{}{\unexpanded{\hsize=\dimexpr\hsize - #3\relax}}%
+ \unexpanded{#4}%
+ }%
+ }%
+}
+
+% {1 = ラベルフォーマット}{2 = 見出し文字列フォーマット}{3 = 副題フォーマット}{4 = 全体フォーマット}{5 = 見出し}{6 = 副題}
+% \jlreq at resultに出力対象を入れる
+\long\def\jlreq at BlockHeading@start at makeoutput@@#1#2#3#4#5#6{%
+ \begingroup
+ \long\def\jlreq at tempa##1{#2}% 見出し文字列
+ \expandafter\def\expandafter\jlreq at tempa\expandafter{\jlreq at tempa{#5}}%
+ \jlreq at ifempty{#6}{%
+ \def\jlreq at tempb{}%
+ }{%
+ \long\def\jlreq at tempb##1{#3}% 副題
+ \expandafter\def\expandafter\jlreq at tempb\expandafter{\jlreq at tempb{#6}}%
+ }%
+ \long\def\jlreq at tempc##1##2##3{#4}% 全体のフォーマット
+ % 二度展開すると欲しいものが得られる
+ \edef\jlreq at tempa{\noexpand\jlreq at tempc{\unexpanded{#1}}{\expandonce{\jlreq at tempa}}{\expandonce{\jlreq at tempb}}}%
+ \edef\jlreq at do{%
+ \unexpanded{\def\jlreq at result}{\expandafter\expandonce\expandafter{\jlreq at tempa}}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\def\jlreq at BlockHeading@start at removecolumn#1:{#1}
+
+% 空き指定を解釈する.a:10pt -> \jlreq at resulta=a,\jlreq at resultb=10pt
+\def\jlreq at BlockHeading@start at analyzespace#1:#2\jlreq at endmark{%
+ \jlreq at ifempty{#1}{%
+ \def\jlreq at resulta{}%
+ \def\jlreq at resultb{}%
+ }{%
+ \let\jlreq at resulta=#1%
+ \edef\jlreq at resultb{\expandonce{\jlreq at BlockHeading@start at removecolumn#2}}%
+ }%
+}
+
+% 行取り処理.#3が空の時は行取りの処理はしない.(空白挿入は行う.)
+% {1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}{4 = 出力}
+% 最後には\nobreak(と\vskip)が入っている
+\long\def\jlreq at BlockHeading@start at gyodori#1#2#3#4{\par{%
+ \setbox\jlreq at tempboxa=\vbox{#4}%
+ % \jlreq at tempskip(a/b)に前/後ろに入れるべき値を入れる
+ % #1がa:ならばその値は\jlreq at tempskipaには足さず\jlreq at tempskipcに入れておく
+ \jlreq at tempskipa=0pt
+ \jlreq at tempskipb=0pt
+ \jlreq at tempskipc=0pt
+ \jlreq at BlockHeading@start at analyzespace#1:\jlreq at endmark
+ \let\jlreq at maeakitype=\jlreq at resulta
+ \let\jlreq at maeaki=\jlreq at resultb
+ \jlreq at BlockHeading@start at analyzespace#2:\jlreq at endmark
+ \let\jlreq at ushiroakitype=\jlreq at resulta
+ \let\jlreq at ushiroaki=\jlreq at resultb
+ \def\jlreq at lines{#3}%
+ % 両方強制指定の場合は行数を無視する.
+ \ifx r\jlreq at maeakitype\ifx r\jlreq at ushiroakitype\def\jlreq at lines{}\fi\fi
+ \setbox\jlreq at tempboxb=\hbox{阿}%
+ \ifx\jlreq at lines\@empty
+ \ifx\jlreq at maeaki\@empty\else
+ \ifx a\jlreq at maeakitype
+ \jlreq at tempskipc=\glueexpr\jlreq at maeaki\relax
+ \else
+ \jlreq at tempskipa=\glueexpr\jlreq at maeaki\relax
+ \fi
+ \fi
+ \ifx\jlreq at ushiroaki\@empty\else
+ \jlreq at tempskipb=\glueexpr\jlreq at ushiroaki\relax
+ \fi
+ \else
+ % 行取り時の前後の空きを足した値を\jlreq at tempdimaに入れる
+ \jlreq at tempdima=\glueexpr(#3\baselineskip - \baselineskip - \ht\jlreq at tempboxa - \dp\jlreq at tempboxa)\relax
+ \ifx\jlreq at maeakitype\@empty
+ \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2\relax
+ \else
+ \ifx a\jlreq at maeakitype
+ \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2\relax
+ \jlreq at tempskipc=\glueexpr\jlreq at maeaki\relax
+ \fi
+ \ifx s\jlreq at maeakitype
+ \jlreq at tempskipa=\glueexpr(\jlreq at tempdima + \dp\jlreq at tempboxb - \ht\jlreq at tempboxb)/2 + \jlreq at maeaki\relax
+ \jlreq at tempdima=\dimexpr\jlreq at tempdima + \jlreq at maeaki\relax
+ \fi
+ \ifx r\jlreq at maeakitype
+ \jlreq at tempskipa=\glueexpr\jlreq at maeaki\relax
+ \jlreq at tempdima=\dimexpr\jlreq at tempdima + \baselineskip - \dp\jlreq at tempboxb\relax
+ \fi
+ \fi
+ \ifx\jlreq at ushiroakitype\@empty
+ \jlreq at tempskipb=\glueexpr\jlreq at tempdima - \jlreq at tempskipa\relax
+ \else
+ \ifx a\jlreq at ushiroakitype
+ \jlreq at tempskipb=\glueexpr\jlreq at tempdima - \jlreq at tempskipa + \jlreq at ushiroaki\relax
+ \fi
+ \ifx r\jlreq at ushiroakitype
+ \jlreq at tempskipb=\glueexpr\jlreq at ushiroaki\relax
+ \jlreq at tempskipa=\glueexpr\jlreq at tempdima - \jlreq at tempskipb + \baselineskip - \ht\jlreq at tempboxb\relax
+ \fi
+ \fi
+ % \jlreq at tempdimaの利用ここまで
+ \fi
+ \jlreq at ifgluezero\jlreq at tempskipc{}{\vskip\jlreq at tempskipc\relax}%
+ \ifx r\jlreq at maeakitype\prevdepth=-1000pt\fi
+ % \jlreq at tempdimb, \jlreq at tempdimcに出力対称の高さを深さを代入
+ \jlreq at tempdimb=\ht\jlreq at tempboxa
+ \jlreq at tempdimc=\dp\jlreq at tempboxa
+ \setbox\jlreq at tempboxa=\vbox{%
+ \jlreq at ifgluezero\jlreq at tempskipa{}{\vskip\jlreq at tempskipa}%
+ \unvbox\jlreq at tempboxa
+ }%
+ \ifx\jlreq at lines\@empty
+ \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa - \jlreq at tempdimb\relax
+ \ht\jlreq at tempboxa=\jlreq at tempdimb
+ \box\jlreq at tempboxa
+ \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt \else\prevdepth=\jlreq at tempdimc\fi
+ % \jlreq at tempdimb, \jlreq at tempdimcの利用ここまで
+ \else
+ \dp\jlreq at tempboxa=\dimexpr\dp\jlreq at tempboxa + \ht\jlreq at tempboxa\relax
+ \ht\jlreq at tempboxa=0pt
+ \box\jlreq at tempboxa
+ \ifx r\jlreq at ushiroakitype\prevdepth=-1000pt \else\prevdepth=0pt \fi
+ \fi
+ \nobreak
+ \jlreq at ifgluezero\jlreq at tempskipb{}{\vskip\jlreq at tempskipb}%
+ \edef\jlreq at do{%
+ \ifdim\parskip=0pt \else
+ \unexpanded{\def\jlreq at parhook@gyodori}{%
+ \noexpand\parskip=\the\parskip
+ \unexpanded{\def\jlreq at parhook@gyodori{}}%
+ }%
+ \unexpanded{\parskip=0pt plus 1pt}%
+ \fi
+ }%
+ \expandafter}\jlreq at do
+}
+\PushPostHook{par}{\jlreq at parhook@gyodori}
+\def\jlreq at parhook@gyodori{}
+
+% 行取り情報をゲットだぜ
+% \jlreq at resultに{1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}を入れる
+% #2#3#4はそれぞれ前空き,後ろ開き,トータル行数のデフォルト値
+% *つきは\setkeys*を使う.[]はkeyvalのファミリー.
+\def\jlreq at BlockHeading@gyodori at parsekeyval{%
+ \@ifstar{\jlreq at BlockHeading@gyodori at parsekeyval@{*}}{\jlreq at BlockHeading@gyodori at parsekeyval@{}}%
+}
+\def\jlreq at BlockHeading@gyodori at parsekeyval@#1{%
+ \@ifnextchar[{\jlreq at BlockHeading@gyodori at parsekeyval@@{#1}}{\jlreq at BlockHeading@gyodori at parsekeyval@@{#1}[jlreq at key]}%
+}
+\long\def\jlreq at BlockHeading@gyodori at parsekeyval@@#1[#2]#3#4#5#6{%
+ \begingroup
+ \def\jlreq at lines{#6}%
+ \def\jlreq at before@space{}%
+ \def\jlreq at before@lines{}%
+ \def\jlreq at after@space{}%
+ \def\jlreq at after@lines{}%
+ \jlreq at parsekeyval#1[#2]{
+ {lines}{\def\jlreq at lines{##1}}
+ {before_space}{\def\jlreq at before@space{##1}}
+ {after_space}{\def\jlreq at after@space{##1}}
+ {before_lines}{%
+ \jlreq at ifempty{##1}{\def\jlreq at before@lines{}}{%
+ \jlreq at iffirsttoken@ignorespaces{##1}{*}%
+ {\edef\jlreq at before@lines{s:\expandonce{\@gobble ##1}}}%
+ {\def\jlreq at before@lines{a:##1}}%
+ }%
+ }
+ {after_lines}{\def\jlreq at after@lines{##1}}
+ }{#3}%
+ % before/after_lines優先
+ \ifx\jlreq at before@space\@empty\else\edef\jlreq at before@space{r:\expandonce{\jlreq at before@space}}\fi
+ \ifx\jlreq at before@lines\@empty\else\edef\jlreq at before@space{\expandonce{\jlreq at before@lines}\baselineskip}\fi
+ \ifx\jlreq at before@space\@empty\def\jlreq at before@space{#4}\fi
+ \ifx\jlreq at after@space\@empty\else\edef\jlreq at after@space{r:\expandonce{\jlreq at after@space}}\fi
+ \ifx\jlreq at after@lines\@empty\else\edef\jlreq at after@space{a:\expandonce{\jlreq at after@lines}\baselineskip}\fi
+ \ifx\jlreq at after@space\@empty\def\jlreq at after@space{#5}\fi
+ \edef\jlreq at do{%
+ \unexpanded{\def\jlreq at result}{{\expandonce{\jlreq at before@space}}{\expandonce{\jlreq at after@space}}{\expandonce{\jlreq at lines}}}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\newbox\jlreq at BlockHeading@start at label@box
+% \DeclareBlockHeading{命令名}{レベル}{設定}
+\def\jlreq at BlockHeading@allheadings{}% 別行見出し一覧
+\newcommand{\DeclareBlockHeading}[3]{%
+ \def\jlreq at do{\@removeelement{#1}}%
+ \expandafter\jlreq at do\expandafter{\jlreq at heading@allheadings}{\jlreq at heading@allheadings}%
+ \appto\jlreq at heading@allheadings{,#1}%
+ \expandafter\jlreq at do\expandafter{\jlreq at BlockHeading@allheadings}{\jlreq at BlockHeading@allheadings}%
+ \appto\jlreq at BlockHeading@allheadings{,#1}%
+ \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
+ \expandafter\edef\csname jlreq at heading@setting@#1\endcsname{\unexpanded{#3}}%
+ \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewBlockHeading}%
+ \@ifundefined{c@#1}{\newcounter{#1}}{}%
+ \@ifundefined{#1mark}{\expandafter\let\csname #1mark\endcsname\@gobble}{}%
+ \jlreq at heading@make at maketoc{#1}{#2}%
+ \begingroup
+ \def\jlreq at font{}%
+ \def\jlreq at subtitle@font{}%
+ \def\jlreq at indent{0\zw}%
+ \def\jlreq at end@indent{0\zw}%
+ \def\jlreq at align{l}%
+ \edef\jlreq at format{\unexpanded{##1##2##3}}%
+ \edef\jlreq at heading@text at format{\unexpanded{##1}}%
+ \def\jlreq at pagebreak{}%
+ \def\jlreq at label@format{\@seccntformat{#1}}%
+ \newif\ifjlreq at second@text at indent@withlabel\jlreq at second@text at indent@withlabeltrue
+ \def\jlreq at after@label at space{1\zw}%
+ \def\jlreq at second@heading at text@indent at wlabel{0pt}%
+ \def\jlreq at second@heading at text@indent at wolabel{0pt}%
+ \edef\jlreq at subtitle@format{\unexpanded{---##1---}}%
+ \newif\ifjlreq at subtitleindent@withlabel\jlreq at subtitleindent@withlabeltrue
+ \def\jlreq at subtitle@indent{1\zw}%
+ \def\jlreq at afterindent{\@afterindenttrue}%
+ \def\jlreq at allowbreak@evenpage{*}% 偶数ページでも改ページを許可するならば空,そうでないなら*
+ \newif\ifjlreq at subtitle@break\jlreq at subtitle@breaktrue
+ \def\jlreq at subtitle@indent{1\zw}%
+ \def\jlreq at column@spanning{false}%
+ \newif\ifjlreq at column@spanning at possible\jlreq at column@spanning at possiblefalse
+ \newif\ifjlreq at number \jlreq at numbertrue
+ % a,bみたいなのをaとbにわける.カンマがなければbは空.引数を{a}{b}として##2を呼び出す.
+ \def\jlreq at parsecomma##1##2{%
+ \jlreq at helper@dividebycomma{##1}%
+ \jlreq at if{\ifjlreq at result\fi}{%
+ \edef\jlreq at do{\noexpand\jlreq at tempa{\expandonce{\jlreq at resulta}}{\expandonce{\jlreq at resultb}}}%
+ }{%
+ \edef\jlreq at do{\noexpand\jlreq at tempa{##1}{}}%
+ }%
+ \def\jlreq at tempa####1####2{##2}%
+ \jlreq at do
+ }%
+ \jlreq at parsekeyval[BlockHeading:#1]{
+ {lines}{}
+ {before_space}{}
+ {after_space}{}
+ {before_lines}{}
+ {after_lines}{}
+ {font}{\def\jlreq at font{##1}}
+ {subtitle_font}{\def\jlreq at subtitle@font{##1}}
+ {indent}{\def\jlreq at indent{##1}}
+ {end_indent}{\def\jlreq at end@indent{##1}}
+ {align}[left,center,right]{%
+ \jlreq at switch{##1}{
+ {left}{\def\jlreq at align{l}}
+ {center}{\def\jlreq at align{c}}
+ {right}{\def\jlreq at align{r}}
+ }%
+ }
+ {format}{\edef\jlreq at format{\unexpanded{##1}}}
+ {after_label_space}{\def\jlreq at after@label at space{##1}}
+ {second_heading_text_indent,heading_text_second_indent}{%
+ \jlreq at parsecomma{##1}{%
+ \jlreq at iffirsttoken{####1}{*}{%
+ \jlreq at second@text at indent@withlabelfalse
+ \edef\jlreq at second@heading at text@indent at wlabel{\expandonce{\@gobble ####1}}%
+ }{%
+ \jlreq at second@text at indent@withlabeltrue
+ \def\jlreq at second@heading at text@indent at wlabel{####1}%
+ }%
+ \jlreq at ifempty{####2}{%
+ \let\jlreq at second@heading at text@indent at wolabel=\jlreq at second@heading at text@indent at wlabel
+ }{%
+ \def\jlreq at second@heading at text@indent at wolabel{####2}%
+ }%
+ }%
+ }
+ {label_format}{\edef\jlreq at label@format{\unexpanded{##1}}}
+ {subtitle_format}{\edef\jlreq at subtitle@format{\unexpanded{##1}}}
+ {subtitle_indent}{%
+ \jlreq at iffirsttoken{##1}{*}{%
+ \jlreq at subtitleindent@withlabelfalse
+ \edef\jlreq at subtitle@indent{\expandonce{\@gobble ##1}}%
+ }{%
+ \jlreq at subtitleindent@withlabeltrue
+ \def\jlreq at subtitle@indent{##1}%
+ }%
+ }
+ {subtitle_break}[true,false]{\csname jlreq at subtitle@break##1\endcsname}
+ {afterindent}[true,false]{\edef\jlreq at afterindent{\expandonce{\csname @afterindent##1\endcsname}}}
+ {allowbreak_if_evenpage}[true,false]{%
+ \jlreq at switch{##1}{
+ {true}{\def\jlreq at allowbreak@evenpage{}}
+ {false}{\def\jlreq at allowbreak@evenpage{*}}
+ }%
+ }
+ {pagebreak}[clearpage,cleardoublepage,clearcolumn,nariyuki,begin_with_odd_page,begin_with_even_page]{%
+ \jlreq at switch{##1}{
+ {clearpage}{\def\jlreq at pagebreak{\clearpage}\jlreq at column@spanning at possibletrue}
+ {cleardoublepage}{\def\jlreq at pagebreak{\cleardoublepage}\jlreq at column@spanning at possibletrue}
+ {clearcolumn}{\if at twocolumn\def\jlreq at pagebreak{\newpage}\else\def\jlreq at pagebreak{}\fi\jlreq at column@spanning at possiblefalse}
+ {begin_with_even_page}{\def\jlreq at pagebreak{\cleartoevenpage[empty]}\jlreq at column@spanning at possibletrue}
+ {begin_with_odd_page}{\def\jlreq at pagebreak{\cleartooddpage[empty]}\jlreq at column@spanning at possibletrue}
+ {nariyuki}{\def\jlreq at pagebreak{}\jlreq at column@spanning at possiblefalse}
+ }%
+ }
+ % 後々数字を受け付けるようになったりするかもしれないので……
+ {column_spanning}{%
+ \jlreq at tempatrue % validな入力に対してfalse
+ \jlreq at ifempty{##1}{}{%
+ \jlreq at ifnumber{##1}{% 数字の時はtrueに回す
+ \jlreq at tempafalse
+ \def\jlreq at column@spanning{true}%
+ }{%
+ \jlreq at switch{##1}{%
+ {true}{\jlreq at tempafalse\def\jlreq at column@spanning{true}}
+ {false}{\jlreq at tempafalse\def\jlreq at column@spanning{false}}
+ }%
+ }%
+ }%
+ \ifjlreq at tempa\ClassWarningNoLine{jlreq}{Invalid input `##1' for column_spanning in BlockHeading #1}\fi
+ }
+ {number}[true,false]{\csname jlreq at number##1\endcsname}
+ }{#3}%
+ \def\jlreq at do{}% 初期化.これに最終処理を入れていく.
+ % 入力チェック
+ \ifthenelse{\equal{\jlreq at column@spanning}{true}}{%
+ \ifjlreq at column@spanning at possible\else
+ \ClassWarningNoLine{jlreq}{column_spanning can be used only with `pagebreak=nariyuki' or `pagebreak=clearcolumn' (in BlockHeading #1)}%
+ \def\jlreq at column@spanning{false}%
+ \fi
+ }{}%
+ % ラベルありフォーマット:前
+ \edef\jlreq at pre@format at wlabel{%
+ \noexpand\noindent
+ \expandonce{\jlreq at font}%
+ \ifnum 0\ifjlreq at second@text at indent@withlabel 1\fi\ifjlreq at subtitleindent@withlabel 1\fi>0
+ \unexpanded{\setbox\jlreq at BlockHeading@start at label@box=\hbox}{\expandonce{\jlreq at label@format}}%
+ \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{\the\wd\jlreq at BlockHeading@start at label@box}}%
+ \unexpanded{\def\jlreq at BlockHeading@start at outputlabel{\box\jlreq at BlockHeading@start at label@box}}%
+ \else
+ \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{0pt}}%
+ \unexpanded{\def\jlreq at BlockHeading@start at outputlabel}{\expandonce{\jlreq at label@format}}%
+ \fi
+ }%
+ % ラベルなしフォーマット:前
+ \edef\jlreq at pre@format at wolabel{%
+ \noexpand\noindent
+ \expandonce{\jlreq at font}%
+ \unexpanded{\xdef\jlreq at BlockHeading@start at labellength{0pt}}%
+ \unexpanded{\def\jlreq at BlockHeading@start at outputlabel}{}%
+ }%
+ % 空き量などの調整を含んだラベル
+ \edef\jlreq at label@format at modified{%
+ \noexpand\jlreq at BlockHeading@start at outputlabel
+ \unexpanded{\inhibitglue\hbox{}}%
+ \ifdim\dimexpr\jlreq at after@label at space\relax=0pt \else
+ \noexpand\hspace*{\noexpand\dimexpr\expandonce{\jlreq at after@label at space}\noexpand\relax}%
+ \fi
+ }%
+ \edef\jlreq at heading@text at format@wlabel{%
+ \ifnum 0\ifdim\jlreq at second@heading at text@indent at wlabel=0pt \else 1\fi\ifjlreq at second@text at indent@withlabel 1\fi>0
+ \unexpanded{\hangindent=\glueexpr}(\expandonce{\jlreq at second@heading at text@indent at wlabel})%
+ \ifjlreq at second@text at indent@withlabel + (\expandonce{\jlreq at after@label at space}) + \unexpanded{\jlreq at BlockHeading@start at labellength}\fi
+ \noexpand\relax
+ \fi
+ \expandonce{\jlreq at heading@text at format}%
+ }%
+ \edef\jlreq at heading@text at format@wolabel{%
+ \ifdim\dimexpr\jlreq at second@heading at text@indent at wolabel\relax=0pt \else
+ \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at second@heading at text@indent at wolabel}\noexpand\relax
+ \fi
+ \expandonce{\jlreq at heading@text at format}%
+ }%
+ % 副題:ラベルありかなしかはhangindentの扱いだけなので,他はまとめる
+ \def\jlreq at make@subtitle at format##1##2{%
+ \edef##1{%
+ \ifjlreq at subtitle@break
+ \noexpand\par
+ ##2%
+ \unexpanded{\nobreak\noindent}%
+ \else
+ \ifdim\jlreq at subtitle@indent=0pt \else
+ \noexpand\hspace*{\expandonce{\jlreq at subtitle@indent}}%
+ \fi
+ \fi
+ {\expandonce{\jlreq at subtitle@font}\expandonce{\jlreq at subtitle@format}}%
+ }%
+ }%
+ \jlreq at make@subtitle at format\jlreq at subtitle@format at wlabel{%
+ \ifjlreq at subtitleindent@withlabel
+ \noexpand\hangafter=0
+ \unexpanded{\hangindent=\dimexpr}\noexpand\jlreq at BlockHeading@start at labellength + (\expandonce{\jlreq at after@label at space}) + (\expandonce{\jlreq at subtitle@indent})\noexpand\relax
+ \else
+ \ifdim\jlreq at subtitle@indent=0pt \else
+ \noexpand\hangafter=0
+ \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at subtitle@indent}\noexpand\relax
+ \fi
+ \fi
+ }%
+ \jlreq at make@subtitle at format\jlreq at subtitle@format at wolabel{%
+ \ifdim\jlreq at subtitle@indent=0pt \else
+ \noexpand\hangafter=0
+ \unexpanded{\hangindent=\dimexpr}\expandonce{\jlreq at subtitle@indent}\noexpand\relax
+ \fi
+ }%
+ \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
+ \eappto\jlreq at do{\expandonce{\jlreq at result}}%
+ \jlreq at BlockHeading@gyodori at parsekeyval*[BlockHeading:#1]{#3}{}{}{1}%
+ \let\jlreq at spaceset=\jlreq at result
+ \edef\jlreq at totalformat{\unexpanded{##1}}%
+ \edef\jlreq at totalformat@after{\expandonce{\jlreq at afterindent}\noexpand\@afterheading}%
+ \if at twocolumn
+ \ifthenelse{\equal{\jlreq at column@spanning}{true}}{%
+ \def\@tempa##1##2##3{%
+ % 前開きが常に入ってしまうので,a:の時は除去する
+ \jlreq at iffirsttoken{##1}{a}{\def\jlreq at spaceset{{}{##2}{##3}}}{}%
+ \edef\jlreq at totalformat{%
+ \unexpanded{\jlreq at if{\if at twocolumn\fi}}{%
+ \noexpand\twocolumn[{%
+ % 普段自動で入る\topskipと\baselineskipを手動で入れる
+ \jlreq at iffirsttoken{##1}{r}{}{\unexpanded{\vskip\topskip\relax}}%
+ \unexpanded{####1}%
+ \jlreq at iffirsttoken{##2}{r}{}{\unexpanded{\vskip\glueexpr\baselineskip - \topskip\relax}}%
+ }]%
+ }{%
+ \expandonce{\jlreq at totalformat}
+ }%
+ }%
+ }%
+ \expandafter\@tempa\jlreq at spaceset
+ \def\jlreq at totalformat@after{}%
+ }{%
+ }%
+ \fi
+ \edef\jlreq at do{%
+ \expandonce{\jlreq at do}%
+ \noexpand\edef\expandonce{\csname jlreq at headingcs@#1\endcsname}{\noexpand\unexpanded{%
+ \noexpand\jlreq at hook@beforeheadings{#1}%
+ \expandonce{\jlreq at pagebreak}%
+ \unexpanded{\jlreq at BlockHeading@start{#1}{#2}}%
+ {{\expandonce{\jlreq at align}}{\expandonce{\jlreq at indent}}{\expandonce{\jlreq at end@indent}}\expandonce{\jlreq at spaceset}{\expandonce{\jlreq at allowbreak@evenpage}}}%
+ {\ifjlreq at number\else -\fi}%
+ {%
+ {%
+ {\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at label@format at modified}}%
+ {\expandonce{\jlreq at heading@text at format@wlabel}}{\expandonce{\jlreq at heading@text at format@wolabel}}%
+ {\expandonce{\jlreq at subtitle@format at wlabel}}{\expandonce{\jlreq at subtitle@format at wolabel}}%
+ }%
+ {%
+ {\expandonce{\jlreq at pre@format at wlabel}}{\expandonce{\jlreq at pre@format at wolabel}}%
+ {\expandonce{\jlreq at format}}%
+ {}{}%
+ }%
+ }%
+ {{}{\expandonce{\jlreq at totalformat}}{\expandonce{\jlreq at totalformat@after}}}%
+ }}%
+ \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq at headingcs@#1\endcsname}}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\newcommand{\NewBlockHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareBlockHeading{#1}{#2}{#3}}%
+}
+\newcommand{\RenewBlockHeading}[3]{%
+ \@ifundefined{#1}{\@latex at error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareBlockHeading{#1}{#2}{#3}}%
+}
+\newcommand{\ProvideBlockHeading}[3]{%
+ \@ifundefined{#1}{\DeclareBlockHeading{#1}{#2}{#3}}{}%
+}
+
+%.. 別行見出しが連続した場合の処理
+% 設定値保存に次のマクロを使う
+% \jlreq at BlockHeading@spaces at headingslist
+% : スペースを考慮しないとならない見出しのリスト.,_chapter_section_subsection,_section_subsection,...みたいな感じ
+% \jlreq at BlockHeading@spaces at setlist@<見出し名リスト>
+% : 見出し名リストが続いたときの空き関連設定.<見出し名リスト>は_chapter_section_subsectionみたいなやつ.
+% {***}{***}...というリスト.各々の***は次のどれか.
+% 最初:全体への指定.{前空き}{後ろ空き}{行数}
+% _{前空き}{後ろ空き}{行数}:見出しに対する指定.先頭が_*の場合は,デフォルト設定をロードしてからということ.
+% それ以外:空き量
+% 最初や最後に空き量指定がある場合は,全体への指定に組み込むことにする.
+%
+% 現在状況保存に以下のマクロを使う
+% \jlreq at BlockHeading@spaces at current@sequence
+% : 現在どのような見出しが続いているかリスト.
+% \jlreq at BlockHeading@spaces at current@space@<n>
+% : 現在処理中のn番目の見出しに対する空き情報.{前空き}{後ろ空き}{トータル行数}{偶数ページbreak情報}.n=1から始まる.
+% \jlreq at BlockHeading@spaces at current@output@<n>
+% : 現在処理中のn番目の見出しの中身.
+% \jlreq at BlockHeading@spaces at current@format@<n>
+% : 現在処理中のn番目の見出しのフォーマット.行取りマクロを包み込むようにする.
+% \jlreq at BlockHeading@spaces at current@before@<n>
+% : n番目の見出しの前に出すもの
+% \jlreq at BlockHeading@spaces at current@after@<n>
+% : n番目の見出しの後ろに出すもの
+% \jlreq at BlockHeading@spaces at current@count
+% : 現在いくつ目の連続する見出しを処理しているかのカウンター
+\newcount\jlreq at BlockHeading@spaces at current@count
+\jlreq at BlockHeading@spaces at current@count=0
+\def\jlreq at BlockHeading@spaces at current@sequence{}
+\def\jlreq at BlockHeading@spaces at headingslist{}
+
+\newcommand{\SetBlockHeadingSpaces}[1]{%
+ \begingroup
+ % 現段階の情報をクリアする
+ \def\jlreq at tempa{}% 見出しリスト
+ \def\jlreq at tempb{}% 設定リスト \def\jlreq at BlockHeading@spaces@***{{**}{**}...}ってのを入れる
+ \jlreq at SetBlockHeadingSpaces#1\jlreq at endmark
+ \edef\jlreq at do{%
+ \unexpanded{%
+ \@for\@tempa:=\jlreq at BlockHeading@spaces at headingslist\do{%
+ \expandafter\let\csname jlreq at BlockHeading@spaces at setlist@\@tempa\endcsname=\@undefined
+ }%
+ }%
+ \unexpanded{\def\jlreq at BlockHeading@spaces at headingslist}{\expandonce{\jlreq at tempa}}%
+ \expandonce{\jlreq at tempb}%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+\def\jlreq at SetBlockHeadingSpaces{% カンマを無視する処理
+ \@ifnextchar,{\expandafter\jlreq at SetBlockHeadingSpaces@i\@gobble}{\jlreq at SetBlockHeadingSpaces@i}%
+}
+\def\jlreq at SetBlockHeadingSpaces@i{%
+ \@ifnextchar[{\jlreq at SetBlockHeadingSpaces@ii}{\jlreq at SetBlockHeadingSpaces@ii[]}%
+}
+\def\jlreq at SetBlockHeadingSpaces@ii[#1]#2{%
+ \jlreq at ifendmark{#2}{}{%
+ \def\jlreq at headings{}% 見出し名リスト
+ \jlreq at BlockHeading@gyodori at parsekeyval[BlockHeadingSpaces]{#1}{}{}{}%
+ \let\jlreq at totalset=\jlreq at result% 上の#1に対応する設定
+ \def\jlreq at set{}% 個々の設定
+ \def\jlreq at lastdimen{}% 最後の寸法
+ \def\jlreq at do##1##2##3{%
+ \jlreq at ifempty{##1}{\jlreq at tempatrue}{\jlreq at tempafalse}% 前開きが空ならば\jlreq at tempatrue
+ \jlreq at ifempty{##2}{\jlreq at tempbtrue}{\jlreq at tempbfalse}% 後ろ開きが空ならば\jlreq at tempbtrue
+ }%
+ \expandafter\jlreq at do\jlreq at totalset
+ \jlreq at SetBlockHeadingSpaces@iii{#2}%
+ \eappto\jlreq at tempa{,\expandonce{\jlreq at headings}}% \jlreq at tempaに\jlreq at headingsを追加
+ \ifjlreq at tempb
+ \ifx\jlreq at lastdimen\@empty\else % 最後が寸法だったので\jlreq at SetBlockHeadingSpaces@totalsetを改変
+ \def\jlreq at do##1##2##3{%
+ \edef\jlreq at totalset{{\unexpanded{##1}}{r:\expandonce{\jlreq at lastdimen}}{\unexpanded{##3}}}%
+ }%
+ \expandafter\jlreq at do\jlreq at totalset
+ \fi
+ \else
+ \eappto\jlreq at set{{\expandonce{\jlreq at lastdimen}}}%
+ \fi
+ \eappto\jlreq at tempb{%
+ \noexpand\@ifundefined{jlreq at BlockHeading@spaces at setlist@\jlreq at headings}{}{%
+ \noexpand\ClassError{jlreq}{The spaces for \jlreq at headings\space is defined more than once (in SetBlockHeadingSpaces)}{\noexpand\@ehc}%
+ }%
+ \noexpand\def\expandonce{\csname jlreq at BlockHeading@spaces at setlist@\jlreq at headings\endcsname}{{\expandonce{\jlreq at totalset}}\expandonce{\jlreq at set}}%
+ }%
+ \jlreq at SetBlockHeadingSpaces
+ }%
+}
+\def\jlreq at SetBlockHeadingSpaces@iii#1{%
+ \@for\@tempa:=#1\do{%
+ \expandafter\jlreq at helper@trim\expandafter{\@tempa}{\@tempa}%
+ \expandafter\jlreq at iffirsttoken@ignorespaces\expandafter{\@tempa}{_}{%
+ \ifx\jlreq at lastdimen\@empty\else\eappto\jlreq at set{{\expandonce{\jlreq at lastdimen}}}\fi%
+ \def\jlreq at lastdimen{}%
+ \expandafter\jlreq at SetBlockHeadingSpaces@iv\@tempa{\jlreq at endmark}%
+ }{%
+ \ifjlreq at tempa
+ % 最初が寸法なので,全体の設定(\jlreq at totalset)に組み込む.
+ \def\jlreq at do##1##2##3{%
+ \edef\jlreq at totalset{{r:\expandonce{\@tempa}}{\unexpanded{##2}}{\unexpanded{##3}}}%
+ }%
+ \expandafter\jlreq at do\jlreq at totalset
+ \else
+ \ifx\jlreq at lastdimen\@empty\else\eappto\jlreq at set{{\expandonce{\jlreq at lastdimen}}}\fi
+ \let\jlreq at lastdimen=\@tempa
+ \fi
+ }%
+ \jlreq at tempafalse
+ }%
+}
+\def\jlreq at SetBlockHeadingSpaces@iv#1#{%
+ \expandafter\jlreq at ifcontains\expandafter{\@gobble #1}{_}{%
+ \ClassWarning{jlreq}{Unusual heading name `\@gobble #1' is found. You forgot a comma? (in SetBlockHeadingSpaces)}%
+ }{}%
+ \jlreq at ifendswith{#1}{*}{{%
+ \def\@tempa_##1*{\def\@tempa{##1}}%
+ \@tempa#1%
+ \ClassWarning{jlreq}{The heading name `\@gobble #1' ends with `*'. Do you mean `_\@tempa{*}'? (in SetBlockHeadingSpaces)}%
+ }}{}%
+ \appto\jlreq at headings{#1}%
+ \jlreq at SetBlockHeadingSpaces@v
+}
+\def\jlreq at SetBlockHeadingSpaces@v#1{%
+ % 空っぽの場合は{_{r:0pt}{r:0pt}{}}
+ \jlreq at ifendmark{#1}{\appto\jlreq at set{{_{r:0pt}{r:0pt}{}}}}{%
+ \jlreq at iffirsttoken{#1}{*}{% *始まりの場合は{_*{}{}{}}
+ \expandafter\jlreq at BlockHeading@gyodori at parsekeyval\expandafter{\@gobble #1}{}{}{}%
+ \eappto\jlreq at set{{_*\expandonce{\jlreq at result}}}%
+ }{% それ以外の場合は{_{}{}{}}
+ \jlreq at BlockHeading@gyodori at parsekeyval{#1}{}{}{}%
+ \eappto\jlreq at set{{_\expandonce{\jlreq at result}}}%
+ }%
+ \@gobble % \jlreq at endmarkを食う
+ }%
+}
+
+% 現在の情報に基づき出力
+\def\jlreq at BlockHeading@spaces at output{%
+ \@ifundefined{jlreq at BlockHeading@spaces at setlist@\jlreq at BlockHeading@spaces at current@sequence}{%
+ \jlreq at BlockHeading@spaces at outputwospace
+ }{%
+ \expandafter\expandafter\expandafter\jlreq at BlockHeading@spaces at output@\csname jlreq at BlockHeading@spaces at setlist@\jlreq at BlockHeading@spaces at current@sequence\endcsname\jlreq at endmark
+ }%
+}
+
+% 連続スペース情報とか無視して各々の見出しを出力する
+\def\jlreq at BlockHeading@spaces at outputwospace{%
+ \begingroup
+ \jlreq at tempcnta=0
+ \def\jlreq at do{}%
+ \jlreq at BlockHeading@spaces at outputwospace@
+ \jlreq at BlockHeading@spaces at clear
+ \expandafter\endgroup
+ \jlreq at do
+}
+\def\jlreq at BlockHeading@spaces at outputwospace@{%
+ \ifnum\jlreq at tempcnta<\jlreq at BlockHeading@spaces at current@count
+ \advance\jlreq at tempcnta by 1
+ \eappto\jlreq at do{\csexpandonce{jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta}}%
+ \edef\jlreq at tempa{%
+ \unexpanded{\long\def\jlreq at tempa##1}{\csexpandonce{jlreq at BlockHeading@spaces at current@format@\the\jlreq at tempcnta}}%
+ }%
+ \jlreq at tempa
+ \edef\jlreq at tempb{%
+ \noexpand\expandonce{\noexpand\jlreq at tempa{%
+ \noexpand\jlreq at BlockHeading@start at gyodori
+ \csexpandonce{jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta}%
+ {\csexpandonce{jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta}}%
+ }}%
+ }%
+ \eappto\jlreq at do{\jlreq at tempb\csexpandonce{jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta}}%
+ \expandafter\jlreq at BlockHeading@spaces at outputwospace@
+ \fi
+}
+
+\def\jlreq at BlockHeading@spaces at output@#1#2\jlreq at endmark{%
+ \def\jlreq at result{}%
+ \jlreq at tempcnta=0
+ \jlreq at BlockHeading@spaces at output@@#2\jlreq at endmark
+ \jlreq at tempatrue % 周りの行取り処理が必要か
+ \jlreq at ifempty{#1}{\jlreq at tempafalse}{}%
+ \ifthenelse{\equal{#1}{{}{}{}}}{\jlreq at tempafalse}{}%
+ \edef\jlreq at do{%
+ \ifjlreq at tempa
+ \unexpanded{\jlreq at BlockHeading@start at gyodori#1}{%
+ \expandonce{\jlreq at result}%
+ }%
+ \else
+ \expandonce{\jlreq at result}%
+ \fi
+ }%
+ \jlreq at BlockHeading@spaces at clear
+ \jlreq at do
+}
+% jlreq at resultに出力すべきものを入れていく
+\def\jlreq at BlockHeading@spaces at output@@#1{%
+ \jlreq at ifendmark{#1}{}{%
+ \jlreq at iffirsttoken@ignorespaces{#1}{_}{%
+ \advance\jlreq at tempcnta by 1
+ \expandafter\jlreq at BlockHeading@spaces at output@@@\expandafter{\@gobble #1}%
+ }{%
+ \appto\jlreq at result{\vskip\glueexpr #1\relax}%
+ }%
+ \jlreq at BlockHeading@spaces at output@@
+ }%
+}
+\def\jlreq at BlockHeading@spaces at output@@@#1{%
+ \edef\jlreq at do{%
+ \noexpand\jlreq at BlockHeading@spaces at output@@@@
+ \jlreq at iffirsttoken@ignorespaces{#1}{*}{{*}\expandonce{\@gobble #1}}{\unexpanded{{}#1}}%
+ \csexpandonce{jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta}%
+ {\csexpandonce{jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta}}%
+ }%
+ \jlreq at do
+}
+% #1: デフォルト値を使うならば*,#2#3#4が設定された値,#5#6#7がデフォルト値,#8は偶数ページの,#9が出力
+\def\jlreq at BlockHeading@spaces at output@@@@#1#2#3#4#5#6#7#8{%
+ \edef\jlreq at tempa{%
+ \unexpanded{\long\def\jlreq at tempa##1}{\csexpandonce{jlreq at BlockHeading@spaces at current@format@\the\jlreq at tempcnta}}%
+ }%
+ \jlreq at tempa
+ \edef\jlreq at tempb{%
+ \noexpand\expandonce{\noexpand\jlreq at tempa{%
+ \noexpand\jlreq at BlockHeading@start at gyodori
+ \jlreq at ifempty{#1}{\unexpanded{{#2}{#3}{#4}}}{%
+ {\jlreq at ifempty{#2}{\unexpanded{#5}}{\unexpanded{#2}}}%
+ {\jlreq at ifempty{#3}{\unexpanded{#6}}{\unexpanded{#3}}}%
+ {\jlreq at ifempty{#4}{\unexpanded{#7}}{\unexpanded{#4}}}%
+ }\unexpanded{{#8}}%
+ }}%
+ }%
+ \eappto\jlreq at result{%
+ \csexpandonce{jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta}%
+ \jlreq at tempb
+ \csexpandonce{jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta}%
+ }%
+}
+
+% 連続見出しスペース調整用のデータをすべてクリアする
+\def\jlreq at BlockHeading@spaces at clear{%
+ \begingroup
+ \jlreq at tempcnta=0
+ \@whilenum\jlreq at tempcnta<\jlreq at BlockHeading@spaces at current@count\do{%
+ \advance\jlreq at tempcnta by 1
+ \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@space@\the\jlreq at tempcnta\endcsname=\@undefined
+ \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@output@\the\jlreq at tempcnta\endcsname=\@undefined
+ \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@before@\the\jlreq at tempcnta\endcsname=\@undefined
+ \expandafter\global\expandafter\let\csname jlreq at BlockHeading@spaces at current@after@\the\jlreq at tempcnta\endcsname=\@undefined
+ }%
+ \gdef\jlreq at BlockHeading@spaces at current@sequence{}%
+ \global\jlreq at BlockHeading@spaces at current@count=0
+ \endgroup
+}
+
+%.. 同行見出し
+% {1 = 命令名}{2 = レベル}{3 = */-}{4 = ラベルフォーマット}{5 = ラベルありフォーマット}{6 = ラベルなしフォーマット}
+% 4,5は見出し文字列が#1になる.
+\long\def\jlreq at RuninHeading@start#1#2#3#4#5#6{%
+ \edef\jlreq at RuninHeading@start at format@label{\unexpanded{#4}}%
+ \edef\jlreq at RuninHeading@start at format@wlabel{\unexpanded{#5}}%
+ \edef\jlreq at RuninHeading@start at format@wolabel{\unexpanded{#6}}%
+ \@ifstar{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{*}}}{\@dblarg{\jlreq at RuninHeading@start@{#1}{#2}{#3}}}%
+}
+% {1 = 命令名}{2 = レベル}{3 = */-}{4 = running head}{5 = 見出し}
+\long\def\jlreq at RuninHeading@start@#1#2#3[#4]#5{%
+ \edef\jlreq at do{\unexpanded{\jlreq at RuninHeading@start@@{#1}{#2}{#3}{#4}{#5}}{\expandonce{\jlreq at RuninHeading@start at format@label}}{\expandonce{\jlreq at RuninHeading@start at format@wlabel}}{\expandonce{\jlreq at RuninHeading@start at format@wolabel}}}%
+ \jlreq at do
+}
+% {1 = 命令名}{2 = レベル}{3 = *}{4 = running head}{5 = 見出し}{6 = ラベルフォーマット}{7 = ラベルありフォーマット}{8 = ラベルなしフォーマット}
+\long\def\jlreq at RuninHeading@start@@#1#2#3#4#5#6#7#8{%
+ \if at noskipsec\leavevmode\fi
+ \begingroup
+ \def\jlreq at do{\global\@noskipsectrue}%
+ \ifnum0\jlreq at ifempty{#3}{}{1}\ifnum #2>\c at secnumdepth 1\fi>0
+ \def\jlreq at tempa##1{#8}%
+ \else
+ \appto\jlreq at do{\refstepcounter{#1}}%
+ \def\jlreq at tempa##1{#7}%
+ \fi
+ \par
+ \eappto\jlreq at do{%
+ \noexpand\everypar{%
+ \noexpand\if at noskipsec
+ \unexpanded{\global\@noskipsecfalse}%
+ \unexpanded{{\setbox\jlreq at tempboxa\lastbox}}%
+ \noexpand\begingroup
+ \expandonce{\jlreq at tempa{#5}}%
+ \expandonce{\csname jlreq at heading@maketoc@#1\endcsname}{#3}{#6}{#4}%
+ \noexpand\endgroup
+ \noexpand\else
+ \unexpanded{\everypar{}}%
+ \noexpand\fi
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+ \ignorespaces
+}
+
+% \DeclareRuninHeading{命令名}{レベル}{設定}
+\newcommand*{\DeclareRuninHeading}[3]{%
+ \def\jlreq at do{\@removeelement{#1}}%
+ \expandafter\jlreq at do\expandafter{\jlreq at heading@allheadings}{\jlreq at heading@allheadings}%
+ \appto\jlreq at heading@allheadings{,#1}%
+ \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
+ \expandafter\edef\csname jlreq at heading@setting@#1\endcsname{\unexpanded{#3}}%
+ \expandafter\def\csname jlreq at 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 at heading@make at maketoc{#1}{#2}%
+ \begingroup
+ \def\jlreq at font{\normalfont\normalsize}%
+ \def\jlreq at indent{0\zw}%
+ \def\jlreq at after@label at space{1\zw}%
+ \def\jlreq at label@font{}%
+ \def\jlreq at label@format{\@seccntformat{#1}}%
+ \def\jlreq at after@space{1\zw}%
+ \newif\ifjlreq at number \jlreq at numbertrue
+ \jlreq at parsekeyval[RuninHeading:#1]{%
+ {font}{\def\jlreq at font{##1}}
+ {indent}{\def\jlreq at indent{##1}}
+ {label_format}{\def\jlreq at 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 at after@label at space{##1}%
+ }
+ {after_space}{%
+ \ifdim\dimexpr##1\relax<0pt \ClassWarning{jlreq}{after_space in Runin Heading #1 should be not negative}\fi
+ \def\jlreq at after@space{##1}%
+ }
+ {number}{\csname jlreq at number##1\endcsname}
+ }{#3}%
+ \newif\ifjlreq at indent@zero
+ \jlreq at ifgluezero{\glueexpr\jlreq at indent\relax}{\jlreq at indent@zerotrue}{\jlreq at indent@zerofalse}%
+ \newif\ifjlreq at after@space at zero
+ \jlreq at ifgluezero{\glueexpr\jlreq at after@space\relax}{\jlreq at after@space at zerotrue}{\jlreq at after@space at zerofalse}%
+ \newif\ifjlreq at after@label at space@zero
+ \jlreq at ifgluezero{\glueexpr\jlreq at after@label at space\relax}{\jlreq at after@label at spacefalse}%
+ \edef\jlreq at format@wlabel{{%
+ \ifjlreq at indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at indent}\noexpand\relax\fi
+ \expandonce{\jlreq at font}%
+ \expandonce{\jlreq at label@format}%
+ \ifjlreq at after@label at space@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at after@label at space}\noexpand\relax\fi
+ ####1%
+ \ifjlreq at after@space at zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at after@space}\noexpand\relax\fi
+ }}%
+ \edef\jlreq at format@wolabel{{%
+ \ifjlreq at indent@zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at indent}\noexpand\relax\fi
+ \expandonce{\jlreq at font}%
+ ####1%
+ \ifjlreq at after@space at zero\else\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at after@space}\noexpand\relax\fi
+ }}%
+ \jlreq at heading@make at l@{#1}{#2}{\jlreq at label@format}%
+ \edef\jlreq at do{%
+ \expandonce{\jlreq at result}%
+ % パラメータトークンを含むので,\edefして\unexpandedで包む
+ \noexpand\edef\expandonce{\csname #1\endcsname}{%
+ \noexpand\unexpanded{%
+ \unexpanded{\jlreq at hook@beforeheadings{#1}}%
+ \unexpanded{\jlreq at RuninHeading@start{#1}{#2}}{\ifjlreq at number\else -\fi}{\expandonce{\jlreq at label@format}}{\expandonce{\jlreq at format@wlabel}}{\expandonce{\jlreq at format@wolabel}}%
+ }%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+\newcommand*{\NewRuninHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareRuninHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\RenewRuninHeading}[3]{%
+ \@ifundefined{#1}{\@latex at error{\expandafter\string\csname#1\endcsname\space undefined}\@ehc}{\DeclareRuninHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\ProvideRuninHeading}[3]{%
+ \@ifundefined{#1}{\DeclareRuninHeading{#1}{#2}{#3}}{}%
+}
+
+%.. 窓見出し
+\def\jlreq at CutinHeading@start#1#2#3#4#5#6#7{%
+ \if at noskipsec\leavevmode\fi
+ \par
+ \jlreq at if{\ifnum\hangafter=1 \fi}{%
+ \jlreq at CutinHeading@start@{#2}{#3}{#4}{#5}{#6}{#7}%
+ }{%
+ \ClassError{jlreq}{Can not use \expandafter\string\csname#1\endcsname\space here}{\@ehc}%
+ }%
+}
+% 1 = 書式指定,2 = インデント, 3 = 見出しと本文の間, 4 = これを越えたら二行以上,5 = これを越えたら三行以上,6 = テキスト
+\def\jlreq at CutinHeading@start@#1#2#3#4#5#6{%
+ % 一行で処理したときの見出し長さを計測
+ \begingroup
+ \setbox\@tempboxa=\hbox{#1#6}%
+ \@tempdima=\wd\@tempboxa
+ % 何行必要かを\jlreq at CutinHeading@linecountに入れる
+ \ifdim\@tempdima>#5\def\jlreq at CutinHeading@linecount{3}%
+ \else\ifdim\@tempdima>#4\def\jlreq at CutinHeading@linecount{2}%
+ \else\def\jlreq at CutinHeading@linecount{1}\fi\fi
+ % \@tempdimaが実際の一行の長さに近い
+ \divide\@tempdima by \jlreq at CutinHeading@linecount
+ % \jlreq at resultboxに見出し部分を,\jlreq at CutinHeading@linecountに見出し自身に何行使うかを入れる
+ \ifnum\jlreq at CutinHeading@linecount=1\relax
+ \setbox\jlreq at resultbox=\vbox{\parindent=0pt\rightskip=0pt\leftskip=0pt\hbox{#1#6}}%
+ \def\jlreq at CutinHeading@linecount{2}%
+ \else
+ \jlreq at inlinenote@determinelength{#6}{#1}{}{\jlreq at CutinHeading@linecount}{\jlreq at CutinHeading@linecount}{\@tempdima}{\linewidth}%
+ \def\jlreq at CutinHeading@linecount{3}%
+ \fi
+ % 普通の一行の高さ/深さに合わせて見出しのボックスを作る
+ \setbox\@tempboxa=\vtop to \dimexpr\numexpr\jlreq at CutinHeading@linecount - 1\relax\baselineskip + 1\zh\relax{\vskip 0pt plus 1fill minus 1fill \box\jlreq at resultbox\vskip 0pt plus 1fill minus 1fill}%
+ % 高さを通常の一行のそれにする
+ \setbox\jlreq at tempboxa=\hbox{阿}%
+ \dp\@tempboxa=\dimexpr\ht\@tempboxa + \dp\@tempboxa - \ht\jlreq at tempboxa\relax
+ \ht\@tempboxa=\ht\jlreq at tempboxa
+ \noindent
+ \hspace*{#2}%
+ \copy\@tempboxa
+ \hspace*{#3}%
+ % でかい見出しボックスの分をキャンセルする空きを入れる
+ % \baselineskip - \ht\jlreq at tempboxaはTeXが挿入するスキップの分
+ \edef\jlreq at do{%
+ \noexpand\par
+ \noexpand\vskip -\the\dimexpr\ht\@tempboxa + \dp\@tempboxa + \baselineskip - \ht\jlreq at tempboxa\relax\relax
+ \noexpand\hangindent=\the\dimexpr#2 + \wd\@tempboxa + #3\relax\relax
+ \noexpand\hangafter=-\jlreq at CutinHeading@linecount\relax
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+ \prevdepth=0pt
+ % 改段落が起こっても\hang****をキープするように\parを書き換えておく(終わったら元に戻す).
+ \def\par{%
+ \ifvmode\jlreq at tempatrue\else\jlreq at tempafalse\fi
+ \jlreq at tempcnta=\hangafter\relax
+ \jlreq at tempdima=\hangindent\relax
+ \@@par
+ \ifjlreq at tempa\else\advance\jlreq at tempcnta by \prevgraf\relax\fi
+ \ifnum\jlreq at tempcnta<0
+ \hangafter=\jlreq at tempcnta\relax
+ \hangindent=\jlreq at tempdima\relax
+ \else
+ \@restorepar
+ \fi
+ }%
+ \@afterindentfalse
+ \@afterheading
+ \ignorespaces
+}
+
+\newcommand*{\DeclareCutinHeading}[3]{%
+ \expandafter\def\csname jlreq at heading@level@#1\endcsname{#2}%
+ \expandafter\def\csname jlreq at heading@setting@#1\endcsname{#3}%
+ \expandafter\def\csname jlreq at heading@type@#1\endcsname{\RenewCutinHeading}%
+ \begingroup
+ \def\jlreq at fontcommand{\sffamily\bfseries}%
+ \def\jlreq at onelinemax{6\zw}%
+ \def\jlreq at twolinemax{20\zw}%
+ \def\jlreq at indent{0\zw}%
+ \def\jlreq at after@space{1\zw}%
+ \jlreq at parsekeyval[CutinHeading:#1]{
+ {font}{\def\jlreq at fontcommand{##1}}
+ {onelinemax}{\def\jlreq at onelinemax{##1}}
+ {twolinemax}{\def\jlreq at twolinemax{##1}}
+ {indent}{\def\jlreq at indent{##1}}
+ {after_space}{\def\jlreq at after@space{##1}}
+ }{#3}%
+ \ifthenelse{\lengthtest{\jlreq at after@space < 0.99\zw} \OR \lengthtest{\jlreq at after@space > 2.01\zw}}{%
+ \jlreq at note{窓見出しと本文との空き量は,基本版面の文字サイズの全角以上,2倍未満とする (4.1.10.c).}%
+ }{}%
+ \edef\jlreq at do{%
+ \noexpand\def\expandonce{\csname #1\endcsname}{%
+ \noexpand\jlreq at CutinHeading@start{#1}{\expandonce{\jlreq at fontcommand}}{\expandonce{\jlreq at indent}}{\expandonce{\jlreq at after@space}}{\expandonce{\jlreq at onelinemax}}{\expandonce{\jlreq at twolinemax}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+\newcommand*{\NewCutinHeading}[3]{%
+ \expandafter\@ifdefinable\csname #1\endcsname{\DeclareCutinHeading{#1}{#2}{#3}}%
+}
+\newcommand*{\RenewCutinHeading}[3]{%
+ \@ifundefined{#1}{\@latex at 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 at heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}%
+ \edef\jlreq at do{\csexpandonce{jlreq at heading@type@#1}{#1}{\csexpandonce{jlreq at heading@level@#1}}{\csexpandonce{jlreq at heading@setting@#1},\unexpanded{#2}}}%
+ \jlreq at do
+}
+% 見出し#1をマクロ#2に保存する
+\newcommand{\SaveHeading}[2]{%
+ \@ifundefined{jlreq at heading@setting@#1}{\ClassError{jlreq}{Unknown heading: #1}{\@ehc}}{}%
+ \edef#2{%
+ \csexpandonce{jlreq at heading@type@#1}{\unexpanded{#1}}{\csexpandonce{jlreq at heading@level@#1}}{\csexpandonce{jlreq at heading@setting@#1}}%
+ }%
+}
+
+\newcommand*{\jlreq at keepbaselineskip}[1]{%
+ \begingroup
+ \edef\jlreq at do{\unexpanded{#1}\noexpand\baselineskip=\the\baselineskip}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\newcommand*{\jlreq at HeadingType}[1]{%
+ \ifcsname jlreq at heading@type@#1\endcsname
+ \jlreq at HeadingType@{#1}{\RenewTobiraHeading}{TobiraHeading}{%
+ \jlreq at HeadingType@{#1}{\RenewBlockHeading}{BlockHeading}{%
+ \jlreq at HeadingType@{#1}{\RenewRuninHeading}{RuninHeading}{%
+ \jlreq at HeadingType@{#1}{\RenewCutinHeading}{CutinHeading}{%
+ UnknownHeading}}}}%
+ \else
+ UndefinedHeading%
+ \fi
+}
+\newcommand*{\jlreq at HeadingType@}[2]{%
+ \jlreq at if{\expandafter\expandafter\expandafter\ifx\csname jlreq at heading@type@#1\endcsname#2\fi}%
+}
+
+% 全ての見出しにマクロ#1を適用する.
+\def\jlreq at heading@execmacro at toallheadings#1{%
+ \begingroup
+ \def\jlreq at do{}%
+ \ifx\jlreq at heading@allheadings\@undefined
+ \jlreq at heading@execmacro at toallheadings@{#1}{chapter,part,section,subsection,subsubsection,paragraph,subparagraph}%
+ \else
+ \def\@tempa{\jlreq at heading@execmacro at toallheadings@{#1}}%
+ \expandafter\@tempa\expandafter{\jlreq at heading@allheadings}%
+ \fi
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\def\jlreq at heading@execmacro at toallheadings@#1#2{
+ \@for\jlreq at tempa:=#2\do{%
+ \@ifundefined{\jlreq at tempa}{}{%
+ \eappto\jlreq at do{\noexpand#1{\expandonce{\jlreq at tempa}}}%
+ }%
+ }%
+}
+\def\jlreq at clearheadingmarks#1{%
+ \@ifundefined{#1mark}{}{%
+ \expandafter\let\csname#1mark\endcsname=\@gobble
+ }%
+}
+
+%.. カウンターの定義(見出し本体はこのファイルの末尾で)
+\setcounter{secnumdepth}{3}
+\newcounter{part}
+\jlreq at switch{\jlreq at 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}
+
+
+%. 注
+% 文字サイズは6ポイントくらい(4.2.3.a)とりあえす\scriptsize
+%.. 合印(4.2.3)
+\newcommand*\jlreq at referencemark@format[1]{#1}
+\newif\ifjlreqadjustreferencemark
+\jlreqadjustreferencemarktrue
+\jlreq at jlreqsetup@add{reference_mark}[inline,interlinear]{
+ \def\jlreq at referencemark{#1}
+ \ifthenelse{\equal{\jlreq at referencemark}{inline}}{
+ \def\jlreq at notemark##1{%
+ \jlreq at ifydir{%
+ \hbox{}\hbox{\@textsuperscript{\normalfont\jlreq at referencemark@format{##1}}}\hbox{}%
+ }{%
+ \setbox\@tempboxa=\hbox{\scriptsize\jlreq at referencemark@format{##1}}%
+ \raise\dimexpr.5\jlreq at gol - \ht\@tempboxa\relax\box\@tempboxa
+ }%
+ }
+ \def\jlreq at hook@prenote{\inhibitglue}
+ % 後ろ側に始め括弧類(cl-01)が配置される場合を除いて,ベタ組(4.2.3,二つ目のc,三つ目のb).
+ \def\jlreq at hook@postnote{\futurelet\jlreq at nextchar\jlreq at postnote@checkopenbracket}%
+ \def\@tempa{}
+ \def\jlreq at do##1{\jlreq at ifendmark{##1}{}{\appto\@tempa{\ifx\jlreq at tempb##11\fi}\jlreq at do}}
+ \expandafter\jlreq at do\jlreq at charlist@openingbrackets\jlreq at endmark
+ \edef\jlreq at postnote@checkopenbracket{%
+ \unexpanded{%
+ \jlreq at getfirsttoken@expandmacros{\jlreq at nextchar}{\jlreq at tempa}%
+ \expandafter\let\expandafter\jlreq at tempb\jlreq at tempa
+ }%
+ \noexpand\jlreq at if{\noexpand\ifnum 0\expandonce{\@tempa}>0 \noexpand\fi}{}{\noexpand\inhibitglue}%
+ }
+ }{% reference_mark=interlinear
+ \def\jlreq at notemark##1{{%
+ \setbox\@tempboxa=\hbox{\scriptsize\jlreq at referencemark@format{##1}}%
+ \@tempdima=\wd\@tempboxa
+ % 行頭に来たときに頭を天にそろえる処理.
+ \ifjlreqadjustreferencemark
+ \jlreq at savepos@for at rest@linewidth
+ \ifdim\jlreq at current@linewidth<\wd\@tempboxa
+ \@tempdima=\jlreq at current@linewidth
+ \fi
+ \fi
+ \setbox\jlreq at tempboxb=\hbox{阿}%
+ \setbox\jlreq at tempboxa=\hbox to\z@{\hskip-\@tempdima\raise\dimexpr\ht\jlreq at tempboxb + \dp\@tempboxa\relax\box\@tempboxa\hss}%
+ \dp\jlreq at tempboxa=0pt\ht\jlreq at tempboxa=0pt\box\jlreq at tempboxa%
+ }}%
+ \ifx l\jlreq at engine
+ \def\jlreq at hook@prenote{%
+ \jlreq at lastnodechar=\lastnodechar\relax
+ \ifnum\jlreq at lastnodechar>-1 \inhibitglue\fi
+ }
+ \else
+ % (u)platexの時は代入すると\inhibitglueが効かなくなる
+ \def\jlreq at hook@prenote{%
+ \ifnum\lastnodechar>-1 \inhibitglue\fi
+ \jlreq at lastnodechar=\lastnodechar\relax
+ }
+ \fi
+ \def\jlreq at hook@postnote{\jlreq at fixjfm}
+ }
+}
+% \@footnotemarkをシンプルなものにする
+\def\jlreq at setdefaultnotemark#1#2{%
+ \def#1{%
+ \leavevmode
+ \ifhmode\edef\@x at sf{\the\spacefactor}\nobreak\fi
+ #2%
+ \ifhmode\spacefactor\@x at sf\fi
+ \relax}%
+}
+\jlreq at setdefaultnotemark\@footnotemark\@makefnmark
+
+%.. 脚注(4.2.5)
+% (縦書きの時は傍注,4.2.6)
+% 罫線の前は行間分,最大+文字サイズ分伸びる(4.2.5.g)
+\setlength{\skip\footins}{\dimexpr\baselineskip - 1\jlreq at gol \relax plus 1\jlreq at gol}
+% 罫線の長さは,基本版面で設定した行長にもよるが,行長の1/3くらいにする.
+\def\jlreq at footnote@rulewidth{.333\textwidth}
+\begingroup
+ \footnotesize
+ \edef\jlreq at do{
+ \unexpanded{\setlength{\footnotesep}}{\the\dimexpr .7\baselineskip\relax}% 何でかわからん……
+ \unexpanded{\def\footnoterule}{%
+ % この罫線は,表罫(おもてけい)とする.
+ \unexpanded{\hrule width \jlreq at footnote@rulewidth height \jlreq at omotekeiwidth}%
+ % 脚注の行間よりやや広くする(4.2.5.f)
+ \noexpand\kern\the\dimexpr 1.5\dimexpr\baselineskip - 1\zh\relax\relax
+ }
+ }
+\expandafter\endgroup
+\jlreq at do
+
+% インデントの計算:脚注の長さが文字の整数倍になるように字下げする(4.2.5.b)
+\jlreq at jlreqsetup@add{footnote_indent}{%
+ \if at tate\else
+ \ifdim\dimexpr#1\relax=0pt \else\jlreq at note{脚注は,一般にその前に区切りのための罫線を挿入するので,字下げは行わなくてよい(4.2.5.b).}\fi
+ \fi
+ \begingroup
+ \footnotesize
+ \jlreq at footnoteindent=\dimexpr#1\relax
+ \@tempdima=\dimexpr\textwidth - \jlreq at footnoteindent\relax
+ \@tempdimb=1\zw
+ \divide\@tempdima\@tempdimb \multiply\@tempdima\@tempdimb
+ \edef\jlreq at do{\noexpand\jlreq at footnoteindent=\the\dimexpr\textwidth - \@tempdima\relax}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\newcommand{\@makefntext}[1]{\jlreq at makefntext{#1}}
+\jlreq at jlreqsetup@add{footnote_second_indent}{%
+ \if at 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 at note{脚注が2行以上となった場合,脚注の2行目以下の字下げを1行目より,脚注の文字サイズの全角アキとするか,逆に,1行目の字下げを2行目より,脚注の文字サイズの全角アキとする (4.2.5.d).}}
+ \fi
+ \ifdim\dimexpr #1\relax<0pt
+ \def\jlreq at makefntext{}
+ \else
+ \def\jlreq at makefntext{\addtolength{\leftskip}{\glueexpr #1\relax}}
+ \fi
+ \long\edef\jlreq at makefntext##1{\expandonce{\jlreq at makefntext}%
+ \unexpanded{%
+ \addtolength{\leftskip}{\jlreq at footnoteindent}%
+ \parindent=1\zw
+ \noindent
+ \hskip-\glueexpr #1\relax
+ \jlreq at referencemark@format{\@thefnmark}%
+ \hskip\glueexpr 1\zw\relax
+ }##1%
+ }
+}
+
+\jlreq at jlreqsetup@add{footnotetext_indent}{
+ \ClassWarningNoLine{jlreq}{footnotetext_indent was removed}
+}
+
+\ifx l\jlreq at engine
+ \fnfixbottomtrue
+\fi
+
+% \footnoteと\footnotemarkの前後に\jlreq at hook@prenote/\jlreq at hook@postnoteを入れる
+\jlreq at saveoriginalcs{\footnote}
+\jlreq at saveoriginalcs{\footnotemark}
+\def\footnote{%
+ \jlreq at hook@prenote
+ \@ifnextchar[{\jlreq at footnote@impl at woption}{\jlreq at footnote@impl at wooption}%
+}
+\def\footnotemark{%
+ \jlreq at hook@prenote
+ \@ifnextchar[{\jlreq at footnotemark@impl at woption}{\jlreq at footnotemark@impl at wooption}%
+}
+\ifthenelse{\boolean{@tate} \AND \(\boolean{@twoside} \OR \boolean{@twocolumn}\)}{
+ % 縦組の傍注は,その見開き内に付いている合印に対応する注を,奇数ページの左端にそろえて配置する.多段組では最下段の左端にそろえて配置する.(4.2.6.a)
+ % 必要ならば\footnoteを\footnotemarkと\footnotetextにわけ,\footnotetextをアウトプット時まで遅延することで実現する.
+ \def\jlreq at footnote@delayfootnoteslist{}
+ \def\jlreq at hook@@opcol{%
+ \expandafter\gdef\expandafter\jlreq at footnote@delayfootnoteslist\expandafter{\expandafter}%
+ \jlreq at footnote@delayfootnoteslist
+ }
+ \preto\@opcol{\jlreq at hook@@opcol}
+ % \jlreq at footnote@delayfootnote at delay#1#2#3:#1ページ目に\footnotetext[#2]{#3}を出す
+ % \jlreq at footnote@delayfootnote at page:何ページ目に\footnotetextを入れるかを\jlreq at resultcntに入れる.その場での場合は-1.
+ \if at twocolumn
+ \if at twoside
+ \def\jlreq at footnote@delayfootnote at page{%
+ \jlreq at setcurrentpage
+ \jlreq at resultcnt=\numexpr\jlreq at currentpage\ifodd\jlreq at currentpage\else + 1\fi\relax
+ % このページに表示&上の段処理済みだと\output内では間に合わない
+ \ifnum\jlreq at resultcnt=\value{page}\if at firstcolumn\else\jlreq at resultcnt=-1 \fi\fi
+ }
+ \else
+ \def\jlreq at footnote@delayfootnote at page{%
+ \jlreq at setcurrentpage
+ \jlreq at resultcnt=\numexpr\jlreq at currentpage\relax
+ \ifnum\jlreq at resultcnt=\value{page}\if at firstcolumn\else\jlreq at resultcnt=-1 \fi\fi
+ }
+ \fi
+ \long\def\jlreq at footnote@delayfootnote at delay#1#2#3{%
+ % 二段組みの場合は上段を組んだ直後に\footnotetextを挿入(そのページの下段に入る)
+ \ifnum 0\if at firstcolumn\else 1\fi\ifnum#1>\value{page}1\fi>0
+ \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}{#3}}}%
+ \else
+ \footnotetext[#2]{#3}%
+ \fi
+ }
+ \else
+ \def\jlreq at footnote@delayfootnote at page{%
+ \jlreq at setcurrentpage
+ \ifodd\jlreq at currentpage
+ \jlreq at resultcnt=-1
+ \else
+ \jlreq at resultcnt=\numexpr\jlreq at currentpage+1\relax
+ \fi
+ }
+ \long\def\jlreq at footnote@delayfootnote at delay#1#2#3{%
+ % 一段組の場合はその前のページを組んだ直後に\footnotetextを挿入.
+ \ifnum\numexpr#1 - 1\relax>\value{page}%
+ \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}{#3}}}%
+ \else
+ \footnotetext[#2]{#3}%
+ \fi
+ }
+ \fi
+ \def\jlreq at footnote@delayfootnote at immediate#1#2#3{%
+ \ifnum #1<\jlreq at currentpage
+ \xappto\jlreq at footnote@delayfootnoteslist{\unexpanded{\jlreq at footnote@delayfootnote{#1}{#2}{#3}}}%
+ \else
+ \footnotetext[#2]{#3}%
+ \fi
+ }
+ \let\jlreq at footnote@delayfootnote=\jlreq at footnote@delayfootnote at delay
+ \def\jlreq at footnote@flushdelayfootnoteslist{%
+ \ifx\jlreq at footnote@delayfootnoteslist\@empty\else
+ \let\jlreq at footnote@delayfootnote=\jlreq at footnote@delayfootnote at immediate
+ \jlreq at setcurrentpage
+ \expandafter\gdef\expandafter\jlreq at footnote@delayfootnoteslist\expandafter{\expandafter}%
+ \jlreq at footnote@delayfootnoteslist
+ \let\jlreq at footnote@delayfootnote=\jlreq at footnote@delayfootnote at delay
+ \fi
+ }
+ \AtEndDocument{\jlreq at footnote@flushdelayfootnoteslist}
+ \preto\newpage{\jlreq at footnote@flushdelayfootnoteslist}
+ \long\def\jlreq at footnote@impl at woption[#1]#2{%
+ \jlreq at footnote@delayfootnote at page
+ \ifnum\jlreq at resultcnt=-1
+ \jlreq at useoriginalcs{\footnote}[#1]{#2}%
+ \else
+ \jlreq at useoriginalcs{\footnotemark}[#1]%
+ \xappto\jlreq at footnote@delayfootnoteslist{\noexpand\jlreq at footnote@delayfootnote{\the\jlreq at resultcnt}{\unexpanded{#1}}{\unexpanded{#2}}}%
+ \fi
+ \jlreq at hook@postnote
+ }
+ \long\def\jlreq at footnote@impl at wooption#1{%
+ \jlreq at footnote@delayfootnote at page
+ \ifnum\jlreq at resultcnt=-1
+ \jlreq at useoriginalcs{\footnote}{#1}%
+ \else
+ \jlreq at useoriginalcs{\footnotemark}%
+ \xappto\jlreq at footnote@delayfootnoteslist{\noexpand\jlreq at footnote@delayfootnote{\the\jlreq at resultcnt}{\the\value{footnote}}{\unexpanded{#1}}}%
+ \fi
+ \jlreq at hook@postnote
+ }
+}{
+ \long\def\jlreq at footnote@impl at woption[#1]#2{%
+ \jlreq at useoriginalcs{\footnote}[#1]{#2}%
+ \jlreq at hook@postnote
+ }
+ \long\def\jlreq at footnote@impl at wooption#1{%
+ \jlreq at useoriginalcs{\footnote}{#1}%
+ \jlreq at hook@postnote
+ }
+}
+\long\def\jlreq at footnotemark@impl at woption[#1]{%
+ \jlreq at useoriginalcs{\footnotemark}[#1]%
+ \jlreq at hook@postnote
+}
+\long\def\jlreq at footnotemark@impl at wooption{%
+ \jlreq at useoriginalcs{\footnotemark}%
+ \jlreq at hook@postnote
+}
+
+% 合印
+\renewcommand*{\@makefnmark}{%
+ \jlreq at ifydir{\jlreq at notemark{\@thefnmark}}{\hbox{\jlreq at notemark{\@thefnmark}}}%
+}
+% 4.2.2注3
+\if at tate
+ \renewcommand*{\thefootnote}{\jlreq at open@bracket at before@space\inhibitglue(\jlreq at rensuji{\@arabic\c at footnote})\inhibitglue}
+\else
+ \renewcommand*{\thefootnote}{\arabic{footnote}\hbox{})\inhibitglue}
+\fi
+\ifthenelse{\equal{\jlreq at article@type}{article}}{}{\@addtoreset{footnote}{chapter}}
+
+
+%.. 後注(4.2.4)
+\def\jlreq at endnotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
+\def\jlreq at endnotecounter{footnote}% 後注用のカウンタ名
+% 文字サイズは\footnotesizeを使う
+\newdimen\jlreq at endnote@prepostspace
+% 前の分との間は行間分空ける(4.2.4.f)
+\jlreq at endnote@prepostspace=\dimexpr\baselineskip - 1\jlreq at gol\relax
+\newdimen\jlreq at endnote@indent
+% 現在の後注一覧を,\jlreq at endnote@textsに{{合印1}{後注1}}{{合印2}{後注2}}...の形で保持する
+\def\jlreq at endnote@texts{}
+\long\def\jlreq at endnote@addtext#1#2{\xappto\jlreq at endnote@texts{\unexpanded{{{#1}{#2}}}}}
+% \endnote自身は後で定義する
+\def\jlreq at endnote@impl{\jlreq at hook@prenote\@ifnextchar[{\jlreq at endnote}{\jlreq at endnote[]}}
+\def\endnotemark{\jlreq at hook@prenote\@ifnextchar[{\jlreq at endnotemark}{\jlreq at endnotemark[]}}
+\def\endnotetext{\@ifnextchar[{\jlreq at endnotetext}{\jlreq at endnotetext[]}}
+\long\def\jlreq at endnote[#1]#2{\jlreq at endnotemark[#1]\@endnotetext{#2}\jlreq at hook@postnote}
+\def\jlreq at endnotemark[#1]{%
+ \jlreq at ifempty{#1}{%
+ \stepcounter{\jlreq at endnotecounter}%
+ \expandafter\protected at xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq at endnotecounter\endcsname #1\relax
+ \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
+ \endgroup
+ }%
+ \@endnotemark
+ \jlreq at hook@postnote
+}
+\jlreq at setdefaultnotemark\@endnotemark\@makeendmark
+\long\def\jlreq at endnotetext[#1]#2{%
+ \jlreq at ifempty{#1}{%
+ \expandafter\protected at xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq at endnotecounter\endcsname #1\relax
+ \expandafter\unrestored at protected@xdef\csname\jlreq at endnotemarkname\endcsname{\csname the\jlreq at endnotecounter\endcsname}%
+ \endgroup
+ }%
+ \@endnotetext{#2}%
+}
+\long\def\@endnotetext#1{%
+ \expandafter\let\expandafter\jlreq at tempa\expandafter=\csname\jlreq at endnotemarkname\endcsname
+ \expandafter\jlreq at endnote@addtext\expandafter{\jlreq at tempa}{#1}%
+}
+\long\def\jlreq at theendnotes#1{%
+ \jlreq at ifendmark{#1}{}{%
+ \jlreq at output@endnotes#1
+ \jlreq at theendnotes
+ }%
+}
+\long\def\jlreq at output@endnotes#1#2{%
+ \expandafter\def\csname\jlreq at endnotemarkname\endcsname{#1}%
+ \item\@makeendtext{#2}%
+}
+
+\newcommand*{\theendnotes}{%
+ \ifx\jlreq at endnote@texts\@empty\else
+ \let\jlreq at tempa=\jlreq at endnote@texts
+ \gdef\jlreq at endnote@texts{}%
+ \edef\jlreq at endnote@beforeafterspace{\the\dimexpr\baselineskip - 1\jlreq at gol\relax plus \the\dimexpr 1\jlreq at gol\relax}%
+ \begingroup
+ \par
+ \footnotesize
+ % 後注の長さを文字サイズの整数倍にする(4.2.4.b)
+ \jlreq at tempdima=\dimexpr\linewidth - \jlreq at endnote@indent - \leftskip\relax
+ \@tempdimb=1\jlreq at mol
+ \divide\jlreq at tempdima\@tempdimb\multiply\jlreq at tempdima\@tempdimb
+ \begin{list}{}{%
+ \itemsep=0pt\relax
+ \parsep=0pt\relax
+ \partopsep=0pt\relax
+ \topsep=0pt\relax
+ \leftmargin=\dimexpr\linewidth - \jlreq at tempdima + \jlreq at endnote@second at indent\relax
+ \itemindent=-\glueexpr\jlreq at endnote@second at indent\relax
+ \topsep=\jlreq at endnote@beforeafterspace\relax
+ \listparindent=1\zw
+ }%
+ \expandafter\jlreq at theendnotes\jlreq at tempa\jlreq at endmark
+ \end{list}%
+ \endgroup
+ \par
+ \fi
+}
+% 4.2.4.b
+\jlreq at endnote@indent=2\jlreq at mol
+\jlreq at jlreqsetup@add{endnote_second_indent}{
+ \def\jlreq at endnote@second at 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 at note{後注が2行以上となった場合,後注の2行目以下の字下げは,1行目より,後注の文字サイズの2倍又は全角とする (4.2.4.d).}}
+}
+\newcommand{\@makeendtext}[1]{%
+ \csname\jlreq at endnotemarkname\endcsname
+ \hskip\glueexpr1\zw\relax% 見出し出力と一文字分の空き(4.2.4.c)
+ #1%
+}
+\let\@makeendmark=\@makefnmark
+
+% \theendnoteの出力を仕込む
+\apptocmd{\jlreq at hook@beforeheadings}{\jlreq at endnote@hook at beforeheadings{#1}}{}{}
+
+\jlreq at jlreqsetup@add{endnote_position}{
+ \def\jlreq at endnote@hook at beforeheadings##1{}
+ \jlreq at tempafalse % headingsが指定された
+ \jlreq at tempbfalse % paragraphが指定された
+ % \jlreq at tempcにセクション名たちを入れていく
+ \def\jlreq at tempc{}
+ \@for\jlreq at tempa:=#1\do{
+ \expandafter\jlreq at helper@trim\expandafter{\jlreq at tempa}{\jlreq at tempa}%
+ \jlreq at switch{\jlreq at tempa}{
+ {headings}{\jlreq at tempatrue}
+ {paragraph}{
+ \jlreq at tempatrue% _paragraphの時は_headingsも有効にする
+ \jlreq at tempbtrue
+ }
+ {
+ \expandafter\jlreq at iffirsttoken@ignorespaces\expandafter{\jlreq at tempa}{_}{
+ \edef\jlreq at tempc{\jlreq at tempc,\expandafter\@gobble\jlreq at tempa}
+ }{
+ \ClassError{jlreq}{Invalid value \jlreq at tempa\space in endnote_position}{\@ehc}
+ }
+ }
+ }
+ }
+
+ \ifjlreq at tempb
+ \edef\endnote{\unexpanded{\def\par{\@restorepar\theendnotes\par}}\expandonce{\jlreq at endnote@impl}}
+ \else
+ \let\endnote=\jlreq at endnote@impl
+ \fi
+
+ \ifjlreq at tempa
+ \apptocmd{\jlreq at endnote@hook at beforeheadings}{\theendnotes}{}{}
+ \else
+ \@for\@tempa:=\jlreq at tempc\do{
+ \ifx\@tempa\@empty\else
+ \edef\jlreq at do{%
+ \unexpanded{\def\jlreq at endnote@hook at beforeheadings##1}{\expandonce{\jlreq at endnote@hook at beforeheadings{##1}}%
+ \unexpanded{\def\@tempa}{\@tempa}\unexpanded{\def\@tempb{##1}}%
+ \unexpanded{\ifx\@tempa\@tempb\theendnotes\fi}%
+ }
+ }
+ \jlreq at do
+ \fi
+ }
+ \fi
+}
+\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 at sidenotemarkname{@thefnmark}% 合印用番号を一時的に入れるマクロ名
+ \long\def\@sidenotetext#1{%
+ \marginpar{\reset at font\footnotesize
+ \color at begingroup\normalcolor
+ \@makesidetext{#1}%
+ \color at endgroup
+ }%
+ }
+ \jlreq at setdefaultnotemark\@sidenotemark\@makesidemark
+ \def\jlreq at sidenotecounter{footnote}% 傍注用のカウンタ名
+ \jlreq at jlreqsetup@add{sidenote_type}[number,symbol]{\def\jlreq at sidenote@type{#1}}
+ \def\jlreq at sidenote@type{number}
+ \jlreq at jlreqsetup@addtofinally{
+ \ifthenelse{\equal{\jlreq at sidenote@type}{number}}{
+ \def\sidenote{\jlreq at hook@prenote\@ifnextchar[{\jlreq at sidenote}{\jlreq at sidenote[]}}
+ \def\sidenotemark{\jlreq at hook@prenote\@ifnextchar[{\jlreq at sidenotemark}{\jlreq at sidenotemark[]}}
+ \def\sidenotetext{\@ifnextchar[{\jlreq at sidenotetext}{\jlreq at sidenotetext[]}}
+ \long\def\jlreq at sidenote[#1]#2{\jlreq at sidenotemark[#1]\@sidenotetext{#2}\jlreq at hook@postnote}
+ \def\jlreq at sidenotemark[#1]{%
+ \jlreq at ifempty{#1}{%
+ \stepcounter{\jlreq at sidenotecounter}%
+ \expandafter\protected at xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq at sidenotecounter\endcsname #1\relax
+ \expandafter\unrestored at protected@xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
+ \endgroup
+ }%
+ \@sidenotemark
+ \jlreq at hook@postnote
+ }
+ \long\def\jlreq at sidenotetext[#1]#2{%
+ \jlreq at ifempty{#1}{%
+ \expandafter\protected at xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
+ }{%
+ \begingroup
+ \csname c@\jlreq at sidenotecounter\endcsname#1\relax
+ \expandafter\unrestored at protected@xdef\csname\jlreq at sidenotemarkname\endcsname{\csname the\jlreq at sidenotecounter\endcsname}%
+ \endgroup
+ }%
+ \@sidenotetext{#2}%
+ }
+ % \hspace{0.5\jlreq at mol}の部分は二分空きにする例もある(4.2.7.g)
+ \ifx l\jlreq at engine
+ \long\def\@makesidetext#1{\csname\jlreq at sidenotemarkname\endcsname\hspace{0.5\jlreq at mol}#1}
+ \else
+ % thefootnote = \inhibitglue (...だと\inhibitglueが効かないので空白を挟む
+ \long\def\@makesidetext#1{ \kern-1\zw\csname\jlreq at sidenotemarkname\endcsname\hspace{0.5\jlreq at mol}#1}
+ \fi
+ \let\@makesidemark=\@makefnmark
+ }{% sidenote_type = symbol
+ \long\def\sidenote#1#2{\jlreq at sidenote{#1}{#2}}
+ \def\sidenotemark#1{\jlreq at sidenotemark{#1}}
+ \long\def\sidenotetext#1#2{\jlreq at sidenotetext{#1}{#2}}
+ \long\def\jlreq at sidenote#1#2{\jlreq at sidenotemark{#1}\jlreq at sidenotetext{#1}{#2}}
+ \edef\jlreq at sidenotemark#1{%
+ {\unexpanded{\reset at font\jlreq at sidenote@keywordfont}#1}%
+ \noexpand\jlreq at hook@prenote
+ \ifx\jlreq at sidenote@defaultmark\@empty\else
+ \expandafter\edef\expandonce{\csname\jlreq at sidenotemarkname\endcsname}{\expandonce{\jlreq at sidenote@defaultmark}}%
+ \noexpand\@sidenotemark
+ \fi
+ }
+ % カスタマイズできるべき?
+ \long\def\jlreq at sidenotetext#1#2{%
+ \expandafter\def\csname\jlreq at sidenotemarkname\endcsname{\inhibitglue\null{\reset at font\sffamily\bfseries\inhibitglue #1}}%
+ \@sidenotetext{#2}%
+ }
+ \long\def\@makesidetext#1{{\sffamily\bfseries\csname\jlreq at sidenotemarkname\endcsname}\hspace*{1\jlreq at mol}#1}
+ \let\@makesidemark=\@makefnmark
+
+ \apptocmd{\sidenote}{\jlreq at hook@postnote}{}{}
+ \apptocmd{\sidenotemark}{\jlreq at hook@postnote}{}{}
+ }
+ }
+ \jlreq at jlreqsetup@add{sidenote_symbol}{\def\jlreq at sidenote@defaultmark{#1}}
+ \jlreq at jlreqsetup@add{sidenote_keyword_font}{\def\jlreq at sidenote@keywordfont{#1}}
+}
+
+%.. 割注(3.4)
+\def\inlinenotesize{.6\jlreq at jafontsize} % 割注の文字サイズ
+\let\jlreq at inlinenote@autolinebreak=\\% 計測時は\linebreakより\\の方が安定する.悩ましい…….
+
+\newcommand{\jlreq at inlinenote@kakkofontsize}{%
+ \fontsize{\dimexpr\inlinenotesize * 2\relax}{\dimexpr \inlinenotesize * 2\relax}%
+ \selectfont
+}
+
+\newcommand{\jlreq at inlinenote@fontsize}{%
+ \fontsize{\inlinenotesize}{\inlinenotesize}%
+ \selectfont
+}
+
+% 割注を入れるための命令.\inlinenote{割注}で使う.
+% 改行位置は自動で計算されるが,常に正しいとは限らない.
+% \inlinenote*は自動で改行されない.\\で改行位置を指定する.
+\newif\ifjlreq at in@inlinenote
+\jlreq at in@inlinenotefalse
+\newcommand*{\jlreq at inlinenote@}[1]{%
+ \ifjlreq at in@inlinenote\ClassError{jlreq}{\string#1\space can't be nested}{\@ehc}\fi
+ \jlreq at in@inlinenotetrue
+ \ifvmode\leavevmode\fi
+ \@ifstar\jlreq at inlinenote@noauto\jlreq at inlinenote@auto
+}
+\DeclareRobustCommand*{\inlinenote}{\jlreq at inlinenote@{\inlinenote}}
+\DeclareRobustCommand*{\warichu}{\jlreq at inlinenote@{\warichu}}
+
+\newcommand*{\jlreq at inlinenote@auto}[1]{%
+ % 割注初め括弧の前の場所を保存
+ \jlreq at savepos@for at rest@linewidth
+ % \jlreq at tempdimbに,現在行の残り長さを入れる
+ \jlreq at tempdimb=\jlreq at rest@linewidth
+ % 括弧の分を引いたものが,割注の使える長さ
+ \setbox\@tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue\jlreq at open@bracket at before@space(\inhibitglue}%
+ \addtolength{\jlreq at tempdimb}{-\wd\@tempboxa}%
+ \ifdim\jlreq at tempdimb<0pt\jlreq at tempdimb=\linewidth\fi
+ {%
+ \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue \jlreq at open@bracket at before@space(}%
+ \jlreq at box@putcenter\jlreq at tempboxa
+ }%
+ % 「初回」時はここに強制改行を入れる.これにより現在位置の取得がより正しくなる……といいなぁ
+ \jlreq at savepos@iflabelundefined{\\}{}%
+ % 割注内の\baselineskipを保存(後で使う).
+ {\jlreq at inlinenote@fontsize\xdef\jlreq at inlinenote@baselineskip{\the\baselineskip}}%
+ % 普通に並べた長さを計測し,その半分から始める
+ \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize #1}%
+ \jlreq at tempdimc=\wd\@tempboxa
+ \divide\jlreq at tempdimc by 2\relax
+ % \@tempcntbに,この長さで計測した場合の行数を入れる
+ \ifdim\jlreq at tempdimc<\jlreq at tempdimb\@tempcntb=2\relax
+ \else
+ \jlreq at tempdima=\dimexpr\jlreq at tempdimc - \jlreq at tempdimb\relax
+ \divide\jlreq at tempdima\linewidth
+ \@tempcntb=\numexpr 2*\number\jlreq at tempdima + 4\relax
+ \fi
+ % \jlreq at parshapeargに\parshapeに指定する書式の最後以外を入れる.
+ \ifnum\@tempcntb>2\relax
+ \edef\jlreq at parshapearg{0pt \the\jlreq at tempdimb\space 0pt \the\jlreq at tempdimb}%
+ \@tempcnta=4\relax
+ \@whilenum\@tempcnta<\@tempcntb\do{%
+ \edef\jlreq at parshapearg{\jlreq at parshapearg\space 0pt \the\linewidth\space 0pt \the\linewidth}%
+ \advance\@tempcnta by 2\relax
+ }%
+ \setlength{\jlreq at tempdimc}{\dimexpr\jlreq at tempdimc - \jlreq at tempdimb - \linewidth * \numexpr(\@tempcntb - 4)/2\relax\relax}%
+ \else
+ \def\jlreq at parshapearg{}%
+ \fi
+ % 行数を伸ばしつつ良いところを探していく
+ \@whilenum\@tempcntb<1001\do{%
+ \ifnum\@tempcntb>2\jlreq at tempdimb=\linewidth\fi
+ \edef\@tempb{\the\@tempcntb}%
+ \jlreq at inlinenote@determinelength{#1}{\jlreq at inlinenote@fontsize}{\jlreq at parshapearg}{2}{\@tempb}{\jlreq at tempdimc}{\jlreq at tempdimb}%
+ \@tempcntb=\@tempb
+ \ifnum\@tempcntb>999\relax% ループが長すぎる
+ \global\setbox\jlreq at resultbox=\voidb at x%
+ \@tempcntb=1001\relax
+ \fi
+ \ifvoid\jlreq at resultbox\else% 成功
+ \edef\jlreq at inlinenote@lines{\the\@tempcntb}% 行数を保存
+ \@tempcntb=1001\relax
+ \fi
+ \advance\@tempcntb by 2\relax
+ \edef\jlreq at parshapearg{\jlreq at parshapearg 0pt \the\jlreq at tempdimb 0pt \the\jlreq at tempdimb}%
+ }%
+ \ifvoid\jlreq at resultbox
+ \ClassWarning{jlreq}{\string\warichu\space failed, may be a bug}%
+ \else
+ \@tempcnta=0
+ \splittopskip=0pt\relax
+ \splitmaxdepth=\maxdimen
+ % 現在行の残り長さを思い出す
+ \jlreq at tempdimb=\jlreq at rest@linewidth
+ \setbox\@tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue\jlreq at open@bracket at before@space(\inhibitglue}%
+ \addtolength{\jlreq at tempdimb}{-\wd\@tempboxa}%
+ \setbox\@tempboxa=\box\jlreq at resultbox
+ \@whilenum\@tempcnta<\jlreq at inlinenote@lines\do{%
+ \ifnum\@tempcnta>0 \jlreq at inlinenote@autolinebreak\fi
+ % \jlreq at tempdimaに今の行の長さを入れる
+ \ifnum\@tempcnta<\numexpr\jlreq at inlinenote@lines - 2\relax
+ \ifnum\@tempcnta=0\jlreq at tempdima=\jlreq at tempdimb
+ \else\jlreq at tempdima=\linewidth\fi
+ \else
+ % 最終行は自然長に任せる
+ \jlreq at tempdima=-1pt\relax
+ \fi
+ {%
+ \edef\@tempa{\the\vbadness}%
+ \vbadness=10000
+ \setbox\jlreq at tempboxa=\vsplit\@tempboxa to \dimexpr\jlreq at inlinenote@baselineskip*2\relax
+ \vbadness=\@tempa\relax
+ \jlreq at getlastbox{\jlreq at tempboxa}%
+ \setbox\jlreq at tempboxb=\box\jlreq at resultbox
+ \jlreq at getlastbox{\jlreq at tempboxa}%
+ \setbox\jlreq at tempboxa=\box\jlreq at resultbox
+ \ifdim\jlreq at tempdima>0pt\relax
+ \setbox\jlreq at tempboxa=\vbox{\jlreq at inlinenote@fontsize
+ \hbox to \jlreq at tempdima{\unhbox\jlreq at tempboxa}%
+ \hbox to \jlreq at tempdima{\unhbox\jlreq at tempboxb}}%
+ \else
+ \setbox\jlreq at tempboxa=\vbox{\jlreq at inlinenote@fontsize
+ \hbox{\unhbox\jlreq at tempboxa}%
+ \hbox{\unhbox\jlreq at tempboxb}}%
+ \fi
+ \jlreq at box@putcenter\jlreq at tempboxa
+ }%
+ \advance\@tempcnta by 2\relax
+ }%
+ \fi
+ \jlreq at inlinenote@endnote
+}
+
+\newcommand*{\jlreq at inlinenote@noauto}[1]{%
+ \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize\inhibitglue\jlreq at open@bracket at before@space(}%
+ \inhibitglue\jlreq at box@putcenter\jlreq at tempboxa
+ \jlreq at inlinenote@noauto@#1\\\jlreq at endmark\jlreq at endmark
+ \jlreq at inlinenote@endnote
+}
+
+\def\jlreq at inlinenote@noauto@#1\\#2#3\jlreq at endmark{%
+ \jlreq at inlinenote@noauto@@#1&\jlreq at endmark\jlreq at endmark
+ \jlreq at ifendmark{#2}{}{\linebreak\jlreq at inlinenote@noauto@#2#3\jlreq at endmark}%
+}
+
+\def\jlreq at inlinenote@noauto@@#1#3\jlreq at endmark{%
+ \jlreq at ifendmark{#2}{%
+ \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize #1}%
+ \jlreq at tempdimc=\wd\@tempboxa
+ \divide\jlreq at tempdimc by 2\relax
+ \jlreq at inlinenote@determinelength{#1}{\jlreq at inlinenote@fontsize}{}{2}{2}{\jlreq at tempdimc}{\maxdimen}%
+ \ifvoid\jlreq at resultbox\else
+ {%
+ \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@fontsize\box\jlreq at resultbox}%
+ \jlreq at box@putcenter\jlreq at tempboxa
+ }%
+ \fi
+ \def\jlreq at next{}%
+ }{%
+ \def\jlreq at next{\jlreq at inlinenote@noauto@@@{#1}#2#3}%
+ }%
+ \jlreq at next
+}
+
+\def\jlreq at inlinenote@noauto@@@#1#2&\jlreq at endmark{%
+ \setbox\@tempboxa=\hbox{\jlreq at inlinenote@fontsize\vbox{\hbox{#1}\hbox{#2}}}%
+ \jlreq at box@putcenter\@tempboxa
+}
+
+\newcommand{\jlreq at inlinenote@endnote}{%
+ \jlreq at in@inlinenotefalse
+ {%
+ \setbox\jlreq at tempboxa=\hbox{\jlreq at inlinenote@kakkofontsize)}%
+ \jlreq at box@putcenter\jlreq at tempboxa
+ \inhibitglue
+ }%
+}
+
+% \jlreq at inlinenote@determinelength{テキスト(1)}{フォントとか指定(2)}{\parshape指定(3)}{調整に使う行数(4)}{成功行数(5)}{最小長さ(6)}{最大長さ(7)}
+% 次を満たす長さXの最小値を求める(ただし#6 <= X <= #7)
+% #1を
+% * #5 - #4行目までは#3の指定に従う
+% * それ以降はX
+% として整形した際に,#5行以内に収まる.
+% \jlreq at resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
+\newcommand{\jlreq at inlinenote@determinelength}[7]{%
+ \begingroup
+ % \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
+ \@tempcnta=1\relax
+ \def\@tempa{}%
+ % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq at tempdima.
+ \@whilenum\@tempcnta<#4\do{%
+ \expandafter\def\expandafter\@tempa\expandafter{\@tempa 0pt \the\jlreq at tempdima}%
+ \advance\@tempcnta by 1\relax
+ }%
+ \@tempcnta=0
+ \jlreq at tempdima=#6\relax
+ % \jlreq at tempdimaを少しずつ伸ばしていく
+ \@whilenum\@tempcnta<1000\do{%
+ \ifnum\@tempcnta>999\relax% ループが長すぎる
+ \global\setbox\jlreq at resultbox=\voidb at x%
+ \@tempcnta=1001\relax
+ \else
+ \setbox\@tempboxa=\vbox{#2%
+ \vbadness=10000\hbadness=10000\vfuzz=\maxdimen\hfuzz=\maxdimen
+ \parindent=0pt\leftskip=0pt\rightskip=0pt
+ \parshape #5 #3 \@tempa 0pt \the\maxdimen
+ #1\par\global\@tempcntb=\prevgraf}%
+ % \message{\string\jlreq at tempdima = \the\jlreq at tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}%
+ \fi
+ \jlreq at getlastbox{\@tempboxa}%
+ \setbox\jlreq at tempboxa=\box\jlreq at resultbox
+ \ifnum\@tempcntb<#5\relax% 行数が達していないならOK
+ % \message{行数 = \the\@tempcntb により確定}
+ % #5行になるまで空の水平ボックスを加えていく.
+ \global\setbox\jlreq at resultbox=\vbox{#2%
+ \unvbox\@tempboxa\hbox{\unhbox\jlreq at tempboxa\unskip\unskip\unpenalty}%
+ \@whilenum\@tempcntb<#5\do{\hbox{}\advance\@tempcntb by 1}}%
+ \@tempcnta=1001\relax
+ \else
+ % そうでない場合は最後の二行の長さを比較する
+ \jlreq at getlastbox{\@tempboxa}%
+ \setbox\jlreq at tempboxb=\box\jlreq at resultbox
+ % \message{最終行の長さ \the\wd\jlreq at tempboxa, その前の長さ \the\wd\jlreq at tempboxb}%
+ \ifdim\wd\jlreq at tempboxa>\wd\jlreq at tempboxb
+ \advance\jlreq at tempdima by 0.3pt\relax% 0.3ptに意味はない
+ \else
+ % 後ろが短いのでOK
+ \global\setbox\jlreq at resultbox=\vbox{#2\unvbox\@tempboxa\box\jlreq at tempboxb\box\jlreq at tempboxa}%
+ \jlreq at resultdimen=\jlreq at tempdima
+ \@tempcnta=1001\relax
+ \fi
+ \fi
+ \ifdim\jlreq at tempdima>#7\relax
+ \global\setbox\jlreq at resultbox=\box\voidb at x
+ \@tempcnta=1001\relax
+ \fi
+ \advance\@tempcnta by 1\relax
+ }%
+ \endgroup
+}
+
+%. ページスタイル.
+% メモ:
+% 2.6.1.cの後半が前半と整合的でないように見える……
+% 柱:両柱と片柱(2.6.3)
+\@tempdima=\jlreq at speciallength{\jlreq at headfoot@sidemargin}
+\ifthenelse{\lengthtest{\@tempdima=0pt} \OR \(\lengthtest{0.99\zw < \@tempdima} \AND \lengthtest{\@tempdima < 1.01\zw}\)}{}{
+ \jlreq at note{ノンブルまたは柱は,基本版面の左右にそろえるか,全角アキだけ寄せた位置に配置する (2.6.1.b).}
+}
+
+%.. 場所指定解析
+% bottom-leftみたいなのを解釈する.入力の順番はどっちでも良いが,出力は<top/bottom><left/right>の順番
+% #1 = bottom-leftみたいなのを{bottom}{left}に変換し,#2に代入,#3はデフォルト値,出力形式で入れる
+\newcommand*{\jlreq at pagestyle@parse at position}[3]{%
+ \jlreq at ifempty{#1}{\def#2{#3}}%
+ {%
+ \begingroup
+ \jlreq at pagestyle@parse at position@#1-\jlreq at endmark
+ % \jlreq at tempcに縦方向を,\jlreq at tempdに横方向を入れる
+ \def\jlreq at tempc{}\def\jlreq at tempd{}%
+ \jlreq at pagestyle@parse at position@@{\jlreq at tempa}%
+ \jlreq at pagestyle@parse at position@@{\jlreq at tempb}%
+ \ifx\jlreq at tempc\@empty\edef\jlreq at tempc{\expandafter\@firstoftwo#3}\fi
+ \ifx\jlreq at tempd\@empty\edef\jlreq at tempd{\expandafter\@secondoftwo#3}\fi
+ \edef\jlreq at do{\unexpanded{\def#2}{{\jlreq at tempc}{\jlreq at tempd}}}%
+ \expandafter\endgroup
+ \jlreq at do
+ }%
+}
+
+\def\jlreq at pagestyle@parse at position@#1-#2\jlreq at endmark{%
+ \def\jlreq at tempa{#1}\def\jlreq at tempb{#2}%
+ \jlreq at ifempty{#2}{%
+ \ifx\jlreq at tempb\@empty\ClassError{jlreq}{Invalid position: #1}{\@ehc}\fi
+ }{%
+ \def\@tempa##1-{\def\jlreq at tempb{##1}}%
+ \@tempa#2\relax
+ }%
+}
+
+\newcommand*\jlreq at pagestyle@parse at position@@[1]{%
+ \jlreq at switch{#1}{
+ {top}{\def\jlreq at tempc{#1}}
+ {bottom}{\def\jlreq at tempc{#1}}
+ {left}{\def\jlreq at tempd{#1}}
+ {right}{\def\jlreq at tempd{#1}}
+ {center}{\def\jlreq at tempd{#1}}
+ {gutter}{\if at tate\def\jlreq at tempd{right}\else\def\jlreq at tempd{left}\fi}
+ {fore_edge}{\if at tate\def\jlreq at tempd{left}\else\def\jlreq at tempd{right}\fi}
+ {fore-edge}{\if at tate\def\jlreq at tempd{left}\else\def\jlreq at tempd{right}\fi}
+ {\ClassError{jlreq}{Invalid position: #1}{\@ehc}}
+ }%
+}
+
+% レベル#1より低いレベルの見出しの**markを\markboth{}{}にする
+\def\jlreq at pagestyle@setclearmark#1{%
+ \@for\@tempa:=\jlreq at heading@allheadings\do{%
+ \@ifundefined{\@tempa}{}{%
+ \@ifundefined{jlreq at heading@level@\@tempa}{}{%
+ \ifnum\csname jlreq at heading@level@\@tempa\endcsname<#1\relax\expandafter\def\csname\@tempa mark\endcsname##1{\markboth{}{}}\fi
+ }%
+ }%
+ }%
+}
+
+% #1のleftとrightを入れ替えて#1に代入
+\def\jlreq at reverse@leftright#1{%
+ \jlreq at switch{#1}{
+ {left}{\def#1{right}}
+ {right}{\def#1{left}}
+ }%
+}
+
+%.. マークの拡張
+\def\jlreq at markregistername#1{jlreq at extramark@register@#1}
+\def\jlreq at extraleftmark#1{\jlreq at extramark@{#1}{\expandafter\@firstoftwo\botmarks}}
+\def\jlreq at extrarightmark#1{\jlreq at extramark@{#1}{\expandafter\@secondoftwo\firstmarks}}
+\def\jlreq at extramark@#1#2{\jlreq at if{\ifcsname\jlreq at markregistername{#1}\endcsname\fi}%
+ {\expandafter\jlreq at extramark@@\expandafter{\csname \jlreq at markregistername{#1}\endcsname}{#2}}%
+ {}%
+}
+\def\jlreq at extramark@@#1#2{#2#1\@empty\@empty}
+
+\def\jlreq at setextraleftmark@#1#2{{#2}{\expandafter\@secondoftwo#1}}
+\def\jlreq at setextrarightmark@#1#2{{\expandafter\@firstoftwo#1}{#2}}
+\def\jlreq at setextraleftmark#1#2{\jlreq at setextramark{#1}{#2}{\jlreq at setextraleftmark@}}
+\def\jlreq at setextrarightmark#1#2{\jlreq at setextramark{#1}{#2}{\jlreq at setextrarightmark@}}
+\def\jlreq at setextramark#1#2#3{%
+ \jlreq at if{\ifcsname\jlreq at markregistername{#1}\endcsname\fi}{}{%
+ \expandafter\newmarks\csname\jlreq at markregistername{#1}\endcsname
+ \expandafter\def\csname\jlreq at markregistername{#1}@themark\endcsname{{}{}}%
+ }%
+ \begingroup
+ \let\label\relax
+ \let\index\relax
+ \let\glossary\relax
+ \def\jlreq@@themark at csname{\jlreq at markregistername{#1}@themark}%
+ \expandafter\unrestored at protected@xdef\csname\jlreq@@themark at csname\endcsname{%
+ \expandafter#3\expandafter{\csname\jlreq@@themark at csname\endcsname}{#2}%
+ }%
+ \expandafter\expandafter\expandafter\@temptokena\expandafter\expandafter\expandafter{\csname\jlreq@@themark at csname\endcsname}%
+ \expandafter\marks\csname\jlreq at markregistername{#1}\endcsname{\the\@temptokena}%
+ \endgroup
+ \if at nobreak\ifvmode\nobreak\fi\fi
+}
+\let\jlreq at markboth=\markboth
+\let\jlreq at markright=\markright
+
+%.. \DeclarePageStyle内で使うもの
+% mark情報の取得を行う.
+% #1の中身をみて,#2 = 何段目見出しか,#3 = odd/even,\csname #4@<見出し命令名>\endcsnameに必要情報を追加し,#5の見出し命令名リストに追加
+% #1 at heading@levelにレベルを入れる
+\def\jlreq at pagestyle@setmark#1#2#3#4#5{%
+ \begingroup
+ \expandafter\jlreq at iffirsttoken\expandafter{#1}{_}{%
+ \ifthenelse{\equal{#3}{odd}}{\let\jlreq at leftright=r}{\let\jlreq at leftright=l}%
+ \edef\jlreq at do{%
+ \unexpanded{\def#1}{%
+ \ifx l\jlreq at leftright
+ \ifnum#2=0 \noexpand\leftmark\else\unexpanded{\jlreq at extraleftmark{#2}}\fi
+ \else
+ \ifnum#2=0 \noexpand\rightmark\else\unexpanded{\jlreq at extrarightmark{#2}}\fi
+ \fi
+ }%
+ }%
+ \edef\jlreq at headingname{\expandafter\@gobble#1}% 見出し命令名
+ \edef\jlreq at tempa{\noexpand\@removeelement{\expandonce{\jlreq at headingname}}}%
+ \expandafter\jlreq at tempa\expandafter{#5}{#5}%
+ \@ifundefined{#4@\jlreq at headingname}{\expandafter\def\csname #4@\jlreq at headingname\endcsname{}}{}%
+ \eappto\jlreq at do{%
+ \noexpand\let\expandonce{\csname\expandafter\@gobble\string #1 at heading@level\endcsname}=\expandonce{\csname jlreq at heading@level@\jlreq at headingname\endcsname}%
+ \unexpanded{\def#5}{\expandonce{#5},\expandonce{\jlreq at headingname}}%
+ \noexpand\appto\expandonce{\csname #4@\jlreq at headingname\endcsname}{{{\ifnum#2=0 #3\fi}{#2}{\ifx r\jlreq at leftright r\else l\fi}}}%
+ }%
+ }{\def\jlreq at do{}}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+% \def\<見出し>mark#1{...}というのを\jlreq at resultに入れる,
+% #1:*ならばextramarkを使う
+% #2: 見出し命令名,#3: mark_format
+% #4: {{mark_formatからさらに調べるやつ (odd|even)}{マークの何番目か.extraでない場合は0}{l or r(leftかrightか)}}の並び
+\def\jlreq at pagestyle@make at headingmark#1#2#3#4{%
+ \begingroup
+ \@for\jlreq at i:=0,1,2\do{%
+ \expandafter\def\csname jlreq at leftmark@\jlreq at i\endcsname{}%
+ \expandafter\def\csname jlreq at rightmark@\jlreq at i\endcsname{}%
+ }%
+ \jlreq at pagestyle@make at headingmark@{#2}{#3}#4\jlreq at endmark
+ \def\jlreq at do{}% とりあえず#1markの中身を入れていく
+ % leftを設定する時は対応するrightを空にする.
+ \expandafter\ifx\csname jlreq at leftmark@0\endcsname\@empty
+ \expandafter\ifx\csname jlreq at rightmark@0\endcsname\@empty\else
+ \eappto\jlreq at do{\jlreq at ifempty{#1}{\noexpand\markright}{\noexpand\jlreq at markright}{\csexpandonce{jlreq at rightmark@0}}}%
+ \fi
+ \else
+ \eappto\jlreq at do{\jlreq at ifempty{#1}{\noexpand\markboth}{\noexpand\jlreq at markboth}{\csexpandonce{jlreq at leftmark@0}}{\csexpandonce{jlreq at rightmark@0}}}%
+ \fi
+ \@for\jlreq at i:=1,2\do{%
+ \expandafter\ifx\csname jlreq at leftmark@\jlreq at i\endcsname\@empty
+ \expandafter\ifx\csname jlreq at rightmark@\jlreq at i\endcsname\@empty\else
+ \eappto\jlreq at do{\noexpand\jlreq at setextrarightmark{\jlreq at i}{\csexpandonce{jlreq at rightmark@\jlreq at i}}}%
+ \fi
+ \else
+ \eappto\jlreq at do{%
+ \noexpand\jlreq at setextraleftmark{\jlreq at i}{\csexpandonce{jlreq at leftmark@\jlreq at i}}%
+ \noexpand\jlreq at setextrarightmark{\jlreq at i}{\csexpandonce{jlreq at rightmark@\jlreq at i}}%
+ }%
+ \fi
+ }%
+ \ifx\jlreq at do\@empty\else
+ \edef\jlreq at do{%
+ \unexpanded{\edef\jlreq at result}{\noexpand\unexpanded{%
+ \noexpand\def\expandonce{\csname #2mark\endcsname}\unexpanded{##1}{%
+ \expandonce{\jlreq at do}%
+ }}%
+ }%
+ }%
+ \fi
+ \expandafter\endgroup
+ \jlreq at do
+}%
+\def\jlreq at pagestyle@make at headingmark@#1#2#3{%
+ \jlreq at ifendmark{#3}{}{\jlreq at pagestyle@make at headingmark@@{#1}{#2}#3}%
+}
+
+\def\jlreq at pagestyle@make at headingmark@@#1#2#3#4#5{%
+ % \jlreq at tempbに\***markの定義を入れる
+ \edef\jlreq at tempb{%
+ \expandonce{\csname the#1\endcsname}%
+ \noexpand\ifx\expandonce{\csname the#1\endcsname}\unexpanded{\@empty\else\protect\quad\fi}%
+ \unexpanded{##1}%
+ }%
+ \jlreq at parsekeyval@nokey{%
+ \jlreq at ifempty{##1}{}{\ifthenelse{\equal{##1}{#3}}{\edef\jlreq at tempb{\unexpanded{##2}}}{}}%
+ \ifthenelse{\equal{##1}{_#1}}{\edef\jlreq at tempb{\unexpanded{##2}}}{}%
+ }{#2}%
+ \ifx l#5%
+ \expandafter\edef\csname jlreq at leftmark@#4\endcsname{\expandonce{\jlreq at tempb}}%
+ \else
+ \expandafter\edef\csname jlreq at rightmark@#4\endcsname{\expandonce{\jlreq at tempb}}%
+ \fi
+ \jlreq at pagestyle@make at headingmark@{#1}{#2}%
+}
+
+% #2 #3 #4と並んだヘッダを作り#1に入れる.#1,#2,#3はコンロトールシークエンスの名前とする.
+\def\jlreq at pagestyle@setheadfoot#1#2#3#4{%
+ \begingroup
+ \edef\jlreq at do{\noexpand\jlreq at pagestyle@setheadfoot@{\unexpanded{#1}}{\csexpandonce{#2}}{\csexpandonce{#3}}{\csexpandonce{#4}}}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+% \edef内だと,#1 != 0ptならば\hskip \dimexpr#1\relaxになる
+\def\jlreq at pagestyle@hskip#1{%
+ \ifdim\dimexpr#1\relax=0pt \expandafter\@gobble\else\expandafter\@firstofone\fi
+ {\noexpand\hskip\noexpand\dimexpr#1\noexpand\relax}%
+}
+\def\jlreq at pagestyle@setheadfoot@#1#2#3#4{%
+ \begingroup
+ % - \Cdpは端にそろえるための補正
+ \jlreq at ifempty{#2}{\def\jlreq at left{}}{\edef\jlreq at left{\jlreq at pagestyle@hskip{\jlreq at expand@speciallength{\jlreq at headfoot@sidemargin}\if at tate - \Cdp\fi}\unexpanded{#2}}}%
+ % +\topskip - \Chtは\jlreq at headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正.
+ \jlreq at ifempty{#4}{\def\jlreq at right{}}{\edef\jlreq at right{\unexpanded{#4}\jlreq at pagestyle@hskip{\jlreq at expand@speciallength{\jlreq at headfoot@sidemargin}\if at tate + \topskip - \Cht\fi}}}%
+ \jlreq at ifempty{#3}{%
+ \edef\jlreq at do{\unexpanded{\def#1}{\expandonce{\jlreq at left}\hfil\expandonce{\jlreq at right}}}%
+ \jlreq at ifempty{#2}{\jlreq at ifempty{#4}{\def\jlreq at do{\def#1{}}}{}}{}%
+ }{% #3を完全に真ん中に配置するために左右の幅を0にしておく
+ \ifx\jlreq at left\@empty\else\edef\jlreq at left{\noexpand\hbox to 0pt{\expandonce{\jlreq at left}\noexpand\hss}}\fi
+ \ifx\jlreq at right\@empty\else\edef\jlreq at right{\noexpand\hbox to 0pt{\noexpand\hss\expandonce{\jlreq at right}}}\fi
+ \edef\jlreq at do{%
+ \unexpanded{\def#1}{\expandonce{\jlreq at left}\hfil\unexpanded{#3}\hfil\expandonce{\jlreq at right}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}%
+
+% #1の左右に傍注調整用の空白を入れて#1に代入する
+\def\jlreq at pagestyle@addsidenotemargin at left#1{%
+ \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{}%
+}
+\def\jlreq at pagestyle@addsidenotemargin at right#1{%
+ \jlreq at pagestyle@addsidenotemargin@{#1}{}{\marginparwidth+\marginparsep}%
+}
+\def\jlreq at pagestyle@addsidenotemargin at bothside#1{%
+ \jlreq at pagestyle@addsidenotemargin@{#1}{\marginparwidth+\marginparsep}{\marginparwidth+\marginparsep}%
+}
+% #2: 左,#3:右,#4:#2 + #3
+\def\jlreq at pagestyle@addsidenotemargin@#1#2#3{%
+ \ifx#1\@empty\else
+ \edef#1{%
+ \jlreq at ifempty{#2}{}{\unexpanded{\hskip-\dimexpr #2\relax}}%
+ \expandonce{#1}%
+ \jlreq at ifempty{#3}{}{\unexpanded{\hskip-\dimexpr #3\relax}}%
+ }%
+ \fi
+}
+
+% #1が空かつ#4が空でないならば#2に#3と#4の中身を追加し,#4を空にする.引数は全てコントロールシークエンス
+\def\jlreq at pagestyle@addifempty#1#2#3#4{%
+ \ifx#1\@empty\ifx#4\@empty\else\eappto#2{\expandonce{#3}\expandonce{#4}}\def#4{}\fi\fi
+}
+
+\newif\ifjlreq at PageStyle@first
+% #1に入っている{柱1}{柱2}...{柱n}という並びから,実際に出力する柱を構築する.n>=1を仮定する.
+% 間に空白を入れる.
+% #1: ターゲットなコントロールシークエンスの名前,#2:*ならばreverseする,#3:空き
+\def\jlreq at pagestyle@make at runninghead#1#2#3{%
+ \jlreq at if{\expandafter\ifx\csname #1\endcsname\@empty\fi}{}{%
+ \edef\jlreq at do{%
+ \noexpand\jlreq at tempatrue % 最初の処理かフラグ
+ \unexpanded{\jlreq at pagestyle@make at runninghead@{#1}{#2}{#3}}\csexpandonce{#1}\noexpand\jlreq at endmark
+ }%
+ \expandafter\def\csname #1\endcsname{}%
+ \jlreq at do
+ % 項目が二つ以上あった.
+ \ifjlreq at tempa\else\cspreto{#1}{\jlreq at PageStyle@firsttrue}\fi
+ }%
+}
+\def\jlreq at pagestyle@make at runninghead@#1#2#3#4#5{%
+ \jlreq at if{\ifnum\numexpr\jlreq at ifendmark{#5\fi}{1}{0}*\ifjlreq at tempa 1\else 0\fi\relax=1 \fi}{%
+ % 項目が一つしか無い
+ \jlreq at ifempty{#2}{\csappto}{\cspreto}{#1}{#4}%
+ }{%
+ % 最初の空でない柱に出会うまでは柱の間の空白を入れない.
+ % 空でない柱に出会ってないならば\ifjlreq at PageStyle@firstはtrue.
+ % 一番最初の\jlreq at PageStyle@firsttrueは後で入れる.
+ \jlreq at ifempty{#2}{\csappto}{\cspreto}{#1}{%
+ \protected at edef\jlreq at tempa{#4}%
+ \ifx\jlreq at tempa\@empty\else
+ \ifjlreq at PageStyle@first\else\hskip\glueexpr#3\relax\fi
+ \jlreq at tempa
+ \jlreq at PageStyle@firstfalse
+ \fi
+ }%
+ \jlreq at tempafalse
+ \jlreq at ifendmark{#5}{}{\jlreq at pagestyle@make at runninghead@{#1}{#2}{#3}{#5}}%
+ }%
+}
+
+% #1= cs,#2 = フォーマットの入ったcs,#3 = デフォルトフォーマットの入ったcs
+\def\jlreq at pagestyle@applyformat#1#2#3{%
+ % デフォルト時に限り,\hbox to ***{空トークン}を避ける
+ \ifnum 0\ifx#1\@empty\else 1\fi\ifx#2\relax\else 1\fi>0
+ \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\ifx#2\relax\expandonce{#3}\else\expandonce{#2}\fi}}\jlreq at do
+ \edef#1{\expandafter\expandonce\expandafter{\expandafter\jlreq at tempa\expandafter{#1}}}%
+ \fi
+}
+
+% フォント情報を追加する.#1:制御綴り名,#2:フォント命令の入っている制御綴名,#1に返す
+\def\jlreq at pagestyle@addfont at tocs#1#2{%
+ \expandafter\ifx\csname #1\endcsname\@empty\else
+ \expandafter\ifx\csname #2\endcsname\@empty\else
+ \expandafter\edef\csname #1\endcsname{{\csexpandonce{#2}\csexpandonce{#1}}}%
+ \fi
+ \fi
+}
+% こちらは#1にトークン列を与える.\edefで展開される.制御綴名#3に代入.
+\def\jlreq at pagestyle@addfont at totokens#1#2#3{%
+ \begingroup
+ \edef\jlreq at do{\noexpand\edef\expandonce{\csname#3\endcsname}{\unexpanded{#1}}}%
+ \expandafter\ifx\csname #2\endcsname\@empty\else
+ \edef\jlreq at tempa{#1}%
+ \ifx\jlreq at tempa\@empty\else
+ \edef\jlreq at do{%
+ \noexpand\edef\expandonce{\csname #3\endcsname}{\noexpand\unexpanded{%
+ {\csexpandonce{#2}\expandonce{\jlreq at tempa}}%
+ }}%
+ }%
+ \fi
+ \fi
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+%.. \DeclarePageStyle
+\newbox\jlreq at PageStyle@box
+\newcommand{\DeclarePageStyle}[2]{%
+ \expandafter\edef\csname jlreq at pagestyle@setting@#1\endcsname{\unexpanded{#2}}%
+ \begingroup
+ \def\jlreq at nombre@i at position{}%
+ \def\jlreq at nombre@i{\thepage}%
+ \def\jlreq at running@head at i@position{}%
+ \def\jlreq at odd@running at head@i{}%
+ \def\jlreq at even@running at head@i{}%
+ \def\jlreq at command{}%
+ \def\jlreq at mark@format{}%
+ \def\jlreq at font{}%
+ \def\jlreq at nombre@font{}%
+ \def\jlreq at running@head at font{}%
+ % フォーマットを空という可能性もあるかもしれないので,デフォルト値は\relaxで表す.
+ \let\jlreq at oddheadformat\relax
+ \let\jlreq at evenheadformat\relax
+ \let\jlreq at oddfootformat\relax
+ \let\jlreq at evenfootformat\relax
+ % 柱とノンブルの間
+ \def\jlreq at gap{1.5\zw}%
+ \def\jlreq at nombre@gap{}%
+ \def\jlreq at running@head at gap{}%
+ \newif\ifjlreq at clearmarkcommand\jlreq at clearmarkcommandtrue
+ \newif\ifjlreq at pstate\jlreq at pstatefalse % PageStyleTATE
+ \@for\jlreq at i:=ii,iii\do{%
+ \expandafter\def\csname jlreq at nombre@\jlreq at i @position\endcsname{}%
+ \expandafter\def\csname jlreq at running@head@\jlreq at i @position\endcsname{}%
+ \expandafter\def\csname jlreq at nombre@\jlreq at i\endcsname{}%
+ \expandafter\def\csname jlreq at odd@running at head@\jlreq at i\endcsname{}%
+ \expandafter\def\csname jlreq at even@running at head@\jlreq at i\endcsname{}%
+ \expandafter\def\csname jlreq at nombre@\jlreq at i @font\endcsname{}%
+ \expandafter\def\csname jlreq at running@head@\jlreq at i @font\endcsname{}%
+ }%
+ \jlreq at parsekeyval[PageStyle:#1]{
+ *{tate}{\jlreq at pstatetrue}
+ *{yoko}{\jlreq at pstatefalse}
+ {nombre}{\def\jlreq at nombre@i{##1}}
+ {nombre_position}{\def\jlreq at nombre@i at position{##1}}
+ {running_head_position}{\def\jlreq at running@head at i@position{##1}}
+ {odd_running_head}{\def\jlreq at odd@running at head@i{##1}}
+ {even_running_head}{\def\jlreq at even@running at head@i{##1}}
+ {font}{%
+ \def\jlreq at nombre@font{##1}%
+ \def\jlreq at running@head at font{##1}%
+ }
+ {nombre_font}{\def\jlreq at nombre@font{##1}}
+ {running_head_font}{\def\jlreq at running@head at font{##1}}
+ {mark_format}{\edef\jlreq at mark@format{\unexpanded{##1}}}
+ {command}{\edef\jlreq at command{\unexpanded{##1}}}
+ {gap}{\def\jlreq at gap{##1}}
+ {nombre_gap}{\def\jlreq at nombre@gap{##1}}
+ {running_head_gap}{\def\jlreq at running@head at gap{##1}}
+ % trueにすると,\ps@***実行時にまず\***markを全て\@gobbleにする.
+ {clear_markcommand}[true,false]{\csname jlreq at clearmarkcommand##1\endcsname}
+ {odd_head_format}{\edef\jlreq at oddheadformat{\unexpanded{##1}}}
+ {even_head_format}{\edef\jlreq at evenheadformat{\unexpanded{##1}}}
+ {odd_foot_format}{\edef\jlreq at oddfootformat{\unexpanded{##1}}}
+ {even_foot_format}{\edef\jlreq at evenfootformat{\unexpanded{##1}}}
+ % 二つ目
+ {nombre_ii}{\def\jlreq at nombre@ii{##1}}
+ {nombre_ii_position}{\def\jlreq at nombre@ii at position{##1}}
+ {running_head_ii_position}{\def\jlreq at running@head at ii@position{##1}}
+ {odd_running_head_ii}{\def\jlreq at odd@running at head@ii{##1}}
+ {even_running_head_ii}{\def\jlreq at even@running at head@ii{##1}}
+ {nombre_ii_font}{\def\jlreq at nombre@ii at font{##1}}
+ {running_head_ii_font}{\def\jlreq at running@head at ii@font{##1}}
+ % 三つ目
+ {nombre_iii}{\def\jlreq at nombre@iii{##1}}
+ {nombre_iii_position}{\def\jlreq at nombre@iii at position{##1}}
+ {running_head_iii_position}{\def\jlreq at running@head at iii@position{##1}}
+ {odd_running_head_iii}{\def\jlreq at odd@running at head@iii{##1}}
+ {even_running_head_iii}{\def\jlreq at even@running at head@iii{##1}}
+ {nombre_iii_font}{\def\jlreq at nombre@iii at font{##1}}
+ {running_head_iii_font}{\def\jlreq at running@head at iii@font{##1}}
+ }{#2}%
+ % ノンブル同士の間や柱同士の間のデフォルトはノンブルと柱の間の空き量
+ \ifx\jlreq at nombre@gap\@empty\let\jlreq at nombre@gap=\jlreq at gap\fi
+ \ifx\jlreq at running@head at gap\@empty\let\jlreq at running@head at gap=\jlreq at gap\fi
+ % _iiが存在するか調べて\ifjlreq at headii@existに入れる
+ \newif\ifjlreq at headii@exist
+ \jlreq at headii@existfalse
+ \jlreq at for@noexpand\jlreq at tempa:=\jlreq at odd@running at head@ii,\jlreq at odd@running at head@ii\do{%
+ \expandafter\ifx\jlreq at tempa\@empty\else\jlreq at headii@existtrue\fi
+ }%
+ % markの処理
+ % (odd|even)_running_head(_ii)が_<見出し命令>で与えられている場合,次のようにする.
+ % * \jlreq@(odd|even)@running at head(@ii)をマーク出力命令(\(left|right)mark or \jlreq at extra(left|right)mark{<num>})に書き換える
+ % - evenの場合はleft,oddの場合はright.
+ % - @iiがなければ\(left|right)mark,@iiがあれば\jlreq at extra(left|right)mark{1}
+ % * 例えば_<見出し命令>が_sectionならば,\jlreq at markdata@sectionに{{<I1>}{<I2>}{<I3>}}を追加する.ここで<I1>,<I2>,<I3>は
+ % - I1: @iiが無いときにodd or even
+ % - I2: @iiが無ければ0,あれば1.
+ % - I3: マーク出力命令がleftかrightに応じて l or r.(上述のようにoddかevenかで判定される.)
+ % * 他にも_sectionが指定されている柱があれば,\jlreq at markdata@sectionにさらに追加で加えていく.
+ % * \jlreq@(odd|even)@running at head(@ii)@heading at levelに<見出し命令>のレベルを入れる.レベルが不明な時は\relaxになる.
+ % また,\jlreq at headingmarklistに<見出し命令>の一覧を入れる.
+ \def\jlreq at headingmarklist{}%
+ \@for\jlreq at parity:=odd,even\do{%
+ \@for\jlreq at i:=0,1,2\do{%
+ % \jlreq at pagestyle@setmarkが上の処理を行う.
+ \edef\jlreq at next{\noexpand\jlreq at pagestyle@setmark{\expandonce{\csname jlreq@\jlreq at parity @running at head@\@roman\numexpr\jlreq at i + 1\relax\endcsname}}{\expandonce{\jlreq at i}}{\expandonce{\jlreq at parity}}{jlreq at markdata}{\noexpand\jlreq at headingmarklist}}%
+ \jlreq at next
+ }%
+ }%
+ % \jlreq at minimumlevelに見出しの最低(数値が小さいという意味)レベルを入れる.
+ \let\jlreq at minimumlevel=\@undefined
+ \def\jlreq at markdefinecommand{}%
+ \@for\jlreq at heading:=\jlreq at headingmarklist\do{%
+ \ifx\jlreq at heading\@empty\else
+ \expandafter\let\expandafter\jlreq at level\csname jlreq at heading@level@\jlreq at heading\endcsname
+ \ifx\jlreq at level\relax\else
+ \ifx\jlreq at minimumlevel\@undefined\let\jlreq at minimumlevel=\jlreq at level
+ \else\ifnum\jlreq at minimumlevel>\jlreq at level\space\let\jlreq at minimumlevel=\jlreq at level\fi\fi
+ \fi
+ % \jlreq at markdata@<見出し命令>にある情報とmark_formatをもとに,\<見出し命令>markを定義するマクロを作成,\jlreq at markdefinecommandに入れる.
+ \edef\jlreq at do{\noexpand\jlreq at pagestyle@make at headingmark{\ifjlreq at headii@exist *\fi}{\expandonce{\jlreq at heading}}{\expandonce{\jlreq at mark@format}}{\csexpandonce{jlreq at markdata@\jlreq at heading}}}%
+ \jlreq at do
+ \eappto\jlreq at markdefinecommand{\expandonce{\jlreq at result}}%
+ \fi
+ }%
+ \ifx\jlreq at minimumlevel\@undefined\else
+ \eappto\jlreq at markdefinecommand{\noexpand\jlreq at pagestyle@setclearmark{\expandonce{\jlreq at minimumlevel}}}%
+ \fi
+ % 見出しを出す場合:evenに章などの高いレベルの見出しを出す(2.6.3.a)
+ \@ifundefined{jlreq at odd@running at head@i at heading@level}{}{\@ifundefined{jlreq at even@running at head@i at heading@level}{}{%
+ \ifnum\jlreq at odd@running at head@i at heading@level<\jlreq at even@running at head@i at heading@level
+ \jlreq at note{偶数ページには奇数ページよりアウトラインレベルの高い見出しを入れる (ページスタイル #1 内,2.6.3.a).}%
+ \fi
+ }}%
+ % 二番目以降にフォント設定を追加
+ \@for\jlreq at i:=ii,iii\do{%
+ \@for\jlreq at parity:=odd,even\do{%
+ \jlreq at pagestyle@addfont at tocs{jlreq@\jlreq at parity @running at head@\jlreq at i}{jlreq at running@head@\jlreq at i @font}%
+ }%
+ \jlreq at pagestyle@addfont at tocs{jlreq at nombre@\jlreq at i}{jlreq at nombre@\jlreq at i @font}%
+ }%
+ % \jlreq at oddhead,\jlreq at oddfoot,\jlreq at evenhead,\jlreq at evenfootに必要なものを入れる.
+ \jlreq at if{\ifjlreq at pstate\fi}{% tate
+ % headの方に処理を入れる.footは空.
+ \def\jlreq at oddfoot{}\def\jlreq at evenfoot{}%
+ \jlreq at for@noexpand\jlreq at position:=\jlreq at nombre@i at position,\jlreq at running@head at i@position\do{%
+ \expandafter\ifx\jlreq at position\@empty\expandafter\def\jlreq at position{0pt}\fi
+ }%
+ \edef\jlreq at gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq at nombre@gap}\noexpand\relax}%
+ \jlreq at pagestyle@addifempty{\jlreq at nombre@iii at position}{\jlreq at nombre@ii}{\jlreq at gapcs}{\jlreq at nombre@iii}%
+ \jlreq at pagestyle@addifempty{\jlreq at nombre@ii at position}{\jlreq at nombre@i}{\jlreq at gapcs}{\jlreq at nombre@ii}%
+ \edef\jlreq at gapcs{\noexpand\hskip\noexpand\glueexpr\expandonce{\jlreq at running@head at gap}\noexpand\relax}%
+ \jlreq at pagestyle@addifempty{\jlreq at running@head at iii@position}{\jlreq at odd@running at head@ii}{\jlreq at gapcs}{\jlreq at odd@running at head@iii}%
+ \jlreq at pagestyle@addifempty{\jlreq at running@head at ii@position}{\jlreq at odd@running at head@i}{\jlreq at gapcs}{\jlreq at odd@running at head@ii}%
+ \jlreq at pagestyle@addifempty{\jlreq at running@head at iii@position}{\jlreq at even@running at head@ii}{\jlreq at gapcs}{\jlreq at even@running at head@iii}%
+ \jlreq at pagestyle@addifempty{\jlreq at running@head at ii@position}{\jlreq at even@running at head@i}{\jlreq at gapcs}{\jlreq at even@running at head@ii}%
+ \def\jlreq at nombre@contents{}% ノンブルを入れる(下の方に出力)
+ \@for\jlreq at i:=i,ii,iii\do{%
+ \expandafter\let\expandafter\jlreq at position\csname jlreq at nombre@\jlreq at i @position\endcsname
+ \expandafter\ifx\csname jlreq at nombre@\jlreq at i\endcsname\@empty\else
+ \jlreq at ifgluezero{\glueexpr\jlreq at position\relax}{\def\jlreq at position{}}{}%
+ \eappto\jlreq at nombre@contents{%
+ \noexpand\hbox to 0pt{\noexpand\hss
+ \ifx\jlreq at position\@empty\else\unexpanded{\hskip \glueexpr}\expandonce{\jlreq at position}\noexpand\relax\fi
+ \csexpandonce{jlreq at nombre@\jlreq at i}%
+ }%
+ }%
+ \fi
+ }%
+ \jlreq at pagestyle@addfont at tocs{jlreq at nombre@contents}{jlreq at nombre@font}%
+ % \jlreq@(odd|even)@contentsに柱を入れる(上の方に出力)
+ \@for\jlreq at parity:=odd,even\do{%
+ \expandafter\def\csname jlreq@\jlreq at parity @contents\endcsname{}%
+ \@for\jlreq at i:=i,ii,iii\do{%
+ \expandafter\let\expandafter\jlreq at position\csname jlreq at running@head@\jlreq at i @position\endcsname
+ \expandafter\ifx\csname jlreq@\jlreq at parity @running at head@\jlreq at i\endcsname\@empty\else
+ \jlreq at ifgluezero{\glueexpr\jlreq at position\relax}{\def\jlreq at position{}}{}%
+ \expandafter\eappto\csname jlreq@\jlreq at parity @contents\endcsname{%
+ \noexpand\hbox to 0pt{\unexpanded{\hskip\glueexpr\headsep + \headheight}%
+ \if at tate\else\unexpanded{+ \topskip - \Cht}\fi
+ \ifx\jlreq at position\@empty\else + \expandonce{\jlreq at position}\fi\noexpand\relax
+ \csexpandonce{jlreq@\jlreq at parity @running at head@\jlreq at i}%
+ \noexpand\hss
+ }%
+ }%
+ \fi
+ }%
+ \jlreq at pagestyle@addfont at tocs{jlreq@\jlreq at parity @contents}{jlreq at running@head at font}%
+ % \jlreq@(odd|even)headの構築
+ % 空き指定には基本版面の文字サイズを使う(2.6.1.c)
+ \@ifundefined{jlreq@\jlreq at parity headformat}
+ {\def\jlreq at format{####1}}%
+ {\expandafter\let\expandafter\jlreq at format\csname jlreq@\jlreq at parity headformat\endcsname}%
+ \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\expandonce{\jlreq at format}}}\jlreq at do
+ \edef\jlreq at tempb{%
+ \csexpandonce{jlreq@\jlreq at parity @contents}%
+ \noexpand\hfil
+ \expandonce{\jlreq at nombre@contents}%
+ }%
+ \expandafter\edef\csname jlreq@\jlreq at parity head\endcsname{%
+ \unexpanded{\setbox\jlreq at tempboxa=\hbox to \dimexpr\headsep + \headheight + \textheight}\if at tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax
+ {%
+ \unexpanded{\tate\adjustbaseline}%
+ \expandafter\expandonce\expandafter{\expandafter\jlreq at tempa\expandafter{\jlreq at tempb}}%
+ }%
+ % Underful対策
+ \ifx l\jlreq at engine
+ \unexpanded{\wd\jlreq at tempboxa=\headheight}%
+ \else
+ \unexpanded{\ht\jlreq at tempboxa=\headheight\dp\jlreq at tempboxa=0pt}%
+ \fi
+ }%
+ }%
+ % \jlreq at tempboxaを正しく配置する
+ \edef\jlreq at lefthead@adjustbox{%
+ \noexpand\hskip\noexpand\dimexpr\if at tate\unexpanded{- \Cdp}\fi \unexpanded{- \headsep - 1\zw\relax}%
+ \unexpanded{\box\jlreq at tempboxa\hfil}%
+ }%
+ \edef\jlreq at righthead@adjustbox{%
+ \noexpand\hskip\unexpanded{\dimexpr\textwidth}\if at tate\unexpanded{- \topskip + \Cht}\fi\unexpanded{ + \headsep\relax}%
+ \unexpanded{\box\jlreq at tempboxa\hss}%
+ }%
+ \if at tate
+ \eappto\jlreq at oddhead{\expandonce{\jlreq at lefthead@adjustbox}}%
+ \eappto\jlreq at evenhead{\expandonce{\jlreq at righthead@adjustbox}}%
+ \else
+ \eappto\jlreq at oddhead{\expandonce{\jlreq at righthead@adjustbox}}%
+ \eappto\jlreq at evenhead{\expandonce{\jlreq at lefthead@adjustbox}}%
+ \fi
+ }{% yoko
+ % 場所を正規化する.
+ \def\jlreq at nombre@i at position@default{{bottom}{center}}%
+ \def\jlreq at running@head at i@position at default{{top}{center}}%
+ % ii以降の位置は指定されていない場合はiのそれに合わせる
+ \@for\jlreq at tempa:=jlreq at nombre,jlreq at running@head\do{%
+ \@for\jlreq at i:=ii,iii\do{%
+ \expandafter\ifx\csname\jlreq at tempa @\jlreq at i @position\endcsname\@empty
+ \expandafter\let\csname\jlreq at tempa @\jlreq at i @position\expandafter\endcsname\csname\jlreq at tempa @i at position\endcsname
+ \fi
+ \expandafter\edef\csname\jlreq at tempa @\jlreq at i @position at default\endcsname{\csname\jlreq at tempa @i at position@default\endcsname}%
+ }%
+ }%
+ \@for\jlreq at tempa:=jlreq at nombre@i at position,jlreq at nombre@ii at position,jlreq at nombre@iii at position,jlreq at running@head at i@position,jlreq at running@head at ii@position,jlreq at running@head at iii@position\do{%
+ \edef\jlreq at next{\noexpand\jlreq at pagestyle@parse at position{\csexpandonce{\jlreq at tempa}}{\expandonce{\csname\jlreq at tempa\endcsname}}{\csexpandonce{\jlreq at tempa @default}}}%
+ \jlreq at next
+ }%
+ \ifthenelse{\(
+ \boolean{@tate} \AND \(
+ \equal{\expandafter\@secondoftwo\jlreq at nombre@i at position}{right} \OR
+ \equal{\expandafter\@secondoftwo\jlreq at running@head at i@position}{right}
+ \)\) \OR \(
+ \(\NOT \boolean{@tate}\) \AND \(
+ \equal{\expandafter\@secondoftwo\jlreq at nombre@i at position}{left} \OR
+ \equal{\expandafter\@secondoftwo\jlreq at running@head at i@position}{left}
+ \)
+ \)}{%
+ \if at twoside
+ \jlreq at note{柱やノンブルは,左ページでは,基本版面の左端の延長線にノンブル又は柱の先頭をそろえて配置するか,基本版面の左端の延長線から基本版面の文字サイズの全角アキだけ右に寄せた位置に配置する (ページスタイル #1 内,2.6.1.b).}%
+ \fi
+ }{}%
+ % フォント変更命令に文字出力命令が入っているとエラーになるのを回避するために\setboxでごまかす.
+ \setbox\jlreq at tempboxa=\hbox{\jlreq at running@head at font
+ \ifthenelse{\lengthtest{\jlreq at gap < 1.49\zw} \OR \( \lengthtest{\jlreq at gap > 1.51\zw} \AND \lengthtest{\jlreq at gap < 1.99\zw} \) \OR \lengthtest{\jlreq at gap > 2.01\zw}}{\jlreq at note{ノンブルと柱との空き量は柱に使用する文字サイズの2倍又は1.5倍とする (ページスタイル #1 内,2.6.1.c).}}{}%
+ }%
+ % 初期化
+ \@for\jlreq at parity:=odd,even\do{%
+ \@for\jlreq at vert:=top,bottom\do{%
+ \@for\jlreq at hor:=left,center,right\do{%
+ \@for\jlreq at type:=nombre,running at head\do{%
+ \expandafter\def\csname jlreq@\jlreq at type @\jlreq at parity @\jlreq at vert @\jlreq at hor\endcsname{}%
+ }%
+ }%
+ }%
+ % ページが左か右か
+ \jlreq at ifleftpage{\jlreq at parity}{\def\jlreq at pagehor{left}}{\def\jlreq at pagehor{right}}%
+ % \jlreq@(running at head|nombre)@(odd|even)@(top|bottom)@(left|center|right)に入れていく
+ % 左ページではノンブルが左(2.6.1.c),i,ii,...はiが左になるようにする.
+ \@for\jlreq at i:=i,ii,iii\do{%
+ % nombre
+ \expandafter\ifx\csname jlreq at nombre@\jlreq at i\endcsname\@empty\else
+ \edef\jlreq at position{\csname jlreq at nombre@\jlreq at i @position\endcsname}%
+ \edef\jlreq at vert{\expandafter\@firstoftwo\jlreq at position}%
+ \edef\jlreq at hor{\expandafter\@secondoftwo\jlreq at position}%
+ \ifthenelse{\equal{\jlreq at parity}{even}}{\jlreq at reverse@leftright{\jlreq at hor}}{}%
+ \jlreq at ifleftpage{\jlreq at parity}{\let\jlreq at addtocs=\cseappto}{\let\jlreq at addtocs\csepreto}%
+ \edef\jlreq at csname{jlreq at nombre@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
+ \expandafter\ifx\csname\jlreq at csname\endcsname\@empty\else\jlreq at addtocs{\jlreq at csname}{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at nombre@gap}\noexpand\relax}\fi
+ \jlreq at addtocs{\jlreq at csname}{\csexpandonce{jlreq at nombre@\jlreq at i}}%
+ \fi
+ % running at head
+ % 一度「紙面の外から」の順番で{A}{B}{C}と入れる
+ \expandafter\ifx\csname jlreq@\jlreq at parity @running at head@\jlreq at i \endcsname\@empty\else
+ \edef\jlreq at position{\csname jlreq at running@head@\jlreq at i @position\endcsname}%
+ \edef\jlreq at vert{\expandafter\@firstoftwo\jlreq at position}%
+ \edef\jlreq at hor{\expandafter\@secondoftwo\jlreq at position}%
+ \ifthenelse{\equal{\jlreq at parity}{even}}{\jlreq at reverse@leftright{\jlreq at hor}}{}%
+ \ifthenelse{\equal{\jlreq at hor}{\jlreq at pagehor}}{\let\jlreq at addtocs=\cseappto}{\let\jlreq at addtocs=\csepreto}%
+ \edef\jlreq at csname{jlreq at running@head@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
+ \jlreq at addtocs{\jlreq at csname}{{\csexpandonce{jlreq@\jlreq at parity @running at head@\jlreq at i}}}%
+ \fi
+ }%
+ % {A}{B}{C}の順だった柱を結合する.本体は\jlreq at pagestyle@make at runninghead.
+ \@for\jlreq at vert:=top,bottom\do{%
+ \@for\jlreq at hor:=left,center,right\do{%
+ \ifthenelse{\equal{\jlreq at hor}{right}}{\def\jlreq at tempa{*}}{\def\jlreq at tempa{}}%
+ \edef\jlreq at do{\noexpand\jlreq at pagestyle@make at runninghead{jlreq at running@head@\jlreq at parity @\jlreq at vert @\jlreq at hor}{\expandonce{\jlreq at tempa}}{\expandonce{\jlreq at running@head at gap}}}%
+ \jlreq at do
+ }%
+ }%
+ % ノンブルと柱を結合し,必要ならばフォント設定をする.
+ \@for\jlreq at vert:=top,bottom\do{%
+ \@for\jlreq at hor:=left,center,right\do{%
+ \edef\jlreq at csname{jlreq@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
+ \edef\jlreq at runheadcsname{jlreq at running@head@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
+ \edef\jlreq at nombrecsname{jlreq at nombre@\jlreq at parity @\jlreq at vert @\jlreq at hor}%
+ % nombreにフォント設定を追加.
+ \expandafter\ifx\csname\jlreq at nombrecsname\endcsname\@empty\else
+ \ifx\jlreq at nombre@font\@empty\else
+ \expandafter\edef\csname\jlreq at nombrecsname\endcsname{{\expandonce{\jlreq at nombre@font}\csexpandonce{\jlreq at nombrecsname}}}%
+ \fi
+ \fi
+ \jlreq at if{\expandafter\ifx\csname\jlreq at runheadcsname\endcsname\@empty\fi}{%
+ % 柱が空:ノンブルのみでよい
+ \expandafter\let\csname\jlreq at csname\expandafter\endcsname\csname\jlreq at nombrecsname\endcsname
+ }{%
+ \jlreq at if{\expandafter\ifx\csname\jlreq at nombrecsname\endcsname\@empty\fi}{%
+% % ノンブルが空.柱のみでよい.
+ \jlreq at pagestyle@addfont at tocs{\jlreq at runheadcsname}{jlreq at running@head at font}%
+ \expandafter\let\csname\jlreq at csname\expandafter\endcsname\csname\jlreq at runheadcsname\endcsname
+ }{%
+% % 両方ある場合:左ページではノンブルが左,右ページではノンブルが右.
+ \jlreq at ifleftpage{\jlreq at parity}{%
+ \ifthenelse{\equal{\jlreq at hor}{right}}{%
+ % <ノンブル><空き><柱>,右寄せ
+ % 柱が空出ないときに限り<空き>を入れる.
+ \jlreq at pagestyle@addfont at totokens{\unexpanded{\ifdim\wd\jlreq at PageStyle@box=0pt \else\hskip}\expandonce{\jlreq at gap}\unexpanded{\relax\fi}}{jlreq at running@head at font}{jlreq at tempa}%
+ \expandafter\edef\csname\jlreq at csname\endcsname{%
+ \unexpanded{\setbox\jlreq at PageStyle@box=\hbox}{\expandonce{\jlreq at running@head at font}\csexpandonce{\jlreq at runheadcsname}}%
+ \csexpandonce{\jlreq at nombrecsname}\expandonce{\jlreq at tempa}\unexpanded{\box\jlreq at PageStyle@box}%
+ }%
+ }{%
+ % <ノンブル><空き><柱>,左寄せ
+ % ノンブルは常に空ではないと仮定する.
+ \jlreq at pagestyle@addfont at totokens{\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at gap}\noexpand\relax\csexpandonce{\jlreq at runheadcsname}}{jlreq at running@head at font}{jlreq at tempa}%
+ \expandafter\edef\csname\jlreq at csname\endcsname{\csexpandonce{\jlreq at nombrecsname}\expandonce{\jlreq at tempa}}%
+ }%
+ }{%
+ \ifthenelse{\equal{\jlreq at hor}{left}}{%
+ % <柱><空き><ノンブル>,左寄せ
+ \jlreq at pagestyle@addfont at totokens{%
+ \unexpanded{\setbox\jlreq at PageStyle@box=\hbox}{\csexpandonce{\jlreq at runheadcsname}}%
+ \unexpanded{\copy\jlreq at PageStyle@box\ifdim\wd\jlreq at PageStyle@box=0pt \else\hskip\glueexpr}\expandonce{\jlreq at gap}\unexpanded{\relax\fi}%
+ }{jlreq at running@head at font}{jlreq at tempa}%
+ \expandafter\edef\csname\jlreq at csname\endcsname{\expandonce{\jlreq at tempa}\csexpandonce{\jlreq at nombrecsname}}%
+ }{%
+ % <柱><空き><ノンブル>,右寄せ
+ \jlreq at pagestyle@addfont at totokens{\csexpandonce{\jlreq at runheadcsname}\unexpanded{\hskip\glueexpr}\expandonce{\jlreq at gap}\noexpand\relax}{jlreq at running@head at font}{jlreq at tempa}%
+ \expandafter\edef\csname\jlreq at csname\endcsname{\expandonce{\jlreq at tempa}\csexpandonce{\jlreq at nombrecsname}}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ }%
+ % 四カ所構築
+ \jlreq at pagestyle@setheadfoot{\jlreq at oddhead}{jlreq at odd@top at left}{jlreq at odd@top at center}{jlreq at odd@top at right}%
+ \jlreq at pagestyle@setheadfoot{\jlreq at oddfoot}{jlreq at odd@bottom at left}{jlreq at odd@bottom at center}{jlreq at odd@bottom at right}%
+ \jlreq at pagestyle@setheadfoot{\jlreq at evenhead}{jlreq at even@top at left}{jlreq at even@top at center}{jlreq at even@top at right}%
+ \jlreq at pagestyle@setheadfoot{\jlreq at evenfoot}{jlreq at even@bottom at left}{jlreq at even@bottom at center}{jlreq at even@bottom at right}%
+ \ifthenelse{\lengthtest{\marginparwidth>0pt} \AND \(\NOT\boolean{@tate}\)}{%
+ \def\jlreq at defaultformat{\hss\hbox to \jlreqyokoheadlength{####1}\hss}%
+ }{%
+ \def\jlreq at defaultformat{####1}%
+ }%
+ \jlreq at pagestyle@applyformat{\jlreq at oddhead}{\jlreq at oddheadformat}{\jlreq at defaultformat}%
+ \jlreq at pagestyle@applyformat{\jlreq at evenhead}{\jlreq at evenheadformat}{\jlreq at defaultformat}%
+ \jlreq at pagestyle@applyformat{\jlreq at oddfoot}{\jlreq at oddfootformat}{\jlreq at defaultformat}%
+ \jlreq at pagestyle@applyformat{\jlreq at evenfoot}{\jlreq at evenfootformat}{\jlreq at defaultformat}%
+ % 傍注用調整
+ \ifdim\marginparwidth>0pt
+ \if at tate\else
+ \if at twocolumn
+ \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at oddhead}%
+ \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at oddfoot}%
+ \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at evenhead}%
+ \jlreq at pagestyle@addsidenotemargin at bothside{\jlreq at evenfoot}%
+ \else
+ \jlreq at pagestyle@addsidenotemargin at right{\jlreq at oddhead}%
+ \jlreq at pagestyle@addsidenotemargin at right{\jlreq at oddfoot}%
+ \jlreq at pagestyle@addsidenotemargin at left{\jlreq at evenhead}%
+ \jlreq at pagestyle@addsidenotemargin at left{\jlreq at evenfoot}%
+ \fi
+ \fi
+ \fi
+ }%
+ \edef\jlreq at do{%
+ \noexpand\edef\expandonce{\csname ps@#1\endcsname}{%
+ \noexpand\unexpanded{%
+ \unexpanded{\def\jlreq at current@pagestyle{#1}}%
+ \ifjlreq at clearmarkcommand\unexpanded{\jlreq at heading@execmacro at toallheadings\jlreq at clearheadingmarks}\fi
+ \ifjlreq at headii@exist
+ \unexpanded{\let\@mkboth=\jlreq at markboth}%
+ \else
+ \unexpanded{\let\@mkboth=\markboth}%
+ \fi
+ \unexpanded{\def\@oddhead}{\expandonce{\jlreq at oddhead}}%
+ \unexpanded{\def\@oddfoot}{\expandonce{\jlreq at oddfoot}}%
+ \unexpanded{\def\@evenhead}{\expandonce{\jlreq at evenhead}}%
+ \unexpanded{\def\@evenfoot}{\expandonce{\jlreq at evenfoot}}%
+ \expandonce{\jlreq at markdefinecommand}%
+ \expandonce{\jlreq at command}%
+ }%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\if at tate
+ \def\jlreqyokoheadlength{\textheight}
+\else
+ \ifdim\marginparwidth>0pt
+ \if at twocolumn
+ \def\jlreqyokoheadlength{\dimexpr\textwidth + 2\marginparwidth + 2\marginparsep\relax}
+ \else
+ \def\jlreqyokoheadlength{\dimexpr\textwidth + \marginparwidth + \marginparsep\relax}
+ \fi
+ \else
+ \def\jlreqyokoheadlength{\textwidth}
+ \fi
+\fi
+\edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if at tate\else\unexpanded{- \topskip + 1\zh}\fi\noexpand\relax}
+
+\newcommand*{\NewPageStyle}[2]{%
+ \expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
+}
+\newcommand*{\RenewPageStyle}[2]{%
+ \@ifundefined{ps@#1}{\@latex at 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 at pagestyle@setting@#1}{\ClassError{jlreq}{Unknown pagestyle: #1}{\@ehc}}{}%
+ \expandafter\let\expandafter\setting\expandafter=\csname jlreq at pagestyle@setting@#1\endcsname
+ \edef\jlreq at do{\noexpand\RenewPageStyle{#1}{\expandonce{\setting},\unexpanded{#2}}}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+%. フロート関連
+% 4.3.3.dの例,縦組みの時だけど横にも適用……
+\setlength{\floatsep}{1\jlreq at gol plus 1\jlreq at gol}
+\setlength{\textfloatsep}{1\jlreq at gol plus \baselineskip}
+\intextsep=\textfloatsep
+\dblfloatsep=\floatsep
+\dbltextfloatsep=\textfloatsep
+% 残りはデフォルトにしておく.
+
+%. 環境も引数にとる可能性のある\jlreqsetup用マクロ.
+% #3={<設定1>,<環境名>=<設定2>}のようなものを受け付ける.
+% #2に<設定1>が,#2@<環境名>に<設定2>が入る.#1には#2@<環境名>が定義されている<環境名>をカンマ区切りで入れる.
+% \jlreqsetup{X,env=B}の後に\jlreqsetup{Y}を指定すると,env環境に対する設定はYになるようにする.
+% ただし\jlreqsetup{env=C,Y}とした場合はenv環境に対してはC.
+\long\def\jlreq at jlreqsetup@withenv#1#2#3{%
+ \@ifundefined{#1}{\expandafter\def\csname #1\endcsname{}}{}%
+ \begingroup
+ \def\jlreq at do{}%
+ \jlreq at parsekeyval@nokey{%
+ \ifjlreq at parsekeyval@nokey at novalue{%
+ \epreto\jlreq at do{%
+ \noexpand\edef\expandonce{\csname #2\endcsname}{\unexpanded{\unexpanded{##1}}}
+ \noexpand\def\expandonce{\csname #1\endcsname}{}%
+ }%
+ \expandafter\@for\expandafter\jlreq at tempa\expandafter:\expandafter=\csname #1\endcsname\do{%
+ \epreto\jlreq at do{\noexpand\let\expandonce{\csname #2@\jlreq at tempa\endcsname}\noexpand\@undefined}%
+ }%
+ }{%
+ \eappto\jlreq at do{%
+ \noexpand\edef\expandonce{\csname #2@##1\endcsname}{\unexpanded{\unexpanded{##2}}}%
+ \unexpanded{\def\jlreq at tempa{\jlreq at helper@removeelement{##1}}}%
+ \unexpanded{\expandafter\jlreq at tempa\expandafter}{\expandonce{\csname #1\endcsname}}{\expandonce{\csname #1\endcsname}}%
+ \unexpanded{\csappto{#1}{,##1}}%
+ }%
+ }%
+ }{#3}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+% #1@#2が定義されていれば\#1@#2の中身に,そうでなければ\#1の中身に展開される.
+% 展開は\unexpandedで抑制される.
+\def\jlreq at jlreqsetup@withenv at nameuse#1#2{%
+ \jlreq at if{\expandafter\ifx\csname #1@#2\endcsname\relax\fi}{\csexpandonce{#1}}{\csexpandonce{#1@#2}}%
+}
+% 4.3.1 注4
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+
+%. 図表
+\newcommand{\@makecaption}[2]{{%
+ % \jlreq at tempbに現在の環境を入れる.
+ \@ifundefined{@currenvir}{%
+ \@ifundefined{@captype}%
+ {\def\jlreq at tempb{}}%
+ {\let\jlreq at tempb=\@captype}%
+ }{\let\jlreq at tempb=\@currenvir}%
+ \reset at font\small
+ \vskip\abovecaptionskip
+ \edef\jlreq at do{\unexpanded{\def\jlreq at tempa##1}{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at label@format at setting}{\jlreq at tempb}}}%
+ \jlreq at do
+ \setbox\jlreq at tempboxa=\hbox{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at label@font at setting}{\jlreq at tempb}#1}%
+ \ifdim\wd\jlreq at tempboxa=0pt
+ \edef\jlreq at tempa{{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at font@setting}{\jlreq at tempb}\unexpanded{#2}}}%
+ \else
+ \edef\jlreq at tempa{%
+ {\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at label@font at setting}{\jlreq at tempb}\expandonce{\jlreq at tempa{#1}}}%
+ \unexpanded{\hskip\glueexpr}\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at after@label at space@setting}{\jlreq at tempb}\noexpand\relax
+ {\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at font@setting}{\jlreq at tempb}\unexpanded{#2}}%
+ }%
+ \fi
+ \setbox\@tempboxa=\hbox{\jlreq at tempa}%
+ \edef\jlreq at tempc{\jlreq at jlreqsetup@withenv at nameuse{jlreq@@makecaption at align@setting}{\jlreq at tempb}}%
+ \expandafter\let\expandafter\jlreq at align\jlreq at tempc
+ \ifdim\wd\@tempboxa>\hsize\relax
+ {%
+ \ifx c\jlreq at align\centering\fi
+ \ifx r\jlreq at align\raggedleft\fi
+ \unhbox\@tempboxa\par
+ }%
+ \else
+ \global\@minipagefalse
+ \hbox to\hsize{%
+ \ifnum0\ifx c\jlreq at align 1\fi\ifx r\jlreq at align 1\fi>0 \hfil\fi
+ \unhbox\@tempboxa
+ \ifnum0\ifx c\jlreq at align 1\fi\ifx l\jlreq at align 1\fi>0 \hfil\fi
+ }%
+ \fi
+ \vskip\belowcaptionskip}}
+
+\jlreq at jlreqsetup@add{caption_font}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at font@envlist}{jlreq@@makecaption at font@setting}{#1}}
+\jlreq at jlreqsetup@add{caption_label_font}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at label@font at envlist}{jlreq@@makecaption at label@font at setting}{#1}}
+\jlreq at jlreqsetup@add{caption_label_format}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at label@format at envlist}{jlreq@@makecaption at label@format at setting}{#1}}
+\jlreq at jlreqsetup@add{caption_after_label_space}{\jlreq at jlreqsetup@withenv{jlreq@@makecaption at after@label at space@envlist}{jlreq@@makecaption at after@label at space@setting}{#1}}
+
+\def\jlreq@@makecaption at align@clearandsetalign#1{%
+ \@for\jlreq at tempa:=\jlreq@@makecaption at align@envlist\do{%
+ \ifx\jlreq at tempa\@empty\else
+ \eappto\jlreq at generalset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@\jlreq at tempa\endcsname}=\noexpand\@undefined}%
+ \fi
+ }%
+ \appto\jlreq at generalset{%
+ \def\jlreq@@makecaption at align@envlist{}%
+ \let\jlreq@@makecaption at align@setting=#1%
+ }%
+}
+\jlreq at jlreqsetup@add{caption_align}{%
+ \@ifundefined{jlreq@@makecaption at align@envlist}{\def\jlreq@@makecaption at align@envlist{}}{}%
+ \begingroup
+ \def\jlreq at generalset{}\def\jlreq at envset{}%
+ \jlreq at parsekeyval@nokey{%
+ \jlreq at ifempty{##1}{}{%
+ \jlreq at switch{##1}{%
+ {center}{\jlreq@@makecaption at align@clearandsetalign{c}}
+ {left}{\jlreq@@makecaption at align@clearandsetalign{l}}
+ {right}{\jlreq@@makecaption at align@clearandsetalign{r}}
+ {top}{\jlreq@@makecaption at align@clearandsetalign{l}}
+ {bottom}{\jlreq@@makecaption at align@clearandsetalign{r}}
+ {%
+ \jlreq at switch{##2}{%
+ {center}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=c}}%
+ {left}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=l}}%
+ {right}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=r}}%
+ {top}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=l}}%
+ {bottom}{\eappto\jlreq at envset{\noexpand\let\expandonce{\csname jlreq@@makecaption at align@setting@##1\endcsname}=r}}%
+ }%
+ \appto\jlreq at envset{%
+ \def\jlreq at tempa{\jlreq at helper@removeelement{##1}}%
+ \expandafter\jlreq at tempa\expandafter{\jlreq@@makecaption at align@envlist}{\jlreq@@makecaption at align@envlist}%
+ \appto\jlreq@@makecaption at align@envlist{,##1}%
+ }%
+ }%
+ }%
+ }%
+ }{#1}%
+ \edef\jlreq at do{\expandonce{\jlreq at generalset}\expandonce{\jlreq at envset}}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+% 特に根拠のない値
+\setlength\abovecaptionskip{.5\jlreq at gol}
+\setlength\belowcaptionskip{0pt}
+
+%.. figure環境
+\newcounter{figure}
+\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+ \renewcommand{\thefigure}{\@arabic\c at figure}
+}{%
+ \@addtoreset{figure}{chapter}
+ \renewcommand{\thefigure}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at figure}
+}
+\newcommand*{\fps at figure}{h}
+\newcommand*{\ftype at figure}{1}
+\newcommand*{\ext at figure}{lof}
+\newcommand*{\fnum at figure}{\figurename\thefigure}
+\newenvironment{figure}{\@float{figure}}{\end at float}
+\newenvironment{figure*}{\@dblfloat{figure}}{\end at dblfloat}
+
+%.. table環境
+\newcounter{table}
+\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+ \renewcommand{\thetable}{\@arabic\c at table}
+}{%
+ \@addtoreset{table}{chapter}
+ \renewcommand{\thetable}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at table}
+}
+\newcommand*{\fps at table}{h}
+\newcommand*{\ftype at table}{2}
+\newcommand*{\ext at table}{lot}
+\newcommand*{\fnum at table}{\tablename\thetable}
+\newenvironment{table}{\@float{table}}{\end at float}
+\newenvironment{table*}{\@dblfloat{table}}{\end at dblfloat}
+
+%. タイトル周り
+\newenvironment{titlepage}{%
+ \if at twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse\newpage
+ \fi
+ \thispagestyle{empty}%
+ \setcounter{page}{1}%
+}{%
+ \if at restonecol\twocolumn\else\newpage\fi
+ \if at twoside\else
+ \setcounter{page}{1}%
+ \fi
+}
+
+\if at 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 at tate
+ \let\jlreq at temporary@original at ialign=\ialign
+ \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq at temporary@original at 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 at endofmaketitle
+ }
+\else
+ \newcommand{\maketitle}{%
+ \par
+ \begingroup
+ \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
+ \renewcommand{\@makefnmark}{\hbox{%
+ \jlreq at iftdir{\yoko}{}%
+ \rlap{\@textsuperscript{\normalfont\@thefnmark}}%
+ }}%
+ \renewcommand{\jlreq at referencemark@format}[1]{\@makefnmark}% うーん
+ \if at twocolumn
+ \ifnum\col at 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 at endofmaketitle
+ }
+\fi
+% いろいろクリアする.
+\def\jlreq at endofmaketitle{%
+ \setcounter{footnote}{0}%
+ \global\let\thanks\relax
+ \global\let\maketitle\relax
+ \global\let\p at 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 at keepbaselineskip{\LARGE}\@title\par}%
+ \vskip\baselineskip
+ {\jlreq at keepbaselineskip{\large}%
+ \lineskip .5\zh
+ % 縦書き時には表組み内でも縦書きにするようにする
+ \if at tate
+ \let\jlreq at temporary@original at ialign=\ialign
+ \pretocmd{\ialign}{\unexpanded{\tate\let\ialign=\jlreq at temporary@original at ialign}}{}{}%
+ \fi
+ \begin{tabular}[t]{c}%
+ \@author
+ \end{tabular}%
+ \par
+ }%
+ \ifx\@date\@empty\else
+ \vskip\baselineskip
+ {\jlreq at keepbaselineskip{\large}\@date}%
+ \fi
+ \end{center}%
+ \par
+ \vskip\baselineskip
+ \ifvoid\jlreq at abstractbox\else\unvbox\jlreq at abstractbox\fi
+}
+
+%.. abstract
+\def\jlreq at parhook@abstract{}
+\ifthenelse{\equal{\jlreq at article@type}{book}}{}{% article,report
+ \newbox\jlreq at abstractbox
+ \newcommand*{\abstractname}{概要}
+ \if at 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 at twocolumn\else1\fi\ifjlreq at preamble1\fi>0
+ \ifjlreq at preamble
+ \ifx l\jlreq at engine\else
+ \def\jlreq at parhook@abstract{\futurelet\jlreq at nextchar\jlreq at openbracket@hook}%
+ \PushPostHook{par}{\jlreq at parhook@abstract}%
+ \fi
+ \fi
+ % とりあえず全部ボックスに入れる.
+ \global\setbox\jlreq at abstractbox=\vtop\bgroup
+ \ifjlreq at preamble
+ % preamble後っぽく振る舞う
+ \@noskipsecfalse
+ % \@nodocumentが入っているので一時的に無効化
+ \everypar{}%
+ \fi
+ \if at 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 at twocolumn\else1\fi\ifjlreq at preamble1\fi>0
+ \endlist
+ \egroup
+ \vspace{\baselineskip}%
+ \if at twocolumn
+ \end{minipage}
+ \fi
+ \egroup
+ \fi
+ \ifjlreq at preamble
+ \ifx l\jlreq at engine\else
+ \def\jlreq at parhook@abstract{}%
+ \fi
+ \else
+ \unvbox\jlreq at 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 at original@@item=\@item
+% \def\@item[##1]{\jlreq at original@@item[##1]\mbox{}\par
+ }}{\endlist}
+\newcommand{\descriptionlabel}[1]{\normalfont\sffamily\bfseries #1}
+
+%.. 箇条書き
+% #3={<設定1>,i=<設定2>,<環境名>={<設定3>,ii=<設定4>}}のような設定を解釈する.
+% <設定2>は#2 at iに,<設定4>は#2 at ii@<環境名>に格納される.
+% <設定1>の指定はi=<設定1>,..,vi=<設定1>と等価.<設定3>も同様.
+% #1には現在何か値が定義されている環境名をカンマ区切りで入れる.
+\long\def\jlreq at jlreqsetup@itemization#1#2#3{
+ \@ifundefined{#1}{\expandafter\def\csname #1\endcsname{}}{}%
+ \begingroup
+ \def\jlreq at generalset{}%
+ \def\jlreq at levelset{}%
+ \def\jlreq at envset{}%
+ \jlreq at parsekeyval@nokey{%
+ \ifjlreq at parsekeyval@nokey at novalue{%
+ % 生の値.環境に対するものをクリアし,全ての<i-iv>に同じ値を設定
+ % 環境一覧リストもクリア.
+ \@for\jlreq at tempa:=i,ii,iii,iv,v,vi\do{%
+ \expandafter\@for\expandafter\jlreq at tempb\expandafter:\expandafter=\csname #1\endcsname\do{%
+ \ifx\jlreq at tempb\@empty\else
+ \eappto\jlreq at generalset{\noexpand\let\expandonce{\csname #2@\jlreq at tempa @\jlreq at tempb\endcsname}\noexpand\@undefined}%
+ \fi
+ }%
+ \eappto\jlreq at generalset{%
+ \noexpand\edef\expandonce{\csname #2@\jlreq at tempa\endcsname}{\unexpanded{\unexpanded{##1}}}%
+ }%
+ }%
+ \appto\jlreq at generalset{\expandafter\def\csname #1\endcsname{}}%
+ }{%
+ \ifthenelse{\equal{##1}{i} \OR \equal{##1}{ii} \OR \equal{##1}{iii} \OR \equal{##1}{iv} \OR \equal{##1}{v} \OR \equal{##1}{vi}}{%
+ % i=とかの時,環境に対応するものをクリアし,\#2@##1に値を入れる
+ \expandafter\@for\expandafter\jlreq at tempa\expandafter:\expandafter=\csname #1\endcsname\do{
+ \ifx\jlreq at tempa\@empty\else
+ \epreto\jlreq at envset{\noexpand\let\expandonce{\csname #2@##1@\jlreq at tempa\endcsname}\noexpand\@undefined}%
+ \fi
+ }%
+ \eappto\jlreq at envset{\noexpand\edef\expandonce{\csname #2@##1\endcsname}{\unexpanded{\unexpanded{##2}}}}%
+ }{%
+ % そうでないとき,環境.##1 = 環境名
+ \jlreq at parsekeyval@nokey{%
+ \ifjlreq at parsekeyval@nokey at novalue{%
+ % i - viまでに全てセットする.
+ \@for\jlreq at tempa:=i,ii,iii,iv,v,vi\do{%
+ \epreto\jlreq at envset{\noexpand\edef\expandonce{\csname #2@\jlreq at tempa @##1\endcsname}{\unexpanded{\unexpanded{####1}}}}%
+ }%
+ }{%
+ % ピンポイント代入
+ \eappto\jlreq at envset{\noexpand\edef\expandonce{\csname #2@####1@##1\endcsname}{\unexpanded{\unexpanded{####2}}}}%
+ }%
+ }{##2}%
+ \eappto\jlreq at envset{%
+ \unexpanded{\def\jlreq at tempa{\jlreq at helper@removeelement{##1}}}%
+ \unexpanded{\expandafter\jlreq at tempa\expandafter}{\expandonce{\csname #1\endcsname}}{\expandonce{\csname #1\endcsname}}%
+ \noexpand\appto\expandonce{\csname #1\endcsname}{\unexpanded{,##1}}%
+ }%
+ }%
+ }%
+ }{#3}%
+ \edef\jlreq at do{\expandonce{\jlreq at generalset}\expandonce{\jlreq at levelset}\expandonce{\jlreq at envset}}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\def\jlreq at itemization@beforeafter at space@envlist{}
+\jlreq at jlreqsetup@add{itemization_beforeafter_space}{\jlreq at jlreqsetup@itemization{jlreq at itemization@beforeafter at space@envlist}{jlreq at itemization@beforeafter at space@setting}{#1}}
+\jlreq at jlreqsetup@add{itemization_itemsep}{\jlreq at jlreqsetup@withenv{jlreq at itemization@itemsep at envlist}{jlreq at itemization@itemsep at setting}{#1}}
+\jlreq at jlreqsetup@add{itemization_labelsep}{\jlreq at jlreqsetup@withenv{jlreq at itemization@labelsep at envlist}{jlreq at itemization@labelsep at setting}{#1}}
+\jlreq at jlreqsetup@add{itemization_label_length}{\jlreq at jlreqsetup@itemization{jlreq at itemization@label at length@envlist}{jlreq at itemization@label at length@setting}{#1}}
+% enumerate, itemize用初期化,#1 = i,ii,...
+\def\jlreq at init@list#1{%
+ \setlength{\partopsep}{0pt}%
+ \setlength{\itemsep}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@itemsep at setting}{\@currenvir}}%
+ \setlength{\parsep}{0pt}%
+ \setlength{\listparindent}{\parindent}%
+ \setlength{\labelsep}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@labelsep at setting}{\@currenvir}\relax}%
+ \setlength{\labelwidth}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@label at length@setting@#1}{\@currenvir}\relax}%
+ \setlength{\topsep}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@beforeafter at space@setting@#1}{\@currenvir}\relax}%
+ \setlength{\leftmargin}{\dimexpr\csname leftmargin#1\endcsname}%
+ \setlength{\itemindent}{\dimexpr\jlreq at jlreqsetup@withenv at nameuse{jlreq at itemization@label at length@setting@#1}{\@currenvir} + \labelsep - \leftmargin\relax}%
+}
+
+\def\@listi{\jlreq at init@list{i}}%
+\let\@listI\@listi
+\def\@listii{\jlreq at init@list{ii}}
+\def\@listiii{\jlreq at init@list{iii}}
+\def\@listiv{\jlreq at init@list{iv}}
+\def\@listv{\jlreq at init@list{v}}
+\def\@listvi{\jlreq at init@list{vi}}
+
+% 引用系.3.5.2の例.
+\jlreq at jlreqsetup@add{quote_indent}{\def\jlreq at quote@indent{#1}}
+\jlreq at jlreqsetup@add{quote_end_indent}{\def\jlreq at quote@end at indent{#1}}
+\jlreq at jlreqsetup@add{quote_fontsize}[normalsize,small,footnotesize,scriptsize,tiny,]{\jlreq at ifempty{#1}{\def\jlreq at quote@fontsize{}}{\edef\jlreq at quote@fontsize{\expandonce{\csname #1\endcsname}}}}
+\jlreq at jlreqsetup@add{quote_beforeafter_space}{\def\jlreq at quote@beforeafter at space{#1}}
+
+\newenvironment{verse}
+ {\let\\\@centercr
+ \list{}{\itemsep\z@ \itemindent -2\jlreq at mol
+ \listparindent\itemindent
+ \labelwidth\z@
+ \labelsep\z@
+ \leftmargin=\dimexpr\jlreq at quote@indent\relax
+ \addtolength{\leftmargin}{2\jlreq at mol}%
+ \rightmargin=\dimexpr\jlreq at quote@end at indent\relax
+ \jlreq at 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 at quote@beforeafter at space\relax
+ \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax}%
+ \item\relax}{\endlist}
+\newenvironment{quotation}
+ {\list{}{%
+ \leftmargin=\dimexpr\jlreq at quote@indent\relax
+ \rightmargin=\dimexpr\jlreq at quote@end at indent\relax
+ \jlreq at 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 at quote@beforeafter at space\relax
+ \parsep\z@ \@plus.1\jlreq at gol}%
+ \item\relax}{\endlist}
+\newenvironment{quote}
+ {\list{}{%
+ \leftmargin=\dimexpr\jlreq at quote@indent\relax
+ \rightmargin=\dimexpr\jlreq at quote@end at indent\relax
+ \jlreq at 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 at speciallength{\jlreq at quote@beforeafter at space}%
+ \listparindent\z@}%
+ \item\relax}{\endlist}
+
+%. 表関係 4.4
+% 表内の行間を0にする(4.4.3.f)
+\jlreq at saveoriginalcs{\tabular}
+\jlreq at 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 at omotekeiwidth} % 4.4.3.c
+\setlength\doublerulesep{2pt}
+\setlength\tabbingsep{\labelsep}
+\skip\@mpfootins=\skip\footins
+\setlength\fboxsep{.3\zw}
+\setlength\fboxrule{\jlreq at omotekeiwidth} % 根拠はない
+% 後で
+\ifthenelse{\equal{\jlreq at article@type}{article}}{%
+ \renewcommand{\theequation}{\@arabic\c at equation}
+}{%
+ \@addtoreset{equation}{chapter}
+ \renewcommand{\theequation}{\ifnum\c at chapter>\z@\thechapter.\fi \@arabic\c at equation}
+}
+
+%. 目次
+\setcounter{tocdepth}{3}
+\newcommand{\@pnumwidth}{2\jlreq at mol}
+\newcommand{\@tocrmarg}{2.55em}
+\newcommand{\@dotsep}{2} % 狭くしてみた
+\newskip\toclineskip
+\setlength\toclineskip{0\jlreq at gol plus .02\jlreq at gol}
+% tarticleから
+\newdimen\@lnumwidth
+\def\numberline#1{\hbox to\@lnumwidth{#1\hfil}}
+\def\addcontentsline#1#2#3{%
+ \protected at write\@auxout{%
+ \let\label\@gobble\let\index\@gobble\let\glossary\@gobble
+ \if at tate
+ \@temptokena{\jlreq at rensuji{\thepage}}%
+ \else
+ \@temptokena{\thepage}%
+ \fi
+ }{\string\@writefile{#1}{\protect\contentsline{#2}{#3}{\the\@temptokena}}}%
+}
+
+\newcount\jlreq at top@contents % トップ見出しを入れる.レベルと同じ値.
+\jlreq at top@contents=-100
+\newcommand*{\jlreq at set@top at contents}[1]{%
+ \ifnum\jlreq at top@contents=-100
+ \jlreq at top@contents=#1\relax
+ \fi
+}
+\ifthenelse{\equal{\jlreq at article@type}{article}}{
+ \newcommand{\tableofcontents}{%
+ \jlreq at top@contents=-100\relax
+ \if at twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \section*{\contentsname}%
+ \@mkboth{\contentsname}{\contentsname}%
+ \@starttoc{toc}%
+ \if at restonecol\twocolumn\fi
+ }
+}{% book, report
+ \newcommand{\tableofcontents}{%
+ \jlreq at top@contents=-100\relax
+ \if at twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi
+ \chapter*{\contentsname}%
+ \@mkboth{\contentsname}{\contentsname}%
+ \@starttoc{toc}%
+ \if at restonecol\twocolumn\fi
+ }
+}
+% JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
+% 文字の大きさは全て同じ(\normalsize)にする.
+% 見出しのレベルがあがると1文字分ずつ字下げしていく.
+% 第三引数は,上からの幅に加え更にトップの見出しからの差による補正(プラス)が入る.
+% 補正には\jlreq at top@contentsを使う.
+% 「トップ」というか,一番最初に現れた見出しを入れる.
+% リーダーは.から・に変更しました.
+\def\@dottedtocline#1#2#3#4#5{%
+ \jlreq at set@top at contents{#1}%
+ \ifnum #1>\c at 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 at top@contents
+ \@tempdima=1\jlreq at mol
+ \multiply \@tempdima by \@tempcnta
+ \advance\leftskip \@lnumwidth \hbox{}\hskip -\leftskip
+ \advance\leftskip\@tempdima
+ {#4}\nobreak
+ \leaders\hbox{$\m at th\mkern \@dotsep mu$\null\inhibitglue ・\inhibitglue\null$\m at th\mkern \@dotsep mu$}%
+ \hfill\nobreak
+ \hb at xt@\@pnumwidth{\hss\normalfont\normalcolor #5}%
+ \par}%
+ \fi}
+
+% listoffigures
+\newcommand{\listoffigures}{%
+ \jlreq at top@contents=-100
+ \section*{\listfigurename}%
+ \@mkboth{\listfigurename}{\listfigurename}%
+ \@starttoc{lof}%
+}
+\newcommand*{\l at figure}{\@dottedtocline{1}{0\jlreq at gol}{2\jlreq at gol}}
+\newcommand{\listoftables}{%
+ \jlreq at top@contents=-100
+ \section*{\listtablename}%
+ \@mkboth{\listtablename}{\listtablename}%
+ \@starttoc{lot}%
+}
+\let\l at table\l at figure
+
+%. 文献,そのまま
+\newdimen\bibindent
+\setlength\bibindent{2\jlreq at mol}
+\newcommand{\newblock}{\hskip .11em\@plus.33em\@minus.07em}
+\newenvironment{thebibliography}[1]{%
+ \jlreq at oldfontcommand@enable
+ \section*{\refname}%
+ \@mkboth{\refname}{\refname}%
+ \list{\@biblabel{\@arabic\c at enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \labelsep=1\zw
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \itemindent=0pt
+ \@openbib at code
+ \usecounter{enumiv}%
+ \let\p at enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c at enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty\clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m
+}{%
+ \def\@noitemerr{\@latex at warning{Empty `thebibliography' environment}}%
+ \endlist
+ \jlreq at oldfontcommand@disable
+}
+\let\@openbib at code\@empty
+
+%. 索引
+\newif\ifjlreq at resttate
+\newenvironment{theindex}{%
+ \jlreq at oldfontcommand@enable
+ \jlreq at iftdir{\clearpage\yoko\jlreq at resttatetrue}{\jlreq at resttatefalse}% 常に横書きにする
+ \if at twocolumn\@restonecolfalse\else\@restonecoltrue\fi
+ \columnseprule\z@ \columnsep 2\jlreq at mol
+ \twocolumn[\section*{\indexname}]%
+ \@mkboth{\indexname}{\indexname}%
+ \jlreq at theindex@pagestyle
+ \parindent\z@
+ \parskip\z@ \@plus .03\jlreq at gol\relax
+ \let\item\@idxitem
+}{%
+ \ifx\jlreq at theindex@savedpagestyle\@undefined\else\expandafter\pagestyle\expandafter{\jlreq at theindex@savedpagestyle}\fi
+ \let\jlreq at theindex@savedpagestyle\@undefined
+ \if at restonecol\onecolumn\else\clearpage\fi
+ \ifjlreq at resttate\tate\fi
+ \jlreq at oldfontcommand@disable
+}
+\newcommand{\@idxitem}{\par\hangindent 4\jlreq at mol}
+\newcommand{\subitem}{\@idxitem \hspace*{2\jlreq at mol}}
+\newcommand{\subsubitem}{\@idxitem \hspace*{3\jlreq at mol}}
+\newcommand{\indexspace}{\par \vskip 1\jlreq at gol \@plus .5\jlreq at gol \@minus .3\jlreq at gol\relax}
+\def\jlreq at theindex@pagestyle{}
+\jlreq at jlreqsetup@add{theindex_pagestyle}{
+ \def\jlreq at tempa{}% ページスタイル名
+ \def\jlreq at theindex@pagestyle{}%
+ \jlreq at tempafalse % restore
+ \jlreq at parsekeyval@nokey{%
+ \ifjlreq at parsekeyval@nokey at novalue{\def\jlreq at tempa{##1}}{%
+ \jlreq at switch{##1}{%
+ {restore}{\csname jlreq at tempa##2\endcsname}%
+ }%
+ }%
+ }{#1}%
+ \eappto\jlreq at theindex@pagestyle{\unexpanded{\let\jlreq at theindex@savedpagestyle}\ifjlreq at tempa\noexpand\jlreq at current@pagestyle\else\noexpand\@undefined\fi}%
+ \ifx\jlreq at tempa\@empty\else
+ \eappto\jlreq at theindex@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq at tempa}}}%
+ \fi
+}
+
+%. 前付,後付,付録
+% \jlreq at matter@heading[restoreする見出し一覧を入れる制御綴]{#2@<見出し命令名>に今の見出しの中身を入れる}{生成する制御綴の名前}{設定}
+\def\jlreq at matter@heading{\@ifnextchar[{\jlreq at matter@heading@}{\jlreq at matter@heading@[]{}}}
+\def\jlreq at matter@heading@[#1]#2#3#4{%
+ \begingroup
+ \def\jlreq at restoreheadings{}% 復帰させる見出し名(カンマ区切り)
+ \def\jlreq at headingscmds{}% \ModiryHeadings**,\RenewHeadings**の塊
+ \jlreq at parsekeyval@nokey{%
+ % ##1 = 見出し命令名, ##2 = 設定
+ \def\jlreq at headingsettings{}% Modifyする中身
+ \def\jlreq at declaretype{Modify}%
+ \def\jlreq at level{}%
+ \jlreq at tempatrue % restore
+ \jlreq at parsekeyval@nokey{%
+ % 各見出し命令に対する設定を解析
+ \ifjlreq at parsekeyval@nokey at novalue{%
+ \eappto\jlreq at headingsettings{\unexpanded{####1}}%
+ }{%
+ \jlreq at switch{####1}{%
+ {heading_type}{%
+ \lowercase{\def\jlreq at tempa{####2}}%
+ \jlreq at switch{\jlreq at tempa}{
+ {tobira}{\def\jlreq at declaretype{RenewTobira}}
+ {block}{\def\jlreq at declaretype{RenewBlock}}
+ {runin}{\def\jlreq at declaretype{RenewRunin}}
+ {cutin}{\def\jlreq at declaretype{RenewCutin}}
+ {modify}{\def\jlreq at declaretype{Modify}}
+ {\ClassError{jlreq}{Unknown heading type `####2'}{\@ehc}}
+ }%
+ }
+ {heading_level}{\def\jlreq at level{####2}}
+ {%
+ \jlreq at ifempty{#1}{\@firstofone}{%
+ \ifthenelse{\equal{####1}{restore}}{%
+ \csname jlreq at tempa####2\endcsname\@gobble
+ }{\@firstofone}%
+ }%
+ {\eappto\jlreq at headingsettings{\ifx\jlreq at headingsettings\@empty\else ,\fi\unexpanded{####1={####2}}}}%
+ }%
+ }%
+ }%
+ }{##2}%
+ \jlreq at ifempty{#1}{}{%
+ \ifjlreq at tempa
+ \eappto\jlreq at headingscmds{\noexpand\SaveHeading{\unexpanded{##1}}{\expandonce{\csname #2@##1\endcsname}}}%
+ \eappto\jlreq at restoreheadings{\ifx\jlreq at restoreheadings\@empty\else ,\fi\unexpanded{##1}}%
+ \fi
+ }%
+ % \jlreq at declareに\ModifyHeadingか\Renew***Headingを入れる
+ \edef\jlreq at declare{\expandonce{\csname\jlreq at declaretype Heading\endcsname}{##1}}%
+ \ifthenelse{\NOT \equal{\jlreq at declaretype}{Modify}}{%
+ \ifx\jlreq at level\@empty
+ % \frontmatter時でのレベルを引用する.
+ \edef\jlreq at declare{%
+ \unexpanded{\edef\jlreq at tempa}{\noexpand\unexpanded{\expandonce{\jlreq at declare}}{\noexpand\expandonce{\expandonce{\csname jlreq at heading@level@##1\endcsname}}}}%
+ \noexpand\jlreq at tempa
+ }%
+ \else
+ \eappto\jlreq at declare{{\expandonce{\jlreq at level}}}%
+ \fi
+ }{}%
+ \eappto\jlreq at headingscmds{\expandonce{\jlreq at declare}{\expandonce{\jlreq at headingsettings}}}%
+ }{#4}%
+ \edef\jlreq at do{%
+ \unexpanded{\def#3}{%
+ \expandonce{\jlreq at headingscmds}%
+ \jlreq at ifempty{#1}{}{\unexpanded{\def#1}{\expandonce{\jlreq at restoreheadings}}}%
+ }%
+ }%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+\def\jlreq at matter@counter at norestore#1#2{%
+ \def#1{}%
+ \jlreq at parsekeyval@nokey{%
+ \jlreq at parsekeyval*{
+ {value}{\appto#1{\setcounter{##1}{####1}}}
+ {the}{\eappto#1{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
+ }{##2}%
+ }{#2}%
+}
+
+\ifthenelse{\equal{\jlreq at article@type}{book}}{
+ \newif\if at mainmatter
+ \@mainmattertrue
+ \jlreq at jlreqsetup@add{frontmatter_pagebreak}{%
+ \edef\jlreq at frontmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+ }
+ \jlreq at jlreqsetup@add{frontmatter_counter}{%
+ \def\jlreq at frontmatter@counter{}%
+ \def\jlreq at tempa{}% 復帰させるカウンタ名リスト
+ \jlreq at parsekeyval@nokey{%
+ \def\jlreq at tempb{}% 中身
+ \jlreq at tempatrue % restore
+ \jlreq at parsekeyval{
+ {value}{\appto\jlreq at tempb{\setcounter{##1}{####1}}}
+ {restore}{\csname jlreq at tempa####1\endcsname}
+ {the}{\eappto\jlreq at tempb{\noexpand\def\expandonce{\csname the##1\endcsname}{\unexpanded{####1}}}}
+ }{##2}%
+ \ifjlreq at tempa
+ \epreto\jlreq at tempb{%
+ \noexpand\let\expandonce{\csname jlreq at frontmatter@savedcounter at the@##1\endcsname}\expandonce{\csname the##1\endcsname}%
+ \noexpand\edef\expandonce{\csname jlreq at frontmatter@savedcounter at value@##1\endcsname}{\unexpanded{\the\value{##1}}}%
+ }%
+ \eappto\jlreq at tempa{\ifx\jlreq at tempa\@empty\else ,\fi\unexpanded{##1}}%
+ \fi
+ \eappto\jlreq at frontmatter@counter{\expandonce{\jlreq at tempb}}%
+ }{#1}%
+ \eappto\jlreq at frontmatter@counter{\unexpanded{\def\jlreq at frontmatter@restorecounters}{\expandonce{\jlreq at tempa}}}%
+ }
+ \jlreq at jlreqsetup@add{frontmatter_heading}{\jlreq at matter@heading[\jlreq at frontmatter@restoreheadings]{jlreq at frontmatter@savedheading}{\jlreq at frontmatter@heading}{#1}}
+ \jlreq at jlreqsetup@add{frontmatter_pagestyle}{%
+ \def\jlreq at tempa{}% ページスタイル名
+ \def\jlreq at frontmatter@pagestyle{}%
+ \jlreq at tempatrue % restore
+ \jlreq at parsekeyval@nokey{%
+ \ifjlreq at parsekeyval@nokey at novalue{\def\jlreq at tempa{##1}}{%
+ \jlreq at switch{##1}{%
+ {restore}{\csname jlreq at tempa##2\endcsname}%
+ }%
+ }%
+ }{#1}%
+ \ifjlreq at tempa
+ \appto\jlreq at frontmatter@pagestyle{\let\jlreq at frontmatter@savedpagestyle\jlreq at current@pagestyle}%
+ \fi
+ \ifx\jlreq at tempa\@empty\else
+ \eappto\jlreq at frontmatter@pagestyle{\noexpand\pagestyle{\expandonce{\jlreq at tempa}}}%
+ \fi
+ }
+ \jlreq at jlreqsetup@add{frontmatter_precode}{\edef\jlreq at frontmatter@precode{\unexpanded{#1}}}
+ \jlreq at jlreqsetup@add{frontmatter_postcode}{\edef\jlreq at frontmatter@postcode{\unexpanded{#1}}}
+ \jlreq at jlreqsetup@add{frontmatter_pagination}{%
+ \def\jlreq at pagination@frontmatterstyle{arabic}%
+ \let\jlreq at pagination@mainmatterpagecommand=\pagenumbering
+ \@for\jlreq at tempa:=#1\do{%
+ \expandafter\jlreq at helper@trim\expandafter{\jlreq at tempa}{\jlreq at tempa}%
+ \jlreq at switch{\jlreq at tempa}{
+ {continuous}{%
+ \def\jlreq at pagination@mainmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c at page}}%
+ }
+ {independent}{\let\jlreq at pagination@mainmatterpagecommand=\pagenumbering}
+ {\edef\jlreq at pagination@frontmatterstyle{\jlreq at tempa}}
+ }%
+ }%
+ }
+ \newcommand*{\frontmatter}{%
+ \jlreq at frontmatter@precode
+ \jlreq at frontmatter@pagebreak
+ \@mainmatterfalse
+ \let\jlreq at frontmatter@savedpagestyle\@undefined
+ \jlreq at frontmatter@pagestyle
+ \jlreq at frontmatter@counter
+ \jlreq at frontmatter@heading
+ \expandafter\gdef\expandafter\thepage\expandafter{\csname @\jlreq at pagination@frontmatterstyle\endcsname\c at page}%
+ \jlreq at frontmatter@postcode
+ }
+ \def\jlreq at frontmatter@restorecounters{}
+ \def\jlreq at frontmatter@restoreheadings{}
+ \def\jlreq at frontmatter@restorecommands{}
+ \jlreq at jlreqsetup@add{mainmatter_pagebreak}{%
+ \edef\jlreq at mainmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+ }
+ \jlreq at jlreqsetup@add{mainmatter_pagestyle}{%
+ \edef\jlreq at mainmatter@pagestyle{\jlreq at ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
+ }
+ \jlreq at jlreqsetup@add{mainmatter_counter}{\jlreq at matter@counter at norestore{\jlreq at mainmatter@counter}{#1}}%
+ \jlreq at jlreqsetup@add{mainmatter_heading}{\jlreq at matter@heading{\jlreq at mainmatter@heading}{#1}}%
+ \jlreq at jlreqsetup@add{mainmatter_precode}{\edef\jlreq at mainmatter@precode{\unexpanded{#1}}}%
+ \jlreq at jlreqsetup@add{mainmatter_postcode}{\edef\jlreq at mainmatter@postcode{\unexpanded{#1}}}%
+ \jlreq at jlreqsetup@add{mainmatter_pagination}{%
+ \def\jlreq at pagination@mainmatterstyle{#1}%
+ }
+ \newcommand*{\mainmatter}{%
+ \jlreq at mainmatter@precode
+ \jlreq at mainmatter@pagebreak
+ \@mainmattertrue
+ \@ifundefined{jlreq at frontmatter@savedpagestyle}{%
+ \jlreq at mainmatter@pagestyle
+ }{%
+ \expandafter\pagestyle\expandafter{\jlreq at frontmatter@savedpagestyle}%
+ }%
+ \@for\jlreq at tempa:=\jlreq at frontmatter@restorecounters\do{%
+ \setcounter{\jlreq at tempa}{\csname jlreq at frontmatter@savedcounter at value@\jlreq at tempa\endcsname}%
+ \expandafter\let\csname the\jlreq at tempa\expandafter\endcsname\csname jlreq at frontmatter@savedcounter at the@\jlreq at tempa\endcsname
+ }%
+ \jlreq at mainmatter@counter
+ \@for\jlreq at tempa:=\jlreq at frontmatter@restoreheadings\do{\csname jlreq at frontmatter@savedheading@\jlreq at tempa\endcsname}
+ \jlreq at mainmatter@heading
+ \@for\jlreq at tempa:=\jlreq at frontmatter@restorecommands\do{%
+ \expandafter\let\csname \jlreq at tempa\expandafter\endcsname\csname jlreq at frontmatter@savedcommand@\jlreq at tempa\endcsname
+ }%
+ \expandafter\jlreq at pagination@mainmatterpagecommand\expandafter{\jlreq at pagination@mainmatterstyle}%
+ \jlreq at mainmatter@postcode
+ }
+ \jlreq at jlreqsetup@add{backmatter_pagebreak}{%
+ \edef\jlreq at backmatter@pagebreak{\jlreq at ifempty{#1}{}{\expandonce{\csname #1\endcsname}}}%
+ }
+ \jlreq at jlreqsetup@add{backmatter_pagestyle}{%
+ \edef\jlreq at backmatter@pagestyle{\jlreq at ifempty{#1}{}{\unexpanded{\pagestyle{#1}}}}%
+ }
+ \jlreq at jlreqsetup@add{backmatter_counter}{\jlreq at matter@counter at norestore{\jlreq at backmatter@counter}{#1}}%
+ \jlreq at jlreqsetup@add{backmatter_heading}{\jlreq at matter@heading{\jlreq at backmatter@heading}{#1}}
+ \jlreq at jlreqsetup@add{backmatter_precode}{\edef\jlreq at backmatter@precode{\unexpanded{#1}}}
+ \jlreq at jlreqsetup@add{backmatter_postcode}{\edef\jlreq at backmatter@postcode{\unexpanded{#1}}}
+ \jlreq at jlreqsetup@add{backmatter_pagination}{
+ \let\jlreq at pagination@backmatterpagecommand=\pagenumbering
+ \def\jlreq at pagination@backmatterstyle{arabic}%
+ \@for\jlreq at tempa:=#1\do{%
+ \expandafter\jlreq at helper@trim\expandafter{\jlreq at tempa}{\jlreq at tempa}%
+ \jlreq at switch{\jlreq at tempa}{
+ {continuous}{%
+ \def\jlreq at pagination@backmatterpagecommand##1{\gdef\thepage{\csname @##1\endcsname\c at page}}%
+ }
+ {independent}{\let\jlreq at pagination@backmatterpagecommand=\pagenumbering}
+ {\edef\jlreq at pagination@backmatterstyle{\jlreq at tempa}}
+ }%
+ }%
+ }
+ \newcommand*{\backmatter}{%
+ \jlreq at backmatter@precode
+ \jlreq at backmatter@pagebreak
+ \jlreq at backmatter@pagestyle
+ \@mainmatterfalse
+ \jlreq at backmatter@counter
+ \jlreq at backmatter@heading
+ \expandafter\jlreq at pagination@backmatterpagecommand\expandafter{\jlreq at pagination@backmatterstyle}%
+ \jlreq at backmatter@postcode
+ }
+}{}
+
+\jlreq at jlreqsetup@add{appendix_counter}{\jlreq at matter@counter at norestore{\jlreq at appendix@counter}{#1}}
+\jlreq at jlreqsetup@add{appendix_heading}{\jlreq at matter@heading{\jlreq at appendix@heading}{#1}}
+\jlreq at jlreqsetup@add{appendix_precode}{\edef\jlreq at appendix@precode{\unexpanded{#1}}}
+\jlreq at jlreqsetup@add{appendix_postcode}{\edef\jlreq at appendix@postcode{\unexpanded{#1}}}
+\newcommand*{\appendix}{%
+ \par
+ \jlreq at appendix@precode
+ \jlreq at appendix@counter
+ \jlreq at appendix@heading
+ \jlreq at appendix@postcode
+}
+
+%. その他諸々
+%.. 縦中横
+\edef\@tempa{%
+ \unexpanded{%
+ \jlreq at ifydir{\ClassError{jlreq}{\string\tatechuyoko\space is not allowed in yoko mode}{\@ehc}}{}%
+ \ifvmode\leavevmode\fi
+ }%
+ \ifx l\jlreq at engine\unexpanded{%
+ \jlreq at lastnodechar=\lastnodechar\relax
+ \ifnum\jlreq at lastnodechar>-1 \inhibitglue\fi
+ }\else\unexpanded{%
+ \ifnum\lastnodechar>-1 \inhibitglue\fi
+ \jlreq at lastnodechar=\lastnodechar\relax
+ }\fi
+}
+
+\expandafter\protected\expandafter\def\expandafter\tatechuyoko\expandafter#\expandafter1\expandafter{%
+ \@tempa
+ % 前のJFM glue
+ \ifnum\jlreq at lastnodechar>-1
+ \jlreq at calc@jfmglue{\char\jlreq at lastnodechar}{阿}%
+ \jlreq at ifgluezero\jlreq at resultskip{}{\hskip\jlreq at resultskip}%
+ \fi
+ \hbox{\yoko
+ \setbox\jlreq at tempboxa=\hbox{阿}%
+ \vrule width 0pt height \ht\jlreq at tempboxa depth \dp\jlreq at tempboxa #1}%
+ \futurelet\jlreq at nextchar\jlreq at tatechuyoko@
+}
+\def\jlreq at tatechuyoko@{%
+ \begingroup
+ \def\jlreq at do{}%
+ \jlreq at getfirsttoken@expandmacros{\jlreq at nextchar}{\jlreq at tempa}%
+ \expandafter\jlreq at ifletter\expandafter{\jlreq at tempa}{%
+ \jlreq at calc@jfmglue{阿}{\jlreq at tempa}%
+ \edef\jlreq at do{%
+ \noexpand\hskip\the\jlreq at resultskip\space
+ \noexpand\inhibitglue
+ }%
+ }{}%
+ \expandafter\endgroup
+ \jlreq at do
+}
+
+% 日にち
+\newif\if西暦
+\def\西暦{\西暦true}
+\def\和暦{\西暦false}
+% #1年#2月#3日 #4は\numberとか\kansujiとか
+\def\jlreq at wareki#1#2#3#4{%
+ \jlreq at warekiyear{#1}{#2}{#3}{#4}%
+ #4#2月#4#3日%
+}
+\def\jlreq at warekiyear#1#2#3#4{%
+ % 昭和:1989年1月7日まで
+ \ifnum0\ifnum#1<1989 1\fi\ifnum#1=1989 \ifnum#2=1 \ifnum#3<8 1\fi\fi\fi>0
+ 昭和\jlreq at warekiyear@{#1}{1926}{#4}%
+ % 平成:2019年4月末日まで
+ \else\ifnum0\ifnum#1<2019 1\fi\ifnum#1=2019 \ifnum#2<5 1\fi\fi>0
+ 平成\jlreq at warekiyear@{#1}{1989}{#4}%
+ \else
+ 令和\jlreq at warekiyear@{#1}{2019}{#4}%
+ \fi\fi
+}
+\def\jlreq at warekiyear@#1#2#3{\ifnum#1=#2 元年\else #3\numexpr#1-#2+1\relax 年\fi}
+\def\today{%
+ \if西暦
+ \jlreq at iftdir{%
+ \kansuji\year 年%
+ \kansuji\month 月%
+ \kansuji\day 日%
+ }{%
+ \number\year 年%
+ \number\month 月%
+ \number\day 日%
+ }%
+ \else
+ \jlreq at iftdir{%
+ \jlreq at wareki{\year}{\month}{\day}{\kansuji}%
+ }{%
+ \jlreq at wareki{\year}{\month}{\day}{\number}%
+ }%
+ \fi
+}
+\jlreq at jlreqsetup@add{year_style}[seireki,wareki]{%
+ \jlreq at switch{#1}{%
+ {seireki}{\西暦true}
+ {wareki}{\西暦false}
+ }
+}
+
+% 時刻
+\hour=\time \divide\hour by 60
+\minute=\numexpr\time - 60*\hour\relax
+
+%.. 定理環境
+\jlreq at saveoriginalcs{\@begintheorem}
+\jlreq at saveoriginalcs{\@opargbegintheorem}
+\def\@begintheorem#1#2{\topsep=\dimexpr\jlreq at theorem@beforeafter at space\relax
+ \trivlist\labelsep=1\zw
+ \itemindent=\dimexpr\jlreq at theorem@indent\relax
+ \item[\hskip \labelsep{\sffamily\bfseries #1\ #2}]}
+\def\@opargbegintheorem#1#2#3{\topsep=\dimexpr\jlreq at theorem@beforeafter at space\relax
+ \trivlist\labelsep=1\zw
+ \itemindent=\dimexpr\jlreq at theorem@indent\relax
+ \item[\hskip \labelsep{\sffamily\bfseries #1\ #2(#3)}]}
+\AtEndOfPackageFile*{amsthm}{%
+ \jlreq at saveoriginalcs{\proof}%
+ \jlreq at saveoriginalcs{\endproof}%
+ \edef\jlreq at do{
+ \unexpanded{\def\jlreq at proof[#1]}{%
+ \unexpanded{\labelsep=1\zw}%
+ \expandonce{\proof[{\reset at font\sffamily\bfseries #1\inhibitglue}\nopunct]}%
+ }
+ }
+ \jlreq at do
+ \def\proof{\@ifnextchar[{\jlreq at proof}{\jlreq at proof[\proofname]}}
+ \renewcommand{\proofname}{証明}
+ \jlreq at setupamsthm
+ \theoremstyle{jlreq}
+}
+\def\jlreq at setupamsthm{
+ \newtheoremstyle{jlreq}{\dimexpr\jlreq at theorem@beforeafter at space\relax}{\dimexpr\jlreq at theorem@beforeafter at space\relax}{\normalfont}{\dimexpr\jlreq at theorem@indent\relax}{\sffamily\bfseries}{}{1\zw}{\thmname{##1}\thmnumber{\ ##2}\thmnote{(##3)}}
+}
+\jlreq at jlreqsetup@add{theorem_beforeafter_space}{
+ \def\jlreq at theorem@beforeafter at space{#1}
+ \@ifpackageloaded{amsthm}{\jlreq at setupamsthm}{}
+}
+\jlreq at jlreqsetup@add{theorem_indent}{
+ \def\jlreq at theorem@indent{#1}
+ \@ifpackageloaded{amsthm}{\jlreq at setupamsthm}{}
+}
+
+
+%. デフォルト設定
+%.. 見出し
+\if at tate
+ \renewcommand{\thepart}{\jlreq at Kanji{part}}
+ \ifthenelse{\equal{\jlreq at article@type}{article}}{}{\renewcommand{\thechapter}{\jlreq at Kanji{chapter}}}
+ \renewcommand{\thesection}{\jlreq at rensuji{\@arabic\c at section}}
+ \renewcommand{\thesubsection}{\jlreq at rensuji{\@alph\c at subsection}}
+ \renewcommand{\thesubsubsection}{\jlreq at rensuji{\@arabic\c at subsubsection}}
+ \renewcommand{\theparagraph}{(\jlreq at rensuji{\@arabic\c at paragraph})}
+ \renewcommand{\thesubparagraph}{(\jlreq at rensuji{\@arabic\c at subparagraph})}
+
+ \ifthenelse{\equal{\jlreq at article@type}{article}}{
+ \NewBlockHeading{part}{0}{font={\jlreq at keepbaselineskip{\LARGE}},indent=4\zw,lines=4,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\large}}}
+ \if at 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 at 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 at keepbaselineskip{\Large}}}
+ \if at twoside\ModifyHeading{chapter}{allowbreak_if_evenpage=true}\fi
+ \renewcommand{\thechapter}{\jlreq at Kanji{chapter}}
+ }
+ \NewBlockHeading{section}{1}{font={\jlreq at keepbaselineskip{\Large}},indent=6\zw,lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\normalsize}}}
+ \if at twoside\ModifyHeading{section}{allowbreak_if_evenpage=true}\fi
+ \NewBlockHeading{subsection}{2}{font={\jlreq at keepbaselineskip{\large}},indent=8\zw,lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\small}}}
+ \if at twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi
+ \NewBlockHeading{subsubsection}{3}{font={\jlreq at 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 at keepbaselineskip{\scriptsize}}}
+ \if at twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi
+ \NewRuninHeading{paragraph}{4}{font={\jlreq at keepbaselineskip{\normalsize}}}
+ \NewRuninHeading{subparagraph}{5}{font={\jlreq at 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 at article@type}{article}}{
+ \NewBlockHeading{part}{0}{font={\jlreq at 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 at keepbaselineskip{\large}}}
+ \renewcommand{\thesection}{\arabic{section}}
+ }
+ {% book, report
+ \NewTobiraHeading{part}{-1}{label_format={第\thepart 部\hspace*{1\jlreq at gol}},format={\null\vfil {\Huge\sffamily\bfseries #1#2}\vfil}}
+ \NewBlockHeading{chapter}{0}{%
+ font={\jlreq at 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 at keepbaselineskip{\Large}}}
+ \renewcommand{\thechapter}{\arabic{chapter}}
+ \renewcommand{\thesection}{\thechapter.\arabic{section}}
+ }
+ \NewBlockHeading{section}{1}{font={\jlreq at keepbaselineskip{\Large\sffamily\bfseries}},lines=3,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\normalsize}}}
+ \NewBlockHeading{subsection}{2}{font={\jlreq at keepbaselineskip{\large\sffamily\bfseries}},lines=2,after_label_space=1\zw,second_heading_text_indent={-1\zw,1\zw},subtitle_font={\jlreq at keepbaselineskip{\small}}}
+ \NewBlockHeading{subsubsection}{3}{font={\jlreq at 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 at keepbaselineskip{\scriptsize}}}
+ \NewRuninHeading{paragraph}{4}{font={\jlreq at keepbaselineskip{\normalsize\sffamily\bfseries}},indent=1\zw}
+ \NewRuninHeading{subparagraph}{5}{font={\jlreq at keepbaselineskip{\normalsize\sffamily\bfseries}},indent=2\zw}
+\fi
+
+\ifthenelse{\equal{\jlreq at article@type}{article}}{}{% book, report
+ \if at openright
+ \ModifyHeading{part}{type=naka}
+ \if at 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
+}
+
+%.. ページスタイル
+\RenewPageStyle{empty}{nombre={},odd_running_head={},even_running_head={}}
+\ifthenelse{\equal{\jlreq at article@type}{article}}{
+ \if at 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 at 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 at 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 at 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}
+
+%.. 注
+\jlreqsetup{reference_mark=inline}
+\if at tate
+ \jlreqsetup{footnote_indent=1\zw}% 根拠なし
+\else
+ \jlreqsetup{footnote_indent=0pt}% (4.2.5.b)
+\fi
+\jlreqsetup{footnote_second_indent=1\zw}
+\jlreqsetup{endnote_second_indent=2\zw}
+\jlreqsetup{endnote_position=headings}
+\ifdim\marginparwidth>0pt
+ \jlreqsetup{sidenote_type=number}
+ \jlreqsetup{sidenote_symbol=*,sidenote_keyword_font={}}
+\fi
+
+%.. キャプション
+\jlreqsetup{
+ caption_font={\sffamily\bfseries},
+ caption_label_font={\sffamily\bfseries},
+ caption_after_label_space=1\zw,
+ caption_label_format={#1},
+ caption_align=center
+}
+
+%.. 箇条書き
+\if at tate
+ \renewcommand{\theenumi}{\jlreq at Kanji{enumi}}
+ \renewcommand{\theenumii}{\jlreq at rensuji{\@arabic\c at enumii}}
+ \renewcommand{\theenumiii}{\jlreq at rensuji{\@arabic\c at enumiii}}
+ \renewcommand{\theenumiv}{\jlreq at rensuji{\@arabic\c at enumiv}}
+ \newcommand{\labelenumi}{\theenumi}
+ \newcommand{\labelenumii}{\theenumii}
+ \newcommand{\labelenumiii}{\theenumiii}
+ \newcommand{\labelenumiv}{\theenumiv}
+\else
+ \renewcommand{\theenumi}{\@arabic\c at enumi}
+ \renewcommand{\theenumii}{\@alph\c at enumii}
+ \renewcommand{\theenumiii}{\@roman\c at enumiii}
+ \renewcommand{\theenumiv}{\@Alph\c at enumiv}
+ \newcommand{\labelenumi}{\theenumi.\hspace{.5\zw}}
+ \newcommand{\labelenumii}{(\theenumii)\hspace{.5\zw}}
+ \newcommand{\labelenumiii}{\theenumiii.\hspace{.5\zw}}
+ \newcommand{\labelenumiv}{\theenumiv.\hspace{.5\zw}}
+\fi
+\renewcommand{\p at enumii}{\theenumi}
+\renewcommand{\p at enumiii}{\theenumi(\theenumii)}
+\renewcommand{\p at enumiv}{\p at enumiii\theenumiii}
+
+\newcommand{\labelitemi}{\hbox to 1\zw{\hss\textbullet\hss}}
+%\newcommand{\labelitemi}{•}
+\if at 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}}
+
+% 見出しが一つ上のレベルからどのくらいずれているかを入れる.
+\setlength\leftmargini{2\zw}
+\setlength\leftmarginii{2\zw}
+\setlength\leftmarginiii{1\zw}
+\setlength\leftmarginiv{1\zw}
+\setlength\leftmarginv{1\zw}
+\setlength\leftmarginvi{1\zw}
+\jlreqsetup{
+ itemization_beforeafter_space={0pt,i=.5\baselineskip},
+ itemization_itemsep=0pt,
+ itemization_labelsep={0pt},
+ itemization_label_length={1\zw,i=2\zw,ii=2\zw}
+}
+
+%.. 引用
+\jlreqsetup{
+ quote_indent=2\zw,
+ quote_end_indent=0pt,
+ quote_fontsize=,
+ quote_beforeafter_space=0pt
+}
+
+%.. その他
+\ifthenelse{\equal{\jlreq at article@type}{book}}{
+ \jlreqsetup{
+ frontmatter_pagebreak = cleardoublepage,
+ frontmatter_pagestyle = {plain,restore = true},
+ frontmatter_heading = {chapter={number=false, restore = true}},
+ frontmatter_counter = {
+ figure = {the = \arabic{figure},restore = true},
+ table = {the = \arabic{table},restore = true},
+ },
+ frontmatter_precode = {},
+ frontmatter_postcode = {},
+ }
+ \jlreqsetup{
+ mainmatter_pagebreak = cleardoublepage,
+ mainmatter_counter = {
+ chapter = {value = 0},
+ },
+ mainmatter_pagestyle = {},
+ mainmatter_heading = {},
+ mainmatter_precode = {},
+ mainmatter_postcode = {},
+ }
+ \if at openright
+ \jlreqsetup{backmatter_pagebreak=cleardoublepage}
+ \else
+ \jlreqsetup{backmatter_pagebreak=clearpage}
+ \fi
+ \jlreqsetup{
+ backmatter_pagestyle = plain,
+ backmatter_counter = {
+ chapter={value = 0, the = {}},
+ figure = {value = 0, the = {\arabic{figure}}},
+ table = {value = 0, the = {\arabic{table}}}
+ },
+ backmatter_heading = {chapter = {number = false}},
+ backmatter_precode = {},
+ backmatter_postcode = {}
+ }
+ \jlreqsetup{
+ frontmatter_pagination = {independent,roman},
+ mainmatter_pagination = {arabic},
+ backmatter_pagination = {continuous,arabic},
+ }
+}{}
+\ifthenelse{\equal{\jlreq at article@type}{article}}{
+ \if at tate
+ \jlreqsetup{
+ appendix_counter = {
+ section = {value = 0, the = {\jlreq at rensuji{\Alph{section}}}},
+ subsection = {value = 0},
+ }
+ }
+ \else
+ \jlreqsetup{
+ appendix_counter = {
+ section = {value = 0, the = {\Alph{section}}},
+ subsection = {value = 0},
+ }
+ }
+ \fi
+ \jlreqsetup{appendix_heading = {},appendix_precode = {},appendix_postcode = {}}
+}{%book, report
+ \if at tate
+ \jlreqsetup{
+ appendix_counter = {
+ chapter = {value = 0, the = {\jlreq at rensuji{\Alph{chapter}}}},
+ }
+ }
+ \else
+ \jlreqsetup{
+ appendix_counter = {
+ chapter = {value = 0, the = {\Alph{chapter}}},
+ }
+ }
+ \fi
+ \jlreqsetup{
+ appendix_heading = {
+ chapter = {label_format = {付録\thechapter}}
+ },
+ appendix_postcode = {%
+ \ifthenelse{\equal{\jlreq at current@pagestyle}{headings}}{%
+ \def\chaptermark#1{\markboth{付録\thechapter\quad #1}{}}%
+ \ModifyPageStyle{headings}{mark_format={_chapter={付録\thechapter\quad #1}}}%
+ }{}%
+ },
+ appendix_precode = {}
+ }
+}
+\jlreqsetup{theindex_pagestyle=plain}
+\jlreqsetup{year_style=seireki}
+\jlreqsetup{theorem_beforeafter_space=1\baselineskip,theorem_indent=0pt}
+
+
+\newcommand{\contentsname}{目次}
+\newcommand{\refname}{参考文献}
+\newcommand{\indexname}{索引}
+\newcommand{\listfigurename}{図目次}
+\newcommand{\figurename}{図}
+\newcommand{\listtablename}{表目次}
+\newcommand{\tablename}{表}
+\pagestyle{plain}
+\pagenumbering{arabic}
+
+%. 最終処理
+\if at twocolumn
+ \twocolumn
+ \sloppy
+ \flushbottom
+\else
+ \onecolumn
+ \raggedbottom
+\fi
+\endinput
+
+
Modified: trunk/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua 2019-09-24 20:05:26 UTC (rev 52168)
+++ trunk/Master/texmf-dist/tex/luatex/jlreq/jfm-jlreq.lua 2019-09-24 20:05:49 UTC (rev 52169)
@@ -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)
More information about the tex-live-commits
mailing list