summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-14 03:01:19 +0000
committerNorbert Preining <norbert@preining.info>2024-02-14 03:01:19 +0000
commita90336c3069c198b41b7b6eb76e3389610ad5eb7 (patch)
tree1d39210ab0b0caece02b2322e3fd773db8385982 /macros
parentff59efb1f42e705d74a6d50a1f8dbd7988ccf380 (diff)
CTAN sync 202402140301
Diffstat (limited to 'macros')
-rw-r--r--macros/jptex/latex/jlreq/LICENSE2
-rw-r--r--macros/jptex/latex/jlreq/README-ja.md16
-rw-r--r--macros/jptex/latex/jlreq/README.md9
-rw-r--r--macros/jptex/latex/jlreq/jfm-jlreq.lua127
-rw-r--r--macros/jptex/latex/jlreq/jlreq-helpers.sty2
-rw-r--r--macros/jptex/latex/jlreq/jlreq-ja.pdfbin377536 -> 383391 bytes
-rw-r--r--macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md4
-rw-r--r--macros/jptex/latex/jlreq/jlreq-trimmarks.md4
-rw-r--r--macros/jptex/latex/jlreq/jlreq-trimmarks.sty4
-rw-r--r--macros/jptex/latex/jlreq/jlreq.cls287
-rw-r--r--macros/jptex/latex/jlreq/jlreq.pdfbin121065 -> 121523 bytes
-rw-r--r--macros/jptex/latex/jlreq/luajfm2pl.lua2
-rw-r--r--macros/latex/contrib/exesheet/README.md6
-rw-r--r--macros/latex/contrib/exesheet/exesheet.dtx124
-rw-r--r--macros/latex/contrib/exesheet/exesheet.pdfbin334627 -> 342355 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.dtx47
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-code.pdfbin968305 -> 2326087 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin597386 -> 911886 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex1215
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin612085 -> 941616 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.tex1147
-rw-r--r--macros/latex/contrib/spbmark/spbmark.pdfbin89117 -> 93819 bytes
-rw-r--r--macros/latex/contrib/spbmark/spbmark.sty63
-rw-r--r--macros/latex/contrib/spbmark/spbmark.tex50
-rw-r--r--macros/latex/contrib/verse/verse.dtx8
-rw-r--r--macros/latex/contrib/verse/verse.pdfbin423239 -> 469138 bytes
-rw-r--r--macros/latex/contrib/xfrac/CHANGELOG.md19
-rw-r--r--macros/latex/contrib/xfrac/README.md29
-rw-r--r--macros/latex/contrib/xfrac/xfrac.dtx1146
-rw-r--r--macros/latex/contrib/xfrac/xfrac.ins49
-rw-r--r--macros/latex/contrib/xfrac/xfrac.pdfbin0 -> 658541 bytes
-rw-r--r--macros/unicodetex/latex/emotion/doc/emotion-doc.pdfbin26890 -> 30553 bytes
-rw-r--r--macros/unicodetex/latex/emotion/doc/emotion-doc.tex3
-rw-r--r--macros/unicodetex/latex/emotion/emotion.def2
-rw-r--r--macros/unicodetex/latex/emotion/emotion.lua21
-rw-r--r--macros/unicodetex/latex/emotion/emotion.sty11
-rw-r--r--macros/unicodetex/latex/fontspec/CHANGES.md14
-rw-r--r--macros/unicodetex/latex/fontspec/README.md11
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-api.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-closing.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-enc.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-feat-aat.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-fontload.dtx9
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-graphite.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-interfaces.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx58
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-keyval.dtx130
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-lang.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-load.dtx5
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-math.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx17
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-opening.dtx98
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx17
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-scripts.dtx7
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-user.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-vars.dtx13
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code-xfss.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code.ltx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-code.pdfbin657454 -> 672898 bytes
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-api.tex1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-enc.tex1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-featset.tex166
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-fontsel.tex2
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-intro.tex17
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-luatex.tex1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-opentype.tex1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-doc-xetex.tex22
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec-lua.dtx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec.dtx7
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec.ins4
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec.ltx1
-rw-r--r--macros/unicodetex/latex/fontspec/fontspec.pdfbin606613 -> 578717 bytes
73 files changed, 3430 insertions, 1582 deletions
diff --git a/macros/jptex/latex/jlreq/LICENSE b/macros/jptex/latex/jlreq/LICENSE
index 3cf9a90f88..10fee31031 100644
--- a/macros/jptex/latex/jlreq/LICENSE
+++ b/macros/jptex/latex/jlreq/LICENSE
@@ -1,6 +1,6 @@
(2-clause BSD license)
jlreq and jlreq-trimmarks
-Copyright 2017-2023, Noriyuki Abe.
+Copyright 2017-2024, Noriyuki Abe.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
diff --git a/macros/jptex/latex/jlreq/README-ja.md b/macros/jptex/latex/jlreq/README-ja.md
index 3f458194b7..6d142be200 100644
--- a/macros/jptex/latex/jlreq/README-ja.md
+++ b/macros/jptex/latex/jlreq/README-ja.md
@@ -48,7 +48,7 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内
`\section*[running head]{見出し文字列}[副題]`というように,通常の書式に加えて副題を受け付けられるように拡張されています.その他,`\part`(articleのみ),`\chapter`(book/reportのみ),`\subsection`,`\subsubsection`も副題を受け付けます.
### `abstract`環境
-プリアンブルにもかけるようになっています.プリアンブルに書かれた場合は,`\maketitle`とともに出力されます.二段組の場合は,段組にならず概要を出力することができます.
+プリアンブルにもかけ,そのときは`\maketitle`とともに出力されます.二段組の場合は,段組にならず概要を出力することができます.ただし今では非推奨の方法です.`\jlreqsetup`で`abstract_with_maketitle=true`を指定して`\maketitle`よりも前に書くことで同様のことができます.
### `\sidenote`
この命令は傍注の幅が正の時にのみ定義されます.デフォルトの基本版面ではこの幅は0に設定されています.従って`\sidenote`は定義されません.後の基本版面の設定を参考にしてください.
@@ -204,6 +204,8 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内
* `mainmatter_pagination`に`continuous`と`independent`は指定できません.
* `appendix_pagebreak`,`appendix_pagestyle`,`appendix_pagination`はありません.
+### 概要
+* `abstract_with_maketitle=[true/false]`:abstract環境が`\maketitle`に先行して書かれた場合,その中身を`\maketitle`とともに遅延します.二段組みの場合でも一段で出力されます.デフォルトは`false`です.`article`および`report`時のみ.
## 見出し
新しい見出しを`\New***Heading`という命令で作ることができます(***には見出しの種類に応じた文字列が入る).書式はすべて
@@ -340,7 +342,8 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内
* `nombre=<書式>`:出力するノンブルを指定します.デフォルトは`\thepage`.
* `odd_running_head=<書式>`,`even_running_head=<書式>`:それぞれ奇数ページ,偶数ページの柱を指定します.`_section`のように`_`から始まる名前を指定すると,対応する見出しを出力します.(`_section`だと現在の`\section`を出力する.)
* `mark_format={[odd=<書式>/even=<書式>/_<見出し命令名>=<書式>],...}`:見出しを柱に出力する際のフォーマットを指定します.`mark_format={_section={節\thesection:#1},_chapter={第\thechapter 章\quad #1}}`のように指定します.見出し命令名の代わりに`odd`や`even`も指定でき,それぞれ奇数ページ/偶数ページの柱の書式になります.`\pagestyle`実行時に`\sectionmark`等を定義することで実現しています.
-* `nombre_ii=<書式>`: 二つ目のノンブルを指定します.`nombre_ii_position`で場所指定,`nombre_ii_font`でフォント設定もできます.指定方法は`nombre`や`nombre_position`と同じです.`odd_running_head_ii`,`even_running_head_ii`,`running_head_ii_position`,`running_head_ii_font`もあります.`nombre_ii_position`や`running_head_ii_position`が指定されなかった場合,`yoko`指定時にはそれぞれ`nombre_position`および`running_head_position`と同じ位置に設定されます.`tate`指定時は一つ目のノンブルや柱に続く場所に表示されます.
+* `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`で取得できます.
`\RenewPageStyle`,`\ProvidePageStyle`,`\DeclarePageStyle`もあります.`\ModifyPageStyle`により既存のページスタイルを改変することが可能です.
@@ -576,6 +579,15 @@ JFMの名前は次の通りです.`[]`で囲まれている文字は設定に
- LuaLaTeX利用時の`everyhook'パッケージの利用をやめた(ドキュメントと整合的でなかった).
- `enumerate'環境直前の空白が入らないことがあったのを修正.
- `use_reverse_pagination`に関するバグ修正.
+* 2024-02-13
+ - LaTeXのhookシステムのために\parをいくつか挿入.
+ - `\jlreqsetup`に`tableofcontents_twocolumn`,`abstract_with_maketitle`を追加.
+ - `everyhook`の機能が呼び出されていたのを削除.
+ - jfmを少し修正.
+ - 見出し内で無限ループが出ることがあったのを修正.
+ - LuaLaTeX利用時に`stfloats`を読み込むようにした.
+ - ページスタイル内の位置調整を改善.
+ - そのほかいくつか改善など.
--------------
Noriyuki Abe
diff --git a/macros/jptex/latex/jlreq/README.md b/macros/jptex/latex/jlreq/README.md
index 5747ed263f..aba05f53b8 100644
--- a/macros/jptex/latex/jlreq/README.md
+++ b/macros/jptex/latex/jlreq/README.md
@@ -186,6 +186,15 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS
- Stopped to load `everyhook' package LuaLaTeX (it was not compatible with the document).
- Fixed a bug: a space before `enumerate' environment was not inserted sometimes.
- Fixed a bug on `use_reverse_pagination`.
+* 2024-02-13
+ - Added some `\par` (for hook system in LaTeX kernel)
+ - Added `tableofcontents_twocolumn` and `abstract_with_maketitle` to `\jlreqsetup`.
+ - Deleted `\PushPostHook`.
+ - Some modifications of jfm.
+ - Fixed a bug: heading command may have an infinite loop.
+ - Load `stfloats` with LuaLaTeX.
+ - Improved position adjustment in pagestyle.
+ - Some other improvements etc.
--------------
Noriyuki Abe
diff --git a/macros/jptex/latex/jlreq/jfm-jlreq.lua b/macros/jptex/latex/jlreq/jfm-jlreq.lua
index e2a2e0a68d..958f5f952e 100644
--- a/macros/jptex/latex/jlreq/jfm-jlreq.lua
+++ b/macros/jptex/latex/jlreq/jfm-jlreq.lua
@@ -14,41 +14,6 @@ xkanjiskipは{1,-3},kanjiskip={0,0}
local stretch_width = 0.25 -- 空き第四段階の空き量
-local hyphen_glue = {
- [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
- [2] = {0, 0, 0, kanjiskip_natural = 1},
- [300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
- [4] = {0, 0, 0, kanjiskip_natural = 1},
- [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
- [6] = {0, 0, 0, kanjiskip_natural = 1},
- [7] = {0, 0, 0, kanjiskip_natural = 1},
- [8] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [9] = {0, 0, 0, kanjiskip_natural = 1},
- [10] = {0, 0, 0, kanjiskip_natural = 1},
- [11] = {0, 0, 0, kanjiskip_natural = 1},
- [12] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [13] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [14] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [15] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [16] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [0] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
- [27] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
---[[
- [20] = {0, 0, 0},
- [21] = {0, 0, 0},
- [22] = {0, 0, 0},
- [23] = {0, 0, 0},
- [24] = {0, 0, 0},
- [25] = {0, 0, 0},
- [26] = {0, 0, 0},
- [28] = {0, 0, 0},
- [29] = {0, 0, 0},
- [30] = {0, 0, 0},
-]]
-}
-
local jfm = {
dir = 'yoko',
zw = 1.0,
@@ -68,8 +33,6 @@ local jfm = {
[1] = {0, 0, 0, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -110,8 +73,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
- [301] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
- [302] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
[4] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -148,21 +109,52 @@ local jfm = {
chars = {'‐'},
width = 0.25,height = 0.88,depth = 0.12,
align = 'middle',
- glue = hyphen_glue,-- 上の方で定義
+ glue = {
+ [1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
+ [2] = {0, 0, 0, kanjiskip_natural = 1},
+ [300] = {0, 0, 0, kanjiskip_natural = 1},
+ [4] = {0, 0, 0, kanjiskip_natural = 1},
+ [5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
+ [6] = {0, 0, 0, kanjiskip_natural = 1},
+ [7] = {0, 0, 0, kanjiskip_natural = 1},
+ [8] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [9] = {0, 0, 0, kanjiskip_natural = 1},
+ [10] = {0, 0, 0, kanjiskip_natural = 1},
+ [11] = {0, 0, 0, kanjiskip_natural = 1},
+ [12] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [13] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [14] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [15] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [16] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [0] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+ [27] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
+--[[
+ [20] = {0, 0, 0},
+ [21] = {0, 0, 0},
+ [22] = {0, 0, 0},
+ [23] = {0, 0, 0},
+ [24] = {0, 0, 0},
+ [25] = {0, 0, 0},
+ [26] = {0, 0, 0},
+ [28] = {0, 0, 0},
+ [29] = {0, 0, 0},
+ [30] = {0, 0, 0},
+]]
+ }
},
[301] = {
chars = {'゠', '–'},
width = 0.5,height = 0.88,depth = 0.12,
align = 'middle',
- glue = hyphen_glue,
+ glue = {} -- 後で処理
},
[302] = {
chars = {'〜'},
width = 1,height = 0.88,depth = 0.12,
align = 'middle',
- glue = hyphen_glue,
+ glue = {} -- 後で処理
},
[4] = { -- 区切り約物
@@ -173,8 +165,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, stretch_width, 0.25, ratio = 1, priority = {-1,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -215,8 +205,6 @@ local jfm = {
[1] = {0.25, stretch_width, 0.25, ratio = 0, priority = {-1,-1}, kanjiskip_natural = 1},
[2] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}, kanjiskip_natural = 1},
[300] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}, kanjiskip_natural = 1},
- [301] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}, kanjiskip_natural = 1},
- [302] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}, kanjiskip_natural = 1},
[4] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}, kanjiskip_natural = 1},
[5] = {0.5, 0, 0.5, ratio = 0.5, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0.25, 0, 0.25, ratio = 0, priority = {0,-1}, kanjiskip_natural = 1},
@@ -257,8 +245,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0, ratio = 0, priority = {-1,0}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0.5, 0, 0, ratio = 0, kanjiskip_natural = 1},
- [301] = {0.5, 0, 0, ratio = 0, kanjiskip_natural = 1},
- [302] = {0.5, 0, 0, ratio = 0, kanjiskip_natural = 1},
[4] = {0.5, 0, 0, ratio = 0, kanjiskip_natural = 1},
[5] = {0.75, 0, 0.25, ratio = 0.33333333, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -299,8 +285,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 0, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
- [301] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
- [302] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
[4] = {0.5, 0, 0.5, ratio = 0, priority = {0,-2}, kanjiskip_natural = 1},
[5] = {0.75, 0, 0.75, ratio = 0.33333333, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -340,8 +324,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -380,8 +362,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -420,8 +400,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -460,8 +438,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -500,8 +476,6 @@ local jfm = {
[1] = {0.5, 0, 0.5, ratio = 1, priority = {0,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -540,8 +514,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -580,8 +552,6 @@ local jfm = {
[1] = {0, stretch_width, 0, priority = {-1,0}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -620,8 +590,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -662,8 +630,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -697,10 +663,10 @@ local jfm = {
},
[161] = { -- 半角カナ
- chars = {'ヲ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン'},
+ chars = {'ヲ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン','。', '「', '」', '、', '・', '゙', '゚'},
width = 0.5, height = 0.88, depth = 0.12,
align = 'left',
- glue = {} -- あとで
+ glue = {} -- あとで処理
},
@@ -727,8 +693,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -790,8 +754,6 @@ local jfm = {
[1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
[6] = {0, 0, 0},
@@ -825,8 +787,6 @@ local jfm = {
[1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
[6] = {0, 0, 0},
@@ -860,8 +820,6 @@ local jfm = {
[1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
[6] = {0, 0, 0},
@@ -895,8 +853,6 @@ local jfm = {
[1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
[6] = {0, 0, 0},
@@ -931,8 +887,6 @@ local jfm = {
[1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},
[6] = {0, 0, 0},
@@ -967,8 +921,6 @@ local jfm = {
[1] = {0,5, 0, 0.5, ratio = 1, priority = {0,-2}},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}},-- 注12
[6] = {0, 0, 0},
@@ -1003,8 +955,6 @@ local jfm = {
[1] = {0.5, 0, 0.5, ratio = 1},
[2] = {0, 0, 0},
[300] = {0, 0, 0},
- [301] = {0, 0, 0},
- [302] = {0, 0, 0},
[4] = {0, 0, 0},
[5] = {0.25, 0, 0.25, ratio = 1},
[6] = {0, 0, 0},
@@ -1038,8 +988,6 @@ local jfm = {
[1] = {0.5, stretch_width, 0.5, ratio = 1, priority = {-1,-2}, kanjiskip_natural = 1},
[2] = {0, 0, 0, kanjiskip_natural = 1},
[300] = {0, 0, 0, kanjiskip_natural = 1},
- [301] = {0, 0, 0, kanjiskip_natural = 1},
- [302] = {0, 0, 0, kanjiskip_natural = 1},
[4] = {0, 0, 0, kanjiskip_natural = 1},
[5] = {0.25, 0, 0.25, ratio = 1, priority = {0,-1}, kanjiskip_natural = 1},
[6] = {0, 0, 0, kanjiskip_natural = 1},
@@ -1238,6 +1186,7 @@ copy_jfm(0,191)
copy_jfm(0,192)
copy_jfm(0,193)
copy_jfm(16,161)
-
+copy_jfm(300,301)
+copy_jfm(300,302)
luatexja.jfont.define_jfm(jfm)
diff --git a/macros/jptex/latex/jlreq/jlreq-helpers.sty b/macros/jptex/latex/jlreq/jlreq-helpers.sty
index 76af5d797a..0980d4e397 100644
--- a/macros/jptex/latex/jlreq/jlreq-helpers.sty
+++ b/macros/jptex/latex/jlreq/jlreq-helpers.sty
@@ -1,7 +1,7 @@
% エンジン非依存のマクロ集
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{jlreq-helpers}[2023/06/19 jlreq-helpers]
+\ProvidesPackage{jlreq-helpers}[2024/02/13 jlreq-helpers]
\ExplSyntaxOn
%. helper1
diff --git a/macros/jptex/latex/jlreq/jlreq-ja.pdf b/macros/jptex/latex/jlreq/jlreq-ja.pdf
index 98e0e76019..9cc052ddff 100644
--- a/macros/jptex/latex/jlreq/jlreq-ja.pdf
+++ b/macros/jptex/latex/jlreq/jlreq-ja.pdf
Binary files differ
diff --git a/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md b/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md
index 7524828894..683ba23928 100644
--- a/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md
+++ b/macros/jptex/latex/jlreq/jlreq-trimmarks-ja.md
@@ -41,7 +41,7 @@ dviドライバの指定です.エンジンに`lualatex`を利用する場合
### `trimmarks_paper`
トンボ付きの紙サイズを指定します.
-* `trimmarks_paper=a4`のように,`a0--a10`, `b0--b10`, `c2--c8`(BはJIS B列)を指定できる他,`trimmarks_paper={<width>,<height>}`と直接寸法を指定することができます.
+* `trimmarks_paper=a4paper`のように,`a0paper--a10paper`, `b0paper--b10paper`, `c2paper--c8paper`を指定できる他,`trimmarks_paper={<width>,<height>}`と直接寸法を指定することができます.B列はISO B列です.JIS B列を指定する場合は`b0j--b10j`を指定してください.
* `a4+{1cm,2cm}`や`{10cm,20cm}+{1cm,2cm}`のように`<紙サイズ>+{<寸法横>,<寸法縦>}`とした場合は,指定された紙サイズから指定された寸法だけ増やした紙サイズを設定します.
* `a4+2cm`は`a4+{2cm,2cm}`と等価です.
* `+2cm`と紙サイズの部分を省略すると,現在の紙サイズを利用します.
@@ -189,6 +189,8 @@ dviドライバの指定です.エンジンに`lualatex`を利用する場合
- `trimmarks_pattern`を`\jlreqtrimmarkssetup`に追加.
* 2023-06-19
- 縦書きで読み込み時にエラーが出るバグ修正.
+* 2024-02-13
+ - ドキュメントの間違いを修正.
--------------
Noriyuki Abe
diff --git a/macros/jptex/latex/jlreq/jlreq-trimmarks.md b/macros/jptex/latex/jlreq/jlreq-trimmarks.md
index 315b400311..724969599b 100644
--- a/macros/jptex/latex/jlreq/jlreq-trimmarks.md
+++ b/macros/jptex/latex/jlreq/jlreq-trimmarks.md
@@ -39,7 +39,7 @@ Set the dvi driver. You do not have to specify it when using the engine `lualate
### `trimmarks_paper`
Set the size of the paper including trim marks.
-* `trimmarks_paper=<paper type>`: specify via the paper type. for the paper type, you can use `a0--a10`, `b0--b10` and `c2--c8`. Note that `b0--b10` is `JIS B' (Japanese B-series variant).
+* `trimmarks_paper=<paper type>`: specify via the paper type. For the paper type, you can use `a0paper--a10paper`, `b0paper--b10paper` and `c2paper--c8paper`. Note that `b0--b10` is ISO B. If you wan to specify JIS B (Japanese B-series variant), use `b0j--b10j`.
* `trimmarks_paper={<width>,height>}`: specify via the width and height.
* `trimmarks_paper=<paper size>+{<width>,<height>}` (e.g. `trimmarks_paper=a4+{1cm,2cm}`): `<width>` (resp. `<height>`) is added to the width (resp. height) of the paper size specified by `<paper size>` For `<paper size>`, one can use `<paper type>` or `{<width>,<height>}` as in the above.
* `trimmarks_paper=a4+2cm` is equivalent to `trimmarks_paper=a4+{2cm,2cm}`.
@@ -183,6 +183,8 @@ 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
+ - Fixed a bug in a document.
--------------
Noriyuki Abe
diff --git a/macros/jptex/latex/jlreq/jlreq-trimmarks.sty b/macros/jptex/latex/jlreq/jlreq-trimmarks.sty
index 36f95d6805..ec65cabae9 100644
--- a/macros/jptex/latex/jlreq/jlreq-trimmarks.sty
+++ b/macros/jptex/latex/jlreq/jlreq-trimmarks.sty
@@ -1,7 +1,7 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{jlreq-trimmarks}[2023/06/19 jlreq-trimmarks]
+\ProvidesPackage{jlreq-trimmarks}[2024/02/13 jlreq-trimmarks]
\RequirePackage{l3keys2e}
-\RequirePackage{jlreq-helpers}[2023/06/19]
+\RequirePackage{jlreq-helpers}[2024/02/13]
\ExplSyntaxOn
% check \tombowdatetrue
diff --git a/macros/jptex/latex/jlreq/jlreq.cls b/macros/jptex/latex/jlreq/jlreq.cls
index 1d0d498877..b285102585 100644
--- a/macros/jptex/latex/jlreq/jlreq.cls
+++ b/macros/jptex/latex/jlreq/jlreq.cls
@@ -5,10 +5,10 @@
%%
% (based on JLReq 20200811 https://www.w3.org/TR/2020/NOTE-jlreq-20200811/)
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jlreq}[2023/06/19 jlreq]
+\ProvidesClass{jlreq}[2024/02/13 jlreq]
\RequirePackage{l3keys2e}
\RequirePackage{etoolbox}
-\RequirePackage{jlreq-helpers}[2023/06/19]
+\RequirePackage{jlreq-helpers}[2024/02/13]
\ExplSyntaxOn
\int_new:N \l__jlreq_tmpa_int
@@ -57,9 +57,9 @@
}
% preambleにいるかのスイッチ
-\newif\ifjlreq@preamble
-\jlreq@preambletrue
-\AtBeginDocument{\jlreq@preamblefalse}
+\bool_new:N \g__jlreq_inpreamble_bool
+\bool_gset_true:N \g__jlreq_inpreamble_bool
+\AtBeginDocument{ \bool_gset_false:N \g__jlreq_inpreamble_bool }
\def\jlreq@saveoriginalcs#1{%
\@ifundefined{#1}{
@@ -482,6 +482,7 @@
% http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1508&parent=8435
\if@tate\AtEndPreamble{\par}\fi
\fi
+% \zwや\zhが再定義されても動くようにするために内部では\jlreq@zw,\jlreq@zhを使う.
\let\jlreq@zw=\zw
\let\jlreq@zh=\zh
\if@tate
@@ -529,8 +530,8 @@
% 組方向を判定
% \jlreq@if(y|t)(dir|box)を定義する.
\jlreq@if{\ifx l\jlreq@engine\fi}{
- \def\jlreq@ifydir { \int_compare:nTF { \ltjgetparameter{direction} == 4 } }
- \def\jlreq@iftdir { \int_compare:nTF { (\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8) == 3 } }
+ \def\jlreq@ifydir { \int_compare:nTF { \ltjgetparameter{direction} == 4 } }
+ \def\jlreq@iftdir { \int_compare:nTF { (\ltjgetparameter{direction}-(\ltjgetparameter{direction}/8)*8) == 3 } }
\def\jlreq@ifybox#1{ \int_compare:nTF { \ltjgetparameter{boxdir}{#1} == 4 } }
\def\jlreq@iftbox#1{ \int_compare:nTF { (\ltjgetparameter{boxdir}{#1}-(\ltjgetparameter{boxdir}{#1}/8)*8) == 3 } }
}{
@@ -808,37 +809,14 @@
\edef\jlreq@jafontscale{\strip@pt\jlreq@resultdimen}
\__jlreq_aftercls_addtodeletecs:N \jlreq@jafontscale
\ifx l\jlreq@engine
- \jlreq@saveoriginalcs{DeclareFontShape@}
- \def\DeclareFontShape@#1#2#3#4#5#6{
- \group_begin:
- \bool_if:nT { \str_if_eq_p:nn {#1} {JY3} || \str_if_eq_p:nn {#1} {JT3} } {
- \tl_set:Nx \l__jlreq_tmpa_tl {#5}
- \tl_if_in:NnTF \l__jlreq_tmpa_tl { jfm=jlreq } {
- \tl_if_in:NnTF \l__jlreq_tmpa_tl { jfm=jlreqv }{
- \tl_replace_all:Nnn \l__jlreq_tmpa_tl { jfm=jlreqv } { jfm=jlreqv-jidori }
- }{
- \tl_replace_all:Nnn \l__jlreq_tmpa_tl { jfm=jlreq } { jfm=jlreq-jidori }
- }
- \cs_set:Nx \l_jlreq_do: {
- \exp_not:N \jlreq@useoriginalcs{DeclareFontShape@}
- \exp_not:n { {#1} {#2} {#3} { #4-jidori } }
- { \tl_use:N \l__jlreq_tmpa_tl } { \exp_not:n {#6} }
- }
- }{
- \tl_if_in:NnT \l__jlreq_tmpa_tl {<->ssub} {
- \cs_set:Nn \l_jlreq_do: {
- \jlreq@useoriginalcs{DeclareFontShape@} {#1} {#2} {#3} { #4-jidori } {#5} {#6}
- }
- }
- }
- }
- \exp_after:wN \group_end: \l_jlreq_do:
- \jlreq@useoriginalcs{DeclareFontShape@} {#1} {#2} {#3} {#4} {#5} {#6}
- }
- \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont :jfm=jlreq;script=latn;-kern}{}
- \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont :jfm=jlreq;script=latn;-kern}{}
- \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont :jfm=jlreqv;script=latn;-kern}{}
- \DeclareFontShape{JT3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont :jfm=jlreqv;script=latn;-kern}{}
+ \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont :jfm=jlreq;-kern}{}
+ \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont :jfm=jlreq;-kern}{}
+ \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont :jfm=jlreqv;-kern}{}
+ \DeclareFontShape{JT3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont :jfm=jlreqv;-kern}{}
+ \DeclareFontShape{JY3}{mc}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont :jfm=jlreq-jidori;-kern}{}
+ \DeclareFontShape{JY3}{gt}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont :jfm=jlreq-jidori;-kern}{}
+ \DeclareFontShape{JT3}{mc}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont :jfm=jlreqv-jidori;-kern}{}
+ \DeclareFontShape{JT3}{gt}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont :jfm=jlreqv-jidori;-kern}{}
\else
\DeclareFontShape{\jlreq@yokokanjiencoding}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmname}{}
\DeclareFontShape{\jlreq@yokokanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg}{}
@@ -856,14 +834,17 @@
\clist_map_inline:nn { m,b,bx,sb,c } {% ####1 = series
\bool_if:nF { \str_if_eq_p:nn {##1} {n} && \str_if_eq_p:nn {####1} {m} } {
\DeclareFontShape{#1}{gt}{####1}{##1}{<->ssub*gt/m/n}{}
+ \DeclareFontShape{#1}{gt}{####1}{##1-jidori}{<->ssub*gt/m/n-jidori}{}
}
}
\clist_map_inline:nn { bx,b,sb } {% ####1 = series
\DeclareFontShape{#1}{mc}{####1}{##1}{<->ssub*gt/m/n}{}
+ \DeclareFontShape{#1}{mc}{####1}{##1-jidori}{<->ssub*gt/m/n-jidori}{}
}
\clist_map_inline:nn { m,c } {% ####1 = series
\bool_if:nF { \str_if_eq_p:nn {##1} {n} && \str_if_eq_p:nn {####1} {m} } {
\DeclareFontShape{#1}{mc}{####1}{##1}{<->ssub*mc/m/n}{}
+ \DeclareFontShape{#1}{mc}{####1}{##1-jidori}{<->ssub*mc/m/n-jidori}{}
}
}
}
@@ -1778,7 +1759,7 @@
\keys_set:nn { DeclareTobiraHeading:#1 } {#3}
\def\jlreq@do{}%
\ifx\jlreq@format\@undefined
- \def\jlreq@format##1##2{##1##2}%
+ \long\def\jlreq@format##1##2{##1##2}%
\fi
\edef\jlreq@formatwlabel{\noexpand\jlreq@format{\exp_not:o {\jlreq@label@format}}}%
\jlreq@heading@make@l@{#1}{#2}{\jlreq@label@format}%
@@ -2082,6 +2063,7 @@
\jlreq@ifempty{#2}{}{\unexpanded{\hsize=\dimexpr\hsize - #2\relax}}%
\jlreq@ifempty{#3}{}{\unexpanded{\hsize=\dimexpr\hsize - #3\relax}}%
\unexpanded{#4}%
+ \noexpand\par
}%
}%
}
@@ -2129,7 +2111,7 @@
% {1 = 前空き}{2 = 後ろ空き}{3 = トータル行数}{4 = 出力}
% 最後には\nobreak(と\vskip)が入っている
\long\def\jlreq@BlockHeading@start@gyodori#1#2#3#4{\par{%
- \setbox\jlreq@tempboxa=\vbox{#4}%
+ \setbox\jlreq@tempboxa=\vbox{#4\par}%
% \jlreq@tempskip(a/b)に前/後ろに入れるべき値を入れる
% #1がa:ならばその値は\jlreq@tempskipaには足さず\jlreq@tempskipcに入れておく
\jlreq@tempskipa=0pt
@@ -2226,8 +2208,8 @@
}%
\expandafter}\jlreq@do
}
-\cs_set:Nn \g__jlreq_gyodori_hook_par: {}
-\PushPostHook{par}{\g__jlreq_gyodori_hook_par:}
+%\cs_set:Nn \g__jlreq_gyodori_hook_par: {}
+%\PushPostHook{par}{\g__jlreq_gyodori_hook_par:}
% 行取り情報をゲットだぜ
@@ -2455,7 +2437,7 @@
\exp_not:o {\jlreq@heading@text@format}%
}%
% 副題:ラベルありかなしかはhangindentの扱いだけなので,他はまとめる
- \def\jlreq@make@subtitle@format##1##2{%
+ \long\def\jlreq@make@subtitle@format##1##2{%
\edef##1{%
\ifjlreq@subtitle@break
\noexpand\par
@@ -2838,7 +2820,7 @@
\jlreq@do
}
% #2: デフォルト値を使うならば*,#3#4#5が設定された値,#6#7#8がデフォルト値,#9は偶数ページの
-\def\jlreq@BlockHeading@spaces@output@@@@#1#2#3#4#5#6#7#8#9{%
+\long\def\jlreq@BlockHeading@spaces@output@@@@#1#2#3#4#5#6#7#8#9{%
\edef\jlreq@tempa{%
\unexpanded{\long\def\jlreq@tempa##1}{\exp_args:Nc \exp_not:o {jlreq@BlockHeading@spaces@current@format@\the\jlreq@tempcnta}}%
}%
@@ -2910,10 +2892,10 @@
\begingroup
\def\jlreq@do{\@nobreakfalse\global\@noskipsectrue}%
\ifnum0\jlreq@ifempty{#3}{}{1}\ifnum #2>\c@secnumdepth 1\fi>0
- \def\jlreq@tempa##1{#8}%
+ \long\def\jlreq@tempa##1{#8}%
\else
\tl_put_right:Nn \jlreq@do {\refstepcounter{#1}}%
- \def\jlreq@tempa##1{#7}%
+ \long\def\jlreq@tempa##1{#7}%
\fi
\par}%
\unexpanded{\tl_put_right:Nx \jlreq@do}{%
@@ -3366,6 +3348,7 @@
\ifx l\jlreq@engine
\fnfixbottomtrue
+ \IfFileExists{stfloats.sty}{\RequirePackage{stfloats}\fnbelowfloat}{}
\fi
% \footnoteと\footnotemarkの前後に\jlreq@hook@prenote/\jlreq@hook@postnoteを入れる
@@ -3377,7 +3360,7 @@
\def\footnote{%
\jlreq@footnote{\footnote}{\footnotemark}{\jlreq@footnotetext@for@footnote}%
}
-\def\jlreq@footnote#1#2#3{%
+\long\def\jlreq@footnote#1#2#3{%
\jlreq@hook@prenote
\@ifnextchar[{\jlreq@footnote@impl@woption{#1}{#2}{#3}}{\jlreq@footnote@impl@wooption{#1}{#2}{#3}}%
}
@@ -3602,6 +3585,8 @@
\long\def\jlreq@output@endnotes#1#2{%
\expandafter\def\csname\jlreq@endnotemarkname\endcsname{#1}%
\item\@makeendtext{#2}%
+ % グルーピングした方がよいか? https://okumuralab.org/tex/mod/forum/discuss.php?d=3669
+ % \item\leavevmode {\@makeendtext{#2}}%
}
\newcommand*{\theendnotes}{%
@@ -4009,7 +3994,7 @@
% * それ以降はX
% として整形した際に,#5行以内に収まる.
% \jlreq@resultboxに整形結果を返す(垂直ボックス).見つからなかったらvoid.\globalに設定する.
-\def\jlreq@inlinenote@determinelength#1#2#3#4#5#6#7{%
+\long\def\jlreq@inlinenote@determinelength#1#2#3#4#5#6#7{%
\begingroup
% \message{#1 の試行開始,行数 = #5, \the\dimexpr#6\relax から \the\dimexpr#7\relaxまで}%
\@tempcnta=1\relax
@@ -4200,7 +4185,7 @@
}
}
-\cs_generate_variant:Nn \__jlreq_pagestyle_applyformat:NnNN { NocN }
+\cs_generate_variant:Nn \__jlreq_pagestyle_applyformat:NnNN { NocN, NoNN }
% mark系の処理をする.
% #2: 奇数ページ柱(prop,{0,1,2}->柱の中身)
@@ -4347,9 +4332,7 @@
\tl_set:Nx \l__jlreq_tmpb_tl { \exp_args:No \exp_not:n {\use_ii:nn ##1} } % 中身
\tl_put_right:Nx \l__jlreq_result_tl {
\exp_not:N \hbox to~0pt {
- \exp_not:n {\hskip\glueexpr\headsep + \headheight}
- \legacy_if:nF { @tate } { \exp_not:n {+ \topskip - \Cht} }
- \tl_if_empty:oF \l__jlreq_tmpa_tl { + \exp_not:o \l__jlreq_tmpa_tl } \exp_not:N \relax
+ \tl_if_empty:oF \l__jlreq_tmpa_tl { \exp_not:n { \hskip\dimexpr } \exp_not:o \l__jlreq_tmpa_tl \exp_not:N \relax }
\exp_not:o \l__jlreq_tmpb_tl
\exp_not:N \hss
}
@@ -4586,51 +4569,52 @@
%#3: 左
%#4: 真ん中
%#5: 右
+% #6: フォーマット,#7: デフォルトフォーマット
% #1に返す.
-\cs_set:Nn \__jlreq_pagestyle_concat_left_center_right:Nnnnn {
+\cs_set:Nn \__jlreq_pagestyle_concat_left_center_right:NnnnnNN {
\str_if_eq:nnTF {#2} {odd} {
- \__jlreq_pagestyle_concat_left_center_right_aux:Nnnn #1 {#3} {#4} {#5}
+ \__jlreq_pagestyle_concat_left_center_right_aux:NnnnNN #1 {#3} {#4} {#5} #6 #7
}{
% evenでは左右入れ替え
- \__jlreq_pagestyle_concat_left_center_right_aux:Nnnn #1 {#5} {#4} {#3}
+ \__jlreq_pagestyle_concat_left_center_right_aux:NnnnNN #1 {#5} {#4} {#3} #6 #7
}
}
-\cs_generate_variant:Nn \__jlreq_pagestyle_concat_left_center_right:Nnnnn { Nneee }
+\cs_generate_variant:Nn \__jlreq_pagestyle_concat_left_center_right:NnnnnNN { NneeecN }
% #2: 左,#3: 真ん中,#4: 右をくっつける
+% #5: フォーマット,#6: デフォルトフォーマット
% #1に返す
-\cs_set:Nn \__jlreq_pagestyle_concat_left_center_right_aux:Nnnn {
+\cs_set:Nn \__jlreq_pagestyle_concat_left_center_right_aux:NnnnNN {
\group_begin:
- \tl_set:Nn \l__jlreq_tmpa_tl {} % 左
- \tl_set:Nn \l__jlreq_tmpb_tl {} % 右
- \tl_set:Nn \l__jlreq_tmpc_tl {} % 戻り値
+ % \l__jlreq_tmpa_tlにくっつけたモノを入れる
+ \tl_if_empty:nTF {#3} {
+ \bool_if:nF { \tl_if_empty_p:n {#2} && \tl_if_empty_p:n {#4} } {
+ \tl_set:Nn \l__jlreq_tmpa_tl { #2 \hfill #4 }
+ }
+ }{
+ % 真ん中のを完全に真ん中に配置するために左右の幅を0にしておく
+ \tl_set:Nx \l__jlreq_tmpa_tl {
+ \tl_if_empty:nF { #2 } { \exp_not:n { \hbox to~0pt { #2 \hss } } }
+ \exp_not:N \hfill \exp_not:n {#3} \exp_not:N \hfill
+ \tl_if_empty:nF { #4 } { \exp_not:n { \hbox to~0pt { \hss #4 } } }
+ }
+ }
+ % \l__jlreq_tmpa_tlにフォーマットを適用し\l__jlreq_tmpa_tlに代入
+ \__jlreq_pagestyle_applyformat:NoNN \l__jlreq_tmpa_tl \l__jlreq_tmpa_tl #5 #6
+ % 横方向の調整
\tl_if_empty:nF {#2} {
\bool_if:nT { ( !\dim_compare_p:nNn {\jlreq@headfoot@sidemargin}={0pt} ) || \legacy_if_p:n {@tate} }{
- \tl_set:Nx \l__jlreq_tmpa_tl { \exp_not:n {\hskip\dimexpr} \jlreq@expand@speciallength{\jlreq@headfoot@sidemargin} \legacy_if:nT { @tate } { \exp_not:n { -\Cdp } } \exp_not:N \relax }
+ \tl_put_left:Nx \l__jlreq_tmpa_tl { \exp_not:n {\hskip\dimexpr} \jlreq@expand@speciallength{\jlreq@headfoot@sidemargin} \legacy_if:nT { @tate } { \exp_not:n { -\Cdp } } \exp_not:N \relax }
}
- \tl_put_right:Nn \l__jlreq_tmpa_tl {#2}
}
\tl_if_empty:nF {#4} {
- \tl_set:Nn \l__jlreq_tmpb_tl {#4}
% \jlreq@headfoot@sidemargin = 0ptの時に本文の右に一致させるための補正.
\bool_if:nT { ( !\dim_compare_p:nNn {\jlreq@headfoot@sidemargin}={0pt} ) || \legacy_if_p:n {@tate} }{
- \tl_put_right:Nx \l__jlreq_tmpb_tl { \exp_not:n {\hskip\dimexpr} \jlreq@expand@speciallength{\jlreq@headfoot@sidemargin} \legacy_if:nT { @tate } { \exp_not:n { + \topskip - \Cht } } \exp_not:N \relax }
+ \tl_put_right:Nx \l__jlreq_tmpa_tl { \exp_not:n {\hskip\dimexpr} \jlreq@expand@speciallength{\jlreq@headfoot@sidemargin} \legacy_if:nT { @tate } { \exp_not:n { + \topskip - \Cht } } \exp_not:N \relax }
}
}
- \tl_if_empty:nTF {#3} {
- \bool_if:nF { \tl_if_empty_p:n {#2} && \tl_if_empty_p:n {#4} } {
- \tl_set:Nx \l__jlreq_tmpc_tl { \exp_not:o \l__jlreq_tmpa_tl \exp_not:N \hfil \exp_not:o \l__jlreq_tmpb_tl }
- }
- }{
- % 真ん中のを完全に真ん中に配置するために左右の幅を0にしておく
- \tl_if_empty:nF { #2 } { \tl_set:Nx \l__jlreq_tmpa_tl { \exp_not:N \hbox to~0pt { \exp_not:o { \l__jlreq_tmpa_tl } \exp_not:N \hss } } }
- \tl_if_empty:nF { #4 } { \tl_set:Nx \l__jlreq_tmpb_tl { \exp_not:N \hbox to~0pt { \exp_not:N \hss \exp_not:o { \l__jlreq_tmpb_tl } } } }
- \tl_set:Nx \l__jlreq_tmpc_tl {
- \exp_not:o \l__jlreq_tmpa_tl\exp_not:N \hfil \exp_not:n {#3} \exp_not:N \hfil \exp_not:o \l__jlreq_tmpb_tl
- }
- }
- \tl_set:Nx \l__jlreq_do_tl { \exp_not:n {\tl_set:Nn #1 } { \exp_not:o \l__jlreq_tmpc_tl } }
+ \tl_set:Nx \l__jlreq_do_tl { \exp_not:n {\tl_set:Nn #1 } { \exp_not:o \l__jlreq_tmpa_tl } }
\exp_after:wN \group_end:
\l__jlreq_do_tl
}
@@ -4885,16 +4869,24 @@
% ノンブル→\l__jlreq_tmpb_tl
\__jlreq_pagestyle_maketate_nombre:NNNNo \l__jlreq_tmpb_tl \l__jlreq_pagestyle_nombre_prop \l__jlreq_pagestyle_nombre_font_prop \l__jlreq_pagestyle_nombre_position_prop \l__jlreq_pagestyle_nombre_gap_tl
% 柱とノンブルを結合→\l__jlreq_tmpa_tl
- \tl_set:Nx \l__jlreq_tmpa_tl { \exp_not:o \l__jlreq_tmpa_tl \exp_not:N \hfil \exp_not:o \l__jlreq_tmpb_tl }
+ \tl_set:Nx \l__jlreq_tmpa_tl { \exp_not:o \l__jlreq_tmpa_tl \exp_not:N \hfill \exp_not:o \l__jlreq_tmpb_tl }
% formatを適用.
\tl_set:Nn \l__jlreq_tmpb_tl {####1} % デフォルトフォーマット
\__jlreq_pagestyle_applyformat:NocN \l__jlreq_tmpa_tl \l__jlreq_tmpa_tl { l__jlreq_pagestyle_##1_top_format_tl } \l__jlreq_tmpb_tl
% 周りのボックスをつける.結果は\l__jlreq_tmpa_propにいれる.
+ % \topskip > 最初のボックスの高さを仮定する.
\prop_put:Nnx \l__jlreq_tmpa_prop { ##1-top } {
\exp_not:n {\setbox\@tempboxa=\hbox to \dimexpr\headsep + \headheight + \textheight}
- \legacy_if:nF { @tate } { \exp_not:n { - \topskip + 1\jlreq@zh } }
+ \legacy_if:nF { @tate } { \exp_not:n { + \Cdp } }
\exp_not:N \relax
- { \exp_not:n { \tate\adjustbaseline } \exp_not:o \l__jlreq_tmpa_tl }
+ { \exp_not:n { \tate\adjustbaseline \hskip \dimexpr \headsep + \headheight }
+ \legacy_if:nF { @tate } { \exp_not:n { + \topskip - \Cht } }
+ \exp_not:N \relax
+ \hbox to \legacy_if:nF { @tate } { \exp_not:N \dimexpr }
+ \textheight
+ \legacy_if:nF { @tate } { \exp_not:n { - \topskip + 1\jlreq@zh \relax } }
+ { \exp_not:o \l__jlreq_tmpa_tl }
+ }
% Underful対策
\ifx l\jlreq@engine
\unexpanded{\wd\@tempboxa=\headheight}%
@@ -4905,13 +4897,17 @@
}
% 位置調整,左側に柱+ノンブルがある場合
\tl_set:Nx \l__jlreq_tmpa_tl {
- \exp_not:n { \hskip\dimexpr } \legacy_if:nT { @tate } { \exp_not:n { - \Cdp } } \exp_not:n { - \headsep - 1\jlreq@zw\relax }
- \exp_not:n { \box\@tempboxa\hfil }
+ \exp_not:n { \hskip\dimexpr - \headsep - 1\jlreq@zw }
+ \legacy_if:nTF { @tate } { \exp_not:n { - \Cdp } }
+ { \dim_compare:nNnF { \jlreq@sidenote@length + \jlreq@sidenote@sep } {=} { 0pt } { - \the\dimexpr\jlreq@sidenote@length + \jlreq@sidenote@sep\relax } }
+ \exp_not:n { \relax\box\@tempboxa\hfill }
}
% 位置調整,右側に柱+ノンブルがある場合
\tl_set:Nx \l__jlreq_tmpb_tl {
- \exp_not:n { \hskip\dimexpr\textwidth } \legacy_if:nT { @tate } { \exp_not:n { - \topskip + \Cht } } \exp_not:n { + \headsep\relax }
- \exp_not:n { \box\@tempboxa\hss }
+ \exp_not:n { \hskip\dimexpr\textwidth + \headsep }
+ \legacy_if:nTF { @tate } { \exp_not:n { - \topskip + \Cht } }
+ { \dim_compare:nNnF { \jlreq@sidenote@length + \jlreq@sidenote@sep } {=} { 0pt } { + \the\dimexpr\jlreq@sidenote@length + \jlreq@sidenote@sep\relax } }
+ \exp_not:n { \relax\box\@tempboxa\hss }
}
% 位置調整とすでに構築したブロックをくっつける.
\legacy_if:nTF { @tate } {
@@ -4978,14 +4974,13 @@
\prop_put:Nno \l__jlreq_tmpb_prop {########1} \l__jlreq_tmpa_tl
}
% 左,中央,右を結合し\l__jlreq_tmpa_tlへ
- \__jlreq_pagestyle_concat_left_center_right:Nneee \l__jlreq_tmpa_tl {##1} {\prop_item:Nn \l__jlreq_tmpb_prop {left} } {\prop_item:Nn \l__jlreq_tmpb_prop {center} } {\prop_item:Nn \l__jlreq_tmpb_prop {right} }
% デフォルトのフォーマットの設定
\bool_if:nTF { \dim_compare_p:n { \jlreq@sidenote@length > 0pt } && (! \legacy_if_p:n { @tate } ) }{
\tl_set:Nn \l__jlreq_tmpb_tl {\hss\hbox to \jlreqyokoheadlength{########1}\hss}
}{
\tl_set:Nn \l__jlreq_tmpb_tl {########1}
}
- \__jlreq_pagestyle_applyformat:NocN \l__jlreq_tmpa_tl \l__jlreq_tmpa_tl { l__jlreq_pagestyle_##1_####1_format_tl } \l__jlreq_tmpb_tl
+ \__jlreq_pagestyle_concat_left_center_right:NneeecN \l__jlreq_tmpa_tl {##1} {\prop_item:Nn \l__jlreq_tmpb_prop {left} } {\prop_item:Nn \l__jlreq_tmpb_prop {center} } {\prop_item:Nn \l__jlreq_tmpb_prop {right} } { l__jlreq_pagestyle_##1_####1_format_tl } \l__jlreq_tmpb_tl
% 傍注用調整
\dim_compare:nNnT {\jlreq@sidenote@length}>{0pt} {
\legacy_if:nF { @tate } {
@@ -5029,7 +5024,7 @@
}
\if@tate
- \def\jlreqyokoheadlength{\textheight}
+ \def\jlreqyokoheadlength{\textwidth}
\else
\ifdim\jlreq@sidenote@length>0pt
\if@twocolumn
@@ -5041,7 +5036,7 @@
\def\jlreqyokoheadlength{\dimexpr\textwidth\relax}
\fi
\fi
-\edef\jlreqtateheadlength{\unexpanded{\dimexpr\headsep + \headheight + \textheight}\if@tate\else\unexpanded{- \topskip + 1\jlreq@zh}\fi\noexpand\relax}
+\edef\jlreqtateheadlength{\unexpanded{\dimexpr\textheight}\if@tate\else\unexpanded{- \topskip + 1\jlreq@zh}\fi\noexpand\relax}
\NewDocumentCommand{\NewPageStyle} { m +m } {%
\expandafter\@ifdefinable\csname ps@#1\endcsname{\DeclarePageStyle{#1}{#2}}%
@@ -5258,11 +5253,20 @@
%.. figure環境
\newcounter{figure}
-\str_if_eq:VnTF \jlreq@article@type { article } {
- \renewcommand{\thefigure}{\@arabic\c@figure}
-}{%
- \@addtoreset{figure}{chapter}
- \renewcommand{\thefigure}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@figure}
+\legacy_if:nTF { @tate } {
+ \str_if_eq:VnTF \jlreq@article@type { article } {
+ \renewcommand{\thefigure}{\tatechuyoko*{\@arabic\c@figure}}
+ }{%
+ \@addtoreset{table}{chapter}
+ \renewcommand{\thefigure}{\tatechuyoko*{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@figure}}
+ }
+}{
+ \str_if_eq:VnTF \jlreq@article@type { article } {
+ \renewcommand{\thefigure}{\@arabic\c@figure}
+ }{%
+ \@addtoreset{figure}{chapter}
+ \renewcommand{\thefigure}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@figure}
+ }
}
\newcommand*{\fps@figure}{h}
\newcommand*{\ftype@figure}{1}
@@ -5273,11 +5277,20 @@
%.. table環境
\newcounter{table}
-\str_if_eq:VnTF \jlreq@article@type { article } {
- \renewcommand{\thetable}{\@arabic\c@table}
-}{%
- \@addtoreset{table}{chapter}
- \renewcommand{\thetable}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@table}
+\legacy_if:nTF { @tate } {
+ \str_if_eq:VnTF \jlreq@article@type { article } {
+ \renewcommand{\thetable}{\tatechuyoko*{\@arabic\c@table}}
+ }{%
+ \@addtoreset{table}{chapter}
+ \renewcommand{\thetable}{\tatechuyoko*{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@table}}
+ }
+}{
+ \str_if_eq:VnTF \jlreq@article@type { article } {
+ \renewcommand{\thetable}{\@arabic\c@table}
+ }{%
+ \@addtoreset{table}{chapter}
+ \renewcommand{\thetable}{\ifnum\c@chapter>\z@\thechapter.\fi \@arabic\c@table}
+ }
}
\newcommand*{\fps@table}{h}
\newcommand*{\ftype@table}{2}
@@ -5302,6 +5315,9 @@
\fi
}
+\bool_new:N \g__jlreq_beforemaketitle_bool
+\bool_gset_true:N \g__jlreq_beforemaketitle_bool
+
\if@titlepage
\newcommand{\maketitle}{%
% jarticleとかからあまり変更していない
@@ -5379,6 +5395,7 @@
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
+ \bool_gset_false:N \g__jlreq_beforemaketitle_bool
}%
% \vskipを\baselineskipにしてみた.
\def\@maketitle{%
@@ -5410,8 +5427,11 @@
}
%.. abstract
-\def\jlreq@parhook@abstract{}
\str_if_eq:VnF \jlreq@article@type { book } {
+ \def\jlreq@parhook@abstract{}
+ \bool_new:N \g__jlreq_abstract_with_maketitle_bool
+ \keys_define:nn { jlreqsetup } { abstract_with_maketitle .bool_set:N = \g__jlreq_abstract_with_maketitle_bool }
+ \jlreqsetup { abstract_with_maketitle = false }
\newbox\jlreq@abstractbox
\newcommand*{\abstractname}{概要}
\if@titlepage
@@ -5430,21 +5450,25 @@
}
\else
\newenvironment{abstract}{%
- \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0
- \ifjlreq@preamble
+ \bool_if:nTF {
+ (! \legacy_if_p:n { @twocolumn } ) ||
+ \g__jlreq_inpreamble_bool ||
+ ( \g__jlreq_beforemaketitle_bool && \g__jlreq_abstract_with_maketitle_bool )
+ } {
+ \bool_if:NT \g__jlreq_inpreamble_bool {
\ifx l\jlreq@engine\else
\def\jlreq@parhook@abstract{\futurelet\jlreq@nextchar\jlreq@openbracket@hook}%
\PushPostHook{par}{\jlreq@parhook@abstract}%
\fi
- \fi
+ }
% とりあえず全部ボックスに入れる.
\global\setbox\jlreq@abstractbox=\vtop\bgroup
- \ifjlreq@preamble
+ \bool_if:NT \g__jlreq_inpreamble_bool {
% preamble後っぽく振る舞う
\@noskipsecfalse
% \@nodocumentが入っているので一時的に無効化
\everypar{}%
- \fi
+ }
\if@twocolumn
\parindent=0pt
\hsize=\textwidth
@@ -5474,11 +5498,15 @@
\parsep\z@ \@plus.1\jlreq@zh
}%
\item\relax
- \else
+ }{
\section*{\abstractname}%
- \fi
+ }
}{%
- \ifnum0\if@twocolumn\else1\fi\ifjlreq@preamble1\fi>0
+ \bool_if:nT {
+ (! \legacy_if_p:n { @twocolumn } ) ||
+ \g__jlreq_inpreamble_bool ||
+ ( \g__jlreq_beforemaketitle_bool && \g__jlreq_abstract_with_maketitle_bool )
+ } {
\endlist
\egroup
\vspace{\baselineskip}%
@@ -5486,14 +5514,18 @@
\end{minipage}
\fi
\egroup
- \fi
- \ifjlreq@preamble
+ }
+ \bool_if:NT \g__jlreq_inpreamble_bool {
\ifx l\jlreq@engine\else
\def\jlreq@parhook@abstract{}%
\fi
- \else
+ }
+ \bool_if:nF {
+ \g__jlreq_inpreamble_bool ||
+ ( \g__jlreq_beforemaketitle_bool && \g__jlreq_abstract_with_maketitle_bool )
+ }{
\unvbox\jlreq@abstractbox
- \fi
+ }
}
\fi
}
@@ -5580,7 +5612,7 @@
itemization_beforeafter_space .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@beforeafter@space@envlist}{jlreq@itemization@beforeafter@space@setting}{#1}},
itemization_itemsep .code:n = {\jlreq@jlreqsetup@withenv{jlreq@itemization@itemsep@envlist}{jlreq@itemization@itemsep@setting}{#1}},
itemization_labelsep .code:n = {\jlreq@jlreqsetup@withenv{jlreq@itemization@labelsep@envlist}{jlreq@itemization@labelsep@setting}{#1}},
- itemization_label_length .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@label@length@envlist}{jlreq@itemization@label@length@setting}{#1}}
+ itemization_label_length .code:n = {\jlreq@jlreqsetup@itemization{jlreq@itemization@label@length@envlist}{jlreq@itemization@label@length@setting}{#1}},
}
% enumerate, itemize用初期化,#1 = i,ii,...
\def\jlreq@init@list#1{%
@@ -5725,25 +5757,37 @@
\newcommand{\tableofcontents}{%
\jlreq@top@contents=-100\relax
\if@twocolumn
- \@restonecoltrue\onecolumn
+ \bool_if:NTF \g__jlreq_tableofcontents_twocolumn_bool {
+ \@restonecolfalse
+ }{
+ \@restonecoltrue\onecolumn
+ }
\else
- \@restonecolfalse
+ % スイッチの流用
+ \bool_if:NTF \g__jlreq_tableofcontents_twocolumn_bool {
+ \@restonecoltrue\twocolumn
+ }{
+ \@restonecolfalse
+ }
\fi
\prop_item:Nn \g__jlreq_tableofcontents_prop { heading }
\@mkboth{\contentsname}{\contentsname}%
\@starttoc{toc}%
- \if@restonecol\twocolumn\fi
+ \if@restonecol
+ \bool_if:NTF \g__jlreq_tableofcontents_twocolumn_bool { \onecolumn } { \twocolumn }
+ \fi
}
+\bool_new:N \g__jlreq_tableofcontents_twocolumn_bool
+\bool_gset_false:N \g__jlreq_tableofcontents_twocolumn_bool
\keys_define:nn { jlreqsetup } {
- tableofcontents_heading .code:n = { \prop_gput:Nnn \g__jlreq_tableofcontents_prop { heading } {#1} }
+ tableofcontents_heading .code:n = { \prop_gput:Nnn \g__jlreq_tableofcontents_prop { heading } {#1} },
+ tableofcontents_twocolumn .bool_gset:N = \g__jlreq_tableofcontents_twocolumn_bool
}
\str_if_eq:VnTF \jlreq@article@type { article } {
\keys_set:nn { jlreqsetup } { tableofcontents_heading = { \section*{\contentsname} } }
}{
\keys_set:nn { jlreqsetup } { tableofcontents_heading = { \chapter*{\contentsname} } }
}
-
-
% JIS X 4051自身の目次に近づけようかと……なりきれてないけど.
% 文字の大きさは全て同じ(\normalsize)にする.
@@ -5753,8 +5797,8 @@
% 「トップ」というか,一番最初に現れた見出しを入れる.
% リーダーは.から・に変更しました.
\def\@dottedtocline#1#2#3#4#5{%
- \jlreq@set@top@contents{#1}%
\ifnum #1>\c@tocdepth \else
+ \jlreq@set@top@contents{#1}%
\vskip\toclineskip
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
@@ -5772,7 +5816,8 @@
\hfill\nobreak
\hb@xt@\@pnumwidth{\hss\normalfont\normalcolor #5}%
\par}%
- \fi}
+ \fi
+}
% listoffigures
\newcommand{\listoffigures}{%
@@ -6194,7 +6239,6 @@
\hbox_to_wd:nn {##1} {
\def#1 { }
\kanjishape{n-jidori}\selectfont
- \def\kanjishape####1{\jlreq@useoriginalcs{kanjishape}{####1-jidori}}
##2
\hskip\glueexpr 0pt~minus~1fil\relax
}
@@ -6317,7 +6361,6 @@
\renewcommand{\theparagraph}{\thesubsubsection .\arabic{paragraph}}
\renewcommand{\thesubparagraph}{\theparagraph .\arabic{subparagraph}}
\str_if_eq:VnTF \jlreq@article@type { article } {
-\def\X{}
\NewBlockHeading{part}{0}{font={\jlreq@keepbaselineskip{\LARGE\sffamily\gtfamily\bfseries}},label_format={第\thepart 部},lines=4,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},subtitle_font={\jlreq@keepbaselineskip{\large}}}
\renewcommand{\thesection}{\arabic{section}}
}{% book, report
diff --git a/macros/jptex/latex/jlreq/jlreq.pdf b/macros/jptex/latex/jlreq/jlreq.pdf
index f07e3d6920..522e67dee5 100644
--- a/macros/jptex/latex/jlreq/jlreq.pdf
+++ b/macros/jptex/latex/jlreq/jlreq.pdf
Binary files differ
diff --git a/macros/jptex/latex/jlreq/luajfm2pl.lua b/macros/jptex/latex/jlreq/luajfm2pl.lua
index bccba0cb3d..626e91853a 100644
--- a/macros/jptex/latex/jlreq/luajfm2pl.lua
+++ b/macros/jptex/latex/jlreq/luajfm2pl.lua
@@ -1,6 +1,6 @@
kpse.set_program_name("texlua","lualatex")
-no_jis_chars = {'⦅','〘','〖','«','〝','⦆','〙','〗','»','〟','‼','⁇','⁈','⁉','〳','〴','〵','〻','ゕ','ゖ','ㇰ','ㇱ','ㇲ','ㇳ','ㇴ','ㇵ','ㇶ','ㇷ','ㇸ','ㇹ','ㇺ','ㇻ','ㇼ','ㇽ','ㇾ','ㇿ','ㇷ゚','€','№','㏋','ℓ','㌃','㌍','㌔','㌘','㌢','㌣','㌦','㌧','㌫','㌶','㌻','㍉','㍊','㍍','㍑','㍗','㎎','㎏','㎜','㎝','㎞','㎡','㏄','ゔ','か゚','き゚','く゚','け゚','こ゚','ヷ','ヸ','ヹ','ヺ','カ゚','キ゚','ク゚','ケ゚','コ゚','セ゚','ツ゚','ト゚','゠','–','ヲ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン'}
+no_jis_chars = {'⦅','〘','〖','«','〝','⦆','〙','〗','»','〟','‼','⁇','⁈','⁉','〳','〴','〵','〻','ゕ','ゖ','ㇰ','ㇱ','ㇲ','ㇳ','ㇴ','ㇵ','ㇶ','ㇷ','ㇸ','ㇹ','ㇺ','ㇻ','ㇼ','ㇽ','ㇾ','ㇿ','ㇷ゚','€','№','㏋','ℓ','㌃','㌍','㌔','㌘','㌢','㌣','㌦','㌧','㌫','㌶','㌻','㍉','㍊','㍍','㍑','㍗','㎎','㎏','㎜','㎝','㎞','㎡','㏄','ゔ','か゚','き゚','く゚','け゚','こ゚','ヷ','ヸ','ヹ','ヺ','カ゚','キ゚','ク゚','ケ゚','コ゚','セ゚','ツ゚','ト゚','゠','–','ヲ', 'ァ', 'ィ', 'ゥ', 'ェ', 'ォ', 'ャ', 'ュ', 'ョ', 'ッ', 'ー', 'ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ヤ', 'ユ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ワ', 'ン','。', '「', '」', '、', '・', '゙', '゚'}
if arg[1] == nil then
print('Usage: texlua luajfm2pl.lua [--noutf] <JFM for LuaTeX-ja> [<PL file name>]')
diff --git a/macros/latex/contrib/exesheet/README.md b/macros/latex/contrib/exesheet/README.md
index 1c56562c44..cd802580ef 100644
--- a/macros/latex/contrib/exesheet/README.md
+++ b/macros/latex/contrib/exesheet/README.md
@@ -8,15 +8,15 @@ The primary advantage of exesheet is its ability to display
a detailed scoring guide and correction instructions as needed.
This feature is especially beneficial for grading papers with multiple graders.
-Additionally, the exesheet class loads the schooldocs package
-which manages the page layout, the main title, headers and footers.
-
The exesheet package offers the following features:
- macros for organizing exercises and subparts,
- specific settings for enumeration lists,
- environments for questions and answers, which can be displayed or hidden,
- macros for detailed comments and grading instructions in the margins which can be displayed or hidden.
+Additionally, the exesheet class loads the schooldocs package
+which manages the page layout, the main title, headers and footers.
+
## Installation
diff --git a/macros/latex/contrib/exesheet/exesheet.dtx b/macros/latex/contrib/exesheet/exesheet.dtx
index 02a8f5e68c..d3c92b9ef3 100644
--- a/macros/latex/contrib/exesheet/exesheet.dtx
+++ b/macros/latex/contrib/exesheet/exesheet.dtx
@@ -23,7 +23,7 @@
%<class>\ProvidesClass{exesheet}
%<package>\ProvidesPackage{exesheet}
%<*class|package>
-[2024/02/03 v2.6 .dtx Typesetting exercise or exam sheets]
+[2024/02/13 v2.7 .dtx Typesetting exercise or exam sheets]
%</class|package>
%<*driver>
\documentclass{ltxdoc}
@@ -85,7 +85,7 @@
%</driver>
% \fi
%
-% \CheckSum{1192}
+% \CheckSum{1206}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -178,6 +178,12 @@
% - error message when using colsenum or colsitem without loading multicol
% - changes in the comparison with other packages}
%
+% \changes{v2.7}{2024/02/13}{
+% - an expl3 update prevents the correction color in tasks environment -> fixed
+% - new command enumfont
+% - babel-french option 'StandardLists=true' works now if french is passed in documentclass
+% - completion of the comparison with other packages}
+%
% \GetFileInfo{exesheet.dtx}
%
% \maketitle
@@ -318,6 +324,7 @@
% \subpart
% Now you are ready to proceed with the current exercise.
%
+% \bigskip
% \pagebreak
% The following macros allow customization in the same manner as for |\exercise|.
%
@@ -545,12 +552,16 @@
% (for \texttt{tablenum1}) and |\labelenuma| (for \texttt{tablenuma}),
% using the \texttt{task} counter:
% \eg |\renewcommand\labelenuma{\Alph{task}.}| yields the labels
-% \textbf{A.}, \textbf{B.}, \ldots
+% \textbf{A.}, \textbf{B.}, etc.
%
% \smallskip
+% \DescribeMacro{\enumfont}
+% With the default option \texttt{setlist=true},
+% the font of all enumeration labels may be changed by redefining |\enumfont|
+% (|\bfseries| by default).
% If the \textsf{exesheet} package is invoked with the option \texttt{setlist=false},
% labels within \texttt{tablenum1} and \texttt{tablenuma} environments
-% will be presented with indentation and in normal font rather than bold.
+% will be presented with indentation, and in normal font rather than bold.
% You can change the label formatting globally with the command |\settask|, \eg
% |\settask{label-format=\itshape}|.
% You can also completely redefine the environments using |\RenewTasksEnvironment|.
@@ -562,17 +573,12 @@
% immediately after inserting the |\item| command
% within an \texttt{enumerate} environment,
% a vertical misplacement may occur.
-% ^^A as demonstrated in the following example:
-% ^^A \begin{enumerate}
-% ^^A \item
-% ^^A \begin{tablenuma}(3) \item One \item Two \item Three \end{tablenuma}
-% ^^A \end{enumerate}
% To achieve proper vertical spacing in such cases, we offer
% the starred environments \texttt{tablenuma*} and \texttt{tablitem*},
% with corrected alignment as shown below:
%
% \noindent\psframe(-0.25,0.05)(12.75,-0.97)
-% \psline[linewidth=0.1pt,linecolor=green,linestyle=dashed](0, -0.63)(10.5, -0.63)
+% \psline[linewidth=0.1pt,linecolor=green,linestyle=dashed](0, -0.6)(10.5, -0.6)
% \begin{enumerate}
% \item
% \begin{tablenuma*}(3) \item One \item Two \item Three \end{tablenuma*}
@@ -1294,39 +1300,40 @@
% \item \textsf{esami}, Grazia Messineo, Salvatore Vassallo~\cite{ESAMI}
% \item \textsf{randexam}, Jianrui Lyu~\cite{RAND}
% \item \textsf{hideanswer}, Yukoh Kusakabe~\cite{HIDE}
-% ^^A\item \textsf{mathexam}, Jan Hlavacek~\cite{MATH}
+% \item \textsf{mathexam}, Jan Hlavacek~\cite{MATH}
% \item \textsf{exesheet}, Antoine Missier
% \end{enumerate}
% \end{flushleft}
% \end{multicols}
%
% \newcommand\X{\ding{56}}
-% \setlength{\extrarowheight}{2pt}
-% \noindent\begin{tabular}{@{\hspace{1.8pt}}l@{\hspace{2pt}}|%
-% *{17}{@{\hspace{1.8pt}}c@{\hspace{1.8pt}}|}}
+% \setlength{\extrarowheight}{2pt}\noindent
+% {\small
+% \begin{tabular}{@{\hspace{2pt}}l@{\hspace{5pt}}|%
+% *{18}{@{\hspace{1.8pt}}c@{\hspace{2pt}}|}}
% \hline
-% Functionality &A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q \\
+% Functionality &A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&R \\
% \hline
-% Optional text for exercise titles &\X&&\X&\X&\X&&&&\X&&&&\X&&&&\X \\
-% Subparts of exercises &\X&&&\X&\X&&&&\X&&\X&\X&\X&\X&\X&&\X \\
-% Annex title or appendix &&&&&&&&&&&&&&&\X&&\X \\
-% Exercise titles in TOC of PDF files &\X&&&&&&&&&&&&&&&&\X \\
-% Short labels for exercises &\X&&\X&\X&&&&&&&&&&&&&\X \\
-% Hiding questions or answers* &\X&*&\X&\X&*&\X&\X&\X&&&*&\X&&\X&*&*&\X \\
-% Different placements for answers &\X&&&&&&&&&&\X&\X&&&&&\X \\
-% Change answers placement in output &\X&&&\X&&\X&&\X&&&&\X&&&&& \\
-% Blank spacing in place of answers &&\X&\X&&\X&&&&&&&\X&&\X&\X&&\X \\
-% Marking scheme commands &&\X&\X&\X&\X&&&&\X&\X&\X&\X&&\X&\X&&\X \\
-% Various positions of points &&&&\X&\X&&&&&&&\X&&\X&&&\X \\
-% Marking scheme calculation/checking &&\X&\X&\X&\X&&&&\X&&\X&\X&&&\X&&\X \\
-% Detailed notes for scoring guide &&&&&&&&&&&&&&&&&\X \\
+% Optional text for exercise titles &\X&&\X&\X&\X&&&&\X&&&&\X&&&&&\X \\
+% Subparts of exercises &\X&&&\X&\X&&&&\X&&\X&\X&\X&\X&\X&&&\X \\
+% Annex title or appendix &&&&&&&&&&&&&&&\X&&&\X \\
+% Exercise titles in TOC of PDF files &\X&&&&&&&&&&&&&&&&&\X \\
+% Short labels for exercises &\X&&\X&\X&&&&&&&&&&&&&&\X \\
+% Hiding questions or answers* &\X&*&\X&\X&*&\X&\X&\X&&&*&\X&&\X&*&*&&\X \\
+% Different placements for answers &\X&&&&&&&&&&\X&\X&&&&&&\X \\
+% Change answers placement in output &\X&&&\X&&\X&&\X&&&&\X&&&&&& \\
+% Blank spacing in place of answers &&\X&\X&&\X&&&&&&&\X&&\X&\X&&\X&\X \\
+% Marking scheme commands &&\X&\X&\X&\X&&&&\X&\X&\X&\X&&\X&\X&&&\X \\
+% Various positions of points &&&&\X&\X&&&&&&&\X&&\X&&&&\X \\
+% Marking scheme calculation/checking &&\X&\X&\X&\X&&&&\X&&\X&\X&&&\X&&&\X \\
+% Detailed notes for scoring guide &&&&&&&&&&&&&&&&&&\X \\
% \hline
% \end{tabular}
+% }
% \medskip
%
% \StopEventually{}
%
-% \pagebreak
% \section{Implementation}
%
% \subsection{Options and required packages}
@@ -1468,8 +1475,8 @@
\renewcommand{\noteragged}{#1}
}
\newcommand*{\displaynotesright}[1][\RaggedRight]{%
- \PackageWarning{exesheet}{Old command \string\displaynotesright\space
- is used. \MessageBreak
+ \PackageWarning{exesheet}{Old command \string\displaynotesright
+ \space is used. \MessageBreak
It can be replaced by the options `display=notes, margin=right'}
\renewcommand\exesheet@display{notes}
\exs@process@display
@@ -1709,8 +1716,10 @@
% (|\setenumerate| is deprecated). By default, |itemsep=1ex| is set for first-level lists,
% and |leftmargin=1.5em| is used to align labels with the start of lines.
% \begin{macrocode}
+\newcommand\enumfont{\bfseries}
+
\newenvironment{exenumerate}[1][]{%
- \setlist[enumerate]{font=\bfseries}
+ \setlist[enumerate]{font=\enumfont}
\setlist[enumerate,1]{leftmargin=1.5em,
itemsep=3ex plus 1ex minus 1ex,topsep=3ex plus 1ex minus 1ex}
\setlist[enumerate,3]{noitemsep,nolistsep}
@@ -1720,49 +1729,46 @@
% \end{macrocode}
% \end{macro}
-% When using the \textsf{babel} package with the \texttt{french} option,
+% When using the \textsf{babel-french} package,
% \texttt{itemize} lists are altered to use the same dash label for each list level.
% These modifications are undone here to revert to the default
% \LaTeX\ \texttt{itemize} lists, including labels and spaces.
-% We have created the |\standardfrenchlists| command, which should be invoked within the
-% |\AtBeginDocument| command or immediately, depending on whether
+% This setting is done by the |\frenchsetup| command, which should be invoked within
+% the |\AtBeginDocument| command or immediately, depending on whether
% \textsf{exesheet} is loaded before or after \textsf{babel}.
% \begin{macrocode}
-\newcommand\standardfrenchlists{%
- \@ifpackagewith{babel}{french}{
- \frenchsetup{StandardLists=true}
- }{}
-}
\ifexesheet@setlist
- \standardfrenchlists
+ \@ifundefined{frenchsetup}{}{\frenchsetup{StandardLists=true}}
% must be executed here (and not at begin doc) if loaded after babel
\fi
\newcommand\labelenumone{\arabic{task}.}
\newcommand\labelenuma{(\alph{task})}
+\newcommand\refenuma{\alph{task}}
\def\exs@process@setlist{% must be executed at begin document
\ifexesheet@setlist
- \standardfrenchlists % executed at begin doc if loaded before babel
- \setlist[enumerate]{font=\bfseries}
+ \@ifundefined{frenchsetup}{}{\frenchsetup{StandardLists=true}}
+ % executed at begin doc if loaded before babel
+ \setlist[enumerate]{font=\enumfont}
\setlist[enumerate,1]{topsep=1.5ex plus 1ex minus 1ex,leftmargin=1.5em}
\fi
% \end{macrocode}
% \DescribeEnv{tablenum1} \DescribeEnv{tablenuma}
-% The |\NewTasks| command is part of the \textsf{tasks} package~\cite{TASK}.
+% The |\NewTasksEnvironment| command is part of the \textsf{tasks} package~\cite{TASK}.
% It enables the definition of the environments \texttt{tablenum1},
% \texttt{tablenuma} and \texttt{tablitem}.
% Horizontal spacing is adjusted to ensure proper alignment with
% items in other \texttt{enumerate} (or \texttt{itemize}) environments.
% \begin{macrocode}
\ifexesheet@setlist
- \settasks{label-format=\bfseries}
+ \settasks{label-format=\enumfont}
\NewTasksEnvironment[label=\labelenumone,
column-sep=1em,label-align=right,
item-indent=1.5em,label-width=1em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
- \NewTasksEnvironment[label=\labelenuma,ref=\alph{task},
+ \NewTasksEnvironment[label=\labelenuma,ref=\refenuma,
column-sep=1em,label-align=right,
item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
@@ -1771,7 +1777,7 @@
column-sep=1em,label-align=right,
label-width=1em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenum1}[\item](2)
- \NewTasksEnvironment[label=\labelenuma,ref=\alph{task},
+ \NewTasksEnvironment[label=\labelenuma,ref=\refenuma,
column-sep=1em,label-align=right,
item-indent=2.15em,label-width=1.6em,label-offset=0.5em,
after-item-skip=0.5ex plus 0.5ex minus 0.5ex]{tablenuma}[\item](2)
@@ -1986,6 +1992,8 @@
% \end{macrocode}
% Then we proceed to define the \texttt{answers} environment.
+% It seems that the \textsf{tasks} package resets the color to black,
+% therefore the |\color{correctioncolor}| options in |\settasks|.
% \begin{macrocode}
\newenvironment{answers}[1][]{% #1 is the optional level
\ifthenelse{\boolean{exesheet@answers}}{%
@@ -1993,9 +2001,21 @@
\set@toclevel[#1]
\typeset@correctionname
\correctionstyle%
+ \ifexesheet@setlist
+ \settasks{
+ label-format = \color{correctioncolor}\enumfont,
+ item-format = \color{correctioncolor}
+ }%
+ \else
+ \settasks{
+ label-format = \color{correctioncolor},
+ item-format = \color{correctioncolor}
+ }%
+ \fi%
\ifexesheet@multicol
- \renewcommand{\columnseprulecolor}{\color{correctioncolor}}
- \fi
+ \renewcommand{\columnseprulecolor}{%
+ \color{correctioncolor}}
+ \fi%
}{}
}{\comment}
}{\ifthenelse{\boolean{exesheet@answers}}{}{\endcomment}}
@@ -2378,7 +2398,8 @@
\AtEndDocument{% final checking (global)
\ifthenelse{\equal{\exe@currentlabel}{none}}{
\ifthenelse{\lengthtest{\sum@pts = 0pt}}{
- \PackageWarningNoLine{exesheet}{checkpts: No points displayed}
+ \PackageWarningNoLine{exesheet}{checkpts:
+ No points displayed}
}{
\ifthenelse{\lengthtest{\sheet@total = \sum@pts}}{
\PackageWarningNoLine{exesheet}{Total:
@@ -2391,7 +2412,8 @@
}{% last exercise and final checking
\exe@check
\ifthenelse{\lengthtest{\sum@exe} = 0pt}{
- \PackageWarningNoLine{exesheet}{checkpts: No points displayed}
+ \PackageWarningNoLine{exesheet}{checkpts:
+ No points displayed}
}{
\ifthenelse{\lengthtest{\sheet@total = \sum@exe}}{
\PackageWarningNoLine{exesheet}{Total:
diff --git a/macros/latex/contrib/exesheet/exesheet.pdf b/macros/latex/contrib/exesheet/exesheet.pdf
index b18f1858e7..8f1760acc1 100644
--- a/macros/latex/contrib/exesheet/exesheet.pdf
+++ b/macros/latex/contrib/exesheet/exesheet.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.dtx b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
index 73cf741334..6503a47298 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-code.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix-code.dtx
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.26d}
-\def\myfiledate{2024/01/25}
+\def\myfileversion{6.27}
+\def\myfiledate{2024/02/13}
%
%
%<*batchfile>
@@ -50,8 +50,8 @@ version 2005/12/01 or later.
%<*driver>
\documentclass[dvipsnames]{l3doc}% dvipsnames is for xcolor (loaded by Tikz)
\VerbatimFootnotes
-\usepackage{xltxtra}
-\usepackage[xetex]{geometry}
+
+\usepackage[luatex]{geometry}
\geometry{left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm,papersize={21cm,29.7cm}}
\usepackage{tikz}
@@ -61,7 +61,7 @@ version 2005/12/01 or later.
\NewDocumentEnvironment {scope} {} {} {}
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
-\fvset{commandchars=\~\#\@,formatcom=\color{gray}}
+\fvset{formatcom=\color{gray}}
\usepackage{upquote}
@@ -2232,9 +2232,12 @@ version 2005/12/01 or later.
% \end{macrocode}
%
% \bigskip
-% The boolean |\l_@@_light_syntax_bool| corresponds to the option |light-syntax|.
+% The boolean |\l_@@_light_syntax_bool| corresponds to the option |light-syntax|
+% and the boolean |\l_@@_light_syntax_expanded_bool| correspond to the the
+% option |light-syntax-expanded|.
% \begin{macrocode}
\bool_new:N \l_@@_light_syntax_bool
+\bool_new:N \l_@@_light_syntax_expanded_bool
% \end{macrocode}
%
% \bigskip
@@ -2499,8 +2502,14 @@ version 2005/12/01 or later.
} ,
cell-space-limits .value_required:n = true ,
xdots .code:n = \keys_set:nn { NiceMatrix / xdots } { #1 } ,
- light-syntax .bool_set:N = \l_@@_light_syntax_bool ,
- light-syntax .default:n = true ,
+ light-syntax .code:n =
+ \bool_set_true:N \l_@@_light_syntax_bool
+ \bool_set_false:N \l_@@_light_syntax_expanded_bool ,
+ light-syntax .value_forbidden:n = true ,
+ light-syntax-expanded .code:n =
+ \bool_set_true:N \l_@@_light_syntax_bool
+ \bool_set_true:N \l_@@_light_syntax_expanded_bool ,
+ light-syntax-expanded .value_forbidden:n = true ,
end-of-row .tl_set:N = \l_@@_end_of_row_tl ,
end-of-row .value_required:n = true ,
first-col .code:n = \int_zero:N \l_@@_first_col_int ,
@@ -3759,7 +3768,7 @@ version 2005/12/01 or later.
\cs_set_eq:NN \Hdotsfor \@@_Hdotsfor:
\cs_set_eq:NN \Vdotsfor \@@_Vdotsfor:
\cs_set_eq:NN \Block \@@_Block:
- \cs_set_eq:NN \rotate \@@_rotate:
+ \cs_set_eq:NN \rotate \@@_rotate:
\cs_set_eq:NN \OnlyMainNiceMatrix \@@_OnlyMainNiceMatrix:n
\cs_set_eq:NN \dotfill \@@_dotfill:
\cs_set_eq:NN \CodeAfter \@@_CodeAfter:
@@ -6740,7 +6749,10 @@ version 2005/12/01 or later.
% We rescan the character of end of line in order to have the correct catcode.
% \begin{macrocode}
\tl_set_rescan:Nno \l_@@_end_of_row_tl { } \l_@@_end_of_row_tl
- \seq_set_split:NVn \l_@@_rows_seq \l_@@_end_of_row_tl { #1 }
+ \bool_if:NTF \l_@@_light_syntax_expanded_bool
+ \seq_set_split:Nee
+ \seq_set_split:NVn
+ \l_@@_rows_seq \l_@@_end_of_row_tl { #1 }
% \end{macrocode}
% We delete the last row if it is empty.
% \begin{macrocode}
@@ -9941,7 +9953,7 @@ version 2005/12/01 or later.
% |#1| is the first row \emph{after} the scope of the instructions in |#2|
% \begin{macrocode}
\cs_new:Npn \@@_if_row_less_than:nn #1 #2
- { \int_compare:nNnT \c@iRow < { #1 } { #2 } }
+ { \int_compare:nNnT { \c@iRow } < { #1 } { #2 } }
% \end{macrocode}
%
% \bigskip
@@ -9958,7 +9970,11 @@ version 2005/12/01 or later.
\exp_not:N
\@@_if_row_less_than:nn
{ \int_eval:n { \c@iRow + \l_@@_key_nb_rows_int } }
- { \exp_not:n { #1 } }
+% \end{macrocode}
+% The |\scan_stop:| is mandatory (for ex. for the case where |\rotate| is used
+% in the argument of |\RowStyle|).
+% \begin{macrocode}
+ { \exp_not:n { #1 } \scan_stop: }
}
}
\cs_generate_variant:Nn \@@_put_in_row_style:n { e }
@@ -9987,7 +10003,6 @@ version 2005/12/01 or later.
nb-rows .value_required:n = true ,
rowcolor .tl_set:N = \l_tmpa_tl ,
rowcolor .value_required:n = true ,
- rowcolor .initial:n = ,
unknown .code:n = \@@_error:n { Unknown~key~for~RowStyle }
}
% \end{macrocode}
@@ -9998,7 +10013,7 @@ version 2005/12/01 or later.
\NewDocumentCommand \@@_RowStyle:n { O { } m }
{
\group_begin:
- \tl_clear:N \l_tmpa_tl % value of \rowcolor
+ \tl_clear:N \l_tmpa_tl
\tl_clear:N \l_@@_color_tl
\int_set_eq:NN \l_@@_key_nb_rows_int \c_one_int
\dim_zero:N \l_tmpa_dim
@@ -17060,6 +17075,7 @@ version 2005/12/01 or later.
last-row,~
left-margin,~
light-syntax,~
+ light-syntax-expanded,~
matrix/columns-type,~
no-cell-nodes,~
notes~(several~subkeys),~
@@ -17119,6 +17135,7 @@ version 2005/12/01 or later.
last-row,~
left-margin,~
light-syntax,~
+ light-syntax-expanded,~
name,~
no-cell-nodes,~
nullify-dots,~
@@ -17184,6 +17201,7 @@ version 2005/12/01 or later.
last-row,~
left-margin,~
light-syntax,~
+ light-syntax-expanded,~
name,~
no-cell-nodes,~
nullify-dots,~
@@ -17247,6 +17265,7 @@ version 2005/12/01 or later.
last-row,~
left-margin,~
light-syntax,~
+ light-syntax-expanded,~
name,~
no-cell-nodes,~
notes~(several~subkeys),~
diff --git a/macros/latex/contrib/nicematrix/nicematrix-code.pdf b/macros/latex/contrib/nicematrix/nicematrix-code.pdf
index b31eaa65ba..94a1050280 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-code.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index 4797714502..c5b00a3a49 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex
index 149fc5dd33..e6026723d3 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -1,7 +1,6 @@
% -*- coding: utf-8 ; -*-
-% Ce fichier doit être compilé avec xelatex uniquement.
+% Ce fichier doit être compilé avec lualatex uniquement.
\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by TikZ, loaded by nicematrix)
-\usepackage{xltxtra}
\usepackage[french]{babel}
\frenchsetup{og = « , fg = »}
@@ -27,16 +26,14 @@
\MakeShortVerb{\|}
\usepackage{fancyvrb}
-\fvset{commandchars=\~\#\@,formatcom=\color{gray}}
+\fvset{formatcom=\color{gray}}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{6.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\titlespacing*{\subsection}{0pt}{4.5ex plus 1ex minus .2ex}{2ex plus .2ex}
-\def\LetterAt{@}
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
-\def\emphase{\bgroup\color{RoyalPurple}\let\next=}
\usepackage{footnote}
\usepackage{booktabs}
@@ -65,6 +62,40 @@
\usepackage{makeidx}
\makeindex
+\def\emphase{\bgroup\color{RoyalPurple}\let\next=}
+
+\usepackage{piton}
+\PitonOptions{language = minimal, detected-commands = {emph,textsl}, splittable = 4}
+\SetPitonStyle{ Number = , Comment = }
+
+\ExplSyntaxOn
+
+\dim_new:N \l__pantigny_width_dim
+
+\keys_define:nn { pantigny }
+ { width .dim_set:N = \l__pantigny_width_dim }
+
+\NewPitonEnvironment { Code } { O { } }
+ {
+ \char_set_catcode_other:N |
+ \cs_set_eq:NN \emph \emphase
+ \dim_zero:N \l__pantigny_width_dim
+ \keys_set:nn { pantigny } { #1 }
+ \color{gray}
+ \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ {
+ \PitonOptions { width = \l__pantigny_width_dim }
+ \begin{minipage}[c]{\l__pantigny_width_dim}
+ }
+ }
+ { \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ { \end{minipage} }
+ }
+
+
+\ExplSyntaxOff
+
+
\NewDocumentCommand{\indexcommand}{m}{\index{#1@\texttt{\textbackslash #1}}}
\NewDocumentCommand{\indexenv}{m}{\index{#1@\texttt{\{#1\}}}}
@@ -152,7 +183,7 @@ votre projet pour bénéficier de la dernière version de
Cette extension peut être utilisée avec |xelatex|, |lualatex| et |pdflatex| mais
aussi avec le cheminement classique |latex|-|dvips|-|ps2pdf| (ou Adobe
Distiller). \textsl{Néanmoins, le fichier nicematrix-french.tex de la présente
- documentation ne peut être compilé qu'avec XeLaTeX.}
+ documentation ne peut être compilé qu'avec LuaLaTeX.}
\medskip
Cette extension nécessite et charge les extensions \pkg{l3keys2e}, \pkg{array},
@@ -269,15 +300,15 @@ LaTeX sont trop proches l'une de l'autre. On en donne ci-dessous un exemple
classique.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
$\begin{pmatrix}
-\frac12 & -\frac12 \\
-\frac13 & \frac14 \\
+\frac{1}{2} & -\frac{1}{2} \\
+\frac{1}{3} & \frac{1}{4} \\
\end{pmatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pmatrix}
-\frac12 & -\frac12 \\
-\frac13 & \frac14 \\
+\frac{1}{2} & -\frac{1}{2} \\
+\frac{1}{3} & \frac{1}{4} \\
\end{pmatrix}$
\medskip
@@ -298,21 +329,23 @@ conseille de régler leurs valeurs avec la commande
n'est pas utilisable avec ces colonnes.}
\medskip
-\begin{Verbatim}
-\NiceMatrixOptions{~emphase#cell-space-limits = 1pt@}
-\end{Verbatim}
+\begin{Code}
+\NiceMatrixOptions{\emph{cell-space-limits = 1pt}}
+\end{Code}
+
+\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
$\begin{pNiceMatrix}
-\frac12 & -\frac12 \\
-\frac13 & \frac14 \\
+\frac{1}{2} & -\frac{1}{2} \\
+\frac{1}{3} & \frac{1}{4} \\
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{ cell-space-limits = 1pt }
$\begin{pNiceMatrix}
-\frac12 & -\frac12 \\
-\frac13 & \frac14 \\
+\frac{1}{2} & -\frac{1}{2} \\
+\frac{1}{3} & \frac{1}{4} \\
\end{pNiceMatrix}$
\end{scope}
@@ -332,13 +365,13 @@ indique le numéro de rangée dont la ligne de base servira de ligne de base pou
le tableau.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
-$A = \begin{pNiceMatrix}[~emphase#baseline=2@]
+\begin{Code}[width=9cm]
+$A = \begin{pNiceMatrix}[\emph{baseline=2}]
\frac{1}{\sqrt{1+p^2}} & p & 1-p \\
1 & 1 & 1 \\
1 & p & 1+p
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$A = \begin{pNiceMatrix}[baseline=2]
\frac{1}{\sqrt{1+p^2}} & p & 1-p \\
1 & 1 & 1 \\
@@ -360,19 +393,19 @@ rangée (avec |{tabular}| ou |{array}| de \pkg{array}, il faut utiliser
|\firsthline|).
\smallskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{enumerate}
\item un item
\smallskip
\item \renewcommand{\arraystretch}{1.2}
-$\begin{NiceArray}~emphase#[t]@{lcccccc}
+$\begin{NiceArray}\emph{[t]}{lcccccc}
\hline
n & 0 & 1 & 2 & 3 & 4 & 5 \\
u_n & 1 & 2 & 4 & 8 & 16 & 32
\hline
\end{NiceArray}$
\end{enumerate}
-\end{BVerbatim}
+\end{Code}
%
\begin{minipage}{5cm}
\begin{enumerate}
@@ -395,20 +428,20 @@ Il est également possible d'utiliser les outils de \pkg{booktabs}: |\toprule|,
\pkg{booktabs}.\par\nobreak
\smallskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{enumerate}
\item an item
\smallskip
\item
$\begin{NiceArray}[t]{lcccccc}
-~emphase#\toprule@
+\emph{\toprule}
n & 0 & 1 & 2 & 3 & 4 & 5 \\
-~emphase#\midrule@
+\emph{\midrule}
u_n & 1 & 2 & 4 & 8 & 16 & 32
-~emphase#\bottomrule@
+\emph{\bottomrule}
\end{NiceArray}$
\end{enumerate}
-\end{BVerbatim}
+\end{Code}
\begin{minipage}{5cm}
\begin{enumerate}
\item an item
@@ -432,20 +465,20 @@ horizontal (tracé par |\hline|). On doit pour cela donner la valeur
horizontal.
\smallskip
-\begin{Verbatim}
+\begin{Code}
\NiceMatrixOptions{cell-space-limits=1pt}
-\end{Verbatim}
+\end{Code}
\smallskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
-$A=\begin{pNiceArray}{cc|cc}~emphase#[baseline=line-3]@
+\begin{Code}[width=9cm]
+$A=\begin{pNiceArray}{cc|cc}\emph{[baseline=line-3]}
\dfrac{1}{A} & \dfrac{1}{B} & 0 & 0 \\
\dfrac{1}{C} & \dfrac{1}{D} & 0 & 0 \\
\hline
0 & 0 & A & B \\
0 & 0 & D & D \\
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{cell-space-limits=1pt}
\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
@@ -493,15 +526,15 @@ tandis que, dans les autres environnements, il est composé en mode mathématiqu
Voici un exemple d'utilisation de la commande |\Block| dans une matrice mathématique.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-~emphase#\Block{3-3}{A}@ & & & 0 \\
+\emph{\Block{3-3}{A}} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
0 & \Cdots& 0 & 0
\end{bNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\Block{3-3}{A} & & & 0 \\
& & & \Vdots \\
@@ -510,6 +543,8 @@ $\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
0 & \Cdots& 0 & 0
\end{bNiceArray}$
+
+
\medskip
On peut souhaiter agrandir la taille du «$A$» placé dans le bloc de l'exemple
précédent. Comme il est composé en mode mathématique, on ne peut pas directement
@@ -522,15 +557,15 @@ LaTeX qui sera inséré \emph{avant} le début du mode mathématique.\footnote{C
\pkg{nicematrix} (cf. partie~\ref{rotate}, p.~\pageref{rotate}).}
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block{3-3}~emphase#<\LARGE>@{A} & & & 0 \\
+\Block{3-3}\emph{<\LARGE>{A}} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
0 & \Cdots& 0 & 0
\end{bNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\Block{3-3}<\LARGE>{A} & & & 0 \\
& & & \Vdots \\
@@ -654,17 +689,17 @@ Dans l'exemple suivant, on a dû élargir à la main les colonnes 2 et 3 (avec l
construction |w{c}{...}| de \pkg{array}).
\medskip
-\begin{BVerbatim}
+\begin{Code}
\begin{NiceTabular}{cw{c}{2cm}w{c}{3cm}c}
rose & tulipe & marguerite & dahlia \\
violette
-& ~emphase#\Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}@
- ~emphase#{\LARGE De très jolies fleurs}@
+& \emph{\Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
+ {\LARGE De très jolies fleurs}}
& & souci \\
pervenche & & & lys \\
arum & iris & jacinthe & muguet
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\medskip
@@ -704,8 +739,8 @@ blocs mono-colonne de cette colonne (ce comportement est assez naturel).
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=12cm]
-\begin{NiceTabular}{~LetterAt{}>{\color{blue}}lr~LetterAt{}} \hline
+\begin{Code}[width=12cm]
+\begin{NiceTabular}{@{}>{\color{blue}}lr@{}} \hline
\Block{2-1}{Pierre} & 12 \\
& 13 \\ \hline
Jacques & 8 \\ \hline
@@ -717,7 +752,7 @@ Henri & 14 \\ \hline
\Block{2-1}{Estelle} & 15 \\
& 19 \\ \hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{@{}>{\color{blue}}lr@{}} \hline
\Block{2-1}{Pierre} & 12 \\
& 13 \\ \hline
@@ -769,17 +804,17 @@ la consigne générale donnée dans le préambule pour cette colonne (cf.~\ref{h
\end{itemize}
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{cc}
\toprule
Écrivain
-& ~emphase#\Block[l]{}{année de\\ naissance}@ \\
+& \emph{\Block[l]{}{année de\\ naissance}} \\
\midrule
Hugo & 1802 \\
Balzac & 1799 \\
\bottomrule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
%
\begin{NiceTabular}{cc}
\toprule
@@ -805,15 +840,15 @@ La commande |\Block| admet les clés |l|, |c| et |r| pour la position horizontal
du contenu du bloc (calé à gauche, centré ou bien calé à droite).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
+\Block\emph{[r]}{3-3}<\LARGE>{A} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
0 & \Cdots& 0 & 0
\end{bNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\Block[r]{3-3}<\LARGE>{A} & & & 0 \\
& & & \Vdots \\
@@ -831,11 +866,10 @@ préambule (ce n'est pas le cas avec |\multicolumn|).
\medskip
\begin{center}
-\fvset{commandchars=\~\#\+}
-\begin{BVerbatim}
-\begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc@{}}
+\begin{Code}
+\begin{NiceTabular}{@{}c!{\qquad}ccc\emph{!{\qquad}}ccc@{}}
\toprule
-Rang & ~emphase#\Block{1-3}{Premier groupe}+ & & & \Block{1-3}{Deuxième groupe} \\
+Rang & \emph{\Block{1-3}{Premier groupe}} & & & \Block{1-3}{Deuxième groupe} \\
& 1A & 1B & 1C & 2A & 2B & 2C \\
\midrule
1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
@@ -844,7 +878,7 @@ Rang & ~emphase#\Block{1-3}{Premier groupe}+ & & & \Block{1-3}{Deuxième groupe}
4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
\bottomrule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\end{center}
\medskip
@@ -871,11 +905,10 @@ il faut utiliser les clés |L|, |R| et |C| de la commande |\Block|.
Voici le même exemple avec la clé |C| pour le premier bloc.
\begin{center}
-\fvset{commandchars=\~\#\+}
-\begin{BVerbatim}
-\begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc@{}}
+\begin{Code}
+\begin{NiceTabular}{@{}c!{\qquad}ccc\emph{!{\qquad}}ccc@{}}
\toprule
-Rang & ~emphase#\Block[C]{1-3}{Premier groupe}+ & & & \Block{1-3}{Deuxième groupe} \\
+Rang & \emph{\Block[C]{1-3}{Premier groupe}} & & & \Block{1-3}{Deuxième groupe} \\
& 1A & 1B & 1C & 2A & 2B & 2C \\
\midrule
1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
@@ -884,7 +917,7 @@ Rang & ~emphase#\Block[C]{1-3}{Premier groupe}+ & & & \Block{1-3}{Deuxième grou
4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
\bottomrule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\end{center}
\medskip
@@ -943,22 +976,22 @@ les blocs mono-rangée).
\begin{scope}
\NiceMatrixOptions{rules/color=[gray]{0.75}, hvlines}
-\begin{BVerbatim}
+\begin{Code}
\NiceMatrixOptions{rules/color=[gray]{0.75}, hvlines}
-\end{BVerbatim}
+\end{Code}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#t@,l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{t},l]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,t,l]{4-2}{two\\lines}
& & \Huge Un\\
@@ -970,16 +1003,16 @@ text & text \\
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#b@,r]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{b},r]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,b,r]{4-2}{two\\lines}
& & \Huge Un\\
@@ -990,16 +1023,16 @@ text & text \\
\end{NiceTabular}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#T@,l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{T},l]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,T,l]{4-2}{two\\lines}
& & \Huge Un\\
@@ -1011,16 +1044,16 @@ text & text \\
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#B@,r]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{B},r]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,B,r]{4-2}{two\\lines}
& & \Huge Un\\
@@ -1055,13 +1088,13 @@ de ligne incomplète ou de double filet horizontal spécifié par |\hline\hline|
(il n'y a pas besoin d'utiliser l'extension \pkg{hhline}).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{|c|c|} \hline
-Premier & Deuxième \\ ~emphase#\hline\hline@
+Premier & Deuxième \\ \emph{\hline\hline}
Paul \\ \hline
Marie & Pauline \\ \hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
%
\begin{NiceTabular}{|c|c|}[c] \hline
Premier & Deuxième \\ \hline\hline
@@ -1086,13 +1119,13 @@ Si vous utilisez \pkg{booktabs} (qui fournit |\toprule|, |\midrule|,
filets tracés par \pkg{nicematrix} sont compatibles avec \pkg{booktabs}.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.5cm]
-$\begin{NiceArray}{~emphase#|cccc|@} \toprule
+\begin{Code}[width=10.5cm]
+$\begin{NiceArray}{\emph{|cccc|}} \toprule
a & b & c & d \\ \midrule
1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ \bottomrule
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
%
$\begin{NiceArray}{|cccc|}
\toprule
@@ -1130,13 +1163,13 @@ Pour des raisons historiques, il n'en est pas de même pour la commande |\cline|
comme on peut le voir avec l'exemple suivant.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\setlength{\arrayrulewidth}{2pt}
\begin{tabular}{cccc} \hline
-A&B&C&D \\ ~emphase#\cline{2-2}@
+A&B&C&D \\ \emph{\cline{2-2}}
A&B&C&D \\ \hline
\end{tabular}
-\end{BVerbatim}
+\end{Code}
%
\begin{scope}
\setlength{\arrayrulewidth}{2pt}
@@ -1156,13 +1189,13 @@ est néanmoins possible de revenir au comportement par défaut de |\cline| avec
clé |standard-cline|).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\setlength{\arrayrulewidth}{2pt}
\begin{NiceTabular}{cccc} \hline
-A&B&C&D \\ ~emphase#\cline{2}@
+A&B&C&D \\ \emph{\cline{2}}
A&B&C&D \\ \hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
%
\begin{scope}
\setlength{\arrayrulewidth}{2pt}
@@ -1209,15 +1242,15 @@ globalement !). Elle est à privilégier.
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
+\begin{Code}[width=9.5cm]
+\begin{NiceTabular}{|ccc|}[\emph{rules/color=[gray]{0.9},rules/width=1pt}]
\hline
rose & tulipe & lys \\
arum & iris & violette \\
muguet & dahlia & souci \\
\hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
\hline
rose & tulipe & lys \\
@@ -1284,15 +1317,15 @@ De même que la commande |\Hline|, le specificateur «\verb+|+» admet entre cro
des options qui caractérisent le filet à tracer.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-\begin{NiceTabular}{|c~emphase#|[color=blue]@c|}
+\begin{Code}[width=10cm]
+\begin{NiceTabular}{|c|\emph{[color=blue]}c|}
\Hline
a & b \\
-~emphase#\Hline[color=red]@
+\emph{\Hline[color=red]}
c & d \\
\Hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
%
\begin{NiceTabular}{|c|[color=blue]c|}
\Hline
@@ -1322,13 +1355,13 @@ En fait, pour les environnements avec délimiteurs (comme |{pNiceMatrix}| ou
le comportement certainement attendu).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{pNiceMatrix}[~emphase#vlines@,rules/width=0.2pt]
+\begin{Code}[width=10.6cm]
+$\begin{pNiceMatrix}[\emph{vlines},rules/width=0.2pt]
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[vlines,rules/width=0.2pt]
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6 \\
@@ -1347,14 +1380,14 @@ La clé |hvlines|, qui ne prend pas de valeur, est la conjonction des clés
|hlines| et |vlines|.
\smallskip
-\begin{Verbatim}
-\begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue,rules/width=1pt]
+\begin{Code}
+\begin{NiceTabular}{cccc}[\emph{hvlines},rules/color=blue,rules/width=1pt]
rose & tulipe & marguerite & dahlia \\
violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\
pervenche & & & lys \\
arum & iris & jacinthe & muguet
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
%
\begin{center}
\begin{NiceTabular}{cccc}[hvlines,rules/color=blue,rules/width=1pt]
@@ -1435,9 +1468,9 @@ les coins vides et ces coins sont alors pris en compte par les outils de tracés
de filets (les filets ne seront pas tracés dans ces coins vides).
\medskip
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
\NiceMatrixOptions{cell-space-top-limit=3pt}
-\begin{NiceTabular}{*{6}{c}}[~emphase#corners@,hvlines]
+\begin{NiceTabular}{*{6}{c}}[\emph{corners},hvlines]
& & & & A \\
& & A & A & A \\
& & & A \\
@@ -1448,7 +1481,7 @@ A & A & A & A & A & A \\
& \Block{2-2}{B} & & A \\
& & & A \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt]
& & & & A \\
& & A & A & A \\
@@ -1467,9 +1500,9 @@ prendre en considération (les coins sont notés |NW|, |SW|, |NE| et |SE| et
doivent être séparés par des virgules).
\medskip
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
\NiceMatrixOptions{cell-space-top-limit=3pt}
-\begin{NiceTabular}{*{6}{c}}[~emphase#corners=NE@,hvlines]
+\begin{NiceTabular}{*{6}{c}}[\emph{corners=NE},hvlines]
1\\
1&1\\
1&2&1\\
@@ -1477,7 +1510,7 @@ doivent être séparés par des virgules).
1&4&6&4&1\\
& & & & &1
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{*{6}{c}}%
[c,corners=NE,hvlines,cell-space-top-limit=3pt]
1\\
@@ -1506,15 +1539,15 @@ elle est utilisée dans une case, de couper cette case selon une diagonale
descendante.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$\begin{NiceArray}{*{5}{c}}[hvlines]
-~emphase#\diagbox{x}{y}@ & e & a & b & c \\
+\emph{\diagbox{x}{y}} & e & a & b & c \\
e & e & a & b & c \\
a & a & e & c & b \\
b & b & c & e & a \\
c & c & b & a & e
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{NiceArray}{*{5}{c}}[hvlines]
\diagbox{x}{y} & e & a & b & c \\
e & e & a & b & c \\
@@ -1599,8 +1632,8 @@ avec une couleur spécifique (et ces filets respecteront les blocs et les coins
comme les autres filets de \pkg{nicematrix}).
\medskip
-\begin{Verbatim}
-\begin{NiceTabular}{lcIcIc}~emphase#[custom-line = {letter=I, color=blue}]@
+\begin{Code}
+\begin{NiceTabular}{lcIcIc}\emph{[custom-line = {letter=I, color=blue}]}
\hline
& \Block{1-3}{dimensions} \\
& L & l & h \\
@@ -1610,7 +1643,7 @@ Produit B & 1 & 3 & 4 \\
Produit C & 5 & 4 & 1 \\
\hline
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -1647,14 +1680,14 @@ calculée à partir des caractéristiques fournies par la clé |tikz|).
\bigskip
Voici ce que l'on obtient avec la clé |dotted| de TikZ.
-\begin{Verbatim}
+\begin{Code}
\NiceMatrixOptions
{
custom-line =
{
letter = I ,
- ~emphase#tikz = dotted @ ,
- ~emphase#total-width = \pgflinewidth@
+ \emph{tikz = dotted ,
+ total-width = \pgflinewidth}
}
}
@@ -1663,7 +1696,7 @@ un & deux & trois \\
quatre & cinq & six \\
sept & huit & neuf
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\NiceMatrixOptions
@@ -1707,8 +1740,8 @@ pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions d
(par exemple pour les remplacer par des lignes en tiretés).}
\smallskip
-\begin{BVerbatim}
-% ~textsl#présent dans nicematrix.sty@
+\begin{Code}
+% présent dans nicematrix.sty
\NiceMatrixOptions
{
custom-line =
@@ -1719,22 +1752,22 @@ pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions d
dotted
}
}
-\end{BVerbatim}
+\end{Code}
\bigskip
Il est donc possible d'utiliser les commandes |\hdottedline| et |\cdottedline|
pour tracer des filets horizontaux en pointillés.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
+\begin{Code}[width=9.5cm]
\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
-~emphase#\hdottedline@
+\emph{\hdottedline}
6 & 7 & 8 & 9 & 10 \\
-~emphase#\cdottedline{1,4-5}@
+\emph{\cdottedline{1,4-5}}
11 & 12 & 13 & 14 & 15
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
\hdottedline
@@ -1750,13 +1783,13 @@ Dans les environnements avec un préambule explicite (comme |{NiceTabular}|,
pointillés avec le spécificateur «|:|».
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{pNiceArray}{cccc~emphase#:@c}
+\begin{Code}[width=9.5cm]
+\begin{pNiceArray}{cccc\emph{:}c}
1 & 2 & 3 & 4 & 5 \\
6 & 7 & 8 & 9 & 10 \\
11 & 12 & 13 & 14 & 15
\end{pNiceArray}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceArray}{cccc:c}
1 & 2 & 3 & 4 & 5 \\
6 & 7 & 8 & 9 & 10 \\
@@ -1836,14 +1869,15 @@ exécuté avant le tracé du tableau. Une syntaxe alternative est proposée : on
peut placer le contenu de ce |code-before| entre les mots-clés |\CodeBefore| et
|\Body| juste au début de l'environnement.
-\begin{Verbatim}
-\begin{pNiceArray}{~textsl#preamble@}
-~emphase#\CodeBefore [~textsl#options@]@
- ~textsl#instructions du code-before@
-~emphase#\Body@
- ~textsl#contenu de l'environnement@
+\smallskip
+\begin{Code}
+\begin{pNiceArray}{\textsl{preamble}}
+\emph{\CodeBefore [\textsl{options}]}
+ \textsl{instructions du code-before}
+\emph{\Body}
+ \textsl{contenu de l’environnement}
\end{pNiceArray}
-\end{Verbatim}
+\end{Code}
\smallskip
L'argument optionnel entre crochets est une liste de couples \textsl{clé=valeur}
@@ -1918,16 +1952,16 @@ colonne avec la syntaxe~-$j$.
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
- ~emphase#\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}@
+ \emph{\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}}
\Body
a & b & c \\
e & f & g \\
h & i & j \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}
@@ -1947,16 +1981,16 @@ la case en haut à gauche et la case en bas à droite du rectangle.
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
- ~emphase#\rectanglecolor{blue!15}{2-2}{3-3}@
+ \emph{\rectanglecolor{blue!15}{2-2}{3-3}}
\Body
a & b & c \\
e & f & g \\
h & i & j \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\rectanglecolor{blue!15}{2-2}{3-3}
@@ -1983,16 +2017,16 @@ couleurs.
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
$\begin{pNiceMatrix}[r,margin]
\CodeBefore
- ~emphase#\chessboardcolors{red!15}{blue!15}@
+ \emph{\chessboardcolors{red!15}{blue!15}}
\Body
1 & -1 & 1 \\
-1 & 1 & -1 \\
1 & -1 & 1
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[baseline=1, r, margin]
\CodeBefore
\chessboardcolors{red!15}{blue!15}
@@ -2019,10 +2053,10 @@ toutes les rangées à partir de la rangée~$a$).
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
+\begin{Code}[width=9cm]
$\begin{NiceArray}{lll}[hvlines]
\CodeBefore
- ~emphase#\rowcolor{red!15}{1,3-5,8-}@
+ \emph{\rowcolor{red!15}{1,3-5,8-}}
\Body
a_1 & b_1 & c_1 \\
a_2 & b_2 & c_2 \\
@@ -2035,7 +2069,7 @@ a_8 & b_8 & c_8 \\
a_9 & b_9 & c_9 \\
a_{10} & b_{10} & c_{10} \\
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
%
$\begin{NiceArray}{lll}[baseline=4,hvlines]
\CodeBefore
@@ -2102,10 +2136,10 @@ tableau pour englober les blocs (créés par la commande |\Block| : cf.~p.~\page
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{NiceTabular}{clr}[hvlines]
\CodeBefore
- ~emphase#\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]@
+ \emph{\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]}
\Body
\Block{1-*}{Résultats} \\
\Block{2-1}{A}& Pierre & 12 \\
@@ -2115,7 +2149,7 @@ tableau pour englober les blocs (créés par la commande |\Block| : cf.~p.~\page
& Henri & 14 \\
& Estelle & 15
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{clr}[hvlines,baseline=2]
\CodeBefore
\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]
@@ -2135,10 +2169,10 @@ tableau pour englober les blocs (créés par la commande |\Block| : cf.~p.~\page
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
\begin{NiceTabular}{lr}[hvlines]
\CodeBefore
- ~emphase#\rowcolors{1}{blue!10}{}[respect-blocks]@
+ \emph{\rowcolors{1}{blue!10}{}[respect-blocks]}
\Body
\Block{2-1}{Pierre} & 12 \\
& 13 \\
@@ -2151,7 +2185,7 @@ Henri & 14 \\
\Block{2-1}{Estelle} & 15 \\
& 19
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{lr}[hvlines,baseline=c]
\CodeBefore
\rowcolors{1}{blue!10}{}[respect-blocks]
@@ -2177,10 +2211,10 @@ qui est une liste de couleurs séparées par des virgules. Dans cette liste, le
symbole |=| représente une couleur identique à la précédente.
\smallskip
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{c}
\CodeBefore
- ~emphase#\rowlistcolors{1}{red!15,blue!15,green!15}@
+ \emph{\rowlistcolors{1}{red!15,blue!15,green!15}}
\Body
Mathilde \\
Pierre \\
@@ -2190,7 +2224,7 @@ Jacques \\
Antoine \\
Stéphanie \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{c}
\CodeBefore
\rowlistcolors{1}{red!15,blue!15,green!15}
@@ -2217,12 +2251,12 @@ avec |\resetcolorseries|\footnote{Pour l'initialisation, on a
\index{resetcolorseries@\texttt{\textbackslash resetcolorseries} (commande de \pkg{xcolor})}
\smallskip
-\begin{BVerbatim}[boxwidth=12cm,baseline=c]
+\begin{Code}[width=12cm]
\begin{NiceTabular}{c}
\CodeBefore
- ~emphase#\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}@
- ~emphase#\resetcolorseries{\value{iRow}}{BlueWhite}@
- ~emphase#\rowlistcolors{1}{BlueWhite!!+}@
+ \emph{\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
+ \resetcolorseries{\value{iRow}}{BlueWhite}
+ \rowlistcolors{1}{BlueWhite!!+}}
\Body
Mathilde \\
Pierre \\
@@ -2232,7 +2266,7 @@ Jacques \\
Antoine \\
Stéphanie \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{c}
\CodeBefore
\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
@@ -2260,10 +2294,10 @@ utilise la clé |corners| pour demander de considérer le coin \emph{north east}
\index{corners (clé d'un environnement)|textit}
\begin{scope}
\hfuzz=11cm
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
-\begin{NiceTabular}{cccccc}[~emphase#corners=NE@,margin,hvlines,first-row,first-col]
+\begin{Code}[width=9cm]
+\begin{NiceTabular}{cccccc}[\emph{corners=NE},margin,hvlines,first-row,first-col]
\CodeBefore
- ~emphase#\rowlistcolors{1}{blue!15, }@
+ \emph{\rowlistcolors{1}{blue!15, }}
\Body
& 0 & 1 & 2 & 3 & 4 & 5 & 6 \\
0 & 1 \\
@@ -2274,7 +2308,7 @@ utilise la clé |corners| pour demander de considérer le coin \emph{north east}
5 & 1 & 5 & 10 & 10 & 5 & 1 \\
6 & 1 & 6 & 15 & 20 & 15 & 6 & 1 \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
@@ -2307,11 +2341,11 @@ Dans l'exemple suivant, on demande explicitement le coloriage de la colonne~$0$
\medskip
\begin{scope}
\hfuzz=11cm
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
-\begin{NiceTabular}{cccccc}[~emphase#corners=NE@,margin,hvlines,first-row,first-col]
+\begin{Code}[width=9cm]
+\begin{NiceTabular}{cccccc}[\emph{corners=NE},margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
- ~emphase#\columncolor{red!15}{0}@
+ \emph{\columncolor{red!15}{0}}
\Body
& 0 & 1 & 2 & 3 & 4 & 5 & 6 \\
0 & 1 \\
@@ -2322,7 +2356,7 @@ Dans l'exemple suivant, on demande explicitement le coloriage de la colonne~$0$
5 & 1 & 5 & 10 & 10 & 5 & 1 \\
6 & 1 & 6 & 15 & 20 & 15 & 6 & 1 \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
@@ -2349,27 +2383,27 @@ l'extension \pkg{booktabs} n'est \emph{pas} chargée par \pkg{nicematrix}.
\index{rotate@\texttt{\textbackslash rotate}|textit}
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
+\begin{Code}[width=8.5cm]
\begin{NiceTabular}{lSSSS}
\CodeBefore
\rowcolor{red!15}{1-2}
\rowcolors{3}{blue!15}{}
\Body
-~emphase#\toprule@
+\emph{\toprule}
\Block{2-1}{Produit} &
\Block{1-3}{dimensions (cm)} & & &
\Block{2-1}{\rotate Prix} \\
-~emphase#\cmidrule(rl){2-4}@
+\emph{\cmidrule(rl){2-4}}
& L & l & h \\
-~emphase#\midrule@
+\emph{\midrule}
petit & 3 & 5.5 & 1 & 30 \\
moyen & 5.5 & 8 & 1.5 & 50.5 \\
premium & 8.5 & 10.5 & 2 & 80 \\
extra & 8.5 & 10 & 1.5 & 85.5 \\
spécial & 12 & 12 & 0.5 & 70 \\
-~emphase#\bottomrule@
+\emph{\bottomrule}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}[c]{lSSSS}
\CodeBefore
\rowcolor{red!15}{1-2}
@@ -2440,11 +2474,11 @@ Ces commandes sont compatibles avec les commandes pour les \emph{overlays} de
Beamer (comme |\only|, etc.)
\medskip
-\begin{Verbatim}
-\NewDocumentCommand { \Blue } { } {~emphase#\columncolor{blue!15}@}
+\begin{Code}
+\NewDocumentCommand { \Blue } { } {\emph{\columncolor{blue!15}}}
\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
\toprule
-~emphase#\rowcolor{red!15}@
+\emph{\rowcolor{red!15}}
Nom & Prénom & Année de naissance \\
\midrule
Achard & Jacques & 5 juin 1962 \\
@@ -2453,7 +2487,7 @@ Vanesse & Stéphanie & 30 octobre 1994 \\
Dupont & Chantal & 15 janvier 1998 \\
\bottomrule
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -2483,19 +2517,19 @@ En particulier, on peut engager un coloriage des rangées avec
|\rowlistcolors{...}| et l'arrêter par un |\rowlistcolors{}| avec argument vide.
\bigskip
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{c}[hvlines,color-inside]
un \\
deux \\
-~emphase#\rowlistcolors{red!15}@
+\emph{\rowlistcolors{red!15}}
trois \\
quatre \\
cinq \\
-~emphase#\rowlistcolors{}@
+\emph{\rowlistcolors{}}
six \\
sept \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{c}[hvlines,color-inside]
un \\
deux \\
@@ -2563,16 +2597,16 @@ soient en mode texte ou bien en mode mathématique.
\end{itemize}
\medskip
-\begin{BVerbatim}[boxwidth=12cm,baseline=c]
+\begin{Code}[width=12cm]
\begin{NiceTabular}{cccc}
\hline
-~emphase#\RowStyle[cell-space-limits=3pt]{\rotate}@
+\emph{\RowStyle[cell-space-limits=3pt]{\rotate}}
premier & deuxième & troisième & quatrième \\
-~emphase#\RowStyle[nb-rows=2,color=white,rowcolor=blue!50]{\sffamily}@
+\emph{\RowStyle[nb-rows=2,color=white,rowcolor=blue!50]{\sffamily}}
1 & 2 & 3 & 4 \\
I & II & III & IV
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\index{rotate@\texttt{\textbackslash rotate}|textit}
\begin{NiceTabular}{cccc}
\hline
@@ -2598,13 +2632,13 @@ Dans les environnements avec un préambule explicite (comme |{NiceTabular}|,
lettres classiques |w|, |W|, |p|, |b| et |m| de l'extension \pkg{array}.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
-\begin{NiceTabular}{~emphase#W{c}{2cm}@cc}[hvlines]
+\begin{Code}[width=9cm]
+\begin{NiceTabular}{\emph{W{c}{2cm}}cc}[hvlines]
Paris & New York & Madrid \\
Berlin & London & Roma \\
Rio & Tokyo & Oslo
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{W{c}{2cm}cc}[hvlines]
Paris & New York & Madrid \\
Berlin & London & Roma \\
@@ -2620,13 +2654,13 @@ colonnes extérieures: cf. p.~\pageref{exterior}) directement avec l'option
|columns-width|.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{pNiceMatrix}[~emphase#columns-width = 1cm@]
+\begin{Code}[width=10cm]
+$\begin{pNiceMatrix}[\emph{columns-width = 1cm}]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[columns-width = 1cm]
1 & 12 & -123 \\
12 & 0 & 0 \\
@@ -2647,13 +2681,13 @@ case la plus large du tableau.\footnote{Le résultat est atteint dès la premiè
un message demandant une deuxième compilation apparaîtra).}\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{pNiceMatrix}[~emphase#columns-width = auto@]
+\begin{Code}[width=10cm]
+$\begin{pNiceMatrix}[\emph{columns-width = auto}]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[columns-width = auto]
1 & 12 & -123 \\
12 & 0 & 0 \\
@@ -2666,8 +2700,8 @@ colonnes de tous les tableaux dans une certaine portion de document avec la
commande |\NiceMatrixOptions|.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-~emphase#\NiceMatrixOptions{columns-width=10mm}@
+\begin{Code}[width=8.5cm]
+\emph{\NiceMatrixOptions{columns-width=10mm}}
$\begin{pNiceMatrix}
a & b \\ c & d
\end{pNiceMatrix}
@@ -2675,7 +2709,7 @@ a & b \\ c & d
\begin{pNiceMatrix}
1 & 1245 \\ 345 & 2
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{columns-width=10mm}
$\begin{pNiceMatrix}
@@ -2704,8 +2738,8 @@ la commande |\Block| présentée précédemment dans ce document
(cf.~p.~\pageref{Block}).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@
+\begin{Code}[width=8.5cm]
+\emph{\begin{NiceMatrixBlock}[auto-columns-width]}
$\begin{array}{c}
\begin{bNiceMatrix}
9 & 17 \\ -2 & 5
@@ -2714,8 +2748,8 @@ $\begin{array}{c}
1 & 1245345 \\ 345 & 2
\end{bNiceMatrix}
\end{array}$
-~emphase#\end{NiceMatrixBlock}@
-\end{BVerbatim}
+\emph{\end{NiceMatrixBlock}}
+\end{Code}
\begin{NiceMatrixBlock}[auto-columns-width]
$\begin{array}{c}
\begin{bNiceMatrix}
@@ -2767,13 +2801,13 @@ suivi de |\arraybackslash|).
et |b|). La valeur par défaut est |t|.
\end{itemize}
-\begin{Verbatim}
-\begin{NiceTabular}~emphase#[width=9cm]{X[2,l]X[l]}@[hvlines]
+\begin{Code}
+\begin{NiceTabular}\emph{[width=9cm]{X[2,l]X[l]}}[hvlines]
Un texte relativement long qui tient sur plusieurs lignes. &
Un texte relativement long qui tient sur plusieurs lignes. \\
Un texte plus court. & Un texte plus court.
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -2800,15 +2834,15 @@ largeur d'une boîte |{varwidth}| est la largeur naturelle de son contenu.
Cela est illustré avec les exemples suivants :
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=6cm]
+\begin{Code}[width=6cm]
\fbox{%
-\begin{~emphase#varwidth@}{8cm}
+\begin{\emph{varwidth}}{8cm}
\begin{itemize}
\item premier item
\item deuxième item
\end{itemize}
-\end{~emphase#varwidth@}}
-\end{BVerbatim}
+\end{\emph{varwidth}}}
+\end{Code}
\fbox{\begin{varwidth}{8cm}
\begin{itemize}
\item premier item
@@ -2817,15 +2851,15 @@ Cela est illustré avec les exemples suivants :
\end{varwidth}}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=6cm]
+\begin{Code}[width=6cm]
\fbox{%
-\begin{~emphase#minipage@}{8cm}
+\begin{\emph{minipage}}{8cm}
\begin{itemize}
\item premier item
\item deuxième item
\end{itemize}
-\end{~emphase#minipage@}}
-\end{BVerbatim}
+\end{\emph{minipage}}}
+\end{Code}
\fbox{\begin{minipage}{8cm}
\begin{itemize}
\item premier item
@@ -2844,13 +2878,13 @@ Lorsque l'extension \pkg{varwidth} est chargée, ces colonnes |V| de
\pkg{varwidth} sont prises en charge par \pkg{nicematrix}.
\medskip
-\begin{Verbatim}
-\begin{NiceTabular}[corners=NW,hvlines]{~emphase#V{3cm}V{3cm}V{3cm}@}
+\begin{Code}
+\begin{NiceTabular}[corners=NW,hvlines]{\emph{V{3cm}V{3cm}V{3cm}}}
& un texte & un très très très très long texte \\
un très très très très long texte \\
un très très très très long texte
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\medskip
\begin{center}
@@ -2897,8 +2931,8 @@ colonnes «extérieures» grâce aux options |first-row|, |last-row|, |first-col
Si elle est présente, la «première rangée» (extérieure) est numérotée par $0$
(et non $1$). Il en est de même pour la «première colonne».
-\begin{Verbatim}
-$\begin{pNiceMatrix}[~emphase#first-row,last-row,first-col,last-col@,nullify-dots]
+\begin{Code}
+$\begin{pNiceMatrix}[\emph{first-row,last-row,first-col,last-col},nullify-dots]
& C_1 & \Cdots & & C_4 & \\
L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
\Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -2906,7 +2940,7 @@ L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
L_4 & a_{41} & a_{42} & a_{43} & a_{44} & L_4 \\
& C_1 & \Cdots & & C_4 &
\end{pNiceMatrix}$
-\end{Verbatim}
+\end{Code}
%
\[\begin{pNiceMatrix}[first-row,last-row,first-col,last-col,nullify-dots]
& C_1 & \Cdots & & C_4 & \\
@@ -2970,11 +3004,11 @@ On peut contrôler l'apparence de ces rangées et colonnes avec les options
|code-for-last-col|. Ces options sont des listes de tokens qui seront insérées
au début de chaque case de la rangée ou de la colonne considérée.
-\begin{Verbatim}
-\NiceMatrixOptions{~emphase#code-for-first-row@ = \color{red},
- ~emphase#code-for-first-col@ = \color{blue},
- ~emphase#code-for-last-row@ = \color{green},
- ~emphase#code-for-last-col@ = \color{magenta}}
+\begin{Code}
+\NiceMatrixOptions{\emph{code-for-first-row} = \color{red},
+ \emph{code-for-first-col} = \color{blue},
+ \emph{code-for-last-row} = \color{green},
+ \emph{code-for-last-col} = \color{magenta}}
$\begin{pNiceArray}{cc|cc}[first-row,last-row=5,first-col,last-col,nullify-dots]
& C_1 & \Cdots & & C_4 & \\
L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
@@ -2984,7 +3018,7 @@ L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
L_4 & a_{41} & a_{42} & a_{43} & a_{44} & L_4 \\
& C_1 & \Cdots & & C_4 &
\end{pNiceArray}$
-\end{Verbatim}
+\end{Code}
%
\begin{scope}
\NiceMatrixOptions{code-for-first-row = \color{red},
@@ -3066,15 +3100,15 @@ avec l'option~|color|.\footnote{Il est aussi possible de changer la couleur de
p.~\pageref{customization}. }\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
a_1 & \Cdots & & & a_1 \\
\Vdots & a_2 & \Cdots & & a_2 \\
- & \Vdots & \Ddots[color=red] \\
+ & \Vdots & \emph{\Ddots[color=red]} \\
\\
a_1 & a_2 & & & a_n
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
a_1 & \Cdots & & & a_1 \\
\Vdots & a_2 & \Cdots & & a_2 \\
@@ -3088,13 +3122,13 @@ a_1 & a_2 & & & a_n
codage suivant :\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
0 & \Cdots & 0 \\
\Vdots & & \Vdots \\
0 & \Cdots & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & 0 \\
\Vdots & & \Vdots \\
@@ -3108,14 +3142,14 @@ colonne. Il est possible d'utiliser la même méthode avec \pkg{nicematrix}
:\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
0 & \Cdots & \Cdots & 0 \\
\Vdots & & & \Vdots \\
\Vdots & & & \Vdots \\
0 & \Cdots & \Cdots & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & \Cdots & 0 \\
\Vdots & & & \Vdots \\
@@ -3132,14 +3166,14 @@ En fait, dans cet exemple, il aurait été possible de tracer la même matrice p
rapidement avec le codage suivant (parmi d'autres) :\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
0 & \Cdots & & 0 \\
\Vdots & & & \\
& & & \Vdots \\
0 & & \Cdots & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & & 0 \\
\Vdots & & & \\
@@ -3164,13 +3198,13 @@ commande~|\Hspace| qui est une variante de |\hspace| transparente pour la
construction des lignes en pointillés de \pkg{nicematrix}.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
-0 & \Cdots & ~emphase#\Hspace*{1cm}@ & 0 \\
-\Vdots & & & \Vdots \\~emphase#[1cm]@
+0 & \Cdots & \emph{\Hspace*{1cm}} & 0 \\
+\Vdots & & & \Vdots \\\emph{[1cm]}
0 & \Cdots & & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & \Hspace*{1cm} & 0 \\
\Vdots & & & \Vdots \\[1cm]
@@ -3185,12 +3219,12 @@ Considérons la matrice suivante qui a été composée classiquement avec
l'environnement |{pmatrix}| de \pkg{amsmath}.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$A = \begin{pmatrix}
h & i & j & k & l & m \\
x & & & & & x
\end{pmatrix}$
-\end{BVerbatim}
+\end{Code}
$A = \begin{pmatrix}
h & i & j & k & l & m \\
x & & & & & x
@@ -3202,12 +3236,12 @@ Si nous ajoutons des instructions |\ldots| dans la seconde rangée, la géométr
de la matrice est modifiée.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$B = \begin{pmatrix}
h & i & j & k & l & m \\
x & \ldots & \ldots & \ldots & \ldots & x
\end{pmatrix}$
-\end{BVerbatim}
+\end{Code}
$B = \begin{pmatrix}
h & i & j & k & l & m \\
x & \ldots & \ldots & \ldots & \ldots & x
@@ -3219,12 +3253,12 @@ Par défaut, avec \pkg{nicematrix}, si nous remplaçons |{pmatrix}| par
changée.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$C = \begin{pNiceMatrix}
h & i & j & k & l & m \\
x & \Ldots & \Ldots & \Ldots & \Ldots & x
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$C = \begin{pNiceMatrix}
h & i & j & k & l & m \\
x & \Ldots & \Ldots & \Ldots & \Ldots & x
@@ -3237,12 +3271,12 @@ seconde rangée. C'est possible en utilisant l'option |nullify-dots| (et une
seule instruction |\Ldots| suffit).\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$D = \begin{pNiceMatrix}[~emphase#nullify-dots@]
+\begin{Code}[width=10cm]
+$D = \begin{pNiceMatrix}[\emph{nullify-dots}]
h & i & j & k & l & m \\
x & \Ldots & & & & x
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$D = \begin{pNiceMatrix}[nullify-dots]
h & i & j & k & l & m \\
x & \Ldots & & & & x
@@ -3273,14 +3307,14 @@ Comme avec les autres commandes de \pkg{nicematrix} (comme |\Cdots|, |\Ldots|,
contenu des cases de part et d'autre.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=7cm]
+\begin{Code}[width=7cm]
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
-1 & ~emphase#\Hdotsfor{3}@ & 5 \\
+1 & \emph{\Hdotsfor{3}} & 5 \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
1 & \Hdotsfor{3} & 5 \\
@@ -3293,14 +3327,14 @@ Néanmoins, si ces cases sont vides, la ligne en pointillés s'étend seulement
dans les cases spécifiées par l'argument de |\Hdotsfor| (par conception).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=7cm]
+\begin{Code}[width=7cm]
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
- & ~emphase#\Hdotsfor{3}@ \\
+ & \emph{\Hdotsfor{3}} \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
& \Hdotsfor{3} \\
@@ -3325,23 +3359,27 @@ L'extension \pkg{nicematrix} propose aussi une commande |\Vdotsfor| similaire à
\medskip
L'exemple suivant utilise à la fois |\Hdotsfor| et |\Vdotsfor|:
-\begin{Verbatim}[formatcom=\small\color{gray}]
+\smallskip
+\begin{scope}
+\small
+\begin{Code}
\begin{bNiceMatrix}
C[a_1,a_1] & \Cdots & C[a_1,a_n]
& \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
\Vdots & \Ddots & \Vdots
- & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
+ & \emph{\Hdotsfor{1}} & \Vdots & \Ddots & \Vdots \\
C[a_n,a_1] & \Cdots & C[a_n,a_n]
& & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
-\rule{0pt}{15mm}\NotEmpty & ~emphase#\Vdotsfor{1}@ & & \Ddots & & ~emphase#\Vdotsfor{1}@ \\
+\rule{0pt}{15mm}\NotEmpty & \emph{\Vdotsfor{1}} & & \Ddots & & \emph{\Vdotsfor{1}} \\
C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n]
& & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
\Vdots & \Ddots & \Vdots
- & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
+ & \emph{\Hdotsfor{1}} & \Vdots & \Ddots & \Vdots \\
C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n]
& & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
\end{bNiceMatrix}
-\end{Verbatim}
+\end{Code}
+\end{scope}
\[\begin{bNiceMatrix}
@@ -3395,15 +3433,15 @@ le résultat fourni par \pkg{nicematrix}.\par\nobreak
\medskip
\begin{scope}
\NiceMatrixOptions{renew-dots,renew-matrix}
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-~emphase#\NiceMatrixOptions{renew-dots,renew-matrix}@
+\begin{Code}[width=10cm]
+\emph{\NiceMatrixOptions{renew-dots,renew-matrix}}
\begin{pmatrix}
1 & \cdots & \cdots & 1 \\
0 & \ddots & & \vdots \\
\vdots & \ddots & \ddots & \vdots \\
0 & \cdots & 0 & 1
\end{pmatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pmatrix}
1 & \cdots & \cdots & 1 \\
0 & \ddots & & \vdots \\
@@ -3429,17 +3467,17 @@ en fait composé sur un fond blanc qui est superposé sur la ligne en pointillé
(voir un exemple p.~\pageref{ex:colon}).
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$\begin{bNiceMatrix}
-1 & \hspace*{1cm} & 0 \\[8mm]
- & ~emphase#\Ddots^{n \text{ fois}}@ & \\
-0 & & 1
+1 & \hspace*{1cm} & 0 \\[8mm]
+ & \emph{\Ddots^{n \text{ fois}}} & \\
+0 & & 1
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
-1 & \hspace*{1cm} & 0 \\[8mm]
+1 & \hspace*{1cm} & 0 \\[8mm]
& \Ddots^{n \text{ fois}} & \\
-0 & & 1
+0 & & 1
\end{bNiceMatrix}$
@@ -3448,17 +3486,17 @@ $\begin{bNiceMatrix}
Avec la clé |xdots/horizontal-labels|, les labels restent horizontaux.\par\nobreak
\smallskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{bNiceMatrix}[xdots/horizontal-labels]
-1 & \hspace*{1cm} & 0 \\[8mm]
- & ~emphase#\Ddots^{n \text{ fois}}@ & \\
-0 & & 1
+\begin{Code}[width=10cm]
+$\begin{bNiceMatrix}[\emph{xdots/horizontal-labels}]
+1 & \hspace*{1cm} & 0 \\[8mm]
+ & \emph{\Ddots^{n \text{ fois}}} & \\
+0 & & 1
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[xdots/horizontal-labels]
-1 & \hspace*{1cm} & 0 \\[8mm]
+1 & \hspace*{1cm} & 0 \\[8mm]
& \Ddots^{n \text{ fois}} & \\
-0 & & 1
+0 & & 1
\end{bNiceMatrix}$
@@ -3552,9 +3590,9 @@ ronds avec TikZ :\newline \small
\url{https://tex.stackexchange.com/questions/52848/tikz-line-with-large-dots}}
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\tikz \draw [dotted] (0,0) -- (5,0) ;
-\end{BVerbatim}
+\end{Code}
\tikz \draw [dotted] (0,0) -- (5,0) ;
\medskip
@@ -3575,8 +3613,8 @@ d'options TikZ applicables à un chemin (à l'exception de «|color|»,
Voici par exemple une matrice tridiagonale avec le style |loosely dotted| :\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c]
-$\begin{pNiceMatrix}[nullify-dots,~emphase#xdots/line-style=loosely dotted@]
+\begin{Code}
+$\begin{pNiceMatrix}[nullify-dots,\emph{xdots/line-style=loosely dotted}]
a & b & 0 & & \Cdots & 0 \\
b & a & b & \Ddots & & \Vdots \\
0 & b & a & \Ddots & & \\
@@ -3584,7 +3622,7 @@ b & a & b & \Ddots & & \Vdots \\
\Vdots & & & & & b \\
0 & \Cdots & & 0 & b & a
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\[\begin{pNiceMatrix}[nullify-dots,xdots/line-style=loosely dotted]
@@ -3609,14 +3647,14 @@ créés par |custom-line| ne sont pas tracés dans les blocs).\footnote{En revan
(cf.~p.~\pageref{line-in-code-after}) ne crée pas de bloc.}
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{bNiceMatrix}[margin,~emphase#hvlines@]
+\begin{Code}[width=10.6cm]
+$\begin{bNiceMatrix}[margin,\emph{hvlines}]
\Block{3-3}<\LARGE>{A} & & & 0 \\
& \hspace*{1cm} & & \Vdots \\
& & & 0 \\
0 & \Cdots& 0 & 0
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[margin,hvlines]
\Block{3-3}<\LARGE>{A} & & & 0 \\
& \hspace*{1cm} & & \Vdots \\
@@ -3652,13 +3690,13 @@ Tous les délimiteurs extensibles de LaTeX peuvent être utilisés.
Voici un exemple qui utilise |\lgroup| et |\rgroup|.
\medskip
-\begin{BVerbatim}
-$\begin{NiceArray}{~emphase#\left\lgroup@ ccc~emphase#\right\rgroup@ l}
+\begin{Code}
+$\begin{NiceArray}{\emph{\left\lgroup} ccc\emph{\right\rgroup} l}
1 & 2 & 3 &
4 & 1 & 6 &
7 & 8 & 9 & \scriptstyle L_3 \gets L_3 + L_1 + L_2
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\[\begin{NiceArray}{\left\lgroup ccc\right\rgroup l}
1 & 2 & 3 & \\
@@ -3672,11 +3710,36 @@ Pour cet exemple, on aurait aussi pu utiliser |{NiceArrayWithDelims}|
et la clé |last-col| (cf. p.~\pageref{exterior}).
\bigskip
-Il y a un cas particulier : pour les délimiteurs |(|, |[| et |\{| (et les
-délimiteurs fermants correspondants), les préfixes |\left| et |\right| sont
-facultatifs.\footnote{Pour les délimiteurs \texttt{[} et \texttt{]},
- les préfixes restent obligatoires en cas de conflit de notation avec des
- crochets d'options de certains descripteurs de colonnes.}
+Il y a un cas particulier : pour les délimiteurs |(|, |[| et |\{|\footnote{ Pour
+ les accolades, la protection par la contre-oblique est obligatoire (c'est
+ pourquoi on a écrit |\{|).}, et les délimiteurs fermants correspondants, les
+préfixes |\left| et |\right| sont facultatifs.\footnote{Pour les délimiteurs
+ \texttt{[} et \texttt{]}, les préfixes restent obligatoires en cas de conflit
+ de notation avec des crochets d'options de certains descripteurs de
+ colonnes.}
+
+
+\bigskip
+Voici un exemple avec un délimiteur |\{| à gauche dans un |{NiceTabular}| (on
+remarquera la compatibilité avec la clé |t|).
+
+\smallskip
+\begin{Code}
+On définit $f$ par\quad
+\begin{NiceTabular}[t]{\{ll}
+$f(x) = 0$ & si $x$ est négatif \\
+$f(x) = 1-e^x$ & si $x$ est positif
+\end{NiceTabular}
+\end{Code}
+
+\smallskip
+\begin{center}
+On définit $f$ par\quad
+\begin{NiceTabular}[t]{\{ll}
+$f(x) = 0$ & si $x$ est négatif \\
+$f(x) = 1-e^x$ & si $x$ est positif
+\end{NiceTabular}
+\end{center}
\bigskip
Dans le cas de deux délimiteurs successifs (nécessairement un fermant suivi d'un
@@ -3684,13 +3747,13 @@ ouvrant pour une autre sous-matrice) un espace égal à |\enskip| est inséré
automatiquement.
\medskip
-\begin{BVerbatim}
-$\begin{pNiceArray}{~emphase#(c)(c)(c)@}
+\begin{Code}
+$\begin{pNiceArray}{\emph{(c)(c)(c)}}
a_{11} & a_{12} & a_{13} \\
a_{21} & \displaystyle \int_0^1\dfrac{1}{x^2+1}\,dx & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
\[\begin{pNiceArray}{(c)(c)(c)}
a_{11} & a_{12} & a_{13} \\
@@ -3761,16 +3824,16 @@ Cette commande peut par exemple être utilisée pour tracer une ligne entre deux
cases adjacentes.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
\NiceMatrixOptions{xdots/shorten = 0.6 em}
\begin{pNiceMatrix}
I & 0 & \Cdots &0 \\
0 & I & \Ddots &\Vdots\\
\Vdots &\Ddots & I &0 \\
0 &\Cdots & 0 &I
-~emphase#\CodeAfter \line{2-2}{3-3}@
+\emph{\CodeAfter \line{2-2}{3-3}}
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{xdots/shorten = 0.6 em}
$\begin{pNiceMatrix}
@@ -3788,15 +3851,15 @@ autres lignes diagonales (par défaut, les lignes tracées par |\Ddots| sont
«parallélisées» : cf.~p.~\pageref{parallelization}).
\medskip
-\begin{BVerbatim}
+\begin{Code}
\begin{bNiceMatrix}
1 & \Cdots & & 1 & 2 & \Cdots & 2 \\
0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\
\Vdots & \Ddots & & & & & \\
0 & \Cdots & 0 & 1 & 2 & \Cdots & 2
-~emphase#\CodeAfter \line[shorten=6pt]{1-5}{4-7}@
+\emph{\CodeAfter \line[shorten=6pt]{1-5}{4-7}}
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
\[\begin{bNiceMatrix}
1 & \Cdots & & 1 & 2 & \Cdots & 2 \\
0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\
@@ -3843,17 +3906,16 @@ colonne avec |@{\hspace{1.5em}}| dans le préambule du tableau.
\medskip
\begin{scope}
\hfuzz=15cm
-\fvset{commandchars=\~\#\+}%
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
-\[\begin{NiceArray}{ccc~emphase#@{\hspace{1.5em}}+c}[cell-space-limits=2pt,~emphase#margin+]
+\begin{Code}[width=11cm]
+\[\begin{NiceArray}{ccc\emph{@{\hspace{1.5em}}}c}[cell-space-limits=2pt,\emph{margin}]
1 & 1 & 1 & x \\
\dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
1 & 2 & 3 & z
\CodeAfter
- ~emphase#\SubMatrix({1-1}{3-3})+
- ~emphase#\SubMatrix({1-4}{3-4})+
+ \emph{\SubMatrix({1-1}{3-3})
+ \SubMatrix({1-4}{3-4})}
\end{NiceArray}\]
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{ccc@{\hspace{1.5em}}c}[cell-space-limits=2pt,margin]
1 & 1 & 1 & x \\
@@ -3873,13 +3935,13 @@ avec la construction suivante.
\medskip
\begin{scope}
\hfuzz=15cm
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
-$\begin{NiceArray}{~emphase#(ccc)(c)@}[cell-space-limits=2pt]
+\begin{Code}[width=11cm]
+$\begin{NiceArray}{\emph{(ccc)(c)}}[cell-space-limits=2pt]
1 & 1 & 1 & x \\
\dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
1 & 2 & 3 & z
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{(ccc)(c)}[cell-space-limits=2pt]
1 & 1 & 1 & x \\
@@ -3897,15 +3959,15 @@ exposant et en indice.
\medskip
\begin{scope}
\hfuzz=15cm
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
$\begin{bNiceMatrix}[right-margin=1em]
1 & 1 & 1 \\
1 & a & b \\
1 & c & d
\CodeAfter
- ~emphase#\SubMatrix[{2-2}{3-3}]^{T}@
+ \emph{\SubMatrix[{2-2}{3-3}]^{T}}
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[right-margin=1em]
1 & 1 & 1 \\
1 & a & b \\
@@ -3964,19 +4026,18 @@ préfixe |sub-matrix|, c'est-à-dire qu'elles sont alors nommées
\medskip
\begin{scope}
\hfuzz=12cm
-\fvset{commandchars=\~\#\!}%
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
- & & \frac12 \\
- & & \frac14 \\[1mm]
-a & b & \frac12a+\frac14b \\
-c & d & \frac12c+\frac14d \\
+ & & \frac{1}{2} \\
+ & & \frac{1}{4} \\[1mm]
+a & b & \frac{1}{2}a+\frac{1}{4}b \\
+c & d & \frac{1}{2}c+\frac{1}{4}d \\
\CodeAfter
\SubMatrix({1-3}{2-3})
\SubMatrix({3-1}{4-2})
\SubMatrix({3-3}{4-3})
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
& & \frac12 \\
@@ -3995,19 +4056,18 @@ Voici le même exemple avec la clé |slim| pour l'une des sous-matrices.
\medskip
\begin{scope}
\hfuzz=12cm
-\fvset{commandchars=\~\#\!}%
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
- & & \frac12 \\
- & & \frac14 \\[1mm]
-a & b & \frac12a+\frac14b \\
-c & d & \frac12c+\frac14d \\
+ & & \frac{1}{2} \\
+ & & \frac{1}{4} \\[1mm]
+a & b & \frac{1}{2}a+\frac{1}{4}b \\
+c & d & \frac{1}{2}c+\frac{1}{4}d \\
\CodeAfter
- \SubMatrix({1-3}{2-3})[~emphase#slim!]
+ \SubMatrix({1-3}{2-3})[\emph{slim}]
\SubMatrix({3-1}{4-2})
\SubMatrix({3-3}{4-3})
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
%
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
@@ -4044,17 +4104,17 @@ En dépit de son nom, la commande |\SubMatrix| peut également être utilisée d
|\toprule| de l'extension \pkg{booktabs}).
\smallskip
-\begin{BVerbatim}[baseline=c]
-\begin{NiceTabular}{~LetterAt{}ll~LetterAt{}}
+\begin{Code}[width=8cm]
+\begin{NiceTabular}{@{}ll@{}}
\toprule
Part A & the first part \\
\Block{2-1}{Part B} & a first sub-part \\
& a second sub-part \\
\bottomrule
\CodeAfter
- ~emphase#\SubMatrix{\{}{2-2}{3-2}{.}@
+ \emph{\emph{\SubMatrix{\{}{2-2}{3-2}{.}}}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\hspace{2cm}
\begin{NiceTabular}{@{}ll@{}}
\toprule
@@ -4069,7 +4129,7 @@ Part A & the first part \\
\vspace{1cm}
\emph{Attention} : La fonctionnalité suivante est fragile et ne fonctionne pas
-avec le cheminement |latex|--|dvips|--|ps2pdf|.\par\nobreak
+avec |latex|--|dvips|--|ps2pdf|.\par\nobreak
La clé |code| de la commande |\SubMatrix| permet d'insérer du code après la
création de la matrice. Elle a surtout pour vocation d'être utilisée pour
@@ -4081,8 +4141,7 @@ dans cette clé, les nœuds de la forme \verb+i-|j+ sont interprétés avec
\medskip
\begin{scope}
-\fvset{commandchars=\~\#\!}%
-\begin{Verbatim}
+\begin{Code}
$\begin{NiceArray}{ccc@{}w{c}{5mm}@{}ccc}
& & && -1 & 1 & 2 \\
& & && 0 & 3 & 4 \\
@@ -4091,12 +4150,12 @@ $\begin{NiceArray}{ccc@{}w{c}{5mm}@{}ccc}
0 & 4 & 5 && 0 & 12 & 41 \\
0 & 0 & 6 && 0 & 0 & 30
\CodeAfter
- ~emphase#\NewDocumentCommand{\MyDraw}{}{\tikz \draw [blue] (2-|1) -| (3-|2) -| (4-|3) ;}!
- \SubMatrix({1-5}{3-7})[~emphase#code = \MyDraw!]
- \SubMatrix({4-1}{6-3})[~emphase#code = \MyDraw!]
- \SubMatrix({4-5}{6-7})[~emphase#code = \MyDraw!]
+ \emph{\NewDocumentCommand{\MyDraw}{}{\tikz \draw [blue] (2-|1) -| (3-|2) -| (4-|3) ;}}
+ \SubMatrix({1-5}{3-7})[\emph{code = \MyDraw}]
+ \SubMatrix({4-1}{6-3})[\emph{code = \MyDraw}]
+ \SubMatrix({4-5}{6-7})[\emph{code = \MyDraw}]
\end{NiceArray}$
-\end{Verbatim}
+\end{Code}
\end{scope}
@@ -4144,15 +4203,15 @@ numéro de rangée et $j$ le numéro de colonne ;
\end{itemize}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
\CodeAfter
- ~emphase#\OverBrace{1-1}{2-3}{A}@
- ~emphase#\OverBrace{1-4}{2-6}{B}@
+ \emph{\OverBrace{1-1}{2-3}{A}
+ \OverBrace{1-4}{2-6}{B}}
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
@@ -4192,15 +4251,15 @@ c'est la position du filet vertical éventuel qui est utilisée (de même pour
\end{itemize}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
\CodeAfter
- \OverBrace~emphase#[shorten,yshift=3pt]@{1-1}{2-3}{A}
- \OverBrace~emphase#[shorten,yshift=3pt]@{1-4}{2-6}{B}
+ \OverBrace\emph{[shorten,yshift=3pt]}{1-1}{2-3}{A}
+ \OverBrace\emph{[shorten,yshift=3pt]}{1-4}{2-6}{B}
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
@@ -4224,7 +4283,7 @@ exécute avec TikZ le chemin rectangulaire qui correspond à chaque case du tabl
avec comme paramètres TikZ l'argument de |\TikzEveryCell|. Cet argument doit
être une liste de couples \textsl{clé=valeur} applicables à un chemin
TikZ. En fait, cette commande s'applique à chaque case du tableau, exceptées
-celles situées dans les rangées et colonnes extérieures (cf.~p.~\pageref{exterior})o et celles situées dans
+celles situées dans les rangées et colonnes extérieures (cf.~p.~\pageref{exterior}) et celles situées dans
les coins vides (quand la clé |corners| est utilisée: cf.~p.~\pageref{corners}). Elle s'applique en fait à
chaque bloc (sauf ceux qui ont la clé |transparent|) et ne s'applique pas aux
cases situées dans ces blocs.
@@ -4241,7 +4300,7 @@ l'argument de |\TikzEveryCell|.
\medskip
\begingroup
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\renewcommand{\arraystretch}{1.3}
\begin{NiceTabular}{ccc}[corners]
@@ -4250,9 +4309,9 @@ l'argument de |\TikzEveryCell|.
& cell 1 1 & cell 1 2 \\
& cell 2 1 & cell 2 2
\CodeAfter
- ~emphase#\TikzEveryCell{offset=1pt,draw}@
+ \emph{\TikzEveryCell{offset=1pt,draw}}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\renewcommand{\arraystretch}{1.3}
\begin{NiceTabular}{ccc}[corners]
& \Block{1-2}{columns} \\
@@ -4363,8 +4422,6 @@ l'extension \pkg{xcolor} et elle n'est pas parfaitement compatible avec
\subsection{Les notes de tableaux}
\index{nota@\textbf{Notes dans les tableaux}|(}
-
-
\label{tabularnote}
\index{tabularnote@\texttt{\textbackslash tabularnote}}
@@ -4381,23 +4438,20 @@ En fait, cette commande n'est disponible que si l'extension \pkg{enumitem} a ét
chargée (avant ou après \pkg{nicematrix}). Les notes sont en effet composées en
fin de tableau selon un type de liste défini par l'extension \pkg{enumitem}.
-\begin{scope}
-\fvset{commandchars=\~\#\!}
-\begin{Verbatim}
+\begin{Code}
\begin{NiceTabular}{@{}llr@{}}
\toprule \RowStyle{\bfseries}
Nom & Prénom & Date de naissance \\
\midrule
-Achard~emphase#\tabularnote{La famille Achard est une très ancienne famille du Poitou.}!
+Achard\emph{\tabularnote{La famille Achard est une très ancienne famille du Poitou.}}
& Jacques & 5 juin 1962 \\
-Lefebvre~emphase#\tabularnote{Le patronyme Lefebvre est une altération de Lefébure.}!
+Lefebvre\emph{\tabularnote{Le patronyme Lefebvre est une altération de Lefébure.}}
& Mathilde & 23 mai 1988 \\
Vanesse & Stéphanie & 30 octobre 1994 \\
Dupont & Chantal & 15 janvier 1998 \\
\bottomrule
\end{NiceTabular}
-\end{Verbatim}
-\end{scope}
+\end{Code}
\begin{center}
\begin{NiceTabular}{@{}llr@{}}
@@ -4475,35 +4529,37 @@ Voir sur la table \ref{t:tabularnote}, p.~\pageref{t:tabularnote}, certaines de
remarques illustrées. Cette table a été composée avec le code suivant
(l'extension \pkg{caption} a été chargée dans ce document).
-\begin{center}
-\fvset{commandchars=\~\#\!}
-\begin{Verbatim}[formatcom=\small\color{gray}]
-\begin{table}
+\bigskip
+\begin{scope}
+\small
+\begin{Code}
+\begin{table}[hbt]
\centering
\NiceMatrixOptions{caption-above}
\begin{NiceTabular}{@{}llc@{}}%
[
caption = Un tableau dont la légende a été rentrée avec la clé \texttt{caption}%
- ~emphase#\tabularnote[$\star$]{On peut mettre une note dans la légende.}! ,
- label = t:tabularnote ,
+ \emph{\tabularnote[$\star$]{On peut mettre une note dans la légende.}} ,
+ label = t:tabularnote,
tabularnote = Un peu de texte avant les notes. ,
notes/bottomrule
]
\toprule
-Nom & Prénom & Durée de vie \\
+Nom & Prénom & Durée de vie \\
\midrule
-Barrère & Bertrand & 86\\
-Nightingale~emphase#\tabularnote{Souvent considérée comme la première!
- ~emphase#infirmière.}\tabularnote{Surnommée «la Dame à la Lampe».}!
-& Florence~emphase#\tabularnote{Cette note est commune à deux appels de notes.}! & 90 \\
-Schœlcher & Victor & 89~emphase#\tabularnote{L'appel de note déborde à droite.}!\\
-Touchet & Marie~emphase#\tabularnote{Cette note est commune à deux appels de notes.}! & 89 \\
-Wallis & John & 87 \\
+Barrère & Bertrand & 86\\
+Nightingale\emph{\tabularnote{Souvent considérée comme la première infirmière.}%
+ \tabularnote{Surnommée «la Dame à la Lampe».}}
+ & Florence\emph{\tabularnote{Cette note est commune à deux appels de notes.}} & 90 \\
+Schœlcher & Victor & 89\emph{\tabularnote{L’appel de note déborde à droite.}} \\
+Touchet & Marie\emph{\tabularnote{Cette note est commune à deux appels de notes.}} & 89 \\
+Wallis & John & 87 \\
\bottomrule
\end{NiceTabular}
\end{table}
-\end{Verbatim}
-\end{center}
+\end{Code}
+\end{scope}
+
\begin{table}[hbt]
\centering
@@ -4523,7 +4579,7 @@ Barrère & Bertrand & 86\\
Nightingale\tabularnote{Souvent considérée comme la première
infirmière.}\tabularnote{Surnommée «la Dame à la Lampe».}
& Florence\tabularnote{Cette note est commune à deux appels de notes.} & 90 \\
-Schœlcher & Victor & 89\tabularnote{L'appel de note déborde à droite.}\\
+Schœlcher & Victor & 89\tabularnote{L’appel de note déborde à droite.}\\
Touchet & Marie\tabularnote{Cette note est commune à deux appels de notes.} & 89 \\
Wallis & John & 87 \\
\bottomrule
@@ -4564,10 +4620,11 @@ Pour la commodité, il est aussi possible de fixer ces clés dans
paires \textsl{clé=valeur} où le nom des clés n'a plus à être préfixé par
|notes|:
\begin{center}
-\begin{BVerbatim}[formatcom = \small \color{gray}]
+\small
+\begin{Code}
\NiceMatrixOptions
{
- notes =
+ \emph{notes} =
{
bottomrule ,
style = ... ,
@@ -4580,7 +4637,7 @@ paires \textsl{clé=valeur} où le nom des clés n'a plus à être préfixé par
}
}
}
-\end{BVerbatim}
+\end{Code}
\end{center}
@@ -4626,9 +4683,9 @@ Valeur initiale : |\textsuperscript{#1}|
Pour la composition du français, il est de tradition de mettre un petit espace
avant l'appel de note. On peut faire ce réglage de la manière suivante :
-\begin{Verbatim}
-\NiceMatrixOptions{notes/label-in-tabular = \,\textsuperscript{~#1}}
-\end{Verbatim}
+\begin{Code}
+\NiceMatrixOptions{notes/label-in-tabular = \,\textsuperscript{#1}}
+\end{Code}
\item La clé |notes/label-in-list| est une commande dont l'argument est
@@ -4641,9 +4698,11 @@ Valeur initiale : |\textsuperscript{#1}|
Pour la composition du français, on ne compose pas les labels des notes en
lettres supérieures dans la liste des notes. On pourra donc prendre le réglage
suivant :
-\begin{Verbatim}
-\NiceMatrixOptions{notes/label-in-list = ~#1.\nobreak\hspace{0.25em}}
-\end{Verbatim}
+
+\begin{Code}
+\NiceMatrixOptions{notes/label-in-list = #1.\nobreak\hspace{0.25em}}
+\end{Code}
+
La commande |\nobreak| est pour le cas où l'option |para| est utilisée.
@@ -4710,13 +4769,14 @@ Pour un exemple de personnalisation des notes de tableau, voir p.~\pageref{ex:no
Si vous souhaitez utiliser les environnements |{NiceTabular}|, |{NiceTabular*}|
ou |{NiceTabularX}| dans un environnement |{threeparttable}| de l'extension
éponyme, vous devez patcher l'environnement |{threeparttable}| avec le code
-suivant (avec une version de LaTeX postérieure à 2020/10/01).
-\begin{Verbatim}[commandchars=\~\#\!]
+suivant.
+
+\begin{Code}
\makeatletter
\AddToHook{env/threeparttable/begin}
{\TPT@hookin{NiceTabular}\TPT@hookin{NiceTabular*}\TPT@hookin{NiceTabularX}}
\makeatother
-\end{Verbatim}
+\end{Code}
Néanmoins, les fonctionnalités proposées par \pkg{nicematrix} rendent peu utile
l'utilisation de \pkg{threeparttable} en conjonction avec \pkg{nicematrix} (voir
@@ -4758,8 +4818,8 @@ Cette clé est disponible dans tous les environnements et commandes de
|\NiceMatrixOptions|.
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{NiceTabular}{ccc}[hvlines,~emphase#rounded-corners@]
+\begin{Code}[width=9.5cm]
+\begin{NiceTabular}{ccc}[hvlines,\emph{rounded-corners}]
\CodeBefore
\rowcolor{red!15}{1}
\Body
@@ -4767,7 +4827,7 @@ Cette clé est disponible dans tous les environnements et commandes de
Arvy & Jacques & Dentiste \\
Jalon & Amandine & Dentiste \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines,rounded-corners]
\CodeBefore
\rowcolor{red!15}{1}
@@ -4793,14 +4853,14 @@ semi-transparent pour estomper le tableau (attention : certains lecteurs de
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt]
\Block{2-2}{} & & test \\
& & blabla \\
& some text & nothing
-~emphase#\CodeAfter \ShowCellNames@
+\emph{\CodeAfter \ShowCellNames}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt]
\Block{2-2}{} & & test \\
& & blabla \\
@@ -4820,15 +4880,15 @@ de type |S| de \pkg{siunitx} dans les environnements de \pkg{nicematrix}. L'impl
aucune macro privée de \pkg{siunitx}.
\medskip
-\begin{BVerbatim}[baseline = c, boxwidth = 10.6cm]
-$\begin{pNiceArray}{~emphase#S@cW{c}{1cm}c}[nullify-dots,first-row]
+\begin{Code}[width = 10.6cm]
+$\begin{pNiceArray}{\emph{S}cW{c}{1cm}c}[nullify-dots,first-row]
{C_1} & \Cdots & & C_n \\
2.3 & 0 & \Cdots & 0 \\
12.4 & \Vdots & & \Vdots \\
1.45 \\
7.2 & 0 & \Cdots & 0
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceArray}{ScW{c}{1cm}c}[nullify-dots,first-row]
{C_1} & \Cdots & & C_n \\
2.3 & 0 & \Cdots & 0 \\
@@ -4856,12 +4916,12 @@ que la commande |\pAutoNiceMatrix| et ses variantes, acceptent la clé
Les clés |l| et |r| sont des raccourcis pour |columns-type=l| et |columns-type=r|.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{bNiceMatrix}[r]
+\begin{Code}[width=10cm]
+$\begin{bNiceMatrix}\emph{[r]}
\cos x & - \sin x \\
\sin x & \cos x
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[r]
\cos x & - \sin x \\
\sin x & \cos x
@@ -4886,9 +4946,9 @@ Dans l'exemple suivant, on l'utilise dans le |code-for-first-row|.\footnote{On
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=12cm]
+\begin{Code}[width=12cm]
\NiceMatrixOptions
- {code-for-first-row = \scriptstyle ~emphase#\rotate@ \text{image de },
+ {code-for-first-row = \scriptstyle \emph{\rotate} \text{image de },
code-for-last-col = \scriptstyle }
$A = \begin{pNiceMatrix}[first-row,last-col=4]
e_1 & e_2 & e_3 \\
@@ -4896,7 +4956,7 @@ e_1 & e_2 & e_3 \\
4 & 5 & 6 & e_2 \\
7 & 8 & 9 & e_3
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{varwidth}{10cm}
\NiceMatrixOptions
{code-for-first-row = \scriptstyle\rotate \text{image de },
@@ -4920,9 +4980,9 @@ Si la commande |\rotate| est utilisée dans la «dernière rangée» (extérieur
matrice), les éléments qui subissent cette rotation sont alignés vers le haut.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=12cm]
+\begin{Code}[width=12cm]
\NiceMatrixOptions
- {code-for-last-row = \scriptstyle ~emphase#\rotate@ ,
+ {code-for-last-row = \scriptstyle \emph{\rotate} ,
code-for-last-col = \scriptstyle }
$A = \begin{pNiceMatrix}[last-row,last-col=4]
1 & 2 & 3 & e_1 \\
@@ -4930,7 +4990,7 @@ $A = \begin{pNiceMatrix}[last-row,last-col=4]
7 & 8 & 9 & e_3 \\
\text{image de } e_1 & e_2 & e_3
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{varwidth}{10cm}
\NiceMatrixOptions
{code-for-last-row = \scriptstyle\rotate ,
@@ -4970,8 +5030,8 @@ de l'\pkg{amsmath} (et les environnements |{psmallmatrix}|, |{bsmallmatrix}|,
etc. de \pkg{mathtools}).
\medskip
-\begin{Verbatim}
-$\begin{bNiceArray}{cccc|c}[~emphase#small@,
+\begin{Code}
+$\begin{bNiceArray}{cccc|c}[\emph{small},
last-col,
code-for-last-col = \scriptscriptstyle,
columns-width = 3mm ]
@@ -4979,7 +5039,7 @@ $\begin{bNiceArray}{cccc|c}[~emphase#small@,
0 & 3 & 2 & 1 & 2 & L_2 \gets 2 L_1 - L_2 \\
0 & 1 & 1 & 2 & 3 & L_3 \gets L_1 + L_3
\end{bNiceArray}$
-\end{Verbatim}
+\end{Code}
%
\[\begin{bNiceArray}{cccc|c}[small, last-col, code-for-last-col = \scriptscriptstyle, columns-width=3mm]
1 & -2 & 3 & 4 & 5 \\
@@ -5031,18 +5091,18 @@ Dans le |\CodeBefore| (cf. p. \pageref{code-before}) et dans le |\CodeAfter|
(hors potentielles colonnes extérieures).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{pNiceMatrix}%
[first-row,
first-col,
- code-for-first-row = \mathbf{~emphase#\alph{jCol}@} ,
- code-for-first-col = \mathbf{~emphase#\arabic{iRow}@} ]
+ code-for-first-row = \mathbf{\emph{\alph{jCol}}} ,
+ code-for-first-col = \mathbf{\emph{\arabic{iRow}}} ]
& & & & \\
& 1 & 2 & 3 & 4 \\
& 5 & 6 & 7 & 8 \\
& 9 & 10 & 11 & 12
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[first-row,
first-col,
code-for-first-row = \mathbf{\alph{jCol}} ,
@@ -5078,9 +5138,9 @@ simplement des tokens qui seront insérés dans chaque case de la matrice).
\medskip
-\begin{Verbatim}
-$C = ~emphase#\pAutoNiceMatrix@{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$
-\end{Verbatim}
+\begin{Code}
+$C = \emph{\pAutoNiceMatrix}{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$
+\end{Code}
\[C = \pAutoNiceMatrix{3-3}{C_{\arabic{iRow},\arabic{jCol}}}\]
@@ -5100,13 +5160,13 @@ sont considérés comme un tout.
\medskip
\begin{scope}
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{bNiceMatrix}[~emphase#light-syntax@,first-row,first-col]
+\begin{Code}[width=10cm]
+$\begin{bNiceMatrix}[\emph{light-syntax},first-row,first-col]
{} a b ;
a 2\cos a {\cos a + \cos b} ;
b \cos a+\cos b { 2 \cos b }
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
%
$\begin{bNiceMatrix}[light-syntax,first-row,first-col]
@@ -5131,6 +5191,14 @@ dans les cases du tableau.\footnote{La raison en est que lorsque l'option |light
après.}
+\medskip
+\colorbox{yellow!50}{\textbf{Nouveau 6.27}}\enskip La clé
+|light-syntax-expanded| a le même comportement que la clé |light-syntax| mais
+avec cette différence que le corps de l'environnement est complètement développé
+(au sens de TeX) avant découpe en lignes (mais après l'extraction de l'éventuel
+|\CodeAfter|).
+
+
\subsection{Couleur des délimiteurs}
\index{delimiters!---/color pour un environnement}
@@ -5142,12 +5210,12 @@ etc.), il est possible de changer la couleur des délimiteurs avec la clé
|delimiters/color|.
\medskip
-\begin{BVerbatim}[boxwidth=12cm,baseline=c]
-$\begin{bNiceMatrix}[delimiters/color=red]
+\begin{Code}[width=12cm]
+$\begin{bNiceMatrix}[\emph{delimiters/color=red}]
1 & 2 \\
3 & 4
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[delimiters/color=red]
1 & 2 \\
3 & 4
@@ -5162,7 +5230,6 @@ préambule des environnements à préambule (cf.~p.~\pageref{delimiters-in-pream
\subsection{L'environnement \{NiceArrayWithDelims\}}
\label{NiceArrayWithDelims}
-
\index{NiceArrayWithDelims@\texttt{\{NiceArrayWithDelims\}}}
En fait, l'environnement |{pNiceArray}| et ses variantes sont fondés sur un
@@ -5173,14 +5240,14 @@ d'utiliser |{NiceArrayWithDelims}| si on a besoin de délimiteurs atypiques ou
asymétriques.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-$\begin{~emphase#NiceArrayWithDelims@}
+\begin{Code}[width=11cm]
+$\begin{\emph{NiceArrayWithDelims}}
{\downarrow}{\uparrow}{ccc}[margin]
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
-\end{~emphase#NiceArrayWithDelims@}$
-\end{BVerbatim}
+\end{\emph{NiceArrayWithDelims}}$
+\end{Code}
%
$\begin{NiceArrayWithDelims}
{\downarrow}{\uparrow}{ccc}[margin]
@@ -5205,7 +5272,8 @@ Pour un exemple d'utilisation, voir \url{tex.stackexchange.com/questions/488566}
\section{Utilisation de TikZ avec nicematrix}
-\label{name}\label{PGF-nodes}
+\label{name}
+\label{PGF-nodes}
\index{tikza@TikZ (utilisation avec \pkg{nicematrix})}
\index{noeud@\textbf{Nœuds PGF/Tikz}|(}
@@ -5265,15 +5333,15 @@ avec \textsc{pgf} mais l'utilisateur final préférera sans doute utiliser TikZ
on suppose que TikZ a été chargé par l'utilisateur.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-$\begin{pNiceMatrix}[name=~emphase#ma-matrice@]
+\begin{Code}[width=11cm]
+$\begin{pNiceMatrix}[name = \emph{ma-matrice}]
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{pNiceMatrix}$
\tikz[remember picture,overlay]
- \draw ~emphase#(ma-matrice-2-2)@ circle (2mm) ;
-\end{BVerbatim}
+ \draw \emph{(ma-matrice-2-2)} circle (2mm) ;
+\end{Code}
$\begin{pNiceMatrix}[name=ma-matrice]
1 & 2 & 3 \\
4 & 5 & 6 \\
@@ -5293,15 +5361,15 @@ préciser l'environnement qui est évidemment l'environnement courant.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
$\begin{pNiceMatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\CodeAfter
-\tikz \draw ~emphase#(2-2)@ circle (2mm) ;
+\tikz \draw \emph{(2-2)} circle (2mm) ;
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
@@ -5342,16 +5410,16 @@ sont tracés en utilisant un style PGF spécifique. Ce style est nommé
|nicematrix/cell-node| et sa définition dans le fichier source |nicematrix.sty|
est la suivante :
-\begin{Verbatim}
+\begin{Code}
\pgfset
{
- ~emphase#nicematrix / cell-node@ /.style =
+ \emph{nicematrix / cell-node} /.style =
{
inner sep = 0 pt ,
minimum width = 0 pt
}
}
-\end{Verbatim}
+\end{Code}
L'utilisateur peut modifier ce style en changeant les valeurs des clés |text/rotate|,
|inner xsep|, |inner ysep|, |inner sep|, |outer xsep|, |outer ysep|, |outer sep|,
@@ -5386,7 +5454,7 @@ cas des colonnes de type |p|, |m| ou |b| dans lesquelles les nœuds ont toujours
une largeur égale à la largeur de la colonne. Dans l'exemple suivant, la
commande |\lipsum| est fournie par l'extension éponyme.
-\begin{Verbatim}
+\begin{Code}
\begin{NiceTabular}{V{10cm}}
\bfseries \large
Titre \\
@@ -5394,7 +5462,7 @@ Titre \\
\CodeAfter
\tikz \draw [rounded corners] (1-1) -| (last-|2) -- (last-|1) |- (1-1) ;
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\begin{NiceTabular}{V{10cm}}
@@ -5558,14 +5626,14 @@ et ne correspondent donc pas nécessairement aux cases délimitées par des file
Voici un tableau qui a été composé de la manière suivante :
\medskip
-\begin{BVerbatim}
+\begin{Code}
\large
\begin{NiceTabular}{wl{2cm}ll}[hvlines]
fraise & amande & abricot \\
prune & pêche & poire \\[1ex]
noix & noisette & brugnon
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\end{minipage}
\hspace{1cm}
\begin{scope}
@@ -5640,8 +5708,7 @@ du tableau proprement dit).
Voici un exemple d'utilisation de ces nœuds dans le |\CodeAfter|.
\begin{center}
-\fvset{commandchars=\~\#\+}
-\begin{Verbatim}
+\begin{Code}
\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
u_1 &-& u_0 &=& r \\
u_2 &-& u_1 &=& r \\
@@ -5659,7 +5726,7 @@ Voici un exemple d'utilisation de ces nœuds dans le |\CodeAfter|.
(4-1.north west) -- (5-3.south east)
(5-1.north west) -- (6-3.south east) ;
\end{NiceArray}
-\end{Verbatim}
+\end{Code}
\end{center}
%
\[\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
@@ -5721,10 +5788,10 @@ horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|.
\medskip
-\begin{Verbatim}
+\begin{Code}
\begin{NiceMatrix}
\CodeBefore
-~emphase#\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;@
+\emph{\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;}
\Body
1 \\
1 & 1 \\
@@ -5736,7 +5803,7 @@ horizontal~$i$ et du filet vertical~$j$ avec la syntaxe |(|$i$\verb+-|+$j$|)|.
1 & 7 & 21 & 35 & 35 & 21 & 7 & 1 \\
1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1
\end{NiceMatrix}
-\end{Verbatim}
+\end{Code}
%
\[\begin{NiceMatrix}
\CodeBefore
@@ -5758,15 +5825,15 @@ Les nœuds de la forme $i$|.5| peuvent être utilisés par exemple pour barrer u
ligne (si on a chargé TikZ).
\smallskip
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
$\begin{pNiceArray}{ccc|c}
2 & 1 & 3 & 0 \\
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
\CodeAfter
- \tikz \draw [red] (~emphase#3.5@-|1) -- (~emphase#3.5@-|last) ;
+ \tikz \draw [red] (\emph{3.5}-|1) -- (\emph{3.5}-|last) ;
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceArray}{ccc|c}
2 & 1 & 3 & 0 \\
3 & 3 & 1 & 0 \\
@@ -5865,7 +5932,7 @@ utilise explicitement la variable publique |\g_nicematrix_code_before_tl|.
\begin{scope}
\fvset{commandchars=\§\¤\μ}
-\begin{Verbatim}
+\begin{Code}
\ExplSyntaxOn
\cs_new_protected:Nn \__pantigny_crossbox:nnn
{
@@ -5876,7 +5943,7 @@ utilise explicitement la variable publique |\g_nicematrix_code_before_tl|.
\NewDocumentCommand \crossbox { ! O { } }
{
- \tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ
+ \tl_gput_right:Nx \emph{\g_nicematrix_code_before_tl}
{
\__pantigny_crossbox:nnn
{ \arabic { iRow } }
@@ -5885,7 +5952,7 @@ utilise explicitement la variable publique |\g_nicematrix_code_before_tl|.
}
}
\ExplSyntaxOff
-\end{Verbatim}
+\end{Code}
\end{scope}
@@ -5914,16 +5981,16 @@ utilise explicitement la variable publique |\g_nicematrix_code_before_tl|.
Voici un exemple d'utilisation :
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\arraycolor{gray!10}
\Body
merlan & requin & cabillaud \\
-baleine & ~emphase#\crossbox[red]@ & morue \\
+baleine & \emph{\crossbox[red]} & morue \\
mante & raie & poule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\arraycolor{gray!10}
@@ -5964,14 +6031,14 @@ Dans les exemples suivants, la première instruction |\Ddots| est marquée en co
\begin{scope}
\begin{minipage}{9.5cm}
Exemple avec parallélisation (comportement par défaut):
-\begin{Verbatim}
+\begin{Code}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
-a+b & ~emphase#\Ddots@~ & & \Vdots \\
+a+b & \emph{\Ddots} & & \Vdots \\
\Vdots & \Ddots & & \\
a+b & \Cdots & a+b & 1
\end{pNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\end{minipage}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
@@ -5983,14 +6050,14 @@ a+b & \Cdots & a+b & 1
\medskip
\NiceMatrixOptions{parallelize-diags=true}%
\begin{minipage}{9.5cm}
-\begin{Verbatim}
+\begin{Code}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
a+b & & & \Vdots \\
-\Vdots & ~emphase#\Ddots@~ & \Ddots & \\
+\Vdots & \emph{\Ddots} & \Ddots & \\
a+b & \Cdots & a+b & 1
\end{pNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\end{minipage}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
@@ -6113,11 +6180,11 @@ Pour pouvoir utiliser \pkg{nicematrix} avec la classe \cls{aastex631} (de
l'\emph{American Astronomical Society}), on doit ajouter dans le préambule du
fichier les lignes suivantes :
-\begin{Verbatim}
+\begin{Code}
\BeforeBegin{NiceTabular}{\let\begin\BeginEnvironment\let\end\EndEnvironment}
\BeforeBegin{NiceArray}{\let\begin\BeginEnvironment}
\BeforeBegin{NiceMatrix}{\let\begin\BeginEnvironment}
-\end{Verbatim}
+\end{Code}
\medskip
Pour pouvoir utiliser \pkg{nicematrix} avec la classe \cls{sn-jnl} (de
@@ -6133,7 +6200,7 @@ Mais il semble que ce ne soit plus nécessaire avec les versions récentes de
\medskip
L'extension \pkg{nicematrix} n'est pas parfaitement compatible avec les classes
-et extensions de \LuaTeX-ja: la détection des coins vides (cf.
+et extensions de LuaTeX-ja: la détection des coins vides (cf.
p.~\pageref{corners}) risque d'être erronée dans certaines circonstances.
\medskip
@@ -6168,21 +6235,21 @@ Pour l'exemple suivant, la bibliothèque \pkg{patterns} de TikZ doit aussi être
\usetikzlibrary{patterns}
\end{Verbatim}
-\begin{Verbatim}
+\begin{Code}
\ttfamily \small
\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
- \Block[~emphase#tikz={pattern=grid,pattern color=lightgray}@]{}
+ \Block[\emph{tikz={pattern=grid,pattern color=lightgray}}]{}
{pattern = grid,\\ pattern color = lightgray}
-& \Block[~emphase#tikz={pattern = north west lines,pattern color=blue}@]{}
+& \Block[\emph{tikz={pattern = north west lines,pattern color=blue}}]{}
{pattern = north west lines,\\ pattern color = blue}
-& \Block[~emphase#tikz={outer color = red!50, inner color=white }@]{2-1}
+& \Block[\emph{tikz={outer color = red!50, inner color=white }}]{2-1}
{outer color = red!50,\\ inner color = white} \\
- \Block[~emphase#tikz={pattern = sixpointed stars, pattern color = blue!15}@]{}
+ \Block[\emph{tikz={pattern = sixpointed stars, pattern color = blue!15}}]{}
{pattern = sixpointed stars,\\ pattern color = blue!15}
-& \Block[~emphase#tikz={left color = blue!50}@]{}
+& \Block[\emph{tikz={left color = blue!50}}]{}
{left color = blue!50} \\
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\ttfamily \small
@@ -6214,16 +6281,16 @@ tableau. On remarquera que l'on utilise la clé |transparent| de la commande
\texttt{\textbackslash CodeBefore}|textit}
-\begin{Verbatim}
+\begin{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\columncolor[RGB]{169,208,142}{2}
\Body
un & deux & trois \\
-\Block[~emphase#transparent, tikz={pattern = north west lines, pattern color = gray}@]{1-*}{}
+\Block[\emph{transparent, tikz={pattern = north west lines, pattern color = gray}}]{1-*}{}
quatre & cinq & six \\
sept & huit & neuf
-\end{Verbatim}
+\end{Code}
\begin{center}
\begin{NiceTabular}{ccc}[hvlines]
@@ -6248,7 +6315,7 @@ tous les filets sauf ceux sur les bords (qui sont, bien entendu, ajoutés par
\pkg{tcolorbox}).
\medskip
-\begin{BVerbatim}
+\begin{Code}
\tcbset
{
colframe = blue!50!black ,
@@ -6271,7 +6338,7 @@ tous les filets sauf ceux sur les bords (qui sont, bien entendu, ajoutés par
]
{
\renewcommand{\arraystretch}{1.2}% <-- the % is mandatory here
- \begin{NiceTabular}{rcl}[~emphase#hvlines-except-borders@,rules/color=blue!50!black]
+ \begin{NiceTabular}{rcl}[\emph{hvlines-except-borders},rules/color=blue!50!black]
\CodeBefore
\rowcolor{red!15}{1}
\Body
@@ -6280,7 +6347,7 @@ tous les filets sauf ceux sur les bords (qui sont, bien entendu, ajoutés par
Upper & Middle & Lower
\end{NiceTabular}
}
-\end{BVerbatim}
+\end{Code}
\index{hvlines-except-borders|textit}
@@ -6333,7 +6400,6 @@ tous les filets sauf ceux sur les bords (qui sont, bien entendu, ajoutés par
\index{style (sous-clé de «notes»)|textit}
\index{enumitem-keys (sous-clé de «notes»)|textit}
\index{enumitem@\pkg{enumitem} (extension requise pour utiliser\newline \texttt{\textbackslash tabularnote})|textit}
-
\label{ex:notes}
Les outils de \pkg{nicematrix} pour les notes dans les tableaux ont été
@@ -6347,13 +6413,16 @@ avec |\tabularnote|) avec des astérisques.\footnote{Bien entendu, il faut qu'il
On commence par écrire une commande |\stars| similaire aux commandes classiques
|\arabic|, |\alph|, |\Alph|, etc. mais qui produit un nombre d'astérisques égal
à son argument.\footnote{Ou plutôt : à la valeur de son argument.}
-\begin{Verbatim}
+
+\medskip
+\begin{Code}
\ExplSyntaxOn
-\NewDocumentCommand ~emphase#\stars@ { m }
- { \prg_replicate:nn { \value { ~#1 } } { $ \star $ } }
+\NewDocumentCommand { \emph{\stars} } { m }
+ { \prg_replicate:nn { \value { #1 } } { $ \star $ } }
\ExplSyntaxOff
-\end{Verbatim}
-%
+\end{Code}
+
+\medskip
Bien entendu, on change le style des notes avec la clé |notes/style|. Mais, il
serait bon aussi de changer certains paramètres du type de liste (au sens de
\pkg{enumitem}) utilisé pour composer les notes après le tableau. On demande de
@@ -6364,20 +6433,22 @@ est le compteur LaTeX utilisé par |\tabularnote| et il est donc égal à la fin
nombre total de notes dans le tableau). On utilise alors la clé |widest*| de
\pkg{enumitem} pour demander une largeur de label correspondante :
|widest*=\value{tabularnote}|.
-\begin{Verbatim}
+
+\smallskip
+\begin{Code}
\NiceMatrixOptions
{
notes =
{
- ~emphase#style = \stars{~#1} , @
- ~emphase#enumitem-keys = @
- ~emphase# { @
- ~emphase# widest* = \value{tabularnote} ,@
- ~emphase# align = right @
- ~emphase# } @
+ \emph{style = \stars{#1} ,
+ enumitem-keys =
+ {
+ widest* = \value{tabularnote} ,
+ align = right
+ } }
}
}
-\end{Verbatim}
+\end{Code}
@@ -6398,21 +6469,21 @@ nombre total de notes dans le tableau). On utilise alors la clé |widest*| de
}
}
\ExplSyntaxOff
-\fvset{commandchars=\~\#\!}
-\begin{Verbatim}
+
+\begin{Code}
\begin{NiceTabular}{@{}llr@{}}
\toprule \RowStyle{\bfseries}
Nom & Prénom & Date de naissance \\
\midrule
-Achard~emphase#\tabularnote{La famille Achard est une très ancienne famille du Poitou.}!
+Achard\emph{\tabularnote{La famille Achard est une très ancienne famille du Poitou.}}
& Jacques & 5 juin 1962 \\
-Lefèbvre~emphase#\tabularnote{Le patronyme Lefebvre est une altération de Lefébure.}!
+Lefèbvre\emph{\tabularnote{Le patronyme Lefebvre est une altération de Lefébure.}}
& Mathilde & 23 mai 1988 \\
Vanesse & Stéphanie & 30 octobre 1994 \\
Dupont & Chantal & 15 janvier 1998 \\
\bottomrule
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\begin{NiceTabular}{@{}llr@{}}
@@ -6441,7 +6512,7 @@ Dupont & Chantal & 15 janvier 1998 \\
Un exemple pour le résultant de deux polynômes :
\par\nobreak
\medskip
-\begin{BVerbatim}
+\begin{Code}
\setlength{\extrarowheight}{1mm}
\begin{vNiceArray}{cccc:ccc}[columns-width=6mm]
a_0 & && &b_0 & & \\
@@ -6452,7 +6523,7 @@ a_p & &&a_0 & & &b_1 \\
& &&\Vdots & &\Ddots& \\
& &&a_p & & &b_q
\end{vNiceArray}
-\end{BVerbatim}
+\end{Code}
\index{Ddots@\texttt{\textbackslash Ddots}|textit}
@@ -6510,7 +6581,9 @@ pointillées (TikZ doit être chargé).
\index{line-style (clé pour les lignes pointillées)|textit}
-\begin{Verbatim}[formatcom=\small\color{gray}]
+\begin{scope}
+\small
+\begin{Verbatim}
\NiceMatrixOptions{code-for-first-row = \scriptstyle,code-for-first-col = \scriptstyle }
\setcounter{MaxMatrixCols}{12}
\newcommand{\blue}{\color{blue}}
@@ -6529,6 +6602,7 @@ pointillées (TikZ doit être chargé).
& & & \blue \overset{\uparrow}{i} & & & & \blue \overset{\uparrow}{j} \\
\end{pNiceMatrix}\]
\end{Verbatim}
+\end{scope}
\index{code-for-first-row|textit}
\index{code-for-last-col|textit}
@@ -6631,19 +6705,19 @@ Dans l'exemple suivant, on utilise des commandes |\Block| pour tracer des filets
en tiretés. Cet exemple nécessite que TikZ soit chargé (par
|\usepackage{tikz}|).
-\begin{Verbatim}
+\begin{Code}
\begin{pNiceMatrix}
-~emphase#\Block[borders={bottom,right,tikz=dashed}]{2-2}{}@
+\emph{\Block[borders={bottom,right,tikz=dashed}]{2-2}{}}
1 & 2 & 0 & 0 & 0 & 0 \\
4 & 5 & 0 & 0 & 0 & 0 \\
-0 & 0 & ~emphase#\Block[borders={bottom,top,right,left,tikz=dashed}]{2-2}{}@
+0 & 0 & \emph{\Block[borders={bottom,top,right,left,tikz=dashed}]{2-2}{}}
7 & 1 & 0 & 0 \\
0 & 0 & -1 & 2 & 0 & 0 \\
-0 & 0 & 0 & 0 & ~emphase#\Block[borders={left,top,tikz=dashed}]{2-2}{}@
+0 & 0 & 0 & 0 & \emph{\Block[borders={left,top,tikz=dashed}]{2-2}{}}
3 & 4 \\
0 & 0 & 0 & 0 & 1 & 4
\end{pNiceMatrix}
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceMatrix}
@@ -6673,8 +6747,12 @@ avec l'environnement |{NiceMatrixBlock}| et l'option |auto-columns-width|.
\index{NiceMatrixBlock@\texttt{\{NiceMatrixBlock\}}|textit}
-\begin{Verbatim}[formatcom=\small\color{gray}]
-~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@
+\bigskip
+
+\begin{scope}
+\small
+\begin{Code}
+\emph{\begin{NiceMatrixBlock}[auto-columns-width]}
\NiceMatrixOptions
{
light-syntax,
@@ -6684,6 +6762,7 @@ avec l'environnement |{NiceMatrixBlock}| et l'option |auto-columns-width|.
no-cell-nodes
}
\setlength{\extrarowheight}{1mm}
+\end{NiceMatrixBlock}
\quad $\begin{pNiceMatrix}
12 -8 7 5 3 {} ;
@@ -6712,8 +6791,9 @@ avec l'environnement |{NiceMatrixBlock}| et l'option |auto-columns-width|.
12 -8 7 5 3 {} ;
0 64 -41 1 19 ;
\end{pNiceMatrix}$
-~emphase#\end{NiceMatrixBlock}@
-\end{Verbatim}
+\emph{\end{NiceMatrixBlock}}
+\end{Code}
+\end{scope}
\medskip
\index{auto-columns-width!(clé de \texttt{\{NiceMatrixBlock\}})|textit}
@@ -6768,12 +6848,15 @@ largeur suivant leur taille.
Pour résoudre ce problème, on peut demander que les délimiteurs soient composés
avec leur largeur maximale grâce à la clé booléenne |delimiters/max-width|.
+\medskip
-\begin{Verbatim}[formatcom=\small\color{gray}]
-~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@
+\begin{scope}
+\small
+\begin{Code}
+\emph{\begin{NiceMatrixBlock}[auto-columns-width]}
\NiceMatrixOptions
{
- ~emphase#delimiters/max-width@,
+ \emph{delimiters/max-width},
light-syntax,
last-col, code-for-last-col = \color{blue}\scriptstyle,
vlines = 5 ,
@@ -6789,8 +6872,9 @@ avec leur largeur maximale grâce à la clé booléenne |delimiters/max-width|.
9 10 -5 4 7
\end{pNiceMatrix}$
...
-~emphase#\end{NiceMatrixBlock}@
-\end{Verbatim}
+\emph{\end{NiceMatrixBlock}}
+\end{Code}
+\end{scope}
\medskip
\begin{NiceMatrixBlock}[auto-columns-width]
@@ -6845,7 +6929,7 @@ Bien sûr, ce tableau ne pourra pas être coupé par un saut de page.
\index{SubMatrix@\texttt{\textbackslash SubMatrix} (commande du
\texttt{\textbackslash CodeAfter}\newline et du
\texttt{\textbackslash CodeBefore})|textit}
-\begin{Verbatim}
+\begin{Code}
\setlength{\extrarowheight}{1mm}
\[\begin{NiceMatrix}%
[ r, last-col=6, code-for-last-col = \scriptstyle \color{blue} ]
@@ -6862,13 +6946,13 @@ Bien sûr, ce tableau ne pourra pas être coupé par un saut de page.
0 & 0 &0 &0 & 0 & L_3 \gets 3L_2+L_3 \\[1mm]
12 & -8 &7 &5 & 3 \\
0 & 64 &-41 & 1 & 19 \\
-~emphase#\CodeAfter [sub-matrix/vlines=4]@
-~emphase# \SubMatrix({1-1}{4-5})@
-~emphase# \SubMatrix({5-1}{8-5})@
-~emphase# \SubMatrix({9-1}{11-5})@
-~emphase# \SubMatrix({12-1}{13-5})@
+\emph{\CodeAfter [sub-matrix/vlines=4]
+ \SubMatrix({1-1}{4-5})
+ \SubMatrix({5-1}{8-5})
+ \SubMatrix({9-1}{11-5})
+ \SubMatrix({12-1}{13-5})}
\end{NiceMatrix}\]
-\end{Verbatim}
+\end{Code}
\medskip
\begin{scope}
@@ -6908,11 +6992,11 @@ dans le préambule du tableau pour indiquer des filets verticaux qui seront
tracés dans les |\SubMatrix| uniquement (en espaçant les colonnes).
\medskip
-\begin{Verbatim}
+\begin{Code}
\setlength{\extrarowheight}{1mm}
\[\begin{NiceArray}
[
- ~emphase#vlines-in-sub-matrix=I@,
+ \emph{vlines-in-sub-matrix=I},
last-col,
code-for-last-col = \scriptstyle \color{blue}
]
@@ -6936,7 +7020,7 @@ tracés dans les |\SubMatrix| uniquement (en espaçant les colonnes).
\SubMatrix({9-1}{11-5})
\SubMatrix({12-1}{13-5})
\end{NiceArray}\]
-\end{Verbatim}
+\end{Code}
@@ -6987,14 +7071,14 @@ la commande |\Block| est laissé vide, le bloc est considéré comme mono-case.}
\label{exemple-CodeAfter}
-\begin{Verbatim}
+\begin{Code}
$\begin{pNiceArray}{>{\strut}cccc}[margin,rules/color=blue]
-~emphase#\Block[draw]{}{a_{11}}@ & a_{12} & a_{13} & a_{14} \\
-a_{21} & \Block[draw]{}{a_{22}} & a_{23} & a_{24} \\
-a_{31} & a_{32} & \Block[draw]{}{a_{33}} & a_{34} \\
-a_{41} & a_{42} & a_{43} & \Block[draw]{}{a_{44}} \\
+\emph{\Block[draw]{}{a_{11}}} & a_{12} & a_{13} & a_{14} \\
+a_{21} & \emph{\Block[draw]{}{a_{22}}} & a_{23} & a_{24} \\
+a_{31} & a_{32} & \emph{\Block[draw]{}{a_{33}}} & a_{34} \\
+a_{41} & a_{42} & a_{43} & \emph{\Block[draw]{}{a_{44}}} \\
\end{pNiceArray}$
-\end{Verbatim}
+\end{Code}
%
\[\begin{pNiceArray}{>{\strut}cccc}[margin,rules/color=blue]
\Block[draw]{}{a_{11}} & a_{12} & a_{13} & a_{14} \\
@@ -7020,14 +7104,14 @@ Il est possible de colorier une rangée avec |\rowcolor| dans le |\CodeBefore|
\index{color-inside|textit}
\index{rowcolor@\texttt{\textbackslash rowcolor}!commande en tableau|textit}
-\begin{Verbatim}
+\begin{Code}
\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
- ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\
- A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\
- A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\
- A_{41} & A_{42} & A_{43} & ~emphase#\rowcolor{red!15}@A_{44}
+ \emph{\rowcolor{red!15}}A_{11} & A_{12} & A_{13} & A_{14} \\
+ A_{21} & \emph{\rowcolor{red!15}}A_{22} & A_{23} & A_{24} \\
+ A_{31} & A_{32} & \emph{\rowcolor{red!15}}A_{33} & A_{34} \\
+ A_{41} & A_{42} & A_{43} & \emph{\rowcolor{red!15}}A_{44}
\end{pNiceArray}
-\end{Verbatim}
+\end{Code}
@@ -7069,22 +7153,22 @@ faut utiliser la clé |create-cell-nodes| du |\CodeBefore| pour demander leur cr
\medskip
\index{highlight (style TikZ défini dans\newline un exemple)|textit}
-\begin{Verbatim}
+\begin{Code}
\tikzset{highlight/.style={rectangle,
fill=red!15,
rounded corners = 0.5 mm,
inner sep=1pt,
- fit=~#1}}
+ fit=#1}}
$\begin{bNiceMatrix}
-~emphase#\CodeBefore [create-cell-nodes] @
-~emphase# \tikz \node [highlight = (2-1) (2-3)] {} ; @
-~emphase# \Body @
+\emph{\CodeBefore [create-cell-nodes]
+ \tikz \node [highlight = (2-1) (2-3)] {} ;
+\Body }
0 & \Cdots & 0 \\
1 & \Cdots & 1 \\
0 & \Cdots & 0 \\
\end{bNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\index{create-cell-nodes (clé de \texttt{\textbackslash CodeBefore})|textit}
\index{CodeBefore@\texttt{\textbackslash CodeBefore}...\texttt{\textbackslash Body}|textit}
@@ -7105,20 +7189,20 @@ $\begin{bNiceMatrix}
On considère maintenant la matrice suivante. Si on veut surligner chaque rangée
de la matrice, on peut utiliser la technique précédente trois fois.
-\begin{Verbatim}
+\begin{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
-~emphase# \node [highlight = (1-1) (1-3)] {} ;@
-~emphase# \node [highlight = (2-1) (2-3)] {} ;@
-~emphase# \node [highlight = (3-1) (3-3)] {} ;@
+ \emph{\node [highlight = (1-1) (1-3)] {} ;
+ \node [highlight = (2-1) (2-3)] {} ;
+ \node [highlight = (3-1) (3-3)] {} ;}
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
a & a & a + b & L_2 \\
a & a & a & L_3
\end{pNiceArray}\]
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
@@ -7140,10 +7224,10 @@ moyens» au lieu des «nœuds normaux».
\index{create-medium-nodes|textit}
\index{create-cell-nodes (clé de \texttt{\textbackslash CodeBefore})|textit}
-\begin{Verbatim}
+\begin{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
\CodeBefore [create-cell-nodes]
- \begin{tikzpicture} ~emphase#[name suffix = -medium]@
+ \begin{tikzpicture} \emph{[name suffix = -medium]}
\node [highlight = (1-1) (1-3)] {} ;
\node [highlight = (2-1) (2-3)] {} ;
\node [highlight = (3-1) (3-3)] {} ;
@@ -7153,7 +7237,7 @@ a & a + b & a + b + c & L_1 \\
a & a & a + b & L_2 \\
a & a & a & L_3
\end{pNiceArray}\]
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
@@ -7232,8 +7316,10 @@ de parenthèses ont été rajoutées avec |\SubMatrix| dans le |\CodeBefore|.
fit=~#1}}
\end{Verbatim}
-\begin{Verbatim}[formatcom = \small\color{gray}]
-\[\begin{NiceArray}{*{6}{c}~LetterAt{\hspace{6mm}}*{5}{c}}[nullify-dots]
+\begin{scope}
+\small
+\begin{Code}
+\[\begin{NiceArray}{*{6}{c}@{\hspace{6mm}}*{5}{c}}[nullify-dots]
\CodeBefore [create-cell-nodes]
\SubMatrix({2-7}{6-last})
\SubMatrix({7-2}{last-6})
@@ -7258,7 +7344,8 @@ de parenthèses ont été rajoutées avec |\SubMatrix| dans le |\CodeBefore|.
\CodeAfter
\tikz \draw [gray,shorten > = 1mm, shorten < = 1mm] (9-4.north) to [bend left] (4-9.west) ;
\end{NiceArray}\]
-\end{Verbatim}
+\end{Code}
+\end{scope}
\subsection{Un tableau triangulaire}
@@ -7276,16 +7363,16 @@ tourner tout le tableau avec la commande |\adjustbox| de l'extension éponyme,
qui doit donc être chargée préalablement).
\medskip
-\begin{Verbatim}
+\begin{Code}
\pgfset
{
- ~emphase#nicematrix/cell-node@/.append style =
+ \emph{nicematrix/cell-node}/.append style =
{ text/rotate = 45, minimum size = 6 mm }
}
\setlength{\tabcolsep}{0pt}
-~emphase#\adjustbox@{rotate = -45, set depth = 6mm + 1.414 \arrayrulewidth}
+\emph{\adjustbox}{rotate = -45, set depth = 6mm + 1.414 \arrayrulewidth}
{\begin{NiceTabular} [ hvlines, corners=SE, baseline = line-9 ] { cccccccc }
\CodeBefore
\chessboardcolors{red!15}{blue!15}
@@ -7299,7 +7386,7 @@ qui doit donc être chargée préalablement).
1 & 7 \\
1
\end{NiceTabular}}
-\end{Verbatim}
+\end{Code}
\begin{center}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index 6f728aa977..abfd168487 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix.tex b/macros/latex/contrib/nicematrix/nicematrix.tex
index 74f6c7ae15..6f18a9c5e6 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix.tex
@@ -1,7 +1,6 @@
% -*- coding: utf-8 ; -*- This file should be compiled with XeLaTeX only
\documentclass[dvipsnames]{article}% dvipsnames is for xcolor (loaded by TikZ,
- % loaded by nicematrix) ℤ
-\usepackage{xltxtra}
+ % loaded by nicematrix)
\usepackage{geometry}
\geometry{left=2.8cm,right=2.8cm,top=2.5cm,bottom=2.5cm,papersize={21cm,29.7cm}}
@@ -24,13 +23,12 @@
\MakeShortVerb{\|}
\usepackage{fancyvrb}
-\fvset{commandchars=\~\#\@,formatcom=\color{gray}}
+\fvset{formatcom=\color{gray}}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{6.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
\titlespacing*{\subsection}{0pt}{4.5ex plus 1ex minus .2ex}{2ex plus .2ex}
-\def\LetterAt{@}
\def\interitem{\vspace{7mm plus 2 mm minus 3mm}}
\def\emphase{\bgroup\color{RoyalPurple}\let\next=}
@@ -62,6 +60,39 @@
\usepackage{makeidx}
\makeindex
+
+\usepackage{piton}
+\PitonOptions{language = minimal, detected-commands = {emph,textsl}, splittable = 4}
+\SetPitonStyle{ Number = , Comment = }
+
+\ExplSyntaxOn
+
+\dim_new:N \l__pantigny_width_dim
+
+\keys_define:nn { pantigny }
+ { width .dim_set:N = \l__pantigny_width_dim }
+
+\NewPitonEnvironment { Code } { O { } }
+ {
+ \char_set_catcode_other:N |
+ \cs_set_eq:NN \emph \emphase
+ \dim_zero:N \l__pantigny_width_dim
+ \keys_set:nn { pantigny } { #1 }
+ \color{gray}
+ \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ {
+ \PitonOptions { width = \l__pantigny_width_dim }
+ \begin{minipage}[c]{\l__pantigny_width_dim}
+ }
+ }
+ { \dim_compare:nNnT \l__pantigny_width_dim > \c_zero_dim
+ { \end{minipage} }
+ }
+
+
+\ExplSyntaxOff
+
+
\NewDocumentCommand{\indexcommand}{m}{\index{#1@\texttt{\textbackslash #1}}}
\NewDocumentCommand{\indexenv}{m}{\index{#1@\texttt{\{#1\}}}}
@@ -242,12 +273,12 @@ It's well known that some rows of the arrays created by default with LaTeX
are, by default, too close to each other. Here is a classical example.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
$\begin{pmatrix}
\frac{1}{2} & -\frac{1}{2} \\
\frac{1}{3} & \frac{1}{4} \\
\end{pmatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pmatrix}
\frac{1}{2} & -\frac{1}{2} \\
\frac{1}{3} & \frac{1}{4} \\
@@ -271,16 +302,16 @@ remark that these parameters apply also to the columns of type |S| of
columns of type~|S|.}
\medskip
-\begin{Verbatim}
-\NiceMatrixOptions{~emphase#cell-space-limits = 1pt@}
-\end{Verbatim}
+\begin{Code}
+\NiceMatrixOptions{\emph{cell-space-limits = 1pt}}
+\end{Code}
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
$\begin{pNiceMatrix}
\frac12 & -\frac12 \\
\frac13 & \frac14 \\
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{cell-space-limits = 1pt}
$\begin{pNiceMatrix}
@@ -305,13 +336,13 @@ position of the arrays. This option takes in as value an integer which is the
number of the row on which the array will be aligned.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
-$A = \begin{pNiceMatrix}[~emphase#baseline=2@]
+\begin{Code}[width=9cm]
+$A = \begin{pNiceMatrix}[\emph{baseline=2}]
\frac{1}{\sqrt{1+p^2}} & p & 1-p \\
1 & 1 & 1 \\
1 & p & 1+p
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$A = \begin{pNiceMatrix}[baseline=2]
\frac{1}{\sqrt{1+p^2}} & p & 1-p \\
1 & 1 & 1 \\
@@ -334,19 +365,19 @@ baseline with the baseline of the first row (with |{tabular}| or |{array}| of
\pkg{array}, one must use |\firsthline|).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{enumerate}
\item an item
\smallskip
\item \renewcommand{\arraystretch}{1.2}
-$\begin{NiceArray}~emphase#[t]@{lcccccc}
+$\begin{NiceArray}\emph{[t]}{lcccccc}
\hline
n & 0 & 1 & 2 & 3 & 4 & 5 \\
u_n & 1 & 2 & 4 & 8 & 16 & 32
\hline
\end{NiceArray}$
\end{enumerate}
-\end{BVerbatim}
+\end{Code}
\begin{minipage}{5cm}
\begin{enumerate}
\item an item
@@ -368,20 +399,20 @@ by \pkg{nicematrix}.}: |\toprule|,
|\bottomrule|, |\midrule|, etc.\par\nobreak
\smallskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{enumerate}
\item an item
\smallskip
\item
$\begin{NiceArray}[t]{lcccccc}
-~emphase#\toprule@
+\emph{\toprule}
n & 0 & 1 & 2 & 3 & 4 & 5 \\
-~emphase#\midrule@
+\emph{\midrule}
u_n & 1 & 2 & 4 & 8 & 16 & 32
-~emphase#\bottomrule@
+\emph{\bottomrule}
\end{NiceArray}$
\end{enumerate}
-\end{BVerbatim}
+\end{Code}
\begin{minipage}{5cm}
\begin{enumerate}
\item an item
@@ -409,15 +440,15 @@ horizontal rule.
\end{Verbatim}
\smallskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
-$A=\begin{pNiceArray}{cc|cc}~emphase#[baseline=line-3]@
+\begin{Code}[width=9cm]
+$A=\begin{pNiceArray}{cc|cc}\emph{[baseline=line-3]}
\dfrac{1}{A} & \dfrac{1}{B} & 0 & 0 \\
\dfrac{1}{C} & \dfrac{1}{D} & 0 & 0 \\
\hline
0 & 0 & A & B \\
0 & 0 & D & D \\
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{cell-space-limits=1pt}
\raisebox{-5mm}{$A=\begin{pNiceArray}{cc|cc}[baseline=line-3]
@@ -466,15 +497,15 @@ text mode whereas, in the other environments, it is composed in math mode.
Here is an example of utilisation of the command |\Block| in mathematical matrices.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-~emphase#\Block{3-3}{A}@ & & & 0 \\
+\emph{\Block{3-3}{A}} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
0 & \Cdots& 0 & 0
\end{bNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\Block{3-3}{A} & & & 0 \\
& & & \Vdots \\
@@ -496,15 +527,15 @@ the command |\rotate| provided by \pkg{nicematrix} (cf. part~\ref{rotate},
p.~\pageref{rotate}).}
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block{3-3}~emphase#<\Large>@{A} & & & 0 \\
+\Block{3-3}\emph{<\Large>}{A} & & & 0 \\
0 & & & \Vdots \\
& & & 0 \\
\hline
0 & \Cdots& 0 & 0
\end{bNiceArray}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\Block{3-3}<\Large>{A} & & & 0 \\
@@ -628,17 +659,16 @@ In the following example, we have had to enlarge by hand the columns 2 and 3
(with the construction |w{c}{...}| of \pkg{array}).
\bigskip
-\begin{BVerbatim}
+\begin{Code}
\begin{NiceTabular}{cw{c}{2cm}w{c}{3cm}c}
rose & tulip & daisy & dahlia \\
-violet
-& ~emphase#\Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}@
- ~emphase#{\LARGE Some beautiful flowers}@
+violet & \emph{\Block[draw=red,fill=[RGB]{204,204,255},rounded-corners]{2-2}
+ {\LARGE Some beautiful flowers}} & & marigold \\
& & marigold \\
iris & & & lis \\
arum & periwinkle & forget-me-not & hyacinth
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\medskip
\begin{center}
@@ -677,8 +707,8 @@ mono-column blocks of that column (this behaviour is probably expected).
\bigskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=12cm]
-\begin{NiceTabular}{~LetterAt{}>{\bfseries}lr~LetterAt{}} \hline
+\begin{Code}[width=12cm]
+\begin{NiceTabular}{@{}>{\bfseries}lr@{}} \hline
\Block{2-1}{John} & 12 \\
& 13 \\ \hline
Steph & 8 \\ \hline
@@ -690,7 +720,7 @@ Henry & 14 \\ \hline
\Block{2-1}{Madison} & 15 \\
& 19 \\ \hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{@{}>{\bfseries}lr@{}}[baseline=c] \hline
\Block{2-1}{John} & 12 \\
& 13 \\ \hline
@@ -739,16 +769,16 @@ used).}
\end{itemize}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{cc}
\toprule
-Writer & ~emphase#\Block[l]{}{year\\ of birth}@ \\
+Writer & \emph{\Block[l]{}{year\\ of birth}} \\
\midrule
Hugo & 1802 \\
Balzac & 1799 \\
\bottomrule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{cc}
\toprule
Writer & \Block[l]{}{year\\ of birth} \\
@@ -774,15 +804,15 @@ The command |\Block| accepts the keys |l|, |c| and |r| for the horizontal
position of its content.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
-\Block~emphase#[r]@{3-3}<\LARGE>{A} & & & 0 \\
+\Block\emph{[r]}{3-3}<\LARGE>{A} & & & 0 \\
& & & \Vdots \\
& & & 0 \\
\hline
0 & \Cdots& 0 & 0
\end{bNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceArray}{cw{c}{1cm}c|c}[margin]
\Block[r]{3-3}<\LARGE>{A} & & & 0 \\
& & & \Vdots \\
@@ -802,11 +832,10 @@ is not the behaviour of |\multicolumn|).
\medskip
\begin{center}
-\fvset{commandchars=\~\#\+}
-\begin{BVerbatim}
-\begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc@{}}
+\begin{Code}
+\begin{NiceTabular}{@{}c!{\qquad}ccc\emph{!{\qquad}}ccc@{}}
\toprule
-Rank & ~emphase#\Block{1-3}{First group}+ & & & \Block{1-3}{Second group} \\
+Rank & \emph{\Block{1-3}{First group}} & & & \Block{1-3}{Second group} \\
& 1A & 1B & 1C & 2A & 2B & 2C \\
\midrule
1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
@@ -815,7 +844,7 @@ Rank & ~emphase#\Block{1-3}{First group}+ & & & \Block{1-3}{Second group} \\
4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
\bottomrule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\end{center}
\bigskip
@@ -844,11 +873,10 @@ Here is the same example with the key |C| for the first block.
\medskip
\begin{center}
-\fvset{commandchars=\~\#\+}
-\begin{BVerbatim}
-\begin{NiceTabular}{@{}c!{\qquad}ccc~emphase#!{\qquad}+ccc@{}}
+\begin{Code}
+\begin{NiceTabular}{@{}c!{\qquad}ccc\emph{!{\qquad}}ccc@{}}
\toprule
-Rank & ~emphase#\Block[C]{1-3}{First group}+ & & & \Block{1-3}{Second group} \\
+Rank & \emph{\Block[C]{1-3}{First group}} & & & \Block{1-3}{Second group} \\
& 1A & 1B & 1C & 2A & 2B & 2C \\
\midrule
1 & 0.657 & 0.913 & 0.733 & 0.830 & 0.387 & 0.893\\
@@ -857,7 +885,7 @@ Rank & ~emphase#\Block[C]{1-3}{First group}+ & & & \Block{1-3}{Second group} \\
4 & 0.161 & 0.708 & 0.386 & 0.257 & 0.074 & 0.336\\
\bottomrule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\end{center}
\bigskip
@@ -919,16 +947,16 @@ When no key is given, the key |v-center| applies (except in the mono-row blocks)
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#t@,l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{t},l]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,t,l]{4-2}{two\\lines}
& & \Huge Un\\
@@ -940,16 +968,16 @@ text & text \\
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#b@,r]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{b},r]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,b,r]{4-2}{two\\lines}
& & \Huge Un\\
@@ -960,16 +988,16 @@ text & text \\
\end{NiceTabular}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#T@,l]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{T},l]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,T,l]{4-2}{two\\lines}
& & \Huge Un\\
@@ -981,16 +1009,16 @@ text & text \\
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}
-\Block[fill=red!10,~emphase#B@,r]{4-2}{two\\lines}
+\Block[fill=red!10,\emph{B},r]{4-2}{two\\lines}
& & \Huge Un\\
& & deux \\
& & trois \\
& & \Huge quatre \\
text & text \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}
\Block[fill=red!10,B,r]{4-2}{two\\lines}
& & \Huge Un\\
@@ -1027,13 +1055,13 @@ incomplete row or by a double horizontal rule specified by |\hline\hline|
(there is no need to use the package~\pkg{hhline}).
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{|c|c|} \hline
-First & Second \\ ~emphase#\hline\hline@
+First & Second \\ \emph{\hline\hline}
Peter \\ \hline
Mary & George\\ \hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{|c|c|}[c] \hline
First & Second \\ \hline\hline
Peter \\ \hline
@@ -1055,13 +1083,13 @@ not in the spirit of \pkg{booktabs}), you should notice that the vertical rules
drawn by \pkg{nicematrix} are compatible with \pkg{booktabs}.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.5cm]
-$\begin{NiceArray}{~emphase#|cccc|@} \toprule
+\begin{Code}[width=10.5cm]
+$\begin{NiceArray}{\emph{|cccc|}} \toprule
a & b & c & d \\ \midrule
1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ \bottomrule
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{NiceArray}{|cccc|}
\toprule
a & b & c & d \\
@@ -1095,13 +1123,13 @@ For historical reasons, this is not the case with the command |\cline|, as
shown by the following example.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\setlength{\arrayrulewidth}{2pt}
\begin{tabular}{cccc} \hline
-A&B&C&D \\ ~emphase#\cline{2-2}@
+A&B&C&D \\ \emph{\cline{2-2}}
A&B&C&D \\ \hline
\end{tabular}
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\setlength{\arrayrulewidth}{2pt}
\begin{tabular}[c]{cccc}
@@ -1119,21 +1147,19 @@ In the environments of \pkg{nicematrix}, this situation is corrected (it's
still possible to go to the standard behaviour of |\cline| with the key |standard-cline|).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\setlength{\arrayrulewidth}{2pt}
\begin{NiceTabular}{cccc} \hline
-A&B&C&D \\ ~emphase#\cline{2}@
+A&B&C&D \\ \emph{\cline{2}}
A&B&C&D \\ \hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\setlength{\arrayrulewidth}{2pt}
\begin{NiceTabular}[c]{cccc}
\hline
-A&B&C&D \\
-\cline{2}
-A&B&C&D \\
-\hline
+A&B&C&D \\ \cline{2}
+A&B&C&D \\ \hline
\end{NiceTabular}
\end{scope}
@@ -1170,15 +1196,15 @@ environment, to fix the color of the rules. This key sets the value locally
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\begin{NiceTabular}{|ccc|}[~emphase#rules/color=[gray]{0.9},rules/width=1pt@]
+\begin{Code}[width=9.5cm]
+\begin{NiceTabular}{|ccc|}[\emph{rules/color=[gray]{0.9},rules/width=1pt}]
\hline
rose & tulipe & lys \\
arum & iris & violette \\
muguet & dahlia & souci \\
\hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{|ccc|}[rules/color=[gray]{0.9},rules/width=1pt]
\hline
rose & tulipe & lys \\
@@ -1241,15 +1267,15 @@ As well as the command |\Hline|, the specifier ``\verb+|+'' supports an optional
argument between square brackets for the characteristics of the rule.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-\begin{NiceTabular}{|c~emphase#|[color=blue]@c|}
+\begin{Code}[width=10cm]
+\begin{NiceTabular}{|c\emph{|[color=blue]}c|}
\Hline
a & b \\
-~emphase#\Hline[color=red]@
+\emph{\Hline[color=red]}
c & d \\
\Hline
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
%
\begin{NiceTabular}{|c|[color=blue]c|}
\Hline
@@ -1278,13 +1304,13 @@ In fact, for the environments with delimiters (such as |{pNiceMatrix}| or
certainly the expected behaviour).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{pNiceMatrix}[~emphase#vlines@,rules/width=0.2pt]
+\begin{Code}[width=10.6cm]
+$\begin{pNiceMatrix}[\emph{vlines},rules/width=0.2pt]
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[vlines,rules/width=0.2pt]
1 & 2 & 3 & 4 & 5 & 6 \\
1 & 2 & 3 & 4 & 5 & 6 \\
@@ -1304,15 +1330,15 @@ $\begin{pNiceMatrix}[vlines,rules/width=0.2pt]
The key |hvlines| (no value) is the conjonction of the keys |hlines| and |vlines|.
\smallskip
-\begin{Verbatim}
+\begin{Code}
\setlength{\arrayrulewidth}{1pt}
-\begin{NiceTabular}{cccc}[~emphase#hvlines@,rules/color=blue]
+\begin{NiceTabular}{cccc}[\emph{hvlines},rules/color=blue]
rose & tulipe & marguerite & dahlia \\
violette & \Block[draw=red]{2-2}{\LARGE fleurs} & & souci \\
pervenche & & & lys \\
arum & iris & jacinthe & muguet
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\setlength{\arrayrulewidth}{1pt}
@@ -1391,9 +1417,9 @@ into account by the tools for drawing the rules (the rules won't be drawn in
the corners).
\bigskip
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
\NiceMatrixOptions{cell-space-top-limit=3pt}
-\begin{NiceTabular}{*{6}{c}}[~emphase#corners@,hvlines]
+\begin{NiceTabular}{*{6}{c}}[\emph{corners},hvlines]
& & & & A \\
& & A & A & A \\
& & & A \\
@@ -1404,7 +1430,7 @@ A & A & A & A & A & A \\
& \Block{2-2}{B} & & A \\
& & & A \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{*{6}{c}}[corners,hvlines,cell-space-top-limit=3pt]
& & & & A \\
& & A & A & A \\
@@ -1423,9 +1449,9 @@ It's also possible to provide to the key |corners| a (comma-separated) list of
corners (designed by |NW|, |SW|, |NE| and |SE|).
\medskip
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
\NiceMatrixOptions{cell-space-top-limit=3pt}
-\begin{NiceTabular}{*{6}{c}}[~emphase#corners=NE@,hvlines]
+\begin{NiceTabular}{*{6}{c}}[\emph{corners=NE},hvlines]
1\\
1&1\\
1&2&1\\
@@ -1433,7 +1459,7 @@ corners (designed by |NW|, |SW|, |NE| and |SE|).
1&4&6&4&1\\
& & & & &1
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{*{6}{c}}[c,corners=NE,hvlines,cell-space-top-limit=3pt]
1\\
1&1\\
@@ -1459,15 +1485,15 @@ The command |\diagbox| (inspired by the package \pkg{diagbox}), allows, when
it is used in a cell, to slash that cell diagonally downwards.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$\begin{NiceArray}{*{5}{c}}[hvlines]
-~emphase#\diagbox{x}{y}@ & e & a & b & c \\
+\emph{\diagbox{x}{y}} & e & a & b & c \\
e & e & a & b & c \\
a & a & e & c & b \\
b & b & c & e & a \\
c & c & b & a & e
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{NiceArray}{*{5}{c}}[hvlines]
\diagbox{x}{y} & e & a & b & c \\
e & e & a & b & c \\
@@ -1551,8 +1577,8 @@ letters to draw rules with a specific color (and those rules will respect the
blocks and corners as do all the rules of \pkg{nicematrix}).
\medskip
-\begin{Verbatim}
-\begin{NiceTabular}{lcIcIc}~emphase#[custom-line = {letter=I, color=blue}]@
+\begin{Code}
+\begin{NiceTabular}{lcIcIc}\emph{[custom-line = {letter=I, color=blue}]}
\hline
& \Block{1-3}{dimensions} \\
& L & l & h \\
@@ -1562,7 +1588,7 @@ Product B & 1 & 3 & 4 \\
Product C & 5 & 4 & 1 \\
\hline
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -1602,14 +1628,14 @@ rule specified in |tikz|).
\bigskip
Here is an example with the key |dotted| of TikZ.
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
+\begin{Code}[width=9cm]
\NiceMatrixOptions
{
custom-line =
{
letter = I ,
- ~emphase#tikz = dotted@ ,
- ~emphase#total-width = \pgflinewidth@
+ \emph{tikz = dotted ,
+ total-width = \pgflinewidth}
}
}
@@ -1618,7 +1644,7 @@ one & two & three \\
four & five & six \\
seven & eight & nine
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions
{
@@ -1657,33 +1683,33 @@ rules.\footnote{However, it's possible to overwrite those definitions with a
|custom-line| (in order, for example, to switch to dashed lines).}
\smallskip
-\begin{BVerbatim}
+\begin{Code}
-\NiceMatrixOptions % ~textsl#present in nicematrix.sty@
+\NiceMatrixOptions % \textsl{present in nicematrix.sty}
{
custom-line =
{
letter = : ,
command = hdottedline ,
ccommand = cdottedline ,
- ~emphase#dotted@
+ \emph{dotted}
}
}
-\end{BVerbatim}
+\end{Code}
Thus, it's possible to use the commands |\hdottedline| and |\cdottedline |to
draw horizontal dotted rules.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
+\begin{Code}[width=9.5cm]
\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
-~emphase#\hdottedline@
+\emph{\hdottedline}
6 & 7 & 8 & 9 & 10 \\
-~emphase#\cdottedline{1,4-5}@
+\emph{\cdottedline{1,4-5}}
11 & 12 & 13 & 14 & 15
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
\hdottedline
@@ -1699,13 +1725,13 @@ In the environments with an explicit preamble (like |{NiceTabular}|,
specifier ``|:|''.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9.5cm]
-\left(\begin{NiceArray}{cccc~emphase#:@c}
+\begin{Code}[width=9.5cm]
+$\left(\begin{NiceArray}{cccc\emph{:}c}
1 & 2 & 3 & 4 & 5 \\
6 & 7 & 8 & 9 & 10 \\
11 & 12 & 13 & 14 & 15
\end{NiceArray}\right)
-\end{BVerbatim}
+\end{Code}
$\left(\begin{NiceArray}{cccc:c}
1 & 2 & 3 & 4 & 5 \\
6 & 7 & 8 & 9 & 10 \\
@@ -1781,14 +1807,14 @@ An alternative syntax is provided: it's possible to put the content of that
|code-before| between the keywords |\CodeBefore| and |\Body| at the beginning
of the environment.
-\begin{Verbatim}
-\begin{pNiceArray}{~textsl#preamble@}
-~emphase#\CodeBefore [~textsl#options@]@
- ~textsl#instructions of the code-before@
-~emphase#\Body@
- ~textsl#contents of the environment@
+\begin{Code}
+\begin{pNiceArray}{\textsl{preamble}}
+\emph{\CodeBefore [\textsl{options}]}
+ \textsl{instructions of the code-before}
+\emph{\Body}
+ \textsl{contents of the environment}
\end{pNiceArray}
-\end{Verbatim}
+\end{Code}
\smallskip
The optional argument between square brackets is a list of \textsl{key=value}
@@ -1807,7 +1833,7 @@ cf.~p.~\pageref{nodes-i}.}
\index{cellcolor@\texttt{\textbackslash cellcolor}!command of
\texttt{\textbackslash CodeBefore}}
-\index{rectanglecolor@\texttt{\textbackslash rectanglecolor} (command of
+\index{rectanglecolor@\texttt{\textbackslash rectanglecolor} (in
\texttt{\textbackslash CodeBefore})}
\index{rowcolor@\texttt{\textbackslash rowcolor}!command of \texttt{\textbackslash CodeBefore}}
\index{columncolor@\texttt{\textbackslash columncolor}!command of
@@ -1864,16 +1890,16 @@ syntax -$j$).
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
- ~emphase#\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}@
+ \emph{\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}}
\Body
a & b & c \\
e & f & g \\
h & i & j \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\cellcolor[HTML]{FFFF88}{3-1,2-2,-3}
@@ -1892,16 +1918,16 @@ of the rectangle and the third is the lower-right cell of the rectangle.
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
- ~emphase#\rectanglecolor{blue!15}{2-2}{3-3}@
+ \emph{\rectanglecolor{blue!15}{2-2}{3-3}}
\Body
a & b & c \\
e & f & g \\
h & i & j \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\rectanglecolor{blue!15}{2-2}{3-3}
@@ -1927,16 +1953,16 @@ quincunx with these colors.
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
$\begin{pNiceMatrix}[r,margin]
\CodeBefore
- ~emphase#\chessboardcolors{red!15}{blue!15}@
+ \emph{\chessboardcolors{red!15}{blue!15}}
\Body
1 & -1 & 1 \\
-1 & 1 & -1 \\
1 & -1 & 1
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[r,baseline=1, margin]
\CodeBefore
\chessboardcolors{red!15}{blue!15}
@@ -1962,10 +1988,10 @@ from the row $a$ until the end).
\medskip
\begin{scope}
\hfuzz = 10cm
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
+\begin{Code}[width=9cm]
$\begin{NiceArray}{lll}[hvlines]
\CodeBefore
- ~emphase#\rowcolor{red!15}{1,3-5,8-}@
+ \emph{\rowcolor{red!15}{1,3-5,8-}}
\Body
a_1 & b_1 & c_1 \\
a_2 & b_2 & c_2 \\
@@ -1978,7 +2004,7 @@ a_8 & b_8 & c_8 \\
a_9 & b_9 & c_9 \\
a_{10} & b_{10} & c_{10} \\
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{NiceArray}{lll}[baseline=4,hvlines]
\CodeBefore
\rowcolor{red!15}{1,3-5,8-}
@@ -2042,10 +2068,10 @@ several rows if they have to incorporate blocks (created with the command
\medskip
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{clr}[hvlines]
\CodeBefore
- ~emphase#\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]@
+ \emph{\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]}
\Body
\Block{1-*}{Results} \\
John & 12 \\
@@ -2055,7 +2081,7 @@ Ashley & 20 \\
Henry & 14 \\
Madison & 15
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{clr}[hvlines,baseline=2]
\CodeBefore
\rowcolors[gray]{2}{0.8}{}[cols=2-3,restart]
@@ -2073,10 +2099,10 @@ Madison & 15
\vspace{1cm}
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{lr}[hvlines]
\CodeBefore
- ~emphase#\rowcolors{1}{blue!10}{}[respect-blocks]@
+ \emph{\rowcolors{1}{blue!10}{}[respect-blocks]}
\Body
\Block{2-1}{John} & 12 \\
& 13 \\
@@ -2089,7 +2115,7 @@ Henry & 14 \\
\Block{2-1}{Madison} & 15 \\
& 19
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{lr}[hvlines,baseline=c]
\CodeBefore
\rowcolors{1}{blue!10}{}[respect-blocks]
@@ -2118,10 +2144,10 @@ command takes in an argument which is a (comma-separated) list of colors. In
that list, the symbol |=| represent a color identical to the previous one.
\smallskip
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{c}
\CodeBefore
- ~emphase#\rowlistcolors{1}{red!15,blue!15,green!15}@
+ \emph{\rowlistcolors{1}{red!15,blue!15,green!15}}
\Body
Peter \\
James \\
@@ -2131,7 +2157,7 @@ Claudius \\
Jane \\
Alexandra \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{c}
\CodeBefore
\rowlistcolors{1}{red!15,blue!15,green!15}
@@ -2158,12 +2184,12 @@ of the colors to the size of the tabular.}).
\index{resetcolorseries@\texttt{\textbackslash resetcolorseries} (command of \pkg{xcolor})}
\smallskip
-\begin{BVerbatim}[boxwidth=12.5cm,baseline=c]
+\begin{Code}[width=12.5cm]
\begin{NiceTabular}{c}
\CodeBefore
- ~emphase#\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}@
- ~emphase#\resetcolorseries{\value{iRow}}{BlueWhite}@
- ~emphase#\rowlistcolors{1}{BlueWhite!!+}@
+ \emph{\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
+ \resetcolorseries[\value{iRow}]{BlueWhite}
+ \rowlistcolors{1}{BlueWhite!!+}}
\Body
Peter \\
James \\
@@ -2173,7 +2199,7 @@ Claudius \\
Jane \\
Alexandra \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{c}
\CodeBefore
\definecolorseries{BlueWhite}{rgb}{last}{blue}{white}
@@ -2199,10 +2225,10 @@ which are in the ``corners''. In the following example, we use the key
\index{corners (key of an environment)|textit}
\begin{scope}
\hfuzz=11cm
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
-\begin{NiceTabular}{cccccc}[~emphase#corners=NE@,margin,hvlines,first-row,first-col]
+\begin{Code}[width=9cm]
+\begin{NiceTabular}{ccccccc}[\emph{corners=NE},margin,hvlines,first-row,first-col]
\CodeBefore
- ~emphase#\rowlistcolors{1}{blue!15, }@
+ \emph{\rowlistcolors{1}{blue!15, }}
\Body
& 0 & 1 & 2 & 3 & 4 & 5 & 6 \\
0 & 1 \\
@@ -2213,7 +2239,7 @@ which are in the ``corners''. In the following example, we use the key
5 & 1 & 5 & 10 & 10 & 5 & 1 \\
6 & 1 & 6 & 15 & 20 & 15 & 6 & 1 \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
@@ -2246,11 +2272,11 @@ In the following example, we require a color in the column~$0$ (which is the
\medskip
\begin{scope}
\hfuzz=11cm
-\begin{BVerbatim}[boxwidth=9cm,baseline=c]
-\begin{NiceTabular}{cccccc}[~emphase#corners=NE@,margin,hvlines,first-row,first-col]
+\begin{Code}[width=9cm]
+\begin{NiceTabular}{ccccccc}[\emph{corners=NE},margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
- ~emphase#\columncolor{red!15}{0}@
+ \emph{\columncolor{red!15}{0}}
\Body
& 0 & 1 & 2 & 3 & 4 & 5 & 6 \\
0 & 1 \\
@@ -2261,7 +2287,7 @@ In the following example, we require a color in the column~$0$ (which is the
5 & 1 & 5 & 10 & 10 & 5 & 1 \\
6 & 1 & 6 & 15 & 20 & 15 & 6 & 1 \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccccccc}[corners=NE,margin,hvlines,first-row,first-col]
\CodeBefore
\rowlistcolors{1}{blue!15, }
@@ -2288,27 +2314,27 @@ However, \pkg{booktabs} is \emph{not} loaded by \pkg{nicematrix}.
\index{rotate@\texttt{\textbackslash rotate}|textit}
\begin{scope}
\hfuzz=10cm
-\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
+\begin{Code}[width=8.5cm]
\begin{NiceTabular}[c]{lSSSS}
\CodeBefore
\rowcolor{red!15}{1-2}
\rowcolors{3}{blue!15}{}
\Body
-~emphase#\toprule@
-\Block{2-1}{Product} &
+\emph{\toprule}
+\Block{2-1}{Product} &
\Block{1-3}{dimensions (cm)} & & &
\Block{2-1}{\rotate Price} \\
-~emphase#\cmidrule(rl){2-4}@
+\emph{\cmidrule(rl){2-4}}
& L & l & h \\
-~emphase#\midrule@
+\emph{\midrule}
small & 3 & 5.5 & 1 & 30 \\
standard & 5.5 & 8 & 1.5 & 50.5 \\
premium & 8.5 & 10.5 & 2 & 80 \\
extra & 8.5 & 10 & 1.5 & 85.5 \\
special & 12 & 12 & 0.5 & 70 \\
-~emphase#\bottomrule@
+\emph{\bottomrule}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}[c]{lSSSS}
\CodeBefore
\rowcolor{red!15}{1-2}
@@ -2376,20 +2402,20 @@ These commands are compatible with the commands for the overlays of Beamer
(|\only|, etc.)
\smallskip
-\begin{Verbatim}
-\NewDocumentCommand { \Blue } { } { ~emphase#\columncolor{blue!15}@ }
+\begin{Code}
+\NewDocumentCommand { \Blue } { } { \emph{\columncolor{blue!15}} }
\begin{NiceTabular}[color-inside]{>{\Blue}c>{\Blue}cc}
\toprule
-~emphase#\rowcolor{red!15}@
+\emph{\rowcolor{red!15}}
Last name & First name & Birth day \\
\midrule
-Achard & Jacques & 5 juin 1962 \\
+Achard & Jacques & 5 juin 1962 \\
Lefebvre & Mathilde & 23 mai 1988 \\
Vanesse & Stephany & 30 octobre 1994 \\
Dupont & Chantal & 15 janvier 1998 \\
\bottomrule
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -2418,19 +2444,19 @@ coloring the rows with |\rowlistcolors{...}| and stop coloring by a command
|\rowlistcolors| with an empty argument.
\bigskip
-\begin{BVerbatim}[boxwidth=10cm,baseline=c]
+\begin{Code}[width=10cm]
\begin{NiceTabular}{c}[hvlines,color-inside]
one \\
two \\
-~emphase#\rowlistcolors{red!15}@
+\emph{\rowlistcolors{red!15}}
three \\
four \\
five \\
-~emphase#\rowlistcolors{}@
+\emph{\rowlistcolors{}}
six \\
seven \\
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{c}[hvlines,color-inside]
one \\
two \\
@@ -2495,16 +2521,16 @@ math and text mode.
\end{itemize}
\medskip
-\begin{BVerbatim}[boxwidth=12cm,baseline=c]
+\begin{Code}[width=12cm]
\begin{NiceTabular}{cccc}
\hline
-~emphase#\RowStyle[cell-space-limits=3pt]{\rotate}@
+\emph{\RowStyle[cell-space-limits=3pt]{\rotate}}
first & second & third & fourth \\
-~emphase#\RowStyle[nb-rows=2,rowcolor=blue!50,color=white]{\sffamily}@
+\emph{\RowStyle[nb-rows=2,rowcolor=blue!50,color=white]{\sffamily}}
1 & 2 & 3 & 4 \\
I & II & III & IV
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\index{rotate@\texttt{\textbackslash rotate}|textit}
\begin{NiceTabular}{cccc}
\hline
@@ -2530,13 +2556,13 @@ In the environments with an explicit preamble (like |{NiceTabular}|,
the standard letters |w|, |W|, |p|, |b| and |m| of the package \pkg{array}.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
-\begin{NiceTabular}{~emphase#W{c}{2cm}@cc}[hvlines]
+\begin{Code}[width=9cm]
+\begin{NiceTabular}{\emph{W{c}{2cm}}cc}[hvlines]
Paris & New York & Madrid \\
Berlin & London & Roma \\
Rio & Tokyo & Oslo
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{W{c}{2cm}cc}[hvlines]
Paris & New York & Madrid \\
Berlin & London & Roma \\
@@ -2551,13 +2577,13 @@ width of all the columns (except the potential exterior columns: cf. p.~\pageref
with the key |columns-width|.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{pNiceMatrix}[~emphase#columns-width = 1cm@]
+\begin{Code}[width=10cm]
+$\begin{pNiceMatrix}[\emph{columns-width = 1cm}]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[columns-width = 1cm]
1 & 12 & -123 \\
12 & 0 & 0 \\
@@ -2578,13 +2604,13 @@ will have written informations in the |aux| file and a message requiring a
second compilation will appear).}\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{pNiceMatrix}[~emphase#columns-width = auto@]
+\begin{Code}[width=10cm]
+$\begin{pNiceMatrix}[\emph{columns-width = auto}]
1 & 12 & -123 \\
12 & 0 & 0 \\
4 & 1 & 2
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[columns-width = auto]
1 & 12 & -123 \\
12 & 0 & 0 \\
@@ -2597,8 +2623,8 @@ the arrays of a current scope with the command
|\NiceMatrixOptions|.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-~emphase#\NiceMatrixOptions{columns-width=10mm}@
+\begin{Code}[width=8.5cm]
+\emph{\NiceMatrixOptions{columns-width=10mm}}
$\begin{pNiceMatrix}
a & b \\ c & d
\end{pNiceMatrix}
@@ -2606,7 +2632,7 @@ a & b \\ c & d
\begin{pNiceMatrix}
1 & 1245 \\ 345 & 2
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{columns-width=10mm}
$\begin{pNiceMatrix}
@@ -2633,8 +2659,8 @@ The environment |{NiceMatrixBlock}| has no direct link with the command
|\Block| presented previously in this document (cf.~p.~\pageref{Block}).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=8.5cm]
-~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@
+\begin{Code}[width=8.5cm]
+\emph{\begin{NiceMatrixBlock}[auto-columns-width]}
$\begin{array}{c}
\begin{bNiceMatrix}
9 & 17 \\ -2 & 5
@@ -2643,8 +2669,8 @@ $\begin{array}{c}
1 & 1245345 \\ 345 & 2
\end{bNiceMatrix}
\end{array}$
-~emphase#\end{NiceMatrixBlock}@
-\end{BVerbatim}
+\emph{\end{NiceMatrixBlock}}
+\end{Code}
\begin{NiceMatrixBlock}[auto-columns-width]
$\begin{array}{c}
\begin{bNiceMatrix}
@@ -2694,13 +2720,13 @@ letters |l|, |c| and |r| (which insert respectively |\raggedright|,
|p|, |m| and |b|). The default value is |t|.
\end{itemize}
-\begin{Verbatim}
-\begin{NiceTabular}~emphase#[width=9cm]{X[2,l]X[l]}@[hvlines]
+\begin{Code}
+\emph{\begin{NiceTabular}[width=9cm]{X[2,l]X[l]}[hvlines]}
a rather long text which fits on several lines
& a rather long text which fits on several lines \\
a shorter text & a shorter text
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\begin{NiceTabular}[width=9cm]{X[2,l]X[l]}[hvlines]
@@ -2729,15 +2755,15 @@ contents.
That point is illustrated on the following examples.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=6cm]
+\begin{Code}[width=6cm]
\fbox{%
-\begin{~emphase#varwidth@}{8cm}
+\begin{\emph{varwidth}}{8cm}
\begin{itemize}
\item first item
\item second item
\end{itemize}
-\end{~emphase#varwidth@}}
-\end{BVerbatim}
+\end{\emph{varwidth}}}
+\end{Code}
\fbox{\begin{varwidth}{8cm}
\begin{itemize}
\item first item
@@ -2746,15 +2772,15 @@ That point is illustrated on the following examples.
\end{varwidth}}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=6cm]
+\begin{Code}[width=6cm]
\fbox{%
-\begin{~emphase#minipage@}{8cm}
+\begin{\emph{minipage}}{8cm}
\begin{itemize}
\item first item
\item second item
\end{itemize}
-\end{~emphase#minipage@}}
-\end{BVerbatim}
+\end{\emph{minipage}}}
+\end{Code}
\fbox{\begin{minipage}{8cm}
\begin{itemize}
\item first item
@@ -2773,13 +2799,13 @@ When the package \pkg{varwidth} is loaded, the columns |V| of \pkg{varwidth}
are supported by \pkg{nicematrix}.
\medskip
-\begin{Verbatim}
-\begin{NiceTabular}[corners=NW,hvlines]{~emphase#V{3cm}V{3cm}V{3cm}@}
+\begin{Code}
+\begin{NiceTabular}[corners=NW,hvlines]{\emph{V{3cm}V{3cm}V{3cm}}}
& some text & some very very very long text \\
some very very very long text \\
some very very very long text
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\medskip
\begin{center}
@@ -2827,8 +2853,8 @@ matrices.
A potential ``first row'' (exterior) has the number $0$ (and not $1$). Idem
for the potential ``first column''.
-\begin{Verbatim}
-$\begin{pNiceMatrix}[~emphase#first-row,last-row,first-col,last-col@,nullify-dots]
+\begin{Code}
+$\begin{pNiceMatrix}[\emph{first-row,last-row,first-col,last-col},nullify-dots]
& C_1 & \Cdots & & C_4 & \\
L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
\Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
@@ -2836,7 +2862,7 @@ L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
L_4 & a_{41} & a_{42} & a_{43} & a_{44} & L_4 \\
& C_1 & \Cdots & & C_4 &
\end{pNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceMatrix}[first-row,last-row,first-col,last-col,nullify-dots]
& C_1 & \Cdots & & C_4 & \\
@@ -2896,21 +2922,23 @@ It's possible to control the appearance of these rows and columns with options
each cell of the corresponding row or column.
-\begin{Verbatim}
-\NiceMatrixOptions{~emphase#code-for-first-row@ = \color{red},
- ~emphase#code-for-first-col@ = \color{blue},
- ~emphase#code-for-last-row@ = \color{green},
- ~emphase#code-for-last-col@ = \color{magenta}}
-$\begin{pNiceArray}{cc|cc}[first-row,last-row=5,first-col,last-col,nullify-dots]
- & C_1 & \Cdots & & C_4 & \\
+\begin{Code}
+\NiceMatrixOptions{\emph{code-for-first-row = \color{red},
+ code-for-first-col = \color{blue},
+ code-for-last-row = \color{green},
+ code-for-last-col = \color{magenta}}}
+\begin{displaymath}
+\begin{pNiceArray}{cc|cc}[first-row,last-row=5,first-col,last-col,nullify-dots]
+ & C_1 & \multicolumn1c{\Cdots} & & C_4 & \\
L_1 & a_{11} & a_{12} & a_{13} & a_{14} & L_1 \\
\Vdots & a_{21} & a_{22} & a_{23} & a_{24} & \Vdots \\
\hline
& a_{31} & a_{32} & a_{33} & a_{34} & \\
L_4 & a_{41} & a_{42} & a_{43} & a_{44} & L_4 \\
- & C_1 & \Cdots & & C_4 &
-\end{pNiceArray}$
-\end{Verbatim}
+ & C_1 & \multicolumn1c{\Cdots} & & C_4 &
+\end{pNiceArray}
+\end{displaymath}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{code-for-first-row = \color{red},
@@ -2991,7 +3019,7 @@ remind that it works for |\Cdots|, |\Ldots|, |\Vdots|, etc.): cf. p.
\pageref{customisation}.}\par\nobreak
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
a_1 & \Cdots & & & a_1 \\
\Vdots & a_2 & \Cdots & & a_2 \\
@@ -2999,7 +3027,7 @@ a_1 & \Cdots & & & a_1 \\
\\
a_1 & a_2 & & & a_n
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
a_1 & \Cdots & & & a_1 \\
\Vdots & a_2 & \Cdots & & a_2 \\
@@ -3013,13 +3041,13 @@ In order to represent the null matrix, one can use the following
codage:\par\nobreak
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
0 & \Cdots & 0 \\
\Vdots & & \Vdots \\
0 & \Cdots & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & 0 \\
\Vdots & & \Vdots \\
@@ -3032,14 +3060,14 @@ LaTeX add a new row and a new column. It's possible to use the same method
with \pkg{nicematrix}:\par\nobreak
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
0 & \Cdots & \Cdots & 0 \\
\Vdots & & & \Vdots \\
\Vdots & & & \Vdots \\
0 & \Cdots & \Cdots & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & \Cdots & 0 \\
\Vdots & & & \Vdots \\
@@ -3056,14 +3084,14 @@ In fact, in this example, it would be possible to draw the same matrix more
easily with the following code:\par\nobreak
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
\begin{bNiceMatrix}
0 & \Cdots & & 0 \\
\Vdots & & & \\
& & & \Vdots \\
0 & & \Cdots & 0
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & & 0 \\
\Vdots & & & \\
@@ -3088,13 +3116,13 @@ command~|\Hspace| which is a variant of |\hspace| transparent for the dotted
lines of \pkg{nicematrix}.\par\nobreak
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-\begin{bNiceMatrix}
-0 & \Cdots & ~emphase#\Hspace*{1cm}@ & 0 \\
-\Vdots & & & \Vdots \\~emphase#[1cm]@
+\begin{Code}[width=10cm]
+$\begin{bNiceMatrix}
+0 & \Cdots & \emph{\Hspace*{1cm}} & 0 \\
+\Vdots & & & \Vdots \\[1cm]
0 & \Cdots & & 0
-\end{bNiceMatrix}
-\end{BVerbatim}
+\end{bNiceMatrix}$
+\end{Code}
$\begin{bNiceMatrix}
0 & \Cdots & \Hspace*{1cm} & 0 \\
\Vdots & & & \Vdots \\[1cm]
@@ -3109,12 +3137,12 @@ Consider the following matrix composed classicaly with the environment
|{pmatrix}| of \pkg{amsmath}.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$A = \begin{pmatrix}
h & i & j & k & l & m \\
x & & & & & x
\end{pmatrix}$
-\end{BVerbatim}
+\end{Code}
$A = \begin{pmatrix}
h & i & j & k & l & m \\
x & & & & & x
@@ -3126,12 +3154,12 @@ If we add |\ldots| instructions in the second row, the geometry of the
matrix is modified.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$B = \begin{pmatrix}
h & i & j & k & l & m \\
x & \ldots & \ldots & \ldots & \ldots & x
\end{pmatrix}$
-\end{BVerbatim}
+\end{Code}
$B = \begin{pmatrix}
h & i & j & k & l & m \\
x & \ldots & \ldots & \ldots & \ldots & x
@@ -3143,12 +3171,12 @@ By default, with \pkg{nicematrix}, if we replace |{pmatrix}| by
changed.\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$C = \begin{pNiceMatrix}
h & i & j & k & l & m \\
x & \Ldots & \Ldots & \Ldots & \Ldots & x
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$C = \begin{pNiceMatrix}
h & i & j & k & l & m \\
x & \Ldots & \Ldots & \Ldots & \Ldots & x
@@ -3161,12 +3189,12 @@ using the option |nullify-dots| (and only one instruction |\Ldots| is
necessary).\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$D = \begin{pNiceMatrix}[~emphase#nullify-dots@]
+\begin{Code}[width=10cm]
+$D = \begin{pNiceMatrix}[\emph{nullify-dots}]
h & i & j & k & l & m \\
-x & \Ldots & & & & x
+x & \Ldots & & & & x
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$D = \begin{pNiceMatrix}[nullify-dots]
h & i & j & k & l & m \\
x & \Ldots & & & & x
@@ -3197,14 +3225,14 @@ As with the other commands of \pkg{nicematrix} (like |\Cdots|, |\Ldots|,
contents of the cells on both sides.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=7cm]
+\begin{Code}[width=7cm]
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
-1 & ~emphase#\Hdotsfor{3}@ & 5 \\
+1 & \emph{\Hdotsfor{3}} & 5 \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
1 & \Hdotsfor{3} & 5 \\
@@ -3217,14 +3245,14 @@ However, if these cells are empty, the dotted line extends only in the cells
specified by the argument of |\Hdotsfor| (by design).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=7cm]
+\begin{Code}[width=7cm]
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
- & ~emphase#\Hdotsfor{3}@ \\
+ & \emph{\Hdotsfor{3}} \\
1 & 2 & 3 & 4 & 5 \\
1 & 2 & 3 & 4 & 5
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 \\
& \Hdotsfor{3} \\
@@ -3247,38 +3275,41 @@ The package \pkg{nicematrix} also provides a command |\Vdotsfor| similar to
\bigskip
The following example uses both |\Hdotsfor| and |\Vdotsfor|:
-\begin{Verbatim}[formatcom=\small\color{gray}]
+\smallskip
+\begin{scope}
+\small
+\begin{Code}
\begin{bNiceMatrix}
-C[a_1,a_1] & \Cdots & C[a_1,a_n]
+C[a_1,a_1] & \Cdots & C[a_1,a_n]
& \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
-\Vdots & \Ddots & \Vdots
- & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
-C[a_n,a_1] & \Cdots & C[a_n,a_n]
+\Vdots & \Ddots & \Vdots
+ & \emph{\Hdotsfor{1}} & \Vdots & \Ddots & \Vdots \\
+C[a_n,a_1] & \Cdots & C[a_n,a_n]
& & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
-\rule{0pt}{15mm}\NotEmpty & ~emphase#\Vdotsfor{1}@ & & \Ddots & & ~emphase#\Vdotsfor{1}@ \\
-C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n]
+\rule{0pt}{15mm}\NotEmpty & \emph{\Vdotsfor{1}} & & \Ddots & & \emph{\Vdotsfor{1}} \\
+C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n]
& & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
-\Vdots & \Ddots & \Vdots
- & ~emphase#\Hdotsfor{1}@ & \Vdots & \Ddots & \Vdots \\
-C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n]
+\Vdots & \Ddots & \Vdots
+ & \emph{\Hdotsfor{1}} & \Vdots & \Ddots & \Vdots \\
+C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n]
& & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
\end{bNiceMatrix}
-\end{Verbatim}
+\end{Code}
+\end{scope}
\[\begin{bNiceMatrix}
C[a_1,a_1] & \Cdots & C[a_1,a_n] & \hspace*{20mm} & C[a_1,a_1^{(p)}] & \Cdots & C[a_1,a_n^{(p)}] \\
-\Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
+\Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
C[a_n,a_1] & \Cdots & C[a_n,a_n] & & C[a_n,a_1^{(p)}] & \Cdots & C[a_n,a_n^{(p)}] \\
\rule{0pt}{15mm}\NotEmpty & \Vdotsfor{1} & & \Ddots & & \Vdotsfor{1} \\
C[a_1^{(p)},a_1] & \Cdots & C[a_1^{(p)},a_n] & & C[a_1^{(p)},a_1^{(p)}] & \Cdots & C[a_1^{(p)},a_n^{(p)}] \\
-\Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
+\Vdots & \Ddots & \Vdots & \Hdotsfor{1} & \Vdots & \Ddots & \Vdots \\
C[a_n^{(p)},a_1] & \Cdots & C[a_n^{(p)},a_n] & & C[a_n^{(p)},a_1^{(p)}] & \Cdots & C[a_n^{(p)},a_n^{(p)}]
\end{bNiceMatrix}\]
-
\subsection{How to generate the continuous dotted lines transparently}
\index{renew-matrix}
@@ -3313,18 +3344,18 @@ With this option, the environment |{matrix}| is redefined and behave like
Therefore, with the keys |renew-dots| and |renew-matrix|, a classical code
gives directly the ouput of \pkg{nicematrix}.\par\nobreak
-\bigskip
+\medskip
\begin{scope}
\NiceMatrixOptions{renew-dots,renew-matrix}
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-~emphase#\NiceMatrixOptions{renew-dots,renew-matrix}@
+\begin{Code}[width=10cm]
+\emph{\NiceMatrixOptions{renew-dots,renew-matrix}}
\begin{pmatrix}
1 & \cdots & \cdots & 1 \\
0 & \ddots & & \vdots \\
\vdots & \ddots & \ddots & \vdots \\
0 & \cdots & 0 & 1
\end{pmatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pmatrix}
1 & \cdots & \cdots & 1 \\
0 & \ddots & & \vdots \\
@@ -3347,13 +3378,13 @@ white background which is put on the line previously drawn (see example on
p.~\pageref{ex:colon}).
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
- & ~emphase#\Ddots^{n \text{ times}}@ & \\
+ & \emph{\Ddots^{n \text{ times}}} & \\
0 & & 1
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}
1 & \hspace*{1cm} & 0 \\[8mm]
& \Ddots^{n \text{ times}} & \\
@@ -3365,13 +3396,13 @@ $\begin{bNiceMatrix}
With the key |xdots/horizontal-labels|, the labels stay horizontal.\par\nobreak
%
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
+\begin{Code}[width=10cm]
$\begin{bNiceMatrix}[xdots/horizontal-labels]
1 & \hspace*{1cm} & 0 \\[8mm]
- & ~emphase#\Ddots^{n \text{ times}}@ & \\
+ & \emph{\Ddots^{n \text{ times}}} & \\
0 & & 1
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[xdots/horizontal-labels]
1 & \hspace*{1cm} & 0 \\[8mm]
& \Ddots^{n \text{ times}} & \\
@@ -3487,8 +3518,8 @@ the TikZ pathes (with the exception of ``|color|'', ``|shorten >|'' and
Here is for example a tridiagonal matrix with the style |loosely dotted|:\par\nobreak
\medskip
-\begin{BVerbatim}[baseline=c]
-$\begin{pNiceMatrix}[nullify-dots,~emphase#xdots/line-style=loosely dotted@]
+\begin{Code}
+$\begin{pNiceMatrix}[nullify-dots,\emph{xdots/line-style=loosely dotted}]
a & b & 0 & & \Cdots & 0 \\
b & a & b & \Ddots & & \Vdots \\
0 & b & a & \Ddots & & \\
@@ -3496,7 +3527,7 @@ b & a & b & \Ddots & & \Vdots \\
\Vdots & & & & & b \\
0 & \Cdots & & 0 & b & a
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\[\begin{pNiceMatrix}[nullify-dots,xdots/line-style=loosely dotted]
@@ -3523,14 +3554,14 @@ blocks).\footnote{On the other side, the command |\line| in the
block.}
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{bNiceMatrix}[margin,~emphase#hvlines@]
+\begin{Code}[width=10.6cm]
+$\begin{bNiceMatrix}[margin,\emph{hvlines}]
\Block{3-3}<\LARGE>{A} & & & 0 \\
& \hspace*{1cm} & & \Vdots \\
& & & 0 \\
0 & \Cdots& 0 & 0
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[margin,hvlines]
\Block{3-3}<\LARGE>{A} & & & 0 \\
& \hspace*{1cm} & & \Vdots \\
@@ -3538,6 +3569,7 @@ $\begin{bNiceMatrix}[margin,hvlines]
0 & \Cdots& 0 & 0
\end{bNiceMatrix}$
+
\index{dotted@\textbf{Dotted lines}|)}
\section{Delimiters in the preamble of the environment}
@@ -3568,13 +3600,13 @@ All the vertical extensible delimiters of LaTeX are allowed.
Here is a example which uses the delimiters |\lgroup| and |\rgroup|.
\smallskip
-\begin{BVerbatim}
-$\begin{NiceArray}{~emphase#\left\lgroup@ ccc~emphase#\right\rgroup@ l}
+\begin{Code}
+$\begin{NiceArray}{\emph{\left\lgroup} ccc\emph{\right\rgroup} l}
1 & 2 & 3 &
4 & 1 & 6 &
7 & 8 & 9 & \scriptstyle L_3 \gets L_3 + L_1 + L_2
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\[\begin{NiceArray}{\left\lgroup ccc\right\rgroup l}
1 & 2 & 3 & \\
@@ -3588,12 +3620,34 @@ For this example, it would also have been possible to use the environment
p.~\pageref{NiceArrayWithDelims}) and the key |last-col| (cf. p.~\pageref{exterior}).
\bigskip
-There is a particular case: for the delimiters |(|, |[| and |\{| (and the
-corresponding closing delimiters), the prefixes |\left| et |\right| are
+There is a particular case: for the delimiters |(|, |[| and |\{|\footnote{For
+ the braces, the protection by a backslash is mandatory (that's why we have
+ written |\{|).},
+and the corresponding closing delimiters, the prefixes |\left| et |\right| are
optional.\footnote{For the delimiters |[| and |]|, the prefixes remain mandatory
when there is a conflict of notation with the square brackets for the options
of some descriptors of columns.}
+\bigskip
+Here is an example with a left delimiter |\{| in a |{NiceTabular}| (remark the
+compatibility with the key |t|).
+
+\smallskip
+\begin{Verbatim}
+We define $f$ with\quad
+\begin{NiceTabular}[t]{\{ll}
+$f(x) = 0$ & if $x$ is non positive \\
+$f(x) = 1-e^x$ & if $x$ is positive
+\end{Verbatim}
+
+\smallskip
+\begin{center}
+On définit $f$ par\quad
+\begin{NiceTabular}[t]{\{ll}
+$f(x) = 0$ & if $x$ is non positive\\
+$f(x) = 1-e^x$ & if $x$ is positive
+\end{NiceTabular}
+\end{center}
\bigskip
@@ -3602,13 +3656,13 @@ an opening one for another submatrix), a space equal to |\enskip| is
automatically inserted.
\medskip
-\begin{BVerbatim}
-$\begin{pNiceArray}{~emphase#(c)(c)(c)@}
+\begin{Code}
+$\begin{pNiceArray}{\emph{(c)(c)(c)}}
a_{11} & a_{12} & a_{13} \\
a_{21} & \displaystyle \int_0^1\dfrac{1}{x^2+1}\,dx & a_{23} \\
a_{31} & a_{32} & a_{33}
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
\[\begin{pNiceArray}{(c)(c)(c)}
a_{11} & a_{12} & a_{13} \\
@@ -3676,16 +3730,16 @@ This command may be used, for example, to draw a dotted line between two
adjacent cells.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
\NiceMatrixOptions{xdots/shorten = 0.6 em}
\begin{pNiceMatrix}
I & 0 & \Cdots &0 \\
0 & I & \Ddots &\Vdots\\
\Vdots &\Ddots & I &0 \\
0 &\Cdots & 0 &I
-~emphase#\CodeAfter \line{2-2}{3-3}@
+\emph{\CodeAfter \line{2-2}{3-3}}
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
\begin{scope}
\NiceMatrixOptions{xdots/shorten = 0.6 em}
$\begin{pNiceMatrix}
@@ -3703,15 +3757,15 @@ lines (by default, the dotted lines drawn by |\Ddots| are ``parallelized'':
cf.~p.~\pageref{parallelization}).
\medskip
-\begin{BVerbatim}
+\begin{Code}
\begin{bNiceMatrix}
1 & \Cdots & & 1 & 2 & \Cdots & 2 \\
0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\
\Vdots & \Ddots & & & & & \\
0 & \Cdots & 0 & 1 & 2 & \Cdots & 2
-~emphase#\CodeAfter \line[shorten=6pt]{1-5}{4-7}@
+\emph{\CodeAfter \line[shorten=6pt]{1-5}{4-7}}
\end{bNiceMatrix}
-\end{BVerbatim}
+\end{Code}
\[\begin{bNiceMatrix}
1 & \Cdots & & 1 & 2 & \Cdots & 2 \\
0 & \Ddots & & \Vdots & \Vdots & \hspace*{2.5cm} & \Vdots \\
@@ -3760,17 +3814,16 @@ and you have added by hand some space between the third and fourth column with
\medskip
\begin{scope}
\hfuzz=15cm
-\fvset{commandchars=\~\#\+}%
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
-\[\begin{NiceArray}{ccc~emphase#@{\hspace{1.5em}}+c}[cell-space-limits=2pt,~emphase#margin+]
+\begin{Code}[width=11cm]
+\[\begin{NiceArray}{ccc\emph{@{\hspace{1.5em}}}c}[cell-space-limits=2pt,\emph{margin}]
1 & 1 & 1 & x \\
\dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
1 & 2 & 3 & z
\CodeAfter
- ~emphase#\SubMatrix({1-1}{3-3})+
- ~emphase#\SubMatrix({1-4}{3-4})+
+ \emph{\SubMatrix({1-1}{3-3})
+ \SubMatrix({1-4}{3-4})}
\end{NiceArray}\]
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{ccc@{\hspace{1.5em}}c}[cell-space-limits=2pt,margin]
1 & 1 & 1 & x \\
@@ -3790,13 +3843,13 @@ with the following construction.
\medskip
\begin{scope}
\hfuzz=15cm
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
-$\begin{NiceArray}{~emphase#(ccc)(c)@}[cell-space-limits=2pt]
+\begin{Code}[width=11cm]
+$\begin{NiceArray}{\emph{(ccc)(c)}}[cell-space-limits=2pt]
1 & 1 & 1 & x \\
\dfrac{1}{4} & \dfrac{1}{2} & \dfrac{1}{4} & y \\
1 & 2 & 3 & z
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{(ccc)(c)}[cell-space-limits=2pt]
1 & 1 & 1 & x \\
@@ -3812,15 +3865,15 @@ and subscript.
\medskip
\begin{scope}
\hfuzz=15cm
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
$\begin{bNiceMatrix}[right-margin=1em]
1 & 1 & 1 \\
1 & a & b \\
1 & c & d
\CodeAfter
- ~emphase#\SubMatrix[{2-2}{3-3}]^{T}@
+ \emph{\SubMatrix[{2-2}{3-3}]^{T}}
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[right-margin=1em]
1 & 1 & 1 \\
1 & a & b \\
@@ -3880,19 +3933,18 @@ the prefix |sub-matrix| which means that their names are therefore
\bigskip
\begin{scope}
\hfuzz=12cm
-\fvset{commandchars=\~\#\!}%
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
- & & \frac12 \\
- & & \frac14 \\[1mm]
-a & b & \frac12a+\frac14b \\
-c & d & \frac12c+\frac14d \\
+ & & \frac{1}{2} \\
+ & & \frac{1}{4} \\[1mm]
+a & b & \frac{1}{2}a+\frac{1}{4}b \\
+c & d & \frac{1}{2}c+\frac{1}{4}d \\
\CodeAfter
\SubMatrix({1-3}{2-3})
\SubMatrix({3-1}{4-2})
\SubMatrix({3-3}{4-3})
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
& & \frac12 \\
@@ -3911,19 +3963,18 @@ Here is the same example with the key |slim| used for one of the submatrices.
\medskip
\begin{scope}
\hfuzz=12cm
-\fvset{commandchars=\~\#\!}%
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
& & \frac12 \\
& & \frac14 \\[1mm]
a & b & \frac12a+\frac14b \\
c & d & \frac12c+\frac14d \\
\CodeAfter
- \SubMatrix({1-3}{2-3})[~emphase#slim!]
+ \SubMatrix({1-3}{2-3})[\emph{slim}]
\SubMatrix({3-1}{4-2})
\SubMatrix({3-3}{4-3})
\end{NiceArray}$
-\end{BVerbatim}
+\end{Code}
\end{scope}
$\begin{NiceArray}{cc@{\hspace{5mm}}l}[cell-space-limits=2pt]
& & \frac12 \\
@@ -3949,17 +4000,17 @@ Despite its name, the command |\SubMatrix| may also be used within a
|\toprule| of \pkg{booktabs}).
\medskip
-\begin{BVerbatim}[baseline=c]
-\begin{NiceTabular}{~LetterAt{}ll~LetterAt{}}
+\begin{Code}[width=8cm]
+\begin{NiceTabular}{@{}ll@{}}
\toprule
Part A & the first part \\
\Block{2-1}{Part B} & a first sub-part \\
& a second sub-part \\
\bottomrule
\CodeAfter
- ~emphase#\SubMatrix{\{}{2-2}{3-2}{.}@
+ \emph{\SubMatrix{\{}{2-2}{3-2}{.}}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\hspace{2cm}
\begin{NiceTabular}{@{}ll@{}}
\toprule
@@ -3983,7 +4034,7 @@ p.~\pageref{submatrix-in-codebefore}.
\vspace{1cm}
\emph{Caution} : The following functionnality is fragile and does not work with
-the compilationn |latex|--|dvips|--|ps2pdf|.\par\nobreak
+|latex|--|dvips|--|ps2pdf|.\par\nobreak
The key |code| of the command |\SubMatrix| allows the insertion of code after
the construction of the submatrix. It's meant to be used to insert TikZ
@@ -3993,9 +4044,7 @@ numbers of row and columns \emph{relative to the submatrix}.\footnote{Be
careful: the syntax \verb+j|-i+ is \emph{not} allowed.}
\medskip
-\begin{scope}
-\fvset{commandchars=\~\#\!}%
-\begin{Verbatim}
+\begin{Code}
$\begin{NiceArray}{ccc@{}w{c}{5mm}@{}ccc}
& & && -1 & 1 & 2 \\
& & && 0 & 3 & 4 \\
@@ -4004,13 +4053,14 @@ $\begin{NiceArray}{ccc@{}w{c}{5mm}@{}ccc}
0 & 4 & 5 && 0 & 12 & 41 \\
0 & 0 & 6 && 0 & 0 & 30
\CodeAfter
- ~emphase#\NewDocumentCommand{\MyDraw}{}{\tikz \draw [blue] (2-|1) -| (3-|2) -| (4-|3) ;}!
- \SubMatrix({1-5}{3-7})[~emphase#code = \MyDraw!]
- \SubMatrix({4-1}{6-3})[~emphase#code = \MyDraw!]
- \SubMatrix({4-5}{6-7})[~emphase#code = \MyDraw!]
+ \emph{\NewDocumentCommand{\MyDraw}{}{\tikz \draw [blue] (2-|1) -| (3-|2) -|
+ (4-|3) ;}}
+ \SubMatrix({1-5}{3-7})[\emph{code = \MyDraw} ]
+ \SubMatrix({4-1}{6-3})[\emph{code = \MyDraw} ]
+ \SubMatrix({4-5}{6-7})[\emph{code = \MyDraw} ]
\end{NiceArray}$
-\end{Verbatim}
-\end{scope}
+\end{Code}
+
\[\begin{NiceArray}{ccc@{}w{c}{5mm}@{}ccc}
@@ -4054,15 +4104,15 @@ syntax $i$|-|$j$ where $i$ the number of row and $j$ the number of column;
\end{itemize}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
\CodeAfter
- ~emphase#\OverBrace{1-1}{2-3}{A}@
- ~emphase#\OverBrace{1-4}{2-6}{B}@
+ \emph{\OverBrace{1-1}{2-3}{A}
+ \OverBrace{1-4}{2-6}{B}}
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
@@ -4105,15 +4155,15 @@ and |right-shorten|;
\end{itemize}
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
\CodeAfter
- \OverBrace~emphase#[shorten,yshift=3pt]@{1-1}{2-3}{A}
- \OverBrace~emphase#[shorten,yshift=3pt]@{1-4}{2-6}{B}
+ \OverBrace[\emph{shorten,yshift=3pt}]{1-1}{2-3}{A}
+ \OverBrace[\emph{shorten,yshift=3pt}]{1-4}{2-6}{B}
\end{pNiceMatrix}
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 & 4 & 5 & 6 \\
11 & 12 & 13 & 14 & 15 & 16 \\
@@ -4156,7 +4206,7 @@ which are the other keys in the argument of |\TikzEveryCell|.
\medskip
\begingroup
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\renewcommand{\arraystretch}{1.3}
\begin{NiceTabular}{ccc}[corners]
& \Block{1-2}{columns} \\
@@ -4164,9 +4214,9 @@ which are the other keys in the argument of |\TikzEveryCell|.
& cell 1 1 & cell 1 2 \\
& cell 2 1 & cell 2 2
\CodeAfter
- ~emphase#\TikzEveryCell{offset=1pt,draw}@
+ \emph{\TikzEveryCell{offset=1pt,draw}}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\renewcommand{\arraystretch}{1.3}
\begin{NiceTabular}{ccc}[corners]
& \Block{1-2}{columns} \\
@@ -4285,23 +4335,23 @@ been loaded (before or after \pkg{nicematrix}). Indeed, the notes are composed
at the end of the array with a type of list provided by the package
\pkg{enumitem}.
-\begin{scope}
-\fvset{commandchars=\~\#\!}
-\begin{Verbatim}
+
+
+\begin{Code}
\begin{NiceTabular}{@{}llr@{}}
\toprule \RowStyle{\bfseries}
Last name & First name & Birth day \\
\midrule
-Achard\tabularnote{~emphase#Achard is an old family of the Poitou.!}
-& Jacques & 5 juin 1962 \\
-Lefebvre\tabularnote{~emphase#The name Lefebvre is an alteration of the name Lefebure.!}
-& Mathilde & 23 mai 1988 \\
-Vanesse & Stephany & 30 octobre 1994 \\
-Dupont & Chantal & 15 janvier 1998 \\
+Achard\emph{\tabularnote{Achard is an old family of the Poitou.}}
+& Jacques & June 5, 2005 \\
+Lefebvre\emph{\tabularnote{The name Lefebvre is an alteration of the name Lefebure.}}
+& Mathilde & January 23, 1975 \\
+Vanesse & Stephany & October 30, 1994 \\
+Dupont & Chantal & January 15, 1998 \\
\bottomrule
\end{NiceTabular}
-\end{Verbatim}
-\end{scope}
+\end{Code}
+
\begin{center}
\begin{NiceTabular}{@{}llr@{}}
@@ -4377,15 +4427,15 @@ For an illustration of some of those remarks, see table
with the following code (the package \pkg{caption} has been loaded in this document).
\begin{center}
-\fvset{commandchars=\~\#\!}
-\begin{Verbatim}[formatcom=\small\color{gray}]
+\small
+\begin{Code}
\begin{table}
\centering
\NiceMatrixOptions{caption-above}
\begin{NiceTabular}{@{}llc@{}
[
caption = A tabular whose caption has been specified by the key
- \texttt{caption}~emphase#\tabularnote[$\star$]{It's possible to put a tabular note in the caption.}! ,
+ \texttt{caption}\emph{\tabularnote[$\star$]{It's possible to put a tabular note in the caption.}} ,
label = t:tabularnote ,
tabularnote = Some text before the notes. ,
notes/bottomrule
@@ -4394,16 +4444,16 @@ with the following code (the package \pkg{caption} has been loaded in this docum
Last name & First name & Length of life \\
\midrule
Churchill & Wiston & 91\\
-Nightingale~emphase#\tabularnote{Considered as the first nurse of history}!%
-~emphase#\tabularnote{Nicknamed ``the Lady with the Lamp''.}!
-& Florence~emphase#\tabularnote{This note is shared by two references.}! & 90 \\
-Schoelcher & Victor & 89~emphase#\tabularnote{The label of the note is overlapping.}!\\
-Touchet & Marie~emphase#\tabularnote{This note is shared by two references.}! & 89 \\
+Nightingale\emph{\tabularnote{Considered as the first nurse of history}}%
+\emph{\tabularnote{Nicknamed ``the Lady with the Lamp''.}}
+& Florence\emph{\tabularnote{This note is shared by two references.}} & 90 \\
+Schoelcher & Victor & 89\emph{\tabularnote{The label of the note is overlapping.}}\\
+Touchet & Marie\emph{\tabularnote{This note is shared by two references.}} & 89 \\
Wallis & John & 87 \\
\bottomrule
\end{NiceTabular}
\end{table}
-\end{Verbatim}
+\end{Code}
\end{center}
@@ -4603,14 +4653,14 @@ For an example of customisation of the tabular notes, see p.~\pageref{ex:notes}.
If you wish to use an environment |{NiceTabular}|, |{NiceTabular*}| or
|{NiceTabularX}| in an environment |{threeparttable}| of the eponymous package,
-you have to patch |{threeparttable}| with the following code (with a version of
-LaTeX at least 2020/10/01).
-\begin{Verbatim}[commandchars=\~\#\!]
+you have to patch |{threeparttable}| with the following code.
+
+\begin{Code}
\makeatletter
\AddToHook{env/threeparttable/begin}
{\TPT@hookin{NiceTabular}\TPT@hookin{NiceTabular*}\TPT@hookin{NiceTabularX}}
\makeatother
-\end{Verbatim}
+\end{Code}
Nevertheless, the use of \pkg{threeparttable} in conjonction with
\pkg{nicematrix} seems rather point-less because of the functionalities
@@ -4652,9 +4702,9 @@ That key is available in all the environments and commands (e.g.
|\NiceMatrixOptions|.
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{NiceTabular}
- [hvlines,~emphase#rounded-corners@]
+ [hvlines,\emph{rounded-corners}]
{ccc}
\CodeBefore
\rowcolor{red!15}{1}
@@ -4663,7 +4713,7 @@ Last name & First name & Profession \\
Arvy & Jacques & Physicist \\
Jalon & Amandine & Physicist
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines,rounded-corners]
\CodeBefore
\rowcolor{red!15}{1}
@@ -4688,14 +4738,14 @@ rectangle to fade the array (caution: some \textsc{pdf} readers don't support
transparency).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
+\begin{Code}[width=10.6cm]
\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt]
\Block{2-2}{} & & test \\
& & blabla \\
& some text & nothing
-~emphase#\CodeAfter \ShowCellNames@
+\emph{\CodeAfter \ShowCellNames}
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines,cell-space-limits=3pt]
\Block{2-2}{} & & test \\
& & blabla \\
@@ -4716,15 +4766,15 @@ macro of \pkg{siunitx}.
\medskip
-\begin{BVerbatim}[baseline = c, boxwidth = 11cm]
-$\begin{pNiceArray}{~emphase#S@cW{c}{1cm}c}[nullify-dots,first-row]
+\begin{Code}[width = 11cm]
+$\begin{pNiceArray}{\emph{S}cW{c}{1cm}c}[nullify-dots,first-row]
{C_1} & \Cdots & & C_n \\
2.3 & 0 & \Cdots & 0 \\
12.4 & \Vdots & & \Vdots \\
1.45 \\
7.2 & 0 & \Cdots & 0
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceArray}{ScW{c}{1cm}c}[nullify-dots,first-row]
{C_1} & \Cdots & & C_n \\
2.3 & 0 & \Cdots & 0 \\
@@ -4752,12 +4802,12 @@ The keys |l| and |r| are shortcuts for |columns-type=l| and |columns-type=r|.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{bNiceMatrix}[r]
+\begin{Code}[width=10cm]
+$\begin{bNiceMatrix}\emph{[r]}
\cos x & - \sin x \\
\sin x & \cos x
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[r]
\cos x & - \sin x \\
\sin x & \cos x
@@ -4783,9 +4833,9 @@ In the following command, we use that command in the
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=12cm]
+\begin{Code}[width=12cm]
\NiceMatrixOptions%
- {code-for-first-row = \scriptstyle ~emphase#\rotate@ \text{image of },
+ {code-for-first-row = \scriptstyle \emph{\rotate} \text{image of },
code-for-last-col = \scriptstyle }
$A = \begin{pNiceMatrix}[first-row,last-col=4]
e_1 & e_2 & e_3 \\
@@ -4793,7 +4843,7 @@ e_1 & e_2 & e_3 \\
4 & 5 & 6 & e_2 \\
7 & 8 & 9 & e_3
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{varwidth}{10cm}
\NiceMatrixOptions%
{code-for-first-row = \scriptstyle\rotate \text{image of },
@@ -4818,9 +4868,9 @@ the corresponding elements are aligned upwards as shown below.
\index{last-col|textit}
\index{code-for-last-col|textit}
-\begin{BVerbatim}[baseline=c,boxwidth=12cm]
+\begin{Code}[width=12cm]
\NiceMatrixOptions%
- {code-for-last-row = \scriptstyle ~emphase#\rotate@ ,
+ {code-for-last-row = \scriptstyle \emph{\rotate} ,
code-for-last-col = \scriptstyle }
$A = \begin{pNiceMatrix}[last-row=4,last-col=4]
1 & 2 & 3 & e_1 \\
@@ -4828,7 +4878,7 @@ $A = \begin{pNiceMatrix}[last-row=4,last-col=4]
7 & 8 & 9 & e_3 \\
\text{image of } e_1 & e_2 & e_3
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
\begin{varwidth}{10cm}
\NiceMatrixOptions%
{code-for-last-row = \scriptstyle\rotate ,
@@ -4864,8 +4914,8 @@ package \pkg{amsmath} (and the environments |{psmallmatrix}|,
|{bsmallmatrix}|, etc. of the package \pkg{mathtools}).
\bigskip
-\begin{Verbatim}
-$\begin{bNiceArray}{cccc|c}[~emphase#small@,
+\begin{Code}
+$\begin{bNiceArray}{cccc|c}[\emph{small},
last-col,
code-for-last-col = \scriptscriptstyle,
columns-width = 3mm ]
@@ -4873,7 +4923,7 @@ $\begin{bNiceArray}{cccc|c}[~emphase#small@,
0 & 3 & 2 & 1 & 2 & L_2 \gets 2 L_1 - L_2 \\
0 & 1 & 1 & 2 & 3 & L_3 \gets L_1 + L_3
\end{bNiceArray}$
-\end{Verbatim}
+\end{Code}
%
\[\begin{bNiceArray}{cccc|c}[small, last-col,
code-for-last-col = \scriptscriptstyle,
@@ -4926,18 +4976,18 @@ In the |\CodeBefore| (cf. p. \pageref{code-before}) and in the |\CodeAfter|
of columns (except the potential exterior columns).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=10.6cm]
-$\begin{pNiceMatrix}% don't forget the %
+\begin{Code}[width=10.6cm]
+$\begin{pNiceMatrix}% don’t forget the %
[first-row,
first-col,
- code-for-first-row = \mathbf{~emphase#\alph{jCol}@} ,
- code-for-first-col = \mathbf{~emphase#\arabic{iRow}@} ]
+ code-for-first-row = \mathbf{\emph{\alph{jCol}}} ,
+ code-for-first-col = \mathbf{\emph{\arabic{iRow}}} ]
& & & & \\
& 1 & 2 & 3 & 4 \\
& 5 & 6 & 7 & 8 \\
& 9 & 10 & 11 & 12
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}[first-row,
first-col,
code-for-first-row = \mathbf{\alph{jCol}} ,
@@ -4971,9 +5021,9 @@ number of columns. The second argument is the pattern (it's a list of tokens
which are inserted in each cell of the constructed matrix).
\medskip
-\begin{Verbatim}
-$C = ~emphase#\pAutoNiceMatrix@{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$
-\end{Verbatim}
+\begin{Code}
+$C = \emph{\pAutoNiceMatrix}{3-3}{C_{\arabic{iRow},\arabic{jCol}}}$
+\end{Code}
\[C = \pAutoNiceMatrix{3-3}{C_{\arabic{iRow},\arabic{jCol}}}\]
@@ -4995,15 +5045,13 @@ between curly braces are considered as a whole.
\medskip
-\begin{scope}
-\begin{BVerbatim}[baseline=c,boxwidth=10cm]
-$\begin{bNiceMatrix}[~emphase#light-syntax@,first-row,first-col]
+\begin{Code}[width=10cm]
+$\begin{bNiceMatrix}[\emph{light-syntax},first-row,first-col]
{} a b ;
a 2\cos a {\cos a + \cos b} ;
b \cos a+\cos b { 2 \cos b }
\end{bNiceMatrix}$
-\end{BVerbatim}
-\end{scope}
+\end{Code}
$\begin{bNiceMatrix}[light-syntax,first-row,first-col]
{} a b ;
a 2\cos a {\cos a + \cos b} ;
@@ -5023,6 +5071,12 @@ the whole content of the environment is loaded as a TeX argument to be
analyzed. The environment doesn't behave in that case as a standard
environment of LaTeX which only put TeX commands before and after the content.}
+\medskip
+\colorbox{yellow!50}{\textbf{New 6.27}}\enskip The key |light-syntax-expanded|
+has the same behaviour as the key |light-syntax| but the body of the
+environment is expanded (in the TeX sens) before being splitted in lines (but
+after the extraction of a potential |\CodeAfter|).
+
\subsection{Color of the delimiters}
@@ -5036,12 +5090,12 @@ it's possible to change the color of the delimiters with the key
|delimiters/color|.
\medskip
-\begin{BVerbatim}[boxwidth=12cm,baseline=c]
+\begin{Code}[width=12cm]
$\begin{bNiceMatrix}[delimiters/color=red]
1 & 2 \\
3 & 4
\end{bNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{bNiceMatrix}[delimiters/color=red]
1 & 2 \\
3 & 4
@@ -5067,14 +5121,14 @@ It's possible to use |{NiceArrayWithDelims}| if we want to use atypical or
asymetrical delimiters.
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-$\begin{~emphase#NiceArrayWithDelims@}
+\begin{Code}[width=11cm]
+$\begin{\emph{NiceArrayWithDelims}}
{\downarrow}{\uparrow}{ccc}[margin]
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
-\end{~emphase#NiceArrayWithDelims@}$
-\end{BVerbatim}
+\end{\emph{NiceArrayWithDelims}}$
+\end{Code}
$\begin{NiceArrayWithDelims}
{\downarrow}{\uparrow}{ccc}[margin]
1 & 2 & 3 \\
@@ -5095,7 +5149,8 @@ For an example of utilisation, see \url{tex.stackexchange.com/questions/488566}
\section{Use of TikZ with nicematrix}
-\label{name}\label{PGF-nodes}
+\label{name}
+\label{PGF-nodes}
\index{tikza@TikZ (utilisation with \pkg{nicematrix})}
\index{node@\textbf{Nodes of PGF/TikZ}|(}
@@ -5155,15 +5210,15 @@ However, one should remind that \pkg{nicematrix} doesn't load TikZ by default.
In the following examples, we assume that TikZ has been loaded.
\bigskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
-$\begin{pNiceMatrix}[name=~emphase#mymatrix@]
+\begin{Code}[width=11cm]
+$\begin{pNiceMatrix}[name=\emph{mymatrix}]
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{pNiceMatrix}$
\tikz[remember picture,overlay]
- \draw ~emphase#(mymatrix-2-2)@ circle (2mm) ;
-\end{BVerbatim}
+ \draw \emph{(mymatrix-2-2)} circle (2mm) ;
+\end{Code}
$\begin{pNiceMatrix}[name=mymatrix]
1 & 2 & 3 \\
4 & 5 & 6 \\
@@ -5182,15 +5237,15 @@ course the current environment).
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=11cm]
+\begin{Code}[width=11cm]
$\begin{pNiceMatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\CodeAfter
- \tikz \draw ~emphase#(2-2)@ circle (2mm) ;
+ \tikz \draw \emph{(2-2)} circle (2mm) ;
\end{pNiceMatrix}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceMatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
@@ -5229,16 +5284,16 @@ Since those nodes are PGF nodes, one won't be surprised to learn that they are
drawn by using a specific PGF style. That style is called |nicematrix/cell-node|
and its definition in the source file |nicematrix.sty| is as follows:
-\begin{Verbatim}
+\begin{Code}
\pgfset
{
- ~emphase#nicematrix / cell-node@ /.style =
+ \emph{nicematrix / cell-node} /.style =
{
inner sep = 0 pt ,
minimum width = 0 pt
}
}
-\end{Verbatim}
+\end{Code}
The final user may modify that style by changing the values of the keys |text/rotate|,
|inner xsep|, |inner ysep|, |inner sep|, |outer xsep|, |outer ysep|, |outer sep|,
@@ -5528,8 +5583,7 @@ the array itself).
Here is an example which uses these nodes in the |\CodeAfter|.
\begin{center}
-\fvset{commandchars=\~\#\+}
-\begin{Verbatim}
+\begin{Code}
\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
u_1 &-& u_0 &=& r \\
u_2 &-& u_1 &=& r \\
@@ -5547,7 +5601,7 @@ Here is an example which uses these nodes in the |\CodeAfter|.
(4-1.north west) -- (5-3.south east)
(5-1.north west) -- (6-3.south east) ;
\end{NiceArray}
-\end{Verbatim}
+\end{Code}
\end{center}
\[\begin{NiceArray}{c@{\;}c@{\;}c@{\;}c@{\;}c}[create-medium-nodes]
@@ -5607,10 +5661,10 @@ by only \textsc{pgf}, which is a sub-layer of TikZ), we can access, in the
syntax |(|$i$\verb+-|+$j$|)|.
\medskip
-\begin{Verbatim}
+\begin{Code}
\begin{NiceMatrix}
\CodeBefore
- ~emphase#\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;@
+ \emph{\tikz \draw [fill=red!15] (7-|4) |- (8-|5) |- (9-|6) |- cycle ;}
\Body
1 \\
1 & 1 \\
@@ -5622,7 +5676,7 @@ syntax |(|$i$\verb+-|+$j$|)|.
1 & 7 & 21 & 35 & 35 & 21 & 7 & 1 \\
1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1
\end{NiceMatrix}
-\end{Verbatim}
+\end{Code}
%
\[\begin{NiceMatrix}
\CodeBefore
@@ -5645,15 +5699,15 @@ The nodes of the form $i$|.5| may be used, for example to cross a row of a
matrix (if TikZ is loaded).
\smallskip
-\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{Code}[width=11cm]
$\begin{pNiceArray}{ccc|c}
2 & 1 & 3 & 0 \\
3 & 3 & 1 & 0 \\
3 & 3 & 1 & 0
\CodeAfter
- \tikz \draw [red] (~emphase#3.5@-|1) -- (~emphase#3.5@-|last) ;
+ \tikz \draw [red] (\emph{3.5}-|1) -- (\emph{3.5}-|last) ;
\end{pNiceArray}$
-\end{BVerbatim}
+\end{Code}
$\begin{pNiceArray}{ccc|c}
2 & 1 & 3 & 0 \\
3 & 3 & 1 & 0 \\
@@ -5744,9 +5798,8 @@ using the public variable |\g_nicematrix_code_before_tl|.
\index{crossbox@\texttt{\textbackslash crossbox} (defined in an example)|textit}
-\begin{scope}
-\fvset{commandchars=\§\¤\μ}
-\begin{Verbatim}
+
+\begin{Code}
\ExplSyntaxOn
\cs_new_protected:Nn \__pantigny_crossbox:nnn
{
@@ -5757,7 +5810,7 @@ using the public variable |\g_nicematrix_code_before_tl|.
\NewDocumentCommand \crossbox { ! O { } }
{
- \tl_gput_right:Nx §emphase¤\g_nicematrix_code_before_tlμ
+ \tl_gput_right:Nx \emph{\g_nicematrix_code_before_tl}
{
\__pantigny_crossbox:nnn
{ \int_use:c { c@iRow } }
@@ -5766,8 +5819,8 @@ using the public variable |\g_nicematrix_code_before_tl|.
}
}
\ExplSyntaxOff
-\end{Verbatim}
-\end{scope}
+\end{Code}
+
\ExplSyntaxOn
@@ -5795,16 +5848,16 @@ using the public variable |\g_nicematrix_code_before_tl|.
Here is an example of utilisation:
\medskip
-\begin{BVerbatim}[baseline=c,boxwidth=9cm]
+\begin{Code}[width=9cm]
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\arraycolor{gray!10}
\Body
merlan & requin & cabillaud \\
-baleine & ~emphase#\crossbox[red]@ & morue \\
+baleine & \emph{\crossbox[red]} & morue \\
mante & raie & poule
\end{NiceTabular}
-\end{BVerbatim}
+\end{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\arraycolor{gray!10}
@@ -5837,20 +5890,19 @@ of the instructions |\Ddots| in the array can have a marked effect on the
final result.
\medskip
-In the following examples, the first |\Ddots| instruction is written in color:
+In the following examples, the first |\Ddots| instruction is written in color.
-% \medskip
\begin{scope}
\begin{minipage}{9.5cm}
Example with parallelization (default):
-\begin{Verbatim}
+\begin{Code}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
-a+b & ~emphase#\Ddots@~ & & \Vdots \\
+a+b & \emph{\Ddots} & & \Vdots \\
\Vdots & \Ddots & & \\
a+b & \Cdots & a+b & 1
\end{pNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\end{minipage}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
@@ -5862,14 +5914,14 @@ a+b & \Cdots & a+b & 1
\bigskip
\NiceMatrixOptions{parallelize-diags=true}%
\begin{minipage}{9.5cm}
-\begin{Verbatim}
+\begin{Code}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
a+b & & & \Vdots \\
-\Vdots & ~emphase#\Ddots@~ & \Ddots & \\
+\Vdots & \emph{\Ddots} & \Ddots & \\
a+b & \Cdots & a+b & 1
\end{pNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\end{minipage}
$A = \begin{pNiceMatrix}
1 & \Cdots & & 1 \\
@@ -6010,7 +6062,7 @@ However, it seems that this is no longer mandatory with the recent versions of
\bigskip
The package \pkg{nicematrix} is not fully compatible with the packages and classes
-of \LuaTeX-ja: the detection of the empty corners (cf. % p.~\pageref{corners})
+of LuaTeX-ja: the detection of the empty corners (cf. p.~\pageref{corners})
may be wrong in some circonstances.
\bigskip
@@ -6028,8 +6080,8 @@ the colums |S| of \pkg{siunitx}).
\section{Examples}
-\subsection[{Utilisation of the key 'TikZ' of the command \textbackslash
-Block}]{Utilisation of the key ``TikZ'' of the command \textbackslash Block}
+\subsection[{Utilisation of the key 'tikz' of the command \textbackslash
+Block}]{Utilisation of the key ``tikz'' of the command \textbackslash Block}
\label{tikz-key-examples}
\index{tikzz@tikz!key of \texttt{\textbackslash Block}|textit}
@@ -6045,21 +6097,21 @@ For the following example, we also need the TikZ library |patterns|.
\end{Verbatim}
-\begin{Verbatim}
+\begin{Code}
\ttfamily \small
\begin{NiceTabular}{X[m]X[m]X[m]}[hvlines,cell-space-limits=3pt,rounded-corners]
- \Block[~emphase#tikz={pattern=grid,pattern color=lightgray}@]{}
+ \Block[\emph{tikz={pattern=grid,pattern color=lightgray}}]{}
{pattern = grid,\\ pattern color = lightgray}
-& \Block[~emphase#tikz={pattern = north west lines,pattern color=blue}@]{}
+& \Block[\emph{tikz={pattern = north west lines,pattern color=blue}}]{}
{pattern = north west lines,\\ pattern color = blue}
-& \Block[~emphase#tikz={outer color = red!50, inner color=white }@]{2-1}
+& \Block[\emph{tikz={outer color = red!50, inner color=white }}]{2-1}
{outer color = red!50,\\ inner color = white} \\
- \Block[~emphase#tikz={pattern = sixpointed stars, pattern color = blue!15}@]{}
+ \Block[\emph{tikz={pattern = sixpointed stars, pattern color = blue!15}}]{}
{pattern = sixpointed stars,\\ pattern color = blue!15}
-& \Block[~emphase#tikz={left color = blue!50}@]{}
+& \Block[\emph{tikz={left color = blue!50}}]{}
{left color = blue!50} \\
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\ttfamily \small
@@ -6089,16 +6141,17 @@ p.~\pageref{rules}}
\texttt{\textbackslash CodeBefore}|textit}
-\begin{Verbatim}
+\begin{Code}
\begin{NiceTabular}{ccc}[hvlines]
\CodeBefore
\columncolor[RGB]{169,208,142}{2}
\Body
one & two & three \\
-\Block[~emphase#transparent, tikz={pattern = north west lines, pattern color = gray}@]{1-*}{}
+\Block[\emph{transparent, tikz={pattern = north west lines, pattern color = gray}}]{1-*}{}
four & five & six \\
seven & eight & nine
-\end{Verbatim}
+\end{NiceTabular}
+\end{Code}
\begin{center}
\begin{NiceTabular}{ccc}[hvlines]
@@ -6122,7 +6175,7 @@ Here is an example of use of |{NiceTabular}| within a command |\tcbox| of
the rules except on the borders (which are, of course, added by \pkg{tcolorbox})
\medskip
-\begin{BVerbatim}
+\begin{Code}
\tcbset
{
colframe = blue!50!black ,
@@ -6145,7 +6198,7 @@ the rules except on the borders (which are, of course, added by \pkg{tcolorbox})
]
{
\renewcommand{\arraystretch}{1.2}% <-- the % is mandatory here
- \begin{NiceTabular}{rcl}[~emphase#hvlines-except-borders@,rules/color=blue!50!black]
+ \begin{NiceTabular}{rcl}[\emph{hvlines-except-borders},rules/color=blue!50!black]
\CodeBefore
\rowcolor{red!15}{1}
\Body
@@ -6154,7 +6207,7 @@ the rules except on the borders (which are, of course, added by \pkg{tcolorbox})
Upper & Middle & Lower
\end{NiceTabular}
}
-\end{BVerbatim}
+\end{Code}
\index{hvlines-except-borders|textit}
@@ -6220,12 +6273,12 @@ the tabular.}
First, we write a command |\stars| similar the well-known commands
|\arabic|, |\alph|, |\Alph|, etc. which produces a number of stars equal to
its argument\footnote{In fact: the value of its argument.}.
-\begin{Verbatim}
+\begin{Code}
\ExplSyntaxOn
-\NewDocumentCommand ~emphase#\stars@ { m }
- { \prg_replicate:nn { \value { ~#1 } } { $ \star $ } }
+\NewDocumentCommand { \emph{\stars} } { m }
+ { \prg_replicate:nn { \value { #1 } } { $ \star $ } }
\ExplSyntaxOff
-\end{Verbatim}
+\end{Code}
%
Of course, we change the style of the labels with the key |notes/style|.
However, it would be interesting to change also some parameters in the type of
@@ -6239,20 +6292,21 @@ number of stars. We know that number: it is equal to |\value{tabularnote}|
therefore, at the end of the tabular, its value is equal to the total number
of tabular notes). We use the key |widest*| of \pkg{enumitem} in order to
require a width equal to that value: |widest*=\value{tabularnote}|.
-\begin{Verbatim}
+
+\begin{Code}
\NiceMatrixOptions
{
notes =
{
- ~emphase#style = \stars{~#1} , @
- ~emphase#enumitem-keys = @
- ~emphase# { @
- ~emphase# widest* = \value{tabularnote} ,@
- ~emphase# align = right @
- ~emphase# } @
+ \emph{style = \stars{#1} ,
+ enumitem-keys =
+ {
+ widest* = \value{tabularnote} ,
+ align = right
+ } }
}
}
-\end{Verbatim}
+\end{Code}
@@ -6273,20 +6327,20 @@ require a width equal to that value: |widest*=\value{tabularnote}|.
}
}
\ExplSyntaxOff
-\begin{Verbatim}
-\begin{NiceTabular}{~@{}llr~@{}}
+\begin{Code}
+\begin{NiceTabular}{@{}llr@{}}
\toprule \RowStyle{\bfseries}
Last name & First name & Birth day \\
\midrule
-Achard\tabularnote{~emphase#Achard is an old family of the Poitou.@}
+Achard\tabularnote{\emph{Achard is an old family of the Poitou.}}
& Jacques & 5 juin 1962 \\
-Lefebvre\tabularnote{~emphase#The name Lefebvre is an alteration of the name Lefebure.@}
+Lefebvre\tabularnote{\emph{The name Lefebvre is an alteration of the name Lefebure.}}
& Mathilde & 23 mai 1988 \\
Vanesse & Stephany & 30 octobre 1994 \\
Dupont & Chantal & 15 janvier 1998 \\
\bottomrule
\end{NiceTabular}
-\end{Verbatim}
+\end{Code}
\begin{center}
\begin{NiceTabular}{@{}llr@{}}
@@ -6497,19 +6551,19 @@ In the following example, we use the command |\Block| to draw dashed rules.
For that example, TikZ should be loaded (by |\usepackage{tikz}|).
-\begin{Verbatim}
+\begin{Code}
\begin{pNiceMatrix}
-~emphase#\Block[borders={bottom,right,tikz=dashed}]{2-2}{}@
+\emph{\Block[borders={bottom,right,tikz=dashed}]{2-2}{}}
1 & 2 & 0 & 0 & 0 & 0 \\
4 & 5 & 0 & 0 & 0 & 0 \\
-0 & 0 & ~emphase#\Block[borders={bottom,top,right,left,tikz=dashed}]{2-2}{}@
+0 & 0 & \emph{\Block[borders={bottom,top,right,left,tikz=dashed}]{2-2}{}}
7 & 1 & 0 & 0 \\
0 & 0 & -1 & 2 & 0 & 0 \\
-0 & 0 & 0 & 0 & ~emphase#\Block[borders={left,top,tikz=dashed}]{2-2}{}@
+0 & 0 & 0 & 0 & \emph{\Block[borders={left,top,tikz=dashed}]{2-2}{}}
3 & 4 \\
0 & 0 & 0 & 0 & 1 & 4
\end{pNiceMatrix}
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceMatrix}
@@ -6537,9 +6591,9 @@ In order to have the columns aligned one above the other, it's possible to
fix a width for all the columns. That's what is done in the following example
with the environment |{NiceMatrixBlock}| and its option |auto-columns-width|.
-\begin{Verbatim}[formatcom=\small\color{gray}]
-\begin{Verbatim}[formatcom=\small\color{gray}]
-~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@
+\begin{small}
+\begin{Code}
+\emph{\begin{NiceMatrixBlock}[auto-columns-width]}
\NiceMatrixOptions
{
light-syntax,
@@ -6577,8 +6631,9 @@ with the environment |{NiceMatrixBlock}| and its option |auto-columns-width|.
12 -8 7 5 3 {} ;
0 64 -41 1 19 ;
\end{pNiceMatrix}$
-~emphase#\end{NiceMatrixBlock}@
-\end{Verbatim}
+\emph{\end{NiceMatrixBlock}}
+\end{Code}
+\end{small}
\medskip
\index{auto-columns-width!(clé de \texttt{\{NiceMatrixBlock\}})|textit}
@@ -6634,11 +6689,12 @@ In order the solve that problem, it's possible to require the delimiters to be
composed with the maximal width, thanks to the boolean key
|delimiters/max-width|.
-\begin{Verbatim}[formatcom=\small\color{gray}]
-~emphase#\begin{NiceMatrixBlock}[auto-columns-width]@
+\begin{small}
+\begin{Code}
+\emph{\begin{NiceMatrixBlock}[auto-columns-width]}
\NiceMatrixOptions
{
- ~emphase#delimiters/max-width@,
+ \emph{delimiters/max-width},
light-syntax,
last-col, code-for-last-col = \color{blue}\scriptstyle,
vlines = 5 ,
@@ -6654,8 +6710,9 @@ composed with the maximal width, thanks to the boolean key
9 10 -5 4 7
\end{pNiceMatrix}$
...
-~emphase#\end{NiceMatrixBlock}@
-\end{Verbatim}
+\emph{\end{NiceMatrixBlock}}
+\end{Code}
+\end{small}
\medskip
\begin{NiceMatrixBlock}[auto-columns-width]
@@ -6711,7 +6768,7 @@ array can't be broken by a page break.
\texttt{\textbackslash CodeAfter}\newline and
\texttt{\textbackslash CodeBefore})|textit}
-\begin{Verbatim}
+\begin{Code}
\setlength{\extrarowheight}{1mm}
\[\begin{NiceMatrix}[ r, last-col=6, code-for-last-col = \scriptstyle \color{blue} ]
12 & -8 & 7 & 5 & 3 \\
@@ -6727,13 +6784,13 @@ array can't be broken by a page break.
0 & 0 &0 &0 & 0 & L_3 \gets 3L_2+L_3 \\[1mm]
12 & -8 &7 &5 & 3 \\
0 & 64 &-41 & 1 & 19 \\
-~emphase#\CodeAfter [sub-matrix/vlines=4]@
-~emphase# \SubMatrix({1-1}{4-5})@
-~emphase# \SubMatrix({5-1}{8-5})@
-~emphase# \SubMatrix({9-1}{11-5})@
-~emphase# \SubMatrix({12-1}{13-5})@
+\emph{\CodeAfter [sub-matrix/vlines=4]
+ \SubMatrix({1-1}{4-5})
+ \SubMatrix({5-1}{8-5})
+ \SubMatrix({9-1}{11-5})
+ \SubMatrix({12-1}{13-5})}
\end{NiceMatrix}\]
-\end{Verbatim}
+\end{Code}
\medskip
\begin{scope}
@@ -6773,11 +6830,11 @@ drawn in the |\SubMatrix| only (by adding space between the columns).
\index{vlines-in-sub-matrix}
\medskip
-\begin{Verbatim}
+\begin{Code}
\setlength{\extrarowheight}{1mm}
\[\begin{NiceArray}
[
- ~emphase#vlines-in-sub-matrix=I@,
+ \emph{vlines-in-sub-matrix=I},
last-col,
code-for-last-col = \scriptstyle \color{blue}
]
@@ -6801,7 +6858,7 @@ drawn in the |\SubMatrix| only (by adding space between the columns).
\SubMatrix({9-1}{11-5})
\SubMatrix({12-1}{13-5})
\end{NiceArray}\]
-\end{Verbatim}
+\end{Code}
\medskip
@@ -6854,14 +6911,14 @@ the command |\Block| is left empty, that means that the block is a mono-cell blo
\label{example-CodeAfter}
-\begin{Verbatim}
+\begin{Code}
$\begin{pNiceArray}{>{\strut}cccc}[margin,rules/color=blue]
-~emphase#\Block[draw]{}{a_{11}}@ & a_{12} & a_{13} & a_{14} \\
+\emph{\Block[draw]{}{a_{11}}} & a_{12} & a_{13} & a_{14} \\
a_{21} & \Block[draw]{}{a_{22}} & a_{23} & a_{24} \\
a_{31} & a_{32} & \Block[draw]{}{a_{33}} & a_{34} \\
a_{41} & a_{42} & a_{43} & \Block[draw]{}{a_{44}} \\
\end{pNiceArray}$
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceArray}{>{\strut}cccc}[margin,rules/color=blue]
\Block[draw]{}{a_{11}} & a_{12} & a_{13} & a_{14} \\
a_{21} & \Block[draw]{}{a_{22}} & a_{23} & a_{24} \\
@@ -6887,16 +6944,14 @@ used−even when \pkg{colortbl} is not loaded).
\medskip
-\begin{Verbatim}
+\begin{Code}
\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
- ~emphase#\rowcolor{red!15}@A_{11} & A_{12} & A_{13} & A_{14} \\
- A_{21} & ~emphase#\rowcolor{red!15}@A_{22} & A_{23} & A_{24} \\
- A_{31} & A_{32} & ~emphase#\rowcolor{red!15}@A_{33} & A_{34} \\
- A_{41} & A_{42} & A_{43} & ~emphase#\rowcolor{red!15}@A_{44}
+ \emph{\rowcolor{red!15}}A_{11} & A_{12} & A_{13} & A_{14} \\
+ A_{21} & \emph{\rowcolor{red!15}}A_{22} & A_{23} & A_{24} \\
+ A_{31} & A_{32} & \emph{\rowcolor{red!15}}A_{33} & A_{34} \\
+ A_{41} & A_{42} & A_{43} & \emph{\rowcolor{red!15}}A_{44}
\end{pNiceArray}
-\end{Verbatim}
-
-
+\end{Code}
\[\begin{pNiceArray}{>{\strut}cccc}[margin, extra-margin=2pt,color-inside]
\rowcolor{red!15}A_{11} & A_{12} & A_{13} & A_{14} \\
@@ -6932,22 +6987,22 @@ their creation with the key |create-cell-nodes| of the keyword |\CodeBefore|.
\medskip
\index{highlight (TikZ style defined in\newline an example)|textit}
-\begin{Verbatim}
+\begin{Code}
\tikzset{highlight/.style={rectangle,
fill=red!15,
rounded corners = 0.5 mm,
inner sep=1pt,
- fit=~#1}}
+ fit=#1}}
$\begin{bNiceMatrix}
-~emphase#\CodeBefore [create-cell-nodes] @
-~emphase# \tikz \node [highlight = (2-1) (2-3)] {} ; @
-~emphase# \Body @
+\emph{\CodeBefore [create-cell-nodes]
+ \tikz \node [highlight = (2-1) (2-3)] {} ;
+\Body}
0 & \Cdots & 0 \\
1 & \Cdots & 1 \\
0 & \Cdots & 0 \\
\end{bNiceMatrix}$
-\end{Verbatim}
+\end{Code}
\index{create-cell-nodes (key of \texttt{\textbackslash CodeBefore})|textit}
\index{CodeBefore@\texttt{\textbackslash CodeBefore}...\texttt{\textbackslash Body}|textit}
@@ -6965,20 +7020,20 @@ $\begin{bNiceMatrix}
We consider now the following matrix. If we want to highlight each row of
this matrix, we can use the previous technique three times.
-\begin{Verbatim}
-\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
+\begin{Code}
+\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
\CodeBefore [create-cell-nodes]
\begin{tikzpicture}
-~emphase# \node [highlight = (1-1) (1-3)] {} ;@
-~emphase# \node [highlight = (2-1) (2-3)] {} ;@
-~emphase# \node [highlight = (3-1) (3-3)] {} ;@
+ \emph{\node [highlight = (1-1) (1-3)] {} ;
+ \node [highlight = (2-1) (2-3)] {} ;
+ \node [highlight = (3-1) (3-3)] {} ;}
\end{tikzpicture}
\Body
a & a + b & a + b + c & L_1 \\
a & a & a + b & L_2 \\
a & a & a & L_3
-\end{pNiceArray}\]
-\end{Verbatim}
+\end{pNiceArray}
+\end{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt]
@@ -7002,10 +7057,10 @@ nodes'' instead of the ``normal nodes''.
\index{create-cell-nodes (key of \texttt{\textbackslash CodeBefore})|textit}
-\begin{Verbatim}
+\begin{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
\CodeBefore [create-cell-nodes]
- \begin{tikzpicture} ~emphase#[name suffix = -medium]@
+ \begin{tikzpicture} \emph{[name suffix = -medium]}
\node [highlight = (1-1) (1-3)] {} ;
\node [highlight = (2-1) (2-3)] {} ;
\node [highlight = (3-1) (3-3)] {} ;
@@ -7015,7 +7070,7 @@ a & a + b & a + b + c & L_1 \\
a & a & a + b & L_2 \\
a & a & a & L_3
\end{pNiceArray}\]
-\end{Verbatim}
+\end{Code}
\[\begin{pNiceArray}{ccc}[last-col, margin = 2pt, create-medium-nodes]
@@ -7093,8 +7148,9 @@ parenthesis have been added with |\SubMatrix| in the |\CodeBefore|.
fit=~#1}}
\end{Verbatim}
-\begin{Verbatim}[formatcom = \small\color{gray}]
-\[\begin{NiceArray}{*{6}{c}~LetterAt{\hspace{6mm}}*{5}{c}}[nullify-dots]
+\begin{small}
+\begin{Code}
+\[\begin{NiceArray}{*{6}{c}@{\hspace{6mm}}*{5}{c}}[nullify-dots]
\CodeBefore [create-cell-nodes]
\SubMatrix({2-7}{6-last})
\SubMatrix({7-2}{last-6})
@@ -7119,7 +7175,8 @@ parenthesis have been added with |\SubMatrix| in the |\CodeBefore|.
\CodeAfter
\tikz \draw [gray,shorten > = 1mm, shorten < = 1mm] (9-4.north) to [bend left] (4-9.west) ;
\end{NiceArray}\]
-\end{Verbatim}
+\end{Code}
+\end{small}
@@ -7140,16 +7197,16 @@ package, which must be loaded previously).
\medskip
-\begin{Verbatim}
+\begin{Code}
\pgfset
{
- ~emphase#nicematrix/cell-node@/.append style =
+ \emph{nicematrix/cell-node}/.append style =
{ text/rotate = 45, minimum size = 6 mm }
}
\setlength{\tabcolsep}{0pt}
-~emphase#\adjustbox@{rotate = -45, set depth = 6mm + 1.414 \arrayrulewidth}
+\emph{\adjustbox}{rotate = -45, set depth = 6mm + 1.414 \arrayrulewidth}
{\begin{NiceTabular} [ hvlines, corners=SE, baseline = line-9 ] { cccccccc }
\CodeBefore
\chessboardcolors{red!15}{blue!15}
@@ -7163,7 +7220,7 @@ package, which must be loaded previously).
1 & 7 \\
1
\end{NiceTabular}}
-\end{Verbatim}
+\end{Code}
\begin{center}
@@ -7205,6 +7262,10 @@ The successive versions of the file |nicematrix.sty| provided by TeXLive are ava
\subsection*{Changes between version 6.25 and 6.26}
+New key |light-syntax-expanded|.
+
+\subsection*{Changes between version 6.25 and 6.26}
+
Special color |nocolor|.
\subsection*{Changes between version 6.24 and 6.25}
diff --git a/macros/latex/contrib/spbmark/spbmark.pdf b/macros/latex/contrib/spbmark/spbmark.pdf
index 90e46b31bf..2a9f56f6c2 100644
--- a/macros/latex/contrib/spbmark/spbmark.pdf
+++ b/macros/latex/contrib/spbmark/spbmark.pdf
Binary files differ
diff --git a/macros/latex/contrib/spbmark/spbmark.sty b/macros/latex/contrib/spbmark/spbmark.sty
index e846f52fde..41fa6ea8b1 100644
--- a/macros/latex/contrib/spbmark/spbmark.sty
+++ b/macros/latex/contrib/spbmark/spbmark.sty
@@ -9,7 +9,7 @@
% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}[2018/12/31]
\RequirePackage{xparse,l3keys2e}
-\ProvidesExplPackage{spbmark}{2024/02/06}{1.46b}
+\ProvidesExplPackage{spbmark}{2024/02/13}{1.46d}
{Customize superscripts and subscripts}
\cs_generate_variant:Nn \box_set_ht:Nn { cv }
@@ -341,6 +341,61 @@
}
}
}
+\spb_define:n
+ {
+ thiswd .code:n =
+ {
+ \spb_local_case_init:nnn
+ { \tl_set:Nn \l__spb_super_thiswd_mode_tl {#1} }
+ { \tl_set:Nn \l__spb_sub_thiswd_mode_tl {#1} } { }
+ },
+ regex .code:n =
+ {
+ \spb_local_case_init:nnn
+ { \tl_set:Nn \l__spb_super_regex_next_tl {#1} }
+ { \tl_set:Nn \l__spb_sub_regex_next_tl {#1} } { }
+ },
+ spthiswd .tl_set:N = \l__spb_super_thiswd_mode_tl,
+ spthiswd .initial:n = keep,
+ sbthiswd .tl_set:N = \l__spb_sub_thiswd_mode_tl,
+ sbthiswd .initial:n = keep,
+ spregex .tl_set:N = \l__spb_super_regex_next_tl,
+ spregex .initial:n = \c{sub}|\c{textsubscript}|\c{sb}|\_,
+ sbregex .tl_set:N = \l__spb_sub_regex_next_tl,
+ sbregex .initial:n = \c{super}|\c{textsuperscript}|\c{sp}|\^
+ }
+\cs_new:Npn \spb_clear_thiswd:n #1
+ {
+ \str_case:nn {#1}
+ {
+ { super }
+ {
+ \peek_regex:nF
+ { \exp_not:o { \l__spb_super_regex_next_tl } }
+ {
+ \exp_not:n
+ {
+ \dim_zero:N \llastwd
+ \dim_zero:N \clastwd
+ \dim_zero:N \rlastwd
+ }
+ }
+ }
+ { sub }
+ {
+ \peek_regex:nF
+ { \exp_not:o { \l__spb_sub_regex_next_tl } }
+ {
+ \exp_not:n
+ {
+ \dim_zero:N \llastwd
+ \dim_zero:N \clastwd
+ \dim_zero:N \rlastwd
+ }
+ }
+ }
+ }
+ }
\cs_new_protected:Npn \spb_both_newcmd_map:n #1
{
@@ -354,7 +409,13 @@
\spb_content_hbox_set:nn {#1} {##1}
\spb_ht_dp_assign:nnnn {#1} {#1} { i } { _outer }
\box_use:c { l__#1_i_outer_box }
+ \exp_last_unbraced:Nx
\group_end:
+ {
+ \exp_args:Nv \str_if_eq:nnT
+ { l__spb_#1_thiswd_mode_tl } { auto }
+ { \spb_clear_thiswd:n {#1} }
+ }
}
}
\cs_new_protected:Npn \spb_content_hbox_set:nn #1#2
diff --git a/macros/latex/contrib/spbmark/spbmark.tex b/macros/latex/contrib/spbmark/spbmark.tex
index 2c9319118c..9fbf4962cf 100644
--- a/macros/latex/contrib/spbmark/spbmark.tex
+++ b/macros/latex/contrib/spbmark/spbmark.tex
@@ -7,8 +7,8 @@
{
package = spbmark,
title = the spbmark package,
- version = v1.46b,
- date = 2024/02/06,
+ version = v1.46d,
+ date = 2024/02/13,
authors = Qu Yi,
info = Customize superscript and subscript,
email = toquyi@163.com,
@@ -46,7 +46,6 @@
\begin{document}
\section{Macro package options}
-\label{sec:macro package options}
The following macro package options will redefine the script commands of the \LaTeX{} kernel. If you do not specify the values of boolean options, they default to \code{true}. These options can also be changed in the preamble area and main body using the global control command \cs{sbpset}.
\begin{options}
\keychoice{text}{true,\fbox{false}}\newtag[Changed]%
@@ -72,7 +71,8 @@ The following macro package options will redefine the script commands of the \La
\end{options}
\section{User commands}
-There are currently three commands to set superscript and subscript. Their format can be set temporarily using the optional parameters of the command, or set globally using a key-value list, see section \ref{sec:global control interface}.
+\label{sec:user commands}
+There are currently three commands to set superscript and subscript. Their format can be set temporarily using the optional parameters of the command, or set globally using a key-value list, see Section \ref{sec:global control interface}.
\begin{commands}
\command{super}[\sarg\oarg{kv list}\marg{content}\oarg{kv list}]
This is a superscript output command. The two \meta{kv list} are equivalent.
@@ -82,11 +82,11 @@ There are currently three commands to set superscript and subscript. Their forma
When the horizontal movement distance of the marker is \emph{non-negative}, since the \cs{super} and \cs{sub} commands put the marker in a horizontal box, the horizontal position is staggered when using superscript and subscript \emph{consecutively}, which is a different mechanism than the sequential use of \code{\^{}} and \code{\_{}} symbols in math mode. The following three commands save the width of the previous marker, use it for negative move of the \option{hmove} option of the next marker, and provide the corresponding alignment.
It should be noted that the following commands should save the longer width of the marker, that is, the longer width of the marker in the front, the shorter width of the marker in the back. This is due to the fact that horizontal movement uses a negative distance to leave the marker in a zero-width box state.
- \command{llastwd}\newtag%
+ \command{llastwd}
Save the width of the previous marker and provide left alignment. This is actually the width of the previous marker, and is the same as the value of \cs{rlastwd} after the next command is used.
- \command{clastwd}\newtag%
+ \command{clastwd}
Save the width of the previous marker and provide center alignment.
- \command{rlastwd}\newtag%
+ \command{rlastwd}
Save the width of the previous marker and provide right alignment. Actually this is the width of the next marker.
\begin{example}
1A\super{bcd}\sub{e}B \\
@@ -118,7 +118,7 @@ There are currently three commands to set superscript and subscript. Their forma
Defines the style of the superscript or subscript used for the \option{style} option.
\command{spbifmath}[\marg{math code}\marg{text code}]
In some cases, \code{math} or \code{text} output modes require different code for format or move. This command can be used when using the \code{match} option or changing the output mode locally, whitch should be used in the move or format options. It can switch the corresponding code according to different output modes.
- \command{spbshortkv}[\marg{short opt}\marg{key value}]\newtag%
+ \command{spbshortkv}[\marg{short opt}\marg{key value}]
Converts any existing key-value pair to a shorthand option. The value of key \code{\#1} indicates that the shorthand option needs to be assigned a value.
\begin{example}
\spbshortkv{x}{sphmove=#1}
@@ -151,6 +151,21 @@ The options common to \meta{kv list} of the three commands are as follows. They
Use the \meta{style name} defined by the \cs{defspbstyle} command to make it work global or local.
\keychoice{mode}{text,math,\fbox{match}}
The mode of superscript or subscript output can be \code{text} or \code{math} mode. The \code{match} option automatically matches output modes according to the current mode.
+ \keychoice{thiswd}{auto,\fbox{keep}}\newtag%
+ Sets how the length of the this marker is handled after this command is used. If it is \code{keep}, the width of the previous marker remains the same. If it is \code{auto}, if the next token is a marker command and the upper or lower position is the \textcolor{red}{opposite} of the this command, the width of the this marker is maintained, otherwise the width automatically returns to \textcolor{red}{zero}.
+ \begin{example}
+ \spbset{sbhmove=-\llastwd,sbthiswd=auto,sbcmd=\color{red}}
+ 1A\super{bcd}\sub[thiswd=keep]{e}Some texts\sub{e} \\
+ 3A\super{bcd}\sub{e}Some texts\sub{e} \\
+ 3A\sub{bcd}[thiswd=keep]\sub{e}Some texts\sub{e} \\
+ 4A\sub{bcd}\sub{e}Some texts\sub{e}
+ \end{example}
+ \keyval{regex}{regular expression}\newtag%
+ After using the superscript or subscript command, this option is used to determine whether the \textcolor{red}{following} tokens match the \meta{regular expression}. If it does \textcolor{red}{not}, the width of the this marker returns to zero.
+ \begin{example}[code-only]
+ \newcommand{\mysp}[2][]{\super[regex=\c{mysb},#2]{#1}}
+ \newcommand{\mysb}[2][]{\sub[regex=\c{mysp},#2]{#1}}
+ \end{example}
\end{options}
\section{Global control interface}
@@ -190,6 +205,14 @@ The following list of keys control the format both of superscript \emph{or} subs
The distance between the subscript baseline and the previous line.
\keyval{sbdepth}{fixed length}
The distance between the subscript baseline and the next line.
+ \keychoice{spthiswd}{auto,\fbox{keep}}\newtag%
+ Width processing mode after using this superscript. See Section \ref{sec:user commands} for the meaning of this option.
+ \keychoice{sbthiswd}{auto,\fbox{keep}}\newtag%
+ Width processing mode after using this subscript. See Section \ref{sec:user commands} for the meaning of this option.
+ \keyval{spregex}{regular expression}\newtag%
+ After the superscript command is used, the regular expression rules of the following tokens are matched. See Section \ref{sec:user commands} for the meaning of this option.
+ \keyval{sbregex}{regular expression}\newtag%
+ After the subscript command is used, the regular expression rules of the following tokens are matched. See Section \ref{sec:user commands} for the meaning of this option.
\end{options}
If \option{sphmove} is positive, the superscript or subscript moves to the right, conversely it moves to the left. The positive direction of vertical offset of subscript and superscript is opposite. For superscript, if \option{spvmove} is positive, the superscript moves up, conversely it moves down. For subscript, if \option{spvmove} is positive, the subscript moves down, conversely it moves up.
@@ -206,7 +229,7 @@ The following list of keys control the format of superscript \emph{and} subscrip
The distance between the superscript baseline and the previous line.
\keyval{spbdepth}{fixed length}
The distance between the subscript baseline and the next line.
- \kvsplit{vsep}{super move}{sub move}\Default{0.6ex}\newtag[Changed]%
+ \kvsplit{vsep}{super move}{sub move}\Default{0.6ex}
The extra vertical distance between superscript and subscript. The front part is the movement amount of the superscript, and the latter part is the movement amount of the subscript. If only the front part means that both are vertically shifted by one-half of the current value.
\keychoice{halign}{\fbox{l},c,r}
The alignment of superscript and subscript, which contains \code{l}, \code{c}, and \code{r} parameters respectively for left, center, and right alignment.
@@ -220,7 +243,8 @@ Here is a list of the three commands, please pay attention to the usage of optio
1A\super[vmove=0.2ex,hmove=0.2em,cmd=\textcolor{red}]{exam}B \\
2$A\sub[style=fancy,cmd+=\mathsf,mode=math]{exam}B$ \\
3A\supersub[vsep=0.6ex,halign=c]{examsuper}{sub}B \\
- 4A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB
+ 4A\super{c}[vmove=5pt,hmove=-5.5pt]B\sub[vmove=5pt,hmove=-5pt]{d}AB \\
+ 5A\super{c\super{d}}B
\end{example}
\subsection{siunitx}
@@ -232,15 +256,15 @@ It can also be used with the \pkg*{siunitx} package to output superscript and su
\end{example}
\subsection{realscripts}
-If the OpenType text font you are using does not have optical sizes, the superscript and subscript may not appear correctly. Loading the \pkg*{realscripts} macro package before the \pkg*{spbmark} macro package fixes this behavior.
+If the OpenType text font you are using does not have optical sizes, the superscript and subscript may not appear correctly. Loading the \pkg*{realscripts} package before the \pkg*{spbmark} package fixes this behavior.
\begin{example}[code-only]
\usepackage{realscripts,spbmark}
\end{example}
\subsection{altsubsup}
-The \pkg*{altsubsup} package allows to write alternate superscript and subscript in math mode with \code{\^{}}\oarg{mark} and \code{\_{}}\oarg{mark} dimensions. When the macro package is loaded using the \code{spbmark} option, the superscript and subscript mechanism of \pkg*{spbmark} is used, you can use \cs{defspbstyle} to define its superscript style \code{altsup} and subscript style \code{altsub}.
+The \pkg*{altsubsup} package allows to write alternate superscript and subscript in math mode with \code{\^{}}\oarg{mark} and \code{\_{}}\oarg{mark} dimensions. When the package is loaded using the \code{spbmark} option, the superscript and subscript mechanism of \pkg*{spbmark} is used, you can use \cs{defspbstyle} to define its superscript style \code{altsup} and subscript style \code{altsub}.
\begin{example}
- \defspbstyle{altsup}{sphmove=-\llastwd,spvmove=1pt}
+ \defspbstyle{altsup}{sphmove=-\llastwd,spthiswd=auto,spvmove=1pt}
$A_[bcd]^[e]B$
\end{example}
diff --git a/macros/latex/contrib/verse/verse.dtx b/macros/latex/contrib/verse/verse.dtx
index cf9d69488c..6b0b4d186b 100644
--- a/macros/latex/contrib/verse/verse.dtx
+++ b/macros/latex/contrib/verse/verse.dtx
@@ -60,7 +60,7 @@
%
% \fi
%
-% \CheckSum{551}
+% \CheckSum{553}
%
% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
% \DoNotIndex{\@centercr,\@cite}
@@ -115,6 +115,7 @@
% \changes{v2.4}{2007/01/10}{Added code to start numbering at a given line}
% \changes{v2.4a}{2009/09/04}{New maintainer (Will Robertson)}
% \changes{v2.4b}{2014/05/10}{Documentation updates}
+% \changes{v2.4c}{2024/02/11}{Avoid clash with tagging}
%
% \def\dtxfile{verse.dtx}
% ^^A \def\fileversion{v1.0}
@@ -133,6 +134,7 @@
% \def\fileversion{v2.4} \def\filedate{2007/01/10}
% \def\fileversion{v2.4a} \def\filedate{2009/09/04}
% \def\fileversion{v2.4b} \def\filedate{2014/05/10}
+% \def\fileversion{v2.4c} \def\filedate{2024/02/12}
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
@@ -968,6 +970,7 @@
% \changes{v2.22}{2005/08/22}{Added verse@envctr counter and
% \cs{theHpoemlines} for hyperref}
% \changes{v2.4}{2007/01/10}{Added fvsline counter}
+% \changes{v2.4c}{2024/02/12}{Use provide/renew instead of newcommand}
% \begin{macrocode}
\newcounter{vslineno}
\newcounter{poemline}
@@ -975,7 +978,8 @@
\setcounter{fvsline}{0}
\newcounter{modulo@vs}
\newcounter{verse@envctr}\setcounter{verse@envctr}{0}
-\newcommand*{\theHpoemline}{\arabic{verse@envctr}.\arabic{poemline}}
+\providecommand{\theHpoemline}{}
+\renewcommand*{\theHpoemline}{\arabic{verse@envctr}.\arabic{poemline}}
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/macros/latex/contrib/verse/verse.pdf b/macros/latex/contrib/verse/verse.pdf
index 0129ac8ed9..870b125287 100644
--- a/macros/latex/contrib/verse/verse.pdf
+++ b/macros/latex/contrib/verse/verse.pdf
Binary files differ
diff --git a/macros/latex/contrib/xfrac/CHANGELOG.md b/macros/latex/contrib/xfrac/CHANGELOG.md
new file mode 100644
index 0000000000..e2f119f66a
--- /dev/null
+++ b/macros/latex/contrib/xfrac/CHANGELOG.md
@@ -0,0 +1,19 @@
+# Changelog
+All notable changes to the `xfrac` since February 2024 will be documented in
+this file.
+
+The format is based on [Keep a
+Changelog](https://keepachangelog.com/en/1.0.0/), this project uses date-based
+'snapshot' version identifiers.
+
+## [Unreleased]
+
+## [2024-02-13]
+
+### Changed
+- New independent repository https://github.com/latex3/xfrac
+- Updated package dependencies (track kernel improvements)
+- Preparation for move of `xtemplate` concepts to the kernel
+
+[Unreleased]: https://github.com/latex3/latex3/compare/2024-02-13...HEAD
+[2024-02-13]: https://github.com/latex3/xfrac/compare/2023-10-10...2024-02-13
diff --git a/macros/latex/contrib/xfrac/README.md b/macros/latex/contrib/xfrac/README.md
new file mode 100644
index 0000000000..8af29b97d2
--- /dev/null
+++ b/macros/latex/contrib/xfrac/README.md
@@ -0,0 +1,29 @@
+# `xfrac`: Split level fractions
+
+Release 2024-02-13
+
+## Overview
+
+The `xfrac` package uses the interface defined by LaTeX templates to provide
+flexible split-level fractions _via_ the `\sfrac` macro. This is both a
+demonstration of the power of the template concept and also a useful addition
+to the available functionality in LaTeX2e.
+
+## Issues
+
+The issue tracker for LaTeX is currently located
+[on GitHub](https://github.com/latex3/xfrac/issues).
+
+## Development team
+
+This code is developed by [The LaTeX Project](https://latex-project.org).
+
+## License
+
+Released under the LaTeX Project Public License v1.3c or later. See https://www.latex-project.org/lppl.txt
+
+-----
+
+<p>Copyright (C) 2024 The LaTeX Project <br />
+<a href="https://latex-project.org/">https://latex-project.org/</a> <br />
+All rights reserved.</p>
diff --git a/macros/latex/contrib/xfrac/xfrac.dtx b/macros/latex/contrib/xfrac/xfrac.dtx
new file mode 100644
index 0000000000..55c26ca76f
--- /dev/null
+++ b/macros/latex/contrib/xfrac/xfrac.dtx
@@ -0,0 +1,1146 @@
+% \iffalse meta-comment
+%
+%% File: xfrac.dtx
+%
+% Copyright (C) 2004,2008-2010 Morten Hoegholm
+% (C) 2011,2012,2014-2024 The LaTeX Project
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% https://www.latex-project.org/lppl.txt
+%
+% This file is part of the "xfrac package" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/xfrac
+%
+% for those people who are interested.
+%
+%<*driver|package>
+\RequirePackage{amstext,graphicx}
+%</driver|package>
+%<*driver>
+\documentclass[full]{l3doc}
+\usepackage{nicefrac,xfrac} ^^A Need nicefrac for demo purposes
+\providecommand*\key[1]{\textbf{#1}}
+\newcommand*\switch[2]{{\fontfamily{#1}\selectfont #2}}
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \title{^^A
+% The \pkg{xfrac} package\\ Split-level fractions^^A
+% }
+%
+% \author{^^A
+% The \LaTeX{} Project\thanks
+% {^^A
+% E-mail:
+% \href{mailto:latex-team@latex-project.org}
+% {latex-team@latex-project.org}^^A
+% }^^A
+% }
+%
+% \date{Released 2024-02-13}
+%
+% \maketitle
+%
+% \begin{documentation}
+%
+% The \pkg{xfrac} package defines a document command \cs{sfrac}
+% with the following syntax:
+% \begin{quote}
+% \cs{sfrac}\oarg{instance}\marg{num}\oarg{sep}\marg{denom}
+% \end{quote}
+% Let's show a few examples:
+% \begin{verbatim}
+% \sfrac{1}{2}, $\sfrac{1}{2}$,
+% $\mathbf{3\times\sfrac{1}{2}}$
+% \quad \fontfamily{ppl}\selectfont Palatino: \sfrac{1}{2}
+% \quad \fontfamily{ptm}\selectfont Times: \sfrac{1}{2}
+% \end{verbatim}
+% \begin{quote}
+% \sfrac{1}{2}, $\sfrac{1}{2}$, $\mathbf{3\times\sfrac{1}{2}}$
+% \quad \fontfamily{ppl}\selectfont Palatino: \sfrac{1}{2}
+% \quad \fontfamily{ptm}\selectfont Times: \sfrac{1}{2}
+% \end{quote}
+% You'll notice something interesting: not only does the \cs{sfrac}
+% command work as it should in math mode, it also gets the job done
+% for other fonts as well.
+%
+% \section{A Bit of History}
+%
+% \subsection{The Past}
+%
+% One of the first exercises in \emph{The \TeX{}Book} is to design a
+% macro for split level fractions. The solution presented is fairly
+% simple, using a \emph{virgule} (a slash) for separating the two
+% components. It looks okay because the text font and math font of
+% Computer Modern look almost identical.
+%
+% The proper symbol to use instead of the virgule is a \emph{solidus}
+% which does not exist in Computer Modern. It is however available in
+% the European Computer Modern fonts, but I'll get back to that.
+%
+% \subsection{The Present}
+%
+% The most common way to produce split level fractions within \LaTeXe{}
+% is by means of the \pkg{nicefrac} package. Part of the reason it
+% has found widespread use is due to the strange design of the
+% built-in text fractions of the EC fonts, which look like this:
+% \textonehalf{}. The package is very simple to use but there are a few
+% issues:
+% \begin{itemize}
+% \item It uses the virgule instead of the solidus.
+% \item Font size of numerator and denominator is bigger than in the
+% built-in symbol. Compare Palatino: \switch{ppl}{\nicefrac{1}{2}}
+% \emph{vs.}~\switch{ppl}{\textonehalf}.
+% \item It doesn't correct for fonts using text figures such as in the
+% \pkg{eco} package. Compare \switch{cmor}{\nicefrac{1}{2}} and
+% \switch{cmor}{\nicefrac{8}{9}}.
+% \item In math mode, it doesn't always pick up the correct math
+% alphabet.
+% \end{itemize}
+% In short: \pkg{nicefrac} doesn't attempt to be the answer to
+% everything and so this is not a criticism of the package. It works
+% quite well for Computer Modern which was pretty much what was widely
+% available at the time it was developed. Users these days, however,
+% have a choice of many fonts when they write their documents.
+%
+% \subsection{The Future}
+%
+% Fonts are wildly different; one macro that works fine for Computer
+% Modern obviously doesn't work well at all in Palatino. For one we
+% have to make the separator symbol configurable, and we need to
+% take care of several details as well: font scaling of the
+% numerator/denominator pair (ND), font selection of ND, \emph{etc.} If we
+% are to have a single package for this in the future we have to define a
+% totally generic interface for the fraction commands and then adjust
+% parameters depending on the current font. What you see in this
+% prototype implementation of \pkg{xfrac} is just that.
+%
+% \section{Advanced User Interface}
+%
+% \subsection{Text mode}
+%
+% The usual problem in text mode has a name: Computer Modern. The
+% solidi of all the Computer Modern fonts leave a lot to be desired,
+% although things are potentially looking better as the Latin Modern
+% fonts are becoming more stable and widespread. As long as the
+% default fonts are Computer Modern variants we must however work
+% around this. One idea that comes to mind is to see what happens
+% when you use a solidus from another font instead. Let's try with
+% Times:
+% \begin{quote}
+% \DeclareInstance{xfrac}{cmr2}{text}
+% {slash-symbol-font = ptm}
+% \enquote{You take \sfrac[cmr2]{1}{2} cup of sugar, \ldots}
+% \end{quote}
+% That looks quite good actually, so it was probably very difficult
+% to obtain that result. Nope, it was extremely easy---if you happen
+% to know about \emph{instances}:
+% \begin{verbatim}
+% \DeclareInstance{xfrac}{cmr}{text}
+% {slash-symbol-font = ptm}
+% \end{verbatim}
+% So we define an instance with the name |cmr| from the template
+% |text| which in turn is of object type |xfrac|. You'll notice
+% the |cmr| is also the name of the font family for Computer Modern
+% Roman and the reasoning behind is that every font family should
+% have it's own settings, and if a document command is to work well
+% in that scheme, letting it use the name of the current font family
+% seems like a good idea. Thus the \cs{sfrac} command checks to see
+% whether an instance with same name as the current font family
+% exists and uses it if the test is true; otherwise the default
+% setting is used. Here we defined the instance to be used for the
+% font family |cmr| and just told it to use the Times font for
+% typesetting the slash symbol which turns out to be a solidus by
+% default.
+%
+% The option \texttt{cm-recommended} which is loaded by default uses
+% the Times solidus for Computer Modern Roman and Computer Modern
+% Sans Serif and the Palatino solidus for Computer Modern Typewriter
+% Type. This looks quite good. Should you however not want this you
+% can use the option \texttt{cm-standard} which produces somewhat
+% acceptable results using Computer Modern exclusively.
+%
+% So what about old style figures? If you use the \pkg{eco}
+% package you might define an instance similar to this (`cmor' is
+% the name of the roman font activated by \pkg{eco}):
+% \DeclareInstance{xfrac}{cmor}{text}
+% {
+% slash-symbol-font = ptm,
+% numerator-font = cmr,
+% denominator-font = cmr
+% }
+% \begin{verbatim}
+% \DeclareInstance{xfrac}{cmor}{text}
+% {
+% slash-symbol-font = ptm,
+% numerator-font = cmr,
+% denominator-font = cmr
+% }
+% \end{verbatim}
+% We also use regular Computer Modern Roman for typesetting ND, so
+% we end up with \switch{cmor}{\sfrac{1}{2}} and
+% \switch{cmor}{\sfrac{8}{9}} instead of
+% \switch{cmor}{\nicefrac{1}{2}} and \switch{cmor}{\nicefrac{8}{9}}.
+% Much better.
+%
+% There are also situations where other tricks are useful. If you
+% don't have the inferior and superior figures available in a font,
+% or the font doesn't have a wider design for small font sizes, you
+% can cheat by manually scaling the ND-pair. I got nice results for
+% Adobe's Stempel Garamond (with small caps and old style figures)
+% with the following setup:
+% \begin{verbatim}
+% \DeclareInstance{xfrac}{pegj}{text}
+% {
+% numerator-font = pegx,
+% denominator-font = pegx,
+% scale-factor = 0.9,
+% h-scale = 1.1
+% }
+% \end{verbatim}
+% We use the font family |pegx| (Stempel Garamond with real small
+% caps) for typesetting the ND-pair. Additionally the key
+% \key{scale-factor} specifies that the font size used for the
+% ND-pair should be $0.9$ of the height of the solidus, and the key
+% \key{h-scale} specifies that the ND-pair should be scaled an extra
+% 10\,\% horizontally.
+%
+% Should you be so fortunate the have a font with inferior and
+% superior figures like in the Monotype Janson example from Philipp
+% Lehman's excellent \emph{The Font Installation Guide}. In that
+% example Philipp defines the font families |mjn0| for the inferior
+% figures and |mjn1| for the superior. Thus to get the \cs{sfrac}
+% command to use them on the fly for the font family |mjnj| (Janson,
+% old style figures) we would say
+% \begin{verbatim}
+% \DeclareInstance{xfrac}{mjnj}{text}
+% {
+% numerator-font = mjn1,
+% denominator-font = mjn0,
+% scaling = false,
+% numerator-bot-sep = 0 pt,
+% denominator-bot-sep = 0 pt
+% }
+% \end{verbatim}
+% I think this example is a very clean way to do it. An alternative
+% approach could be to use the keys \key{numerator-format} and
+% \key{denominator-format} to process the arguments and let them
+% determine what to do.
+%
+% \subsection{Math Mode}
+%
+% In math mode the choices are a lot fewer because first of all
+% \TeX{} comes with a built-in limitation of $16$ math families.
+% Additionally we will not need a solidus for typesetting split
+% fractions in math, as tradition is to use a virgule instead. We
+% define the basic |mathdefault| instance to simply use the math
+% family in use when the instance is run. So if we're in normal math
+% like |$\sfrac{7}{9}$| we simply get family~$-1$. If we're inside a
+% \cs{mathbf} we're in family~$4$ (in the standard setup at least),
+% and so the fraction is typeset with the same math family. Simple,
+% isn't?
+%
+% You can also declare instances for the math families, but I really
+% don't see why you would. If you do then name them according to the
+% scheme \texttt{mathfam\meta{N}}, where \meta{N} is the family number, and
+% only do it if you \emph{really} know how to set up math fonts.
+% That is, if \cs{DeclareMathAlphabet} is unbeknownst to you, then
+% just don't go there.
+%
+% \section{The Template Interface}
+%
+% \begin{TemplateInterfaceDescription}{xfrac}
+%
+% \TemplateArgument{1}{The numerator}
+%
+% \TemplateArgument{2}{The separator}
+%
+% \TemplateArgument{3}{The denominator}
+%
+% \TemplateSemantics
+%
+% Typesets arguments 1 and 3 separated by argument 2, which in text
+% mode by default is a \emph{solidus}. This is taken from
+% \pkg{textcomp} where it is denoted \cs{textfractionsolidus}.
+% This is the character used for the ready made split level
+% fractions such as \textonehalf{}---except in the (European) Computer
+% Modern fonts. In math mode a \emph{virgule} is used instead as
+% this is more appropriate and it is always available in the math
+% fonts. The solidus is a text symbol only.
+%
+% \end{TemplateInterfaceDescription}
+%
+% \begin{TemplateDescription}{xfrac}{text}
+%
+% \TemplateKey{numerator-font}{tokenlist}
+% {Font family specification to use for the numerator.}
+% {\cs{f@family}}
+%
+% \TemplateKey{numerator-format}{function 1 arg}
+% {Action to be taken on the numerator.}
+% {Process argument unchanged}
+%
+% \TemplateKey{slash-symbol}{tokenlist}
+% {The separator symbol. If not specified the default value will be
+% used instead.}
+% {Solidus (\cs{textfractionsolidus})}
+%
+% \TemplateKey{slash-symbol-font}{tokenlist}
+% {Font family specification to use for the separator symbol.}
+% {\cs{f@family}}
+%
+% \TemplateKey{slash-symbol-format}{function 1 arg}
+% {Action to be taken on the separator symbol.}
+% {Process argument unchanged}
+%
+% \TemplateKey{denominator-font}{tokenlist}
+% {Font family specification to use for the denominator.}
+% {\cs{f@family}}
+%
+% \TemplateKey{denominator-format}{function 1 arg}
+% {Action to be taken on the denominator.}
+% {Process argument unchanged}
+%
+% \TemplateKey{h-scale}{real}
+% {Factor by which the numerator and denominator should be
+% horizontally scaled. It should only be used if the real superior
+% and inferior fonts are not available. For instance Stempel
+% Garamond looks excellent if scaled 10\,\% extra horizontally, \emph{i.e.},
+% by a factor of 1.1.}
+% {1}
+%
+% \TemplateKey{v-scale}{real}
+% {Same as \key{h-scale} only vertically. Probably not of much use
+% but added for completeness.}
+% {1}
+%
+% \TemplateKey{scale-factor}{real}
+% {Fraction of the size of \key{slash-symbol}. Used for setting the
+% font size of numerator and denominator. Usually a value of app.\
+% \sfrac{5}{6} produces fine results. It should only be used if the
+% real superior and inferior fonts are not available. As an example
+% Stempel Garamond looks better if the factor is 0.9.}
+% {0.83333}
+%
+% \TemplateKey{scale-relative}{choice}
+% {If set to |true| the font size of the numerator and denominator
+% is scaled with respect to the height of the \key{slash-symbol}. If
+% set to |false| the font is scaled with respect to the total height
+% of the \key{slash-symbol}.}
+% {true}
+%
+% \TemplateKey{scaling}{choice}
+% {If set to |true| the fonts are allowed to scale. If set to
+% |false| they are not. See the `Janson' example for an application.}
+% {true}
+%
+% \TemplateKey{numerator-top-sep}{length}
+% {Dimension specifying the space between the top of the
+% \key{slash-symbol} and the top of the numerator. If not specified,
+% the depth of the solidus will be used, because this value will
+% make the fraction look even.}
+% {Unspecified}
+%
+% \TemplateKey{numerator-bot-sep}{length}
+% {Dimension specifying the lift of the numerator from the
+% baseline.}
+% {Unspecified}
+%
+% \TemplateKey{denominator-bot-sep}{length}
+% {Dimension specifying the lift of the denominator from the
+% baseline.}
+% {Unspecified}
+%
+% \TemplateKey{slash-right-kern}{length}
+% {Dimension specifying the kerning between the \key{slash-symbol}
+% and the numerator.}
+% {\texttt{0pt}}
+%
+% \TemplateKey{slash-left-kern}{length}
+% {Dimension specifying the kerning between the \key{slash-symbol}
+% and the denominator.}
+% {\texttt{0pt}}
+%
+% \TemplateKey{math-mode}{choice}
+% {Are we in math mode or not?}
+% {false}
+%
+% \TemplateKey{phantom}{tokenlist}
+% {A character that suits the common cases. As we would mostly want
+% to use numbers in text mode we choose a \enquote{tall} number, while in
+% math it is somewhat different.}
+% {8}
+%
+% \TemplateSemantics
+%
+% This template is also the foundation for the \enquote{math} template. The
+% keys \key{slash-right-mkern} and \key{slash-left-mkern} can only
+% be used in math mode and are not shown here.
+%
+% \end{TemplateDescription}
+%
+% \begin{TemplateDescription}{xfrac}{math}
+%
+% \TemplateKey{numerator-font}{tokenlist}
+% {Font family specification to use for the numerator.}
+% {\cs{number}\cs{fam}}
+%
+% \TemplateKey{slash-symbol}{tokenlist}
+% {The separator symbol. If not specified the default value will be
+% used instead.}
+% {Virgule ($/$)}
+%
+% \TemplateKey{slash-symbol-font}{tokenlist}
+% {Font family specification to use for the separator symbol.}
+% {\cs{number}\cs{fam}}
+%
+% \TemplateKey{denominator-font}{tokenlist}
+% {Font family specification to use for the denominator.}
+% {\cs{number}\cs{fam}}
+%
+% \TemplateKey{scale-factor}{real}
+% {Fraction of the size of \key{slash-symbol}. In math mode we
+% cannot rely on the fonts to be able to scale, but giving a default
+% scale of 0.7 fits into the regular size changing scheme---the
+% default scheme has values $(D,T,S,SS)=(1,1,0.7,0.5)$ whereas we
+% with a default \key{scale-factor} of 0.7 get $(1,1,0.7,0.49)$.
+% That's close enough.}
+% {0.7}
+%
+% \TemplateKey{scale-relative}{choice}
+% {If set to |true| the font size of the numerator and denominator
+% is scaled with respect to the height of the \key{slash-symbol}. If
+% set to |false| the font is scaled with respect to the total height
+% of the \key{slash-symbol}.}
+% {false}
+%
+% \TemplateKey{scaling}{choice}
+% {If set to |true| the fonts are allowed to scale. If set to
+% |false| they are not. See the |plainmath| example for an application.}
+% {true}
+%
+% \TemplateKey{numerator-top-sep}{length}
+% {Dimension specifying the space between the top of the
+% \key{slash-symbol} and the top of the numerator. If not specified,
+% the depth of the virgule will be used, because this value will
+% make the fraction look even.}
+% {\texttt{0pt}}
+%
+% \TemplateKey{denominator-bot-sep}{length}
+% {Dimension specifying the lift of the denominator from the
+% baseline.}
+% {\texttt{0pt}}
+%
+% \TemplateKey{slash-right-mkern}{muskip}
+% {Same as \key{slash-right-kern} but for math mode only and should
+% be specified in \texttt{mu} units.}
+% {\texttt{-2mu}}
+%
+% \TemplateKey{slash-left-mkern}{muskip}
+% {Same as \key{slash-left-kern} but for math mode only and should
+% be specified in \texttt{mu} units.}
+% {\texttt{-1mu}}
+%
+% \TemplateKey{math-mode}{choice}
+% {Are we in math mode or not?}
+% {true}
+%
+% \TemplateKey{phantom}{tokenlist}
+% {A character that suits the common cases. In math we have a high
+% risk of using a parenthesis, so we choose that. Text mode is
+% another story.}
+% {(^^A)
+% }
+%
+% \TemplateSemantics
+%
+% This template is a restricted version of the |text| template. Only
+% the keys that are different from the |text| template are shown
+% here. Also bear in mind that the attributes \key{slash-left-kern}
+% and \key{slash-right-kern} have no meaning in this template.
+%
+% \end{TemplateDescription}
+%
+% \end{documentation}
+%
+% \begin{implementation}
+%
+% \section{\pkg{xfrac} implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<@@=xfrac>
+% \end{macrocode}
+%
+% Load \pkg{expl3} \enquote{up-front} only if required.
+% \begin{macrocode}
+\@ifundefined{ExplLoaderFileDate}
+ {\RequirePackage{expl3}}
+ {}
+% \end{macrocode}
+%
+% Make sure that the version of \pkg{l3kernel} in use is sufficiently new.
+% We use \cs{ExplFileDate} as \cs{@ifpackagelater} doesn't work for pre-loaded
+% \pkg{expl3} in the absence of the package.
+% \begin{macrocode}
+\@ifl@t@r\ExplLoaderFileDate{2018-02-21}
+ {}
+ {%
+ \PackageError{xfrac}{Support package expl3 too old}
+ {%
+ You need to update your installation of 'l3kernel'.\MessageBreak
+ Loading~xfrac~will~abort!%
+ }%
+ \endinput
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProvidesExplPackage{xfrac}{2024-02-13}{}
+ {Split-level fractions}
+% \end{macrocode}
+%
+% \begin{macro}{\IfFormatAtLeastTF}
+% Not present in older kernels: use the \LaTeXe{} mechanism as this is correct
+% for this case.
+% \begin{macrocode}
+\providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2020-02-02 }
+ { }
+ { \RequirePackage { textcomp } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2020-10-01 }
+ { }
+ { \RequirePackage { xparse } }
+% \end{macrocode}
+%
+% \begin{variable}{\l_@@_cm_std_bool}
+% There is one option to support.
+% \begin{macrocode}
+\keys_define:nn { xfrac }
+ {
+ cm-recommended .choice:,
+ cm-recommended /
+ false .code:n =
+ { \bool_set_true:N \l_@@_cm_std_bool },
+ cm-recommended /
+ true .code:n =
+ { \bool_set_false:N \l_@@_cm_std_bool },
+ cm-recommended .default:n = { true },
+ cm-standard .bool_set:N = \l_@@_cm_std_bool
+ }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2022-06-01 }
+ { \ProcessKeyOptions }
+ {
+ \RequirePackage { l3keys2e }
+ \ProcessKeysOptions { xfrac }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2024-06-01 }
+ { }
+ { \RequirePackage { xtemplate } }
+% \end{macrocode}
+%
+% \begin{variable}{\l_@@_slash_box}
+% \begin{variable}{\l_@@_tmp_box}
+% In keeping with the \LaTeX3 philosophy, rather than use generic
+% scratch boxes and get confused, \pkg{xfrac} reserves its own named
+% working space.
+% \begin{macrocode}
+\box_new:N \l_@@_slash_box
+\box_new:N \l_@@_tmp_box
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+%
+% \begin{macro}{\@@_tmp:w}
+% Used for the raised boxes: weird as it does not take an argument
+% but the \cs{raisebox} does.
+% \begin{macrocode}
+\cs_new:Npn \@@_tmp:w { }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Initialisation of variables}
+%
+% Variables used in templates have to be set up: there is not
+% much to say about these, other than that they must exist.
+%
+% \begin{variable}{\l_@@_denominator_bot_sep_dim}
+% \begin{variable}{\l_@@_numerator_bot_sep_dim}
+% \begin{variable}{\l_@@_numerator_top_sep_dim}
+% \begin{variable}{\l_@@_slash_left_sep_dim}
+% \begin{variable}{\l_@@_slash_right_sep_dim}
+% Fixed lengths.
+% \begin{macrocode}
+\dim_new:N \l_@@_denominator_bot_sep_dim
+\dim_new:N \l_@@_numerator_bot_sep_dim
+\dim_new:N \l_@@_numerator_top_sep_dim
+\dim_new:N \l_@@_slash_left_sep_dim
+\dim_new:N \l_@@_slash_right_sep_dim
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_slash_left_muskip}
+% \begin{variable}{\l_@@_slash_right_muskip}
+% Math mode skips.
+% \begin{macrocode}
+\muskip_new:N \l_@@_slash_left_muskip
+\muskip_new:N \l_@@_slash_right_muskip
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_hscale_fp}
+% \begin{variable}{\l_@@_scale_factor_fp}
+% \begin{variable}{\l_@@_vscale_fp}
+% Floating point values.
+% \begin{macrocode}
+\fp_new:N \l_@@_hscale_fp
+\fp_new:N \l_@@_scale_factor_fp
+\fp_new:N \l_@@_vscale_fp
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+%
+% \begin{variable}{\l_@@_denominator_font_tl}
+% \begin{variable}{\l_@@_numerator_font_tl}
+% \begin{variable}{\l_@@_phantom_tl }
+% \begin{variable}{\l_@@_slash_symbol_tl}
+% \begin{variable}{\l_@@_slash_symbol_font_tl}
+% Token lists, which include floating-point numbers and math(s)
+% skips.
+% \begin{macrocode}
+\tl_new:N \l_@@_denominator_font_tl
+\tl_new:N \l_@@_numerator_font_tl
+\tl_new:N \l_@@_phantom_tl
+\tl_new:N \l_@@_slash_symbol_tl
+\tl_new:N \l_@@_slash_symbol_font_tl
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+% \end{variable}
+%
+% \begin{macro}{\@@_fontscale:}
+% \begin{macro}{\@@_math:n}
+% \begin{macro}{\@@_denominator_font_change:}
+% \begin{macro}{\@@_denominator_format:n}
+% \begin{macro}{\@@_numerator_font_change:}
+% \begin{macro}{\@@_numerator_format:n}
+% \begin{macro}{\@@_relscale:}
+% \begin{macro}{\@@_slash_symbol_font_change:}
+% \begin{macro}{\@@_slash_symbol_format:n}
+% \begin{macro}{\@@_text_or_math:n}
+% Functions, either things which are calculated \enquote{on the fly}
+% (no argument required) or are functions taking one argument in the
+% code.
+% \begin{macrocode}
+\cs_new:Npn \@@_fontscale: { }
+\cs_new:Npn \@@_math:n #1 { }
+\cs_new:Npn \@@_denominator_font_change: { }
+\cs_new:Npn \@@_denominator_format:n #1 { }
+\cs_new:Npn \@@_numerator_font_change: { }
+\cs_new:Npn \@@_numerator_format:n #1 { }
+\cs_new:Npn \@@_relscale: { }
+\cs_new:Npn \@@_slash_symbol_font_change: { }
+\cs_new:Npn \@@_slash_symbol_format:n #1 { }
+\cs_new:Npn \@@_text_or_math:n #1 { }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{The template}
+%
+% There is only one object type in \pkg{xfrac}, rather unimaginatively
+% named \texttt{xfrac}.
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2024-06-01 }
+ { \NewTemplateType }
+ { \DeclareObjectType }
+ { xfrac } { 3 }
+% \end{macrocode}
+%
+% A single template interface is used for both text and math(s), which
+% does make a few things a little complex later.
+% \begin{macrocode}
+\DeclareTemplateInterface { xfrac } { text } { 3 }
+ {
+ denominator-bot-sep : length = \c_max_dim ,
+ denominator-font : tokenlist = \f@family ,
+ denominator-format : function 1 = #1 ,
+ h-scale : real = 1 ,
+ math-mode : choice { false , true }
+ = false ,
+ numerator-font : tokenlist = \f@family ,
+ numerator-format : function 1 = #1 ,
+ numerator-bot-sep : length = \c_max_dim ,
+ numerator-top-sep : length = \c_max_dim ,
+ phantom : tokenlist = 8 ,
+ scale-factor : real = 0.83333 ,
+ scale-relative : choice { false , true }
+ = true ,
+ scaling : choice { false , true }
+ = true ,
+ slash-left-kern : length = 0 pt ,
+ slash-left-mkern : muskip = -2 mu ,
+ slash-right-kern : length = 0 pt ,
+ slash-right-mkern : muskip = -1 mu ,
+ slash-symbol : tokenlist = \textfractionsolidus ,
+ slash-symbol-font : tokenlist = \f@family ,
+ slash-symbol-format : function 1 = #1 ,
+ v-scale : real = 1 ,
+ }
+% \end{macrocode}
+% Most of the variable binding is quite simple: of course, the choices
+% are a little more complicated. That is particularly true where
+% these have to set up \enquote{on the fly} functions.
+% \begin{macrocode}
+\DeclareTemplateCode { xfrac } { text } { 3 }
+ {
+ denominator-bot-sep = \l_@@_denominator_bot_sep_dim ,
+ denominator-font = \l_@@_denominator_font_tl ,
+ denominator-format = \@@_denominator_format:n ,
+ h-scale = \l_@@_hscale_fp ,
+ math-mode =
+ {
+ false = \cs_set_eq:NN \@@_math:n \use:n,
+ true = \cs_set_eq:NN \@@_math:n \ensuremath
+ },
+ numerator-font = \l_@@_numerator_font_tl ,
+ numerator-format = \@@_numerator_format:n ,
+ numerator-bot-sep = \l_@@_numerator_bot_sep_dim ,
+ numerator-top-sep = \l_@@_numerator_top_sep_dim ,
+ phantom = \l_@@_phantom_tl ,
+ scale-factor = \l_@@_scale_factor_fp ,
+ scale-relative =
+ {
+ false =
+ \cs_set:Npn \@@_relscale:
+ {
+ \dim_eval:n
+ { \box_ht:N \l_@@_tmp_box + \box_dp:N \l_@@_tmp_box }
+ },
+ true =
+ \cs_set:Npn \@@_relscale:
+ { \dim_eval:n { \box_ht:N \l_@@_slash_box } }
+ },
+ scaling =
+ {
+ false = \cs_set_eq:NN \@@_fontscale: \prg_do_nothing:,
+ true =
+ \cs_set:Npn \@@_fontscale:
+ {
+ \fontsize
+ { \fp_to_dim:n { \l_@@_scale_factor_fp * \@@_relscale: } }
+ { \c_zero_dim }
+ \selectfont
+ }
+ },
+ slash-left-kern = \l_@@_slash_left_sep_dim ,
+ slash-left-mkern = \l_@@_slash_left_muskip ,
+ slash-right-kern = \l_@@_slash_right_sep_dim ,
+ slash-right-mkern = \l_@@_slash_right_muskip ,
+ slash-symbol = \l_@@_slash_symbol_tl ,
+ slash-symbol-font = \l_@@_slash_symbol_font_tl ,
+ slash-symbol-format = \@@_slash_symbol_format:n ,
+ v-scale = \l_@@_vscale_fp
+ }
+% \end{macrocode}
+% The implementation part starts with applying all of the settings
+% from above. The first part of the set up is then to determine
+% whether the surroundings are text or math(s), and react accordingly.
+% \begin{macrocode}
+ {
+ \mode_if_math:TF
+ {
+ \cs_set_eq:NN \@@_text_or_math:n \text
+ \cs_set:Npe \@@_denominator_font_change:
+ { \tex_fam:D \l_@@_denominator_font_tl }
+ \cs_set:Npe \@@_numerator_font_change:
+ { \tex_fam:D \l_@@_numerator_font_tl }
+ \cs_set:Npe \@@_slash_symbol_font_change:
+ { \tex_fam:D \l_@@_slash_symbol_font_tl }
+ }
+ {
+ \cs_set_eq:NN \@@_text_or_math:n \mbox
+ \cs_set:Npn \@@_denominator_font_change:
+ {
+ \fontfamily { \l_@@_denominator_font_tl }
+ \selectfont
+ }
+ \cs_set:Npn \@@_numerator_font_change:
+ {
+ \fontfamily { \l_@@_numerator_font_tl }
+ \selectfont
+ }
+ \cs_set:Npn \@@_slash_symbol_font_change:
+ {
+ \fontfamily { \l_@@_slash_symbol_font_tl }
+ \selectfont
+ }
+ }
+% \end{macrocode}
+% Everything is now either inside \cs{text} or an \cs{mbox}, depending
+% upon the surroundings. First, there are some boxes to set up.
+% \begin{macrocode}
+ \@@_text_or_math:n
+ {
+ \m@th
+ \hbox_set:Nn \l_@@_tmp_box
+ { \@@_math:n { \vphantom { ( ) } } }
+ \hbox_set:Nn \l_@@_slash_box
+ {
+ \@@_math:n
+ {
+ \@@_slash_symbol_format:n
+ {
+ \@@_math:n
+ {
+ \@@_slash_symbol_font_change:
+ \IfNoValueTF {#2}
+ { \l_@@_slash_symbol_tl } {#2}
+ }
+ }
+ }
+ }
+% \end{macrocode}
+% Check on the numerator separator dimensions. The code starts with the
+% assumption that neither has been given, as this can then be used to
+% set up a default, which is also used when both values are set
+% erroneously.
+% \begin{macrocode}
+ \cs_set:Npn \@@_tmp:w
+ {
+ \raisebox
+ {
+ \dim_eval:n
+ {
+ \box_ht:N \l_@@_slash_box
+ - \box_dp:N \l_@@_slash_box
+ - \height
+ }
+ }
+ }
+ \dim_compare:nNnTF
+ { \l_@@_numerator_top_sep_dim } = { \c_max_dim }
+ {
+ \dim_compare:nNnF
+ { \l_@@_numerator_bot_sep_dim } = { \c_max_dim }
+ {
+ \cs_set:Npn \@@_tmp:w
+ {
+ \raisebox
+ { \dim_use:N \l_@@_numerator_bot_sep_dim }
+ }
+ }
+ }
+ {
+ \dim_compare:nNnTF
+ { \l_@@_numerator_bot_sep_dim } = { \c_max_dim }
+ {
+ \cs_set:Npn \@@_tmp:w
+ {
+ \raisebox
+ {
+ \dim_eval:n
+ {
+ \box_ht:N \l_@@_slash_box
+ - \dim_use:N \l_@@_numerator_top_sep_dim
+ - \height
+ }
+ }
+ }
+ }
+ {
+ \msg_error:nn { xfrac }
+ { over-specified-numerator-sep }
+ }
+ }
+% \end{macrocode}
+% Typeset the numerator.
+% \begin{macrocode}
+ \@@_tmp:w
+ {
+ \@@_fontscale:
+ \@@_numerator_format:n
+ {
+ \scalebox
+ { \fp_use:N \l_@@_hscale_fp }
+ [ \fp_use:N \l_@@_vscale_fp ]
+ {
+ \@@_math:n
+ {
+ \@@_numerator_font_change:
+ {
+ \vphantom { \l_@@_phantom_tl }
+ #1
+ }
+ }
+ }
+ }
+ }
+ \@@_math:n
+ { % THIS IS JUST WRONG!
+ \mode_if_math:TF
+ { \tex_mskip:D \l_@@_slash_right_muskip }
+ { \tex_hskip:D \l_@@_slash_right_sep_dim }
+ }
+% \end{macrocode}
+% Typeset the separator.
+% \begin{macrocode}
+ \box_use:N \l_@@_slash_box
+ \@@_math:n
+ {
+ \mode_if_math:TF
+ { \tex_mskip:D \l_@@_slash_left_muskip }
+ { \tex_hskip:D \l_@@_slash_left_sep_dim }
+ }
+% \end{macrocode}
+% Typeset the denominator.
+% \begin{macrocode}
+ \dim_compare:nNnTF
+ { \l_@@_denominator_bot_sep_dim } = { \c_max_dim }
+ {
+ \cs_set:Npn \@@_tmp:w
+ { \raisebox { - \box_dp:N \l_@@_slash_box } }
+ }
+ {
+ \cs_set:Npn \@@_tmp:w
+ {
+ \raisebox
+ { \dim_use:N \l_@@_denominator_bot_sep_dim }
+ }
+ }
+ \@@_tmp:w
+ {
+ \@@_fontscale:
+ \@@_denominator_format:n
+ {
+ \scalebox
+ { \fp_use:N \l_@@_hscale_fp }
+ [ \fp_use:N \l_@@_vscale_fp ]
+ {
+ \@@_math:n
+ {
+ \@@_denominator_font_change:
+ {
+ \vphantom { \l_@@_phantom_tl }
+ #3
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% Since math(s) and text mode are wildly different entities we define a
+% separate template for each. You already saw the \enquote{text}
+% template, and here is the \enquote{math} template.
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2024-06-01 }
+ {
+ \DeclareTemplateCopy { xfrac } { math } { text }
+ \EditTemplateDefaults { xfrac } { math }
+ }
+ { \DeclareRestrictedTemplate { xfrac } { text } { math } }
+ {
+ numerator-font = \number \fam ,
+ slash-symbol = / ,
+ slash-symbol-font = \number \fam ,
+ denominator-font = \number \fam ,
+ scale-factor = 0.7 ,
+ scale-relative = false ,
+ scaling = true ,
+ denominator-bot-sep = 0 pt ,
+ math-mode = true ,
+ phantom = ( % )
+ }
+% \end{macrocode}
+%
+%\subsection{The standard instances}
+%
+% For the default instances we just use the relevant templates with
+% the default settings.
+%
+% The default \enquote{text} instance.
+% \begin{macrocode}
+\DeclareInstance { xfrac } { default } { text } { }
+% \end{macrocode}
+%
+% The default \enquote{math(s)} instance. We annot set the
+% |numerator-top-sep| in the restricted template above.
+% \begin{macrocode}
+\DeclareInstance { xfrac } { mathdefault } { math }
+ { numerator-top-sep = 0pt }
+% \end{macrocode}
+%
+% Default Computer Modern setup. Far from optimal, but better than
+% nothing.
+% \begin{macrocode}
+\DeclareInstance { xfrac } { cmr } { text }
+ {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.2 ex ,
+ slash-left-kern = -0.1 em ,
+ slash-right-kern = -0.1 em
+ }
+\DeclareInstance { xfrac } { cmss } { text }
+ {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.2 ex ,
+ slash-left-kern = -0.1 em ,
+ slash-right-kern = -0.1 em
+ }
+\DeclareInstance { xfrac } { cmtt } { text }
+ {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.2 ex ,
+ slash-left-kern = -0.1 em ,
+ slash-right-kern = -0.1 em
+ }
+% \end{macrocode}
+%
+% We can do better for the Computer Modern fonts. For cmr and cmss
+% we choose Times, and for cmtt use Palatino.
+% \begin{macrocode}
+\bool_if:NF \l_@@_cm_std_bool
+ {
+ \DeclareInstance { xfrac } { cmr } { text }
+ { slash-symbol-font = ptm }
+ \DeclareInstance { xfrac } { cmss } { text }
+ { slash-symbol-font = ptm }
+ \DeclareInstance { xfrac } { cmtt } { text }
+ { slash-symbol-font = ppl }
+ }
+% \end{macrocode}
+%
+% Things works slightly better with Latin Modern.
+% \begin{macrocode}
+\DeclareInstance { xfrac } { lmr } { text }
+ {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0.1 ex ,
+ slash-left-kern = -0.15 em ,
+ slash-right-kern = -0.15 em
+ }
+\DeclareInstance { xfrac } { lmss } { text }
+ {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0 pt ,
+ slash-left-kern = -0.15 em ,
+ slash-right-kern = -0.15 em
+ }
+\DeclareInstance { xfrac } { lmtt } { text }
+ {
+ denominator-bot-sep = 0 pt ,
+ numerator-top-sep = 0 pt ,
+ slash-left-kern = -0.15 em ,
+ slash-right-kern = -0.15 em
+ }
+% \end{macrocode}
+%
+% \subsection{The user command}
+%
+% \begin{macro}{\sfrac}
+% Currently there is just a single user command. \cs{sfrac} takes
+% two mandatory arguments: numerator and denominator. It can take an
+% optional argument between the mandatory specifying the separator
+% like this:
+% \begin{verbatim}
+% \sfrac{7}[/]{12}
+% \end{verbatim}
+% It also has an optional argument that comes before the first
+% mandatory argument. If used it will use that instance instead of
+% the auto-detected one, so a user who has defined the instance
+% \enquote{cmr2} may use
+% \begin{verbatim}
+% \sfrac[cmr2]{7}{12}
+% \end{verbatim}
+% and get the settings from \enquote{cmr2} instead of the settings of
+% the current font family.
+% \begin{macrocode}
+\NewDocumentCommand \sfrac { o m o m }
+ {
+ \mode_if_math:TF
+ {
+ \IfInstanceExistTF { xfrac } { mathfam \number \fam }
+ { \UseInstance { xfrac } { mathfam \number \fam } }
+ { \UseInstance { xfrac } { mathdefault } }
+ {#2} {#3} {#4}
+ }
+ {
+ \IfInstanceExistTF { xfrac } {#1}
+ { \UseInstance { xfrac } {#1} }
+ {
+ \IfInstanceExistTF { xfrac } { \f@family }
+ { \UseInstance { xfrac } { \f@family } }
+ { \UseInstance { xfrac } { default } }
+ }
+ {#2} {#3} {#4}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Messages}
+%
+% Just the one.
+% \begin{macrocode}
+\msg_new:nnnn { xfrac } { over-specified-numerator-sep }
+ { You~have~specified~both~"numerator-top-sep"~and~"numerator-bot-sep". }
+ { I~will~pretend~that~you~didn't~specify~either~of~them. }
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \end{implementation}
+%
+% \PrintIndex
diff --git a/macros/latex/contrib/xfrac/xfrac.ins b/macros/latex/contrib/xfrac/xfrac.ins
new file mode 100644
index 0000000000..aec317dbb3
--- /dev/null
+++ b/macros/latex/contrib/xfrac/xfrac.ins
@@ -0,0 +1,49 @@
+\iffalse meta-comment
+
+File: xfrac.ins
+
+Copyright (C) 2004,2008-2010 Morten Hoegholm
+ (C) 2011,2012,2016,2017,2019-2024 The LaTeX Project
+
+It may be distributed and/or modified under the conditions of the
+LaTeX Project Public License (LPPL), either version 1.3c of this
+license or (at your option) any later version. The latest version
+of this license is in the file
+
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3packages bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
+
+The released version of this bundle is available from CTAN.
+
+\fi
+
+\input docstrip %
+\askforoverwritefalse
+
+\preamble
+
+Copyright (C) 2004,2008-2010 Morten Hoegholm
+ (C) 2011-2024 The LaTeX Project
+
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
+
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3packages bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
+
+\endpreamble
+% stop docstrip adding \endinput
+\postamble
+\endpostamble
+
+\keepsilent
+
+\generate{\file{xfrac.sty} {\from{xfrac.dtx} {package}}}
+
+\endbatchfile
diff --git a/macros/latex/contrib/xfrac/xfrac.pdf b/macros/latex/contrib/xfrac/xfrac.pdf
new file mode 100644
index 0000000000..e79462c3dd
--- /dev/null
+++ b/macros/latex/contrib/xfrac/xfrac.pdf
Binary files differ
diff --git a/macros/unicodetex/latex/emotion/doc/emotion-doc.pdf b/macros/unicodetex/latex/emotion/doc/emotion-doc.pdf
index ba22192aff..96ffcc5fdd 100644
--- a/macros/unicodetex/latex/emotion/doc/emotion-doc.pdf
+++ b/macros/unicodetex/latex/emotion/doc/emotion-doc.pdf
Binary files differ
diff --git a/macros/unicodetex/latex/emotion/doc/emotion-doc.tex b/macros/unicodetex/latex/emotion/doc/emotion-doc.tex
index 6c4fae83c5..97801c76b0 100644
--- a/macros/unicodetex/latex/emotion/doc/emotion-doc.tex
+++ b/macros/unicodetex/latex/emotion/doc/emotion-doc.tex
@@ -10,7 +10,8 @@
xcolor,
listings
}
-\setmainfont{KpMath Light}
+
+\setmainfont{KpMath}
\geometry{
a4paper,
diff --git a/macros/unicodetex/latex/emotion/emotion.def b/macros/unicodetex/latex/emotion/emotion.def
index 4e6387e627..715c0ad63c 100644
--- a/macros/unicodetex/latex/emotion/emotion.def
+++ b/macros/unicodetex/latex/emotion/emotion.def
@@ -1,5 +1,5 @@
\ProvidesExplFile{emotion.def}
- {2024/02/06}{0.1}{LaTeX emoji}
+ {2024/02/13}{0.2}{LaTeX emoji}
\tl_const:cn{l__emotion_ 🇦}{^^^^^^01f1e6}
\tl_const:cn{l__emotion_ 🇧}{^^^^^^01f1e7}
diff --git a/macros/unicodetex/latex/emotion/emotion.lua b/macros/unicodetex/latex/emotion/emotion.lua
deleted file mode 100644
index bde272c2b5..0000000000
--- a/macros/unicodetex/latex/emotion/emotion.lua
+++ /dev/null
@@ -1,21 +0,0 @@
-function unicodes(chs)
- local text = ""
- for _, c in utf8.codes(chs) do
- text = text .. unicode(c)
- end
- print(text)
-end
-
-function unicode(codepoint)
- local value = NULL
- if codepoint > 0xFFFF then
- value = string.format("^^^^^^%06x", codepoint)
- elseif codepoint > 0xFF then
- value = string.format("^^^^%04x", codepoint)
- else
- value = string.format("^^%02x", codepoint)
- end
- return value
-end
-
-unicodes("🀁♀") \ No newline at end of file
diff --git a/macros/unicodetex/latex/emotion/emotion.sty b/macros/unicodetex/latex/emotion/emotion.sty
index 34b02f82ed..7e4070dd39 100644
--- a/macros/unicodetex/latex/emotion/emotion.sty
+++ b/macros/unicodetex/latex/emotion/emotion.sty
@@ -1,12 +1,12 @@
\RequirePackage{expl3}
-\ProvidesExplPackage{emotion}{2024/02/06}{0.1}{LaTeX emoji}
+\ProvidesExplPackage{emotion}{2024/02/13}{0.2}{LaTeX emoji}
\RequirePackage { fontspec }
\ExplSyntaxOn
% add emotion command
-\newfontface \emotionfont: { Apple~Color~Emoji } [ Renderer = Harfbuzz ]
+\newfontface \emotionfont: { Twemoji~Mozilla } [ Renderer = Harfbuzz ]
% enable update emoji font
\newcommand{\emotionsetup}[1]{
@@ -23,17 +23,14 @@
% import pre-defined emotion
\file_input:n { emotion.def }
-\tl_set:Nn \l__emotion_tmp_tl {❓}
+\tl_set:Nn \l__emotion_nodef_tl {❓}
\newcommand{\emotion}[1]{
-\group_begin:
-\tl_set:Nn \l__emotion_tmp_tl {#1}
\ifcsname l__emotion_#1\endcsname
{\emotionfont:{\tl_use:c {l__emotion_ #1}}}
\else
- {\emotionfont:{\tl_use:N \l__emotion_tmp_tl}}
+ {\emotionfont:#1}
\fi
-\group_end:
}
\ExplSyntaxOff
diff --git a/macros/unicodetex/latex/fontspec/CHANGES.md b/macros/unicodetex/latex/fontspec/CHANGES.md
index 10841c18c3..dd938d5d51 100644
--- a/macros/unicodetex/latex/fontspec/CHANGES.md
+++ b/macros/unicodetex/latex/fontspec/CHANGES.md
@@ -1,6 +1,20 @@
Change history
==============
+
+## v2.9a (2024/02/13)
+
+ * Added a `Scale=MatchAveragecase` paramater which averages `Scale=MatchLowercase` and `Scale=MatchUppercase`.
+ * Switched options to LaTeX keyval handler.
+ * Added option `verbose` to undo silent/quiet.
+ * `euenc`/`tuenc` options are now obsolete (TU is the only encoding).
+ * Support variable fonts under LuaLaTeX.
+ * Skip scanning for filenames when loading fonts by name on LuaLaTeX.
+ * Allow restricting filename lookup to kpathsea lookups using `KpseOnly`.
+ * Added support for named colors from l3color.
+ * Support with lualatex spotcolors and cmyk colors in the pdf.
+
+
## v2.8a (2022/01/15)
* Add `SwashFont` and `BoldSwashFont` features to support LaTeX's now-builtin `\textsw`
diff --git a/macros/unicodetex/latex/fontspec/README.md b/macros/unicodetex/latex/fontspec/README.md
index f5dceebaeb..349b2c39f2 100644
--- a/macros/unicodetex/latex/fontspec/README.md
+++ b/macros/unicodetex/latex/fontspec/README.md
@@ -54,10 +54,10 @@ Release versions of fontspec are available from CTAN:
<http://www.ctan.org/pkg/fontspec>
Development and historical versions are available from Github:
- <http://github.com/wspr/fontspec>
+ <http://github.com/latex3/fontspec>
Please offer suggestions and file bug reports in the issue tracker:
- <http://github.com/wspr/fontspec/issues>
+ <http://github.com/latex3/fontspec/issues>
If you are running TeX Live, you can update to the latest version of this package by running
@@ -67,12 +67,11 @@ If you wish to manually download the latest release version from CTAN, get the p
http://mirror.ctan.org/install/macros/latex/contrib/fontspec.tds.zip
-If you wish to use the latest development version from Github, either use git to obtain the bleeding edge version with
+If you wish to use the latest development version from Github, use git to obtain the latest repository code with
- git clone git://github.com/wspr/fontspec.git
+ git clone git://github.com/latex3/fontspec.git
-(For bleeding edge versions, see the `working` branch.)
-Having obtained the package from Github, install the package code by running
+See the `working` branch for changes that have not been released to CTAN yet (no guarantees the code in that branch will always be fully functional). Having obtained the package from Github, install the package code by running
l3build install
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx
index 17f22a23e7..e8a8878e66 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-api.dtx
@@ -378,6 +378,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-closing.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-closing.dtx
index 5adc879707..91b5ebb7ee 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-closing.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-closing.dtx
@@ -32,6 +32,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-enc.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-enc.dtx
index f477998130..17434643e0 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-enc.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-enc.dtx
@@ -146,6 +146,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-feat-aat.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-feat-aat.dtx
index 994fae553c..fdffc058e5 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-feat-aat.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-feat-aat.dtx
@@ -231,6 +231,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx
index a278057442..c48e40deb0 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-feat-opentype.dtx
@@ -571,6 +571,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-fontload.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-fontload.dtx
index 4f3dcea690..12dc8472df 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-fontload.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-fontload.dtx
@@ -34,7 +34,7 @@
%
% \begin{macro}[pTF]{\@@_primitive_font_if_null:N}
% \begin{macrocode}
-\prg_set_conditional:Nnn \@@_primitive_font_if_null:N {p,TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_if_null:N {p,TF,T,F}
{
\ifx #1 \nullfont
\prg_return_true:
@@ -47,12 +47,12 @@
%
% \begin{macro}[pTF]{\@@_primitive_font_set:NnnTF,\@@_primitive_font_gset:NnnTF}
% \begin{macrocode}
-\prg_set_conditional:Nnn \@@_primitive_font_set:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_set:Nnn {TF,T,F}
{
\@@_primitive_font_set:Nnn #1 {#2} {#3}
\@@_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
}
-\prg_set_conditional:Nnn \@@_primitive_font_gset:Nnn {TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_gset:Nnn {TF,T,F}
{
\@@_primitive_font_gset:Nnn #1 {#2} {#3}
\@@_primitive_font_if_null:NTF #1 {\prg_return_false:} {\prg_return_true:}
@@ -66,7 +66,7 @@
%
% \begin{macro}[TF]{\@@_primitive_font_if_exist:n}
% \begin{macrocode}
-\prg_set_conditional:Nnn \@@_primitive_font_if_exist:n {TF,T,F}
+\prg_new_conditional:Nnn \@@_primitive_font_if_exist:n {TF,T,F}
{
\group_begin:
\@@_font_suppress_not_found_error:
@@ -124,6 +124,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-graphite.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-graphite.dtx
index 2a26211c2a..f794f469e1 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-graphite.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-graphite.dtx
@@ -116,6 +116,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-interfaces.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-interfaces.dtx
index d76dd61d60..09c855905d 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-interfaces.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-interfaces.dtx
@@ -284,6 +284,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx
index ee7e36cc88..b45a7d3c6c 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-internal.dtx
@@ -282,13 +282,14 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_font_is_file:,\@@_font_is_name:}
+% \begin{macro}{\@@_font_is_file:,\@@_font_is_name:,\@@_font_is_kpse:}
% The \cs{@@_fontname_wrap:n} command takes the font name and either passes it through unchanged or wraps it in the syntax for loading a font `by filename'.
-% \XeTeX's syntax is followed since \pkg{luaotfload} provides compatibility.
+% For Lua\TeX\ there are two kinds kinds of filename based loading supported: Regular filename lookups which include system fonts and lookups restricted to kpse.
% \begin{macrocode}
\cs_new:Nn \@@_font_is_name:
{
- \cs_set_eq:NN \@@_fontname_wrap:n \use:n
+%<XE> \cs_set_eq:NN \@@_fontname_wrap:n \use:n
+%<LU> \cs_set:Npn \@@_fontname_wrap:n ##1 { name: ##1 }
}
% \end{macrocode}
%
@@ -298,6 +299,16 @@
\cs_set:Npn \@@_fontname_wrap:n ##1 { [ \l_@@_font_path_tl ##1 ] }
}
% \end{macrocode}
+%
+% \begin{macrocode}
+%<*LU>
+\cs_new:Nn \@@_font_is_kpse:
+ {
+ \cs_set:Npn \@@_fontname_wrap:n ##1 { kpse: ##1 }
+ }
+%</LU>
+%<XE>\cs_new_eq:NN \@@_font_is_kpse: \@@_font_is_file:
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_set_scriptlang:}
@@ -360,7 +371,8 @@
\str_if_eq:eeF { \l_@@_hexcol_tl \l_@@_opacity_tl }
{ \c_@@_hexcol_tl \c_@@_opacity_tl }
- { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
+%<XE> { \@@_update_featstr:n { color = \l_@@_hexcol_tl\l_@@_opacity_tl } }
+%<LU> { \@@_update_featstr:n { color = {\l_@@_hexcol_tl\l_@@_opacity_tl} } }
}
% \end{macrocode}
% \end{macro}
@@ -445,7 +457,7 @@
\prop_gput:cnx {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {fontdef}
{
\@@_construct_font_call:nn {\l_fontspec_fontname_tl}
- { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist }
+ { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist \@@_get_variations: }
}
\prop_gput:cnV {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {script-num} \l_@@_script_int
\prop_gput:cnV {g_@@_fontinfo_ \g_@@_nfss_family_tl _prop} {lang-num} \l_@@_language_int
@@ -649,7 +661,7 @@
\group_begin:
\@@_primitive_font_set:Nnn \l_@@_tmpa_font { \@@_construct_font_call:nn {#1} { \l_@@_pre_feat_sclist } } { \f@size pt + 1sp }
\@@_primitive_font_set:Nnn \l_@@_tmpb_font { \@@_construct_font_call:nn {#1#2} { \l_@@_pre_feat_sclist } } { \f@size pt + 1sp }
- \str_if_eq:eeTF { \@@_primitive_font_get_name:N \l_@@_tmpa_font } { \@@_primitive_font_get_name:N \l_@@_tmpb_font }
+ \cs_if_eq:NNTF \l_@@_tmpa_font \l_@@_tmpb_font
{ \group_end: \prg_return_false: }
{ \group_end: \prg_return_true: }
}
@@ -790,7 +802,7 @@
%<debug>\typeout{====~Setup~NFSS~shape:~<\l_@@_size_tl>~\l_fontspec_fontname_tl}
\@@_get_features:n { #2 , #3 , #4 }
-%<debug>\typeout{====~Gathered~features:~\g_@@_rawfeatures_sclist}
+%<debug>\typeout{====~Gathered~features:~\g_@@_rawfeatures_sclist \@@_get_variations:}
\tl_if_empty:NF \l_@@_scale_tl
{
@@ -801,7 +813,7 @@
{
<\l_@@_size_tl> \l_@@_scale_tl
\@@_construct_font_call:nn { \l_fontspec_fontname_tl }
- { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist }
+ { \l_@@_pre_feat_sclist \g_@@_rawfeatures_sclist \@@_get_variations: }
}
}
% \end{macrocode}
@@ -1052,6 +1064,33 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_get_variations:}
+% \cmd{\@@_get_variations:} builds the feature string representing the
+% current variation instance and/or axis settings.
+% \begin{macrocode}
+\cs_generate_variant:Nn \tl_tail:n { e }
+\cs_new:Nn \@@_format_axis:nn
+ {
+ , #1 = #2
+ }
+\cs_new:Nn \@@_get_variations:
+ {
+ \tl_if_empty:NF \g_@@_instance_tl
+ {
+ instance = { \g_@@_instance_tl };
+ }
+ \prop_if_empty:NF \g_@@_rawvariations_prop
+ {
+ axis = {
+ \tl_tail:e {
+ \prop_map_function:NN \g_@@_rawvariations_prop \@@_format_axis:nn
+ }
+ };
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Initialisation}
%
% \begin{macro}{\@@_init:}
@@ -1089,6 +1128,8 @@
\cs_new:Nn \@@_init_fontface:
{
\tl_gclear:N \g_@@_rawfeatures_sclist
+ \prop_gclear:N \g_@@_rawvariations_prop
+ \tl_gclear:N \g_@@_instance_tl
\tl_clear:N \l_@@_scale_tl
\tl_set_eq:NN \l_@@_opacity_tl \c_@@_opacity_tl
\tl_set_eq:NN \l_@@_hexcol_tl \c_@@_hexcol_tl
@@ -1210,6 +1251,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-keyval.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-keyval.dtx
index bb18912f8a..57ff738183 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-keyval.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-keyval.dtx
@@ -63,7 +63,13 @@
\bool_set_true:N \l_@@_noit_bool
\bool_set_true:N \l_@@_external_bool
\tl_set:Nn \l_@@_font_path_tl {#1}
- \@@_font_is_file:
+ \bool_lazy_and:nnTF { \l_@@_external_kpse_bool } { \tl_if_empty_p:N \l_@@_font_path_tl }
+ {
+ \@@_font_is_kpse:
+ }
+ {
+ \@@_font_is_file:
+ }
%<*XE>
\keys_set:nn {fontspec-renderer} {Renderer=OpenType}
%</XE>
@@ -89,6 +95,22 @@
\@@_keys_define_code:nnn {fontspec} {Extension} {}
% \end{macrocode}
%
+% \paragraph{\feat{KpseOnly}}
+% If the font is specified by filename, only search for it through kpse.
+% \XeTeX\ does not support finding system fonts by filename so this is always implicitly set
+% there.
+% \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-preparse-external} {KpseOnly}
+ {
+ \bool_set_true:N \l_@@_external_kpse_bool
+ \bool_if:NT \l_@@_external_bool
+ {
+ \@@_font_is_kpse:
+ }
+ }
+\@@_keys_define_code:nnn {fontspec} {KpseOnly} {}
+% \end{macrocode}
+%
%
% \paragraph{\feat{Renderer}}
% This feature must be processed before all others (the other font shape and features
@@ -463,8 +485,8 @@
%
% \paragraph{Scale}
% If the input isn't one of the pre-defined string options, then
-% it's gotta be numerical. \cs{fontspec_calc_scale:n} does all the work in
-% the auto-scaling cases.
+% it's gotta be numerical. \cs{fontspec_calc_scale:n} and \cs{fontspec_calc_scale:nn}
+% do all the work in the auto-scaling cases.
% \begin{macrocode}
\@@_keys_define_code:nnn {fontspec} {Scale}
{
@@ -472,8 +494,10 @@
{
{MatchLowercase} { \@@_calc_scale:n {5} }
{MatchUppercase} { \@@_calc_scale:n {8} }
+ {MatchAveragecase} { \@@_calc_scale:nn {5} {8} }
}
{ \tl_set:Nx \l_@@_scale_tl {#1} }
+ \@@_info:n {set-scale}
}
% \end{macrocode}
%
@@ -520,7 +544,6 @@
\dim_to_fp:n {\l_@@_tmpb_dim} }
}
- \@@_info:n {set-scale}
\exp_args:NNNx
\group_end:
\tl_set:Nx \l_@@_scale_tl { \l_@@_scale_tl }
@@ -529,6 +552,26 @@
% \end{macro}
%
%
+% \begin{macro}{\@@_calc_scale:nn}
+% This macro calls \cs{fontspec_calc_scale:n} twice
+% and then sets the scale to the average of the two results.
+% \begin{macrocode}
+\cs_new:Nn \@@_calc_scale:nn
+{
+ \group_begin:
+ \__fontspec_calc_scale:n {#1}
+ \tl_set_eq:NN \l_@@_tmp_tl \l_@@_scale_tl
+ \__fontspec_calc_scale:n {#2}
+ \tl_set:Nx \l_@@_scale_tl
+ {
+ \fp_eval:n { (\l_@@_tmp_tl + \l_@@_scale_tl)/2 }
+ }
+ \exp_args:NNNx
+ \group_end:
+ \tl_set:Nx \l_@@_scale_tl { \l_@@_scale_tl }
+ }
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\@@_set_font_dimen:NnN}
% This function sets the dimension |#1| (for font |#3|) to `fontdimen' |#2|
% for either font dimension 5 (x-height) or 8 (cap-height). If, for some
@@ -675,26 +718,61 @@
% \end{macrocode}
%
% \paragraph{Color}
-% Hooks into pkg{xcolor}, which names its colours \texttt{\char`\\color@<name>}.
+% Test first if the color is a named l3color, then if it is a color from
+% \pkg{xcolor}, which names its colours \texttt{\char`\\color@<name>}.
+% If this fails the argument is assumed to be a hex color.
+%
% \begin{macrocode}
\@@_keys_define_code:nnn {fontspec} {Color}
{
- \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+%<*XE>
+ \color_if_exist:nTF {#1}
{
- \convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
+ \color_export:nnN {#1} {HTML}\l_@@_hexcol_tl
}
{
- \int_compare:nTF { \tl_count:n {#1} == 6 }
- { \tl_set:Nn \l_@@_hexcol_tl {#1} }
+ \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+ {
+ \convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
+ }
{
- \int_compare:nTF { \tl_count:n {#1} == 8 }
- { \fontspec_parse_colour:viii #1 }
+ \int_compare:nTF { \tl_count:n {#1} == 6 }
+ { \tl_set:Nn \l_@@_hexcol_tl {#1} }
{
- \bool_if:NF \l_@@_firsttime_bool
- { \@@_warning:nx {bad-colour} {#1} }
+ \int_compare:nTF { \tl_count:n {#1} == 8 }
+ { \fontspec_parse_colour:viii #1 }
+ {
+ \bool_if:NF \l_@@_firsttime_bool
+ { \@@_warning:nx {bad-colour} {#1} }
+ }
}
}
}
+%</XE>
+%<*LU>
+ \color_if_exist:nTF {#1}
+ {
+ \tl_set:Nn \l_@@_hexcol_tl {#1}
+ }
+ {
+ \cs_if_exist:cTF { \token_to_str:N \color@ #1 }
+ {
+ \convertcolorspec{named}{#1}{HTML}\l_@@_hexcol_tl
+ }
+ {
+ \int_compare:nTF { \tl_count:n {#1} == 6 }
+ { \tl_set:Nn \l_@@_hexcol_tl {#1} }
+ {
+ \int_compare:nTF { \tl_count:n {#1} == 8 }
+ { \fontspec_parse_colour:viii #1 }
+ {
+ \bool_if:NF \l_@@_firsttime_bool
+ { \@@_warning:nx {bad-colour} {#1} }
+ }
+ }
+ }
+ }
+%</LU>
}
% \end{macrocode}
%
@@ -723,6 +801,7 @@
}
\tl_set:Nx \l_@@_opacity_tl
{
+%<LU> ,
\int_compare:nT { \l_@@_tmp_int <= "F } {0} % zero pad
\int_to_hex:n { \l_@@_tmp_int }
}
@@ -760,14 +839,21 @@
% \subsubsection{Continuous font axes}
%
% \begin{macrocode}
+%<*XE>
\@@_keys_define_code:nnn {fontspec} {Weight}
{
\@@_update_featstr:n{weight=#1}
}
+%</XE>
+%<LU>\@@_define_opentype_variation_axis:nn {Weight} {wght}
+%<*XE>
\@@_keys_define_code:nnn {fontspec} {Width}
{
\@@_update_featstr:n{width=#1}
}
+%</XE>
+%<LU>\@@_define_opentype_variation_axis:nn {Width} {wdth}
+\@@_define_opentype_variation_axis:nn {Slant} {slnt}
\@@_keys_define_code:nnn {fontspec} {OpticalSize}
%<*XE>
{
@@ -795,6 +881,23 @@
%</LU>
% \end{macrocode}
%
+% For other potentially font specific variation axes, there is a raw setter available:
+% \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-opentype} {RawAxis}
+ {
+ \prop_gput_from_keyval:Nn \g_@@_rawvariations_prop {#1}
+ }
+% \end{macrocode}
+%
+% \subsubsection{Variation instances}
+%
+% \begin{macrocode}
+\@@_keys_define_code:nnn {fontspec-opentype} {Instance}
+ {
+ \tl_gset:Nn \g_@@_instance_tl {#1}
+ }
+% \end{macrocode}
+%
% \subsubsection{Font transformations}
% These are to be specified to apply directly to a font shape:
% \begin{macrocode}
@@ -914,6 +1017,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-lang.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-lang.dtx
index 22bde48834..1e52fc9d26 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-lang.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-lang.dtx
@@ -407,6 +407,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-load.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-load.dtx
index 4f7ec3bd83..db7f370031 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-load.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-load.dtx
@@ -21,7 +21,7 @@
{
\RequirePackage{luaotfload}
\lua_now:e{require("fontspec")}
- \RequirePackageWithOptions{fontspec-luatex}
+ \RequirePackage{fontspec-luatex}
\endinput
}
% \end{macrocode}
@@ -30,7 +30,7 @@
% \begin{macrocode}
\sys_if_engine_xetex:T
{
- \RequirePackageWithOptions{fontspec-xetex}
+ \RequirePackage{fontspec-xetex}
\endinput
}
% \end{macrocode}
@@ -60,6 +60,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-math.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-math.dtx
index 73f29782af..01d99c8641 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-math.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-math.dtx
@@ -248,6 +248,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx
index 1eafe2333d..1785437fa0 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-msg.dtx
@@ -13,6 +13,7 @@
\cs_new:Npn \@@_error:n { \msg_error:nn {fontspec} }
\cs_new:Npn \@@_error:nn { \msg_error:nnn {fontspec} }
\cs_new:Npn \@@_error:nx { \msg_error:nnx {fontspec} }
+\cs_new:Npn \@@_error:nxx { \msg_error:nnxx {fontspec} }
\cs_new:Npn \@@_warning:n { \msg_warning:nn {fontspec} }
\cs_new:Npn \@@_warning:nx { \msg_warning:nnx {fontspec} }
\cs_new:Npn \@@_warning:nxx { \msg_warning:nnxx {fontspec} }
@@ -188,10 +189,21 @@
Input mapping not supported in LuaTeX.\\
Use "Ligatures=TeX" instead of "Mapping=tex-text".
}
-\@@_msg_new:nn {cm-default-obsolete}
+% \end{macrocode}
+% message for package options must be loaded earlier
+% \begin{macrocode}
+%</fontspec>
+%<*options>
+\msg_new:nnn {fontspec} {cm-default-obsolete}
+ {
+ The~"cm-default"~package~option~is~obsolete.
+ }
+\msg_new:nnn {fontspec} {enc-obsolete}
{
- The "cm-default" package option is obsolete.
+ The~"#1"~package~option~is~obsolete.~TU~is~the~default~encoding.
}
+%</options>
+%<*fontspec>
\@@_msg_new:nn {font-index-needs-ttc}
{
The "FontIndex" feature is only supported by TTC (TrueType Collection) fonts.\\
@@ -268,6 +280,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-opening.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-opening.dtx
index 60253a1ea8..103fe2addf 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-opening.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-opening.dtx
@@ -4,75 +4,74 @@
%
% \iffalse
% \begin{macrocode}
-%<*fontspec>
+%<*options>
% \end{macrocode}
% \fi
%
% \subsection{Package options}
%
% \begin{macrocode}
-\DeclareOption{cm-default}
+\DeclareKeys
{
- \@@_warning:n {cm-default-obsolete}
- }
+ cm-default .code:n = { \msg_warning:nn {fontspec} {cm-default-obsolete} }
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareOption {math} { \bool_gset_true:N \g_@@_math_bool }
-\DeclareOption {no-math} { \bool_gset_false:N \g_@@_math_bool }
-\DeclareOption {config} { \bool_gset_true:N \g_@@_cfg_bool }
-\DeclareOption {no-config}{ \bool_gset_false:N \g_@@_cfg_bool }
-\DeclareOption {euenc} { \bool_gset_true:N \g_@@_euenc_bool }
-\DeclareOption {tuenc} { \bool_gset_false:N \g_@@_euenc_bool }
+ ,math .bool_gset:N = \g_@@_math_bool
+ ,math .usage:n = preamble
+ ,no-math .bool_gset_inverse:N = \g_@@_math_bool
+ ,no-math .usage:n = preamble
+ ,config .bool_gset:N = \g_@@_cfg_bool
+ ,config .usage:n = load
+ ,no-config .bool_gset_inverse:N = \g_@@_cfg_bool
+ ,no-config .usage:n = load
+ ,euenc .code:n = { \msg_warning:nnn {fontspec} {enc-obsolete}{euenc} }
+ ,tuenc .code:n = { \msg_warning:nnn {fontspec} {enc-obsolete}{tuenc} }
% \end{macrocode}
%
% \begin{macrocode}
-\DeclareOption {quiet}
- {
- \msg_redirect_module:nnn { fontspec } { warning } { info }
- \msg_redirect_module:nnn { fontspec } { info } { none }
- }
-\DeclareOption{silent}
- {
- \msg_redirect_module:nnn { fontspec } { warning } { none }
- \msg_redirect_module:nnn { fontspec } { info } { none }
- }
+ ,quiet .code:n =
+ {
+ \msg_redirect_module:nnn { fontspec } { warning } { info }
+ \msg_redirect_module:nnn { fontspec } { info } { none }
+ }
+ ,silent .code:n =
+ {
+ \msg_redirect_module:nnn { fontspec } { warning } { none }
+ \msg_redirect_module:nnn { fontspec } { info } { none }
+ }
+ ,verbose .code:n =
+ {
+ \msg_redirect_module:nnn { fontspec } { warning } { warning }
+ \msg_redirect_module:nnn { fontspec } { info } { info }
+ }
+ }
% \end{macrocode}
%
% \begin{macrocode}
-\ExecuteOptions{config,math,tuenc}
-\ProcessOptions*
+\SetKeys{config,math}
+\ProcessKeyOptions
% \end{macrocode}
%
-%
+% \iffalse
+% \begin{macrocode}
+%</options>
+%<*fontspec>
+% \end{macrocode}
+% \fi
%
%
% \subsection{Encodings}
%
-% Soon to be the default, with a just-in-case check:
+% Now the default, with a just-in-case check:
% \begin{macrocode}
-\bool_if:NF \g_@@_euenc_bool
- {
- \file_if_exist:nTF {tuenc.def}
- {
- \cs_if_exist:cF {T@TU}
- {
- \@@_warning:n {tu-clash}
- \DeclareFontEncoding{TU}{}{}
- \DeclareFontSubstitution{TU}{lmr}{m}{n}
- }
- }
- {
- \@@_warning:n {tu-missing}
- \bool_gset_true:N \g_@@_euenc_bool
- }
- }
-\bool_if:NTF \g_@@_euenc_bool
+\cs_if_exist:cF {T@TU}
{
-%<XE> \tl_gset:Nn \g_fontspec_encoding_tl {EU1}
-%<LU> \tl_gset:Nn \g_fontspec_encoding_tl {EU2}
+ \@@_warning:n {tu-clash}
+ \DeclareFontEncoding{TU}{}{}
+ \DeclareFontSubstitution{TU}{lmr}{m}{n}
}
- { \tl_gset:Nn \g_fontspec_encoding_tl { TU } }
+\tl_gset:Nn \g_fontspec_encoding_tl { TU }
% \end{macrocode}
%
% \begin{macrocode}
@@ -100,16 +99,6 @@
% Something to do with \cmd\select@language\ ending up in the \texttt{.aux}
% file which is read at the beginning of the document.
%
-% \begin{macrocode}
-\bool_if:NT \g_@@_euenc_bool
- {
-%<LU> \cs_set_eq:NN \fontspec_tmp: \XeTeXpicfile
-%<LU> \cs_set:Npn \XeTeXpicfile {}
- \RequirePackage{xunicode}
-%<LU> \cs_set_eq:NN \XeTeXpicfile \fontspec_tmp:
- }
-% \end{macrocode}
-%
%
% \subsection{Generic functions}
%
@@ -201,6 +190,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx
index 94be4acfca..1ea0a4eccf 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-opentype.dtx
@@ -10,6 +10,22 @@
%
%
%
+% \begin{macro}{\@@_define_opentype_variation_axis:nn}
+% \begin{macrocode}
+\cs_new:Nn \@@_define_opentype_variation_axis:nn
+ {
+ \keys_define:nn {fontspec-opentype}
+ {
+ #1 .code:n = {
+ \prop_gput:Nnn \g_@@_rawvariations_prop { #2 } { ##1 }
+ },
+ #1 .value_required:n = true,
+ #1 .groups:n = {opentype},
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_define_opentype_feature_group:n}
% \begin{macrocode}
\cs_new:Nn \@@_define_opentype_feature_group:n
@@ -466,6 +482,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-scripts.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-scripts.dtx
index 7c2f79117c..d56a066e7e 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-scripts.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-scripts.dtx
@@ -37,7 +37,7 @@
\newfontscript{CJK~Ideographic}{hani}
\newfontscript{Coptic}{copt}
\newfontscript{Cypriot~Syllabary}{cprt}
-\newfontscript{Cypro~Minoan}{cpmn}
+\newfontscript{Cypro-Minoan}{cpmn}
\newfontscript{Cyrillic}{cyrl}
\newfontscript{Default}{DFLT}
\newfontscript{CustomDefault}{latn,DFLT}
@@ -71,6 +71,7 @@
\newfontscript{Javanese}{java}
\newfontscript{Kaithi}{kthi}
\newfontscript{Kannada}{knd2,knda}
+\newfontscript{Kawi}{kawi}
\newfontscript{Kayah~Li}{kali}
\newfontscript{Kharosthi}{khar}
\newfontscript{Khitan~Small~Script}{kits}
@@ -92,7 +93,7 @@
\newfontscript{Mandaic}{mand}
\newfontscript{Manichaean}{mani}
\newfontscript{Marchen}{marc}
-\newfontscript{Masaram Gondi}{gonm}
+\newfontscript{Masaram~Gondi}{gonm}
\newfontscript{Math}{math}
\newfontscript{Medefaidrin}{medf}
\newfontscript{Meitei~Mayek}{mtei}
@@ -108,6 +109,7 @@
\newfontscript{Myanmar}{mym2,mymr}
\newfontscript{N'Ko}{nko~}
\newfontscript{Nabataean}{nbat}
+\newfontscript{Nag~Mundari}{nagm}
\newfontscript{Nandinagari}{nand}
\newfontscript{Newa}{newa}
\newfontscript{Nushu}{nshu}
@@ -195,6 +197,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-user.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-user.dtx
index eeb704df58..d28eda0c2f 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-user.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-user.dtx
@@ -540,6 +540,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-vars.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-vars.dtx
index d24776218f..bb6d3b4eee 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-vars.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-vars.dtx
@@ -4,6 +4,7 @@
%
% \iffalse
% \begin{macrocode}
+%<@@=fontspec>
%<*fontspec>
% \end{macrocode}
% \fi
@@ -50,9 +51,12 @@
% \end{macrocode}
% For package options:
% \begin{macrocode}
+%</fontspec>
+%<*options>
\bool_new:N \g_@@_cfg_bool
\bool_new:N \g_@@_math_bool
-\bool_new:N \g_@@_euenc_bool
+%</options>
+%<*fontspec>
% \end{macrocode}
%
% \begin{macrocode}
@@ -63,6 +67,7 @@
\bool_new:N \l_@@_defining_encoding_bool
\bool_new:N \l_@@_scriptlang_exist_bool
\bool_new:N \g_@@_em_normalise_slant_bool
+\bool_new:N \l_@@_external_kpse_bool
\bool_new:N \l_@@_proceed_bool
% \end{macrocode}
%
@@ -151,6 +156,7 @@
\prop_new:N \g_@@_strong_prop
\prop_new:N \g_@@_fontid_family_prop
\prop_new:N \g_@@_family_int_prop
+\prop_new:N \g_@@_rawvariations_prop
% \end{macrocode}
%
% \paragraph{Token lists}
@@ -288,11 +294,13 @@
\tl_new:N \l_@@_punctspace_adjust_tl
\tl_new:N \l_@@_wordspace_adjust_tl
\tl_new:N \l_@@_postadjust_tl
+\tl_new:N \g_@@_instance_tl
% \end{macrocode}
%
% \begin{macrocode}
\tl_const:Nn \c_@@_hexcol_tl {000000}
-\tl_const:Nn \c_@@_opacity_tl {FF~}
+%<XE> \tl_const:Nn \c_@@_opacity_tl {FF~}
+%<LU> \tl_const:Nn \c_@@_opacity_tl {}
\tl_const:Nn \c_@@_postadjust_tl { \l_@@_wordspace_adjust_tl \l_@@_punctspace_adjust_tl }
% \end{macrocode}
%
@@ -328,6 +336,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code-xfss.dtx b/macros/unicodetex/latex/fontspec/fontspec-code-xfss.dtx
index ecbad84167..bac0e57d94 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code-xfss.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code-xfss.dtx
@@ -151,6 +151,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code.ltx b/macros/unicodetex/latex/fontspec/fontspec-code.ltx
index 5ee01ccc80..1ec8fe6cd7 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code.ltx
+++ b/macros/unicodetex/latex/fontspec/fontspec-code.ltx
@@ -30,6 +30,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-code.pdf b/macros/unicodetex/latex/fontspec/fontspec-code.pdf
index 0a86c16bf7..c11119f627 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-code.pdf
+++ b/macros/unicodetex/latex/fontspec/fontspec-code.pdf
Binary files differ
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-api.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-api.tex
index 42970e3f37..bdcb1935b3 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-api.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-api.tex
@@ -339,6 +339,7 @@ OpenType language tag |#1|.
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-enc.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-enc.tex
index 8ab667b288..60da8dbb3a 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-enc.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-enc.tex
@@ -204,6 +204,7 @@ the process of defining Unicode font range encodings:
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-featset.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-featset.tex
index 4bb75d14b5..b95931c52e 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-featset.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-featset.tex
@@ -330,7 +330,7 @@ Notably, this mechanism is different to that of the \pkg{color}/\pkg{xcolor}/\pk
(For example, if you set the colour in a \verb|\setmainfont| command, \verb|\color{...}| and related commands, including hyperlink colouring, will no longer have any effect on text in this font.)
Therefore, \pkg{fontspec}'s colour commands are best used to set explicit colours in specific situations, and the \pkg{xcolor} package is recommended for more general colour functionality.
-The colour is defined as a triplet of two-digit Hex RGB
+The colour can be defined as a triplet of two-digit Hex RGB
values, with optionally another value for the transparency (where
|00| is completely transparent and |FF| is opaque.)
\begin{Lexample}{color}{Selecting colour with transparency.}
@@ -341,8 +341,6 @@ values, with optionally another value for the transparency (where
{\addfontfeature{Color=DDBB2299}P}\kern-0.5ex
{\addfontfeature{Color=00BB3399}R}
\end{Lexample}
-Transparency is supported by \LuaLaTeX; \XeLaTeX\ with the \texttt{xdvipdfmx} driver
-does not support this feature.
If you load the \pkg{xcolor} package, you may use any named colour instead
of writing the colours in hexadecimal.
@@ -353,23 +351,68 @@ of writing the colours in hexadecimal.
\definecolor{Foo}{rgb}{0.3,0.4,0.5}
\fontspec[Color=Foo]{Verdana} ...
\end{Verbatim}
-The \pkg{color} package is \emph{not} supported; use \pkg{xcolor} instead.
-You may specify the transparency with a named colour using the \feat{Opacity}
-feature which takes an decimal from zero to one corresponding to
-transparent to opaque respectively:
+You may also use named colours defined with the color commands of the L3
+programming layer:
+\begin{Verbatim}
+ \ExplSyntaxOn
+ \color_set:nnn{Foo}{rgb}{0.3,0.4,0.5}
+\ExplSyntaxOff
+ ...
+ \fontspec[Color=Foo]{Verdana} ...
+\end{Verbatim}
+
+Color expressions (\verb+red!50!blue+) are not supported. The \pkg{color}
+package is \emph{not} supported neither.
+
+The code will at first test for color names of the L3 layer, then for xcolor
+names and at last try to use the argument as a hexadecimal value.
+
+You may specify the transparency with a named colour using the \feat{Opacity}
+feature which takes an decimal from zero to one corresponding to transparent
+to opaque respectively:
\begin{Verbatim}
\fontspec[Color=red,Opacity=0.7]{Verdana} ...
\end{Verbatim}
It is still possible to specify a colour in six-char hexadecimal form
while defining opacity in this way, if you like.
+\subsubsection{Color models}
+
+With \XeTeX\ color are always written in the rgb color model into the PDF.
+When using \LuaTeX, colors with the commands of the L3 layer can be written
+as rgb or cmyk or as spot color depending on their definition and of the
+value of the variable \verb+\l_color_fixed_model_tl+.
+
+\subsubsection{Spot colors}
+With \LuaTeX\ it is possible to use spot colors. This requires the use of the
+PDF management:
+\begin{Verbatim}
+\DocumentMetadata{}
+\documentclass{article}
+\usepackage{fontspec}
+\ExplSyntaxOn
+ \color_model_new:nnn { sepblue } { Separation }
+ {
+ name = PANTONE~3005~U ,
+ alternative-model = cmyk ,
+ alternative-values = {1, 0.56, 0,0},
+ }
+ \color_set:nnn{spotblue}{sepblue}{1}
+\ExplSyntaxOff
+...
+\fontspec[Color=spotblue]{texgyreheros}
+\end{Verbatim}
+
+
+
\subsection{Scale}
\cmdbox{
\feat{Scale} = \meta{number} \\
\feat{Scale} = \opt{MatchLowercase} \\
- \feat{Scale} = \opt{MatchUppercase}
+ \feat{Scale} = \opt{MatchUppercase} \\
+ \feat{Scale} = \opt{MatchAveragecase}
}
In its explicit form, \feat{Scale} takes a single
@@ -377,18 +420,21 @@ numeric argument for linearly scaling the font, as demonstrated
in \exref{fontload}.
As well as a numerical argument, the \feat{Scale} feature
-also accepts options \opt{MatchLowercase}
-and \opt{MatchUppercase}, which will scale the font being selected to match
-the current default roman font to either the height of the lowercase or
-uppercase letters, respectively; these features are shown in \exref{scale}.
+also accepts options \opt{MatchLowercase}, \opt{MatchUppercase},
+and \opt{MatchAveragecase}, which will scale the font being selected to match
+the current default roman font to either the height of the lowercase,
+the height of the uppercase letters, or the average of the two,
+respectively; these features are shown in \exref{scale}.
The amount of scaling used in each instance is reported in the \texttt{.log} file.
\begin{Xexample}{scale}{Automatically calculated scale values.}
- \setmainfont{Georgia}
- \newfontfamily\lc[Scale=MatchLowercase]{Verdana}
+ \setmainfont{texgyrepagella-regular.otf}
+ \newfontfamily\lc[Scale=MatchLowercase]{texgyreadventor-regular.otf}
The perfect match {\lc is hard to find.}\\
- \newfontfamily\uc[Scale=MatchUppercase]{Arial}
- L O G O \uc F O N T
+ \newfontfamily\uc[Scale=MatchUppercase]{texgyreheros-regular.otf}
+ L O G O {\uc F O N T}\\
+ \newfontfamily\ac[Scale=MatchAveragecase]{FiraMath-Regular.otf}
+ Lower {\ac and UPPER} CASE
\end{Xexample}
Additional calls to the \feat{Scale} feature overwrite the settings of the former.
@@ -400,7 +446,8 @@ necessary. For example:
[ Scale = 1.1 , ScaleAgain = 1.2 ] % -> scale of 1.32
\end{Verbatim}
-Note that when |Scale=MatchLowercase| is used with |\setmainfont|, the new `main'
+Note that when |Scale=MatchLowercase|, |Scale=MatchUppercase|, or |Scale=MatchAverageCase|
+is used with |\setmainfont|, the new `main'
font of the document will be scaled to match the old default.
If you wish to automatically scale all fonts except have the main font use `natural'
scaling, you may write
@@ -608,12 +655,97 @@ This functionality is not generally used for lowercase text in modern typesettin
In particular, small amounts of letter spacing can be very useful, when setting small caps or all caps titles.
Also see the OpenType \opt{Uppercase} option of the \feat{Letters} feature (\vref{sec:letters}).
+
+\section{Variable fonts} \label{sec:variable}
+
+OpenType variable fonts and Multiple Master fonts are parameterised over
+orthogonal font axes, allowing continuous selection along such features
+as weight, width, and optical size.
+
+Currently OpenType variable fonts are only supported in \LuaTeX, while
+Multiple Master fonts only work with \XeTeX.
+
+\subsection{Optical font sizes} \label{sec:aat-opticalsize}
+Whereas traditional OpenType fonts will have only a few separate
+optical sizes, a Variable or Multiple Master font's optical size can be
+specified over a continuous range. Unfortunately, this flexibility makes
+it harder to create an automatic interface through \LaTeX, and the
+optical size for a Variable or Multiple Master font must always be specified
+explicitly.
+\begin{Verbatim}
+ \fontspec{Minion MM Roman}[OpticalSize=11]
+ MM optical size test \\
+ \fontspec{Minion MM Roman}[OpticalSize=47]
+ MM optical size test \\
+ \fontspec{Minion MM Roman}[OpticalSize=71]
+ MM optical size test \\
+\end{Verbatim}
+
+
+\subsection{Weight} \label{sec:variable-weight}
+For fonts with a variable weight axis, the weight can be specified through the
+\feat{Weight} feature. The value should be between 0 and 1000, where typically
+400 corresponds to regular wight and 700 is a bold font.
+\begin{Verbatim}
+ \fontspec{Source Serif Variable}[Weight=700]
+ Bold \\
+ \fontspec{Source Serif Variable}[Weight=200]
+ Extra Light \\
+\end{Verbatim}
+
+
+\subsection{Width} \label{sec:variable-width}
+Similarly, the \feat{Width} feature allows specifying the value of the width axis,
+where the value is a percentage of normal width.
+\begin{Verbatim}
+ \fontspec{Noto Serif}[Width=100]
+ Normal Width \\
+ \fontspec{Noto Serif}[Width=75]
+ Condensed \\
+\end{Verbatim}
+
+\subsection{Slant} \label{sec:variable-slant}
+Also fonts with a slant axis can be controlled with the \feat{Slant} feature.
+In a standard compliant font the value should specify the clockwise angle in degree
+the glyphs are slanted. Therefore for a typical forward leaning slanted font, a
+negative value should be passed.
+
+Many fonts use this feature in non-standard ways, so you might have to experiment
+a bit with the value.
+\begin{Verbatim}
+ \fontspec{Roboto Flex}[Slant=0]
+ Upright \\
+ \fontspec{Roboto Flex}[Slant=-5]
+ Slanted \\
+\end{Verbatim}
+
+\subsection{Other axes} \label{sec:variable-raw}
+For OpenType variable fonts, additional axis values can be specified
+if the four letter tag of these axes is known.
+Than their value can be set with the \feat{RawAxis} feature:
+\begin{Verbatim}
+ \fontspec{Noto Serif}[RawAxis={CTGR=100}]
+ Maximal contrast \\
+ \fontspec{Noto Serif}[RawAxis={CTGR=0}]
+ Regular contrast \\
+\end{Verbatim}
+
+\subsection{Instances} \label{sec:variable-instances}
+Instead of manually setting axis values, many fonts contain named instances which are predefined settings of all axes.
+
+To select such an instance, the \feat{Instance} feature can be used:
+\begin{Verbatim}
+ \fontspec{Noto Serif}[Instance=ExtraCondensed Bold]
+ This is in extra condensed bold.
+\end{Verbatim}
+
\end{document}
% /©
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-fontsel.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-fontsel.tex
index d6ac139ef6..aecd47e176 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-fontsel.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-fontsel.tex
@@ -129,6 +129,7 @@ wish to have them all installed in your system's font directories.
In this case, it is more convenient to load them from a different location on your disk.
This technique is also necessary in \XeTeX\ when loading OpenType fonts that are present within your \TeX\ distribution, such as \path{/usr/local/texlive/2013/texmf-dist/fonts/opentype/public}.
Fonts in such locations are visible to \XeTeX\ but cannot be loaded by font name, only file name; \LuaTeX\ does not have this restriction.
+(If you for some reason want to restrict the fonts to the ones provided by your \TeX\ distribution even though you are using \LuaTeX\ you can use the \texttt{KpseOnly} option)
When selecting fonts by file name, any font that can be found in the default
search paths may be used directly (including in the current directory)
@@ -641,6 +642,7 @@ if it were a `naked' control sequence; \eg, `|M. \fontspec{...} N|' and
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-intro.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-intro.tex
index 4e913b6107..07345d19d7 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-intro.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-intro.tex
@@ -75,17 +75,19 @@ For basic use, no package options are required:
\usepackage{fontspec}
\end{Verbatim}
Package options will be introduced below; some preliminary details are discussed first.
-
+Package options are setup with the in-built \LaTeX{} keyval options handler. This means
+that the package can be loaded more than once with different options without triggering
+an option clash error. The \texttt{config} and \texttt{no-config} option must be used in
+the first loading and are ignored later.
\subsection{Font encodings}
-The (default) \texttt{tuenc} package option switches the \textsc{nfss} font encoding to \texttt{TU}.
+The package switches the \textsc{nfss} font encoding to \texttt{TU}.
\texttt{TU} is a new Unicode font encoding, intended for both \XeTeX\ and \LuaTeX\ engines, and automatically contains support for symbols covered by \LaTeX's traditional \texttt{T1} and \texttt{TS1} font encodings (for example, |\%|, |\textbullet|, |\"u|, and so on).
Some additional features are provided by \pkg{fontspec} to customise some encoding details; see Part~\vref{part:enc} for further details.
-Pre-2017 behaviour can be achieved with the \texttt{euenc} package option.
-This selects the \texttt{EU1} or \texttt{EU2} encoding (\XeTeX/\LuaTeX, resp.) and loads the \pkg{xunicode} package for symbol support.
-Package authors and users who have referred explicitly to the encoding names \texttt{EU1} or \texttt{EU2} should update their code or documents.
+Pre-2017 behaviour is now obsolete. The \texttt{euenc} and \texttt{tuenc} package options are
+ignored. Package authors and users who have referred explicitly to the encoding names \texttt{EU1} or \texttt{EU2} should update their code or documents.
(See internal variable names described in \vref{sec:api} for how to do this properly.)
@@ -108,7 +110,7 @@ A |fontspec.cfg| file is distributed with \pkg{fontspec} with a small number of
To customise \pkg{fontspec} to your liking, use the standard |.cfg| file as a starting point or write your own from scratch, then either place it in the same folder as the main document for isolated cases, or in a location
that \XeTeX\ or \LuaTeX\ searches by default; \eg\ in Mac\TeX: \path{~/Library/texmf/tex/latex/}.
-The package option |no-config| will suppress the loading of the |fontspec.cfg| file under all circumstances.
+The package option |no-config| will suppress the loading of the |fontspec.cfg| file under all circumstances. Both options must be used the first time \pkg{fontspec} is loaded and are ignored in later calls.
\subsection{Warnings}
@@ -121,7 +123,7 @@ transcript (\texttt{.log}) file instead.
Use the |silent| package option to completely suppress these warnings if you
don't even want the |.log| file cluttered up.
-
+Both options can also be used with \cs{Setkeys} in the document. Use the |verbose| option to get activate the warnings again.
\section{Interaction with \LaTeXe\ and other packages}
@@ -184,6 +186,7 @@ An example for setting up a font family for use with \cs{strong} is discussed in
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-luatex.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-luatex.tex
index e0ed5881d6..b08a89230e 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-luatex.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-luatex.tex
@@ -81,6 +81,7 @@ Please refer to the \LuaTeX/\pkg{luaotfload} documentation for more details.
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-opentype.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-opentype.tex
index 3d6aa4601b..10bc9f0284 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-opentype.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-opentype.tex
@@ -1467,6 +1467,7 @@ however; please get in touch if there are improvements that could be made.
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-doc-xetex.tex b/macros/unicodetex/latex/fontspec/fontspec-doc-xetex.tex
index 4f1369ddd6..0033156971 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-doc-xetex.tex
+++ b/macros/unicodetex/latex/fontspec/fontspec-doc-xetex.tex
@@ -58,27 +58,6 @@ by \pkg{fontspec} before all others and will automatically and without warning
select the \opt{OpenType} renderer.}
-\subsection{Optical font sizes} \label{sec:aat-opticalsize}
-
-Multiple Master fonts are parameterised over
-orthogonal font axes, allowing continuous selection along such
-features as weight, width, and optical size.
-Whereas an OpenType font will have only a few separate
-optical sizes, a Multiple Master font's optical size can be
-specified over a continuous range. Unfortunately, this flexibility makes
-it harder to create an automatic interface through \LaTeX, and the
-optical size for a Multiple Master font must always be specified
-explicitly.
-\begin{Verbatim}
- \fontspec{Minion MM Roman}[OpticalSize=11]
- MM optical size test \\
- \fontspec{Minion MM Roman}[OpticalSize=47]
- MM optical size test \\
- \fontspec{Minion MM Roman}[OpticalSize=71]
- MM optical size test \\
-\end{Verbatim}
-
-
\subsection{Vertical typesetting}
\XeTeX\ provides for vertical typesetting simply with the ability to rotate
@@ -282,6 +261,7 @@ options: \opt{Off},
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec-lua.dtx b/macros/unicodetex/latex/fontspec/fontspec-lua.dtx
index 0ec3127188..09e123a053 100644
--- a/macros/unicodetex/latex/fontspec/fontspec-lua.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec-lua.dtx
@@ -89,6 +89,7 @@ end
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec.dtx b/macros/unicodetex/latex/fontspec/fontspec.dtx
index e6d8105a7a..f73bb4edcb 100644
--- a/macros/unicodetex/latex/fontspec/fontspec.dtx
+++ b/macros/unicodetex/latex/fontspec/fontspec.dtx
@@ -70,7 +70,7 @@
\ProvidesExplFile{fontspec.dtx}
%</dtx>
%<*fontspec>
- {2022/01/15}{2.8a}{Font selection for XeLaTeX and LuaLaTeX}
+ {2024/02/13}{2.9a}{Font selection for XeLaTeX and LuaLaTeX}
%</fontspec>
% \end{macrocode}
%
@@ -89,8 +89,8 @@
%<lua>local fontspec = fontspec
%<lua>fontspec.module = {
%<lua> name = "fontspec",
-%<lua> version = "2.8a",
-%<lua> date = "2022/01/15",
+%<lua> version = "2.9a",
+%<lua> date = "2024/02/13",
%<lua> description = "Font selection for XeLaTeX and LuaLaTeX",
%<lua> author = "Khaled Hosny, Philipp Gesang, Will Robertson",
%<lua> copyright = "Khaled Hosny, Philipp Gesang, Will Robertson",
@@ -104,6 +104,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec.ins b/macros/unicodetex/latex/fontspec/fontspec.ins
index be45e40b82..00b43f9ee2 100644
--- a/macros/unicodetex/latex/fontspec/fontspec.ins
+++ b/macros/unicodetex/latex/fontspec/fontspec.ins
@@ -32,6 +32,9 @@ the conditions of the LaTeX Project Public License, version 1.3c or higher
\generate{\file{fontspec.sty}{
\from{fontspec.dtx}{fontspec,load\FSDEBUG}
+ \from{fontspec-code-vars.dtx}{options}
+ \from{fontspec-code-msg.dtx}{options}
+ \from{fontspec-code-opening.dtx}{options}
\from{fontspec-code-load.dtx}{fontspec,load\FSDEBUG}
}}
@@ -48,6 +51,7 @@ the conditions of the LaTeX Project Public License, version 1.3c or higher
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec.ltx b/macros/unicodetex/latex/fontspec/fontspec.ltx
index 239069ff7e..d6d2a2d642 100644
--- a/macros/unicodetex/latex/fontspec/fontspec.ltx
+++ b/macros/unicodetex/latex/fontspec/fontspec.ltx
@@ -28,6 +28,7 @@
% ------------------------------------------------
% The FONTSPEC package <wspr.io/fontspec>
% ------------------------------------------------
+% Copyright 2022-2023 The LaTeX project
% Copyright 2004-2022 Will Robertson, LPPL "maintainer"
% Copyright 2009-2015 Khaled Hosny
% Copyright 2013 Philipp Gesang
diff --git a/macros/unicodetex/latex/fontspec/fontspec.pdf b/macros/unicodetex/latex/fontspec/fontspec.pdf
index 3e223342f5..6fb58328d1 100644
--- a/macros/unicodetex/latex/fontspec/fontspec.pdf
+++ b/macros/unicodetex/latex/fontspec/fontspec.pdf
Binary files differ