diff options
author | Norbert Preining <norbert@preining.info> | 2024-08-24 03:03:45 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-08-24 03:03:45 +0000 |
commit | 85dbf9e6c3eafa4a9fdfdbe0bae89f570ac32f29 (patch) | |
tree | 5936f263ef64c40c3b8e86ae3e29d88b047cb5bd /macros/jptex | |
parent | 82f5764bd001d191b822d064f56dac669d1325a0 (diff) |
CTAN sync 202408240303
Diffstat (limited to 'macros/jptex')
22 files changed, 1285 insertions, 525 deletions
diff --git a/macros/jptex/latex/jlreq/README-ja.md b/macros/jptex/latex/jlreq/README-ja.md index e7d28508c4..3d4f146f11 100644 --- a/macros/jptex/latex/jlreq/README-ja.md +++ b/macros/jptex/latex/jlreq/README-ja.md @@ -19,7 +19,7 @@ ## 動作環境 pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内部で読み込みます. -* (常時):l3keys2e,lmodern +* (常時):lmodern * (LuaLaTeX非利用時):everyhook * (LuaLaTeX利用時):luatexja,luatexja-adjust @@ -343,7 +343,7 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内 * `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`指定時は一つ目のノンブルや柱に続く場所に表示されます. -* `odd_head_format=<書式>`, `odd_foot_format=<書式>`, `even_head_format=<書式>`, `even_foot_format=<書式>`:ヘッダやフッタのフォーマットを指定します.`#1`がヘッダまたはフッタ全体に書き換えられます.ただし`#1`には位置調整用のコードが入っている場合もあるので,特に`\NewPageStyle`に`tate`を指定している場合には思うようにならないこともあります.例えば奇数ページのヘッダに罫線を引くためには`odd_head_format={\underline{\makebox[\jlreqyokoheadlength]{#1}}}`とするとよいでしょう.なお,ここで使った`\jlreqyokoheadlength`は本クラスファイル内で定義されているマクロで,ヘッダの横方向の長さを与えます.(フッタの長さも同じです.)縦方向の長さ,すなわち`\DeclarePageStyle`で`tate`が指定されている場合の長さは`\jlreqtateheadlength`で取得できます. +* `odd_head_format=<書式>`, `odd_foot_format=<書式>`, `even_head_format=<書式>`, `even_foot_format=<書式>`:ヘッダやフッタのフォーマットを指定します.`#1`がヘッダまたはフッタ全体に書き換えられます.ただし`#1`には位置調整用のコードが入っている場合もあるので,特に`\NewPageStyle`に`tate`を指定している場合には思うようにならないこともあります.例えば奇数ページのヘッダに罫線を引くためには`odd_head_format={\underline{\makebox[\jlreqyokoheadlength]{#1}}}`とするとよいでしょう.なお,ここで使った`\jlreqyokoheadlength`は本クラスファイル内で定義されているマクロで,ヘッダの横方向の長さを与えます.(フッタの長さも同じです.)縦方向の長さ,すなわち`\NewPageStyle`で`tate`が指定されている場合の長さは`\jlreqtateheadlength`で取得できます. `\RenewPageStyle`,`\ProvidePageStyle`,`\DeclarePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です. @@ -590,6 +590,12 @@ JFMの名前は次の通りです.`[]`で囲まれている文字は設定に - そのほかいくつか改善など. * 2024-02-16 - バグ修正 +* 2024-08-23 + - バグ修正 + - 内部変数名の変更 + - 英語ドキュメントに使い方を書いた + - `\DeclareKeys`などを使うようにした. + - 行見出しの内部処理をちょっとだけ変更. -------------- Noriyuki Abe diff --git a/macros/jptex/latex/jlreq/README.md b/macros/jptex/latex/jlreq/README.md index 80ef200e89..3c7ec380ee 100644 --- a/macros/jptex/latex/jlreq/README.md +++ b/macros/jptex/latex/jlreq/README.md @@ -14,7 +14,383 @@ Run `make` to generate JFM files. Move the files as follows: 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). +To use, simply write +```latex +\documentclass{jlreq} +``` + This will set up a document class equivalent to an article in horizontal writing. The engine is automatically determined, but if you want to specify it, pass one of `platex/uplatex/lualatex` as a class option. To switch to vertical writing, pass the `tate` option. Additionally, to make the document class equivalent to report or book, pass the `report` or `book` option respectively. For example, to create a vertical book, write `\documentclass[tate,book]{jlreq}`. + +Other common options accepted are `oneside/twoside/onecolumn/twocolumn/titlepage/notitlepage/draft/final/landscape/openright/openany/leqno/fleqn`. Also, passing the `disablejfam` option will not register Japanese fonts for use in mathematics. + +You can write the content as you would in a standard document class, but the following commands have been added or extended. Note that this document uses terms from [Requirements for Japanese Text Layout](https://www.w3.org/TR/jlreq/?lang=en) without explanation. + +### `\jlreqsetup` +This is a command for settings. It can only be used in the preamble. Settings for the document are made either as class options or through `\jlreqsetup`, depending on the setting item. + +### `\section` +The `\section` command is extended to accept subtitles in addition to the usual format, as in `\section*[running head]{Heading}[Subtitle]`. Other commands such as `\part` (only in article), `\chapter` (only in book/report), `\subsection`, and `\subsubsection` also accept subtitles. + +### `abstract` environment +You can place it in the preamble, and it will be output with `\maketitle`. In the case of two columns, it allows you to output the abstract without columnization. However, this method is now deprecated. By specifying `abstract_with_maketitle=true` in `\jlreqsetup` and writing it before `\maketitle`, you can achieve the same effect. + +### `\sidenote` +This command is only defined when the width of the sidenote is positive. In the default basic layout, this width is set to 0. Therefore, `\sidenote` is not defined. Please refer to the later basic layout settings. `\sidenote` outputs a sidenote (or footnote in vertical writing). Internally, it uses `\marginpar`. By default, it has the same format as `\footnote`, but if `sidenote_type=symbol` is specified in `\jlreqsetup`, the format becomes `\sidenote{relevant item}{note}`. For example, you would write: + +```latex +capable of publishing \sidenote{manuscript}{by methods such as printing…} +``` +Please refer to the later explanation as well. + +### `\endnote` +Specifies an endnote. It has the same format as `\footnote`. By default, the note itself is output just before the heading. This behavior can be controlled by passing `endnote_position` to `\jlreqsetup`. For more details, please see the later explanation of notes. Also, executing `\theendnotes` will output it on the spot. + +### `\warichu` +Outputs a warichu (split annotation). The line division positions are calculated automatically (multiple compilations are required). With `\warichu*`, you can manually specify these positions. The format is `\warichu*{(before first line) & (after first line)\\ (before second line) & (after second line)...}`. If `&` is omitted, it will be adjusted automatically. + +### `\tatechuyoko` +Outputs horizontal-in-vertical text. You use it as `\tatechuyoko{<content>}`. `\tatechuyoko` will result in an error if used in a non-vertical writing place, but `\tatechuyoko*` will be output as is in a non-vertical writing place. + +### `\jidori` +By using `\jidori{<dimension>}{<content>}`, you can output the content justified to the length of the dimension. + +### `\akigumi` +By using `\akigumi{<dimension>}{<content>}`, you can output the result of spacing the characters of the content by the length of the dimension. However, the correct output result is not obtained except when using LuaLaTeX. + +### `\jafontsize` +Specifies the Japanese font size, similar to `\fontsize`. If `jafontscale=0.9` is specified as a class option, specifying `\fontsize{9pt}{15pt}` will result in a Japanese font size of 8.1pt, but `\jafontsize{9pt}{15pt}` will result in 9pt (with the European font size being 10pt). The second argument is exactly the same as the second argument of `\fontsize`. + +### `\ ` +A macro consisting of a single full-width space (U+3000). It inserts a Japanese character space. In LuaLaTeX, you can also input a Japanese character space with ` ` alone. + +### Others +* Ruby and encircled points are not provided. It is recommended to use [PXrubrica](https://github.com/zr-tex8r/PXrubrica) or `luatexja-ruby` (for LuaLaTeX, included in the LuaTeX-ja package). + +* When using pLaTeX / upLaTeX, macros `\zw` and `\zh` that expand to `zw` and `zh`, respectively, are defined. In LuaLaTeX, macros of the same name are defined within LuaTeX-ja. + +* Requirements for Japanese Text Layout 2.3.2.d state that it is desirable to align the number of lines in each column on the last page of horizontal two-column typesetting, but this process is not performed. You can perform this process by using the `nidanfloat` package and specifying + + ````latex + \usepackage[balance]{nidanfloat} + ```` + + However, `\newpage` and `\clearpage` on the last page will not work correctly. For more details, please see the manual of the `nidanfloat` package. + +* The functionality to set fonts is not provided. Japanese fonts can be set using `luatexja-fontspec` or `luatexja-preset` (both included in the LuaTeX-ja package) when using LuaLaTeX. If using dvipdfmx, you can set it with [PXchfon](https://github.com/zr-tex8r/PXchfon). + +* The space between Japanese characters (stored in `\kanjiskip` in (u)pTeX and in the `kanjiskip` parameter in LuateX-ja) by default allows for up to a quarter-character width of space, in accordance with the Requirements for Japanese Text Layout. However, due to limitations of TeX’s functionality, this may not always produce appropriate results. If you want to change this value, please redefine `\jlreqkanjiskip`. For example: + + ```latex + \documentclass{jlreq} + \renewcommand{\jlreqkanjiskip}{0pt plus .1\zw minus .01\zw} + \begin{document} + (Main text) + \end{document} + ```` + + The space between Japanese and European characters (stored in `\xkanjiskip` in (u)pTeX and in the `xkanjiskip` parameter in LuateX-ja) can also be changed by redefining `\jlreqxkanjiskip`. + +* When specifying `book`, even if you specify `openany` as a class option, a blank page may be inserted after `\mainmatter`. This is to match the behavior of the standard class file. By specifying `\jlreqsetup{mainmatter_pagebreak=clearpage}`, you can prevent the insertion of a blank page, but by default, `\mainmatter` resets the page number, so there may be inconsistencies in the parity of page numbers. Please consider changing to a continuous pagination by specifying something like `\jlreqsetup{frontmatter_pagination={arabic,continuous}}`. For more details, please refer to the following “Front Matter, etc.” section. + +## Design options +The design is specified in keyval format via class options or `\jlreqsetup`. However, due to LaTeX’s implementation, cases where input that should be possible is not accepted may occur with class options. In many cases, this can be resolved by removing spaces. + +In the following, the following usage will be used: +* `[A/B]`: Either A or B. `[A/B/C]`, etc., are the same. +* `<dimension>`: A dimension recognized by TeX. You can also use simple expressions (like `10pt+10pt`). In class options, you may be able to use special values as follows (these are available in pLaTeX / upLaTeX by default, but are processed to be available in LuaLaTeX as well): In places like `\jlreqsetup`, you can always describe the full-width width with `\zw` or `\zh`. Below, for example, if `Q` and `H` are available, it will be described as `<dimension;Q,H>`. + - `Q`, `H`: Interpreted as 0.25mm. + - `zw`, `zh`: Interpreted as full-width width. +* `<code>`: LaTeX code. +* `<font setting code>`: Commands for font settings, such as `\Large` or `\bfseries`. Multiple specifications like `\Large\bfseries` are also possible. + +### Kihon-hanmen +Class option. + +* `paper=[<paper size name>/{<dimension>,<dimension>}]`: Specifies the paper size. You can specify from `a0paper` to `a10paper`, `b0paper` to `b10paper` (ISO B series), or `b0j` to `b10j` for JIS B series. Also available are `letterpaper`, `legalpaper`, and `executivepaper`. Alternatively, you can directly specify dimensions with `{<width>,<height>}`. +* `fontsize=<dimension;Q,H>`: Specifies the font size for Latin script. The default is 10pt. +* `jafontsize=<dimension;Q,H>`: Specifies the font size for Japanese script. +* `jafontscale=<real number>`: The ratio of Japanese font size to Latin font size (Japanese / Latin). Ignored if both `fontsize` and `jafontsize` are specified. The default is 1. +* `line_length=<dimension;zw,zh>`: The length of a line. By default, it's 0.75 times the paper width in the direction of character progression. The actual value is adjusted to be a multiple of the length of one character. +* `number_of_lines=<natural number>`: The number of lines per page. By default, it's a value that makes it 0.75 times the paper height in the direction of line progression. +* `gutter=<dimension;zw,zh>`: The size of the gutter margin. + - Without `tate`option: It's the margin on the left for odd pages and on the right for even pages. + * With `tate` option: It's the opposite. + * If `twoside` is not specified in the class options, the margin is always set as for odd pages. +* `fore-edge=<dimension;zw,zh>`: The size of the fore-edge margin (the side opposite the gutter). It's implemented for convenience, although it's not used when margins are specified according to "Requirements for Japanese Text Layout". +* `head_space=<dimension;zw,zh>`: The amount of space at the top (head). The default value centers the text block vertically. +* `foot_space=<dimension;zw,zh>`: The amount of space at the bottom (foot). The default value centers the text block vertically. +* `baselineskip=<dimension;Q,H,zw,zh>`: The line feed. By default, it's 1.7 times the `jafontsize`. +* `linegap=<dimension;Q,H,zw,zh>`: The line gap. +* `headfoot_sidemargin=<dimension;zw,zh>`: The left and right margin for headers and footers. +* `column_gap=<dimension;zw,zh>`: The gap between columns (only for `twocolumn`). +* `sidenote_length=<dimension;zw,zh>`: Specifies the width of the sidenote. + +### +class option +* `open_bracket_pos=[zenkaku_tentsuki/zenkakunibu_nibu/nibu_tentsuki]`: Specifies the positioning of opening brackets at the start of a line. Options are: + - `zenkaku_tentsuki`: Full-width characters are indented at the start of a paragraph. + - `zenkakunibu_nibu`: Full-width at the start of a paragraph, half-width at a line break. + - `nibu_tentsuki`: Half-width indentation at the start of a line. +* `hanging_punctuation`: Enables hanging punctuation. + +### Reverse pagination +class option. +* `use_reverse_pagination`: Enables reverse pagination functionality. Defines a ‘read-only counter’ named `jlreqreversepage`. Commands like `\arabic` and `\value` can be applied to it, and `\thejlreqreversepage` is defined as `\arabic{jlreqreversepage}`. + +### Note related +Specified by `\jlreqsetup`. + +* `reference_mark=[inline/interlinear]`: Specifies the placement of reference marks. Options are `inline` (in the line after the relevant item) or `interlinear` (above the line for horizontal writing, or to the right for vertical writing). +* `footnote_second_indent=<dimension>`: Sets the indent for the second and subsequent lines of footnotes (horizontal writing) or sidenotes (vertical writing). +* `sidenote_type=[number/symbol]`: Determines the correspondence between the sidenote and the text. Options are `number` (default, with a serial number indicating the note) or `symbol` (with a specific symbol and the word with the note emphasized). +* `sidenote_symbol=<code>`: When `sidenote_type=symbol` is specified, this sets the symbol to be used at the note's location. THe default is * +* `sidenote_keyword_font=<font setting code>`: Specifies the font for the word with the sidenote when `sidenote_type=symbol` is used. +* `endnote_second_indent=<dimension>`: Sets the indent for the second and subsequent lines of endnotes. +` endnote_position=[headings/paragraph/{_<heading name 1>,_<heading name 2>,...}]`: The output location of the endnote can be specified. `headings` will output the note before each heading (default), `paragraph` will output it when a new paragraph starts, and specifying `endnote_position={_chapter,_section}` will output it before `\chapter` and `\section`. To specify `<_heading name>`, the target heading must be created using the functionality of this class file. +* `warichu_opening=<code>`, `warichu_closing=<code>`: These are inserted before and after the warichu (split annotation). The default is parentheses (). + +### Caption +You can change the captions for figures and tables using `\jlreqsetup`. All settings allow for environment-specific customization. For example, `caption_font=\normalsize,table=\Large` means that within the table environment, `\Large` will be applied, while `\normalsize` will be applied in other environments. Other settings follow the same pattern. +* `caption_font=<font setting code>`: Specifies the font for the caption itself. +* `caption_label_font=<font setting code>`: Specifies the font for the caption label. +* `caption_after_label_space=<dimension>`: Specifies the space between the label and the caption text. +* `caption_label_format=<code>`: Specifies the format of the label. For example, `caption_label_format={#1:}` where `#1` is replaced with something like “Figure 1”. +* `caption_align=[left/right/center/bottom/top]`: Specifies the position of the caption. For instance, `{center,*left}` means it’s usually centered, but aligned left when the caption is large. + +### Quotation +* `quote_indent=<dimension>`: Specifies the indentation for quotes. The default is `2\zw`. The length of a line is adjusted to be an integer multiple of the character size. +* `quote_end_indent=<dimension>`: Specifies the indentation for the end of quotes. The default is `0\zw`. +* `quote_beforeafter_space=<dimension>`: Specifies the space before and after quotes. Setting `quote_beforeafter_space=1\baselineskip` will result in a one-line space. +* `quote_fontsize=[normalsize/small/footnotesize/scriptsize/tiny]`: Specifies the font size for quotes. + +### Itemization +* `itemization_beforeafter_space=<dimension>`: Specifies the space before and after the itemization. For example, `itemization_beforeafter_space={i=<dimension>}` sets the space for the top level only. `itemization_beforeafter_space={0pt,i=10pt,ii=5pt}` sets 10pt for level 1 itemization, 5pt for level 2, and 0pt for others. Levels are indicated by lowercase Roman numerals. +* `itemization_itemsep=<dimension>`: Specifies the space between items. + +### Front matter etc. +You can specify the behavior of `\frontmatter` / `\mainmatter` / `\backmatter` / `\appendix` with `\jlreqsetup`. + +* `frontmatter_pagebreak=[cleardoublepage/clearpage]`: Specifies the command name to execute the page break at `\frontmatter`. If it is empty, nothing is done. +* `frontmatter_counter={<counter name>={value=<value>, the=<code>, restore=[true/false]},…}`: Specifies the operation of the counter at `\frontmatter`. For example, `chapter={value=0,the={[\arabic{chapter]}}` sets the value of the chapter counter to 0 and `\thechapter` to `[\arabic{chapter}]`. By default, the value and `\the<counter name>` definition are restored at `\mainmatter`, but this behavior is suppressed by specifying Prestore=false`. +* `frontmatter_heading={<heading command name>={<setting>},…}`: Changes the behavior of the heading command. In addition to the items that can be specified by `\Delare***Heading`, the following are accepted. + - `heading_type=[Tobira/Block/Runin/Cutin/Modify]`: The type of heading1. If Modify is specified, it will be changed by `\ModifyHeading`. + - `heading_level=<number>`: Specifies the level of the heading command. If not specified, the value at `\frontmatter` is used. This is ignored when `heading_type=Modify`. + - `restore=[true/false]`: If true is specified, the original definition is restored at `\mainmatter`. The default is true. +* `frontmatter_pagestyle={<page style name>[,restore=[true/false]]}`: Switches to the specified page style at `\frontmatter`. By default, it returns to the original page style at `\mainmatter`, but this can be prevented by specifying `restore=false`. +* `frontmatter_pagination={<page number specification>[,continuous,independent]}`: Specifies the output format of the page number, such as `frontmatter_pagination=roman`, with the LaTeX command name. In addition, continuous makes it a continuous number, and independent makes it a separate number. +* `frontmatter_precode=<code>`: The code that is executed first at `\frontmatter`. +* `frontmatter_postcode=<code>`: The code that is executed last at `\frontmatter`. + +There are also settings that change `frontmatter` to `mainmatter`, `backmatter`, or `appendix`. However, there are some differences as follows. +* `restore=[true/false]` is an invalid setting. +* Pmainmatter_pagination` cannot specify continuous or independent. +* `appendix_pagebreak`, `appendix_pagestyle`, `appendix_pagination` do not exist. + +#### Abstract +* `abstract_with_maketitle=[true/false]`: If the abstract environment is written before `\maketitle`, it delays its content and outputs it with `\maketitle`. Even in the case of two columns, it is output in one column. The default is false. This option is available only when `article` and `report` are specified. + +## Headings +You can create new headings with commands like `\New***Heading` ( is a string that corresponds to the type of heading). The format is always `\New***Heading{<command name>}{<level>}{<settings>}`. Also, `\Renew***Heading`, `\Provide***Heading`, and `\Declare***Heading` are available at the same time. They are respectively + +* `\Renew***Heading`: If the command with the specified name is not defined, it causes an error. +* `\Provide***Heading`: If the command with the specified name is not defined, it defines a new heading command. +* `\Declare***Heading`: It defines a new heading command regardless of whether the command with the specified name is defined or not. + +### Tobira headings +You can create it with \NewTobiraHeading. It creates a command with the same format as the usual class file’s \section and so on. The settings are as follows. +. +* `type=[han/naka]`: It creates a half-title heading if `han` is specified, and a middle-title heading if `naka` is specified. +* `pagestyle=<page style name>`: It specifies the page style of the heading area. +* `label_format=<code>`: It specifies the command to output the label. For example, specify it as `label_format={Chapter \thechapter}`. +* `format=<code>`: It specifies the format to actually output. `#1` is replaced with the label, `#2` with the heading text. In this case, the commands `\jlreqHeadingLabel` and `\jlreqHeadingText` are available internally. They are commands that take one argument each, and output the given argument itself if the label and heading text are not empty, respectively, and output nothing otherwise. For example, if you specify it as `format={[\jlreqHeadingLabel{Label=#1}]}`, it outputs `[Label=<label>]` if the label is not empty, and `[]` otherwise. Note that `#1` is replaced not with the label itself, but with the code that has the adjustment of the space and so on. Therefore, you may get an unexpected result. `#2` is the same. +* `number=[true/false]`: It specifies whether to number or not. However, even if `number=false` is specified, the corresponding counter is defined. Also, the definition of `\the<counter name>` is not changed, so you need to redefine it if necessary. + +### Block headings +You can create it with `\NewBlockHeading`. It creates a command with the format `\<command name>*[running head]{heading text}[subtitle]`. The settings are as follows. + +#### Format related +* `font=<font setting code>`: It specifies the font of the heading. +* `subtitle_font=<font setting code>`: It specifies the font of the subtitle. +* `label_format=<code>`: It specifies the format of the label. Specify it as `label_format={Chapter \thechapter}`, for example. +* `subtitle_format=<code>`: It specifies the format of the subtitle. Specify it as `subtitle_format={“#1”}`, for example. `#1` is replaced with the subtitle itself. +* `format=<code>`: It specifies the format of the entire heading. `#1` is replaced with the label, `#2` with the heading text, `#3` with the subtitle. Internally, the commands `\jlreqHeadingLabel`, `\jlreqHeadingText`, and `\jlreqHeadingSubtitle` are available. They are commands that take one argument each, and output the given argument itself if the label, heading text, and subtitle are not empty, respectively, and output nothing otherwise. For example, if you specify it as `format={[\jlreqHeadingLabel{Label=#1}]}`, it outputs `[Label=<label>]` if the label is not empty, and `[]` otherwise. Note that `#1` is replaced not with the label itself, but with the code that has the adjustment of the space and so on. Therefore, you may get an unexpected result. `#2` and `#3` are the same. + +#### Indent related +* `align=[left/center/right]`: It specifies the horizontal alignment of the heading position. +* `indent=<dimension>`: It specifies the amount of indentation of the entire heading. +* `end_indent=<dimension>`: It specifies the amount of back indentation of the entire heading. +* `after_label_space=<dimension>`: It specifies the amount of space between the label and the heading text. +* `second_heading_text_indent=[<dimension>/{<dimension>,<dimension>}]`: It specifies the indent of the second and subsequent lines of the heading text. It specifies from the beginning of the first line of the heading text, but if you put `*` at the beginning like `second_heading_text_indent=*1\zw`, it specifies from the beginning of the label. Also, if you specify it as `second_heading_text_indent={<when there is a label>,<when there is no label>}`, you can change the value depending on the presence or absence of the label. You can also use * in the specification of `<when there is a label>`. +* `subtitle_indent=<dimension>`: It specifies the amount of indentation of the subtitle. It specifies from the beginning of the first line of the heading text. However, if you put `*` at the beginning like `subtitle_indent=*1\zw`, it specifies from the beginning of the label. It is valid only when `subtitle_break=true`. + +#### Others +* `subtitle_break=[true/false]`: It specifies whether to break the line between the heading text and the subtitle. +* `allowbreak_if_evenpage=[true/false]`: It allows a page break immediately after the heading if it is on an even page. +* `pagebreak=[clearpage/cleardoublepage/clearcolumn/nariyuki/begin_with_odd_page/begin_with_even_page]`: It specifies the page break before the heading2. They are respectively, page break, `\cleardoublepage` execution, column break, as it is, start with odd page, start with even page. +* `pagestyle=<page style name>`: It specifies the page style of the heading area. +* `afterindent=[true/false]`: It specifies whether to indent the paragraph immediately after the heading. +* `column_spanning=[true/false]`: It makes the heading span columns. It is ignored when `pagebreak=nariyuki` or `pagebreak=clearcolumn`. +* `number=[true/false]`: It specifies whether to number or not. The same caution as `\NewTobiraHeading` is required. + +#### Gyo-dori +You can specify gyo-dori setting in one of the following ways. + +* Specify the number of lines and place it in the center. Specify the number of lines with `lines=<natural number>`. You can also specify the number of lines to add before and after with `before_lines=<natural number>` and `after_lines=<natural number>`. For example, if you specify `lines=3,after_lines=1`, it will be placed in four lines, and the space after will be one line larger than the space before. The space specified by `before_lines` does not enter at the top of the page, but if you put `*` at the beginning like `before_lines=*1`, it always enters. +* Specify the number of lines and either the space before or after. Specify the number of lines with `lines=<natural number>`, and the space before or after with either `before_space=<dimension>` or `after_space=<dimension>`. +* Specify the space before and after. Specify it with `before_space=<dimension>` and `after_space=<dimension>`. + + +### Gyo-dori for consecutive headings +You can set the gyo-dori settings for block headings that are placed consecutively with `\SetBlockHeadingSpaces`. `\SetBlockHeadingSpaces` is used as follows: + +```latex +\SetBlockHeadingSpaces { {_part{lines=3,before_lines=1},_section{lines=2},_subsection{lines=2}} [lines=5]{_section,23pt,_subsection,16pt} } +``` + +This means the following. + +* If the headings are placed in the order of `\part`, `\section`, `\subsection`, and the front and back are not headings, then `\part` is three-line spacing + one line space before, and `\section` and `\subsection` are two-line spacing. +* If the headings are placed in the order of `\section`, `\subsection`, and the front and back are not headings, then the whole is five-line spacing, and there is `23pt` space between `\section` and `\subsection`, and `16pt` space after `\subsection`. + +The individual settings are as follows. + +* Each `{}` contains `_<heading command name>` or `<dimension>` separated by commas. +* You can add settings enclosed in `[]` at the beginning. This is a setting for the entire heading that is placed consecutively. `lines / before_lines / after_lines / before_space / after_space` are available. Each meaning is the same as the line spacing specification described above. +* The dimension is the amount of space as it is. +* You can add settings enclosed in `{}` after `_<heading command name>` to set the amount of space for that heading. If not set, there is no space before and after. +* In the settings enclosed in `{}` for the heading, `lines / before_lines / after_lines / before_space / after_space` are available. Each meaning is the same as the line spacing specification described above. +* If you make the part enclosed in `{}` only `*`, (for example, `_section{*}`), it uses the same setting as when it is placed alone. + +Note that whether the headings are consecutive or not is determined simply by whether the block heading commands are written in succession. Therefore, even if there are commands that are not related to the output between the heading commands, they are not considered to be consecutive headings. However, if only spaces, line breaks, or `\label[<option>]{<argument>}…{<argument>}` are inserted between the heading commands, they are considered to be consecutive headings. + +### Run-in headings + +Run-in headings are created with `\NewRuninHeading`. The command creates a heading with the same format as the standard document class's `\section`, i.e. `\<command name>*[running head]{heading text}`. The settings are as follows: + +* `font=<font setting command>`: Specifies the font of the heading. +* `indent=<dimension>`: Specifies the indentation of the entire heading text. +* `after_label_space=<dimension>`: Specifies the space between the label and the heading text. +* `label_format=<code>`: Specifies the format of the label. For example, `label_format={\theparagraph}`. +* `after_space=<dimension>`: Specifies the space between the heading and the main text. +* `number=[true/false]`: Specifies whether to number the heading or not. The same caution as `\NewTobiraHeading` applies. + +### Cut-in headings +You can create cut-in headings with `\NewCutinHeading`. The command has the format `\<command name>{heading text}`. The settings are as follows: +* `font=<font setting command>`: Specifies the font of the heading. +* `indent=<dimension>`: Specifies the indentation of the entire heading. +* `after_space=<dimension>`: Specifies the space between the heading and the text. +* `onelinemax=<dimension>`, `twolinemax=<dimension>`: If the length of the heading text is less than or equal to `onelinemax`, the window heading is output in one line. If it is less than or equal to `twolinemax`, it is output in two lines. Otherwise, it is output in three lines. The default values are 6 characters and 20 characters, respectively. + +### `\ModifyHeading` +`\ModifyHeading` is a command that changes the settings of a heading command that has already been defined (using one of the above commands). For example, + +```latex +\ModifyHeading{section}{lines=10} +``` + +changes only the line spacing of `\section` to 10 lines, while keeping the font and other settings the same. You cannot change the type of heading with this command. + +### `\SaveHeading` + +`\SaveHeading` saves the definition of a heading command. For example, you can use it like this: + +```latex +\SaveHeading{section}{\restoresection} % Save the contents of \section to \restoresection. +\RenewBlockHeading{section}{1}{font=…} % Redefine \section with a new font. +… +\restoresection % Restore the contents of \section. +``` + +## Page Style +You can define a page style using +```latex +\NewPageStyle{<page style name>}{<settings>} +``` + +`<settings>` is in keyval format. You can apply the defined page style with `\pagestyle`. The settings are as follows: + +* `yoko`: Prints horizontally at the top and bottom. Default. +* `tate`: Prints vertically on the fore-edge side. +* `running_head_font=<font setting command>`: Specifies the font for the running head. +* `nombre_font=<font setting command>`: Specifies the font for the page number. +* `running_head_position`, `nombre_position`: Specifies the position of the running head and the page number. The specification method changes depending on whether `yoko` or `tate` is specified. + - `yoko` specified: You can specify it like top-left. You can use `top / bottom / center / left / right / gutter / fore-edge`. `left` and `right` are for odd pages. If `twoside` is specified, even pages are the opposite. + - `tate` specified: You can specify `<dimension>`. `running_head_position` specifies the drop amount from the top of the running head, and `nombre_position` specifies the raise amount from the bottom of the page number. +* `nombre=<format>`: Specifies the page number to output. The default is `\thepage`. +* `odd_running_head=<format>`, `even_running_head=<format>`: Specifies the running head for odd and even pages, respectively. If you specify a name starting with _ like `_section`, it outputs the corresponding heading. (`_section` outputs the current `\section`.) +* `mark_format={[odd=<format>/even=<format>/_<heading command name>=<format>],…}`: Specifies the format for outputting headings to the running head. Specify it like `mark_format={_section={Section \thesection: #1},_chapter={Chapter \thechapter \quad #1}}`. You can also specify odd or even instead of the heading command name, which will be the format for the running head on odd/even pages. It is implemented by defining `\sectionmark` etc. when executing `\pagestyle`. +* `nombre_ii=<format>`: Specifies the second page number. You can also specify the location with `nombre_ii_position` and the font with `nombre_ii_font`. The specification method is the same as `nombre` and `nombre_position`. +* `odd_running_head_ii`, `even_running_head_ii`, `running_head_ii_position`, `running_head_ii_font` are also available. If `nombre_ii_position` or `running_head_ii_position` is not specified, it will be set to the same position as `nombre_position` or `running_head_position` when `yoko` is specified. When `tate` is specified, it will be displayed in the place following the first page number or running head. +* `odd_head_format=<format>`, `odd_foot_format=<format>`, `even_head_format=<format>`, `even_foot_format=<format>P: Specifies the format for the header and footer. `#1` will be replaced with the entire header or footer. However, `#1` may contain code for position adjustment, so it may not work as expected, especially when `tate` is specified in `\NewPageStyle`. For example, to draw a rule under the header on odd pages, you can do `odd_head_format={\underline{\makebox[\jlreqyokoheadlength]{#1}}}`. `\jlreqyokoheadlength` is a macro defined in this class file and gives the horizontal length of the header. (The footer length is the same.) The vertical length, i.e., the length when `tate` is specified in `\NewPageStyle`, can be obtained with `\jlreqtateheadlength`. + +`\RenewPageStyle`, `\ProvidePageStyle`, `\DeclarePageStyle` are also available1. + +You can modify an existing page style with `\ModifyPageStyle`. + +## JFM +We use the following custom JFMs. Some packages may reset the settings to use their own JFMs or the standard JFMs. In that case, you need to set the appropriate package options to use the JFMs of this class file. + +### For pLaTeX/upLaTeX + +The names of the JFMs are as follows. The characters enclosed in `[]` may or may not be included depending on the settings. + +``` +[u][b][z]jlreq[g][-v] +``` + +Each character is included in the following cases. + +* `u`: When using upLaTeX +* `b`: When using hanging punctuation. (When the class option hanging_punctuation is specified.) +* `z`: When the space before the opening brackets at the beginning of a line is two-bun for the beginning of a paragraph and one-bun for the line break. (When the class option `open_bracket_pos=zenkakunibu_nibu` is specified.) +* `g`: For gothic fonts. +* `-v`: For vertical writing. + +For example, if you process a source without using hanging punctuation and specifying `open_bracket_pos=zenkakunibu_nibu` as a class option with pLaTeX, the JFM named zjlreq will be used for horizontal writing mincho font. + +For LuaLaTeX + +* The JFM for horizontal writing is jlreq +* The JFM for vertical writing is jlreqv + +The same JFM is used for gothic fonts. This class file changes the JFM of LuaTeX-ja standard to these. + +## Others + +If the class option `jlreq_notes` is passed, a notification will be given when a setting that contradicts the description of Japanese typesetting processing is made. +## jlreq-complements +`jlreq-complements` is a package that customizes the environments that are typically provided by LaTeX document classes. You can use it as follows. It accepts the following options: + +* `platex`, `uplatex`, `lulalatex`: Specify the engine. +* `setupname=<name>`: Specify the name of the command for customization. The default is `jlreqcomplementssetup`, and you can set it by writing `\jlreqcomplementssetup{<settings>}` in the preamble. + + +In `jlreq`, it is loaded as `\usepackage[<engine recognized in jlreq>,setupname=jlreqsetup]{jlreq-complements}`, so you can customize the environments with the usual `\jlreqsetup`. To make this work well with an existing name, the original command and the new one need to be compatible. It is usually better to avoid this. + +### `thebibliography` environment + +* `thebibliography_heading=<code>`: Specify the command to output the heading of the `thebibliography` environment. Use it like `thebibliography_heading={\section*{\refname}}`. +* `thebibliography_after_label_space=<dimension>`: Specify the space after the label of each item in the `thebibliography` environment. +* `thebibliography_indent=<dimension>`: Specify the indentation of the entire `thebibliography` environment. +* `thebibliography_mark=<code>`: Specify the code to register the heading of the `thebibliography` environment in the column. +* `thebibliography_precode=<code>`, `thebibliography_postcode=<code>`: Specify the code that is executed before and after the `thebibliography` environment, respectively. + +### `theindex` environment +* `theindex_heading=<code>`: Specify the command to output the heading of the `theindex` environment. +* `theindex_mark=<code>`: Specify the code to register the heading of the `theindex` environment in the column. +* `theindex_twocolumn=[true/false]`: Specify whether to output the `theindex` environment in two columns. +* `theindex_column_gap=<dimension>`: Specify the column gap in the `theindex` environment when `theindex_twocolumn=true`. +* `theindex_column_rule_width=<dimension>`: Specify the value of `\columnseprule` in the `theindex` environment when `theindex_twocolumn=true`. +* `theindex_pagestyle=<page style name>`: Specify the page style for the `theindex` environment. +* `theindex_postcode=<code>`, `theindex_precode=<code>`: Specify the code that is executed before and after the `theindex` environment, respectively. + +### Theorem environment +* ` theorem_beforeafter_space=<dimension>`: Specify the space before and after the theorem environment. +* `theorem_label_font=<font setting code>`: Specify the font for the label part of the theorem environment. +* `theorem_font=<font setting code>`: Specify the font for the body of the theorem environment. +* `theorem_indent=<dimension>`: Specify the indentation of the body of the theorem environment. +* `proof_label_font=<font setting code>`: This setting is only valid when the `amsthm` package is loaded. Specify the font for the label of the `proof` environment. + +When the `amsthm` package is loaded, a new theorem style `jlreq` is defined and the current style is changed to `jlreq`. In this case, the above settings function as settings for this `jlreq` style. ## LICENSE This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENSE). @@ -197,6 +573,13 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS - Some other improvements etc. * 2024-02-16 - Fixed a bug. +* 2024-08-23 + - Fixed bugs. + - Changed the name of some internal variables. + - Added the usage of this class to English document. + - Use `\DeclareKeys` etc. + - Changed the internal processing of block headings a little. + -------------- Noriyuki Abe https://github.com/abenori/jlreq diff --git a/macros/jptex/latex/jlreq/jlreq-complements.sty b/macros/jptex/latex/jlreq/jlreq-complements.sty index 80ab620650..1dc817a197 100644 --- a/macros/jptex/latex/jlreq/jlreq-complements.sty +++ b/macros/jptex/latex/jlreq/jlreq-complements.sty @@ -1,7 +1,6 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{jlreq-complements}[2022/11/28 jlreq-complements] -\RequirePackage{jlreq-helpers}[2022/11/28] -\RequirePackage{l3keys2e} +\ProvidesPackage{jlreq-complements}[2024/08/23 jlreq-complements] +\RequirePackage{jlreq-helpers}[2024/02/13] \ExplSyntaxOn @@ -9,7 +8,7 @@ \str_new:N \g__jlreq_complements_engine_str \tl_new:N \g__jlreq_complements_finally -\keys_define:nn { jlreq-complements } { +\DeclareKeys [jlreq-complements] { setupname .code:n = { \str_set:Nn \g__jlreq_complements_setupname_str {#1} }, @@ -20,8 +19,8 @@ lualatex .code:n = { \str_set:Nn \g__jlreq_complements_engine_str { lualatex } }, lualatex .value_forbidden:n = true, } -\keys_set:nn { jlreq-complements } { setupname = jlreqcomplementssetup } -\ProcessKeysOptions { jlreq-complements } +\SetKeys [jlreq-complements] { setupname = jlreqcomplementssetup } +\ProcessKeyOptions [jlreq-complements] \str_if_empty:NT \g__jlreq_complements_engine_str { \jlreq@helper@guessengine @@ -37,7 +36,8 @@ \str_if_eq:VnTF \g__jlreq_complements_engine_str { lualatex } { \prg_new_conditional:Nnn \__jlreq_complements_iftdir: { T, F, TF} { - \int_compare_p:n { (\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8) == 3 } + \int_compare:nTF { (\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8) == 3 } + { \prg_return_true: } { \prg_return_false: } } }{ \prg_new_conditional:Nnn \__jlreq_complements_iftdir: { T, F, TF} { \iftdir \prg_return_true: \else \prg_return_false: \fi } diff --git a/macros/jptex/latex/jlreq/jlreq-ja.pdf b/macros/jptex/latex/jlreq/jlreq-ja.pdf Binary files differindex 991e8350bd..ed4fb07f5d 100644 --- a/macros/jptex/latex/jlreq/jlreq-ja.pdf +++ b/macros/jptex/latex/jlreq/jlreq-ja.pdf diff --git a/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md b/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md index 683ba23928..f76e369f55 100644 --- a/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md +++ b/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md @@ -191,6 +191,8 @@ dviドライバの指定です.エンジンに`lualatex`を利用する場合 - 縦書きで読み込み時にエラーが出るバグ修正. * 2024-02-13 - ドキュメントの間違いを修正. +* 2024-08-23 + - `\DeclareKeys`などを使うようにした. -------------- Noriyuki Abe diff --git a/macros/jptex/latex/jlreq/jlreq-trimmarks.md b/macros/jptex/latex/jlreq/jlreq-trimmarks.md index 724969599b..c116121a7c 100644 --- a/macros/jptex/latex/jlreq/jlreq-trimmarks.md +++ b/macros/jptex/latex/jlreq/jlreq-trimmarks.md @@ -183,8 +183,10 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS - Added `trimmarks_pattern` to `\jlreqtrimmarkssetup`. * 2023-06-19 - Fixed a bug: an error occurred when the package is loaded with tate mode. -* 2023-02-13 +* 2024-02-13 - Fixed a bug in a document. +* 2024-08-23 + - Use `\DeclareKeys` etc. -------------- Noriyuki Abe diff --git a/macros/jptex/latex/jlreq/jlreq-trimmarks.sty b/macros/jptex/latex/jlreq/jlreq-trimmarks.sty index ec65cabae9..1cded80d8c 100644 --- a/macros/jptex/latex/jlreq/jlreq-trimmarks.sty +++ b/macros/jptex/latex/jlreq/jlreq-trimmarks.sty @@ -1,6 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{jlreq-trimmarks}[2024/02/13 jlreq-trimmarks] -\RequirePackage{l3keys2e} +\ProvidesPackage{jlreq-trimmarks}[2024/08/23 jlreq-trimmarks] \RequirePackage{jlreq-helpers}[2024/02/13] \ExplSyntaxOn @@ -42,13 +41,13 @@ } % dvipdfmx=f,dvips=s,dviout = o, lualatex = l -\keys_define:nn { jlreq-trimmarks } { +\DeclareKeys [jlreq-trimmarks] { dvipdfmx .code:n = {\let\jlreq@trimmarks@driver=f}, .value_forbidden:n = true, dvips .code:n = {\let\jlreq@trimmarks@driver=s}, .value_forbidden:n = true, dviout .code:n = {\let\jlreq@trimmarks@driver=o}, .value_forbidden:n = true } \let\jlreq@trimmarks@engine=\jlreq@engine -\keys_define:nn { jlreq-trimmarks } { +\DeclareKeys [jlreq-trimmarks] { lualatex .code:n = {\let\jlreq@trimmarks@engine=l}, .value_forbidden:n = true, uplatex .code:n = {\let\jlreq@trimmarks@engine=u}, .value_forbidden:n = true, platex .code:n = {\let\jlreq@trimmarks@engine=p}, .value_forbidden:n = true @@ -156,7 +155,7 @@ } \__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@analyzepapersize -\keys_define:nn { jlreq-trimmarks } { trimmarks_paper .tl_set:N = \jlreq@trimmarks@option@papersize } +\DeclareKeys [jlreq-trimmarks] { trimmarks_paper .tl_set:N = \jlreq@trimmarks@option@papersize } \__jlreq_trimmarks_afterpkg_addtodeletecs:N \jlreq@trimmarks@option@papersize \newif\ifjlreq@trimmarks@digital \jlreq@trimmarks@digitaltrue @@ -166,7 +165,7 @@ % flag: `show` is specified or not \newif\ifjlreq@trimmarks@option@show \jlreq@trimmarks@option@showfalse -\keys_define:nn { jlreq-trimmarks } { +\DeclareKeys [jlreq-trimmarks] { show .code:n = { \jlreq@trimmarks@option@showtrue \jlreq@ifempty{#1}{ @@ -214,14 +213,14 @@ } \newif\ifjlreq@trimmarks@landscape \jlreq@trimmarks@landscapefalse -\keys_define:nn { jlreq-trimmarks } { landscape .code:n = {\jlreq@trimmarks@landscapetrue}, .value_forbidden:n = true } +\DeclareKeys [jlreq-trimmarks] { landscape .code:n = {\jlreq@trimmarks@landscapetrue}, .value_forbidden:n = true } \__jlreq_trimmarks_afterpkg_addtodeleteif:N \ifjlreq@trimmarks@landscape -\keys_set:nn { jlreq-trimmarks } { +\SetKeys [jlreq-trimmarks] { trimmarks_paper = {+2in}, bleed_margin = { top = 3mm, bottom = 3mm, gutter = 3mm, fore-edge = 3mm }, } -\ProcessKeysOptions { jlreq-trimmarks } +\ProcessKeyOptions [jlreq-trimmarks] \ifjlreq@trimmarks@option@show\else \ifx o\jlreq@trimmarks@driver diff --git a/macros/jptex/latex/jlreq/jlreq.cls b/macros/jptex/latex/jlreq/jlreq.cls index b8e5c3dbcb..8f14372b38 100644 --- a/macros/jptex/latex/jlreq/jlreq.cls +++ b/macros/jptex/latex/jlreq/jlreq.cls @@ -5,28 +5,39 @@ %% % (based on JLReq 20200811 https://www.w3.org/TR/2020/NOTE-jlreq-20200811/) \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{jlreq}[2024/02/16 jlreq] -\RequirePackage{l3keys2e} +\ProvidesClass{jlreq}[2024/08/23 jlreq] \RequirePackage{etoolbox} \RequirePackage{jlreq-helpers}[2024/02/13] \ExplSyntaxOn +\cs_new:Nn \l_jlreq_do: {} \int_new:N \l__jlreq_tmpa_int +\int_new:N \l__jlreq_tmpb_int +\int_new:N \l__jlreq_tmpc_int \tl_new:N \l__jlreq_tmpa_tl \tl_new:N \l__jlreq_tmpb_tl \tl_new:N \l__jlreq_tmpc_tl -\cs_new:Nn \l_jlreq_do: {} \str_new:N \l__jlreq_tmpa_str \str_new:N \l__jlreq_tmpb_str \str_new:N \l__jlreq_tmpc_str -\bool_new:N \l_jlreq_tmpa_bool -\clist_new:N \l_jlreq_tmpa_clist +\bool_new:N \l__jlreq_tmpa_bool +\bool_new:N \l__jlreq_tmpb_bool +\bool_new:N \l__jlreq_tmpc_bool +\clist_new:N \l__jlreq_tmpa_clist +\clist_new:N \l__jlreq_tmpb_clist +\clist_new:N \l__jlreq_tmpc_clist \seq_new:N \l__jlreq_tmpa_seq +\seq_new:N \l__jlreq_tmpb_seq +\seq_new:N \l__jlreq_tmpc_seq \dim_new:N \l__jlreq_tmpa_dim -\skip_new:N \l_jlreq_tmpa_skip -\box_new:N \l_jlreq_tmpa_box -\box_new:N \l_jlreq_tmpb_box -\box_new:N \l_jlreq_tmpc_box +\dim_new:N \l__jlreq_tmpb_dim +\dim_new:N \l__jlreq_tmpc_dim +\skip_new:N \l__jlreq_tmpa_skip +\skip_new:N \l__jlreq_tmpb_skip +\skip_new:N \l__jlreq_tmpc_skip +\box_new:N \l__jlreq_tmpa_box +\box_new:N \l__jlreq_tmpb_box +\box_new:N \l__jlreq_tmpc_box \prop_new:N \l__jlreq_tmpa_prop \prop_new:N \l__jlreq_tmpb_prop \prop_new:N \l__jlreq_tmpc_prop @@ -91,7 +102,8 @@ % ものは\jlreq@option@<key>に格納する. % _とかは@に変換する. % エンジン類 -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { + name.usage = load, uplatex .code:n = { \let\jlreq@engine=u }, uplatex .value_forbidden:n = true, platex .code:n = { \let\jlreq@engine=p }, platex .value_forbidden:n = true, lualatex .code:n = { \let\jlreq@engine=l }, lualatex .value_forbidden:n = true, @@ -115,13 +127,13 @@ \tl_gput_right:Nn \g__jlreq_papersizelist_tl { { ##1 } { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } } } \clist_map_inline:nn {#2} { - \keys_define:nn { jlreq } { + \DeclareKeys [jlreq] { ##1 .code:n = { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} }, ##1 .value_forbidden:n = true } } } -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { paper .code:n = { \str_case:nVF {#1} \g__jlreq_papersizelist_tl { \jlreq@helper@dividebycomma{#1}% @@ -153,7 +165,7 @@ } \clist_map_inline:nn {#2} { \cs_set:Nx \l__jlreq_do: { - \exp_not:N \keys_define:nn { jlreq } { + \exp_not:N \DeclareKeys [jlreq] { ##1 .code:n = { \exp_not:o { \l__jlreq_tmpa:n {##1} } \exp_not:n { \setlength{\paperwidth}{#3} \setlength{\paperheight}{#4} } @@ -276,7 +288,7 @@ %.. フォントサイズ,行長,1ページあたりの行数で基本版面のサイズを決める(2.4.1.a) \__jlreq_aftercls_addtodeletecs:N \jlreq@option@fontsize -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { fontsize .tl_set:N = \jlreq@option@fontsize, 10pt .code:n = {\def\jlreq@option@fontsize{10pt}}, 10pt .value_forbidden:n = true, 11pt .code:n = {\def\jlreq@option@fontsize{11pt}}, 11pt .value_forbidden:n = true, @@ -287,69 +299,68 @@ \__jlreq_aftercls_addtodeletecs:N \jlreq@option@jafontsize \__jlreq_aftercls_addtodeletecs:N \jlreq@option@jafontscale %.. 行の長さ -\keys_define:nn { jlreq } { line_length .tl_set:N = \jlreq@option@line@length } +\DeclareKeys [jlreq] { line_length .tl_set:N = \jlreq@option@line@length } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@line@length %.. 1ページあたりの行数 -\keys_define:nn { jlreq } { number_of_lines .tl_set:N = \jlreq@option@number@of@lines } +\DeclareKeys [jlreq] { number_of_lines .tl_set:N = \jlreq@option@number@of@lines } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@number@of@lines % 地の空き量,のどの空き量で配置位置を決める(2.4.1.b)省略されたら中央配置. %.. 天 -\keys_define:nn { jlreq } { head_space .tl_set:N = \jlreq@option@head@space } +\DeclareKeys [jlreq] { head_space .tl_set:N = \jlreq@option@head@space } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@head@space %.. 地 -\keys_define:nn { jlreq } { foot_space .tl_set:N = \jlreq@option@foot@space } +\DeclareKeys [jlreq] { foot_space .tl_set:N = \jlreq@option@foot@space } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@foot@space %.. のど -\keys_define:nn { jlreq } { gutter .tl_set:N = \jlreq@option@gutter } +\DeclareKeys [jlreq] { gutter .tl_set:N = \jlreq@option@gutter } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@gutter %.. 小口 \__jlreq_aftercls_addtodeletecs:N \jlreq@option@fore@edge -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { fore_edge .tl_set:N = \jlreq@option@fore@edge, fore-edge .tl_set:N = \jlreq@option@fore@edge } %.. 柱とノンブル % 本文とヘッダ/フッタの間の空き -\keys_define:nn { jlreq } { headfoot_verticalposition .tl_set:N = \jlreq@option@headfoot@verticalpos } +\DeclareKeys [jlreq] { headfoot_verticalposition .tl_set:N = \jlreq@option@headfoot@verticalpos } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@headfoot@verticalpos % 柱やノンブルの左右の空き -\keys_define:nn { jlreq } { headfoot_sidemargin .tl_set:N = \jlreq@headfoot@sidemargin } +\DeclareKeys [jlreq] { headfoot_sidemargin .tl_set:N = \jlreq@headfoot@sidemargin } %.. 段間 -\keys_define:nn { jlreq } { column_gap .tl_set:N = \jlreq@option@column@gap } +\DeclareKeys [jlreq] { column_gap .tl_set:N = \jlreq@option@column@gap } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@column@gap %.. 行送り,指定無しの場合は文字サイズの1.7倍とする.(1.5から2倍が好ましい:2.4.2.d 注3) -\keys_define:nn { jlreq } { - baselineskip .tl_set:N = \jlreq@option@baselineskip, - linegap .code:n = { \def\jlreq@option@baselineskip{1zw + #1} } +\DeclareKeys [jlreq] { + baselineskip .tl_set:N = \jlreqbaselineskip, + linegap .code:n = { \def\jlreqbaselineskip{1zw + #1} } } -\__jlreq_aftercls_addtodeletecs:N \jlreq@option@baselineskip %.. 組み方系 % 行頭に括弧が来たときの配置:3.1.5 % 段落頭指定_折り返し行頭指定 で与える. -\keys_define:nn { jlreq } { open_bracket_pos .choices:nn = {zenkaku_tentsuki,zenkakunibu_nibu,nibu_tentsuki}{\def\jlreq@open@bracket@pos{#1}} } +\DeclareKeys [jlreq] { open_bracket_pos .choices:nn = {zenkaku_tentsuki,zenkakunibu_nibu,nibu_tentsuki}{\def\jlreq@open@bracket@pos{#1}} } % ぶら下げ組みをするか:3.8.2 注1 \newif\ifjlreq@burasage\jlreq@burasagefalse -\keys_define:nn { jlreq } { hanging_punctuation .code:n = {\jlreq@burasagetrue}, hanging_punctuation .value_forbidden:n = true} +\DeclareKeys [jlreq] { hanging_punctuation .code:n = {\jlreq@burasagetrue}, hanging_punctuation .value_forbidden:n = true} % jsarticleと同じkanjiskipを使う \newif\ifjlreq@narrow@kanjiskip\jlreq@narrow@kanjiskipfalse -\keys_define:nn { jlreq } { narrow_kanjiskip .code:n = {\jlreq@narrow@kanjiskiptrue}, narrow_kanjiskip .value_forbidden:n = true} +\DeclareKeys [jlreq] { narrow_kanjiskip .code:n = {\jlreq@narrow@kanjiskiptrue}, narrow_kanjiskip .value_forbidden:n = true} \__jlreq_aftercls_addtodeleteif:N \ifjlreq@narrow@kanjiskip %.. 注 % 傍注のタイプ -\keys_define:nn { jlreq } { sidenote_length .tl_set:N = \jlreq@option@sidenote@length } +\DeclareKeys [jlreq] { sidenote_length .tl_set:N = \jlreq@option@sidenote@length } \__jlreq_aftercls_addtodeletecs:N \jlreq@option@sidenote@length %.. 逆ノンブル \newif\ifjlreq@option@use@reverse@pagination \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@use@reverse@pagination \jlreq@option@use@reverse@paginationfalse -\keys_define:nn { jlreq } { use_reverse_pagination .code:n = {\jlreq@option@use@reverse@paginationtrue}, use_reverse_pagination .value_forbidden:n = true } +\DeclareKeys [jlreq] { use_reverse_pagination .code:n = {\jlreq@option@use@reverse@paginationtrue}, use_reverse_pagination .value_forbidden:n = true } %.. もろもろ \newif\if@restonecol\@restonecolfalse @@ -358,7 +369,7 @@ \newif\if@tate \@tatefalse \newif\ifjlreq@option@titlepage \jlreq@option@titlepagefalse % titlepageかnotitlepageかが指定された \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@titlepage -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { landscape .code:n = {\@landscapetrue}, landscape .value_forbidden:n = true, tombo .code:n = {\ClassWarningNoLine{jlreq}{The~option~`tombo'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}}, tombow .code:n = {\ClassWarningNoLine{jlreq}{The~option~`tombow'~is~not~supported~by~jlreq~class.~Please~use~the~jlreq-trimmarks~package}}, @@ -368,7 +379,7 @@ \newif\ifjlreq@option@twoside\jlreq@option@twosidefalse % onesideかtwosideが指定された \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@twoside -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { oneside .code:n = { \@twosidefalse\@mparswitchfalse\jlreq@option@twosidetrue }, oneside .value_forbidden:n = true, twoside .code:n = { \@twosidetrue\@mparswitchtrue\jlreq@option@twosidetrue }, twoside .value_forbidden:n = true, onecolumn .code:n = { \@twocolumnfalse }, onecolumn .value_forbidden:n = true, @@ -381,7 +392,7 @@ \newif\if@openright \newif\ifjlreq@option@open \jlreq@option@openfalse % openrightかopenanyが指定された \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@open -\keys_define:nn { jlreq } { +\DeclareKeys [jlreq] { openright .code:n = { \@openrighttrue\jlreq@option@opentrue }, openright .value_forbidden:n = true, openany .code:n = { \@openrightfalse\jlreq@option@opentrue }, openany .value_forbidden:n = true, leqno .code:n = { \input{leqno.clo } }, leqno .value_forbidden:n = true, @@ -389,12 +400,12 @@ } \newif\ifjlreq@option@enablejfam \jlreq@option@enablejfamtrue \__jlreq_aftercls_addtodeleteif:N \ifjlreq@option@enablejfam -\keys_define:nn { jlreq } { disablejfam .code:n = { \jlreq@option@enablejfamfalse }, disablejfam .value_forbidden:n = true} +\DeclareKeys [jlreq] { disablejfam .code:n = { \jlreq@option@enablejfamfalse }, disablejfam .value_forbidden:n = true} \def\jlreq@note#1{} -\keys_define:nn { jlreq } { jlreq_notes .code:n = { \def\jlreq@note##1{\message{^^JJLReq note: ##1^^J}}}, jlreq_notes .value_forbidden:n = true} +\DeclareKeys [jlreq] { jlreq_notes .code:n = { \def\jlreq@note##1{\message{^^JJLReq note: ##1^^J}}}, jlreq_notes .value_forbidden:n = true} -\keys_set:nn { jlreq } { +\SetKeys [jlreq] { article_type=article,paper=a4, number_of_lines={},line_length = {}, head_space={},foot_space={},gutter={},fore_edge={}, @@ -402,8 +413,9 @@ sidenote_length=0pt,column_gap={2zw}, headfoot_verticalposition = {},headfoot_sidemargin={0pt}, open_bracket_pos=zenkaku_tentsuki, - onecolumn,final } -\ProcessKeysOptions { jlreq } + onecolumn,final +} +\ProcessKeyOptions [jlreq] \legacy_if:nF { jlreq@option@titlepage } { \str_if_eq:VnTF \jlreq@article@type { article } { \@titlepagefalse } { \@titlepagetrue } @@ -1189,23 +1201,22 @@ % \baselineskipの計算 % いったん文字サイズを変更((u)platexの際にzh/zwをきちんとするため) \@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@fontsize}% -\newdimen\jlreq@baselineskip +% 現在の\baselineskipを計算し#1に入れる \ifx l\jlreq@engine - \setlength{\jlreq@baselineskip}{% - \dimexpr\directlua{ + \edef\jlreqbaselineskip{ + \directlua{ local~act = string.char(92)~ - local~s = [[\jlreq@option@baselineskip]]~ + local~s = [[\jlreqbaselineskip]]~ s = s:gsub("[QH]",act .. "dimexpr 0.25mm" .. act .. "relax"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw")~ - tex.print(s)~ - }\relax - }% -\else - \setlength{\jlreq@baselineskip}{\dimexpr\jlreq@option@baselineskip\relax} + tex.print(act .. "unexpanded{" .. s .. "}")~ + } + } \fi -\ifdim\jlreq@fontsize>\jlreq@baselineskip +\dim_set:Nn \l__jlreq_tmpa_dim {\jlreqbaselineskip} +\ifdim\jlreq@fontsize>\l__jlreq_tmpa_dim \ClassError{jlreq}{The~baselineskip~is~less~than~fontsize}{\@ehc}% \fi -\bool_if:nT { \dim_compare_p:n { \jlreq@baselineskip < 1.5\zw } || \dim_compare_p:n { \jlreq@baselineskip > 2\zw } } { +\bool_if:nT { \dim_compare_p:n { \l__jlreq_tmpa_dim < 1.5\zw } || \dim_compare_p:n { \l__jlreq_tmpa_dim > 2\zw } } { \jlreq@note { 行間は二分以上全角以下が望ましい (2.4.2.d~注3).} } @@ -1266,7 +1277,7 @@ \fi \renewcommand{\normalsize}{% - \@setfontsize\normalsize{\jlreq@fontsize}{\jlreq@baselineskip}% + \@setfontsize\normalsize{\jlreq@fontsize}{\dimexpr\jlreqbaselineskip\relax}% \abovedisplayskip 1.1\jlreq@fontsize \@plus .3\jlreq@fontsize \@minus .4\jlreq@fontsize \abovedisplayshortskip \z@ \@plus .3\jlreq@fontsize \belowdisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize @@ -1286,26 +1297,49 @@ % 2.5.2 \baselineskipは一定の方がよい? % \@listiは再定義しないようにした.(\normalsizeと共用でJLReq通りだと思う.) \newcommand{\footnotesize}{% - \@setfontsize\footnotesize{.8\jlreq@fontsize}{\dimexpr 115\jlreq@baselineskip/170\relax}% 脚注文字サイズの二分より少し小さい値を行間に: 4.2.5.e + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\footnotesize{.8\jlreq@fontsize}{\dimexpr 115\jlreq@tempdima/170\relax}% 脚注文字サイズの二分より少し小さい値を行間に: 4.2.5.e \abovedisplayskip .6\jlreq@fontsize \@plus.2\jlreq@fontsize \@minus.4\jlreq@fontsize \abovedisplayshortskip \z@ \@plus.1\jlreq@fontsize \belowdisplayshortskip .3\jlreq@fontsize \@plus.1\jlreq@fontsize \@minus.2\jlreq@fontsize \belowdisplayskip \abovedisplayskip} -% tsize10.cloの引数を,そのまま\jlreq@fontsize/\jlreq@baselineskipでスケーリングしているだけ. +% tsize10.cloの引数を,そのまま\jlreq@fontsize/\jlreqbaselineskipでスケーリングしているだけ. \newcommand{\small}{% % jsarticleのもの - \@setfontsize\small{.9\jlreq@fontsize}{\dimexpr 13\jlreq@baselineskip/17\relax}% + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\small{.9\jlreq@fontsize}{\dimexpr 13\jlreq@tempdima/17\relax}% \abovedisplayskip .9\jlreq@fontsize \@plus.3\jlreq@fontsize \@minus.4\jlreq@fontsize \abovedisplayshortskip \z@ \@plus.3\jlreq@fontsize \belowdisplayshortskip \abovedisplayshortskip \belowdisplayskip \abovedisplayskip} -\newcommand{\scriptsize}{\@setfontsize\scriptsize{\dimexpr 7\jlreq@fontsize/10\relax}{\dimexpr 8\jlreq@baselineskip/17\relax}} -\newcommand{\tiny}{\@setfontsize\tiny{\dimexpr 5\jlreq@fontsize/10\relax}{\dimexpr 6\jlreq@baselineskip/17\relax}} -\newcommand{\large}{\@setfontsize\large{\dimexpr12\jlreq@fontsize/10\relax}{\jlreq@baselineskip}} -\newcommand{\Large}{\@setfontsize\Large{\dimexpr14\jlreq@fontsize/10\relax}{\dimexpr 21\jlreq@baselineskip/17\relax}} -\newcommand{\LARGE}{\@setfontsize\LARGE{\dimexpr17\jlreq@fontsize/10\relax}{\dimexpr 25\jlreq@baselineskip/17\relax}} -\newcommand{\huge}{\@setfontsize\huge{2\jlreq@fontsize}{\dimexpr 28\jlreq@baselineskip/17\relax}} -\newcommand{\Huge}{\@setfontsize\Huge{\dimexpr 25\jlreq@fontsize/10\relax}{\dimexpr 33\jlreq@baselineskip/17\relax}} +\newcommand{\scriptsize}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\scriptsize{\dimexpr 7\jlreq@fontsize/10\relax}{\dimexpr 8\jlreq@tempdima/17\relax} +} +\newcommand{\tiny}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\tiny{\dimexpr 5\jlreq@fontsize/10\relax}{\dimexpr 6\jlreq@tempdima/17\relax} +} +\newcommand{\large}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\large{\dimexpr12\jlreq@fontsize/10\relax}{\jlreq@tempdima} +} +\newcommand{\Large}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\Large{\dimexpr14\jlreq@fontsize/10\relax}{\dimexpr 21\jlreq@tempdima/17\relax} +} +\newcommand{\LARGE}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\LARGE{\dimexpr17\jlreq@fontsize/10\relax}{\dimexpr 25\jlreq@tempdima/17\relax} +} +\newcommand{\huge}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\huge{2\jlreq@fontsize}{\dimexpr 28\jlreq@tempdima/17\relax} +} +\newcommand{\Huge}{ + \setlength{\jlreq@tempdima}{\dimexpr\jlreqbaselineskip\relax} + \@setfontsize\Huge{\dimexpr 25\jlreq@fontsize/10\relax}{\dimexpr 33\jlreq@tempdima/17\relax} +} %. plextから拝借 \def\jlreq@Kanji#1{\expandafter\kansuji\csname c@#1\endcsname} @@ -1833,42 +1867,32 @@ %.. 別行見出し % \jlreq@BlockHeading@start:別行見出しを出力する命令. -% \jlreq@BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = カウンタ関連}{5 = フォーマット関連}{6 = 全体フォーマット}*{見出し}[副題] +% \jlreq@BlockHeading@start{1 = 命令名}{2 = レベル}{3 = スペース関連}{4 = カウンタ関連}*[running head]{見出し}[副題] % カウンタ関連=-,*,無し:-はカウンタ関連を処理しない.*はさらに目次に追加しない(星付き命令と同様).星付きで呼び出された時は常に*同等. % スペース関連={配置:lcr(左中央右)}{字下げ(寸法)}{字上げ(寸法)}{前空き}{後空き}{行取りの行数}{空か*か,偶数ページでも改ページを許可するならば空} % 前/後空きはprefixにa:/s:/r:が入る.r:は空きがその値そのものになる.a:/s:は行取りに加えて入る.a:で指定された空きはページ行頭では入らない % 後空きの時はs:は指定できない. -% フォーマット関連: -% フォーマット関連={{ラベルのみのフォーマット}{ラベルフォーマット}{見出し文字列フォーマット}{見出し文字列フォーマット(ラベル無し)}{副題フォーマット}{副題フォーマット(ラベル無し)}}{{前フォーマットラベルあり}{前フォーマットラベルなし}{見出し全体のフォーマット}{後ろフォーマットラベルあり}{後ろフォーマットラベルなし}} +% フォーマット関連:あらかじめマクロに入れておく +% \jlreq@BlockHeading@start@eachformat: {ラベルのみのフォーマット}{ラベルフォーマット}{見出し文字列フォーマット}{見出し文字列フォーマット(ラベル無し)}{副題フォーマット}{副題フォーマット(ラベル無し)} +% \jlreq@BlockHeading@start@format: {前フォーマットラベルあり}{前フォーマットラベルなし}{見出し全体のフォーマット}{後ろフォーマットラベルあり}{後ろフォーマットラベルなし} +% \jlreq@BlockHeading@start@totalformat: 全体フォーマット % 見出しそのものは「全体フォーマット」に従い出力される.パラメータトークン#1を含み,#1=見出し本体:スペース関連と上の「見出し全体のフォーマット」に基づいて整形される. % 見出し全体のフォーマット内では#1=ラベル,#2=見出し文字列,#3=副題,それぞれ各々のフォーマットに基づき整形される. % ラベルフォーマットでは#1=カウンタ名,見出し文字列フォーマットでは#1=見出し文字列,副題フォーマットでは#1=副題 % ラベルのみのフォーマットは目次に使われる. -\long\def\jlreq@BlockHeading@start#1#2#3#4#5#6{% - \if@noskipsec\leavevmode\fi - % #5と#6は\parを含むかもしれないので引数渡しはしない(後の\@ifstarで詰まる) - \edef\jlreq@BlockHeading@start@eachformat{\exp_not:o {\@firstoftwo#5}}% - \edef\jlreq@BlockHeading@start@format{\exp_not:o {\@secondoftwo#5}}% - \edef\jlreq@BlockHeading@start@totalformat{\unexpanded{#6}}% - \jlreq@BlockHeading@start@{#1}{#2}{#3}{#4}% -} -% {1 = 命令}{2 = レベル}{3 = スペース関連} -\long\def\jlreq@BlockHeading@start@#1#2#3#4{% - \@ifstar{\@dblarg{\jlreq@BlockHeading@start@@{#1}{#2}{#3}{*}}}{\@dblarg{\jlreq@BlockHeading@start@@{#1}{#2}{#3}{#4}}}% -} % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}[5 = running head]{6 = 見出し} -\long\def\jlreq@BlockHeading@start@@#1#2#3#4[#5]#6{% - \@ifnextchar[{\jlreq@BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq@BlockHeading@start@@@{#1}{#2}{#3}{#4}{#5}{#6}[]}% +\long\def\jlreq@BlockHeading@start#1#2#3#4[#5]#6{% + \@ifnextchar[{\jlreq@BlockHeading@start@i{#1}{#2}{#3}{#4}{#5}{#6}}{\jlreq@BlockHeading@start@i{#1}{#2}{#3}{#4}{#5}{#6}[]}% } % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = *}{5 = running head}{6 = 見出し}[7 = 副題] -\long\def\jlreq@BlockHeading@start@@@#1#2#3#4#5#6[#7]{% - \edef\jlreq@do{\unexpanded{\jlreq@BlockHeading@start@@@@{#1}{#2}{#3}}{\exp_not:o {\jlreq@BlockHeading@start@totalformat}}}% +\long\def\jlreq@BlockHeading@start@i#1#2#3#4#5#6[#7]{% + \edef\jlreq@do{\unexpanded{\jlreq@BlockHeading@start@ii{#1}{#2}{#3}}{\exp_not:o {\jlreq@BlockHeading@start@totalformat}}}% \jlreq@do{#4}{#5}{#6}{#7}% } % {1 = 命令}{2 = レベル}{3 = スペース関連}{4 = 全フォーマット}{5 = *}{6 = running head}{7 = 見出し}{8 = 副題} -\long\def\jlreq@BlockHeading@start@@@@#1#2#3#4#5#6#7#8{% +\long\def\jlreq@BlockHeading@start@ii#1#2#3#4#5#6#7#8{% \global\advance\jlreq@BlockHeading@spaces@current@count by 1 \tl_gput_right:Nn \jlreq@BlockHeading@spaces@current@sequence {_#1}% \edef\jlreq@tempa##1##2##3##4##5##6##7{% @@ -2200,18 +2224,12 @@ \jlreq@ifgluezero\jlreq@tempskipb{}{\vskip\jlreq@tempskipb}% \edef\jlreq@do{% \dim_compare:nF { \parskip=0pt } { -% \exp_not:N \cs_set:Nn \exp_not:N \g__jlreq_gyodori_hook_par: { -% \noexpand\parskip=\the\parskip\noexpand\relax -% \exp_not:n { \cs_set:Nn \g__jlreq_gyodori_hook_par: {} } -% } \exp_not:N \AddToHook { para/before } { \noexpand\parskip=\the\parskip\noexpand\relax } \noexpand\parskip=0pt } }% \expandafter}\jlreq@do } -%\cs_set:Nn \g__jlreq_gyodori_hook_par: {} -%\PushPostHook{par}{\g__jlreq_gyodori_hook_par:} % 行取り情報をゲットだぜ @@ -2498,34 +2516,46 @@ \def\jlreq@totalformat@after{}% }% \fi + % フォーマットを指定のマクロに入れる命令群 + \tl_set:Nx \l__jlreq_tmpa_tl { + \exp_not:n {\edef\jlreq@BlockHeading@start@eachformat}{\exp_not:N \unexpanded{% + {\exp_not:o {\jlreq@label@format}}{\exp_not:o {\jlreq@label@format@modified}}% + {\exp_not:o {\jlreq@heading@text@format@wlabel}}{\exp_not:o {\jlreq@heading@text@format@wolabel}}% + {\exp_not:o {\jlreq@subtitle@format@wlabel}}{\exp_not:o {\jlreq@subtitle@format@wolabel}}% + }}% + \exp_not:n {\edef\jlreq@BlockHeading@start@format}{\exp_not:N \unexpanded{% + {\exp_not:o {\jlreq@pre@format@wlabel}}{\exp_not:o {\jlreq@pre@format@wolabel}}% + {\exp_not:o {\jlreq@format}}% + {}{}% + }}% + \exp_not:n {\edef\jlreq@BlockHeading@start@totalformat}{\exp_not:N \unexpanded{% + {\exp_not:n { + \par + \addpenalty\@secpenalty + \addvspace{0pt}\relax % 改ページ関係(#54,#100),よくわかっていない + }} + {\exp_not:o {\jlreq@totalformat}}{\exp_not:o {\jlreq@totalformat@after}}% + }}% + } + % \jlreq@BlockHeading@startの第四引数 + \tl_set:Nx \l__jlreq_tmpb_tl { + {\exp_not:o {\jlreq@align}}{\exp_not:o {\jlreq@indent}}{\exp_not:o {\jlreq@end@indent}}\exp_not:o {\jlreq@spaceset}{\exp_not:o {\jlreq@allowbreak@evenpage}} + } \edef\jlreq@do{% \exp_not:o {\jlreq@do}% \noexpand\edef\exp_not:c {jlreq@headingcs@#1}{\noexpand\unexpanded{% \exp_not:N \g__jlreq_hook_beforeheading:n {#1} \exp_not:o {\jlreq@pagebreak}% \tl_if_empty:NF \l__jlreq_pagestyle_tl { \exp_not:N \thispagestyle {\exp_not:o { \l__jlreq_pagestyle_tl } } } - \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}% - {{\exp_not:o {\jlreq@align}}{\exp_not:o {\jlreq@indent}}{\exp_not:o {\jlreq@end@indent}}\exp_not:o {\jlreq@spaceset}{\exp_not:o {\jlreq@allowbreak@evenpage}}}% - {\ifjlreq@number\else -\fi}% - {% - {% - {\exp_not:o {\jlreq@label@format}}{\exp_not:o {\jlreq@label@format@modified}}% - {\exp_not:o {\jlreq@heading@text@format@wlabel}}{\exp_not:o {\jlreq@heading@text@format@wolabel}}% - {\exp_not:o {\jlreq@subtitle@format@wlabel}}{\exp_not:o {\jlreq@subtitle@format@wolabel}}% - }% - {% - {\exp_not:o {\jlreq@pre@format@wlabel}}{\exp_not:o {\jlreq@pre@format@wolabel}}% - {\exp_not:o {\jlreq@format}}% - {}{}% - }% - }% - {{\exp_not:n { - \par - \addpenalty\@secpenalty - \addvspace{0pt}\relax % 改ページ関係(#54,#100),よくわかっていない - }}{\exp_not:o {\jlreq@totalformat}}{\exp_not:o {\jlreq@totalformat@after}}}% - }}% - \noexpand\def\exp_not:c {#1}{\exp_not:c {jlreq@headingcs@#1}}% + \exp_not:o \l__jlreq_tmpa_tl + \exp_not:N \@ifstar + {\exp_not:N \@dblarg{\exp_not:N \jlreq@BlockHeading@start{\exp_not:n {#1}}{\exp_not:n {#2}}{\exp_not:o {\l__jlreq_tmpb_tl}}{*}}}% + {\exp_not:N \@dblarg{\exp_not:N \jlreq@BlockHeading@start{\exp_not:n {#1}}{\exp_not:n {#2}}{\exp_not:o {\l__jlreq_tmpb_tl}}{\ifjlreq@number\else -\fi}}}% + } + }% + \noexpand\def\exp_not:c {#1}{ + \exp_not:c {jlreq@headingcs@#1} + }% }% \expandafter\endgroup \jlreq@do @@ -3027,8 +3057,8 @@ \cs_set:Nn \__jlreq_CutinHeading_start_aux:nnnnnn{% % 一行で処理したときの見出し長さを計測 \group_begin: - \hbox_set:Nn \l_jlreq_tmpa_box {#1#6} - \dim_set:Nn \l__jlreq_tmpa_dim { \box_wd:N \l_jlreq_tmpa_box} + \hbox_set:Nn \l__jlreq_tmpa_box {#1#6} + \dim_set:Nn \l__jlreq_tmpa_dim { \box_wd:N \l__jlreq_tmpa_box} % 何行必要かを\l__jlreq_cutinheading_linecount_tlに入れる \dim_compare:nTF { \l__jlreq_tmpa_dim > #5} { \tl_set:Nn \l__jlreq_cutinheading_linecount_tl {3} @@ -3038,31 +3068,31 @@ } { \tl_set:Nn \l__jlreq_cutinheading_linecount_tl {1} } } % \l__jlreq_tmpa_dimが実際の一行の長さに近い \dim_set:Nn \l__jlreq_tmpa_dim { \l__jlreq_tmpa_dim / \l__jlreq_cutinheading_linecount_tl } - % \l_jlreq_tmpb_boxに見出し部分を,\l__jlreq_cutinheading_linecount_tlに見出し自身に何行使うかを入れる + % \l__jlreq_tmpb_boxに見出し部分を,\l__jlreq_cutinheading_linecount_tlに見出し自身に何行使うかを入れる \int_compare:nTF { \l__jlreq_cutinheading_linecount_tl = 1 }{ - \vbox_set:Nn \l_jlreq_tmpb_box {\parindent=0pt\rightskip=0pt\leftskip=0pt\box_use_drop:N \l_jlreq_tmpa_box} + \vbox_set:Nn \l__jlreq_tmpb_box {\parindent=0pt\rightskip=0pt\leftskip=0pt\box_use_drop:N \l__jlreq_tmpa_box} \tl_set:Nn \l__jlreq_cutinheading_linecount_tl {2} }{ \jlreq@inlinenote@determinelength{#6}{#1}{}{\l__jlreq_cutinheading_linecount_tl}{\l__jlreq_cutinheading_linecount_tl}{\l__jlreq_tmpa_dim}{\linewidth}% - \box_set_eq:NN \l_jlreq_tmpb_box \jlreq@resultbox + \box_set_eq:NN \l__jlreq_tmpb_box \jlreq@resultbox \tl_set:Nn \l__jlreq_cutinheading_linecount_tl {3} } % 普通の一行の高さ/深さに合わせて見出しのボックスを作る - \setbox\l_jlreq_tmpa_box =\vtop to \dimexpr\numexpr\l__jlreq_cutinheading_linecount_tl - 1\relax\baselineskip + 1\jlreq@zh\relax{\skip_vertical:n {0pt~plus~1fill~minus~1fill} \box_use_drop:N \l_jlreq_tmpb_box \skip_vertical:n {0pt~plus~1fill~minus~1fill}}% + \setbox\l__jlreq_tmpa_box =\vtop to \dimexpr\numexpr\l__jlreq_cutinheading_linecount_tl - 1\relax\baselineskip + 1\jlreq@zh\relax{\skip_vertical:n {0pt~plus~1fill~minus~1fill} \box_use_drop:N \l__jlreq_tmpb_box \skip_vertical:n {0pt~plus~1fill~minus~1fill}}% % 高さを通常の一行のそれにする - \hbox_set:Nn \l_jlreq_tmpc_box {阿} - \box_set_dp:Nn \l_jlreq_tmpa_box { \box_ht:N \l_jlreq_tmpa_box + \box_dp:N \l_jlreq_tmpa_box - \box_ht:N \l_jlreq_tmpc_box } - \box_set_ht:Nn \l_jlreq_tmpa_box { \box_ht:N \l_jlreq_tmpc_box } + \hbox_set:Nn \l__jlreq_tmpc_box {阿} + \box_set_dp:Nn \l__jlreq_tmpa_box { \box_ht:N \l__jlreq_tmpa_box + \box_dp:N \l__jlreq_tmpa_box - \box_ht:N \l__jlreq_tmpc_box } + \box_set_ht:Nn \l__jlreq_tmpa_box { \box_ht:N \l__jlreq_tmpc_box } \noindent \hspace*{#2}% - \box_use:N \l_jlreq_tmpa_box + \box_use:N \l__jlreq_tmpa_box \hspace*{#3}% % でかい見出しボックスの分をキャンセルする空きを入れる - % \baselineskip - box_ht:N \l_jlreq_tmpc_boxはTeXが挿入するスキップの分 + % \baselineskip - box_ht:N \l__jlreq_tmpc_boxはTeXが挿入するスキップの分 \cs_set:Nx \l__jlreq_do:{ \exp_not:N \par - \exp_not:N \skip_vertical:n {\dim_eval:n {-\box_ht:N \l_jlreq_tmpa_box - \box_dp:N \l_jlreq_tmpa_box - \baselineskip + \box_ht:N \l_jlreq_tmpc_box}} - \exp_not:N\hangindent= \dim_eval:n {#2 + \box_wd:N \l_jlreq_tmpa_box + #3} \exp_not:N \relax + \exp_not:N \skip_vertical:n {\dim_eval:n {-\box_ht:N \l__jlreq_tmpa_box - \box_dp:N \l__jlreq_tmpa_box - \baselineskip + \box_ht:N \l__jlreq_tmpc_box}} + \exp_not:N\hangindent= \dim_eval:n {#2 + \box_wd:N \l__jlreq_tmpa_box + #3} \exp_not:N \relax \exp_not:N\hangafter=-\l__jlreq_cutinheading_linecount_tl\relax }% \exp_after:wN \group_end: @@ -3136,14 +3166,14 @@ \str_set:Nn \l__jlreq_tmpa_str {#2} \str_case_e:nn { \jlreq@HeadingType {#1} } { { BlockHeading } { - \bool_set_false:N \l_jlreq_tmpa_bool - \str_if_in:NnT \l__jlreq_tmpa_str { before_space= } { \bool_set_true:N \l_jlreq_tmpa_bool } - \str_if_in:NnT \l__jlreq_tmpa_str { before_space~= } { \bool_set_true:N \l_jlreq_tmpa_bool } - \bool_if:NT \l_jlreq_tmpa_bool {\tl_put_left:Nn \l__jlreq_tmpa_tl {before_lines={},} } - \bool_set_false:N \l_jlreq_tmpa_bool - \str_if_in:NnT \l__jlreq_tmpa_str { after_space= } { \bool_set_true:N \l_jlreq_tmpa_bool } - \str_if_in:NnT \l__jlreq_tmpa_str { after_space~= } { \bool_set_true:N \l_jlreq_tmpa_bool } - \bool_if:NT \l_jlreq_tmpa_bool {\tl_put_left:Nn \l__jlreq_tmpa_tl {after_lines={},}} + \bool_set_false:N \l__jlreq_tmpa_bool + \str_if_in:NnT \l__jlreq_tmpa_str { before_space= } { \bool_set_true:N \l__jlreq_tmpa_bool } + \str_if_in:NnT \l__jlreq_tmpa_str { before_space~= } { \bool_set_true:N \l__jlreq_tmpa_bool } + \bool_if:NT \l__jlreq_tmpa_bool {\tl_put_left:Nn \l__jlreq_tmpa_tl {before_lines={},} } + \bool_set_false:N \l__jlreq_tmpa_bool + \str_if_in:NnT \l__jlreq_tmpa_str { after_space= } { \bool_set_true:N \l__jlreq_tmpa_bool } + \str_if_in:NnT \l__jlreq_tmpa_str { after_space~= } { \bool_set_true:N \l__jlreq_tmpa_bool } + \bool_if:NT \l__jlreq_tmpa_bool {\tl_put_left:Nn \l__jlreq_tmpa_tl {after_lines={},}} } } \cs_set:Nx \l_jlreq_do: { @@ -3998,7 +4028,7 @@ % \jlreq@resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する. \long\def\jlreq@inlinenote@determinelength#1#2#3#4#5#6#7{% \begingroup - % \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}% +% \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relax まで(長さ\the\dimexpr #7 - #6\relax )}% \@tempcnta=1\relax \def\@tempa{}% % 調整に使う行の\parshape指定を\@tempaに入れる.長さは\jlreq@tempdima. @@ -4019,12 +4049,12 @@ \parindent=0pt\leftskip=0pt\rightskip=0pt \parshape #5~#3~\@tempa 0pt~\the\maxdimen #1\par\global\@tempcntb=\prevgraf}% - % \message{\string\jlreq@tempdima = \the\jlreq@tempdima で試行,行数は\the\@tempcntb , 書式 #5 #3 \@tempa 0pt \the\maxdimen}% +% \message{\string\jlreq@tempdima = \the\jlreq@tempdima で試行,行数は\the\@tempcntb , 書式~#5~#3~\@tempa~0pt~\the\maxdimen}% \fi \jlreq@getlastbox{\@tempboxa}% \setbox\jlreq@tempboxa=\box\jlreq@resultbox \ifnum\@tempcntb<#5\relax% 行数が達していないならOK - % \message{行数 = \the\@tempcntb により確定} +% \message{行数 = \the\@tempcntb により確定} % #5行になるまで空の水平ボックスを加えていく. \global\setbox\jlreq@resultbox=\vbox{#2% \unvbox\@tempboxa\hbox{\unhbox\jlreq@tempboxa\unskip\unskip\unpenalty}% @@ -4034,7 +4064,7 @@ % そうでない場合は最後の二行の長さを比較する \jlreq@getlastbox{\@tempboxa}% \setbox\jlreq@tempboxb=\box\jlreq@resultbox - % \message{最終行の長さ \the\wd\jlreq@tempboxa, その前の長さ \the\wd\jlreq@tempboxb}% +% \message{最終行の長さ \the\wd\jlreq@tempboxa, その前の長さ \the\wd\jlreq@tempboxb}% \ifdim\wd\jlreq@tempboxa>\wd\jlreq@tempboxb \advance\jlreq@tempdima by 0.3pt\relax% 0.3ptに意味はない \else @@ -6194,17 +6224,17 @@ \ltj@setpar@global \cs_set:Nn \l_jlreq_do: {} \tl_if_empty:nF {#1} { - \skip_set:Nn \l_jlreq_tmpa_skip { #1 } + \skip_set:Nn \l__jlreq_tmpa_skip { #1 } \cs_set:Nx \l_jlreq_do: { \exp_not:o \l_jlreq_do: - \exp_not:N \cs_set:Npn \exp_not:N \jlreqkanjiskip { \skip_use:N \l_jlreq_tmpa_skip } - \exp_not:N \ltjsetkanjiskip \skip_use:N \l_jlreq_tmpa_skip + \exp_not:N \cs_set:Npn \exp_not:N \jlreqkanjiskip { \skip_use:N \l__jlreq_tmpa_skip } + \exp_not:N \ltjsetkanjiskip \skip_use:N \l__jlreq_tmpa_skip } } \tl_if_empty:nF {#2} { - \skip_set:Nn \l_jlreq_tmpa_skip { #2 } + \skip_set:Nn \l__jlreq_tmpa_skip { #2 } \cs_set:Nx \l_jlreq_do: { \exp_not:o \l_jlreq_do: - \exp_not:N \cs_set:Npn \exp_not:N \jlreqxkanjiskip { \skip_use:N \l_jlreq_tmpa_skip } - \exp_not:N \ltjsetxkanjiskip \skip_use:N \l_jlreq_tmpa_skip + \exp_not:N \cs_set:Npn \exp_not:N \jlreqxkanjiskip { \skip_use:N \l__jlreq_tmpa_skip } + \exp_not:N \ltjsetxkanjiskip \skip_use:N \l__jlreq_tmpa_skip } } \exp_after:wN \group_end: @@ -6215,17 +6245,17 @@ \group_begin: \cs_set:Nn \l_jlreq_do: {} \tl_if_empty:nF {#1} { - \skip_set:Nn \l_jlreq_tmpa_skip { #1 } + \skip_set:Nn \l__jlreq_tmpa_skip { #1 } \cs_set:Nx \l_jlreq_do: { \exp_not:o \l_jlreq_do: - \exp_not:N \cs_set:Npx \exp_not:N \jlreqkanjiskip { \skip_use:N \l_jlreq_tmpa_skip } - \exp_not:N \skip_set:Nn \exp_not:N \kanjiskip { \skip_use:N \l_jlreq_tmpa_skip } + \exp_not:N \cs_set:Npx \exp_not:N \jlreqkanjiskip { \skip_use:N \l__jlreq_tmpa_skip } + \exp_not:N \skip_set:Nn \exp_not:N \kanjiskip { \skip_use:N \l__jlreq_tmpa_skip } } } \tl_if_empty:nF {#2} { - \skip_set:Nn \l_jlreq_tmpa_skip { #2 } + \skip_set:Nn \l__jlreq_tmpa_skip { #2 } \cs_set:Nx \l_jlreq_do: { \exp_not:o \l_jlreq_do: - \exp_not:N \cs_set:Npx \exp_not:N \jlreqxkanjiskip { \skip_use:N \l_jlreq_tmpa_skip } - \exp_not:N \skip_set:Nn \exp_not:N \xkanjiskip { \skip_use:N \l_jlreq_tmpa_skip } + \exp_not:N \cs_set:Npx \exp_not:N \jlreqxkanjiskip { \skip_use:N \l__jlreq_tmpa_skip } + \exp_not:N \skip_set:Nn \exp_not:N \xkanjiskip { \skip_use:N \l__jlreq_tmpa_skip } } } \exp_after:wN \group_end: diff --git a/macros/jptex/latex/jlreq/jlreq.pdf b/macros/jptex/latex/jlreq/jlreq.pdf Binary files differindex 03eebb298a..fe98bc8adc 100644 --- a/macros/jptex/latex/jlreq/jlreq.pdf +++ b/macros/jptex/latex/jlreq/jlreq.pdf diff --git a/macros/jptex/latex/pxchfon/LICENSE b/macros/jptex/latex/pxchfon/LICENSE index 72d5a31c9e..9350cdfdbc 100644 --- a/macros/jptex/latex/pxchfon/LICENSE +++ b/macros/jptex/latex/pxchfon/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2009-2023 Takayuki YATO (aka. "ZR") +Copyright (c) 2009-2024 Takayuki YATO (aka. "ZR") Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/macros/jptex/latex/pxchfon/README-ja.md b/macros/jptex/latex/pxchfon/README-ja.md index ee6573018c..18df6b2606 100644 --- a/macros/jptex/latex/pxchfon/README-ja.md +++ b/macros/jptex/latex/pxchfon/README-ja.md @@ -57,6 +57,20 @@ MITライセンスの下で配布される。 更新履歴 -------- + * Version 2.2 ‹2024/08/22› + - `usefontmaplines` 環境を追加。 + * Version 2.1a ‹2024/08/12› + - 警告メッセージの改良。 + * Version 2.1 ‹2023/08/11› + - `\pxchfonsetup` 命令を追加。 + - `maybe-multiweight` 指定時は japanese-otf 用のマップ行を必ず + 出力する。 + - 開発者用フラグ `\pxchfonNoCheckMultiweight` を追加。 + ※試験的機能の `\pxchfonMaybeMultiweight` は非推奨。 + - オプション `nocheck-expert` を追加。 + - オプション `resetdvidriver` を追加。 + - プリセット非指定時の `(no)alphabet` の省略に対して警告を出す。 + - エラー・警告メッセージの改良。 * Version 2.0 ‹2023/08/28› - keyval パッケージを使用する。 - Unicode 直接指定のオプションを key-value 形式の `unicode` キーに diff --git a/macros/jptex/latex/pxchfon/README.md b/macros/jptex/latex/pxchfon/README.md index 6cd05a265c..6357d6c13a 100644 --- a/macros/jptex/latex/pxchfon/README.md +++ b/macros/jptex/latex/pxchfon/README.md @@ -39,6 +39,19 @@ This package is distributed under the MIT License. Revision History ---------------- + * Version 2.2 ‹2024/08/22› + - New environment `usefontmaplines`. + * Version 2.1a ‹2024/08/12› + - Improve warning messages. + * Version 2.1 ‹2024/08/11› + - New command `\pxchfonsetup`. + - `maybe-multiweight` forces to output map lines for japanese-otf. + - Add flag `\pxchfonNoCheckMultiweight`. + (Old experimental `\pxchfonMaybeMultiweight` is deprecated.) + - New option `nocheck-expert`. + - New option `resetdvidriver`. + - Warn if `(no)alphabet` is omitted without using a preset. + - Improve error/warning messages. * Version 2.0 ‹2023/08/28› - Use keyval package. - Now options on direct-Unicode settings are provided as a single @@ -47,7 +60,7 @@ Revision History (Experimental option `unicode(*)-fwid` is removed.) - New options `legacycode` and `legacycode-replace`. (Old experimental options on “legacycode” are removed.) - - Warn if `(no)alphabet` is omitted without using a preset. + - Deprecate ommision of `(no)alphabet` without using a preset. - Warn if user commands on multi-weight are used without employing `deluxe` option of japanese-otf package. - New option `maybe-multiweight`. diff --git a/macros/jptex/latex/pxchfon/pxchfon.pdf b/macros/jptex/latex/pxchfon/pxchfon.pdf Binary files differindex 10ce88b39d..68b2370e61 100644 --- a/macros/jptex/latex/pxchfon/pxchfon.pdf +++ b/macros/jptex/latex/pxchfon/pxchfon.pdf diff --git a/macros/jptex/latex/pxchfon/pxchfon.sty b/macros/jptex/latex/pxchfon/pxchfon.sty index 310af67b71..eef9fbc347 100644 --- a/macros/jptex/latex/pxchfon/pxchfon.sty +++ b/macros/jptex/latex/pxchfon/pxchfon.sty @@ -1,7 +1,7 @@ %% %% This is file 'pxchfon.sty'. %% -%% Copyright (c) 2009-2023 Takayuki YATO (aka. "ZR") +%% Copyright (c) 2009-2024 Takayuki YATO (aka. "ZR") %% GitHub: https://github.com/zr-tex8r %% Twitter: @zr_tex8r %% @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxchfon}[2023/08/28 v2.0] +\ProvidesPackage{pxchfon}[2024/08/22 v2.2] \def\pxcz@pkgname{pxchfon} %--------------------------------------- general @@ -28,7 +28,11 @@ %% unique tokens \def\pxcz@end{\pxcz@end@} \def\pxcz@mt{\pxcz@mt@} +\toksdef\pxcz@mk=9 % unexpandable +%% \pxcz@letcs\CSa{<cs2>} +\def\pxcz@letcs#1#2{% + \expandafter\let\expandafter#1\csname#2\endcsname} %% \pxcz@csletcs{<cs1>}{<cs2>} \def\pxcz@csletcs#1#2{% \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname} @@ -47,6 +51,19 @@ \def\pxcz@onlypreamble@let#1{% \@onlypreamble#1\let#1} +%% \pxcz@first@doc@hook +% Invoked earlier than \pxcz@doc@hook. +\pxcz@onlypreamble@let\pxcz@first@doc@hook\@empty +\AtBeginDocument{\pxcz@first@doc@hook} + +%% \pxcz@new@gbool{<name>} +\pxcz@onlypreamble@def\pxcz@new@gbool#1{% + \expandafter\pxcz@new@gbool@a\csname if#1\endcsname{#1}} +\pxcz@onlypreamble@def\pxcz@new@gbool@a#1#2{% + \@namedef{#2true}{\global\let#1\iftrue}% + \@namedef{#2false}{\global\let#1\iffalse}% + \@nameuse{#2false}}\@gobbletwo\fi\fi + %% \pxcz@csuse@or{<csname>}{<default>} \def\pxcz@csuse@or#1#2{% \expandafter\ifx\csname#1\endcsname\relax \expandafter\@firstoftwo @@ -59,13 +76,22 @@ \def\pxcz@lower@a#1\pxcz@end#2{% \lowercase{\def#2{#1}}} -%% \pxcz@setkeys{<text>}{<error>} -\pxcz@onlypreamble@def\pxcz@setkeys#1#2{% - \def\KV@errx##1{#2}% - \edef\pxcz@do{\noexpand\setkeys{pxchfon}{#1}}\pxcz@do +%% \pxcz@setkeys{<kv-family>}{<text>}{<error>} +\pxcz@onlypreamble@def\pxcz@setkeys#1#2#3{% + \let\KV@errx#3% + \edef\pxcz@do{\noexpand\setkeys{#1}{#2}}\pxcz@do \let\KV@errx\pxcz@org@KV@errx} \let\pxcz@org@KV@errx\KV@errx +%% \pxcz@handle@mt@kvopt{<key>}{<value>}{<code>} +\pxcz@onlypreamble@def\pxcz@handle@mt@kvopt#1#2#3{% + \ifx\pxcz@mt#2\pxcz@mt #3% + \else + \PackageError\pxcz@pkgname + {No value allowed for key '#1'}% + {\@ehc}% + \fi} + %% \pxcz@handle@kvopt{<key>}{<cs-key>}{<value>}{<code>} %% \pxcz@handle@bool@kvopt{<key>}{<cs-key>}{<value>} \pxcz@onlypreamble@def\pxcz@handle@kvopt{% @@ -74,10 +100,11 @@ \pxcz@handle@kvopt@a{}{#1}{#2}{#3}{\pxcz@value}} \pxcz@onlypreamble@def\pxcz@handle@kvopt@a#1#2#3#4{% \@nameuse{pxcz@#3@giventrue}% - \pxcz@csletcs{pxcz@value}{pxcz@#3#1#4}% + \pxcz@letcs\pxcz@value{pxcz@#3#1#4}% \ifx\pxcz@value\relax \PackageError\pxcz@pkgname - {Invalid value for option key '#2'\MessageBreak (#4)}% + {Invalid value for key '#2'\MessageBreak (#4)}% + {\@ehc}% \expandafter\@gobble \else \expandafter\@firstofone \fi} @@ -97,8 +124,46 @@ \def\pxcz@split@c#1\pxcz@mt#2\pxcz@end#3{% \def\pxcz@pre{#3}\def\pxcz@post{#1}} +%% \pxcz@let@jchar@token\CS{<code>} +\pxcz@onlypreamble@def\pxcz@let@jchar@token#1#2{% + \begingroup + \kansujichar1=#2\relax \kcatcode#2=18\relax + \xdef\pxcz@g@tmpa{\kansuji1}% + \endgroup + \let#1=\pxcz@g@tmpa} + +%% \pxcz@geta +\pxcz@let@jchar@token\pxcz@geta{\jis"222E} + +%% \pxcz@Z\newrobustcmd*\CS... +% On e-TeX engines, it simply does \newrobustcmd*; +% otherwise it does \DeclareRobustCommand* with 'new' check. +\pxcz@onlypreamble@def\pxcz@Z\newrobustcmd*#1{% + \pxcz@okfalse + \@ifdefinable{#1}{\pxcz@oktrue}% + \pxcz@cond\ifpxcz@ok\fi + {\DeclareRobustCommand*#1}{\providecommand*\pxcz@mt}% +} + +%% \pxcz@PackageNoteNoLine +\ifx\PackageNoteNoLine\@undefined + \let\pxcz@PackageNoteNoLine\PackageWarningNoLine +\else + \let\pxcz@PackageNoteNoLine\PackageNoteNoLine +\fi + %--------------------------------------- environment check +%%<+> \pxchfonNoCheckMultiweight +% If defined, skips the check for using multi-weight settings +% without loading japanese-otf package with 'deluxe'. +%(keep unchanged) + +%%<+> \pxchfonNoCheckExpert +% If defined, skips the check for using expert settings without +% substituting all weights. +%(keep unchanged) + %% check for 'pxjafont' package \@ifpackageloaded{pxjafont}{% \PackageError\pxcz@pkgname @@ -115,6 +180,18 @@ \pxcz@do\kchardef{\pxcz@uptextrue} % only upTeX in Unicode is seen as upTeX \ifnum\ucs"3000="3000 \else \pxcz@uptexfalse \fi} +%% \ifpxcz@etex +\newif\ifpxcz@etex \pxcz@etexfalse +\pxcz@do\eTeXversion{\pxcz@etextrue} +%% \ifpxcz@etoolbox +\newif\ifpxcz@etoolbox +\ifpxcz@etex + \IfFileExists{etoolbox.sty}{% + \RequirePackage{etoolbox}[2011/01/03]% v2.1 + \pxcz@etoolboxtrue + \let\pxcz@Z\@empty + }{} +\fi %% \pxcz@JYn \edef\pxcz@JYn{% @@ -128,13 +205,11 @@ \pxcz@lite@modetrue} %% \ifpxcz@otf@loaded -%% \ifpxcz@otf@deluxe %% \pxcz@otf@weight: otf weight mode \newif\ifpxcz@otf@loaded \pxcz@otf@loadedtrue -\newif\ifpxcz@otf@deluxe \pxcz@otf@deluxefalse % watch out for priority... \@ifpackagewith{otf}{deluxe}{% - \pxcz@otf@deluxetrue \let\pxcz@otf@weight=d + \let\pxcz@otf@weight=d }{\@ifpackagewith{otf}{bold}{% \let\pxcz@otf@weight=b }{\@ifpackagewith{otf}{expert}{% @@ -253,7 +328,7 @@ \let\pxcz@alphabet\relax \newif\ifpxcz@otf \pxcz@otftrue \newif\ifpxcz@cmap@alpha -\newif\ifpxcz@mmivjis +\pxcz@new@gbool{pxcz@mmivjis} \newif\ifpxcz@everypage \newif\ifpxcz@oneweight \newif\ifpxcz@fullwidth @@ -274,9 +349,14 @@ \chardef\pxcz@glyphid\z@ \newif\ifpxcz@autojfmsync +%% \pxcz@invalid@opt{<key>} +\pxcz@onlypreamble@def\pxcz@invalid@opt#1{% + \@unknownoptionerror} + %% process options % drivers \DeclareOption{nodvidriver}{\pxcz@enabledfalse} +\DeclareOption{resetdvidriver}{\pxcz@enabledtrue} \DeclareOption{dvips}{\pxcz@enabledfalse} \DeclareOption{dviout}{\pxcz@enabledfalse} \DeclareOption{xdvi}{\pxcz@enabledfalse} @@ -353,7 +433,9 @@ \DeclareOption{autojfmsync}{\pxcz@autojfmsynctrue} \DeclareOption{noautojfmsync}{\pxcz@autojfmsyncfalse} % maybe-multiweight -\DeclareOption{maybe-multiweight}{\let\pxchfonMaybeMultiweight=t} +\DeclareOption{maybe-multiweight}{\let\pxchfonNoCheckMultiweight=t} +% nocheck-expert +\DeclareOption{nocheck-expert}{\let\pxchfonNoCheckExpert=t} % use=<spec> \define@key{pxchfon}{use}{% \pxcz@okfalse @@ -427,7 +509,7 @@ \DeclareOption*{% \pxcz@parse@opt\CurrentOption \ifpxcz@ok\else - \pxcz@setkeys{\CurrentOption}{\@unknownoptionerror}% + \pxcz@setkeys{pxchfon}{\CurrentOption}\pxcz@invalid@opt \fi} %% \pxcz@use@list @@ -475,7 +557,7 @@ \ifpxcz@unicode@given\else \let\pxcz@unicode\pxcz@unicode@@false \ifnum\pxcz@pxufont@loaded>0 - \PackageWarningNoLine\pxcz@pkgname + \pxcz@PackageNoteNoLine\pxcz@pkgname {Option 'unicode' is enabled, since the package\MessageBreak 'pxufont' is already loaded} \let\pxcz@unicode\pxcz@unicode@@full @@ -486,7 +568,13 @@ %% apply default value for \pxcz@alphabet \if\pxcz@alphabet\relax \ifx\pxcz@main@preset\relax \ifx\pxcz@file@preset\relax - % TODO: warn + \PackageWarningNoLine\pxcz@pkgname + {No preset is given and options for alphabetic\MessageBreak + fonts ('alphabet'/'noalphabet'/'relfont') are\MessageBreak + omitted. Here 'alphabet' will be assumed, but\MessageBreak + such omission is now DEPRECATED and the behavior\MessageBreak + might be changed in future!!\MessageBreak + You must write the option 'alphabet' explicitly} \let\pxcz@alphabet=t \fi\fi \if\pxcz@alphabet\relax @@ -530,32 +618,14 @@ \let\pxcz@switch@font@xjistrue\pxcz@switch@font@xjisfalse \fi -\begingroup \lccode`\@=`\_ \lowercase{% - \xdef\pxcz@get@dvipdfmx@version{% - \let\noexpand\pxcz@dvipdfmx@version\expandafter\noexpand - \csname c@@Kernel@sys@dvipdfmx@version@int\endcsname}} -\endgroup -\AtBeginDocument{% - \@tempswatrue - \ifnum\pxcz@unicode<\pxcz@unicode@@full\else - \pxcz@get@dvipdfmx@version - \ifx\pxcz@dvipdfmx@version\@undefined\else - \ifnum\pxcz@dvipdfmx@version<20170918 - \@tempswafalse \fi\fi - \fi - \if@tempswa\else - \PackageError\pxcz@pkgname - {Option 'unicode' is not available, since\MessageBreak - your dvipdfmx is too old (v.\number\pxcz@dvipdfmx@version)} - {The option requires dvipdfmx version 20170918 or later.% - \MessageBreak\@ehc} - \fi} - %--------------------------------------- preset-dependent setup -%% variables -\newif\ifpxcz@warn@unless@all@defined -\newif\ifpxcz@warn@unless@all@embedded +%% \pxcz@warn@unless@all@defined@for +% The \do-list of names of problematic features. +\pxcz@onlypreamble@let\pxcz@warn@unless@all@defined@for\@empty +%% \pxcz@warn@unless@all@embedded@for +% The \do-list of names of problematic features. +\pxcz@onlypreamble@let\pxcz@warn@unless@all@embedded@for\@empty %% \pxcz@apply@opt@unicode % Forces the 'unicode' setup (unless a directunicode option was given). @@ -566,7 +636,7 @@ \fi} %% \pxcz@warn@unicode \pxcz@onlypreamble@def\pxcz@warn@unicode{% - \PackageWarningNoLine\pxcz@pkgname + \pxcz@PackageNoteNoLine\pxcz@pkgname {The option 'unicode' is enforced, because the\MessageBreak preset '\pxcz@main@preset' is selected.}} @@ -586,7 +656,8 @@ \pxcz@custom@apply@opt@unicode % No-embed is not supported under the 'unicode' setup \ifnum\pxcz@unicode=\pxcz@unicode@@full - \pxcz@warn@unless@all@embeddedtrue + \g@addto@macro\pxcz@warn@unless@all@embedded@for{% + \do{Direct Unicode spec ('unicode')}} \fi %% apply default for pxcz@legacycode@replace @@ -661,9 +732,36 @@ \fi \let\pxcz@expert=f \fi -\if t\pxcz@expert - \pxcz@warn@unless@all@definedtrue -\fi +\g@addto@macro\pxcz@first@doc@hook{% + \if t\pxcz@expert \ifx\pxchfonNoCheckExpert\@undefined + \g@addto@macro\pxcz@warn@unless@all@defined@for{% + \do{Expert glyph shapes ('expert')}}% + \fi\fi} + +%--------------------------------------- '\pxchfonsetup' + +%% errors +\pxcz@onlypreamble@def\pxcz@err@ivsky#1{% + \PackageError\pxcz@pkgname + {Unknown key: #1}% + {\@ehc}} + +%% 'jis2004=<bool>' +\define@key{pxchfonS}{jis2004}[true]{% + \pxcz@handle@bool@kvopt{jis2004}{mmivjis}{#1}} +%% 'maybe-multiweight' +\define@key{pxchfonS}{maybe-multiweight}[]{% + \pxcz@handle@mt@kvopt{maybe-multiweight}{#1}{% + \global\let\pxchfonNoCheckMultiweight=t}} +%% 'nocheck-expert' +\define@key{pxchfonS}{nocheck-expert}[]{% + \pxcz@handle@mt@kvopt{nocheck-expert}{#1}{% + \global\let\pxchfonNoCheckExpert=t}} + +%%<*> \pxchfonsetup{<text>} +\@onlypreamble\pxchfonsetup +\pxcz@Z\newrobustcmd*\pxchfonsetup[1]{% + \pxcz@setkeys{pxchfonS}{#1}\pxcz@err@ivsky} %--------------------------------------- user interface @@ -678,53 +776,60 @@ tcml,tcmr,tcmb,tcgr,tcgb,tcgx,tcgu,tcmgr} %%<*> \setminchofont/\setgothicfont/etc. -\newcommand*\setminchofont{\pxcz@setfont{mnl,mnr,mnb}} -\newcommand*\setgothicfont{\pxcz@setfont{gtr,gtb,gtx,gtu}} -\newcommand*\setlightminchofont{\pxcz@setfont@dx{mnl}} -\newcommand*\setmediumminchofont{\pxcz@setfont@dx{mnr}} -\newcommand*\setboldminchofont{\pxcz@setfont@dx{mnb}} -\newcommand*\setmediumgothicfont{\pxcz@setfont@dx{gtr}} -\newcommand*\setboldgothicfont{\pxcz@setfont@dx{gtb}} -\newcommand*\setxboldgothicfont{\pxcz@setfont@dx{gtx}} -\newcommand*\setoneweightgothicfont{\pxcz@setfont@dx{gtu}} -\newcommand*\setmarugothicfont{\pxcz@setfont@dx{mgr}} - -\newcommand*\setkoreanminchofont{\pxcz@setfont{koml,komr,komb}} -\newcommand*\setkoreangothicfont{\pxcz@setfont{kogr,kogb,kogx,kogu,komgr}} -\newcommand*\setkoreanlightminchofont{\pxcz@setfont@dx{koml}} -\newcommand*\setkoreanmediumminchofont{\pxcz@setfont@dx{komr}} -\newcommand*\setkoreanboldminchofont{\pxcz@setfont@dx{komb}} -\newcommand*\setkoreanmediumgothicfont{\pxcz@setfont@dx{kogr}} -\newcommand*\setkoreanboldgothicfont{\pxcz@setfont@dx{kogb}} -\newcommand*\setkoreanxboldgothicfont{\pxcz@setfont@dx{kogx}} -\newcommand*\setkoreanoneweightgothicfont{\pxcz@setfont@dx{kogu}} -\newcommand*\setkoreanmarugothicfont{\pxcz@setfont@dx{komgr}} - -\newcommand*\setschineseminchofont{\pxcz@setfont{scml,scmr,scmb}} -\newcommand*\setschinesegothicfont{\pxcz@setfont{scgr,scgb,scgx,scgu,scmgr}} -\newcommand*\setschineselightminchofont{\pxcz@setfont@dx{scml}} -\newcommand*\setschinesemediumminchofont{\pxcz@setfont@dx{scmr}} -\newcommand*\setschineseboldminchofont{\pxcz@setfont@dx{scmb}} -\newcommand*\setschinesemediumgothicfont{\pxcz@setfont@dx{scgr}} -\newcommand*\setschineseboldgothicfont{\pxcz@setfont@dx{scgb}} -\newcommand*\setschinesexboldgothicfont{\pxcz@setfont@dx{scgx}} -\newcommand*\setschineseoneweightgothicfont{\pxcz@setfont@dx{scgu}} -\newcommand*\setschinesemarugothicfont{\pxcz@setfont@dx{scmgr}} - -\newcommand*\settchineseminchofont{\pxcz@setfont{tcml,tcmr,tcmb}} -\newcommand*\settchinesegothicfont{\pxcz@setfont{tcgr,tcgb,tcgx,tcgu,tcmgr}} -\newcommand*\settchineselightminchofont{\pxcz@setfont@dx{tcml}} -\newcommand*\settchinesemediumminchofont{\pxcz@setfont@dx{tcmr}} -\newcommand*\settchineseboldminchofont{\pxcz@setfont@dx{tcmb}} -\newcommand*\settchinesemediumgothicfont{\pxcz@setfont@dx{tcgr}} -\newcommand*\settchineseboldgothicfont{\pxcz@setfont@dx{tcgb}} -\newcommand*\settchinesexboldgothicfont{\pxcz@setfont@dx{tcgx}} -\newcommand*\settchineseoneweightgothicfont{\pxcz@setfont@dx{tcgu}} -\newcommand*\settchinesemarugothicfont{\pxcz@setfont@dx{tcmgr}} +% japanese +\pxcz@Z\newrobustcmd*\setminchofont{\pxcz@setfont{mnl,mnr,mnb}} +\pxcz@Z\newrobustcmd*\setgothicfont{\pxcz@setfont{gtr,gtb,gtx,gtu}} +\pxcz@Z\newrobustcmd*\setlightminchofont{\pxcz@setdf{mnl}} +\pxcz@Z\newrobustcmd*\setmediumminchofont{\pxcz@setdf{mnr}} +\pxcz@Z\newrobustcmd*\setboldminchofont{\pxcz@setdf{mnb}} +\pxcz@Z\newrobustcmd*\setmediumgothicfont{\pxcz@setdf{gtr}} +\pxcz@Z\newrobustcmd*\setboldgothicfont{\pxcz@setdf{gtb}} +\pxcz@Z\newrobustcmd*\setxboldgothicfont{\pxcz@setdf{gtx}} +\pxcz@Z\newrobustcmd*\setoneweightgothicfont{\pxcz@setdf{gtu}} +\pxcz@Z\newrobustcmd*\setmarugothicfont{\pxcz@setdf{mgr}} +% korean +\pxcz@Z\newrobustcmd*\setkoreanminchofont{% + \pxcz@setfont{koml,komr,komb}} +\pxcz@Z\newrobustcmd*\setkoreangothicfont{% + \pxcz@setfont{kogr,kogb,kogx,kogu,komgr}} +\pxcz@Z\newrobustcmd*\setkoreanlightminchofont{\pxcz@setdf{koml}} +\pxcz@Z\newrobustcmd*\setkoreanmediumminchofont{\pxcz@setdf{komr}} +\pxcz@Z\newrobustcmd*\setkoreanboldminchofont{\pxcz@setdf{komb}} +\pxcz@Z\newrobustcmd*\setkoreanmediumgothicfont{\pxcz@setdf{kogr}} +\pxcz@Z\newrobustcmd*\setkoreanboldgothicfont{\pxcz@setdf{kogb}} +\pxcz@Z\newrobustcmd*\setkoreanxboldgothicfont{\pxcz@setdf{kogx}} +\pxcz@Z\newrobustcmd*\setkoreanoneweightgothicfont{\pxcz@setdf{kogu}} +\pxcz@Z\newrobustcmd*\setkoreanmarugothicfont{\pxcz@setdf{komgr}} +% schinese +\pxcz@Z\newrobustcmd*\setschineseminchofont{% + \pxcz@setfont{scml,scmr,scmb}} +\pxcz@Z\newrobustcmd*\setschinesegothicfont{% + \pxcz@setfont{scgr,scgb,scgx,scgu,scmgr}} +\pxcz@Z\newrobustcmd*\setschineselightminchofont{\pxcz@setdf{scml}} +\pxcz@Z\newrobustcmd*\setschinesemediumminchofont{\pxcz@setdf{scmr}} +\pxcz@Z\newrobustcmd*\setschineseboldminchofont{\pxcz@setdf{scmb}} +\pxcz@Z\newrobustcmd*\setschinesemediumgothicfont{\pxcz@setdf{scgr}} +\pxcz@Z\newrobustcmd*\setschineseboldgothicfont{\pxcz@setdf{scgb}} +\pxcz@Z\newrobustcmd*\setschinesexboldgothicfont{\pxcz@setdf{scgx}} +\pxcz@Z\newrobustcmd*\setschineseoneweightgothicfont{\pxcz@setdf{scgu}} +\pxcz@Z\newrobustcmd*\setschinesemarugothicfont{\pxcz@setdf{scmgr}} +% tchinese +\pxcz@Z\newrobustcmd*\settchineseminchofont{% + \pxcz@setfont{tcml,tcmr,tcmb}} +\pxcz@Z\newrobustcmd*\settchinesegothicfont{% + \pxcz@setfont{tcgr,tcgb,tcgx,tcgu,tcmgr}} +\pxcz@Z\newrobustcmd*\settchineselightminchofont{\pxcz@setdf{tcml}} +\pxcz@Z\newrobustcmd*\settchinesemediumminchofont{\pxcz@setdf{tcmr}} +\pxcz@Z\newrobustcmd*\settchineseboldminchofont{\pxcz@setdf{tcmb}} +\pxcz@Z\newrobustcmd*\settchinesemediumgothicfont{\pxcz@setdf{tcgr}} +\pxcz@Z\newrobustcmd*\settchineseboldgothicfont{\pxcz@setdf{tcgb}} +\pxcz@Z\newrobustcmd*\settchinesexboldgothicfont{\pxcz@setdf{tcgx}} +\pxcz@Z\newrobustcmd*\settchineseoneweightgothicfont{\pxcz@setdf{tcgu}} +\pxcz@Z\newrobustcmd*\settchinesemarugothicfont{\pxcz@setdf{tcmgr}} \pxcz@onlypreamble@def\pxcz@setfont#1{\@ifnextchar[%] {\pxcz@setfont@a{#1}}{\pxcz@setfont@a{#1}[0]}} -\pxcz@onlypreamble@def\pxcz@setfont@dx{% +\pxcz@onlypreamble@def\pxcz@setdf{% \pxcz@deluxe@usedtrue\pxcz@setfont} \pxcz@onlypreamble@def\pxcz@setfont@a#1[#2]#3{% \edef\pxcz@tmpa{#3}\pxcz@lower\pxcz@tmpa @@ -742,22 +847,21 @@ \@for\pxcz@x:=\pxcz@sym@list\do{% \@namedef{pxcz@FS/\pxcz@x}{}} -%%<*> \maybemultiweight -\newcommand*\maybemultiweight{% - \let\pxchfonMaybeMultiweight=t} - % check for usage of multi-weight commands -\ifx t\pxchfonMaybeMultiweight\else - \AtBeginDocument{% - \ifpxcz@deluxe@used\ifpxcz@otf@deluxe\else +\g@addto@macro\pxcz@first@doc@hook{% + \ifx t\pxchfonMaybeMultiweight % for compatibility + \let\pxchfonNoCheckMultiweight=t% + \fi + \ifx\pxchfonNoCheckMultiweight\@undefined + \ifpxcz@deluxe@used\if d\pxcz@otf@weight\else \PackageWarningNoLine\pxcz@pkgname {Setting for multi-weight usage of japanese-otf\MessageBreak font set is employed, but 'deluxe' option\MessageBreak of japanese-otf is not enabled!\MessageBreak You should specify 'maybe-multiweight' option\MessageBreak if you really intend the present setting} - \fi\fi} -\fi + \fi\fi + \fi} %--------------------------------------- fontmap internals @@ -777,9 +881,9 @@ \def\pxcz@cmap@hwuni{UniJIS-UCS2-HW-H} %%<*> \usecmapforalphabet/\nousecmapforalphabet -\newcommand*\usecmapforalphabet{% +\pxcz@Z\newrobustcmd*\usecmapforalphabet{% \global\pxcz@cmap@alphatrue} -\newcommand*\nousecmapforalphabet{% +\pxcz@Z\newrobustcmd*\nousecmapforalphabet{% \global\pxcz@cmap@alphafalse} %% \pxcz@NEF/<sym> @@ -800,42 +904,56 @@ %%<+> \JaFontReplacementFor{<sym>} \newcommand*\JaFontReplacementFor[1]{% \csname pxcz@FS/#1\endcsname} +\@namedef{pxcz@FS/*}{\pxcz@empty} %%<+> \JaFontReplacementHook{<code>} \@onlypreamble\JaFontReplacementHook -\newcommand*\JaFontReplacementHook{% +\pxcz@Z\newrobustcmd*\JaFontReplacementHook{% \g@addto@macro\pxcz@user@hook} \let\pxcz@user@hook\@empty %%<+> \JaFontUserDefinedMap \@onlypreamble\JaFontUserDefinedMap -\newcommand*\JaFontUserDefinedMap{% +\pxcz@Z\newrobustcmd*\JaFontUserDefinedMap{% \g@addto@macro\pxcz@user@map} -\let\pxcz@user@map\@empty -\@namedef{pxcz@FS/*}{\pxcz@empty} - -%%<+> \usefontmapline{<map-line>} -\@onlypreamble\usefontmapline -\newcommand*\usefontmapline[1]{% - \JaFontUserDefinedMap{\pxcz@addtospec@alt\pxcz@mapline{#1}}} - -%%<+> \usefontmapfile{<map-file>} -\@onlypreamble\usefontmapfile -\newcommand*\usefontmapfile[1]{% - \JaFontUserDefinedMap{\pxcz@addtospec@alt\pxcz@mapfile{#1}}} +\pxcz@onlypreamble@let\pxcz@user@map\@empty %% \pxcz@check@extra % Executed at the begin-document hook. \@onlypreamble\pxcz@check@extra \let\pxcz@check@extra\@empty +%% \pxcz@addtospec@aux{<name>}{<text>} +\pxcz@onlypreamble@def\pxcz@addtospec@aux#1#2{% + \xdef\pxcz@spec{\pxcz@spec\noexpand\special{pdf:#1 #2}}% +} + +%%<*> \usefontmapline{<map-line>} +\@onlypreamble\usefontmapline +\pxcz@Z\newrobustcmd*\usefontmapline[1]{% + \JaFontUserDefinedMap{\pxcz@add@mapline{#1}}% +} +%%<*> \usefontmapfile{<map-file>} +\@onlypreamble\usefontmapfile +\pxcz@Z\newrobustcmd*\usefontmapfile[1]{% + \JaFontUserDefinedMap{\pxcz@add@mapfile{#1}}% +} +%% \pxcz@add@mapfile{<map-file>} +\pxcz@onlypreamble@def\pxcz@add@mapfile{% + \pxcz@addtospec@aux{mapfile}% +} +%% \pxcz@add@mapline{<map-line>} +\pxcz@onlypreamble@def\pxcz@add@mapline{% + \pxcz@addtospec@aux{mapline}% +} + %--------------------------------------- map entry handling %%<*> \setnewglyphcmapprefix{<str>} \def\pxcz@pfx@jis@dflt{2004-} \def\pxcz@pfx@jis@star{JISX0213-2004-} \@onlypreamble\setnewglyphcmapprefix -\newcommand*\setnewglyphcmapprefix{% +\pxcz@Z\newrobustcmd*\setnewglyphcmapprefix{% \@ifstar{\pxcz@set@pfx@jis\pxcz@pfx@jis@star}% {\pxcz@set@pfx@jis}} \def\pxcz@set@pfx@jis#1{% @@ -887,18 +1005,6 @@ \ifx\pxcz@font\@empty \else\ifx\pxcz@font\pxcz@noembed \else - \pxcz@inspect@font@tribe@a{?SourceHanSerif-}{.otf?}{sourcehan}% - \pxcz@inspect@font@tribe@a{?SourceHanSans-}{.otf?}{sourcehan}% - \pxcz@inspect@font@tribe@a{?:0:SourceHanSerif-}{.ttc?}{sourcehanC}% - \pxcz@inspect@font@tribe@a{?:0:SourceHanSans-}{.ttc?}{sourcehanC}% - \pxcz@inspect@font@tribe@a{?NotoSerifCJKjp-}{.otf?}{noto}% - \pxcz@inspect@font@tribe@a{?NotoSansCJKjp-}{.otf?}{noto}% - \pxcz@inspect@font@tribe@a{?:0:NotoSerifCJK-}{.ttc?}{notoC}% - \pxcz@inspect@font@tribe@a{?:0:NotoSansCJK-}{.ttc?}{notoC}% - \pxcz@inspect@font@tribe@a{?yumin}{.ttf?}{yumin}% - \pxcz@inspect@font@tribe@a{?YUMIN}{.TTF?}{yuminU}% - \pxcz@inspect@font@tribe@a{:YuGoth}{.ttc?}{yugoth}% - \pxcz@inspect@font@tribe@a{:YUGOTH}{.TTC?}{yugoth}% \pxcz@inspect@font@tribe@a{:moga}{.ttc?}{mogamobo}% \pxcz@inspect@font@tribe@a{:mobo}{.ttc?}{mogamobo}% \fi\fi @@ -919,7 +1025,7 @@ %% \pxcz@switch@font@for{<feature>} % Modifies \pxcz@font, assuming \pxcz@font@tribe is properly set. \pxcz@onlypreamble@def\pxcz@switch@font@for#1{% - \pxcz@csletcs{pxcz@tmpb}{pxcz@switch@font@@\pxcz@font@tribe @#1}% + \pxcz@letcs\pxcz@tmpb{pxcz@switch@font@@\pxcz@font@tribe @#1}% \ifx\pxcz@tmpb\relax\else %\typeout{#1:\pxcz@font-->\expandafter\pxcz@tmpb\pxcz@font}% \edef\pxcz@font{\expandafter\pxcz@tmpb\pxcz@font}% @@ -1085,11 +1191,9 @@ \fi\fi % output it \ifx\pxcz@font\pxcz@kill@mapping - \xdef\pxcz@spec{\pxcz@spec\noexpand\special{% - \pxcz@mapline{-#2}}}% + \pxcz@add@mapline{-#2}% \else\ifx\pxcz@font\@empty\else - \xdef\pxcz@spec{\pxcz@spec\noexpand\special{% - \pxcz@mapline{#2 \pxcz@cmap\space\pxcz@font\pxcz@mopts}}}% + \pxcz@add@mapline{#2 \pxcz@cmap\space\pxcz@font\pxcz@mopts}% \fi\fi} %% \pxcz@do@file@preset @@ -1116,13 +1220,7 @@ \ifpxcz@uptex \pxcz@use@mapfile@b{uptex-#1-#2}\fi \ifpxcz@otf \pxcz@use@mapfile@b{otf-#1-#2}\fi} \pxcz@onlypreamble@def\pxcz@use@mapfile@b#1{% - \pxcz@addtospec@alt\pxcz@mapfile{#1.map}} - -%% \pxcz@addtospec@alt -\def\pxcz@addtospec@alt#1#2{% - \xdef\pxcz@spec{\pxcz@spec\noexpand\special{#1{#2}}}} -\def\pxcz@mapfile#1{pdf:mapfile #1} -\def\pxcz@mapline#1{pdf:mapline #1} + \pxcz@add@mapfile{#1.map}} %--------------------------------------- map entry definitions @@ -1435,15 +1533,15 @@ \else \ifnum\pxcz@unicode<\pxcz@unicode@@simple\else \pxcz@diruni@oktrue % 'unicode=UTF' does not need otf - \AtBeginDocument{% loading otf later causes inconsistency + \g@addto@macro\pxcz@first@doc@hook{% + % loading otf later causes inconsistency \@ifpackageloaded{otf}{\pxcz@diruni@okfalse}{}}% \fi \fi \fi %%<*> \diruni -\newcommand*{\diruni}{\pxcz@diruni} -\DeclareRobustCommand*{\pxcz@diruni}{% +\pxcz@Z\newrobustcmd*\diruni{% \not@math@alphabet\diruni\relax \ifx\cy@encoding\pxcz@JYn % if in standard Japanese encoding \expandafter\let\csname UTF \endcsname\pxcz@du@UTF @@ -1452,10 +1550,9 @@ } %%<*> \textdiruni{<text>} -\@ifdefinable{\textdiruni}{% - \DeclareRobustCommand*{\textdiruni}[1]{% - \relax\ifmmode\hbox\fi{\pxcz@diruni#1}% - }} +\pxcz@Z\newrobustcmd*\textdiruni[1]{% + \relax\ifmmode\hbox\fi{\diruni#1}% +} %% \pxcz@du@UTF \def\pxcz@du@UTF#1{% @@ -1476,7 +1573,7 @@ \ifcase\pxcz@unicode with 'unicode' option% \else pxchfon after 'otf' package% \fi .\MessageBreak\@ehc}} -\AtBeginDocument{% +\g@addto@macro\pxcz@first@doc@hook{% \ifpxcz@diruni@ok \let\pxcz@err@diruni\relax \else \let\pxcz@diruni\pxcz@err@diruni \fi} @@ -1526,7 +1623,7 @@ \fi \fi\fi\fi -\AtBeginDocument{% +\g@addto@macro\pxcz@first@doc@hook{% \def\pxcz@do#1#2#3{% \DeclareFontShape{#1}{#2}{#3}{diruni}{<->ssub*#2/#3/n}{}}% \@for\pxcz@tmpa:={\rmdefault,\sfdefault,\ttdefault}\do{% @@ -1547,25 +1644,25 @@ \fi %---- </diruni-ok> %--------------------------------------- 'glyphid' +\ifnum\pxcz@glyphid>0 %---- <*glyphid> -%% \pxcz@geta -\chardef\pxcz@geta=\jis"222E\relax - -\ifnum\pxcz@glyphid=2 %---- <*glyphid> +\ifnum\pxcz@glyphid=2 %---- <*glyphid-ok> %% check integrity \ifpxcz@otf@loaded\else - \AtBeginDocument{% loading otf later causes inconsistency + \g@addto@macro\pxcz@first@doc@hook{% + % loading otf later causes inconsistency \@ifpackageloaded{otf}{% \PackageWarningNoLine\pxcz@pkgname {The option 'glyphid' will not work. You must\MessageBreak load pxchfon after 'otf' package}% - \def\gid{\pxcz@gid@fb}}{}} + \def\pxcz@gid{\pxcz@gid@fb}% + \chardef\pxcz@glyphid=1 + }{}} \fi -%%<*> \gid{<number>} -\newcommand*{\gid}{\pxcz@gid} -\DeclareRobustCommand*{\pxcz@gid}[1]{% +%% \pxcz@gid{<number>} +\def\pxcz@gid#1{% \begingroup \kanjishape{dirgid}\selectfont \kchar#1\pxcz@gid@jfm@sync @@ -1608,108 +1705,38 @@ \pxcz@dg@decl@shape{gt}{bx}f{ssub*gt/m/dirgid}{}% \fi\fi\fi -\fi %---- </glyphid> - -\ifnum\pxcz@glyphid>0 - %% \pxcz@gid@fb - \providecommand*{\gid}{\pxcz@gid@fb} - \DeclareRobustCommand*{\pxcz@gid@fb}[1]{% - \begingroup \kchar\pxcz@geta \endgroup} - - % redefinition in PDF-strings - \begingroup \kansujichar1=\pxcz@geta \kcatcode\pxcz@geta=18 - \xdef\pxcz@hy@gid#1{\kansuji1} - \endgroup - \pxcz@hy@disable@commands{% - \let\gid\pxcz@hy@gid} -\fi - -%--------------------------------------- 'alphabet' option - -%% check for textcomp -\newif\ifpxcz@textcomp -\ifx\DeclareEncodingSubset\@undefined\else - \expandafter\ifx\csname T@TS1\endcsname\relax\else - \pxcz@textcomptrue -\fi\fi +\fi %---- </glyphid-ok> -%% \pxcz@afont@enc@list -\def\pxcz@afont@enc@list{OT1,T1} -\ifpxcz@textcomp \g@addto@macro\pxcz@afont@enc@list{,TS1}\fi -%% \pxcz@decl@family{<fam>} -\pxcz@onlypreamble@def\pxcz@decl@family#1{% - \ifpxcz@textcomp \DeclareEncodingSubset{TS1}{#1}{3}\fi - \@for\pxcz@x:=\pxcz@afont@enc@list\do{% - \DeclareFontFamily{\pxcz@x}{#1}{}}} -%% \pxcz@decl@shape{<fam>}{<ser>}<sw>{<font>} -\pxcz@onlypreamble@def\pxcz@decl@shape#1#2#3#4{% - \if s#3% - \@for\pxcz@x:=\pxcz@afont@enc@list\do{% - \DeclareFontShape{\pxcz@x}{#1}{#2}{n}{<->ssub*#4}{}}% +%%<*> \gid{<number>} +\pxcz@Z\newrobustcmd*\gid{\pxcz@gid} + +%% \pxcz@gid@fb +\def\pxcz@gid@fb#1{% + \begingroup + \pxcz@geta + \endgroup} +\providecommand*\pxcz@gid{\pxcz@gid@fb} + +% redefinition in PDF-strings +\def\pxcz@hy@gid#1{% + \ifx\pxjahyperBadCharacter\@undefined + \pxcz@geta \else - \DeclareFontShape{OT1}{#1}{#2}{n}{<->#4-l5j}{}% - \DeclareFontShape {T1}{#1}{#2}{n}{<->#4-t1}{}% - \ifpxcz@textcomp - \DeclareFontShape{TS1}{#1}{#2}{n}{<->#4-ts1}{}% - \fi + \pxjahyperBadCharacter{GID+#1}% \fi - \@for\pxcz@x:=\pxcz@afont@enc@list\do{% - \DeclareFontShape{\pxcz@x}{#1}{#2}{it}{<->ssub*#1/#2/n}{}% - \DeclareFontShape{\pxcz@x}{#1}{#2}{sl}{<->ssub*#1/#2/n}{}}} - -\ifpxcz@alphafont %---- <*alphabet> -\ifpxcz@otf@deluxe %---- <*otfdx> : otf with deluxe option - % define families cfjar & cfjas -\pxcz@decl@family{cfjar}% -\pxcz@decl@shape{cfjar}{l}n{cfjar-l}% -\pxcz@decl@shape{cfjar}{m}n{cfjar-r}% -\pxcz@decl@shape{cfjar}{bx}n{cfjar-b}% -\pxcz@decl@family{cfjas}% -\pxcz@decl@shape{cfjas}{m}n{cfjas-r}% -\pxcz@decl@shape{cfjas}{bx}n{cfjas-b}% -\pxcz@decl@shape{cfjas}{eb}n{cfjas-x}% -\pxcz@decl@family{cfjam}% -\pxcz@decl@shape{cfjam}{m}n{cfjam-r}% - % redefine \ltseries & \ebseries so they affect roman font -\let\ltseries\relax \let\ebseries\relax -\DeclareRobustCommand\ltseries{% - \not@math@alphabet\ltseries\relax - \fontseries\ltdefault\selectfont}% -\DeclareRobustCommand\ebseries{% - \not@math@alphabet\ebseries\relax - \fontseries\ebdefault\selectfont}% -\else %---- <*!otfdx> -\pxcz@decl@family{cfjar}% -\pxcz@decl@shape{cfjar}{m}n{cfjar-r}% -\pxcz@decl@shape{cfjar}{bx}s{cfjas/m/n}% -\pxcz@decl@family{cfjas}% -\pxcz@decl@shape{cfjas}{m}n{cfjas-r}% -\pxcz@decl@shape{cfjas}{bx}s{cfjas/m/n}% -\pxcz@onlypreamble@def\pxcz@err@dxotf#1{% - \PackageError\pxcz@pkgname - {Loaded before '#1' with 'deluxe'}% - {This package must be loaded after '#1' with 'deluxe' option - when using both.}} -\g@addto@macro\pxcz@check@extra{% - \expandafter\let\expandafter\pxcz@x\csname pxcz@FS/mnr\endcsname - \ifx\pxcz@x\@empty\else - % if mnr is replaced but gtr is not then ... - \expandafter\ifx\csname pxcz@FS/gtr\endcsname\@empty - {\expandafter\let\csname pxcz@FS/gtr\endcsname\pxcz@x - \pxcz@Entry{gtr}{r-cfjas-r-@PXcjk0@}{unicode}{HWid}}% - \fi\fi - \@ifpackagewith{otf}{deluxe}{\pxcz@err@dxotf{otf}}{}% } -\fi %---- </otfdx> -\fi %---- </alphabet> + \pxcz@hy@disable@commands{% + \let\gid\pxcz@hy@gid} -%--------------------------------------- begin-document hook +\fi %---- </glyphid> +%--------------------------------------- 'pxchfon0' submodule +\ifpxcz@lite@mode\else -%% variables -\let\pxcz@afont@enc\relax +%% load the submodule +\input{pxchfon0.def} -%% \pxcz@mgfamily@hook -\def\pxcz@mgfamily@hook{\romanfamily{cfjam}} +\fi +%--------------------------------------- begin-document hook %% \pxcz@set@page@hook{<text>} \ifpxcz@old@hook@system %---- @@ -1740,37 +1767,14 @@ \expandafter\ifx\csname pxcz@FS/\pxcz@x\endcsname\@empty \pxcz@okfalse \fi}} -%% \pxcz@decl@relfont{<fam>}{<afam>}{<ser>,...} -\pxcz@onlypreamble@def\pxcz@decl@relfont#1#2#3{% - \@for\pxcz@x:={#3}\do{% - \expandafter\ifx\csname\k@encoding/#1/\pxcz@x/n\endcsname\relax\else - \edef\pxcz@tmpa{\noexpand\DeclareRelationFont - {\k@encoding}{#1}{\pxcz@x}{}{\pxcz@afont@enc}{#2}{\pxcz@x}{}% - }\pxcz@tmpa - \fi}% - \PackageInfo\pxcz@pkgname - {Relation font set for \k@encoding/#1}} - -%% \pxcz@check@afont@enc -\pxcz@onlypreamble@def\pxcz@check@afont@enc{% - \pxcz@oktrue % OT1 is always okay - \expandafter\ifx\csname\pxcz@afont@enc+cfjar\endcsname\relax - \pxcz@okfalse \fi - % if not okay, use OT1 instead - \ifpxcz@ok\else \def\pxcz@afont@enc{OT1}\fi} - -%% \pxcz@set@bfdefault@to@bx{<doc-ser>} -\pxcz@onlypreamble@let\pxcz@set@bfdefault@to@bx\@gobble -\ifx\DeclareFontSeriesDefault\@undefined\else - \def\pxcz@set@bfdefault@to@bx#1{% - \DeclareFontSeriesDefault[#1]{bf}{bx}} -\fi - %% the begin-document hook \pxcz@onlypreamble@def\pxcz@doc@hook{% \ifpxcz@otf \@ifpackageloaded{otf}{\pxcz@otftrue}{\pxcz@otffalse}% \@ifpackageloaded{utf}{\pxcz@utftrue}{\pxcz@utffalse}% + \ifx\pxchfonNoCheckMultiweight\@undefined\else + \pxcz@otftrue + \fi \fi \pxcz@user@hook \let\pxcz@use@do\pxcz@use@mapfile @@ -1782,44 +1786,11 @@ \pxcz@inspect@flavor@all \fi \if t\pxcz@alphabet % 'alphabet' - \pxcz@check@alldefined{mnl,mnr,mnb}\ifpxcz@ok - \renewcommand\rmdefault{cfjar}% - \pxcz@set@bfdefault@to@bx{rm}% - \fi - \pxcz@check@alldefined{gtr,gtb,gtx}\ifpxcz@ok - \renewcommand\sfdefault{cfjas}% - \pxcz@set@bfdefault@to@bx{sf}% - \fi - % attach hook to \mgfamily if mgr font is defined - \pxcz@check@alldefined{mgr}\ifpxcz@ok\ifpxcz@otf@deluxe - \begingroup - \def\pxcz@x##1{\toks@\expandafter{##1}% - \xdef##1{\noexpand\pxcz@mgfamily@hook\the\toks@}% - }\expandafter\pxcz@x\csname mgfamily \endcsname - \endgroup - \fi\fi - % decide alphabet font encoding - \edef\pxcz@afont@enc{\encodingdefault}% - \pxcz@check@afont@enc\ifpxcz@ok\else - \PackageWarningNoLine\pxcz@pkgname - {Default encoding is changed to 'OT1' because% - \MessageBreak'alphabet' option is in effect}% - \renewcommand\encodingdefault{OT1}% - \fi - \normalfont + \pxcz@setup@alphabet \pxcz@addtospec{ALPHA}% \fi \if r\pxcz@alphabet % 'relfont' - \edef\pxcz@afont@enc{\encodingdefault}% - \pxcz@check@afont@enc - \pxcz@check@alldefined{mnl,mnr,mnb}% - \ifpxcz@ok \pxcz@decl@relfont\mcdefault{cfjar}{m,bx,l}\fi - \pxcz@check@alldefined{gtr,gtb,gtx}% - \ifpxcz@ok \pxcz@decl@relfont\gtdefault{cfjas}{m,bx,eb}\fi - \pxcz@check@alldefined{mgr}% - \ifpxcz@ok\ifpxcz@otf@deluxe - \pxcz@decl@relfont\mgdefault{cfjam}{m}% - \fi\fi + \pxcz@setup@relfont \pxcz@addtospec{ALPHA}% \fi \ifpxcz@uptex\else @@ -1843,24 +1814,34 @@ \ifpxcz@utf \pxcz@addtospec{UTF}% \fi % warn if some weights are not substituted, and if necessaty - \ifpxcz@warn@unless@all@defined - \ifpxcz@otf@deluxe + \ifx\pxcz@warn@unless@all@defined@for\@empty\else + \if d\pxcz@otf@weight \pxcz@check@alldefined{mnl,mnr,mnb,gtr,gtb,gtx,mgr}% \else \pxcz@check@alldefined{mnr,mnb,gtr,gtb}% \fi \ifpxcz@ok\else + \def\do##1{\MessageBreak - ##1}% \PackageWarningNoLine\pxcz@pkgname - {Some font weights are not substituted.\MessageBreak - So some features of pxchfon might not work\MessageBreak - properly when applied to such weights}% + {There are some weights that font files are\MessageBreak + not specified for. It is possibly okay,\MessageBreak + but some features of pxchfon (listed below)\MessageBreak + might not work properly when applied to\MessageBreak + such weights.% + \pxcz@warn@unless@all@defined@for + \expandafter\@gobble}% gobble the period \fi \fi % warn if some weights are not embedded, and if necessaty - \ifpxcz@warn@unless@all@embedded \ifpxcz@noembed@used + \ifx\pxcz@warn@unless@all@embedded@for\@empty\else + \ifpxcz@noembed@used + \def\do##1{\MessageBreak - ##1}% \PackageWarningNoLine\pxcz@pkgname {Some font weights have no-embed setting.\MessageBreak - So some features of pxchfon might not work\MessageBreak - properly when applied to such weights}% + So some features of pxchfon (listed below)\MessageBreak + might not work properly when applied to\MessageBreak + such weights.% + \pxcz@warn@unless@all@embedded@for + \expandafter\@gobble}% gobble the period \fi\fi % \pxcz@check@extra @@ -1868,7 +1849,7 @@ \ifpxcz@enabled \pxcz@set@page@hook{\pxcz@spec}% \else\ifx\pxcz@spec\@empty\else - \PackageWarningNoLine\pxcz@pkgname + \pxcz@PackageNoteNoLine\pxcz@pkgname {Font mapping is disabled, since the driver in use\MessageBreak is not dvipdfmx}% \fi\fi @@ -2090,7 +2071,7 @@ \ifpxcz@autojfmsync %---- <*autojfmsync> % Makes \git/\CID/\UTF do automatically jfmsync \let\pxcz@gid@jfm@sync\pxcz@jfm@sync -\AtBeginDocument{% +\g@addto@macro\pxcz@first@doc@hook{% \ifx\put@character\@undefined\else \g@addto@macro\put@character{\pxcz@jfm@sync}% \fi diff --git a/macros/jptex/latex/pxchfon/pxchfon.tex b/macros/jptex/latex/pxchfon/pxchfon.tex index b58048a15b..6c47ce3d84 100644 --- a/macros/jptex/latex/pxchfon/pxchfon.tex +++ b/macros/jptex/latex/pxchfon/pxchfon.tex @@ -14,15 +14,17 @@ pdfauthor={八登崇之}} \usepackage{bxtexlogo} \bxtexlogoimport{*,logo-e} -\usepackage{shortvrb} +\usepackage{shortvrb,alltt} \MakeShortVerb{\|} -\newcommand{\PkgVersion}{2.0} -\newcommand{\PkgDate}{2023/08/28} +\newcommand{\PkgVersion}{2.2} +\newcommand{\PkgDate}{2024/08/22} \newcommand{\Pkg}[1]{\textsf{#1}} \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$} +\newcommand{\RMeta}[1]{{\rmfamily\Meta{#1}}} \newcommand{\Note}{\par\noindent ※} \newcommand{\Means}{:\ } \newcommand{\Zk}{\mbox{}} +\newcommand{\cs}[1]{\symbol{`\\}#1} \providecommand{\Strong}[1]{\textsf{#1}} %----------------------------------------------------------- \begin{document} @@ -88,9 +90,10 @@ OpenTypeフォントをユーザが指定する機能を提供する。 \begin{itemize} \item \Strong{ドライバオプション}\Means - |dvipdfmx|、|dvips|、|dviout|、|xdvi| および |nodvidriver|% - (ドライバ依存動作の無効化を明示的に指示) + |dvipdfmx|、|dvips|、|dviout|、|xdvi| % が指定できる。 + \footnote{「上級者向け」の一覧にある |nodvidriver| + と |resetdvidriver| もドライバオプションの一種である。}% ただし、本パッケージの主要機能である 「フォントマップの文書内での指定」 がサポートされるのは\Strong{dvipdfmxのみ}である。 @@ -144,7 +147,8 @@ OpenTypeフォントをユーザが指定する機能を提供する。 今でもこの動作は維持されているが、 2.0版以降はこの既定設定を利用することは\Strong{非推奨}% \footnote{プリセット指定オプションの有無により既定が変わる仕様は - 好ましくないため。}% + 好ましくないため。 + 2.1版以降では警告が出る。}% となり、プリセット不使用の場合は 3つのオプションの何れかを指定することが推奨される。 \item |otf|(既定)\Means @@ -194,6 +198,12 @@ OpenTypeフォントをユーザが指定する機能を提供する。 \paragraph{上級者向けオプション} \begin{itemize} +\item |nodvidriver|\Means + 特殊なドライバオプションで、 + ドライバ依存動作の無効化を明示的に指示する。 +\item |resetdvidriver|\Means + |nodvidriver| の否定。 + \Note ドライバ指定は既定値である |dvipdfmx| に戻る。 \item |relfont|\Means 指定された和文フォントの英数字部分を({\pLaTeX}の標準機能である) \Strong{従属欧文フォント}として設定する。 @@ -281,7 +291,7 @@ OpenTypeフォントをユーザが指定する機能を提供する。 Unicode直接指定が有効である場合に、 全角幅のグリフを優先させる。 \Note 全角幅想定の文字が使える可能性が増えるという利点がある一方で、 - 半角幅想定の文字が使える可能性が減るという欠点もある。 + 半角幅想定の文字が使えなくなるという欠点もある。 \item |nofullwidth|(既定)\Means |fullwidth| の否定。 \item |legacycode=|\Meta{値}\Means @@ -325,12 +335,12 @@ OpenTypeフォントをユーザが指定する機能を提供する。 \item |maybe-multiweight|\Means 「|deluxe| オプション付きの\Pkg{japanese-otf}パッケージが読み込まれて いないにもかかわらず多ウェイト用のフォント設定命令が使われた」 - 際に出る警告を抑止する。% - \footnote{例えば - 「単ウェイト・多ウェイト兼用を意図したフォント設定命令を - テンプレートに記述している」 - 「\Pkg{japanese-otf}以外でその和文TFMを流用している」 - などの状況を想定している。} + 場合に出る警告を抑止する。 +\item |nocheck-expert|\Means + 「Unicode 直接指定と |expert| オプションが有効で、 + かつ置換されていないウェイトが存在する」 + 場合に出る警告を抑止する。 + \Note 警告抑止オプションについては\ref{sec:Suppress-Warnings}を参照。 \end{itemize} %=========================================================== @@ -442,6 +452,17 @@ OpenTypeフォントをユーザが指定する機能を提供する。 \paragraph{上級者向け機能} \begin{itemize} +\item |\pxchfonsetup{|\Meta{設定}|,…}|\Means + 設定を変更する。 + 設定可能なパラメタは以下の通り。 + \Note 真偽値をとるパラメタでは、値を省略した場合は |true| + と等価となる。 + \Note 残念ながら、実装の都合のためパッケージ読込後に変更可能な + 設定項目はかなり少ない。 + \begin{itemize} + \item |jis2004|[|=|\Meta{真偽値}]\Means + オプションの (|no|)|jis2004| と同じ。 + \end{itemize} \item |\usecmapforalphabet|\Means |usecmapforalphabet| オプションの設定に切り替える。 (\ref{sec:Loading}節を参照。) @@ -466,6 +487,21 @@ OpenTypeフォントをユーザが指定する機能を提供する。 \item |\usefontmapline{|\Meta{マップ行}|}|\Means dvipdfmxのマップ行を直接指定して、その読込を指示する。 \Note pdf{\TeX}の |\pdfmapline| に相当する機能。 +\item |usefontmaplines| 環境\Means + 複数のマップ行を一度に記述できる環境。 + \footnote{|usefontmaplines| 環境の中では、 + {\LaTeX}の特殊文字のうち |\| と空白だけが通常のの規則に従う。 + 改行は各マップ行の区切りの意味をもつ。 + \texttt{\%} は行末までをコメントにするが、改行は維持される。 + 他の文字(|{| |}| も含む)はその文字自体と解釈される。 + 他の注意として、|\end{usefontmaplines}| は行頭に書く必要がある。} +\begin{quote}\small\begin{alltt} +\cs{begin}\{usefontmaplines\} +\RMeta{マップ行} +\RMeta{マップ行} +…… +\cs{end}\{usefontmaplines\} +\end{alltt}\end{quote} \item |\diruni|\Means 現在の和文フォントを“Unicode直接入力” (フォントマップをUnicode直接指定にした上で @@ -1636,5 +1672,67 @@ r-cfjam-r-@PXcjk0@ msgothic.ttc FontIndex=0 \end{itemize} %=========================================================== +\section{警告抑止用のオプション・開発者用フラグ} +\label{sec:Suppress-Warnings} + +本パッケージのオプション設定は極めて複雑なため、使用法によっては +「動作が極めて解りにくい状態」 +や +「ユーザ命令の範囲ではサポートされない状態」 +といった“奇妙な”状態に移行していまうことがある。 +一方で +「そういう“奇妙な”設定を解った上で敢えて利用している」 +「本パッケージ以外の手段で生成したフォントマップ行を併用している」 +などの理由で、“奇妙な”設定が正当である可能性もある。 +このため、現状の方針としては +「“奇妙な”状態になった場合は(エラーでなく +\footnote{将来的に、警告抑止の手段が十分に周知された段階で、 + エラーに移行することも考えられる。}) +\Strong{警告を出す}」 +ことにしている。 + +しかし、正当に利用している人にとってはこの警告は煩わしいはずなので、 +特定の警告を抑止するための手段を用意する。 +警告抑止の方法は「オプション」と「開発者用フラグ」 +の2種類がある。 + +\paragraph{開発者用フラグ} +開発者用フラグ +\footnote{開発者用の機能であるため、ここでは{\TeX}言語の知識を仮定する。} +とは、例えば |\pxchfonNoCheckMultiweight| のように、 +本パッケージが指定する特定の制御綴のことである。 +制御綴が\Strong{定義済である}場合にフラグが有効であると判断する。 +従って、本パッケージの機能と連携するパッケージの開発者は、 +\begin{quote}\small\begin{verbatim} +\let\pxchfonNoCheckMultiweight=t +\end{verbatim}\end{quote} +のようなコードを実行することで、不要な警告を抑止できる。 +\Note 定義済であれば意味は何でもよいが、上記コードのように +「文字トークンの|t|」を使うことを推奨する。 + +\paragraph{オプション・開発者用フラグの一覧} +以下のものが用意されている。 + +\begin{itemize} +\item |maybe-multiweight| オプション/% + |\pxchfonNoCheckMultiweight| フラグ\Means + 「|deluxe| オプション付きの\Pkg{japanese-otf}パッケージが読み込まれて + いないにもかかわらず多ウェイト用のフォント設定命令が使われた」 + 場合に出る警告を抑止する。 + \Note 例えば + 「単ウェイト・多ウェイト兼用を意図したフォント設定命令を + テンプレートに記述している」 + 「\Pkg{japanese-otf}以外でその和文TFMを流用している」 + などの状況を想定している。 + \Note 有効化した場合、たとえ\Pkg{japanese-otf}が読み込まれていなくても + \Pkg{japanese-otf}用のフォントマップ行を書き込む。 +\item |nocheck-expert| オプション/% + |\pxchfonNoCheckExpert| フラグ\Means + 「Unicode 直接指定と |expert| オプションが有効で、 + かつ置換されていないウェイトが存在する」 + 場合に出る警告を抑止する。 +\end{itemize} + +%=========================================================== \end{document} %% EOF diff --git a/macros/jptex/latex/pxchfon/pxchfon0.def b/macros/jptex/latex/pxchfon/pxchfon0.def index 1be68f098f..1a78b75eb9 100644 --- a/macros/jptex/latex/pxchfon/pxchfon0.def +++ b/macros/jptex/latex/pxchfon/pxchfon0.def @@ -1,4 +1,235 @@ -% pxchfon0.def -% This file does nothing; it exists for check for full installation. -\relax -% EOF +%% +%% This is file 'pxchfon0.def'. +%% +%% Copyright (c) 2009-2024 Takayuki YATO (aka. "ZR") +%% GitHub: https://github.com/zr-tex8r +%% Twitter: @zr_tex8r +%% +%% This package is distributed under the MIT License. +%% + +%% package declaration +\NeedsTeXFormat{pLaTeX2e} +\ProvidesFile{pxchfon0.def}[2024/08/22 v2.2] +\providecommand{\bxDebug}[1]{} + +%--------------------------------------- general + +%% variables +\newif\ifpxcz@textcomp + +%--------------------------------------- 'alphabet' option +\ifpxcz@alphafont + +%% check for textcomp +\ifx\DeclareEncodingSubset\@undefined\else + \expandafter\ifx\csname T@TS1\endcsname\relax\else + \pxcz@textcomptrue +\fi\fi + +%% \pxcz@afont@enc@list +\def\pxcz@afont@enc@list{OT1,T1} +\ifpxcz@textcomp \g@addto@macro\pxcz@afont@enc@list{,TS1}\fi +%% \pxcz@decl@family{<fam>} +\pxcz@onlypreamble@def\pxcz@decl@family#1{% + \ifpxcz@textcomp \DeclareEncodingSubset{TS1}{#1}{3}\fi + \@for\pxcz@x:=\pxcz@afont@enc@list\do{% + \DeclareFontFamily{\pxcz@x}{#1}{}}} +%% \pxcz@decl@shape{<fam>}{<ser>}<sw>{<font>} +\pxcz@onlypreamble@def\pxcz@decl@shape#1#2#3#4{% + \if s#3% + \@for\pxcz@x:=\pxcz@afont@enc@list\do{% + \DeclareFontShape{\pxcz@x}{#1}{#2}{n}{<->ssub*#4}{}}% + \else + \DeclareFontShape{OT1}{#1}{#2}{n}{<->#4-l5j}{}% + \DeclareFontShape {T1}{#1}{#2}{n}{<->#4-t1}{}% + \ifpxcz@textcomp + \DeclareFontShape{TS1}{#1}{#2}{n}{<->#4-ts1}{}% + \fi + \fi + \@for\pxcz@x:=\pxcz@afont@enc@list\do{% + \DeclareFontShape{\pxcz@x}{#1}{#2}{it}{<->ssub*#1/#2/n}{}% + \DeclareFontShape{\pxcz@x}{#1}{#2}{sl}{<->ssub*#1/#2/n}{}}} + +\if d\pxcz@otf@weight %---- <*otfdx> : otf with deluxe option + % define families cfjar & cfjas +\pxcz@decl@family{cfjar}% +\pxcz@decl@shape{cfjar}{l}n{cfjar-l}% +\pxcz@decl@shape{cfjar}{m}n{cfjar-r}% +\pxcz@decl@shape{cfjar}{bx}n{cfjar-b}% +\pxcz@decl@family{cfjas}% +\pxcz@decl@shape{cfjas}{m}n{cfjas-r}% +\pxcz@decl@shape{cfjas}{bx}n{cfjas-b}% +\pxcz@decl@shape{cfjas}{eb}n{cfjas-x}% +\pxcz@decl@family{cfjam}% +\pxcz@decl@shape{cfjam}{m}n{cfjam-r}% + % redefine \ltseries & \ebseries so they affect roman font +\let\ltseries\relax \let\ebseries\relax +\DeclareRobustCommand\ltseries{% + \not@math@alphabet\ltseries\relax + \fontseries\ltdefault\selectfont}% +\DeclareRobustCommand\ebseries{% + \not@math@alphabet\ebseries\relax + \fontseries\ebdefault\selectfont}% +\else %---- <*!otfdx> +\pxcz@decl@family{cfjar}% +\pxcz@decl@shape{cfjar}{m}n{cfjar-r}% +\pxcz@decl@shape{cfjar}{bx}s{cfjas/m/n}% +\pxcz@decl@family{cfjas}% +\pxcz@decl@shape{cfjas}{m}n{cfjas-r}% +\pxcz@decl@shape{cfjas}{bx}s{cfjas/m/n}% +\pxcz@onlypreamble@def\pxcz@err@dxotf#1{% + \PackageError\pxcz@pkgname + {Loaded before '#1' with 'deluxe'}% + {This package must be loaded after '#1' with 'deluxe' option + when using both.}} +\g@addto@macro\pxcz@check@extra{% + \expandafter\let\expandafter\pxcz@x\csname pxcz@FS/mnr\endcsname + \ifx\pxcz@x\@empty\else + % if mnr is replaced but gtr is not then ... + \expandafter\ifx\csname pxcz@FS/gtr\endcsname\@empty + {\expandafter\let\csname pxcz@FS/gtr\endcsname\pxcz@x + \pxcz@Entry{gtr}{r-cfjas-r-@PXcjk0@}{unicode}{HWid}}% + \fi\fi + \@ifpackagewith{otf}{deluxe}{\pxcz@err@dxotf{otf}}{}% +} +\fi %---- </otfdx> + +\fi +%--------------------------------------- begin-document hook +\ifpxcz@alphafont + +%% variables +\let\pxcz@afont@enc\relax + +%% \pxcz@mgfamily@hook +\def\pxcz@mgfamily@hook{\romanfamily{cfjam}} + +%% \pxcz@decl@relfont{<fam>}{<afam>}{<ser>,...} +\pxcz@onlypreamble@def\pxcz@decl@relfont#1#2#3{% + \@for\pxcz@x:={#3}\do{% + \expandafter\ifx\csname\k@encoding/#1/\pxcz@x/n\endcsname\relax\else + \edef\pxcz@tmpa{\noexpand\DeclareRelationFont + {\k@encoding}{#1}{\pxcz@x}{}{\pxcz@afont@enc}{#2}{\pxcz@x}{}% + }\pxcz@tmpa + \fi}% + \PackageInfo\pxcz@pkgname + {Relation font set for \k@encoding/#1}} + +%% \pxcz@check@afont@enc +\pxcz@onlypreamble@def\pxcz@check@afont@enc{% + \pxcz@oktrue % OT1 is always okay + \expandafter\ifx\csname\pxcz@afont@enc+cfjar\endcsname\relax + \pxcz@okfalse \fi + % if not okay, use OT1 instead + \ifpxcz@ok\else \def\pxcz@afont@enc{OT1}\fi} + +%% \pxcz@set@bfdefault@to@bx{<doc-ser>} +\pxcz@onlypreamble@let\pxcz@set@bfdefault@to@bx\@gobble +\ifx\DeclareFontSeriesDefault\@undefined\else + \def\pxcz@set@bfdefault@to@bx#1{% + \DeclareFontSeriesDefault[#1]{bf}{bx}} +\fi + +%% \pxcz@setup@alphabet +\pxcz@onlypreamble@def\pxcz@setup@alphabet{% + \pxcz@check@alldefined{mnl,mnr,mnb}\ifpxcz@ok + \renewcommand\rmdefault{cfjar}% + \pxcz@set@bfdefault@to@bx{rm}% + \fi + \pxcz@check@alldefined{gtr,gtb,gtx}\ifpxcz@ok + \renewcommand\sfdefault{cfjas}% + \pxcz@set@bfdefault@to@bx{sf}% + \fi + % attach hook to \mgfamily if mgr font is defined + \pxcz@check@alldefined{mgr}\ifpxcz@ok\if d\pxcz@otf@weight + \begingroup + \def\pxcz@x##1{\toks@\expandafter{##1}% + \xdef##1{\noexpand\pxcz@mgfamily@hook\the\toks@}% + }\expandafter\pxcz@x\csname mgfamily \endcsname + \endgroup + \fi\fi + % decide alphabet font encoding + \edef\pxcz@afont@enc{\encodingdefault}% + \pxcz@check@afont@enc\ifpxcz@ok\else + \PackageWarningNoLine\pxcz@pkgname + {Default encoding is changed to 'OT1' because% + \MessageBreak'alphabet' option is in effect}% + \renewcommand\encodingdefault{OT1}% + \fi + \normalfont +} + +%% \pxcz@setup@relfont +\pxcz@onlypreamble@def\pxcz@setup@relfont{% + \edef\pxcz@afont@enc{\encodingdefault}% + \pxcz@check@afont@enc + \pxcz@check@alldefined{mnl,mnr,mnb}% + \ifpxcz@ok \pxcz@decl@relfont\mcdefault{cfjar}{m,bx,l}\fi + \pxcz@check@alldefined{gtr,gtb,gtx}% + \ifpxcz@ok \pxcz@decl@relfont\gtdefault{cfjas}{m,bx,eb}\fi + \pxcz@check@alldefined{mgr}% + \ifpxcz@ok\if d\pxcz@otf@weight + \pxcz@decl@relfont\mgdefault{cfjam}{m}% + \fi\fi +} + +\fi +%--------------------------------------- 'usefontmaplines' + +%%<*> \begin{usefontmaplines} +% <map-line> +% ... +% \end{usefontmaplines} +\@onlypreamble\usefontmaplines +\newenvironment{usefontmaplines}{% + \catcode`\{=12 \catcode`\}=12 \catcode`\&=12 \catcode`\#=12 + \catcode`\^=12 \catcode`\~=12 \catcode`\%=12 \catcode13=12 + \catcode32=10 \endlinechar=13 + \let\pxcz@tmp@end\end \let\begin\relax \let\end\relax + \let\par\@empty \let\ \space \def\pxcz@tmp@end@{\end}% + \pxcz@maplines@a +}{} +\@onlypreamble\pxcz@maplines@a +\long\def\pxcz@maplines@a#1{% + \def\pxcz@tmpa{#1}\pxcz@cond\ifx\pxcz@tmpa\pxcz@tmp@end@\fi{% + \catcode`\{=1 \catcode`\}=2 + \pxcz@tmp@end + }{%else + \pxcz@maplines@b#1% + }% +} +\@onlypreamble\pxcz@maplines@b +\begingroup \catcode13=12 +\long\gdef\pxcz@maplines@b#1^^M{% + \pxcz@maplines@line#1\pxcz@mk% + \pxcz@maplines@a% +}% +\endgroup +\@onlypreamble\pxcz@maplines@line +\long\def\pxcz@maplines@line#1\pxcz@mk{% + \edef\pxcz@tmpa{#1}% + \pxcz@split{\@percentchar}{\pxcz@tmpa}% + \ifx\pxcz@pre\relax\else \let\pxcz@tmpa\pxcz@pre \fi + \pxcz@split{\end}{\pxcz@tmpa}% + \ifx\pxcz@pre\relax + \pxcz@split{\space\pxcz@mk}{\pxcz@tmpa\pxcz@mk}% + \ifx\pxcz@pre\relax\else \let\pxcz@tmpa\pxcz@pre \fi + \ifx\pxcz@tmpa\@empty\else + \expandafter\usefontmapline\expandafter{\pxcz@tmpa}% + \fi + \else % '\end' found inside the line + \pxcz@maplines@err + \fi +} +\pxcz@onlypreamble@def\pxcz@maplines@err{% + \PackageError\pxcz@pkgname + {'\string\end{usefontmaplines}' must be put at the top\MessageBreak + of a line}% + {\@ehc}% + \def\pxcz@maplines@a{\pxcz@tmp@end{usefontmaplines}}% +} + +%--------------------------------------- all done +\endinput +%% EOF diff --git a/macros/jptex/latex/pxchfon/sample/sample-2000jis.pdf b/macros/jptex/latex/pxchfon/sample/sample-2000jis.pdf Binary files differindex e9034e19a9..bad0442fea 100644 --- a/macros/jptex/latex/pxchfon/sample/sample-2000jis.pdf +++ b/macros/jptex/latex/pxchfon/sample/sample-2000jis.pdf diff --git a/macros/jptex/latex/pxchfon/sample/sample-2000jis.tex b/macros/jptex/latex/pxchfon/sample/sample-2000jis.tex index d8f11703aa..3a83ddb397 100644 --- a/macros/jptex/latex/pxchfon/sample/sample-2000jis.tex +++ b/macros/jptex/latex/pxchfon/sample/sample-2000jis.tex @@ -1,7 +1,8 @@ -% 文字コードはUTF-8 (platex -kanji=utf8) -\documentclass[a6paper,papersize]{jsarticle} -\usepackage[noembed,noprefer2004jis]{pxchfon} % no-embed -%\usepackage[hiragino-pron,noprefer2004jis]{pxchfon} % embed Hiragino ProN +% pLaTeX document; UTF-8 (platex -kanji=utf8) +% This file is in public domain. +\documentclass[a6paper,dvipdfmx,papersize,nojis2004]{jsarticle} +\usepackage[ipaex]{pxchfon} % embed IPAex fonts +%\usepackage[hiragino-pron]{pxchfon} % embed Hiragino ProN \begin{document} 葛餅で蓬餅で、かつ煎餅! \end{document} diff --git a/macros/jptex/latex/pxchfon/sample/sample-2004jis.pdf b/macros/jptex/latex/pxchfon/sample/sample-2004jis.pdf Binary files differindex 27e567b8e0..698b4bc254 100644 --- a/macros/jptex/latex/pxchfon/sample/sample-2004jis.pdf +++ b/macros/jptex/latex/pxchfon/sample/sample-2004jis.pdf diff --git a/macros/jptex/latex/pxchfon/sample/sample-2004jis.tex b/macros/jptex/latex/pxchfon/sample/sample-2004jis.tex index 2563674efc..3cfe0c5079 100644 --- a/macros/jptex/latex/pxchfon/sample/sample-2004jis.tex +++ b/macros/jptex/latex/pxchfon/sample/sample-2004jis.tex @@ -1,7 +1,8 @@ -% 文字コードはUTF-8 (platex -kanji=utf8) -\documentclass[a6paper,papersize]{jsarticle} -\usepackage[noembed,prefer2004jis]{pxchfon} % no-embed -%\usepackage[hiragino-pron,prefer2004jis]{pxchfon} % embed Hiragino ProN +% pLaTeX document; UTF-8 (platex -kanji=utf8) +% This file is in public domain. +\documentclass[a6paper,dvipdfmx,papersize,jis2004]{jsarticle} +\usepackage[ipaex]{pxchfon} % embed IPAex fonts +%\usepackage[hiragino-pron]{pxchfon} % embed Hiragino ProN \begin{document} 葛餅で蓬餅で、かつ煎餅! \end{document} diff --git a/macros/jptex/latex/pxchfon/sample/sample-pxchfon.pdf b/macros/jptex/latex/pxchfon/sample/sample-pxchfon.pdf Binary files differindex 38ed09884e..e5d4a966cd 100644 --- a/macros/jptex/latex/pxchfon/sample/sample-pxchfon.pdf +++ b/macros/jptex/latex/pxchfon/sample/sample-pxchfon.pdf diff --git a/macros/jptex/latex/pxchfon/sample/sample-pxchfon.tex b/macros/jptex/latex/pxchfon/sample/sample-pxchfon.tex index 504b1eb411..ed5f8697fc 100644 --- a/macros/jptex/latex/pxchfon/sample/sample-pxchfon.tex +++ b/macros/jptex/latex/pxchfon/sample/sample-pxchfon.tex @@ -1,6 +1,7 @@ -% 文字コードはUTF-8 (platex -kanji=utf8) +% pLaTeX文書; UTF-8 (platex -kanji=utf8) +% This file is in public domain. \documentclass[a4paper]{jsarticle} -\usepackage{pxchfon} +\usepackage[alphabet]{pxchfon}% 欧文にも適用 \setminchofont[0]{hgrgy.ttc} % HG行書体 \setgothicfont[0]{hgrpp1.ttc} % HG創英角ポップ体 \usepackage{otf} @@ -12,7 +13,7 @@ \begin{document} \title{pxchfon パッケージ} \author{ZR} -\date{2009 年 3 月 29 日} +\date{2024 年 8 月 8 日} \maketitle \section{はじめに} @@ -36,20 +37,18 @@ \item 一度インストールすると、それだけで任意の日本語フォントに 適用できる。 \begin{enumerate} - \item しかも和文のみを置き換える場合なら、インストールも簡単。 \item 置き換えるフォントは、{\LaTeX} 文書内でファイル名で 指定する。 + \item とても簡単。 \end{enumerate} \item ただし、等幅のフォントしか利用できない。 \begin{enumerate} \item 欧文も等幅(半角)になってしまう。 - \item しかもアクセント付文字・非英語文字( - {\fontfamily{cmr}\selectfont \'e, \ss} 等)が使えない。 - \item 残念。 + \item とても残念。 \end{enumerate} \item dvipdfmx 専用。 \begin{enumerate} - \item 非常に残念。 + \item チョット残念。 \end{enumerate} \end{enumerate} |