summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-08-02 03:02:40 +0000
committerNorbert Preining <norbert@preining.info>2021-08-02 03:02:40 +0000
commit7c20aed48e20b439ef64f417a7e32ce7fda44d18 (patch)
tree13cc29cf9941f8b282c5a95dcb8910f1aef9dbd5 /macros/latex
parent956b25a304207d06fe012f8c8efcb13cc66e3eec (diff)
CTAN sync 202108020302
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx178
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin552330 -> 571527 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex291
-rw-r--r--macros/latex/contrib/elpres/README.md29
-rw-r--r--macros/latex/contrib/elpres/doc/elpres-example.pdfbin159639 -> 157784 bytes
-rw-r--r--macros/latex/contrib/elpres/doc/elpres-manual.pdfbin158286 -> 155411 bytes
-rw-r--r--macros/latex/contrib/elpres/doc/elpres-manual.tex13
-rw-r--r--macros/latex/contrib/elpres/tex/elpres.cls29
-rw-r--r--macros/latex/contrib/elpres/tex/elpresbluelightgrayscheme.sty24
-rw-r--r--macros/latex/contrib/elpres/tex/elpresgrayscheme.sty24
-rw-r--r--macros/latex/contrib/elpres/tex/elpreswhitebluescheme.sty24
-rw-r--r--macros/latex/contrib/elpres/tex/elpreswhiteredscheme.sty23
-rw-r--r--macros/latex/contrib/elpres/tex/elpreswhitetealscheme.sty25
-rw-r--r--macros/latex/contrib/iexec/README.md2
-rw-r--r--macros/latex/contrib/iexec/iexec.pdfbin108132 -> 107917 bytes
-rw-r--r--macros/latex/contrib/iexec/iexec.sty9
-rw-r--r--macros/latex/contrib/iexec/iexec.tex2
-rw-r--r--macros/latex/contrib/scrambledenvs/README.md15
-rw-r--r--macros/latex/contrib/scrambledenvs/scrambledenvs.dtx472
-rw-r--r--macros/latex/contrib/scrambledenvs/scrambledenvs.pdfbin0 -> 191739 bytes
-rw-r--r--macros/latex/contrib/tabularray/tabularray.pdfbin652813 -> 680990 bytes
-rw-r--r--macros/latex/contrib/tabularray/tabularray.sty359
-rw-r--r--macros/latex/contrib/tabularray/tabularray.tex956
23 files changed, 1847 insertions, 628 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index 3e61fa0833..7f671cf194 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -8,7 +8,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/07/30}{1.28}
+\ProvidesExplClass{easybook}{2021/08/01}{1.28b}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -292,11 +292,10 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/07/30}{1.28}
+\ProvidesExplPackage{easybase}{2021/08/01}{1.28b}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \int_to_arabic:n { v }
-\cs_generate_variant:Nn \int_to_alph:n { v }
\cs_generate_variant:Nn \dim_add:Nn { NV,Nv }
\cs_generate_variant:Nn \dim_set:Nn { NV }
\cs_generate_variant:Nn \prop_set_from_keyval:Nn { NV }
@@ -728,8 +727,6 @@
\cs_if_exist:NF \kaishu { \cs_gset_eq:NN \kaishu \itshape }
}
-\tl_new:N \l__eb_fnmark_number_choice_tl
-\bool_new:N \l__eb_fntext_bottom_bool
\ctex_define:nn { style }
{
footwith .choices:nn =
@@ -738,6 +735,73 @@
footwith .value_required:n = true,
footwith .initial:n = chapter
}
+\NewDocumentCommand{\eb_assign_fnmark_code:n}
+ {>{\SplitArgument{1}{,}}m}
+ {\eb_assign_fnmark_code_pos:nn #1}
+\cs_new_protected:Npn \eb_assign_fnmark_code_pos:nn #1#2
+ {
+ \tl_set:Nn \l__eb_fnmark_before_tl {#1}
+ \tl_if_novalue:nTF {#2}
+ { \tl_clear:N \l__eb_fnmark_after_tl }
+ { \tl_set:Nn \l__eb_fnmark_after_tl {#2} }
+ }
+\cs_new:Npn \eb_fnmark_counter_pifont:N #1
+ { \ding{\int_eval:n { 171 + #1 }} }
+\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1
+ { \ding{\int_eval:n { 181 + #1 }} }
+\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1
+ { \ding{\int_eval:n { 191 + #1 }} }
+\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1
+ { \ding{\int_eval:n { 201 + #1 }} }
+\cs_new:Npn \eb_int_format_trans:NN #1
+ {
+ \str_case:nn {#1}
+ {
+ { A } { \int_to_Alph:n }
+ { a } { \int_to_alph:n }
+ { 1 } { \int_to_arabic:n }
+ { I } { \int_to_Roman:n }
+ { i } { \int_to_roman:n }
+ { c } { \exp_args:NV \zhnumber }
+ }
+ }
+\cs_new_protected:Npn \eb_fnmark_normal_label_set:nn #1#2
+ {
+ \tl_set:Nn \l__eb_fnmark_number_type_tl {#1}
+ \cs_set:cpx {#2}
+ {
+ \str_case:VnT \l__eb_fnmark_number_type_tl
+ {
+ { plain }
+ { \exp_not:N \int_use:N }
+ { pifont }
+ { \exp_not:N \eb_fnmark_counter_pifont:N }
+ { pifont* }
+ { \exp_not:N \eb_fnmark_counter_pifont_neg:N }
+ { pifont-sans }
+ { \exp_not:N \eb_fnmark_counter_pifont_sans:N }
+ { pifont-sans* }
+ { \exp_not:N \eb_fnmark_counter_pifont_sans_neg:N }
+ }
+ { \exp_not:N \c@footnote }
+ }
+ }
+\cs_new_protected:Npn \eb_fnmark_shorter_label_set:nn #1#2
+ {
+ \tl_set:Nn \l__eb_fnmark_shorter_label_tl {#1}
+ \eb_clist_map_inline:nn
+ { A,a,1,I,i,c }
+ {
+ \tl_if_in:nnT {#1} {##1}
+ {
+ \tl_replace_once:Nnn \l__eb_fnmark_shorter_label_tl {##1}
+ { \eb_int_format_trans:NN ##1 \c@footnote }
+ \seq_map_break:
+ }
+ }
+ \cs_set_eq:cN {#2} \l__eb_fnmark_shorter_label_tl
+ }
+\bool_new:N \l__eb_fntext_bottom_bool
\ctex_define:nn { hdrset }
{
fnmargin .dim_set:N = \footnoteindent,
@@ -750,9 +814,9 @@
fnmark-pos .tl_set:N = \l__eb_fnmark_position_tl,
fnmark-pos .initial:n = super,
- afterfnmark .tl_set:N = \l__eb_fnmark_after_tl,
- afterfnmark .initial:n =
- { \tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } },
+ fnmark-code .code:n = \eb_assign_fnmark_code:n {#1},
+ fnmark-code .initial:n =
+ { ,\tl_if_eq:NnF \l__eb_fnmark_position_tl { super } { \space } },
fnmark-form .tl_set:N = \l__eb_fnmark_format_tl,
footnotetype .multichoices:nn =
@@ -767,8 +831,18 @@
fnmark-num .choices:nn =
{ plain,pifont,pifont*,pifont-sans,pifont-sans* }
- { \tl_set:Nn \l__eb_fnmark_number_choice_tl {#1} },
+ { \eb_fnmark_normal_label_set:nn {#1} { the@footnote } },
fnmark-num .value_required:n = true,
+ fnmark-num/unknown .code:n =
+ { \eb_fnmark_shorter_label_set:nn {#1} { the@footnote } },
+ fntext-num .choices:nn =
+ { plain,pifont,pifont*,pifont-sans,pifont-sans* }
+ { \eb_fnmark_normal_label_set:nn {#1} { thefootnote } },
+ fntext-num .value_required:n = true,
+ fntext-num/unknown .code:n =
+ { \eb_fnmark_shorter_label_set:nn {#1} { thefootnote } },
+ fnboth-num .meta:n = { fntext-num = #1,fnmark-num = #1 },
+ fnboth-num .initial:n = plain,
unknown .code:n = \eb_msg_unknown_option:n { hdrset }
}
@@ -882,20 +956,58 @@
}
\ProvideDocumentCommand{\super}{mo}{\textsuperscript{#1}}
\providecommand{\spb@textsuperscript@save}{\textsuperscript}
-\providecommand{\footref}[1]
+\cs_set_protected:Npn \footref #1
{
\group_begin:
- \unrestored@protected@xdef\@thefnmark{\ref{#1}}
+ \unrestored@protected@xdef\eb@thefnmark{\ref{#1}}
\group_end:
\@footnotemark
}
+\cs_set_protected:Npn \footnote
+ {
+ \@ifnextchar [
+ {\@xfootnote}
+ {
+ \exp_args:NV \stepcounter \@mpfn
+ \eb_current_label:n { @footnote }
+ \protected@xdef\@thefnmark{\thempfn}
+ \protected@xdef\eb@thefnmark{\the@footnote}
+ \@footnotemark
+ \@footnotetext
+ }
+ }
+\cs_set:Npn \footnotemark
+ {
+ \@ifnextchar [
+ {\@xfootnotemark}
+ {
+ \stepcounter{footnote}
+ \protected@xdef\eb@thefnmark{\the@footnote}
+ \@footnotemark
+ }
+ }
+\ctex_at_end_package:nn { hyperref }
+ {
+ \cs_set:Npn \@xfootnotemark [#1]
+ {
+ \group_begin:
+ \setcounter{footnote}{#1}
+ \unrestored@protected@xdef\eb@thefnmark{\the@footnote}
+ \group_end:
+ \@footnotemark
+ }
+ }
\cs_set:Npn \@makefnmark
{
\hbox:n
{
\tl_use:N \l__eb_subfont_footnote_tl
\tl_use:N \l__eb_fnmark_format_tl
- {\super{\@thefnmark}[0pt]}
+ {
+ \tl_if_eq:NnTF \@mpfn { footnote }
+ { \super{\eb@thefnmark}[0pt] }
+ { \super{\@thefnmark}[0pt] }
+ }
}
}
\cs_new:Npn \eb@makefnmark
@@ -906,8 +1018,12 @@
\tl_use:N \l__eb_fnmark_format_tl
{
\tl_if_eq:NnT \l__eb_fnmark_position_tl { super }
- { \spb@textsuperscript@save }{\@thefnmark}
- \tl_use:N \l__eb_fnmark_after_tl
+ { \spb@textsuperscript@save }
+ {
+ \tl_use:N \l__eb_fnmark_before_tl
+ \@thefnmark
+ \tl_use:N \l__eb_fnmark_after_tl
+ }
}
}
}
@@ -924,30 +1040,8 @@
\cs_new:Npn \Footnote #1 { \Footnotemark{#1}\@footnotetext }
\cs_new:Npn \Footnotemark #1 { \eb@@makefnmark{#1}\@footnotemark }
\cs_new:Npn \Footnotetext #1 { \eb@@makefnmark{#1}\@footnotetext }
-\cs_new:Npn \eb_fnmark_counter_pifont:N #1
- { \ding{\int_eval:n { 171 + #1 }} }
-\cs_new:Npn \eb_fnmark_counter_pifont_neg:N #1
- { \ding{\int_eval:n { 181 + #1 }} }
-\cs_new:Npn \eb_fnmark_counter_pifont_sans:N #1
- { \ding{\int_eval:n { 191 + #1 }} }
-\cs_new:Npn \eb_fnmark_counter_pifont_sans_neg:N #1
- { \ding{\int_eval:n { 201 + #1 }} }
-\cs_new:Npn \eb_footnote_counter:N #1
- {
- \str_case:VnF \l__eb_fnmark_number_choice_tl
- {
- { plain } { \int_use:N #1 }
- { pifont } { \eb_fnmark_counter_pifont:N #1 }
- { pifont* } { \eb_fnmark_counter_pifont_neg:N #1 }
- { pifont-sans } { \eb_fnmark_counter_pifont_sans:N #1 }
- { pifont-sans* } { \eb_fnmark_counter_pifont_sans_neg:N #1 }
- }
- { \int_use:N #1 }
- }
-\cs_new:Npn \eb_alph:n #1 { \int_to_alph:v { c@#1 } }
-\cs_set:Npn \thefootnote { \eb_footnote_counter:N \c@footnote }
-\cs_set:Npn \thempfootnote { \eb_alph:n { mpfootnote } }
\cs_new:Npn \eb@footmisc@ifvoid #1#2#3 { \ifvoid #1#2\else #3\fi }
+\cs_set:Npn \thempfootnote { \int_to_alph:n { \c@mpfootnote } }
\contentsuse{lstlisting}{lol}
\seq_put_left:Nn \c__ctex_headings_seq { chapter }
@@ -1191,11 +1285,10 @@
\tl_remove_once:cn { theeb@#4 } {#5}
\eb_current_label:n { eb@#4 }
}
-\cs_new:Npn \eb_arabic:n #1 { \int_to_arabic:v { c@#1 } }
\cs_new:Npn \eb_section_counter_prefix:n #1
{
\int_compare:nNnT { \c@chapter } > { 0 } { \use:c { the#1chapter }. }
- \eb_arabic:n { #1section }
+ \int_to_arabic:v { c@#1section }
}
\cs_set:Npn \thebichapter { \eb_arabic:n { bichapter } }
\cs_set:Npn \thebisection { \eb_section_counter_prefix:n { bi } }
@@ -2147,7 +2240,10 @@
\clist_map_inline:nn { page,none }
{
\tl_if_eq:NnT \l_keys_value_tl {##1}
- { \clist_map_break:n { \colorlet{ctex@toc@number}{black} } }
+ {
+ \colorlet{ctex@toc@number}{black}
+ \clist_map_break:
+ }
}
},
linktoc .default:n = all,
@@ -2256,7 +2352,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/30}{1.28}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/01}{1.28b}
{Customization of tcolorbox for easybook}
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 1da8d293a7..e8f8782172 100644
--- a/macros/latex/contrib/easybook/easybook.pdf
+++ b/macros/latex/contrib/easybook/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex
index 1f85ee17da..da6802b68f 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -3,15 +3,16 @@
\usepackage[fontset = fandol]{ctex}
\usepackage
{
- hologo,pifont,booktabs,enumitem,colortbl,
- fancyvrb-ex,geometry,indentfirst
+ booktabs,enumitem,newtxmath,indentfirst,
+ fancyvrb,geometry,colortbl,hologo,pifont
}
+\colorlet{cnltxred}{violet}
\setcnltx
{
name = easybook,
title = EASYBOOK 使用手册,
- version = v1.28,
- date = 2021/07/30,
+ version = v1.28b,
+ date = 2021/08/01,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
email = quee123@foxmail.com,
@@ -28,7 +29,7 @@
add-frame-options = {innerleftmargin = 2em},
listings-options = {numbers = none}
}
-\KOMAoptions{headsepline = 0.6pt}
+\KOMAoptions{headsepline = 0.6pt,numbers = {noenddot}}
\setfootnoterule[0.6pt]{0.4\columnwidth}
\addtokomafont{headsepline}{\color{cnltxblue}}
\addtokomafont{footnoterule}{\color{cnltxblue}}
@@ -39,7 +40,6 @@
\geometry{margin = 1in,marginparwidth = 0.65in}
\setlist{nosep,labelindent = \parindent,leftmargin = *,labelsep = 0.5em}
\setlist[itemize,1]{label = \small\color{cnltxblue}\textbullet}
-\newnote*{\change}[2][]{Introduced in #2\newline\ifblank{#1}{}{Changed in #1}}
\arrayrulecolor{cnltxblue}
\setcounter{tocdepth}{2}
@@ -171,17 +171,17 @@
\label{sec:document class options}
\begin{options}
\opt{draft}\Default!
- 开启草稿模式会加快编译速度,表现有显示页面边框、行溢出的地方显示黑色方块、图片变成占位方框、显示当前日期和关闭超链接渲染。不载入 \pkg*{tcolorbox} 宏包使用盒子环境也会提高编译速度,详情见小节 \ref{subsec:box}。
+ 开启草稿模式会加快编译速度,表现有显示页面边框、行溢出的地方显示黑色方块、图片变成占位方框、显示当前日期和关闭超链接渲染。不使用绘图宏包及依赖于 \pkg*{tcolorbox} 宏包的盒子环境也会增快编译速度,详情见小节 \ref{subsec:box}。
\opt{newline}\Default!
部分和章标题的样式为另起一行,符合一般英文书籍的习惯。
\keychoice{scheme}{chinese,plain}\Default{chinese}
- \option{scheme} 代表文档的主题,扩展了此选项在 C\TeX 文档类中原有的作用范围,\option{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。
+ 文档主题方案选项 \option{scheme} 扩展了 C\TeX 文档类中同名选项原有的作用范围,\option{plain} 选项可使各类标题变为英文形式。包括章节标题、图表标题和定理标题等。
\opt{enmode}\Default!
同时开启 \option{newline} 和 \keyis-{scheme}{plain} 选项以符合英文原生风格。
\keychoice{scheme}{a4paper,b5paper,c5paper,letterpaper,其它纸张}\Default{a4paper}
- 设置页面大小,交给 \pkg*{geometry} 宏包处理,可使用它支持的所有规格。建议选项 \option*{b5paper} 和 \keyis*-{zihao}{5},选项 \option*{a4paper} 和 \keyis*-{zihao}{-4} 配合。
+ 页眉尺寸选项将参数交给 \pkg*{geometry} 宏包处理,可使用它支持的所有纸张规格。建议选项 \option*{b5paper} 和 \keyis*-{zihao}{5},选项 \option*{a4paper} 和 \keyis*-{zihao}{-4} 配合。
\keyval-{config}{配置文件名}
- \option{config} 为载入用户配置选项,配置文件名不需加括号但需带有后缀名如 \code{tex}、\code{def} 和 \code{cfg}。
+ 选项 \option{config} 载入用户配置文件,最好放在当前路径且需带有文件扩展名如 \code{tex}、\code{def} 和 \code{cfg}。
\keybool{floatpage}\Default{true}
开启这个选项后浮动环境 \env*{table} 和 \env*{figure} 的比例参数会使用默认值,关闭它则尽可能避免出现浮动页,使图表环境与正文段落更加紧凑,减少多余的空白版面。
\end{options}
@@ -190,15 +190,15 @@
\begin{options}
\keychoice{cjkfont}{adobe,fandol,founder,mac,macnew,macold,ubuntu,windows,none}\Default
中文字体采用 C\TeX 宏集包含的字库并与其一致,具体配置方案可以查看 C\TeX 使用手册。它与 \option*{fontset} 选项是等效的,如果没有指定 \option{cjkfont} 的值,将会自动检测操作系统并选择相应的字体。
-\end{options}
-如果需要使用其它中文字体,可以在启用选项 \keyis-{cjkfont}{none} 后,再使用 \pkg*{xeCJK} 宏包的相关命令设置字体以及声明字体族:
-\begin{ctexexam}
+ 如果需要使用其它中文字体,可以在启用选项 \keyis-{cjkfont}{none} 后,再使用 \pkg*{xeCJK} 宏包的相关命令设置字体以及声明字体族:
+ \begin{ctexexam}
\setCJKmainfont{SimSun}[BoldFont = SimHei,ItalicFont = KaiTi]
\setCJKsansfont{SimHei}
\setCJKmonofont{FangSong}
\newCJKfontfamily[song]\songti{SimSun}
-\end{ctexexam}
+ \end{ctexexam}
+\end{options}
\subsection{英文字体}
\begin{options}
@@ -207,7 +207,7 @@
\begin{center}
\begin{tabular}{cccc}
\toprule
- & \sffamily{正文字体} & \sffamily{无衬线字体} & \sffamily{等宽字体} \\
+ & \textsf{正文字体} & \textsf{无衬线字体} & \textsf{等宽字体} \\
\midrule[0.6pt]
\code{noto} & Noto Serif & Noto Sans & Noto Sans Mono \\
\code{garamond} & EB Garamond & Libertinus Sans & LM Mono \\
@@ -237,12 +237,12 @@
\command{frontmatter}[\sarg\oarg{编号格式}]\Default{Roman}
前言区命令,使部分和章标题不编号,带有星号的变体命令不使用 \cs{cleardoublepage} 命令。页码 \meta{编号格式} 可设置为例如 \code{roman}、\code{Alph} 等格式。
\command{mainmatter}[\sarg]
- 文区命令,章标题正常编号且页码为从 1 开始计数的阿拉伯数字,带有星号的变体命令不使用 \cs{cleardoublepage} 清双页命令。
+ 主文区命令,章标题正常编号且页码为从 1 开始计数的阿拉伯数字,带有星号的变体命令不使用 \cs{cleardoublepage} 清双页命令。
\command{backmatter} 后记区命令,页码格式与编号保持不变,章标题不编号。
\command{cleardoublepage}[\oarg{页面风格}]\Default{empty}
清双页命令可以确保下一页文本总在奇数页开始,在奇数页使用它会产生空白偶数页。文区命令 \cs{frontmatter} 和 \cs{mainmatter} 会用到清双页命令,在启用文类选项 \option*{openright} 时标题命令 \cs*{part} 和 \cs*{chapter} 也会用到清双页命令。
\command{blankpagestyle}[\marg{页面风格}]
- 空白页面风格命令全局指定多出空白页的默认页面风格,或使用可选参数局部指定。默认的风格为 \code{empty},即空的页眉页脚。
+ 多出空白页的默认页面风格用空白页面风格命令 \cs{blankpagestyle} 全局指定,或使用可选参数局部指定。默认的风格为 \code{empty},即空的页眉页脚。
\end{commands}
\subsection{目录命令}
@@ -250,11 +250,11 @@
\command{tableofcontents}[\parg\oarg{键值列表}\darg{附加代码}]
主文档目录命令。带有 \parg{} 号参数的命令输出双语目录,需要与双语目录标题命令 \cs{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入目录样式和换页等命令
\command{listoffigures}[\sarg\parg\oarg{键值列表}]
- 输出图片目录命令。带有星号的目录命令不将标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。
+ 输出图片目录命令。带有星号的目录命令不将目录标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。
\command{listoftables}[\sarg\parg\oarg{键值列表}]
- 输出表格目录命令。带有星号的目录命令不将标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。
+ 输出表格目录命令。带有星号的目录命令不将目录标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。
\command{listoflstlistings}[\sarg\parg\oarg{键值列表}]
- 输出代码目录命令。带有星号的目录命令不将标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。以上命令可选参数的 \meta{键值列表} 如下:
+ 输出代码目录命令。带有星号的目录命令不将目录标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。以上命令可选参数的 \meta{键值列表} 如下:
\end{commands}
\begin{options}
@@ -277,7 +277,6 @@
\end{options}
\subsection{标题命令}
-\change[2021-06-13]{2021-05-05}
双语目录标题命令目前设置了常用的三个级别,它们将中文标题正常输出,并使中英文标题加入双语目录。类似于标准文档类,这三个标题命令分别具有独立的计数器\footnote{默认情况下与普通标题命令共享使用计数器。},并对应 \cs*{the}\meta{计数器} 的值,可以用于 \option{binumber} 选项更改英文目录中的编号。这个功能是为国内一些高校的学位论文模板的要求设计,在一般情况和英文模式下\textbf{不需要使用}。
\begin{commands}
\command{bichapter}[\sarg\oarg{目录中文标题}\marg{中文标题}\marg{目录英文标题}]
@@ -288,17 +287,16 @@
\code{subsection} 级别的双语目录标题命令,具有独立的 \code{bisubsection} 计数器。
\end{commands}
-它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录的格式是一致的,共享使用 \cs*{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下:
+它们的星号变体命令使文中标题不编号,但是仍然加入双语目录,若英文标题参数空置那么仅加入中文目录而不加入英文目录,这一特点与 \cs{chapter*} 等命令的行为不太一样,在一些情况下会用到。可选参数是目录中的中文标题,默认与中文标题一致,正文标题过长时可用它设置在目录中显示的标题。默认情况下双语目录的格式是一致的,共享使用 \module*{tocset} 的设置,英文目录的章级别标题名及编号的修改方式如下:
\begin{options}
\kvsplit{biname}{英文目录前名字,英文目录后名字}\Module{chapter}\Default{Chapter\cs*{space}}
更改英文目录 \code{chapter} 级别的标题编号前后名字,类似 C\TeX 的 \option*{name} 选项。
\keyval-{binmuber}{英文目录数字输出命令}\Module{chapter}\Default{\cs*{arabic}\Marg{chapter}}
- 更改英文目录 \code{chapter} 级别的标题编号输出格式,类似 C\TeX 的 \option*{nuber} 选项。
+ 更改英文目录 \code{chapter} 级别的标题编号输出格式,类似 C\TeX 的 \option*{number} 选项。
\end{options}
\begin{commands}
\command{appendix}[\splitoarg{前名字,后名字}\darg{数字输出命令}]
- \change[2021-06-13]{2021-05-05}
附录开始命令,其后的章节标题变为附录形式。英文目录中附录标题的 \meta{前名字} 为英文附录目录前名字,\meta{后名字} 为英文附录目录后名字。前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。\meta{数字输出命令} 为附录标题在英文目录中的编号命令。
\command{BeforeAddBitoc}[\sarg\marg{加入目录英文标题前的代码}]
作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \cs{bichapter} 等命令前生效。
@@ -312,7 +310,7 @@
\command{sub}[\sarg\oarg{垂直偏移}\splitoarg{高度,深度}\darg{格式代码}\marg{内容}\oarg{水平偏移}]
下标命令,与简短命令 \cs{sp} 等效。水平和垂直偏移为正值时代表向下或向右移动,否则相反。其它用法和参数与上标命令 \cs{super} 类似。
\command{supersub}[\sarg\oarg{间距}\darg{对齐方式}\marg{上标内容}\marg{下标内容}\oarg{水平偏移}\splitdarg{上标代码,下标代码}]
- 同时输出上标和下标的命令。\meta{间距} 为上下标的垂直间距,\meta{对齐方式} 是下标的水平对齐方式,参数与 \option{supersubalign} 相同,\meta{水平偏移} 默认为 \code{0pt}。
+ 同时输出上标和下标的命令,与简短命令 \cs{spb} 等效。\meta{间距} 为上下标的垂直间距,\meta{对齐方式} 是下标的水平对齐方式,参数与 \module*{style/}\option{supersubalign} 相同,\meta{水平偏移} 默认为 \code{0pt}。
\end{commands}
\section{接口选项}
@@ -324,31 +322,46 @@
\begin{tabular}{*{5}{c}}
\toprule
\hyperref[subsec:style]{风格} & \hyperref[subsec:other font]{其它字体} & \hyperref[subsec:spacing]{行距} & \hyperref[subsec:hyperlinks]{超链接} & \hyperref[subsec:reference]{参考文献} \\
- style & subfont & spread & refset & bibset \\
+ \module*{style} & \module*{subfont} & \module*{spread} & \module*{refset} & \module*{bibset} \\
\midrule[0.6pt]
\hyperref[subsec:theorem of style]{定理样式} & \hyperref[subsec:page margins]{页面尺寸} & \hyperref[subsec:header and footer]{页眉页脚} & \hyperref[subsec:catalog style]{目录样式} & \\
- thmset & geoset & hdrset & tocset & \\
+ \module*{thmset} & \module*{geoset} & \module*{hdrset} & \module*{tocset} & \\
\bottomrule
\end{tabular}
\end{center}
+
+ 例如使用下面小节 \ref{subsec:style} 介绍的风格 \module*{style} 模块,路径名与所属下级选项之间可以 \code{/} 或 \code{=} 号分开,符号后不能有空格或者换行:
+ \begin{ctexexam}
+ \ctexset
+ {
+ style/color = seaside,
+ style =
+ {
+ rulewidth = 0.5pt,
+ uppercase = false
+ }
+ }
+ \style{figure-con = {-}}
+ \end{ctexexam}
+
+ 文档类有三种选项:布尔型 \boolkey*{key},选项的值为 \code{true} 或 \code{false},如果不指定默认为真。键值型 \key*-{key}{value} 需要为选项指定值,后面 \code{=} 号不能省略。选择型 \choicekey*{key}{one,\default{two},three} 根据提供的可选值进行设定。
\end{commands}
\subsection{风格}
\label{subsec:style}
\begin{options}
\keychoice{color}{none,seaside,energy,cyberpunk}\Module{style}\Default{none}
- \change[2021-07-03]{2021-01-05}
- 预置了四种主题颜色,默认主题 \code{none} 为黑白页面,主题颜色不包括超链接。
+ 预置了四种颜色主题,默认主题 \code{none} 为黑白页面,颜色主题不包括超链接。
\begin{commands}
\command{DeclareThemeColor}[\splitmarg{风格名称,ctex@frame,ctex@emph,ctex@verb}]
- 可以使用 \cs{DeclareThemeColor} 命令声明新的主题颜色,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 HTML 颜色代码,构成主题颜色。类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。
+ 可以使用 \cs{DeclareThemeColor} 命令声明新的颜色主题,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 \code{HTML} 颜色代码,构成颜色主题。类似地更改超链接颜色见小节 \ref{subsec:hyperlinks}。
\end{commands}
\keyval-{color-all}{HTML颜色代码}\Default
- 统一设置主题的各部分颜色,参数是 6 个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。
+ 统一设置主题的各部分颜色,参数是 6 个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。
\keybool{multoc}\Default{false}
开启多栏目录,与节 \ref{sec:document command} 中目录命令的同名选项有相同效果。
\keybool{withpart}\Default{false}
- 使章跟随每一部分编号,默认不跟随。
+ 使章标题跟随每一部分编号,开启新的一部分时章编号从 1 开始,默认不跟随。
\keychoice{footwith}{part,chapter,page}\Default{chapter}
使脚注跟随编号的计数器,默认跟随章,当开启新的一章时脚注编号从 1 开始。
\keyval-{rulewidth}{线宽}\Default{0.75pt}
@@ -362,7 +375,6 @@
\subsubsection{连接符}
\begin{options}
\keyval-{figure-con}{图片连接符}\Module{style}\Default{\Marg{.}}
- \change[2021-07-02]{2021-01-05}
设置图片题注编号的连接符。
\keyval-{table-con}{表格连接符}\Default{\Marg{.}}
设置表格题注编号的连接符。
@@ -401,19 +413,18 @@
\subsection{超链接}
\label{subsec:hyperlinks}
-\module*{refset} 将超链接选项(包括以上选项)交给 \pkg*{hyperref} 处理,除了一些关于 pdf 书签的选项可能会失效,其它由键值选项命令 \cs*{hypersetup} 支持的多数选项可用。
+\module*{refset} 将超链接选项(包括以上选项)交给 \pkg*{hyperref} 处理,除了一些关于 \code{pdf} 书签的选项可能会失效,其它由键值选项命令 \cs*{hypersetup} 支持的多数选项可用。
\begin{options}
\keychoice{linktype}{edge,colors,none}\Module{refset}\Default{edge}
- \change[2021-07-03]{2021-01-05}
使超链接为边框形式,\option{various} 使超链接变为彩色,预置了四种颜色样式。\code{none} 关闭超链接边框与颜色,此时 \option{linkcolor} 选项无效。
\keychoice{linkcolor}{fresh,cutepink,navyblue,crimson}\Default{navyblue}
超链接颜色样式,预置了四种超链接颜色风格。
\begin{commands}
\command{DeclareLinkColor}[\splitmarg{风格名称,ctex@link,ctex@url,ctex@cite}]
- 可以使用 \cs{DeclareLinkColor} 命令声明新的超链接颜色样式,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 HTML 颜色代码,构成超链接颜色。
+ 可以使用 \cs{DeclareLinkColor} 命令声明新的超链接颜色样式,它的参数以英文逗号分隔,第一部分为颜色风格名称,后面三部分为 \code{HTML} 颜色代码,构成超链接颜色。
\end{commands}
\keyval-{linkcol-all}{HTML颜色代码}\Default
- 统一设置超链接的各部分颜色,参数是 6 个十六进制数字组成的 HTML 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。
+ 统一设置超链接的各部分颜色,参数是 6 个十六进制数字组成的 \code{HTML} 颜色代码,任意颜色的代码可以在常见的图片处理工具拾色器中查看。
\keychoice{linktoc}{none,section,page,all}\Default{all}
将目录中的超链接取消、置于标题上、置于页码上或置于标题和页码上。
\end{options}
@@ -423,7 +434,6 @@
行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。各行距既可在导言区全局设置也可正文中设置对后面生效。
\begin{options}
\keyval-{line}{数值}\Module{spread}\Default{1.3}
- \change[2021-05-17]{2021-01-05}
正文行距,C\TeX 原有的行距选项 \option*{linespread} 失效。
\keyval-{table}{数值}\Default{1.05}
表格行距,对传统表格环境 \env*{tabular}、\env*{tabularx} 以及 \pkg*{tabularray} 宏包的 \env{tblr} 环境生效,同时 \env{tblr} 也自带有 \option*{stretch} 选项设置行距。
@@ -445,7 +455,6 @@
\label{subsec:other font}
\begin{options}
\keyval-{table-cap}{字体命令}\Module{subfont}\Default{\cs*{sffamily}\cs*{small}}
- \change[2021-05-19]{2021-01-08}
表格标题的字体设置,包括字体族、字体系列、字体尺寸和字体形状命令。
\keyval-{figure-cap}{字体命令}\Default{\cs*{sffamily}\cs*{small}}
图片标题的字体设置,包括字体族、字体系列、字体尺寸和字体形状命令。
@@ -463,7 +472,6 @@
\label{subsec:reference}
\begin{options}
\keychoice{backend}{bibtex,biblatex}\Module{bibset}\Default{bibtex}
- \change[2021-06-13]{2021-01-11}
参考文献处理后端,默认用传统的 \hologo{BibTeX} 处理参考文献\footnote{使用 \hologo{BibTeX} 引擎时加载 \pkg*{natbib} 宏包,使用 \hologo{biber} 时将加载 \pkg*{biblatex} 宏包。}。
\keychoice{bib-style}{numerical,authoryear,其它格式}\Default{numerical}
参考文献格式为中国的参考文献推荐标准 GB/T 7714-2015,有顺序编码制和著者-出版年制两种风格,理工科类一般使用顺序编码制,文科类一般使用著者-出版年制。若使用其它格式,使用 \hologo{BibTeX} 处理时需确保正确的 \code{bst} 文件,使用 \hologo{biber} 处理可使用 \pkg*{biblatex} 宏包支持的参考文献风格名称。
@@ -476,11 +484,8 @@
\subsubsection{配置参考文献}
\begin{commands}
\command{printbibliography}[\oarg{键值列表}]
- \change[2021-04-09]{2021-01-11}
两种方式\textbf{均使用}此命令打印参考文献,不同处理后端此命令的 \meta{键值列表} 不同。使用 \hologo{BibTeX} 处理时选项与节 \ref{sec:document command} 目录的选项相同,使用 \hologo{biber} 处理时常用的选项如下:
-\end{commands}
-
-\begin{options}
+ \begin{options}
\keychoice*{heading}{bibliography,subbibliography,bibintoc,subbibintoc}\Default{bibintoc}
参考文献通常有一个章标题或者节标题,该选项选择由 \cs*{defbibheading} 定义的标题名。
\keyval*-{title}{参考文献标题名}\Default
@@ -493,7 +498,8 @@
指定条目的打印类型。
\keyval*-{filter}{过滤器名}\Default
使用由 \cs*{defbibfilter} 定义的 \option*{filter} 来过滤条目。
-\end{options}
+ \end{options}
+\end{commands}
可能一些情况下您希望更加灵活地设置参考文献或有更多需求,下面举一个在导言区手动配置 \pkg*{biblatex} 宏包的例子:
\begin{ctexexam}
@@ -507,12 +513,11 @@
\label{subsec:theorem of style}
\begin{options}
\keybool{thmbox}\Module{thmset}\Default{false}
- \change[2021-07-01]{2021-01-12}
开启定理环境盒子的边框,需载入 \pkg*{tcolorbox} 宏包才生效。这个选项与 \pkg*{thmtools} 中并不一致,\pkg*{thmtools} 的同名选项包括 \code{L}、\code{M} 和 \code{S} 三个参数。
\keychoice{within}{chapter,section,其它环境,空置}\Default{chapter}
- 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器。
+ 定理编号跟随的计数器,默认跟随章的编号,也可以跟随其它定理环境的编号,当计数器增加时定理编号会从零开始,空置时不跟随其它计数器编号。
\keyval-{headpunct}{字体命令}\Default{false}
- 定理标题末尾后的标记,在换行符或第一段内容的间隔之前。
+ 定理标题末尾后的标记,在换行符或与第一段内容的间隔之前。
\keyval-{bodyfont}{字体命令}\Default{chapter}
定理内容部分的字体,包括字体族、字体系列、字体尺寸和字体形状命令。
\keyval-{notefont}{字体命令}\Default
@@ -537,37 +542,36 @@
文档类已预置 8 个定理环境,环境名及对应的定理标题名见小节 \ref{subsec:theorem},如果需要新的定理标题名或定理样式可使用这三个命令,由 \pkg*{thmtools} 提供支持。
\begin{commands}
\command{declaretheorem}[\oarg{键值列表1}\marg{定理环境名}\oarg{键值列表2}]
- \change[2021-07-13]{2021-01-12}
- 定义新的定理类环境,\cs{newtheorem} 命令与它等效。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。\meta{键值列表} 中常用的选项如下:
+ 声明新的定理环境命令,\cs{newtheorem} 命令与它等效。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。\meta{键值列表} 中常用的选项如下:
\begin{options}
- \keyval*-{name}{定理环境标题}
+ \keyval*-{name}{定理环境标题}\Default
定理标题的默认值是环境的名称,并且首字母大写(英文标题)。
- \keychoice*{numbered}{no,yes,unless unique}
+ \keychoice*{numbered}{no,yes,unless unique}\Default
定理可以被编号、不被编号或者只有在文档中多次出现时才被编号。
- \keyval*-{numberlike}{定理环境名}
+ \keyval*-{numberlike}{定理环境名}\Default
定理将使用此计数器进行编号,通常这是另一个定理环境的名称。
- \keyval*-{style}{定理样式名}
- 用 \cs{declaretheoremstyle} 定义的定理样式的名称,定理将使用这种样式的设置。
+ \keyval*-{style}{定理样式名}\Default
+ 选项的值为 \cs{declaretheoremstyle} 新定义的 \meta{定理样式名} 或预置的 \code{easy-theorem} 定理样式,定理将使用这种样式的设置。
\end{options}
- \command{DeclareTheorem}[\marg{定理环境名}\oarg{英文标题}\marg{中文标题}\darg{盒子样式}\oarg{键值列表}]
- \cs{DeclareTheorem} 是更便捷的定理命令,它定义一个新的定理环境,与 \cs{declaretheorem} 命令 \meta{键值列表} 支持的选项相同,但它们的区别有:
+ \command{DeclareTheorem}[\marg{环境名}\oarg{英文标题}\marg{中文标题}\darg{盒子风格}\oarg{键值列表}]
+ 定理声明命令 \cs{DeclareTheorem} 更加便捷,它定义一个新的定理环境,与 \cs{declaretheorem} 命令 \meta{键值列表} 支持的选项相同,但它们的区别有:
\begin{itemize}
- \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的环境名。
- \item 自动定义交叉引用的格式,引用标签前缀为定理名称。
- \item 定理盒子选项 \option{thmbox} 仍然生效,盒子样式选项是用于设置定理盒子样式的名称,它需要 \pkg*{tcolorbox} 的 \cs*{tcbset} 接口命令或 \cs{tcbappstyle} 设定,默认为 \code{tc-theorem}。
+ \item 中英文模式下标题不同,英文标题为可选项,默认为首字母大写的 \meta{环境名}。
+ \item 自动定义交叉引用的格式,引用标签前缀为定理标题名称。
+ \item 定理盒子选项 \keyis-{thmbox}{true} 仍然生效,此时 \meta{盒子风格} 用于设置定理盒子风格的名称,它需要 \pkg*{tcolorbox} 的 \cs*{tcbset} 接口命令或 \cs{tcbappstyle} 设定,默认为 \code{tc-theorem}。
\item 默认使用 \code{easy-theorem} 定理样式,可在最后一个选项使用 \option*{style} 更改样式。
\end{itemize}
\command{declaretheoremstyle}[\oarg{键值列表1}\marg{定理样式名}\oarg{键值列表2}]
定义新的定理样式,\meta{键值列表} 中包括上述定理样式以及 \cs{declaretheorem} 的所有选项。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与它们的同名命令一致。
\end{commands}
-下面简单列举定理命令的用法,预置定理的样式为 \code{easy-theorem},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样:
+下面简单列举定理命令的用法,预置定理的样式为 \code{easy-theorem},上述定理样式选项将仅对这个定理样式生效。如果使用这个样式增加新的定理环境可以这样:
\begin{ctexexam}
\DeclareTheorem{定理环境名}{中文标题}[style = easy-theorem]
\declaretheorem[style = easy-theorem,name = 定理名]{定理环境名}
\end{ctexexam}
-\cs{declaretheorem} 定义的定理环境需要手动增加盒子边框:
+命令 \cs{declaretheorem} 定义的定理环境需要手动增加盒子边框:
\begin{ctexexam}
\tcolorboxenvironment{定理环境名}{tc-theorem}
\end{ctexexam}
@@ -588,7 +592,6 @@
\begin{options}\noitemsep
\keyval-{headruleskip}{页眉线间距}\Module{geoset}\Default*
\keyval-{footruleskip}{页脚线间距}\Default*
- \change[2021-06-02]{2021-01-13}
\keyval*-{left}{页面左边距}\Default*{3.17cm}
\keyval*-{top}{页面上边距}\Default*{2.54cm}
\keyval*-{hmargin}{左边距,右边距}\Default*
@@ -609,30 +612,29 @@
\subsection{页眉页脚}
\label{subsec:header and footer}
-\module*{hdrset} 设置的命令由 \pkg*{fancyhdr} 宏包提供支持。在 \cls*{book} 模式时使用章节页眉标志内容选项 \option{chap-mark} 和 \option{sec-mark},在 \cls*{article} 模式时使用 \option{sec-mark} 和 \option{subsec-mark} 选项,这与标准文档类的行为一致,标志内容中参数 \code{\#1} 代表当前章、节或小节的标题。也可以直接重新定义这些标志命令,但此时 \module*{style/}\option{uppercase} 选项失效,这时可以用例如 \cs*{MakeUppercase} 命令来设置标志内容的大小写。
+模块 \module*{hdrset} 设置的命令由 \pkg*{fancyhdr} 宏包提供支持。在 \cls*{book} 模式时使用章节页眉标志内容选项 \option{chap-mark} 和 \option{sec-mark},在 \cls*{article} 模式时使用 \option{sec-mark} 和 \option{subsec-mark} 选项,这与标准文档类的行为一致,标志内容中参数 \code{\#1} 代表当前章、节或小节的标题。也可以直接重新定义这些选项对应的标题标记命令,但此时 \module*{style/}\option{uppercase} 选项失效,这时可以用例如 \cs*{MakeUppercase} 命令来设置标志内容的大小写。
\begin{options}
\keyval-{head-foot}{页眉页脚代码}\Module{hdrset}
- \change[2021-06-14]{2021-01-13}
设置页眉页脚的格式,使用 \pkg*{fancyhdr} 支持的 \cs*{fancyhead} 和 \cs*{fancyhead} 等命令,或在正文中使用这些命令改变其后的页面风格。
\keyval-{chap-mark}{标题标记}
- \cs*{chaptermark} 标题标记命令的内容,包括了标签选项 \option{chap-label} 的内容。
+ 标题标记命令 \cs*{chaptermark} 的内容,包括了标签选项 \option{chap-label} 的内容。
\keyval-{sec-mark}{标题标记}
- \cs*{sectionmark} 标题标记命令的内容,包括了标签选项 \option{sec-label} 的内容。
+ 标题标记命令 \cs*{sectionmark} 的内容,包括了标签选项 \option{sec-label} 的内容。
\keyval-{subsec-mark}{标题标记}
- \cs*{subsectionmark} 标题标记命令的内容,包括了标签选项 \option{subsec-label} 的内容。
+ 标题标记命令 \cs*{subsectionmark} 的内容,包括了标签选项 \option{subsec-label} 的内容。
\kvsplit-{chap-label}{\oarg{编号}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}}
- \cs*{chaptermark} 标题标记命令内容的标签,比标记命令内容选项更常用,可选参数是页眉的标题编号形式,必选参数是编号与标题之间的距离命令:
+ 标题标记命令 \cs*{chaptermark} 内容的标签,比标记命令内容选项更常用,可选参数是页眉的标题编号形式,必选参数是编号与标题之间的距离命令:
\begin{ctexexam}
\hdrset
{
chap-label = [\thechapter]{\hspace{1em}},
- sec-mark = C\TeXifname{C\TeXthesection——}{}#1
+ sec-mark = \CTEXifname{\CTEXthesection——}{}#1
}
\end{ctexexam}
\kvsplit-{sec-label}{\oarg{编号}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}}
- \cs*{sectionmark} 标题标记命令内容的标签,用法与 \option{chap-label} 类似。
+ 标题标记命令 \cs*{sectionmark} 内容的标签,用法与 \option{chap-label} 类似。
\kvsplit-{subsec-label}{\oarg{编号}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}}
- \cs*{subsectionmark} 标题标记命令内容的标签,用法与 \option{chap-label} 类似。
+ 标题标记命令内容 \cs*{subsectionmark} 的标签,用法与 \option{chap-label} 类似。
\keyval-{headrule}{横线命令}
绘制页眉横线的选项,可以使用 \cs*{hrule}、\cs*{rule} 或下述 \cs{markrule} 等画线命令来绘制横线。手动绘制横线时线条粗细选项 \code{style/rulewidth} 会失效。
\keyval-{footrule}{横线命令}\Default
@@ -643,7 +645,6 @@
\begin{commands}\noitemsep
\command{easyhead}[\oarg{位置}\marg{内容}]\default{}
- \change[2021-07-25]{2021-01-13}
\command{easyfoot}[\oarg{位置}\marg{内容}]
命令 \cs{easyhead} 和 \cs{easyfoot} 的使用方法与 \cs{fancyhead} 和 \cs{fancyfoot} 完全相同,它们需要在 \option{head-foot} 选项中使用,设置的是一个名为 \code{fancy} 的页面风格。\pkg*{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共 12 个部分,可选参数中 \code{E} 和 \code{O} 代表偶数和奇数,\code{L}、\code{C} 和 \code{R} 代表左、中和右部分。单面打印时,含有偶数位置的命令无效。
\end{commands}
@@ -651,12 +652,12 @@
\begin{commands}\noitemsep
\command*{markboth}[\marg{左页页眉内容}\marg{右页页眉内容}]\default{}
\command*{markright}[\marg{右页页眉内容}]
- \cs*{markboth} 和 \cs*{markright} 这两个命令用于手动设置页眉内容,一般紧随标题命令,特殊情况下可以使用它们得到需要的页眉标志。上述标志命令内容的选项便是基于这两个命令。如果是单面排版,则 \meta{左页页眉内容} 无效。
+ 命令 \cs*{markboth} 和 \cs*{markright} 用于手动设置当前页页眉标记,一般紧随标题命令,特殊情况下可以使用它们得到需要的页眉标志。上述标记命令内容的选项便是基于这两个命令。如果是单面打印,则 \meta{左页页眉内容} 无效。
\end{commands}
\begin{commands}
\command{markrule}[\oarg{长度}\darg{颜色名}\marg{线宽}\spemcoarg{上间距,下间距}]
- 命令 \cs{markrule} 用于绘制页眉页脚横线,\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用 \code{!} 号分开,若只有一部分则表示 \meta{上间距},这个命令也可以在正文中绘制横线。下面举一个设置页眉内容的例子:
+ 命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用 \code{!} 号分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子:
\begin{ctexexam}
\hdrset
{
@@ -674,7 +675,6 @@
\subsubsection{脚注格式}
\begin{options}
\keyval-{fnmargin}{刚性长度}\Module{hdrset}\Default{0.75em}
- \change[2021-07-14]{2021-05-12}\
脚注首段缩进距离,等于长度 \cs{footnoteindent} 的值.
\keyval-{fnparskip}{弹性长度}\Default{0ex}
脚注段落间距,等于长度 \cs{footparskip} 的值。
@@ -688,39 +688,47 @@
\end{ctexexam}
\keychoice{fnmark-pos}{normal,super}\Default{super}
设置脚注编号的位置,正常文本或是上标形式。
- \keychoice{fnmark-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*}\Default{plain}
- 脚注编号的格式,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。
- \keyval-{fnmark-form}{格式代码}\Default{格式代码}
+ \keychoice{fnmark-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*,短编号}\Default{plain}
+ 脚注正文标记编号的格式,默认为原生样式 \code{plain},还可以改为 \code{pifont} 的各个版本,从左往右依次为普通版、阴文衬线版、阳文无衬线版和阴文无衬线版,缺点是它们的编号仅包括 1-10。
+
+ 短编号的形式与列表环境类似,不过增加了一个中文数字格式参数 \code{c}。原生样式 \code{plain} 等同于单独使用数字 \code{1} 参数。这个选项可以用在正文中改变其后脚注编号格式。
+ \begin{ctexexam}
+ \hdrset{fnmark-num = 1} % 等于编号格式plain
+ \hdrset{fnmark-num = (a)}
+ \end{ctexexam}
+ \keychoice{fntext-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*,短编号}\Default{plain}
+ 脚注内容标记编号的格式,用法与 \option{fnmark-num} 一样,所以脚注内容与正文标记编号格式\textbf{可以不同}。
+ \keychoice{fnboth-num}{plain,pifont,pifont*,pifont-sans,pifont-sans*,短编号}\Default{plain}
+ 同时设定脚注正文标记编号 \option{fnmark-num} 与脚注内容标记编号 \option{fntext-num} 的格式。目前脚注编号格式选项对于迷你页环境 \env*{minipage} 无效,其中的脚注保持默认英文字母的编号形式。
+ \keyval-{fnmark-form}{格式代码}\Default
脚注标记的格式,在此设置字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注标记,一般配合 \keyis-{fnmark-num}{plain} 使用。
- \keyval-{fntext-form}{格式代码}\Default{格式代码}
+ \keyval-{fntext-form}{格式代码}\Default
脚注内容的格式,在此设置字体命令会覆盖 \module*{subfont/}\option{footnote} 的设置,最后一个格式命令可以带有一个参数,这个参数接受脚注内容。
- \keyval-{afterfnmark}{格式代码}\Default{格式代码}
- 脚注标记后的代码,由于脚注标记处于水平盒子中,它一般用于设置标记与文本间的距离。
+ \kvsplit{fnmark-code}{前代码,后代码}\newline
+ 脚注内容标记前后增加代码可以用 \meta{前代码} 与 \meta{后代码},也可以只有前部分,这两部分代码只对页面下方的标记有效。由于脚注标记处于水平模式,一般在脚注类型为 \keyis-{footnotetype}{default} 时在标记与其后脚注段落间插入距离代码,或与正文中的标记稍有不同。
\end{options}
\subsection{目录样式}
\label{subsec:catalog style}
-\module*{tocset} 将目录样式交给 \pkg*{titletoc} 处理,\code{level} 代表 \code{part}、\code{chapter}、\code{section}、\code{subsection}、\code{figure}、\code{table} 和 \code{lstlisting} 级别的目录,而使用 \code{list} 级别可以统一设置图片、表格和代码目录的样式。
+模块 \module*{tocset} 将目录样式交给 \pkg*{titletoc} 处理,\code{level} 代表 \code{part}、\code{chapter}、\code{section}、\code{subsection}、\code{figure}、\code{table} 和 \code{lstlisting} 级别的目录,而使用 \code{list} 级别可以统一设置图片、表格和代码目录的样式。
\begin{options}
\keyval-{format}{目录标题格式}\Module{/(level)}
- \change[2021-05-14]{2021-01-13}
- 目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用无间距重合的 \cs*{addvspace} 命令。
+ 各级别目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。
\keyval-{format+}{目录标题格式}
- 与 \option{format} 用法一样,在已有的格式命令后附加内容。
+ 与 \option{format} 用法一样,只是在已有的格式命令后附加代码。
\keyval-{indent}{刚性长度}
- 目录中的标题左边缩进距离,通常标题级别越低缩进越大。
+ 各级别目录中的标题左边缩进距离,通常标题级别越低缩进越大。
\keyval-{rule}{目录引导线样式}
- \option{rule} 选项中一般应当使用 \cs{tocrule} 命令,将会在接下来介绍。
+ 引导线选项 \option{rule} 中一般应当使用 \cs{tocrule} 命令绘制引导线,将会在接下来介绍。
\keyval-{numsep}{刚性长度}\Default{1em}
- 有编号的标题在目录中编号与标题的间距,默认距离统一为 \code{1em}。
+ 有编号的标题在各级别目录中编号与标题的间距,默认距离统一为 \code{1em}。
\end{options}
\begin{commands}
- \command{tocrule}[\sarg\oarg{引导点间距}\parg{引导点大小}\marg{引导点}\oarg{页码格式}]
- \change[2021-06-11]{2021-01-13}
- \cs{tocrule} 命令生成目录引导线,需要在 \option{rule} 选项中使用。带有星号的命令会使当前级别的目录引导线右边与页码连接而不是对齐。引导点间距需带有长度单位,引导点大小不带单位,为引导点符号正常大小的倍数,引导点一般为英文句号或 \cs*{cdot} 中心点符号。页码格式的内容位于页码前面,可以设置页码字体和距离等,最后一个格式命令可以带有一个参数,这个参数接受页码编号。
+ \command{tocrule}[\sarg\oarg{引导点间距}\darg{引导点大小}\marg{引导点}\oarg{页码格式}]
+ 目录命令 \cs{tocrule} 生成目录引导线,需要在 \meta{目录引导线样式} 中使用。带有星号的命令会使当前级别的目录引导线右边与页码相连而不是对齐。\meta{引导点间距} 需带有长度单位,\meta{引导点大小} 不带单位,为 \meta{引导点} 的放大因子,\meta{引导点} 一般为英文句号或 \cs*{cdot} 中心点符号。\meta{页码格式} 的代码位于页码前面,可以设置页码字体和距离等,最后一个命令可以带有一个参数,这个参数为页码编号。
\command*{CTEXnumberline}[\marg{编号级别}]
- \cs*{CTEXnumberline} 命令用于在 C\TeX 文档类的 \option*{tocline} 选项中设置目录标签的编号,它已经被重新定义,使得目录编号后间距选项 \option{numsep} 仍然有效。\meta{编号级别} 为 \code{chapter} 和 \code{section} 等,也可用参数 \code{\#1} 代替当前级别类型,标题名用参数 \code{\#2} 代替一般不变。
+ 目录命令 \cs*{CTEXnumberline} 用于在 C\TeX 文档类的 \option*{tocline} 选项中设置目录标签的编号,它已经被重新定义,使得目录编号后间距选项 \option{numsep} 仍然有效。\meta{编号级别} 为 \code{chapter} 和 \code{section} 等,也可用参数 \code{\#1} 代替当前级别类型,标题名用参数 \code{\#2} 代替一般不变。
\begin{ctexexam}
\tocset
{
@@ -738,9 +746,8 @@
\keyval-{belowoffset}{长度}\Module{tocset}\Default{-1pc}
主文档目录标题下方的间距补偿,一般为负值,用于抵消 \option{format} 中额外的垂直间距。
\keyval-{belowoffset}{长度}\Module{/(level)}\Default{0pc}
- 与之上面选项的意义类似,代表 \code{figure}、\code{table} 和 \code{lstlisting} 三个级别,也可以使用 \code{list} 统一设置,一般为正值。
+ \code{level} 代表 \code{figure}、\code{table} 和 \code{lstlisting} 三个级别目录标题下方间距补偿,也可以使用 \code{list} 统一设置,一般为正值。这个距离也可以用 C\TeX 标题下方距离选项修改。
\keyval-{lolskip}{长度}\Module{tocset}\Default{0.8pc}
- \change[2021-05-14]{2021-01-13}
代码目录中章之间的代码标题的距离,与 C\TeX 的表格目录和图片目录中章之间的标题距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,它们的值均默认为 \code{0.8pc},在 \cls*{article} 模式中此选项失效。
\keyval-{tocline-fig}{图片目录标签}
图片目录标签,选项参数中 \code{\#1} 代表编号,还可包含标签名称,默认标签名称与图片题注名称一致。
@@ -757,11 +764,11 @@
}
\end{ctexexam}
\keybool{line-align}\Default{true}
- \option{line-align} 选项可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。
+ 引导线选项 \option{line-align} 可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码相连。
\keybool{hang}\Default{false}
- \option{hang} 选项使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。
+ 悬挂缩进选项 \option{hang} 使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。
\keyval-{numsep-all}{刚性长度}\Default{1em}
- 统一设置所有有编号的标题在目录中编号与标题的间距。
+ 统一设置所有级别有编号的标题在目录中编号与标题的间距。
\keyval-{indent-all}{刚性长度}
统一设置所有级别的目录标题左边缩进。
\keyval-{rule-all}{目录引导线样式}
@@ -810,11 +817,12 @@
\environment*{enumerate}[\oarg{键值列表}]\default{}
\environment*{itemize}[\oarg{键值列表}]\default{}
\environment*{description}[\oarg{键值列表}]
- 已为三种列表预置了三个级别,同种列表或不同种列表间的不同级别可相互嵌套,可以使用短编号的形式,带有星号的环境为行内列表。默认列表标签与标准文档类一致,下面举几个更改列表标签以及其它格式的例子:
+ 已为三种列表各自预置了三个级别,同种列表或不同种列表间的不同级别可相互嵌套,可以使用短编号的形式,带有星号的环境为行内列表。默认列表标签与标准文档类一致,下面举几个更改列表标签以及其它格式的例子:
\begin{ctexexam}
\setlist{nosep} % 取消所有列表额外的垂直间距
\begin{enumerate}[label = \arabic*(a),leftmargin = 1cm,resume]
- \begin{itemize}[label = \textbullet]
+ \begin{enumerate}[(1)] % 短编号形式
+ \begin{itemize}[label = \textbullet,labelsep = *]
\begin{description}[font = \sffamily\bfseries,style = nextline]
\end{ctexexam}
\end{environments}
@@ -834,7 +842,7 @@
\begin{center}
\begin{tabular}{*{8}{c}}
\toprule
- theorem & definition & lemma & corollary & proposition & example & remark & proof \\
+ \env{theorem} & \env{definition} & \env{lemma} & \env{corollary} & \env{proposition} & \env{example} & \env{remark} & \env{proof} \\
定理 & 定义 & 引理 & 推论& 性质 & 例 & 注 & 证明 \\
\bottomrule
\end{tabular}
@@ -842,11 +850,11 @@
\end{environments}
\subsection{悬挂缩进}
-\change{2021-07-11}
\begin{commands}
\command{hangpara}[\marg{缩进长度}\marg{缩进开始行数}]
悬挂缩进命令 \cs{hangpara} 使其后的一个段落保持悬挂缩进,参数与 \env{hangparas} 环境相同,不过只有一个段落。
\end{commands}
+
\begin{environments}
\environment{hangparas}[\marg{缩进长度}\marg{缩进开始行数}]
悬挂缩进环境 \env{hangparas} 有两个必选参数,使其中的段落均保持悬挂缩进。每个段落的缩进将以 \meta{缩进长度} 从 \meta{缩进开始行数} 开始。
@@ -858,21 +866,22 @@
\command{lstinline}[\oarg{键值列表}\marg{行内代码}]
行内代码抄录命令,较 \cs*{verb} 命令有较大改进,具有代码语言和样式支持。
\end{commands}
+
\begin{environments}
\environment{lstlisting}[\oarg{键值列表}]
行间代码抄录环境,支持多种语言库,默认使用 \code{LaTeX} 代码语言,使用可选参数局部设置代码格式。
\end{environments}
+
\begin{options}\noitemsep
\keyval-{lstlistlistingname}{代码目录标题名}\default{}
\keyval-{lstlistingname}{代码题注标题名}
- \option*{lstlistlistingname} 和 \option*{lstlistingname} 分别是代码目录名与代码环境题注名,与 C\TeX 使用手册标题汉化一节类似,可使用 \cs*{ctexset} 接口命令直接修改。
+ 代码目录名与代码环境题注名选项 \option*{lstlistlistingname} 和 \option*{lstlistingname} 用法与 C\TeX 使用手册标题汉化一节类似,可以看作对这节的扩展。
\end{options}
\subsection{习题}
\label{subsec:exercise}
\begin{environments}
\environment{exercise}[\sarg\parg\oarg{键值列表1}\darg{键值列表2}\oarg{键值列表3}]
- \change[2021-07-25]{2021-01-05}
习题环境的标题使用 \cs*{tcbox} 行内盒子包装样式,内容则使用 \env{enumerate} 列表环境。它有 5 个可选参数,应当注意用法。当使用星号参数时标题不进行编号,使用 \parg{} 号参数时不使用预置标题,此时 \meta{键值列表1} 除了 \option{label} 选项失效。\par
\meta{键值列表2} 包括 \pkg*{tcolorbox} 的盒子样式选项,例如 \option*{boxsep} 和 \option*{fontupper} 等,也可以使用下述 \option{tcolorbox} 选项。在这里可以使用 \cs{tcbappstyle} 命令设置标题选项 \meta{键值列表2} 的值,第一个参数为 \code{exercise}。
@@ -889,14 +898,14 @@
\begin{commands}
\command{setexercise}[\marg{键值列表1}]
- \cs{setexercise} 命令用于全局设置上述习题环境 \env{exercise} 标题样式可选参数中 \meta{键值列表1} 的默认值,包含的选项如下:
+ 配置命令 \cs{setexercise} 用于全局设置上述习题环境 \env{exercise} 标题样式可选参数中 \meta{键值列表1} 的默认值,包含的选项如下:
\begin{options}
\keyval-{color}{标题背景颜色名}\Default{DeepSkyBlue}
习题标题盒子背景颜色,可以使用 \pkg*{xcolor} 自定义颜色或使用色库。
\keyval-{title}{环境标题}\Default{习题}
习题的标题,可以匹配中英文模式,习题环境使用 \parg{} 参数时无效。
\keyval-{number}{习题编号格式}\Default{\Marg{1.}}
- 标题编号输出选项 \option{number} 为短编号形式,应当包含 A、a、I、i、或 1 其中一个符号。
+ 标题编号输出选项 \option{number} 为短编号形式,应当包含 \code{A}、\code{a}、\code{I}、\code{i}、或 \code{1} 其中一个符号。
\keyval-{numsep}{编号与标题的间距}\Default{0.5em}
习题标题编号与后方标题文本的间距,习题环境使用星号参数时无效。
\keyval-{tcolorbox}{键值列表2}
@@ -912,7 +921,7 @@
\command{exerprologue}[\marg{序言内容}]
序言命令 \cs{exerprologue} 在习题环境开始前插入一段内容,可以是文本或者代码,需要在每一个习题环境前使用。
\command{tcphantomifname}[\marg{编号代码}\marg{不编号代码}]
- \cs{tcphantomifname} 根据使用 \pkg*{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码,比如使用 \cs*{addcontentsline} 命令将习题标题加入目录。
+ 命令 \cs{tcphantomifname} 根据使用 \pkg*{tcolorbox} 生成的习题标题是否编号,在超链接锚点的位置加入代码,比如使用 \cs*{addcontentsline} 命令将习题标题加入目录。
\end{commands}
\subsection{盒子}
@@ -921,7 +930,6 @@
\begin{commands}
\command{tcbappstyle}[\sarg\marg{风格名称}\marg{键值列表}]
- \change{2021-07-25}
这是一个 \pkg*{tcolorbox} 宏包盒子风格定义命令,带有星号的命令可以\textbf{新建或重置}一个名为 \code{tc-}\meta{风格名称} 的盒子风格,否则是修改\textbf{已存在}的风格。这个命令可以调整以下即将介绍的预置盒子风格,对于预置盒子来说参数 \meta{风格名称} 即为它们对应的环境或命令名。
\begin{ctexexam}
\tcbappstyle*{mytcb} % 新建一个盒子风格tc-mytcb
@@ -946,6 +954,7 @@
\environment{outline}[\oarg{键值列表1}\darg{标题名称}\oarg{键值列表2}]
摘要盒子 \env{outline} 可用于章前摘要,它的标题是可选参数,默认标题是摘要。\meta{键值列表2} 是摘要盒子样式选项,可以使用 \cs{tcbappstyle} 命令对它进行全局设置,命令第一个参数为 \code{outline}。
\end{environments}
+
\begin{commands}
\command{setoutlinelist}[\marg{键值列表1}]
\meta{键值列表1} 与 \pkg*{enumitem} 宏包中列表配置选项相同,可以设置摘要条目的各种距离,要对它进行全局设置可以使用 \cs{setoutlinelist} 命令。
@@ -992,9 +1001,9 @@
\command*{unit}[\oarg{键值列表}\marg{单位}]
单位格式化命令 \cs*{unit} 包含文字元素(例如字母或数字)时,使用 \Marg{.} 和 \code{\~{}} 放置在单元乘积中间,并使用 \code{\_} 和 \code{\^{}} 正确放置指定的下标和上标。格式化方法可在数学和文本模式下使用。
\command*{qty}[\oarg{键值列表}\marg{数字}\oarg{前缀}\marg{单位}]
- \cs*{qty} 命令可用来输出带有单位的量。
+ 命令 \cs*{qty} 可用来输出带有单位的量。
\command*{qtyrange}[\oarg{键值列表}\marg{数字1}\marg{数字2}\marg{单位}]
- \cs*{qtyrange} 可以输出带有范围和单位的量。
+ 命令 \cs*{qtyrange} 可以输出带有范围和单位的量。
\begin{ctexexam}
\numproduct{-21x3e5}
\unit{mL~min^{-1}}
@@ -1007,17 +1016,16 @@
\begin{commands}\noitemsep
\command{newcounter}[\marg{计数器}\oarg{父计数器}]\default{}
\command{UseCounter}[\sarg\oarg{父计数器}\darg{编号}\marg{计数器}\marg{内容}\oarg{分隔符}]
- \cs{newcounter} 是 \LaTeX 自带的创建计数器命令,\cs{UseCounter} 将会以一定的格式使用由它创建的计数器,将会以 \cs*{the}\meta{父计数器}\meta{分隔符}\cs*{the}\meta{计数器}\meta{内容} 输出当前内容。
- 需要注意的是 \cs{UseCounter} 仅具有\textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 保持当前值,\meta{编号} 为 \code{arabic} 和 \code{alpha} 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。
-\end{commands}
+ 命令 \cs{newcounter} 是 \LaTeX 自带的创建计数器命令,命令 \cs{UseCounter} 以一定的格式使用由它创建的计数器,将会以 \cs*{the}\meta{父计数器}\meta{分隔符}\cs*{the}\meta{计数器}\meta{内容} 输出当前内容。注意 \cs{UseCounter} 仅具有\textbf{输出功能},并不会改变计数器原有的绑定关系。默认每使用一次命令 \meta{计数器} 的值增加 1,带有星号的命令使 \meta{计数器} 值保持不变,\meta{编号} 为 \code{arabic} 和 \code{alpha} 等格式,\meta{数值} 可以手动将 \meta{计数器} 设为指定值。
-在一定的场合下可能用到 \cs{UseCounter} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \cs{labelformat} 设置计数器的引用标签需添加 \code{eb@}:
-\begin{ctexexam}
+ 在一定的场合下可能用到 \cs{UseCounter} 命令,比如通过新建快捷命令在一些位置使用定理环境的计数器,使用 \cs{labelformat} 设置计数器的引用标签需添加 \code{eb@}:
+ \begin{ctexexam}
\labelformat{eb@theorem}{定理 #1}
\newcommand{\theoremhead}[1]
{定理 \UseCounter[chapter]{theorem}{\hspace{1em}#1}}
\theoremhead{定理标题}\label{thm:theorem}
-\end{ctexexam}
+ \end{ctexexam}
+\end{commands}
\subsection{图表题注}
\begin{commands}\noitemsep
@@ -1035,7 +1043,6 @@
\end{commands}
\subsection{公式符号对照}
-\change{2021-07-22}
\begin{environments}
\environment{eqcomp}[\oarg{键值列表1}\darg{键值列表2}]
一些公式之后可以使用基于列表环境的 \env{eqcomp} 进行符号对照。对照列表的 \meta{键值列表2} 与 \pkg*{enumitem} 的选项相同,一般较少用到,可以用于设置垂直间距等。
@@ -1049,35 +1056,35 @@
\command{seteqcomp}[\marg{键值列表1}]
对照环境的 \meta{键值列表1} 可以使用 \cs{seteqcomp} 全局设置,它的选项如下:
\begin{options}
- \keyval-{width}{符号宽度}\Default{2em}
- 设置适当的符号宽度可以防止文字重叠和边界溢出等问题。
- \keyval-{delim}{引导符}\Default{——}
- 符号对照的引导符,\cs{symb} 的 \meta{引导符} 和对齐方式是基于这个符号的宽度。
- \keyval-{space}{符号间隙}\Default{0.25em}
- 符号间隙为引导符两侧与符号和说明文字间的距离。
- \keychoice{item-align}{l,c,r}\Default{r}
- 符号的对齐方式,分为左(\code{l})、中(\code{c})和右(\code{r})三种对齐方式。
- \keychoice{delim-align}{l,c,r}\Default{c}
- 引导符的对齐方式,分为左(\code{l})、中(\code{c})和右(\code{r})三种对齐方式。
- \keyval-{enumitem}{键值列表2}
- 可以使用选项 \option{enumitem} 或命令 \cs{seteqcomplist} 调整对照列表的水平垂直间距。
- \keyval-{intro}{首行文字}\Default
- 符号对照的说明文字,应当为简短的几个字,只显示在第一行,其后为悬挂缩进的对照列表。
- \keyval-{font}{符号字体}\Default
- 符号的字体,数学和文本符号模式应采用不同的字体命令,最后一个命令可以接受一个参数,这个参数为符号。
- \keychoice{mode}{math,text}\Default{math}
- 符号字体模式,可以为数学字体或者文本字体。
+ \keyval-{width}{符号宽度}\Default{2em}
+ 设置适当的符号宽度可以防止文字重叠和边界溢出等问题。
+ \keyval-{delim}{引导符}\Default{——}
+ 符号对照的引导符,\cs{symb} 的 \meta{引导符} 和对齐方式是基于这个符号的宽度。
+ \keyval-{space}{符号间隙}\Default{0.25em}
+ 符号间隙为引导符两侧与符号和说明文字间的距离。
+ \keychoice{item-align}{l,c,r}\Default{r}
+ 符号的对齐方式,分为左(\code{l})、中(\code{c})和右(\code{r})三种对齐方式。
+ \keychoice{delim-align}{l,c,r}\Default{c}
+ 引导符的对齐方式,分为左(\code{l})、中(\code{c})和右(\code{r})三种对齐方式。
+ \keyval-{enumitem}{键值列表2}
+ 可以使用选项 \option{enumitem} 或命令 \cs{seteqcomplist} 调整对照列表的水平垂直间距。
+ \keyval-{intro}{首行文字}\Default
+ 符号对照的说明文字,应当为简短的几个字,只显示在第一行,其后为悬挂缩进的对照列表。
+ \keyval-{font}{符号字体}\Default
+ 符号的字体,数学和文本符号模式应采用不同的字体命令,最后一个命令可以接受一个参数,这个参数为符号。
+ \keychoice{mode}{math,text}\Default{math}
+ 符号字体模式,可以为数学字体或者文本字体。
\end{options}
\end{commands}
-\subsection{引用}
+\subsection{交叉引用}
\begin{commands}
- \command{ref}[\marg{标签}]
- 使用 \cs*{ref} 命令引用 \cs*{label} 设置的标签,将会检测临近计数器并添加相应的前缀,比如图表、章节标题和定理等。
- \command{footref}[\marg{脚注标签}]
- \cs{footref} 对自动编号的脚注进行引用,为上标形式与脚注标记一致。
+ \command*{ref}[\marg{标签名}]
+ 使用 \cs*{ref} 命令引用 \cs*{label} 设置的 \meta{标签名},将会检测临近计数器并添加相应的前缀,比如图表、章节标题和定理等。
+ \command{footref}[\marg{脚注标签名}]
+ 对自动编号的脚注进行引用可使用 \cs{footref} 命令,与引用的标记共享一个编号与格式。
\command{labelformat}[\marg{计数器}\marg{标签引用格式}]
- \cs{labelformat} 可以设置标签引用格式,第二个参数中 \code{\#1} 代表 \cs*{the}\meta{计数器},可以设置引用序号的前缀和后缀。
+ 标签格式命令 \cs{labelformat} 可以设置引用标签格式,\meta{标签引用格式} 中 \code{\#1} 代表 \cs*{the}\meta{计数器},可以设置引用序号的前缀和后缀。
\end{commands}
\subsubsection{索引}
@@ -1107,6 +1114,8 @@
命令 \cs{marginnote} 可以生成简单的边注,如果只给定了 \meta{右文本},那么边注在奇偶数页文字相同。如果同时给定了 \meta{左文本},则偶数页使用 \meta{左文本} 的文字。
\end{commands}
+\appendix
+
\section{依赖的宏包}
以下为 \pkg*{easybase} 直接调用的关键宏包,方括号内为宏包已使用的选项。蓝色的宏包表示截至当前在 \TeX~Live 2021 中存在更新,旧版本并不影响使用。带有 \ding{81} 符号的宏包并未载入它们,仅做了一些预配置,可在导言区手动载入以实现相关的功能。
\begin{description}[font = \normalfont\sffamily]
diff --git a/macros/latex/contrib/elpres/README.md b/macros/latex/contrib/elpres/README.md
index d2538d778c..36346c4764 100644
--- a/macros/latex/contrib/elpres/README.md
+++ b/macros/latex/contrib/elpres/README.md
@@ -1,4 +1,4 @@
-Elpres v0.8 2021-02-20
+Elpres v0.8 2021-08-01
# Short description
@@ -18,15 +18,11 @@ For enhanced features the packages `ragged2e`, `overlays`, `wallpaper`,
A homepage for the elpres project: http://vkiefel.de/elpres.html with
additional material.
-# Changes in v0.8
+# Changes in v0.9
-* A bug fixed in the `elpres...scheme.sty` files (incorrect value for
- `\labelitemiv`)
-* Installation instructions in the manual completed
-* Detailed installation instructions added to this file (`README.md`).
-* Manual: a description of the new commands `\overlaysoff` and `\alertsoff`
- of the `overlays` package (introduced in version 2.12 of `overlays`)
- included
+* A new class option `bulletsymb` was added
+* A `TDS` archive file `elpres.tds.zip` for added for the upolad on `ctan.org`
+* Detailed installation instructions were updated in this file (`README.md`).
# Installation
@@ -52,8 +48,8 @@ following files:
ep-ball-04.eps,
ep-ball-05.eps
-(in short: `elpres.cls` and all `*.sty`, `*.png` and `*.eps` files) should
-be copied into a directory in the `.../tex/...`-branch of a `texmf`-tree
+(in short: `elpres.cls` and all `*.sty`, `*.png` and `*.eps` files) are
+copied into a directory in the `.../tex/...`-branch of a `texmf`-tree
like `../texmf/tex/latex/elpres`, where `texmf` may be `texmf-dist` or
`texmf-local` or an analogous directory.
@@ -64,18 +60,23 @@ The manual and the example file:
elpres-example.pdf,
elpres-example.tex
-should be copied into a directory of the `.../doc/...`-branch of a
+are to be copied into a directory of the `.../doc/...`-branch of a
`texmf`-tree like `../texmf/doc/latex/elpres`, where `texmf` may be
`texmf-dist` or `texmf-local` or an analogous directory. Finally the file
location database (e.g. `ls-R`) should be updated. More details can be found
in the manual.
+# Support
+
+The project web page is found on
+[http://vkiefel.de/elpres.html](http://vkiefel.de/elpres.html)
+
# License
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL). The latest version of this license is
available in the file:
+[http://www.latex-project.org/lppl.txt](http://www.latex-project.org/lppl.txt)
- http://www.latex-project.org/lppl.txt
-Current maintainer is Volker Kiefel.
+Current maintainer of `elpres` is Volker Kiefel.
diff --git a/macros/latex/contrib/elpres/doc/elpres-example.pdf b/macros/latex/contrib/elpres/doc/elpres-example.pdf
index e822d13da0..bbd2597b3c 100644
--- a/macros/latex/contrib/elpres/doc/elpres-example.pdf
+++ b/macros/latex/contrib/elpres/doc/elpres-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/elpres/doc/elpres-manual.pdf b/macros/latex/contrib/elpres/doc/elpres-manual.pdf
index 65f8c02150..8ff9be4792 100644
--- a/macros/latex/contrib/elpres/doc/elpres-manual.pdf
+++ b/macros/latex/contrib/elpres/doc/elpres-manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/elpres/doc/elpres-manual.tex b/macros/latex/contrib/elpres/doc/elpres-manual.tex
index 1e25345afa..b4b00a808b 100644
--- a/macros/latex/contrib/elpres/doc/elpres-manual.tex
+++ b/macros/latex/contrib/elpres/doc/elpres-manual.tex
@@ -39,8 +39,8 @@
\title{\textsf{elpres} --- electronic presentations \\ with (pdf/Lua)\LaTeX}
\author{Volker Kiefel\thanks{volker dot kiefel at freenet dot de,
\url{http://vkiefel.de/elpres.html}}}
-\date{v0.8\\[1.8ex]
- February 28, 2021%
+\date{v0.9\\[1.8ex]
+ Ausgust 01, 2021%
% --- \textcolor{DarkGreen}{update of this manual:
% September 27, 2020}
}
@@ -175,7 +175,12 @@ is intended for use of \texttt{elpres} with Lua\LaTeX\
\index{Lualatex@Lua\LaTeX}
with its own font selection mechanisms.
Options for different screen aspect ratios: \texttt{4x3}
-(default), \texttt{16x9}, \texttt{16x10}. The option \texttt{navisymb}
+(default), \texttt{16x9}, \texttt{16x10}.
+\index{bulletsymb class option@\texttt{bulletsymb} class option}
+The option \texttt{bulletsymb} selects \verb+$\bullet$+ symbols
+instead of the default \texttt{itemize}-environment
+\verb+\item+ symbols in all four levels.
+The option \texttt{navisymb}
adds symbols for navigation to the presentation.
Options of the \texttt{article} class are also available for
\texttt{elpres} presentations,
@@ -1415,6 +1420,8 @@ been updated in section \ref{sec:Introduction} and detailed instructions were
added to \texttt{README.md}. Section \ref{sec:inact-overl-comm} was updated. A
bug in the \texttt{elpres...scheme.sty} files was fixed (incorrect value for
\verb+\labelitemiv+).
+\textbf{v0.9} (01.08.2021): New class option \texttt{bulletsymb} added, an
+archive \texttt{elpres.tds.zip} is added for \texttt{ctan.org} upload.
\printindex
diff --git a/macros/latex/contrib/elpres/tex/elpres.cls b/macros/latex/contrib/elpres/tex/elpres.cls
index 29f9df9a88..36aa7c7171 100644
--- a/macros/latex/contrib/elpres/tex/elpres.cls
+++ b/macros/latex/contrib/elpres/tex/elpres.cls
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{elpres}[2021/02/28 class for plain electronic presentations]
+\ProvidesClass{elpres}[2021/08/01 class for plain electronic presentations]
%
% 2004/06/19 v0.1 - initial version
%
@@ -32,7 +32,12 @@
%
% 2021/02/28 v0.8 - bug in elpres...scheme.sty files fixed, manual updated
%
+% 2021/08/01 v0.9 - new class option `bulletsymb' added, elpres.tds.zip
+% archive added to ctan.org upload
%
+%
+
+
% Options: select fonts
\newcommand{\fontna}{initialisiert}
\DeclareOption{nofonts}{%
@@ -70,13 +75,21 @@
\renewcommand{\screenformat}{scr16x10}%
}
-
% Option: navigation symbols
\newcommand{\navigation}{withoutnavigationsymb}
\DeclareOption{navisymb}{%
\renewcommand{\navigation}{withnavi}%
}
+% begin neu 1.8.21
+% Option: itemize symbols Option: select $\bullet$ instead of default
+% itemize symbols
+\newcommand{\itemize@elsymbols}{default@symbols}
+\DeclareOption{bulletsymb}{%
+ \renewcommand{\itemize@elsymbols}{bullet@symbols}%
+}
+% end neu 1.8.21
+
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass{article}
@@ -223,6 +236,18 @@
\newcommand{\pagenrconst}{\addtocounter{page}{-1}}
+%% begin geaendert 1.8.21
+
+\ifthenelse{\equal{\itemize@elsymbols}{bullet@symbols}}{%
+\renewcommand{\labelitemi}{\large\ensuremath{\bullet}}%
+\renewcommand{\labelitemii}{\ensuremath{\bullet}}%
+\renewcommand{\labelitemiii}{\small\ensuremath{\bullet}}%
+\renewcommand{\labelitemiv}{\footnotesize\ensuremath{\bullet}}%
+}{}
+
+%% end geaendert 1.8.21
+
+
%% (External): Default colors for defined slide elements, they are modified in
%% style files -- these color names may be used externally by authors of
%% presentations
diff --git a/macros/latex/contrib/elpres/tex/elpresbluelightgrayscheme.sty b/macros/latex/contrib/elpres/tex/elpresbluelightgrayscheme.sty
index 719bcbd676..daac18a441 100644
--- a/macros/latex/contrib/elpres/tex/elpresbluelightgrayscheme.sty
+++ b/macros/latex/contrib/elpres/tex/elpresbluelightgrayscheme.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{elpresbluelightgrayscheme}[2020/08/15 elpres layout scheme blue lightgray]
+\ProvidesPackage{elpresbluelightgrayscheme}[2021/08/01 elpres layout scheme blue lightgray]
\definecolor{epturquoise}{rgb}{0.1,0.83,0.8}
\definecolor{eplistheadcolor}{rgb}{0.75,0.8,1} % color for list heads
@@ -29,10 +29,22 @@
\definecolor{eptextcolor}{rgb}{0.7,0.7,0.75} % Ext: normal text color
\color{eptextcolor} % Ext: normal text color
-\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-01}}
-\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-01}}
-\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-01}}
-\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-01}}
+%% begin geaendert 1.8.21
+\ifthenelse{\equal{\itemize@elsymbols}{default@symbols}}{%
+\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-01}}%
+\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-01}}%
+\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-01}}%
+\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-01}}%
+}{}
+
+\ifthenelse{\equal{\itemize@elsymbols}{bullet@symbols}}{%
+\renewcommand{\labelitemi}{\large\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemii}{\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiii}{\small\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiv}{\footnotesize\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+}{}
+%% end geaendert 1.8.21
+
\renewcommand{\labelenumi}{\textcolor{eplistheadcolor}{\textbf{\theenumi.}}}
\renewcommand{\labelenumii}{\textcolor{eplistheadcolor}{\textbf{\theenumii.}}}
@@ -43,3 +55,5 @@
\textcolor{eplistheadcolor}{\textbf{#1}}}
\endinput
+
+% vim: syntax=tex tw=2048 ai
diff --git a/macros/latex/contrib/elpres/tex/elpresgrayscheme.sty b/macros/latex/contrib/elpres/tex/elpresgrayscheme.sty
index a33c41a7ab..42cf019183 100644
--- a/macros/latex/contrib/elpres/tex/elpresgrayscheme.sty
+++ b/macros/latex/contrib/elpres/tex/elpresgrayscheme.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{elpresgrayscheme}[2020/08/15 elpres layout scheme gray]
+\ProvidesPackage{elpresgrayscheme}[2021/08/01 elpres layout scheme gray]
\definecolor{epgreen}{rgb}{0.11,0.34,0.3}
\definecolor{eplistheadcolor}{named}{epgreen} % color for list heads
@@ -28,11 +28,23 @@
\definecolor{eptextcolor}{rgb}{0.16,0.16,0.16} % Ext: normal text color
\color{eptextcolor} % Ext: normal text color
+%% begin geaendert 1.8.21
+\ifthenelse{\equal{\itemize@elsymbols}{default@symbols}}{%
+\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-03}}%
+\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-03}}%
+\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-03}}%
+\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-03}}%
+}{}
+
+\ifthenelse{\equal{\itemize@elsymbols}{bullet@symbols}}{%
+\renewcommand{\labelitemi}{\large\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemii}{\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiii}{\small\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiv}{\footnotesize\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+}{}
+%% end geaendert 1.8.21
+
-\renewcommand{\labelitemi}{\includegraphics[scale=0.065]{ep-ball-03}}
-\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-03}}
-\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-03}}
-\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-03}}
\renewcommand{\labelenumi}{\textcolor{eplistheadcolor}{\textbf{\theenumi.}}}
\renewcommand{\labelenumii}{\textcolor{eplistheadcolor}{\textbf{\theenumii.}}}
@@ -43,3 +55,5 @@
\textcolor{epgreen}{\textbf{#1}}}
\endinput
+
+% vim: syntax=tex tw=2048 ai
diff --git a/macros/latex/contrib/elpres/tex/elpreswhitebluescheme.sty b/macros/latex/contrib/elpres/tex/elpreswhitebluescheme.sty
index 06449fd3d5..f469c2ebc9 100644
--- a/macros/latex/contrib/elpres/tex/elpreswhitebluescheme.sty
+++ b/macros/latex/contrib/elpres/tex/elpreswhitebluescheme.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{elpreswhitebluescheme}[2020/08/15 elpres layout scheme white blue]
+\ProvidesPackage{elpreswhitebluescheme}[2021/08/01 elpres layout scheme white blue]
\definecolor{epdarkblue}{rgb}{0.12,0.09,0.65}
\definecolor{eplistheadcolor}{named}{epdarkblue} % color for list heads
@@ -29,10 +29,22 @@
\definecolor{eptextcolor}{rgb}{0.2,0.16,0.16} % Ext: normal text color
\color{eptextcolor} % Ext: normal text color
-\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-05}}
-\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-05}}
-\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-05}}
-\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-05}}
+%% begin geaendert 1.8.21
+\ifthenelse{\equal{\itemize@elsymbols}{default@symbols}}{%
+\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-05}}%
+\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-05}}%
+\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-05}}%
+\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-05}}%
+}{}
+
+\ifthenelse{\equal{\itemize@elsymbols}{bullet@symbols}}{%
+\renewcommand{\labelitemi}{\large\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemii}{\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiii}{\small\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiv}{\footnotesize\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+}{}
+%% end geaendert 1.8.21
+
\renewcommand{\labelenumi}{\textcolor{eplistheadcolor}{\textbf{\theenumi.}}}
\renewcommand{\labelenumii}{\textcolor{eplistheadcolor}{\textbf{\theenumii.}}}
@@ -46,3 +58,5 @@
\color{epverydarkblue}
\endinput
+
+% vim: syntax=tex tw=2048 ai
diff --git a/macros/latex/contrib/elpres/tex/elpreswhiteredscheme.sty b/macros/latex/contrib/elpres/tex/elpreswhiteredscheme.sty
index 1c7255e668..9860cec48b 100644
--- a/macros/latex/contrib/elpres/tex/elpreswhiteredscheme.sty
+++ b/macros/latex/contrib/elpres/tex/elpreswhiteredscheme.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{elpreswhiteredscheme}[2020/08/15 elpres layout white red]
+\ProvidesPackage{elpreswhiteredscheme}[2021/08/01 elpres layout white red]
\definecolor{epdarkred}{rgb}{0.6,0.09,0.1}
\definecolor{eplistheadcolor}{named}{epdarkred} % color for list heads
@@ -29,10 +29,21 @@
\definecolor{eptextcolor}{rgb}{0.2,0.16,0.16} % Ext: normal text color
\color{eptextcolor} % Ext: normal text color
-\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-02}}
-\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-02}}
-\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-02}}
-\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-02}}
+%% begin geaendert 1.8.21
+\ifthenelse{\equal{\itemize@elsymbols}{default@symbols}}{%
+\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-02}}%
+\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-02}}%
+\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-02}}%
+\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-02}}%
+}{}
+
+\ifthenelse{\equal{\itemize@elsymbols}{bullet@symbols}}{%
+\renewcommand{\labelitemi}{\large\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemii}{\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiii}{\small\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiv}{\footnotesize\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+}{}
+%% end geaendert 1.8.21
\renewcommand{\labelenumi}{\textcolor{eplistheadcolor}{\textbf{\theenumi.}}}
\renewcommand{\labelenumii}{\textcolor{eplistheadcolor}{\textbf{\theenumii.}}}
@@ -46,3 +57,5 @@
\color{epverydarkred}
\endinput
+% vim: syntax=tex tw=2048 ai
+
diff --git a/macros/latex/contrib/elpres/tex/elpreswhitetealscheme.sty b/macros/latex/contrib/elpres/tex/elpreswhitetealscheme.sty
index ff71fb1935..9df8c25007 100644
--- a/macros/latex/contrib/elpres/tex/elpreswhitetealscheme.sty
+++ b/macros/latex/contrib/elpres/tex/elpreswhitetealscheme.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{elpreswhitetealscheme}[2020/08/15 elpres layout scheme white teal]
+\ProvidesPackage{elpreswhitetealscheme}[2021/08/01 elpres layout scheme white teal]
\definecolor{epdarkteal}{rgb}{0.02,0.35,0.38}
\definecolor{eplistheadcolor}{named}{epdarkteal} % color for list heads
@@ -29,10 +29,22 @@
\definecolor{eptextcolor}{rgb}{0.2,0.16,0.16} % Ext: normal text color
\color{eptextcolor} % Ext: normal text color
-\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-04}}
-\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-04}}
-\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-04}}
-\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-04}}
+
+%% begin geaendert 1.8.21
+\ifthenelse{\equal{\itemize@elsymbols}{default@symbols}}{%
+\renewcommand{\labelitemi}{\includegraphics[scale=0.06]{ep-ball-04}}%
+\renewcommand{\labelitemii}{\includegraphics[scale=0.055]{ep-ball-04}}%
+\renewcommand{\labelitemiii}{\includegraphics[scale=0.05]{ep-ball-04}}%
+\renewcommand{\labelitemiv}{\includegraphics[scale=0.045]{ep-ball-04}}%
+}{}
+
+\ifthenelse{\equal{\itemize@elsymbols}{bullet@symbols}}{%
+\renewcommand{\labelitemi}{\large\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemii}{\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiii}{\small\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+\renewcommand{\labelitemiv}{\footnotesize\textcolor{eplistheadcolor}{\ensuremath{\bullet}}}%
+}{}
+%% end geaendert 1.8.21
\renewcommand{\labelenumi}{\textcolor{eplistheadcolor}{\textbf{\theenumi.}}}
\renewcommand{\labelenumii}{\textcolor{eplistheadcolor}{\textbf{\theenumii.}}}
@@ -46,3 +58,6 @@
\color{epverydarkteal}
\endinput
+
+% vim: syntax=tex tw=2048 ai
+
diff --git a/macros/latex/contrib/iexec/README.md b/macros/latex/contrib/iexec/README.md
index 226069a29f..b147ac146c 100644
--- a/macros/latex/contrib/iexec/README.md
+++ b/macros/latex/contrib/iexec/README.md
@@ -13,7 +13,7 @@ and then use in the preamble:
\documentclass{article}
\usepackage{iexec}
\begin{document}
-Today is \iexec{date +\%e-\%b-\%Y}.
+Today is \iexec{date +\%e-\%b-\%Y | tr -d '\\n'}.
\end{document}
```
diff --git a/macros/latex/contrib/iexec/iexec.pdf b/macros/latex/contrib/iexec/iexec.pdf
index a47a9869fd..ad364b67de 100644
--- a/macros/latex/contrib/iexec/iexec.pdf
+++ b/macros/latex/contrib/iexec/iexec.pdf
Binary files differ
diff --git a/macros/latex/contrib/iexec/iexec.sty b/macros/latex/contrib/iexec/iexec.sty
index 34898e324c..2f8cd15bb0 100644
--- a/macros/latex/contrib/iexec/iexec.sty
+++ b/macros/latex/contrib/iexec/iexec.sty
@@ -21,7 +21,7 @@
% SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{iexec}[2021/07/12 0.3.1 Inputable Shell Executions]
+\ProvidesPackage{iexec}[2021/08/01 0.4.0 Inputable Shell Executions]
\RequirePackage{shellesc}
@@ -30,7 +30,10 @@
\DeclareOptionX{trace}{\tracetrue}
\ProcessOptionsX\relax
-\makeatletter\newcommand\iexec[2][iexec.tmp]{%
+\newcommand\iexec[2][iexec.tmp]{%
+ \ifnum\pdfshellescape=1\else
+ \PackageError{iexec}{You must run latex with --shell-escape option}{}
+ \fi
\begingroup%
\let\%\@percentchar%
\let\\\@backslashchar%
@@ -41,6 +44,6 @@
\endgroup%
\input{#1}%
\iftrace\else\ShellEscape{rm #1}\fi%
-}\makeatother
+}
\endinput
diff --git a/macros/latex/contrib/iexec/iexec.tex b/macros/latex/contrib/iexec/iexec.tex
index 098a297045..4929b99631 100644
--- a/macros/latex/contrib/iexec/iexec.tex
+++ b/macros/latex/contrib/iexec/iexec.tex
@@ -27,7 +27,7 @@
\usepackage{ffcode}
\title{\ff{iexec}: \LaTeX{} Package \\ for Inputable Shell Executions}
\author{Yegor Bugayenko}
-\date{0.3.1 2021/07/12}
+\date{0.4.0 2021/08/01}
\begin{document}
\pagenumbering{gobble}
\raggedbottom
diff --git a/macros/latex/contrib/scrambledenvs/README.md b/macros/latex/contrib/scrambledenvs/README.md
new file mode 100644
index 0000000000..cab73c508e
--- /dev/null
+++ b/macros/latex/contrib/scrambledenvs/README.md
@@ -0,0 +1,15 @@
+# The LaTeX package scrambledenvs - version 1.0.0 (2021/07/31)
+
+**scrambledenvs** allows you to arbitrarily create and print scrambled environments (like scrambled hints in a book) and customize the output.
+
+## Installation instructions
+
+A working TeX installation is required.
+
+This is a self-extracting dtx file, so run
+
+ pdflatex scrambledenvs.dtx
+
+to generate the README, documentation, and packages.
+
+
diff --git a/macros/latex/contrib/scrambledenvs/scrambledenvs.dtx b/macros/latex/contrib/scrambledenvs/scrambledenvs.dtx
new file mode 100644
index 0000000000..d83f1cfffd
--- /dev/null
+++ b/macros/latex/contrib/scrambledenvs/scrambledenvs.dtx
@@ -0,0 +1,472 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2021 Dennis Chen <proofprogram@gmail.com>
+%
+% This work may be distributed and/or modified under
+% the conditions the LaTeX Project Public License (LPPL),
+% either version 1.3 of this license or (at your option)
+% any later version. The latest version of this license
+% can be found in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+# The LaTeX package scrambledenvs - version 1.0.0 (2021/07/31)
+
+**scrambledenvs** allows you to arbitrarily create and print scrambled environments (like scrambled hints in a book) and customize the output.
+
+## Installation instructions
+
+A working TeX installation is required.
+
+This is a self-extracting dtx file, so run
+
+ pdflatex scrambledenvs.dtx
+
+to generate the README, documentation, and packages.
+%</readme>
+% \fi
+
+% \iffalse
+
+%<*internal>
+\fi
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+ \expandafter\begingroup
+\fi
+%</internal>
+%<*install>
+
+\input docstrip.tex
+\keepsilent
+\askforoverwritefalse
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2021 Dennis Chen <proofprogram@gmail.com>
+
+This work may be distributed and/or modified under
+the conditions the LaTeX Project Public License (LPPL),
+either version 1.3 of this license or (at your option)
+any later version. The latest version of this license
+can be found in
+
+ http://www.latex-project.org/lppl.txt
+
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+To produce the documentation, run palette.dtx through pdflatex.
+
+\endpreamble
+\postamble
+
+This package consists of the file scrambledenvs.dtx,
+ and the generated files scrambledenvs.sty,
+ scrambledenvs.pdf.
+\endpostamble
+
+\usedir{tex/latex/scrambledenvs}
+\generate{
+ \file{scrambledenvs.sty}{\from{\jobname.dtx}{main}\from{\jobname.dtx}{helper}}
+}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* files into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* scrambledenvs.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation, run the file *}
+\Msg{* scrambledenvs.dtx through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+%</install>
+%<install>\endbatchfile
+%<*internal>
+
+\usedir{source/latex/scrambledenvs}
+\generate{
+ \file{\jobname.ins}{\from{\jobname.dtx}{install}}
+}
+\nopreamble\nopostamble
+
+\usedir{doc/latex/scrambledenvs}
+\generate{
+ \file{README.md}{\from{\jobname.dtx}{readme}}
+}
+
+\ifx\fmtname\nameofplainTeX
+ \expandafter\endbatchfile
+\else
+ \expandafter\endgroup
+\fi
+%</internal>
+%<*main>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{scrambledenvs}[2021/07/31 v1.0.0 Create and print scrambled environments]
+\RequirePackage{forloop}
+\RequirePackage{pgfmath}
+\pgfmathsetseed{2407}
+%</main>
+%<*driver>
+\ProvidesFile{\jobname.dtx}[2021/07/31 v1.0.0 Create and print scrambled environments]
+\documentclass{ltxdoc}
+
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+
+\begin{document}
+ \DocInput{\jobname.dtx}
+ \PrintIndex
+ \PrintChanges
+\end{document}
+%</driver>
+% \fi
+% \GetFileInfo{\jobname.dtx}
+% \changes{v1.0.0}{2021/07/31}{Initial version}
+%
+% \renewcommand{\emph}[1]{\textbf{#1}}
+%
+% \title{\textsf{scrambledenvs} -- Create and print scrambled environments}
+% \author{Dennis Chen \\ proofprogram@gmail.com}
+% \date{\fileversion{} (\filedate)}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \textsf{scrambledenvs} package allows you to create scrambled environments and print them out later, such as scrambled hints or solutions.
+% \end{abstract}
+%
+% \section{Overview}
+%
+% This package was designed to mark hints at a location\footnote{It can generalize beyond hints, but I thought it best to start off with a specific example..} and print them out later in a random order.\footnote{Though you do have the ability to make the order not random: pass in |noscramble| to the package.}
+%
+% There is an outer environment which typesets the label. Inside it you should place the inner environment \emph{and only the inner environment}. Inside this inner environment, you write the contents of your hint. This will typeset the hint number. Finally, you may print the hints at some later location in a randomized order.
+%
+% \section{Usage}
+%
+% If you want your solutions to be scrambled, call
+% \begin{verbatim}
+%\usepackage{scrambledenvs}
+% \end{verbatim}
+%
+% If you want to disable all scrambling for any reason, call
+% \begin{verbatim}
+%\usepackage[noscramble]{scrambledenvs}
+% \end{verbatim}
+% \iffalse
+%<*main>
+\newif\ifscrambledenvs@scramble\scrambledenvs@scrambletrue
+\DeclareOption{noscramble}{\scrambledenvs@scramblefalse}
+\ProcessOptions\relax
+%</main>
+% \fi
+%
+% \DescribeMacro{\newscrambledenv}
+% In order to create a new scrambled environment, one should call |\newscrambledenv{envname}|. This requires that the macros |\envname| and |\envname|s be undefined, as well as the counters \textsf{envname}count and \textsf{envname}tempcount be undefined, as |\newscrambledenv| will define these.
+%
+% This defines the environments |`envname`s| and |`envname`|, and the macro |\print`envname`|, where |`envname'| denotes the value passed in to |\newscrambledenv|. Because this will get confusing fast, we will just assume that |`envname'| is |hint|, since this generalizes quite easily.
+%
+% Thus in this example, the environments |hints| and |hint| are defined, and the macro |\printhint| is defined.
+%
+% If any of these macros or counters are defined, the package will throw a custom error.
+%
+% ^^A At the start, surround everything in newscrambledenv (since everything in main goes there)
+% \iffalse
+%<*main>
+\newcommand\newscrambledenv[1]{
+ \scrambledenvs@check@macrodefined{print#1}
+ \scrambledenvs@check@envdefined{#1s}
+ \scrambledenvs@check@envdefined{#1}
+ \newcounter{scrambledenvs@#1@count}
+ \newcounter{scrambledenvs@#1@tempcount}
+%</main>
+%<*helper>
+\newcommand\scrambledenvs@check@macrodefined[1]{%
+ \ifcsname #1\endcsname
+ \PackageError{scrambledenvs}{The macro \@backslashchar #1\space cannot be defined,\MessageBreak
+ as the macro \@backslashchar #1 is already defined}{Remove any packages that define \@backslashchar #1,\MessageBreak
+ or choose a different name for your scrambled environment.}%
+ \fi
+}
+\newcommand\scrambledenvs@check@envdefined[1]{%
+ \ifcsname #1\endcsname
+ \PackageError{scrambledenvs}{The environment `#1' cannot be defined,\MessageBreak
+ as the macro \@backslashchar #1 is already defined}{Remove any packages that define `#1',\MessageBreak
+ or choose a different name for your scrambled environment.}%
+ \fi
+}
+%</helper>
+% \fi
+% \DescribeEnv{hints}
+% This is the outer environment. Depending on how many |hint| environments are put inside it, it will either typeset \emph{Hints:} or \emph{Hint:} with the numerical labels of the passed in hints following it.
+% You should put in nothing but the inner environment |hint|. (See the examples for a correct usage.)
+% \iffalse
+%<*helper>
+\def\scrambledenvs@active{}
+%</helper>
+%<*main>
+\newenvironment{#1s}{%
+ \setcounter{scrambledenvs@#1@tempcount}{0}%
+ \def\scrambledenvs@active{#1}%
+ \unskip\ignorespaces%
+}
+{
+\ifnum\value{scrambledenvs@#1@tempcount}=0\relax
+\else
+ \ifnum\value{scrambledenvs@#1@tempcount}=1\relax
+ {\csname scrambledenvs@#1@labelfont\endcsname\csname scrambledenvs@#1@label\endcsname :}
+ {\csname scrambledenvs@#1@reffont\endcsname\ref{#1:\value{scrambledenvs@#1@count}}}%
+ \else
+ {\csname scrambledenvs@#1@labelfont\endcsname\csname scrambledenvs@#1@label\endcsname s:}%
+ \forloop{scrambledenvs@loopcount}{\the\numexpr\value{scrambledenvs@#1@count}-\value{scrambledenvs@#1@tempcount}+1\relax}{\value{scrambledenvs@loopcount}<\the\numexpr\value{scrambledenvs@#1@count}+1\relax} {
+ {\csname scrambledenvs@#1@reffont\endcsname\ref{#1:\thescrambledenvs@loopcount}}%
+ }
+ \fi
+\fi
+\setcounter{scrambledenvs@#1@tempcount}{0}%
+}
+%</main>
+% \fi
+%
+% \DescribeEnv{hint}
+% This is the inner environment. The inner environment |hint| \emph{must} be inside the outer environment |hints|.
+% \iffalse
+%<*main>
+\newenvironment{#1}{%
+ \stepcounter{scrambledenvs@#1@tempcount}%
+ \stepcounter{scrambledenvs@#1@count}%
+ \ifnum\pdfstrcmp{#1}{\scrambledenvs@active}=0\relax
+ \else
+ \PackageError{scrambledenvs}{The inner environment `#1' must be inside the outer environment `#1s'}{}
+ \fi
+ \unskip%
+ \filecontents[overwrite]{\jobname-\the\value{scrambledenvs@#1@count}.#1}%
+}
+{%
+ \endfilecontents
+}
+%</main>
+% \fi
+%
+% \DescribeMacro{\printhint}
+%
+% To print out the hints (either in a random or fixed order, depending on whether the option |noscramble| is passed in), just write |\printhint|.
+%
+% \iffalse
+%<*helper>
+\newcounter{scrambledenvs@loopcount}
+\newcounter{scrambledenvs@innerloopcount}
+%</helper>
+%<*main>
+\expandafter\newcommand\csname print#1\endcsname{%
+ \ifscrambledenvs@scramble %\if
+ \ifcsname thescrambledenvs@#1@count\endcsname
+ \ifnum\value{scrambledenvs@#1@count}>0\relax
+ \expandafter\edef\csname pgfmath@randomlist@#1\endcsname{\value{scrambledenvs@#1@count}}%
+ \forloop{scrambledenvs@loopcount}{1}{\value{scrambledenvs@loopcount}<\the\numexpr\value{scrambledenvs@#1@count}+1\relax}{\expandafter\edef\csname pgfmath@randomlist@#1@\thescrambledenvs@loopcount\endcsname{\thescrambledenvs@loopcount}}%
+ \begin{scrambledenvs@#1@printenv}%
+ \forloop{scrambledenvs@loopcount}{0}{\value{scrambledenvs@loopcount}<\value{scrambledenvs@#1@count}}{%
+ \pgfmathrandomitem\scrambledenvs@tempindex{#1}%
+ \csname scrambledenvs@#1@printitem\endcsname\label{#1:\scrambledenvs@tempindex}%
+ \input{\jobname-\scrambledenvs@tempindex.#1}%
+ \forloop{scrambledenvs@innerloopcount}{\scrambledenvs@tempindex}{\value{scrambledenvs@innerloopcount}<\csname pgfmath@randomlist@#1\endcsname}{%
+ \global\expandafter\let\csname pgfmath@randomlist@#1@\thescrambledenvs@innerloopcount\expandafter\endcsname\csname pgfmath@randomlist@#1@\the\numexpr\thescrambledenvs@innerloopcount+1\relax\endcsname%
+ }%
+ \expandafter\xdef\csname pgfmath@randomlist@#1\endcsname{\the\numexpr\csname pgfmath@randomlist@#1\endcsname-1\relax}%
+ }%
+ \end{scrambledenvs@#1@printenv}
+ \fi
+ \fi
+ \else
+ \ifcsname thescrambledenvs@#1@count\endcsname
+ \ifnum\value{scrambledenvs@#1@count}>0\relax
+ \begin{scrambledenvs@#1@printenv}%
+ \forloop{scrambledenvs@loopcount}{1}{\value{scrambledenvs@loopcount}<\the\numexpr\value{scrambledenvs@#1@count}+1\relax}{\csname scrambledenvs@#1@printitem\endcsname\label{#1:\thescrambledenvs@loopcount}\input{\jobname-\thescrambledenvs@loopcount.#1}}%
+ \end{scrambledenvs@#1@printenv}
+ \fi
+ \fi
+ \fi
+}
+%</main>
+% \fi
+%
+% \subsection{Formatting}
+%
+% There are five pieces of configurable formatting. They are roughly ordered by the order they would appear in a document.
+%
+% \DescribeMacro{\hintlabel}
+% First is the label ``Hint(s)'' which gets printed by the outer environment |hints|. Capitalization and singular/plural form is automatically taken care of. To change it, write |\hintlabel{new label}| to get ``New label(s)'' as the new label.
+%
+% By default the label is the environment name capitalized. This may be useful if your environment names are shortened: for instance, you could change the label of |solu| to ``Solution(s)'' instead.
+%
+% \iffalse
+%<*main>
+\expandafter\def\csname scrambledenvs@#1@label\endcsname{\MakeUppercase #1}
+\scrambledenvs@check@macrodefined{#1label}
+\expandafter\newcommand\csname #1label\endcsname[1]{\expandafter\def\csname scrambledenvs@#1@label\endcsname{\MakeUppercase ##1}}
+%</main>
+% \fi
+%
+% \DescribeMacro{\hintlabelfont}
+% Second is the font of the label. To change it, write |\hintlabelfont{new label font}| to apply the new font. By default the font applied is |\bfseries|.
+%
+% Because this macro only takes in one argument, it is advisable to use |\bfseries| instead of |\textbf|, for instance.
+%
+% \iffalse
+%<*main>
+\expandafter\def\csname scrambledenvs@#1@labelfont\endcsname{\scrambledenvs@labelfont}
+\scrambledenvs@check@macrodefined{#1labelfont}
+\expandafter\newcommand\csname #1labelfont\endcsname[1]{\expandafter\def\csname scrambledenvs@#1@labelfont\endcsname{##1}}
+%</main>
+% \fi
+%
+% \DescribeMacro{\hintreffont}
+% Sets the font of the numerical references the follows the label.
+%
+% If you are using hyperref and you are using the |colorlinks| option: because the references are generated with |\ref|, you must change hyperref colors in order to change the color. |\color| will not work. Otherwise |\color| will work.
+%
+% \iffalse
+%<*main>
+\expandafter\def\csname scrambledenvs@#1@reffont\endcsname{\scrambledenvs@reffont}
+\scrambledenvs@check@macrodefined{#1reffont}
+\expandafter\newcommand\csname #1reffont\endcsname[1]{\expandafter\def\csname scrambledenvs@#1@reffont\endcsname{##1}}
+%</main>
+% \fi
+%
+% \DescribeMacro{\hintprintenv}
+% When the randomized hints are printed at the end, the actual printed contents are wrapped around an environment. By default the beginning of the environment is |\begin{enumerate}| and the end is |\end{enumerate}|.
+%
+% To change these, write |\hintprintenv{new env beginning}{new env ending}|.
+%
+% \iffalse
+%<*main>
+\newenvironment{scrambledenvs@#1@printenv}{\begin{scrambledenvs@printenv}}{\end{scrambledenvs@printenv}}
+\scrambledenvs@check@envdefined{#1printenv}
+\expandafter\newcommand\csname #1printenv\endcsname[2]{\renewenvironment{scrambledenvs@#1@printenv}{##1}{##2}}
+%</main>
+% \fi
+%
+% \DescribeMacro{\hintprintitem}
+% Each item of the randomized hints is printed with |\hintprintitem| at the beginning. By default it is |\item|.
+%
+% The way this is defined also allows for changing the font of the output. So if you want to bold the hint text, you could write |\hintprintitem{\bfseries\item}|.
+% \iffalse
+%<*main>
+\expandafter\def\csname scrambledenvs@#1@printitem\endcsname{\scrambledenvs@printitem}
+\scrambledenvs@check@macrodefined{#1printitem}
+\expandafter\newcommand\csname #1printitem\endcsname[1]{\expandafter\def\csname scrambledenvs@#1@printitem\endcsname{##1}}
+%</main>
+% \fi
+%
+% You may also change the defaults of all these pieces \emph{except the label} with the following macros. (The names of these macros make it impossible to pass in |\newscrambledenv{default}|, but there is no reason to do such a thing anyway.)
+%
+% If, at any point, you change the defaults, \emph{all} fonts/formats that have not been custom-set will be changed, including those of previously defined scrambled environments.
+%
+% Usage is identical to configuring formatting for specific scrambled environments.
+%
+% \DescribeMacro{\defaultlabelfont}
+% Changes the default label font.
+% \iffalse
+%<*helper>
+\def\scrambledenvs@labelfont{\bfseries}
+\def\defaultlabelfont#1{\def\scrambledenvs@lineformat{#1}}
+%</helper>
+% \fi
+%
+% \DescribeMacro{\defaultreffont}
+% Changes the default reference font.
+% \iffalse
+%<*helper>
+\def\scrambledenvs@reffont{}
+\def\defaultreffont#1{\def\scrambledenvs@reffont{#1}}
+%</helper>
+% \fi
+%
+% \DescribeMacro{\defaultprintenv}
+% Changes the default print environment.
+% \iffalse
+%<*helper>
+\newenvironment{scrambledenvs@printenv}{\begin{enumerate}}{\end{enumerate}}
+\def\defaultprintenv#1#2{\renewenvironment{scrambledenvs@printenv}{#1}{#2}}
+%</helper>
+%\fi
+%
+% \DescribeMacro{\defaultprintitem}
+% Changes the formatting of the default print item.
+% \iffalse
+%<*helper>
+\def\scrambledenvs@printitem{\item}
+\def\defaultprintitem#1{\def\scrambledenvs@printitem{#1}}
+%</helper>
+% \fi
+%
+% \section{Examples}
+% In all of the examples, we use |hint| as our generic scrambled environment.
+% \subsection{A barebones example}
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{scrambledenvs}
+%\newscrambledenv{hint}
+%
+%\begin{document}
+%This is a really hard problem, so we provide hints.\begin{hints}
+%\begin{addhint}
+%This is a helpful hint.
+%\end{addhint}
+%\begin{addhint}
+%And another one!
+%\end{addhint}
+%\end{hints}
+%
+%\section{Hints printed}
+%
+%\printhint
+%
+%\end{document}
+%\end{verbatim}
+% \subsection{Changing hint formatting}
+% Changing default formatting is identical, except there is no way to change the label. (We do not include the document body since we have already shown how that works.)
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{scrambledenvs}
+%\usepackage{xcolor}
+%\newscrambledenv{hint}
+%\hintlabel{tip}
+%\hintlabelfont{\textit}
+%\hintreffont{\color{blue}\bfseries}
+%\hintprintenv{\begin{enumerate}\small}{\end{enumerate}}
+%\hintprintitem{\bfseries\item}
+%\end{verbatim}
+% \subsection{Changing hintreffont color: hpyerrefs colorlink}
+% Since we are using |\ref| to typeset labels (which are set with |\label|), if we use |colorlinks| from package |hyperref| we must locally change the linkcolor in order to change the color the numbers are typeset in.
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{scrambledenvs}
+%\usepackage{xcolor}
+%\usepackage{hyperref}
+%\hypersetup{colorlinks}
+%\newscrambledenv{hint}
+%\hintreffont{\hypersetup{linkcolor=blue}}
+%\end{verbatim}
+% ^^A At the end, close brace
+%\iffalse
+%<*main>
+}
+%</main>
+%\fi
+% \Finale
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/scrambledenvs/scrambledenvs.pdf b/macros/latex/contrib/scrambledenvs/scrambledenvs.pdf
new file mode 100644
index 0000000000..079d211a9f
--- /dev/null
+++ b/macros/latex/contrib/scrambledenvs/scrambledenvs.pdf
Binary files differ
diff --git a/macros/latex/contrib/tabularray/tabularray.pdf b/macros/latex/contrib/tabularray/tabularray.pdf
index ba8b283884..c7b3de29ca 100644
--- a/macros/latex/contrib/tabularray/tabularray.pdf
+++ b/macros/latex/contrib/tabularray/tabularray.pdf
Binary files differ
diff --git a/macros/latex/contrib/tabularray/tabularray.sty b/macros/latex/contrib/tabularray/tabularray.sty
index 0a12e61ba5..4717992539 100644
--- a/macros/latex/contrib/tabularray/tabularray.sty
+++ b/macros/latex/contrib/tabularray/tabularray.sty
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\ProvidesExplPackage{tabularray}{2021-07-01}{2021L}
+\ProvidesExplPackage{tabularray}{2021-08-01}{2021M}
{Typeset tabulars and arrays with LaTeX3}
\RequirePackage{xparse}
@@ -359,6 +359,7 @@
\__tblr_data_new_key:nnn { row } { @row-foot } { dim }
\__tblr_data_new_key:nnn { row } { @row-upper } { dim }
\__tblr_data_new_key:nnn { row } { @row-lower } { dim }
+\__tblr_data_new_key:nnn { row } { break } { int }
\int_new:N \g__tblr_data_column_key_count_int
\__tblr_data_new_key:nnn { column } { width } { dim }
@@ -858,12 +859,30 @@
}
}
+\tl_new:N \l__tblr_child_from_tl
+\tl_new:N \l__tblr_child_to_tl
+
\cs_new_protected_nopar:Npn \__tblr_get_childs_normal_aux:w #1 - #2 \scan_stop
{
- \int_step_inline:nnn {#1} {#2}
+ \__tblr_child_name_to_index:nN {#1} \l__tblr_child_from_tl
+ \__tblr_child_name_to_index:nN {#2} \l__tblr_child_to_tl
+ \int_step_inline:nnn { \l__tblr_child_from_tl } { \l__tblr_child_to_tl }
{ \clist_put_right:Nn \l_tblr_childs_clist {##1} }
}
+\regex_const:Nn \c__tblr_child_name_regex { ^ [X-Z] $ }
+
+%% Convert X, Y, Z to the indexes of the last three childs, respectively
+\cs_new_protected_nopar:Npn \__tblr_child_name_to_index:nN #1 #2
+ {
+ \regex_match:NnTF \c__tblr_child_name_regex {#1}
+ {
+ \tl_set:Nx #2
+ { \int_eval:n { \l_tblr_childs_total_tl + \int_from_alph:n {#1} - 26 } }
+ }
+ { \tl_set:Nx #2 { #1 } }
+ }
+
%%% --------------------------------------------------------
%% \section{New Table Commands}
%%% --------------------------------------------------------
@@ -929,6 +948,20 @@
\int_set:Nn \c@colnum {#2}
}
+%% Table commands are defined only inside tblr environments,
+%% but some packages such as csvsimple need to use them outside tblr environments,
+%% therefore we define some of them first here.
+\ProvideDocumentCommand \SetHlines { o m m } {}
+\ProvideDocumentCommand \SetHline { o m m } {}
+\ProvideDocumentCommand \SetVlines { o m m } {}
+\ProvideDocumentCommand \SetVline { o m m } {}
+\ProvideDocumentCommand \SetCells { o m } {}
+\ProvideDocumentCommand \SetCell { o m } {}
+\ProvideDocumentCommand \SetRows { o m } {}
+\ProvideDocumentCommand \SetRow { o m } {}
+\ProvideDocumentCommand \SetColumns { o m } {}
+\ProvideDocumentCommand \SetColumn { o m } {}
+
%%% --------------------------------------------------------
%%> \section{New Content Commands}
%%% --------------------------------------------------------
@@ -1958,8 +1991,9 @@
abovesep+ .code:n = \__tblr_row_gadd_dimen:ne { abovesep } { \dim_eval:n {#1} },
belowsep+ .code:n = \__tblr_row_gadd_dimen:ne { belowsep } { \dim_eval:n {#1} },
rowsep+ .meta:n = { abovesep+ = #1, belowsep+ = #1},
- nobreak .code:n = \__tblr_prop_gput:nxx { row }
- { [\int_eval:n {\c@rownum - 1}] / nobreak } { true },
+ break .code:n = \__tblr_row_gput:nn { break } {#1},
+ pagebreak .meta:n = { break = 1 },
+ nopagebreak .meta:n = { break = -1 },
unknown .code:n = \__tblr_row_unknown_key:V \l_keys_key_str,
}
@@ -2028,6 +2062,16 @@
}
\cs_generate_variant:Nn \__tblr_row_unknown_key:n { V }
+\NewTableCommand \pagebreak
+ {
+ \tblr_set_row:nn {} { break = 1 }
+ }
+
+\NewTableCommand \nopagebreak
+ {
+ \tblr_set_row:nn {} { break = -1 }
+ }
+
%%% --------------------------------------------------------
%% \section{Column Types and Row Types}
%%% --------------------------------------------------------
@@ -2357,6 +2401,8 @@
\NewTblrEnviron { tblr }
\NewTblrEnviron { longtblr }
\SetTblrOuter [ longtblr ] { long }
+\NewTblrEnviron { talltblr }
+\SetTblrOuter [ talltblr ] { tall }
\tl_new:N \l__tblr_env_name_tl
\bool_new:N \l__tblr_math_mode_bool
@@ -2378,16 +2424,16 @@
\int_gincr:N \g_tblr_level_int
\__tblr_clear_prop_lists:
\__tblr_clear_spec_lists:
- \__tblr_enable_table_commands:
- \LogTblrTracing { step = split ~ table}
- \__tblr_split_table:n {#3}
- \LogTblrTracing { command }
\LogTblrTracing { step = init ~ table ~ outer ~ spec}
\__tblr_init_table_outer_spec:
- \LogTblrTracing { outer }
\LogTblrTracing { step = parse ~ table ~ options }
\__tblr_parse_table_option:n {#1}
+ \LogTblrTracing { outer }
\LogTblrTracing { option }
+ \__tblr_enable_table_commands:
+ \LogTblrTracing { step = split ~ table}
+ \__tblr_split_table:n {#3}
+ \LogTblrTracing { command }
\bool_if:NT \g__tblr_use_intarray_bool { \__tblr_init_table_data: }
\LogTblrTracing { step = init ~ table ~ inner ~ spec}
\__tblr_init_table_inner_spec:
@@ -2439,35 +2485,54 @@
\regex_replace_all:NVN \c__tblr_remove_braces_regex \c__tblr_remove_braces_tl #1
}
-%% Split table content to cells and store them
-%% #1: table content
+\tl_new:N \l__tblr_body_tl
+\tl_new:N \l__tblr_expand_tl
+\seq_new:N \l__tblr_lines_seq
-\seq_new:N \l_tblr_lines_seq
+%% Expand every occurrence of the specified macro once
+%% #1: table content; #2: macro to be expanded
+\cs_new_protected:Npn \__tblr_expand_table_body:nN #1 #2
+ {
+ \tl_clear:N \l__tblr_body_tl
+ \cs_set_protected:Npn \__tblr_expand_table_body_aux:w ##1 #2
+ {
+ \tl_put_right:Nn \l__tblr_body_tl {##1}
+ \peek_meaning:NTF \q_stop
+ { \use_none:n }
+ { \exp_last_unbraced:NV \__tblr_expand_table_body_aux:w #2 }
+ }
+ \__tblr_expand_table_body_aux:w #1 #2 \q_stop
+ }
+%% Split table content to cells and store them
+%% #1: table content
\cs_new_protected:Npn \__tblr_split_table:n #1
{
+ \tl_set:Nx \l__tblr_expand_tl { \__tblr_spec_item:nn { outer } { expand } }
+ \tl_set:Nx \l__tblr_expand_tl { \tl_head:N \l__tblr_expand_tl }
+ \tl_if_empty:NTF \l__tblr_expand_tl
+ { \tl_set:Nn \l__tblr_body_tl {#1} }
+ { \exp_args:NnV \__tblr_expand_table_body:nN {#1} \l__tblr_expand_tl }
\int_zero:N \c@rowcount
\int_zero:N \c@colcount
- \__tblr_split_table_to_lines:nN { #1 } \l_tblr_lines_seq
- \__tblr_split_lines_to_cells:N \l_tblr_lines_seq
+ \__tblr_split_table_to_lines:NN \l__tblr_body_tl \l__tblr_lines_seq
+ \__tblr_split_lines_to_cells:N \l__tblr_lines_seq
}
%% Split table content to a sequence of lines
-%% #1: table content, #2: resulting sequence of lines
-\cs_new_protected:Npn \__tblr_split_table_to_lines:nN #1 #2
+%% #1: tl with table contents, #2: resulting sequence of lines
+\cs_new_protected:Npn \__tblr_split_table_to_lines:NN #1 #2
{
- \tl_set:Nn \l_tmpa_tl { #1 }
- \__tblr_insert_braces:N \l_tmpa_tl
- \seq_set_split:NnV \l_tmpa_seq { \\ } \l_tmpa_tl
+ \__tblr_insert_braces:N #1
+ \seq_set_split:NnV \l_tmpa_seq { \\ } #1
\seq_clear:N #2
\seq_map_inline:Nn \l_tmpa_seq
{
\tl_if_head_eq_meaning:nNTF {##1} *
{
- \tl_set:Nn \l__tblr_b_tl { \SetRow{nobreak} }
+ \tl_set:Nn \l__tblr_b_tl { \SetRow { break = -1 } }
\tl_set:Nx \l__tblr_c_tl { \tl_tail:n {##1} }
\tl_trim_spaces:N \l__tblr_c_tl %% Ignore spaces between * and [dimen]
- \tl_log:N \l__tblr_c_tl
\tl_if_head_eq_meaning:VNT \l__tblr_c_tl [
{
\tl_put_right:Nn \l__tblr_b_tl { \RowBefore@AddBelowSep }
@@ -2699,6 +2764,8 @@
@vline-count = 0,
}
+\tl_new:N \l__tblr_inner_spec_verb_tl
+
\cs_new_protected:Npn \__tblr_init_table_inner_spec:
{
\prop_map_inline:Nn \g__tblr_initial_table_prop
@@ -2745,6 +2812,7 @@
\__tblr_spec_gput:nen { vline }
{ [\int_eval:n { \c@colcount + 1}] / ##1 } {##2}
}
+ \tl_clear:N \l__tblr_inner_spec_verb_tl
\keys_set:nv { tblr } { l__tblr_default_ \l__tblr_env_name_tl _inner_tl }
}
@@ -2755,7 +2823,7 @@
\clist_new:N \g__tblr_table_known_keys_clist
\clist_gset:Nn \g__tblr_table_known_keys_clist
{
- colspec, rowspec, width, hspan, vspan, stretch,
+ colspec, rowspec, width, hspan, vspan, stretch, verb,
column, row, cell, vline, hline, columns, rows, cells, vlines, hlines,
leftsep, rightsep, colsep, abovesep, belowsep, rowsep, rulesep,
rowhead, rowfoot,
@@ -2769,6 +2837,8 @@
hspan .code:n = \__tblr_keys_gput:nn { hspan } {#1},
vspan .code:n = \__tblr_keys_gput:nn { vspan } {#1},
stretch .code:n = \__tblr_keys_gput:nn { stretch } {#1},
+ verb .tl_set:N = \l__tblr_inner_spec_verb_tl,
+ verb .default:n = lite,
columns .code:n = \__tblr_set_every_column_aux:n {#1},
rows .code:n = \__tblr_set_every_row_aux:n {#1},
cells .code:n = \__tblr_set_every_cell_aux:n {#1},
@@ -2851,7 +2921,8 @@
\keys_define:nn { tblr-outer }
{
- long .code:n = \__tblr_outer_gput_spec:nn { long } {true},
+ long .code:n = \__tblr_outer_gput_spec:nn { long } { true },
+ tall .code:n = \__tblr_outer_gput_spec:nn { tall } { true },
halign .code:n = \__tblr_outer_gput_spec:nn { halign } {#1},
valign .code:n = \__tblr_outer_gput_spec:nn { valign } {#1},
l .meta:n = { halign = l },
@@ -2860,6 +2931,7 @@
t .meta:n = { valign = t },
m .meta:n = { valign = m },
b .meta:n = { valign = b },
+ expand .code:n = \__tblr_outer_gput_spec:nn { expand } {#1},
headsep .code:n = \__tblr_outer_gput_spec:nn { headsep } {#1},
footsep .code:n = \__tblr_outer_gput_spec:nn { footsep } {#1},
presep .code:n = \__tblr_outer_gput_spec:nn { presep } {#1},
@@ -3252,7 +3324,11 @@
\seq_map_variable:NNn \l_tmpa_seq \l_tmpa_tl
{
\__tblr_remove_braces:N \l_tmpa_tl
- \hbox_set:Nn \l_tmpa_box { \l__tblr_f_tl \l_tmpa_tl }
+ \hbox_set:Nn \l_tmpa_box
+ {
+ \l__tblr_f_tl
+ \__tblr_rescan_cell_tokens:N \l_tmpa_tl
+ }
\tl_set:Nx \l__tblr_w_tl
{ \dim_max:nn { \l__tblr_w_tl } { \box_wd:N \l_tmpa_box } }
}
@@ -3267,8 +3343,8 @@
\cs_new_protected:Npn \__tblr_get_vcell_and_sizes:NN #1 #2
{
\group_begin:
- \vbox_set_top:Nn \l_tmpa_box { \__tblr_make_vcell_text:nN #1 #2 }
- \vbox_set:Nn \l_tmpb_box { \__tblr_make_vcell_text:nN #1 #2 }
+ \vbox_set_top:Nn \l_tmpa_box { \__tblr_make_vcell_text:NN #1 #2 }
+ \vbox_set:Nn \l_tmpb_box { \__tblr_make_vcell_text:NN #1 #2 }
\dim_gset:Nn \g__tblr_cell_wd_dim { \box_wd:N \l_tmpb_box }
\dim_gset:Nn \g__tblr_cell_ht_dim
{ \box_ht:N \l_tmpb_box + \box_dp:N \l_tmpb_box }
@@ -3312,17 +3388,30 @@
%% #1: cell text; #2: box width
%% All halign commands are defined at the beginning of the file
-\cs_new_protected:Npn \__tblr_make_vcell_text:nN #1 #2
+\cs_new_protected:Npn \__tblr_make_vcell_text:NN #1 #2
{
\dim_set:Nn \tex_hsize:D { #2 }
\@arrayparboxrestore
\cs:w __tblr_halign_command_ \g__tblr_cell_halign_tl : \cs_end:
\mode_leave_vertical:
\box_use:N \l__tblr_strut_ht_box
- \bool_if:NTF \l__tblr_math_mode_bool { $#1$ } { #1 }
+ \bool_if:NTF \l__tblr_math_mode_bool
+ { $#1$ }
+ { \__tblr_rescan_cell_tokens:N #1 }
\box_use:N \l__tblr_strut_dp_box
}
+\cs_new_protected:Npn \__tblr_rescan_cell_tokens:N #1
+ {
+ \tl_if_empty:NTF \l__tblr_inner_spec_verb_tl
+ { #1 }
+ {
+ \regex_replace_all:nnN { . } { \c{string} \0 } #1
+ \tl_set:Nx #1 { #1 }
+ \exp_args:NV \tex_scantokens:D #1
+ }
+ }
+
%% #1: total height dimension; #2: head dimension; #3: foot dimension;
%% #4: tl for resulting upper size; #5: tl for resulting lower size
@@ -4315,6 +4404,7 @@
\DefTblrTemplate { contfoot-text } { normal } { Continued ~ on ~ next ~ page }
\SetTblrTemplate { contfoot-text } { normal }
+\DefTblrTemplate { contfoot } { empty } { }
\DefTblrTemplate { contfoot } { plain }
{
\noindent
@@ -4338,6 +4428,7 @@
\DefTblrTemplate { conthead-text } { normal } { ( Continued ) }
\SetTblrTemplate { conthead-text } { normal }
+\DefTblrTemplate { conthead } { empty } { }
\DefTblrTemplate { conthead } { plain }
{
\noindent
@@ -4364,6 +4455,7 @@
\tl_new:N \l__tblr_caption_short_tl
+\DefTblrTemplate { caption-lot } { empty } { }
\DefTblrTemplate { caption-lot } { normal }
{
\tl_set:Nx \l__tblr_caption_short_tl { \InsertTblrText { entry } }
@@ -4377,18 +4469,22 @@
%% We need to use \hspace and \enskip, but not ~ or \space,
%% since we want a correct hangindent caption paragraph.
+\DefTblrTemplate { caption-tag } { empty } { }
\DefTblrTemplate { caption-tag } { normal } { Table \hspace{0.25em} \thetable }
\SetTblrTemplate { caption-tag } { normal }
+\DefTblrTemplate { caption-sep } { empty } { }
\DefTblrTemplate { caption-sep } { normal } { : \enskip }
\SetTblrTemplate { caption-sep } { normal }
+\DefTblrTemplate { caption-text } { empty } { }
\DefTblrTemplate { caption-text } { normal } { \InsertTblrText { caption } }
\SetTblrTemplate { caption-text } { normal }
\box_new:N \l__tblr_caption_box
\box_new:N \l__tblr_caption_left_box
+\DefTblrTemplate { caption } { empty } { }
\DefTblrTemplate { caption } { plain }
{
\hbox_set:Nn \l__tblr_caption_box
@@ -4441,6 +4537,7 @@
}
\SetTblrTemplate { caption } { normal }
+\DefTblrTemplate { capcont } { empty } { }
\DefTblrTemplate { capcont } { plain }
{
\hbox_set:Nn \l__tblr_caption_box
@@ -4536,6 +4633,7 @@
{ \textsuperscript { \sffamily \UseTblrFont { note-tag } #1 } }
}
+\DefTblrTemplate { note-tag } { empty } { }
\DefTblrTemplate { note-tag } { normal }
{
\textsuperscript { \sffamily \UseTblrFont { note-tag } \InsertTblrNoteTag }
@@ -4548,12 +4646,15 @@
}
\SetTblrTemplate { note-target } { normal }
+\DefTblrTemplate { note-sep } { empty } { }
\DefTblrTemplate { note-sep } { normal } { \space }
\SetTblrTemplate { note-sep } { normal }
+\DefTblrTemplate { note-text } { empty } { }
\DefTblrTemplate { note-text } { normal } { \InsertTblrNoteText }
\SetTblrTemplate { note-text } { normal }
+\DefTblrTemplate { note } { empty } { }
\DefTblrTemplate { note } { plain }
{
\MapTblrNotes
@@ -4608,18 +4709,22 @@
%%> \section{Table Remarks Templates}
%%% --------------------------------------------------------
+\DefTblrTemplate { remark-tag } { empty } { }
\DefTblrTemplate { remark-tag } { normal }
{
\itshape \UseTblrFont { remark-tag } \InsertTblrRemarkTag
}
\SetTblrTemplate { remark-tag } { normal }
+\DefTblrTemplate { remark-sep } { empty } { }
\DefTblrTemplate { remark-sep } { normal } { : \space }
\SetTblrTemplate { remark-sep } { normal }
+\DefTblrTemplate { remark-text } { empty } { }
\DefTblrTemplate { remark-text } { normal } { \InsertTblrRemarkText }
\SetTblrTemplate { remark-text } { normal }
+\DefTblrTemplate { remark } { empty } { }
\DefTblrTemplate { remark } { plain }
{
\MapTblrRemarks
@@ -4687,10 +4792,12 @@
foot .meta:n = { firstfoot, middlefoot, lastfoot },
}
+\DefTblrTemplate { head } { empty } { }
+\DefTblrTemplate { foot } { empty } { }
+
\DefTblrTemplate { firsthead } { normal }
{
\UseTblrTemplate { caption } { default }
- \UseTblrTemplate { caption-lot } { default }
}
\DefTblrTemplate { middlehead, lasthead } { normal }
@@ -4793,8 +4900,7 @@
\__tblr_get_table_width:
\__tblr_build_table_head_aux:Nn \l__tblr_table_firsthead_box
{
- \tl_set:Nn \l_tmpa_tl { \InsertTblrText { label } }
- \tl_if_empty:NF \l_tmpa_tl { \exp_args:NV \label \l_tmpa_tl }
+ \__tblr_build_table_label_entry:
\UseTblrTemplate { firsthead } { default }
}
\__tblr_build_table_head_aux:Nn
@@ -4809,6 +4915,35 @@
\l__tblr_table_lastfoot_box { \UseTblrTemplate { lastfoot } { default } }
}
+\cs_new_protected:Npn \__tblr_build_tall_table_head_foot:
+ {
+ \__tblr_get_table_width:
+ \__tblr_build_table_head_aux:Nn \l__tblr_table_firsthead_box
+ {
+ \__tblr_build_table_label_entry:
+ \UseTblrTemplate { firsthead } { default }
+ }
+ \__tblr_build_table_foot_aux:Nn
+ \l__tblr_table_lastfoot_box { \UseTblrTemplate { lastfoot } { default } }
+ }
+
+\cs_new_protected:Npn \__tblr_build_table_label_entry:
+ {
+ \tl_set:Nx \l_tmpa_tl { \InsertTblrText { label } }
+ \tl_if_eq:NnTF \l_tmpa_tl { none }
+ {
+ \SetTblrTemplate { caption-tag }{ empty }
+ \SetTblrTemplate { caption-sep }{ empty }
+ }
+ {
+ \refstepcounter { table }
+ \tl_if_empty:NF \l_tmpa_tl { \exp_args:NV \label \l_tmpa_tl }
+ }
+ \tl_set:Nx \l_tmpb_tl { \InsertTblrText { entry } }
+ \tl_if_eq:NnF \l_tmpb_tl { none }
+ { \UseTblrTemplate { caption-lot } { default } }
+ }
+
\cs_new_protected:Npn \__tblr_build_table_head_aux:Nn #1 #2
{
\vbox_set:Nn #1
@@ -4835,14 +4970,27 @@
{
\tl_if_eq:enTF { \__tblr_spec_item:nn { outer } { long } } { true }
{ \__tblr_build_long_table:e { \__tblr_spec_item:nn { outer } { halign } } }
- { \__tblr_build_short_table:e { \__tblr_spec_item:nn { outer } { valign } } }
+ {
+ \tl_if_eq:enTF { \__tblr_spec_item:nn { outer } { tall } } { true }
+ {
+ \__tblr_build_tall_table:e
+ { \__tblr_spec_item:nn { outer } { valign } }
+ }
+ {
+ \__tblr_build_short_table:e
+ { \__tblr_spec_item:nn { outer } { valign } }
+ }
+ }
}
\dim_new:N \l__tblr_remain_height_dim
-\tl_new:N \l__tblr_long_from_tl
-\tl_new:N \l__tblr_long_to_tl
+\int_new:N \l__tblr_long_from_int
+\int_new:N \l__tblr_long_to_int
+\int_new:N \l__tblr_curr_i_int
+\int_new:N \l__tblr_prev_i_int
\int_new:N \l__tblr_table_page_int
-\bool_new:N \l__tblr_table_page_break_bool
+\bool_new:N \l__tblr_page_break_curr_bool
+\bool_new:N \l__tblr_page_break_prev_bool
%% #1: table alignment
%% For long table, we need to leave hmode first to get correct \pagetotal
@@ -4862,37 +5010,29 @@
\hrule height ~ 0pt
\LogTblrTracing { page }
\int_set:Nn \l__tblr_table_page_int {1}
- \refstepcounter { table }
\__tblr_build_head_foot:
\dim_set:Nn \l__tblr_remain_height_dim
{ \pagegoal - \pagetotal - \l__tblr_row_head_foot_dim }
- \tl_set:Nx \l__tblr_long_from_tl { \int_eval:n { \l__tblr_row_head_tl + 1 } }
- \tl_set:Nx \l__tblr_long_to_tl
- { \int_eval:n { \c@rowcount - ( \l__tblr_row_foot_tl + 0 ) } }
- \int_step_variable:nnNn
- { \l__tblr_long_from_tl } { \l__tblr_long_to_tl } \l__tblr_i_tl
- {
- \dim_set:Nn \l_tmpa_dim
- {
- \__tblr_data_item:nen { row } { \l__tblr_i_tl } { abovesep }
- +
- \__tblr_data_item:nen { row } { \l__tblr_i_tl } { @row-height }
- +
- \__tblr_data_item:nen { row } { \l__tblr_i_tl } { belowsep }
- +
- \__tblr_spec_item:ne { hline }
- { [ \int_eval:n { \l__tblr_i_tl + 1} ] / @hline-height }
- }
+ \int_set:Nn \l__tblr_long_from_int { \l__tblr_row_head_tl + 1 }
+ \int_set:Nn \l__tblr_long_to_int { \c@rowcount - ( \l__tblr_row_foot_tl + 0 ) }
+ \int_set:Nn \l__tblr_curr_i_int { \l__tblr_long_from_int - 1 }
+ \int_do_while:nNnn { \l__tblr_curr_i_int } < { \l__tblr_long_to_int }
+ {
+ \int_set_eq:NN \l__tblr_prev_i_int \l__tblr_curr_i_int
+ \__tblr_get_next_table_rows:NNNN
+ \l__tblr_long_to_int \l__tblr_curr_i_int
+ \l_tmpa_dim \l__tblr_page_break_curr_bool
\__tblr_check_table_page_break:NNN
- \l__tblr_remain_height_dim \l_tmpa_dim \l__tblr_table_page_break_bool
- \bool_if:NTF \l__tblr_table_page_break_bool
+ \l__tblr_remain_height_dim \l_tmpa_dim \l__tblr_page_break_prev_bool
+ \bool_if:NTF \l__tblr_page_break_prev_bool
{
- \__tblr_do_if_tracing:nn { page } { \tl_log:N \l__tblr_i_tl }
- \int_compare:nNnT
- { \l__tblr_i_tl - \l__tblr_long_from_tl } > {1}
+ \__tblr_do_if_tracing:nn { page } { \int_log:N \l__tblr_curr_i_int }
+ \int_compare:nNnF
+ { \l__tblr_prev_i_int - \l__tblr_long_from_int } < {0}
{
\__tblr_build_page_table:nnx {#1}
- { \l__tblr_long_from_tl } { \int_eval:n { \l__tblr_i_tl - 1 } }
+ { \int_use:N \l__tblr_long_from_int }
+ { \int_use:N \l__tblr_prev_i_int }
\int_incr:N \l__tblr_table_page_int
}
\newpage
@@ -4901,10 +5041,24 @@
\LogTblrTracing { page }
\dim_set:Nn \l__tblr_remain_height_dim
{ \pagegoal - \pagetotal - \l__tblr_row_head_foot_dim - \l_tmpa_dim }
- \tl_set_eq:NN \l__tblr_long_from_tl \l__tblr_i_tl
+ \int_set:Nn \l__tblr_long_from_int { \l__tblr_prev_i_int + 1 }
}
{
- \dim_add:Nn \l__tblr_remain_height_dim { -\l_tmpa_dim }
+ \bool_if:NTF \l__tblr_page_break_curr_bool
+ {
+ \__tblr_build_page_table:nnx {#1}
+ { \int_use:N \l__tblr_long_from_int }
+ { \int_use:N \l__tblr_curr_i_int }
+ \int_incr:N \l__tblr_table_page_int
+ \newpage
+ \hbox{}\kern-\topskip\nobreak
+ \noindent
+ \LogTblrTracing { page }
+ \dim_set:Nn \l__tblr_remain_height_dim
+ { \pagegoal - \pagetotal - \l__tblr_row_head_foot_dim }
+ \int_set:Nn \l__tblr_long_from_int { \l__tblr_curr_i_int + 1 }
+ }
+ { \dim_add:Nn \l__tblr_remain_height_dim { -\l_tmpa_dim } }
}
}
\int_compare:nNnTF { \l__tblr_table_page_int } = {1}
@@ -4916,13 +5070,49 @@
\box_set_eq:NN \l__tblr_table_head_box \l__tblr_table_lasthead_box
\box_set_eq:NN \l__tblr_table_foot_box \l__tblr_table_lastfoot_box
}
- \__tblr_build_page_table:nnn
- {#1} { \l__tblr_long_from_tl } { \l__tblr_long_to_tl }
+ \__tblr_build_page_table:nnn {#1}
+ { \int_use:N \l__tblr_long_from_int } { \int_use:N \l__tblr_long_to_int }
\skip_vertical:n { \__tblr_spec_item:nn { outer } { postsep } }
\hrule height ~ 0pt
}
\cs_generate_variant:Nn \__tblr_build_long_table:n { e }
+%% #1: int with index of the last row; #2: int with index of current row;
+%% #3: row dimension; #4: break page or not.
+\cs_new_protected:Npn \__tblr_get_next_table_rows:NNNN #1 #2 #3 #4
+ {
+ \bool_set_true:N \l_tmpa_bool
+ \dim_zero:N #3
+ \bool_set_false:N #4
+ \bool_while_do:Nn \l_tmpa_bool
+ {
+ \int_incr:N #2
+ \dim_add:Nn #3
+ {
+ \__tblr_data_item:nen { row } { \int_use:N #2 } { abovesep }
+ +
+ \__tblr_data_item:nen { row } { \int_use:N #2 } { @row-height }
+ +
+ \__tblr_data_item:nen { row } { \int_use:N #2 } { belowsep }
+ +
+ \__tblr_spec_item:ne { hline }
+ { [ \int_eval:n { #2 + 1 } ] / @hline-height }
+ }
+ \int_compare:nNnTF {#2} < {#1}
+ {
+ \tl_set:Nx \l__tblr_b_tl
+ { \__tblr_data_item:nen { row } { \int_eval:n { #2 + 1 } } { break } }
+ \int_compare:nNnTF { \l__tblr_b_tl } < { 0 }
+ { \bool_set_true:N \l_tmpa_bool }
+ {
+ \bool_set_false:N \l_tmpa_bool
+ \int_compare:nNnT { \l__tblr_b_tl } > { 0 } { \bool_set_true:N #4 }
+ }
+ }
+ { \bool_set_false:N \l_tmpa_bool }
+ }
+ }
+
\box_new:N \l__tblr_table_head_box
\box_new:N \l__tblr_table_foot_box
\dim_new:N \l__tblr_table_head_foot_dim
@@ -5000,6 +5190,28 @@
}
%% #1: table alignment
+%% For tall table, we need to leave vmode first.
+%% Since there may be \centering in table environment,
+%% We use \raggedright to reset alignement for table head/foot.
+\cs_new_protected:Npn \__tblr_build_tall_table:n #1
+ {
+ \mode_leave_vertical:
+ \raggedright
+ \__tblr_build_tall_table_head_foot:
+ \__tblr_build_one_table:nn {1} {\c@rowcount}
+ \vbox_set:Nn \l__tblr_table_box
+ {
+ \box_use:N \l__tblr_table_firsthead_box
+ \hrule height ~ 0pt
+ \box_use:N \l__tblr_table_box
+ \hrule height ~ 0pt
+ \box_use:N \l__tblr_table_lastfoot_box
+ }
+ \__tblr_valign_whole:Nn \l__tblr_table_box #1
+ }
+\cs_generate_variant:Nn \__tblr_build_tall_table:n { e }
+
+%% #1: table alignment
%% For short table, we need to leave vmode first
\cs_new_protected:Npn \__tblr_build_short_table:n #1
{
@@ -5886,7 +6098,8 @@
\NewTblrLibrary { siunitx }
{
\RequirePackage { siunitx }
- \NewColumnType { S } [1] [] { Q[si = {##1}] }
+ \NewColumnType { S } [1] [] { Q[si = {##1}, c] }
+ \NewColumnType { s } [1] [] { Q[si = {##1}, c, cmd = \TblrUnit] }
\__tblr_data_new_key:nnn { cell } { si } { str }
\keys_define:nn { tblr-column }
{
@@ -5895,12 +6108,20 @@
\cs_new_protected:Npn \__tblr_siunitx_setcolumn:n ##1
{
\__tblr_column_gput_cell:nn { si } {##1}
- \__tblr_process_text_for_every_column_cell:n { \__tblr_siunitx_tablenum:n }
+ \__tblr_process_text_for_every_column_cell:n { \TblrNum }
+ }
+ \NewDocumentCommand \TblrNum { m }
+ {
+ \__tblr_siunitx_process:Nn \tablenum {##1}
+ }
+ \NewDocumentCommand \TblrUnit { m }
+ {
+ \__tblr_siunitx_process:Nn \si {##1}
}
- \cs_new_protected:Npn \__tblr_siunitx_tablenum:n ##1
+ \cs_new_protected:Npn \__tblr_siunitx_process:Nn ##1 ##2
{
- \tl_if_head_is_group:nTF {##1}
- { ##1 }
+ \tl_if_head_is_group:nTF {##2}
+ { ##2 }
{
\group_begin:
\tl_set:Nx \l_tmpa_tl
@@ -5909,7 +6130,7 @@
{ \int_use:N \c@rownum } { \int_use:N \c@colnum } { si }
}
\exp_args:NV \sisetup \l_tmpa_tl
- \tablenum {##1}
+ ##1 {##2}
\group_end:
}
}
diff --git a/macros/latex/contrib/tabularray/tabularray.tex b/macros/latex/contrib/tabularray/tabularray.tex
index 45d486d995..1e5b4a104e 100644
--- a/macros/latex/contrib/tabularray/tabularray.tex
+++ b/macros/latex/contrib/tabularray/tabularray.tex
@@ -6,7 +6,10 @@
\usepackage{codehigh} % https://ctan.org/pkg/codehigh
\usepackage{tabularray}
\usepackage{array,multirow,amsmath}
-\usepackage{chemmacros}
+\usepackage{chemmacros,environ}
+
+\usepackage[firstpage=true]{background}
+\backgroundsetup{contents={}}
\UseTblrLibrary{booktabs,diagbox,siunitx}
@@ -14,7 +17,7 @@
\hypersetup{
colorlinks=true,
urlcolor=blue3,
- linkcolor=red3,
+ linkcolor=blue3,
}
\usepackage{tcolorbox}
@@ -26,13 +29,22 @@
\newcommand*{\K}[1]{\texttt{#1}}
\newcommand*{\V}[1]{\texttt{#1}}
+\newcommand*{\None}{$\times$}
+
+\NewTblrEnviron{newtblr}
+\SetTblrOuter[newtblr]{long}
+\SetTblrInner[newtblr]{
+ hlines = {white}, column{1,2} = {co=1}, colsep = 5pt,
+ row{odd} = {brown8}, row{even} = {gray8},
+ row{1} = {fg=white, bg=purple2, font=\bfseries\sffamily},
+}
\NewTblrEnviron{spectblr}
\SetTblrOuter[spectblr]{long}
\SetTblrInner[spectblr]{
- hlines = {white},
- row{odd}={brown8},row{even}={gray8},row{1}={fg=white,bg=purple2,font=\bfseries\sffamily},
- column{2} = {co=1},
+ hlines = {white}, column{2} = {co=1}, colsep = 5pt,
+ row{odd} = {brown8}, row{even} = {gray8},
+ row{1} = {fg=white, bg=purple2, font=\bfseries\sffamily},
rowhead = 1,
}
@@ -47,12 +59,10 @@
\renewcommand*{\thefootnote}{*}
-\newcommand*{\myversion}{2021L}
-\newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)\\\myrepo}
-\newcommand*{\myrepo}{\url{https://github.com/lvjr/tabularray}}
+\newcommand*{\myversion}{2021M}
\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
-\colorlet{highback}{\ifodd\month azure9\else blue9\fi}
+\colorlet{highback}{azure9}
\CodeHigh{language=latex/table,style/main=highback,style/code=highback}
\NewCodeHighEnv{code}{style/main=gray9,style/code=gray9}
\NewCodeHighEnv{demo}{style/main=gray9,style/code=gray9,demo}
@@ -61,10 +71,81 @@
\begin{document}
-\title{\sffamily\color{red3}Tabularray: Typeset Tabulars and Arrays with \LaTeX3}
-\author{Jianrui Lyu (tolvjr@163.com)}
-\date{\mydate}
-\maketitle
+\savegeometry{standard}
+\newgeometry{left=0pt,right=0pt}
+
+\begin{titlepage}
+
+\backgroundsetup{
+ scale = 1,
+ angle = 0,
+ opacity = 1,
+ %color = black,
+ contents = {
+ \begin{tblr}{
+ width = \paperwidth, columns = {1}, rows= {4em},
+ cell{odd}{odd} = {gray9}, cell{even}{even} = {gray9},
+ }
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ & & & & & & & & & & & & & & \\
+ \end{tblr}
+ }
+}
+
+\noindent
+\begin{tblr}{
+ colspec = {lX}, colsep = 12mm, hlines = {2pt, white},
+ row{odd} = {azure8}, row{even} = {gray8},
+ row{1} = {6em,azure2,fg=white,font=\LARGE\bfseries\sffamily},
+ row{2-Z} = {3em,font=\Large},
+}
+ Tabularray & Typeset Tabulars and Arrays with \LaTeX3 \\
+ Author & Jianrui Lyu (tolvjr@163.com) \\
+ Version & \myversion\ (\the\year-\mylpad\month-\mylpad\day) \\
+ Code & \url{https://github.com/lvjr/tabularray} \\
+ Code & \url{https://bitbucket.org/lvjr/tabularray} \\
+ Issue & \url{https://github.com/lvjr/tabularray/issues} \\
+ Forum & \url{https://github.com/lvjr/tabularray/discussions} \\
+\end{tblr}
+
+\begin{codehigh}[boxsep=6mm]
+\begin{tblr}{
+ colspec = {lX}, colsep = 12mm, hlines = {2pt, white},
+ row{odd} = {azure8}, row{even} = {gray8},
+ row{1} = {6em,azure2,fg=white,font=\LARGE\bfseries\sffamily},
+ row{2-Z} = {3em,font=\Large},
+}
+ Tabularray & Typeset Tabulars and Arrays with \LaTeX3 \\
+ Author & Jianrui Lyu (tolvjr@163.com) \\
+ Version & \myversion\ (\the\year-\mylpad\month-\mylpad\day) \\
+ Code & \url{https://github.com/lvjr/tabularray} \\
+ Code & \url{https://bitbucket.org/lvjr/tabularray} \\
+ Issue & \url{https://github.com/lvjr/tabularray/issues} \\
+ Forum & \url{https://github.com/lvjr/tabularray/discussions} \\
+\end{tblr}
+\end{codehigh}
+
+\end{titlepage}
+
+\loadgeometry{standard}
\tableofcontents
@@ -177,7 +258,7 @@ Note that you can use more meaningful \verb!t! instead of \verb!p! for top basel
For some users who are familiar with word processors,
these \verb!t! and \verb!b! columns are counter-intuitive.
In \verb!tabularray! package, there are another two column types \verb!h! and \verb!f!,
-which will align cell text at row head and row foot, respectively:
+which will align cell text at the head and the foot, respectively:
\begin{demohigh}
\begin{tblr}{Q[h,4em]Q[t,4em]Q[m,4em]Q[b,4em]Q[f,4em]}
@@ -191,9 +272,8 @@ which will align cell text at row head and row foot, respectively:
\section{Multirow Cells}
-The above \verb!h! and \verb!f! columns are necessary for multirow cells.
-In \verb!tabularray!, the \verb!t! and \verb!b! in the optional argument of \verb!\multirow! commands
-will be treated as \verb!h! and \verb!f!, respectively:
+The above \verb!h! and \verb!f! alignments are necessary
+when we write multirow cells with \verb!\SetCell! command in \verb!tabularray!.
\begin{demo}
\begin{tabular}{|l|l|l|l|}
@@ -210,8 +290,8 @@ will be treated as \verb!h! and \verb!f!, respectively:
\begin{demohigh}
\begin{tblr}{|l|l|l|l|}
\hline
- \multirow[t]{4}{1.5cm}{Multirow Cell One} & Alpha &
- \multirow[b]{4}{1.5cm}{Multirow Cell Two} & Alpha \\
+ \SetCell[r=4]{h,1.5cm} Multirow Cell One & Alpha &
+ \SetCell[r=4]{f,1.5cm} Multirow Cell Two & Alpha \\
& Beta & & Beta \\
& Gamma & & Gamma \\
& Delta & & Delta \\
@@ -222,7 +302,7 @@ will be treated as \verb!h! and \verb!f!, respectively:
Note that you don't need to load \verb!multirow! package first,
since \verb!tabularray! doesn't depend on it.
Furthermore, \verb!tabularray! will always typeset decent multirow cells.
-First, it will set correct vertical \verb!c! alignment,
+First, it will set correct vertical middle alignment,
even though some rows have large height:
\begin{demo}
@@ -239,7 +319,7 @@ even though some rows have large height:
\begin{demohigh}
\begin{tblr}{|l|m{4em}|}
\hline
- \multirow[c]{4}{1.5cm}{Multirow} & Alpha \\
+ \SetCell[r=4]{m,1.5cm} Multirow & Alpha \\
& Beta \\
& Gamma \\
& Delta Delta Delta \\
@@ -263,7 +343,7 @@ therefore it always avoids vertical overflow:
\begin{demohigh}
\begin{tblr}{|l|m{4em}|}
\hline
- \multirow[c]{2}{1cm}{Line \\ Line \\ Line \\ Line} & Alpha \\
+ \SetCell[r=2]{m,1cm} {Line \\ Line \\ Line \\ Line} & Alpha \\
\cline{2}
& Beta \\
\hline
@@ -477,190 +557,36 @@ Hlines and vlines can also have colors:
\end{tblr}
\end{demohigh}
-\section{New Table Commands}
-
-All commands which change the specifications of tables \textcolor{red3}{must} be defined with \verb!\NewTableCommand!.
-The following example demonstrates how to define similar rules as in \verb!booktabs! package:
+\chapter{Basic Interfaces}
-\begin{codehigh}
-\NewTableCommand\toprule{\hline[0.08em]}
-\NewTableCommand\midrule{\hline[0.05em]}
-\NewTableCommand\bottomrule{\hline[0.08em]}
-\begin{tblr}{llll}
-\toprule
- Alpha & Beta & Gamma & Delta \\
-\midrule
- Epsilon & Zeta & Eta & Theta \\
- Iota & Kappa & Lambda & Mu \\
- Nu & Xi & Omicron & Pi \\
-\bottomrule
-\end{tblr}
-\end{codehigh}
+\section{Old and New Interfaces}
-\chapter{The Old Interfaces}
+With \verb!tabularray! package, you can change the styles of tables via old interfaces or new interfaces.
-With tabularray package, you can still use improved table commands to change the styles of tables.
+The old interfaces consist of some table commands inside the table contents.
Same as \verb!tabular! and \verb!array! environments,
all table commands \textcolor{red3}{must} be put at the beginning ot the cell text.
Also, new table commands \textcolor{red3}{must} be defined with \verb!\NewTableCommand!.
-\section{Hline Commands}
-
-The \verb!\hline! command has an optional argument which accepts key-value options.
-The available keys are described in Table \ref{key:hvline}.
-
-\begin{demohigh}
-\begin{tblr}{llll}
-\hline
- Alpha & Beta & Gamma & Delta \\
-\hline[dashed]
- Epsilon & Zeta & Eta & Theta \\
-\hline[dotted]
- Iota & Kappa & Lambda & Mu \\
-\hline[2pt,blue5]
-\end{tblr}
-\end{demohigh}
-
-The \verb!\cline! command also has an optional argument which is the same as \verb!\hline!.
-
-\begin{demohigh}
-\begin{tblr}{llll}
-\cline{1-4}
- Alpha & Beta & Gamma & Delta \\
-\cline[dashed]{1,3}
- Epsilon & Zeta & Eta & Theta \\
-\cline[dashed]{2,4}
- Iota & Kappa & Lambda & Mu \\
-\cline[2pt,blue5]{-}
-\end{tblr}
-\end{demohigh}
-
-You can use child selectors in the mandatory argument of \verb!\cline!.
-
-\begin{demohigh}
-\begin{tblr}{llll}
-\cline{1-4}
- Alpha & Beta & Gamma & Delta \\
-\cline[dashed]{odd}
- Epsilon & Zeta & Eta & Theta \\
-\cline[dashed]{even}
- Iota & Kappa & Lambda & Mu \\
-\cline[2pt,blue5]{-}
-\end{tblr}
-\end{demohigh}
-
-\section{Cell Commands}
-
-The \verb!\SetCell! command has a mandatory argument for setting the styles of current cell.
-The available keys are described in Table \ref{key:cell}.
-
-\begin{demohigh}
-\begin{tblr}{llll}
-\hline[1pt]
- Alpha & \SetCell{bg=teal2,fg=white} Beta & Gamma & Delta \\
-\hline
- Epsilon & Zeta & \SetCell{r,font=\scshape} Eta & Theta \\
-\hline
- Iota & Kappa & Lambda & Mu \\
-\hline[1pt]
-\end{tblr}
-\end{demohigh}
-
-The \verb!\SetCell! command also has an optional argument for setting the multispan of current cell.
-The available keys are described in Table \ref{key:cellspan}.
-
-\begin{demohigh}
-\begin{tblr}{|X|X|X|X|X|X|}
-\hline
- Alpha & Beta & Gamma & Delta & Epsilon & Zeta \\
-\hline
- \SetCell[c=2]{c} Eta & 2-2
- & \SetCell[c=2]{c} Iota & 2-4
- & \SetCell[c=2]{c} Lambda & 2-6 \\
-\hline
- \SetCell[c=3]{l} Nu & 3-2 & 3-3
- & \SetCell[c=3]{l} Pi & 3-5 & 3-6 \\
-\hline
- \SetCell[c=6]{r} Tau & 4-2 & 4-3 & 4-4 & 4-5 & 4-6 \\
-\hline
-\end{tblr}
-\end{demohigh}
-
-\section{Row Commands}
-
-The \verb!\SetRow! command has a mandatory argument for setting the styles of current row.
-The available keys are described in Table \ref{key:row}.
-
-\begin{demohigh}
-\begin{tblr}{llll}
-\hline[1pt]
- \SetRow{azure8} Alpha & Beta & Gamma & Delta \\
-\hline
- \SetRow{blue8,c} Epsilon & Zeta & Eta & Theta \\
-\hline
- \SetRow{violet8} Iota & Kappa & Lambda & Mu \\
-\hline[1pt]
-\end{tblr}
-\end{demohigh}
-
-\section{Column Types}
-
-The \verb!tabularray! package has only one type of primitive column: the \verb!Q! column.
-Other types of columns are defined as \verb!Q! columns with some keys.
-
-\begin{codehigh}
-\NewColumnType{l}{Q[l]}
-\NewColumnType{c}{Q[c]}
-\NewColumnType{r}{Q[r]}
-\NewColumnType{t}[1]{Q[t,wd=#1]}
-\NewColumnType{m}[1]{Q[m,wd=#1]}
-\NewColumnType{b}[1]{Q[b,wd=#1]}
-\NewColumnType{h}[1]{Q[h,wd=#1]}
-\NewColumnType{f}[1]{Q[f,wd=#1]}
-\NewColumnType{X}[1][]{Q[co=1,#1]}
-\end{codehigh}
-
-\begin{demohigh}
-\begin{tblr}{|t{15mm}|m{15mm}|b{20mm}|}
- Alpha & Beta & {Gamma\\Gamma} \\
- Epsilon & Zeta & {Eta\\Eta} \\
- Iota & Kappa & {Lambda\\Lambda} \\
-\end{tblr}
-\end{demohigh}
-
-Any new column type must be defined with \verb!\NewColumnType! command.
-It can have an optional argument when it's defined.
-
-\section{Row Types}
-
-The \verb!tabularray! package has only one type of primitive row: the \verb!Q! row.
-Other types of rows are defined as \verb!Q! rows with some keys.
-
-\begin{codehigh}
-\NewRowType{l}{Q[l]}
-\NewRowType{c}{Q[c]}
-\NewRowType{r}{Q[r]}
-\NewRowType{t}[1]{Q[t,ht=#1]}
-\NewRowType{m}[1]{Q[m,ht=#1]}
-\NewRowType{b}[1]{Q[b,ht=#1]}
-\NewRowType{h}[1]{Q[h,ht=#1]}
-\NewRowType{f}[1]{Q[f,ht=#1]}
-\end{codehigh}
-
-\begin{demohigh}
-\begin{tblr}{rowspec={|t{12mm}|m{10mm}|b{10mm}|}}
- Alpha & Beta & {Gamma\\Gamma} \\
- Epsilon & Zeta & {Eta\\Eta} \\
- Iota & Kappa & {Lambda\\Lambda} \\
-\end{tblr}
-\end{demohigh}
-
-Any new row type must be defined with \verb!\NewRowType! command.
-It can have an optional argument when it's defined.
-
-\chapter{The New Interfaces}
-
-With \verb!tabularray! package, you can separate style and content totally in tables.
+The new interfaces consist of some options inside the mandatory argument,
+hence totally separating the styles and the contents of tables.
+
+\begin{newtblr}[
+ caption = {Old Interfaces and New Interfaces},
+ label = {key:interface},
+]{verb}
+ Old Interfaces & New Interfaces \\
+ \verb!\SetHlines! & \K{hlines} \\
+ \verb!\SetHline!, \verb!\hline!, \verb!\cline! & \K{hline}, \K{rowspec} \\
+ \verb!\SetVlines! & \K{vlines} \\
+ \verb!\SetVline!, \verb!\vline!, \verb!\rline! & \K{vline}, \K{colspec} \\
+ \verb!\SetCells! & \K{cells} \\
+ \verb!\SetCell! & \K{cell} \\
+ \verb!\SetRows! & \K{rows} \\
+ \verb!\SetRow! & \K{row}, \K{rowspec} \\
+ \verb!\SetColumns! & \K{columns} \\
+ \verb!\SetColumn! & \K{column}, \K{colspec} \\
+\end{newtblr}
\section{Hlines and Vlines}
@@ -673,11 +599,13 @@ All available keys for hlines and vlines are described in Table \ref{key:hvline}
]{}
Key & Description and Values & Initial Value \\
\underline{\K{dash}} & dash style: \V{solid}, \V{dashed} or \V{dotted} & \V{solid} \\
- \K{text} & replace hline/vline with text (like \V{!} specifier in \K{colspec}) & None \\
- \underline{\K{wd}} & rule width dimension & None \\
- \underline{\K{fg}} & rule color name & None \\
+ \K{text} & replace hline/vline with text (like \V{!} specifier in \K{colspec}) & \None \\
+ \underline{\K{wd}} & rule width dimension & \None \\
+ \underline{\K{fg}} & rule color name & \None \\
\end{spectblr}
+\subsection{Hlines and Vlines in New Interfaces}
+
Options \verb!hlines! and \verb!vlines! are for setting all hlines and vlines, respectively.
With empty value, all hlines/vlines will be solid.
@@ -686,9 +614,6 @@ With empty value, all hlines/vlines will be solid.
Alpha & Beta & Gamma & Delta \\
Epsilon & Zeta & Eta & Theta \\
Iota & Kappa & Lambda & Mu \\
- Nu & Xi & Omicron & Pi \\
- Rho & Sigma & Tau & Upsilon \\
- Phi & Chi & Psi & Omega \\
\end{tblr}
\end{demohigh}
@@ -696,15 +621,11 @@ With values inside one pair of braces, all hlines/vlines will be styled.
\begin{demohigh}
\begin{tblr}{
- hlines = {1pt,solid},
- vlines = {red3,dashed},
+ hlines = {1pt,solid}, vlines = {red3,dashed},
}
Alpha & Beta & Gamma & Delta \\
Epsilon & Zeta & Eta & Theta \\
Iota & Kappa & Lambda & Mu \\
- Nu & Xi & Omicron & Pi \\
- Rho & Sigma & Tau & Upsilon \\
- Phi & Chi & Psi & Omega \\
\end{tblr}
\end{demohigh}
@@ -746,19 +667,16 @@ Another pair of braces before will draw more hlines/vlines (in which \verb!-! st
\begin{demohigh}
\begin{tblr}{
- hlines = {1}{-}{dashed},
- hlines = {2}{-}{solid},
+ hlines = {1}{-}{dashed}, hlines = {2}{-}{solid},
}
Alpha & Beta & Gamma & Delta \\
Epsilon & Zeta & Eta & Theta \\
Iota & Kappa & Lambda & Mu \\
- Nu & Xi & Omicron & Pi \\
- Rho & Sigma & Tau & Upsilon \\
- Phi & Chi & Psi & Omega \\
\end{tblr}
\end{demohigh}
Options \verb!hline{i}! and \verb!vline{j}! are for setting some hlines and vlines, respectively.
+Their values are the same as options \verb!hliness! and \verb!vlines!:
\begin{demohigh}
\begin{tblr}{
@@ -775,7 +693,25 @@ Options \verb!hline{i}! and \verb!vline{j}! are for setting some hlines and vlin
\end{tblr}
\end{demohigh}
-At last we show the usage of \verb!text! key by the following example%
+You can use \verb!X!, \verb!Y!, \verb!Z! to denote the last three childs, respectively.
+It is especially useful when you are writing long tables:
+
+\begin{demohigh}
+\begin{tblr}{
+ hline{1,Z} = {2pt},
+ hline{2,Y} = {1pt},
+ hline{3-X} = {dashed},
+}
+ Alpha & Beta & Gamma & Delta \\
+ Epsilon & Zeta & Eta & Theta \\
+ Iota & Kappa & Lambda & Mu \\
+ Nu & Xi & Omicron & Pi \\
+ Rho & Sigma & Tau & Upsilon \\
+ Phi & Chi & Psi & Omega \\
+\end{tblr}
+\end{demohigh}
+
+Now we show the usage of \verb!text! key by the following example%
\footnote{Code from \url{https://tex.stackexchange.com/questions/603023/tabularray-and-tabularx-column-separator}.}:
\begin{demohigh}
@@ -795,10 +731,89 @@ At last we show the usage of \verb!text! key by the following example%
You need to load \verb!chemmacros! package for the \verb!\ch! command.
+\subsection{Hlines and Vlines in Old Interfaces}
+
+The \verb!\hline! command has an optional argument which accepts key-value options.
+The available keys are described in Table \ref{key:hvline}.
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\hline
+ Alpha & Beta & Gamma & Delta \\
+\hline[dashed]
+ Epsilon & Zeta & Eta & Theta \\
+\hline[dotted]
+ Iota & Kappa & Lambda & Mu \\
+\hline[2pt,blue5]
+\end{tblr}
+\end{demohigh}
+
+The \verb!\cline! command also has an optional argument which is the same as \verb!\hline!.
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\cline{1-4}
+ Alpha & Beta & Gamma & Delta \\
+\cline[dashed]{1,3}
+ Epsilon & Zeta & Eta & Theta \\
+\cline[dashed]{2,4}
+ Iota & Kappa & Lambda & Mu \\
+\cline[2pt,blue5]{-}
+\end{tblr}
+\end{demohigh}
+
+You can use child selectors in the mandatory argument of \verb!\cline!.
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\cline{1-4}
+ Alpha & Beta & Gamma & Delta \\
+\cline[dashed]{odd}
+ Epsilon & Zeta & Eta & Theta \\
+\cline[dashed]{even}
+ Iota & Kappa & Lambda & Mu \\
+\cline[2pt,blue5]{-}
+\end{tblr}
+\end{demohigh}
+
+Commands \verb!\SetHline! combines the usages of \verb!\hline! and \verb!\cline!:
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\SetHline{1-3}{blue5,1pt}
+ Alpha & Beta & Gamma & Delta \\
+ Epsilon & Zeta & Eta & Theta \\
+ Iota & Kappa & Lambda & Mu \\
+\SetHline{2-4}{teal5,1pt}
+\end{tblr}
+\end{demohigh}
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\SetHline[1]{1-3}{blue5,1pt}
+\SetHline[2]{1-3}{azure5,1pt}
+ Alpha & Beta & Gamma & Delta \\
+ Epsilon & Zeta & Eta & Theta \\
+ Iota & Kappa & Lambda & Mu \\
+\SetHline[1]{2-4}{teal5,1pt}
+\SetHline[2]{2-4}{green5,1pt}
+\end{tblr}
+\end{demohigh}
+
+In fact, table command \verb!\SetHline[<index>]{<columns>}{<styles>}! at the beginning of row \verb!i!
+is the same as table option \verb!hline{i}={<index>}{<columns>}{<styles>}!.
+
+Also, table command \verb!\SetHlines[<index>]{<columns>}{<styles>}! at the beginning of some row
+is the same as table option \verb!hlines={<index>}{<columns>}{<styles>}!.
+
+The usages of table commands \verb!\vline!, \verb!\rline!, \verb!\SetVline!, \verb!\SetVlines!
+are similar to those of \verb!\hline!, \verb!\cline!, \verb!\SetHline!, \verb!\SetHlines!, respectively.
+But normally you don't need to use them.
+
\section{Cells and Spancells}
All available keys for cells are described in Table \ref{key:cell} and Table \ref{key:cellspan}.
-\nopagebreak
+
\begin{spectblr}[
caption = {Keys for the Content of Cells},
label = {key:cell},
@@ -812,13 +827,13 @@ All available keys for cells are described in Table \ref{key:cell} and Table \re
& vertical alignment: \V{t} (top), \V{m} (middle), \V{b} (bottom),
\V{h} (head) or \V{f} (foot)
& \V{t} \\
- \underline{\K{wd}} & width dimension & None \\
- \underline{\K{bg}} & background color name & None \\
- \K{fg} & foreground color name & None \\
- \K{font} & font commands & None \\
- \K{preto} & prepend text to the cell & None \\
- \K{appto} & append text to the cell & None \\
- \K{cmd} & execute command for the cell text & None \\
+ \underline{\K{wd}} & width dimension & \None \\
+ \underline{\K{bg}} & background color name & \None \\
+ \K{fg} & foreground color name & \None \\
+ \K{font} & font commands & \None \\
+ \K{preto} & prepend text to the cell & \None \\
+ \K{appto} & append text to the cell & \None \\
+ \K{cmd} & execute command for the cell text & \None \\
\end{spectblr}
\vspace{-2em}
\begin{spectblr}[
@@ -830,6 +845,8 @@ All available keys for cells are described in Table \ref{key:cell} and Table \re
\K{c} & number of columns the cell spans & 1 \\
\end{spectblr}
+\subsection{Cells and Spancells in New Interfaces}
+
Option \verb!cells! is for setting all cells.
\nopagebreak
\begin{demohigh}
@@ -862,6 +879,62 @@ Option \verb!cell{i}{j}! is for setting some cells.
\end{tblr}
\end{demohigh}
+\subsection{Cells and Spancells in Old Interfaces}
+
+The \verb!\SetCell! command has a mandatory argument for setting the styles of current cell.
+The available keys are described in Table \ref{key:cell}.
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\hline[1pt]
+ Alpha & \SetCell{bg=teal2,fg=white} Beta & Gamma \\
+\hline
+ Epsilon & Zeta & \SetCell{r,font=\scshape} Eta \\
+\hline
+ Iota & Kappa & Lambda \\
+\hline[1pt]
+\end{tblr}
+\end{demohigh}
+
+The \verb!\SetCell! command also has an optional argument for setting the multispan of current cell.
+The available keys are described in Table \ref{key:cellspan}.
+
+\begin{demohigh}
+\begin{tblr}{|X|X|X|X|X|X|}
+\hline
+ Alpha & Beta & Gamma & Delta & Epsilon & Zeta \\
+\hline
+ \SetCell[c=2]{c} Eta & 2-2
+ & \SetCell[c=2]{c} Iota & 2-4
+ & \SetCell[c=2]{c} Lambda & 2-6 \\
+\hline
+ \SetCell[c=3]{c} Nu & 3-2 & 3-3
+ & \SetCell[c=3]{c} Pi & 3-5 & 3-6 \\
+\hline
+ \SetCell[c=6]{c} Tau & 4-2 & 4-3 & 4-4 & 4-5 & 4-6 \\
+\hline
+\end{tblr}
+\end{demohigh}
+
+\begin{demohigh}
+\begin{tblr}{|X|X|X|X|X|X|}
+\hline
+ Alpha & Beta & Gamma & Delta & Epsilon & Zeta \\
+\hline
+ \SetCell[r=2]{m} Eta
+ & Theta & Iota & Kappa & Lambda & \SetCell[r=2]{m} Mu \\
+\hline
+ Nu & Xi & Omicron & Pi & Rho & Sigma \\
+\hline
+\end{tblr}
+\end{demohigh}
+
+In fact, table command \verb!\SetCell[<span>]{<styles>}! at the beginning of cell at row \verb!i!
+and column \verb!j! is the same as table option \verb!cell{i}{j}={<span>}{<styles>}!.
+
+Also, table command \verb!\SetCells[<span>]{<styles>}! at the beginning of some cell
+is the same as table option \verb!cells={<span>}{<styles>}!.
+
\section{Rows and Columns}
All available keys for rows and columns are described in Table \ref{key:row} and Table \ref{key:column}.
@@ -879,19 +952,19 @@ All available keys for rows and columns are described in Table \ref{key:row} and
& vertical alignment: \V{t} (top), \V{m} (middle), \V{b} (bottom),
\V{h} (head) or \V{f} (foot)
& \V{t} \\
- \underline{\K{ht}} & height dimension & None \\
- \underline{\K{bg}} & background color name & None \\
- \K{fg} & foreground color name & None \\
- \K{font} & font commands & None \\
+ \underline{\K{ht}} & height dimension & \None \\
+ \underline{\K{bg}} & background color name & \None \\
+ \K{fg} & foreground color name & \None \\
+ \K{font} & font commands & \None \\
\K{abovesep} & set vertical space above the row & \V{2pt} \\
- \K{abovesep+} & increase vertical space above the row & None \\
+ \K{abovesep+} & increase vertical space above the row & \None \\
\K{belowsep} & set vertical space below the row & \V{2pt} \\
- \K{belowsep+} & increase vertical space below the row & None \\
+ \K{belowsep+} & increase vertical space below the row & \None \\
\K{rowsep} & set vertical space above and below the row & \V{2pt} \\
- \K{rowsep+} & increase vertical space above and below the row & None \\
- \K{preto} & prepend text to every cell (like \V{>} specifier in \K{rowspec}) & None \\
- \K{appto} & append text to every cell (like \V{<} specifier in \K{rowspec}) & None \\
- \K{cmd} & execute command for every cell text & None \\
+ \K{rowsep+} & increase vertical space above and below the row & \None \\
+ \K{preto} & prepend text to every cell (like \V{>} specifier in \K{rowspec}) & \None \\
+ \K{appto} & append text to every cell (like \V{<} specifier in \K{rowspec}) & \None \\
+ \K{cmd} & execute command for every cell text & \None \\
\end{spectblr}
\vspace{-2em}
\begin{spectblr}[
@@ -907,30 +980,30 @@ All available keys for rows and columns are described in Table \ref{key:row} and
& vertical alignment: \V{t} (top), \V{m} (middle), \V{b} (bottom),
\V{h} (head) or \V{f} (foot)
& \V{t} \\
- \underline{\K{wd}} & width dimension & None \\
- \underline{\K{co}} & coefficient for the extendable column (\V{X} column) & None \\
- \underline{\K{bg}} & background color name & None \\
- \K{fg} & foreground color name & None \\
- \K{font} & font commands & None \\
+ \underline{\K{wd}} & width dimension & \None \\
+ \underline{\K{co}} & coefficient for the extendable column (\V{X} column) & \None \\
+ \underline{\K{bg}} & background color name & \None \\
+ \K{fg} & foreground color name & \None \\
+ \K{font} & font commands & \None \\
\K{leftsep} & set horizontal space to the left of the column & \V{6pt} \\
- \K{leftsep+} & increase horizontal space to the left of the column & None \\
+ \K{leftsep+} & increase horizontal space to the left of the column & \None \\
\K{rightsep} & set horizontal space to the right of the column & \V{6pt} \\
- \K{rightsep+} & increase horizontal space to the right of the column & None \\
+ \K{rightsep+} & increase horizontal space to the right of the column & \None \\
\K{colsep} & set horizontal space to both sides of the column & \V{6pt} \\
- \K{colsep+} & increase horizontal space to both sides of the column & None \\
- \K{preto} & prepend text to every cell (like \V{>} specifier in \K{colspec}) & None \\
- \K{appto} & append text to every cell (like \V{<} specifier in \K{colspec}) & None \\
- \K{cmd} & execute command for every cell text & None \\
+ \K{colsep+} & increase horizontal space to both sides of the column & \None \\
+ \K{preto} & prepend text to every cell (like \V{>} specifier in \K{colspec}) & \None \\
+ \K{appto} & append text to every cell (like \V{<} specifier in \K{colspec}) & \None \\
+ \K{cmd} & execute command for every cell text & \None \\
\end{spectblr}
+\subsection{Rows and Columns in New Interfaces}
+
Options \verb!rows! and \verb!columns! are for setting all rows and columns, respectively.
\nopagebreak
\begin{demohigh}
\begin{tblr}{
- hlines,
- vlines,
- rows = {7mm},
- columns = {15mm,c},
+ hlines, vlines,
+ rows = {7mm}, columns = {15mm,c},
}
Alpha & Beta & Gamma & Delta \\
Epsilon & Zeta & Eta & Theta \\
@@ -967,17 +1040,16 @@ The following example demonstrates the usages of \verb!bg!, \verb!fg! and \verb!
Delta & Epsilon & Zeta \\
Eta & Theta & Iota \\
Kappa & Lambda & Mu \\
- Nu Xi Omikron & Pi Rho Sigma & Tau Upsilon Phi \\
+ Nu Xi Omicron & Pi Rho Sigma & Tau Upsilon Phi \\
\end{tblr}
\end{demohigh}
The following example demonstrates the usages of
\verb!abovesep!, \verb!belowsep!, \verb!leftsep!, \verb!rightsep! keys.
-\nopagebreak
+%\nopagebreak
\begin{demohigh}
\begin{tblr}{
- hlines,
- vlines,
+ hlines, vlines,
rows = {abovesep=1pt,belowsep=5pt},
columns = {leftsep=1pt,rightsep=5pt},
}
@@ -999,7 +1071,109 @@ The following example shows that we can replace \verb!\\[dimen]! with \verb!belo
\end{tblr}
\end{demohigh}
-\section{The Whole Table}
+\subsection{Rows and Columns in Old Interfaces}
+
+The \verb!\SetRow! command has a mandatory argument for setting the styles of current row.
+The available keys are described in Table \ref{key:row}.
+
+\begin{demohigh}
+\begin{tblr}{llll}
+\hline[1pt]
+ \SetRow{azure8} Alpha & Beta & Gamma & Delta \\
+\hline
+ \SetRow{blue8,c} Epsilon & Zeta & Eta & Theta \\
+\hline
+ \SetRow{violet8} Iota & Kappa & Lambda & Mu \\
+\hline[1pt]
+\end{tblr}
+\end{demohigh}
+
+In fact, table command \verb!\SetRow{<styles>}! at the beginning of row \verb!i!
+is the same as table option \verb!row{i}={<styles>}!.
+
+Also, table command \verb!\SetRows{<styles>}! at the beginning of some row
+is the same as table option \verb!rows={<styles>}!.
+
+The usages of table commands \verb!\SetColumn! and \verb!\SetColumns!
+are similar to those of \verb!\SetRow! and \verb!\SetRows!, respectively.
+But normally you don't need to use them.
+
+\section{Colspec and Rowspec}
+
+Options \verb!colspec!/\verb!rowspec! are for setting column/row specifications
+with column/row type specifiers.
+
+\subsection{Colspec and Width}
+
+Option \verb!width! are for setting the width of the table with extendable columns.
+The following example demonstrates the usage of \verb!width! option.
+\nopagebreak
+\begin{demohigh}
+\begin{tblr}{width=0.8\textwidth, colspec={|l|X[2]|X[3]|X[-1]|}}
+ Alpha & Beta & Gamma & Delta \\
+ Epsilon & Zeta & Eta & Theta \\
+ Iota & Kappa & Lambda & Mu \\
+\end{tblr}
+\end{demohigh}
+
+\subsection{Column Types}
+
+The \verb!tabularray! package has only one type of primitive column: the \verb!Q! column.
+Other types of columns are defined as \verb!Q! columns with some keys.
+
+\begin{codehigh}
+\NewColumnType{l}{Q[l]}
+\NewColumnType{c}{Q[c]}
+\NewColumnType{r}{Q[r]}
+\NewColumnType{t}[1]{Q[t,wd=#1]}
+\NewColumnType{m}[1]{Q[m,wd=#1]}
+\NewColumnType{b}[1]{Q[b,wd=#1]}
+\NewColumnType{h}[1]{Q[h,wd=#1]}
+\NewColumnType{f}[1]{Q[f,wd=#1]}
+\NewColumnType{X}[1][]{Q[co=1,#1]}
+\end{codehigh}
+
+\begin{demohigh}
+\begin{tblr}{|t{15mm}|m{15mm}|b{20mm}|}
+ Alpha & Beta & {Gamma\\Gamma} \\
+ Epsilon & Zeta & {Eta\\Eta} \\
+ Iota & Kappa & {Lambda\\Lambda} \\
+\end{tblr}
+\end{demohigh}
+
+Any new column type must be defined with \verb!\NewColumnType! command.
+It can have an optional argument when it's defined.
+
+\subsection{Row Types}
+
+The \verb!tabularray! package has only one type of primitive row: the \verb!Q! row.
+Other types of rows are defined as \verb!Q! rows with some keys.
+
+\begin{codehigh}
+\NewRowType{l}{Q[l]}
+\NewRowType{c}{Q[c]}
+\NewRowType{r}{Q[r]}
+\NewRowType{t}[1]{Q[t,ht=#1]}
+\NewRowType{m}[1]{Q[m,ht=#1]}
+\NewRowType{b}[1]{Q[b,ht=#1]}
+\NewRowType{h}[1]{Q[h,ht=#1]}
+\NewRowType{f}[1]{Q[f,ht=#1]}
+\end{codehigh}
+
+\begin{demohigh}
+\begin{tblr}{rowspec={|t{12mm}|m{10mm}|b{10mm}|}}
+ Alpha & Beta & {Gamma\\Gamma} \\
+ Epsilon & Zeta & {Eta\\Eta} \\
+ Iota & Kappa & {Lambda\\Lambda} \\
+\end{tblr}
+\end{demohigh}
+
+Any new row type must be defined with \verb!\NewRowType! command.
+It can have an optional argument when it's defined.
+
+\chapter{Extra Interfaces}
+
+\section{Table Specifications}
All available keys for the whole table are described in Table \ref{key:table}.
@@ -1008,9 +1182,6 @@ All available keys for the whole table are described in Table \ref{key:table}.
label = {key:table},
]{}
Key & Description and Values & Initial Value \\
- \K{rowspec} & set row specifications with row type specifiers & None \\
- \K{colspec} & set column specifications with column type specifiers & None \\
- \K{width} & width of the table with extendable columns & None \\
\K{rulesep} & space between two hlines or vlines & \V{2pt} \\
\K{stretch} & stretch ratio for struts added to cell text & \V{1} \\
\K{abovesep} & set vertical space above every row & \V{2pt} \\
@@ -1023,16 +1194,6 @@ All available keys for the whole table are described in Table \ref{key:table}.
\K{vspan} & vertical span algorithm: \V{default} or \V{even} & \V{default} \\
\end{spectblr}
-The following example demonstrates the usage of \verb!width! key.
-\nopagebreak
-\begin{demohigh}
-\begin{tblr}{width=0.8\textwidth, colspec={|l|X[2]|X[3]|X[-1]|}}
- Alpha & Beta & Gamma & Delta \\
- Epsilon & Zeta & Eta & Theta \\
- Iota & Kappa & Lambda & Mu \\
-\end{tblr}
-\end{demohigh}
-
The following example shows that we can replace \verb!\doublerulesep! parameter with \verb!rulesep! key.
\nopagebreak
\begin{demohigh}
@@ -1158,6 +1319,80 @@ Text \begin{mytblr}{cccc}
\end{mytblr} Text
\end{demohigh}
+If not giving the optional argument to \verb!\SetTblrInner! or \verb!\SetTblrOuter! command,
+we set the default specifications for \verb!tblr! environment.
+And different tabularray environments could have different default specifications.
+
+\section{New Table Commands}
+
+All commands which change the specifications of tables \textcolor{red3}{must} be defined with \verb!\NewTableCommand!.
+The following example demonstrates how to define a new table command:
+
+\begin{demohigh}
+\NewTableCommand\myhline{\hline[0.1em,red5]}
+\begin{tblr}{llll}
+\myhline
+ Alpha & Beta & Gamma & Delta \\
+ Epsilon & Zeta & Eta & Theta \\
+ Iota & Kappa & Lambda & Mu \\
+\myhline
+\end{tblr}
+\end{demohigh}
+
+\section{Expand Macros First}
+
+\verb!Tabularray! need to see every \verb!&! and \verb!\\! when splitting the table body
+with \verb!l3regex!. And you can not put cell text inside any table command defined with
+\verb!\NewTableCommand!. But you could use outer specification \verb!expand! to make \verb!tabularray!
+expand every occurrence of a specified macro \underline{once} before splitting the table body:
+
+\begin{demohigh}
+\def\tblrbody{
+ \hline
+ 20 & 30 & 40 \\
+ 50 & 60 & 70 \\
+ \hline
+}
+\begin{tblr}[expand=\tblrbody]{ccc}
+ \hline
+ AA & BB & CC \\
+ \tblrbody
+ DD & EE & FF \\
+ \tblrbody
+ GG & HH & II \\
+ \hline
+\end{tblr}
+\end{demohigh}
+
+With this \verb!expand! option, you can also use \verb!environ! package
+to define a new environment based on \verb!tblr! environment:
+
+\begin{demohigh}
+\NewEnviron{fancytblr}{
+ Before Text
+ \begin{tblr}[expand=\BODY]{hlines}
+ \BODY
+ \end{tblr}
+ After Text
+}
+\begin{fancytblr}
+ One & Two & Three \\
+ Four & Five & Six \\
+ Seven & Eight & Nine \\
+\end{fancytblr}
+\end{demohigh}
+
+\section{Use Verbatim Commands}
+
+With inner specification \verb!verb!, you can write \verb!\verb! commands in the cell text:
+
+\begin{demohigh}
+\begin{tblr}{hlines,verb}
+ 20 & 30 & \verb!\hello{world}!40 \\
+ 50 & \verb!\hello!60 & 70 \\
+\end{tblr}
+\end{demohigh}
+
\section{Counters and Lengths}
Counters \verb!rownum!, \verb!colnum!, \verb!rowcount!, \verb!colcount! can be used in cell text:
@@ -1214,16 +1449,18 @@ By this approach, alternating row colors should work as expected.
remark{Source} = {Made up by myself. Made up by myself. Made up by myself.},
]{
colspec = {XXX}, width = 0.85\linewidth,
- row{odd} = {gray9}, row{even} = {brown9}, rowhead = 2, rowfoot = 1,
+ rowhead = 2, rowfoot = 1,
+ row{odd} = {gray9}, row{even} = {brown9},
+ row{1-2} = {purple7}, row{Z} = {blue7},
}
\hline
- \SetRow{purple7} Head & Head & Head \\
+ Head & Head & Head \\
\hline
- \SetRow{purple7} Head & Head & Head \\
+ Head & Head & Head \\
\hline
Alpha & Beta & Gamma \\
\hline
- Epsilon & Zeta\TblrNote{a} & Eta \\
+ Epsilon & Zeta\TblrNote{a} & Eta \\
\hline
Iota & Kappa\TblrNote{$\dag$} & Lambda \\
\hline
@@ -1365,7 +1602,7 @@ Alpha & Beta & Gamma \\
\hline
Phi & Chi & Psi \\
\hline
- Alpha & Beta & Gamma\footnote{Hello} \\
+ Alpha & Beta & Gamma \\
\hline
Epsilon & Zeta & Eta \\
\hline
@@ -1401,7 +1638,7 @@ Alpha & Beta & Gamma \\
%\hline
% Phi & Chi & Psi \\
\hline
- \SetRow{blue7} Foot & Foot & Foot \\
+ Foot & Foot & Foot \\
\hline
\end{longtblr}
@@ -1431,16 +1668,18 @@ The source code for the above long table is shown below. It is mainly self-expla
remark{Source} = {Made up by myself. Made up by myself. Made up by myself.},
]{
colspec = {XXX}, width = 0.85\linewidth,
- row{odd} = {gray9}, row{even} = {brown9}, rowhead = 2, rowfoot = 1,
+ rowhead = 2, rowfoot = 1,
+ row{odd} = {gray9}, row{even} = {brown9},
+ row{1-2} = {purple7}, row{Z} = {blue7},
}
\hline
- \SetRow{purple7} Head & Head & Head \\
+ Head & Head & Head \\
\hline
- \SetRow{purple7} Head & Head & Head \\
+ Head & Head & Head \\
\hline
Alpha & Beta & Gamma \\
\hline
- Epsilon & Zeta\TblrNote{a} & Eta \\
+ Epsilon & Zeta\TblrNote{a} & Eta \\
\hline
Iota & Kappa\TblrNote{$\dag$} & Lambda \\
\hline
@@ -1464,7 +1703,7 @@ The source code for the above long table is shown below. It is mainly self-expla
\hline
Phi & Chi & Psi \\
\hline
- \SetRow{blue7} Foot & Foot & Foot \\
+ Foot & Foot & Foot \\
\hline
\end{longtblr}
\end{codehigh}
@@ -1489,33 +1728,43 @@ Their options are outer specifications and should be put in the optional argumen
\begin{spectblr}[
caption = {Outer Specifications for Table Heads and Table Foots}
-]{}
+]{verb}
Key Nama & Key Description & Initial Value \\
\V{headsep} & vertical space between table head and table body & \V{6pt} \\
\V{footsep} & vertical space between table foot and table body & \V{6pt} \\
- \V{presep} & vertical space between table head and the above text & \texttt{1.5\string\bigskipamount} \\
- \V{postsep} & vertical space between table foot and the below text & \texttt{1.5\string\bigskipamount} \\
- \V{theme} & table theme (including settings for templates and styles) & None \\
- \V{caption} & table caption & None \\
- \V{entry} & short table caption to be put in List of Tables & None \\
- \V{label} & table label & None \\
- \V{note\{<name>\}} & table note with \V{<name>} as tag & None \\
- \V{remark\{<name>\}} & table remark with \V{<name>} as tag & None \\
+ \V{presep} & vertical space between table head and the above text & \verb!1.5\bigskipamount! \\
+ \V{postsep} & vertical space between table foot and the below text & \verb!1.5\bigskipamount! \\
+ \V{theme} & table theme (including settings for templates and styles) & \None \\
+ \V{caption} & table caption & \None \\
+ \V{entry} & short table caption to be put in List of Tables & \None \\
+ \V{label} & table label & \None \\
+ \V{note\{<name>\}} & table note with \V{<name>} as tag & \None \\
+ \V{remark\{<name>\}} & table remark with \V{<name>} as tag & \None \\
\end{spectblr}
+If you write \verb!entry=none!, \verb!tabularray! package will not add an entry in List of Tables.
+Therefore \verb!caption=text,entry=none! is similar to \verb!\caption[]{text}! in \verb!longtable!.
+
+If you write \verb!label=none!, \verb!tabularray! package will not step \verb!table! counter,
+and set the \verb!caption-tag! and \verb!caption-sep! elements (see below) to empty.
+Therefore \verb!caption=text,entry=none,label=none! is similar to \verb!\caption*{text}!
+in \verb!longtable!, except for the counter.
+
\section{Customize Templates}
\subsection{Overview of Templates}
-The template system for table heads and table foots in \verb!tabularray! is largely inspired by \verb!beamer!,
-\verb!caption! and \verb!longtable! packages. You can use \verb!\DefTblrTemplate! command to define and
-modify templates, and \verb!\SetTblrTemplate! command to choose default templates. In defining templates,
+The template system for table heads and table foots in \verb!tabularray! is largely inspired
+by \verb!beamer!, \verb!caption! and \verb!longtable! packages. For elements in Table \ref{tblr:element},
+you can use \verb!\DefTblrTemplate! to define and modify templates,
+and use \verb!\SetTblrTemplate! to choose default templates. In defining templates,
you can include other templates with \verb!\UseTblrTemplate! and \verb!\ExpTblrTemplate! commands.
\begin{spectblr}[
- caption = {Templates for Table Heads and Table Foots}
+ caption = {Elements for Table Heads and Table Foots},
+ label = {tblr:element},
]{}
- Template Name & Template Description \\
+ Element Name & Element Description and Default Template \\
\V{contfoot-text}& continuation text in the foot, normally ``Continued on next page'' \\
\V{contfoot} & continuation paragraph in the foot, normally including \V{contfoot-text} template \\
\V{conthead-text}& continuation text in the head, normally ``(Continued)'' \\
@@ -1542,10 +1791,13 @@ you can include other templates with \verb!\UseTblrTemplate! and \verb!\ExpTblrT
\V{foot} & setting all of \V{firstfoot}, \V{middlefoot} and \V{lastfoot} \\
\end{spectblr}
-A template which only includes short text is called a \underline{sub template}.
-Normally there is one \verb!-! in the name of a sub template.
-A template which includes one or more paragraphs is called a \underline{main template}.
-Normally there isn't any \verb!-! in the name of a main template.
+An element which only includes short text is called a \underline{sub element}.
+Normally there is one \verb!-! in the name of a sub element.
+An element which includes one or more paragraphs is called a \underline{main element}.
+Normally there isn't any \verb!-! in the name of a main element.
+
+For each of the above elements, two templates \verb!normal! and \verb!empty! are always defined.
+You can select one of them with \verb!\SetTblrTemplate! command.
\subsection{Continuation Templates}
@@ -1560,7 +1812,7 @@ Let us have a look at the code for defining templates of continuation text first
In the above code, command \verb!\DefTblrTemplate! defines the templates with name \verb!normal!,
and then command \verb!\SetTblrTemplate! sets the templates with name \verb!normal! as default.
-The \verb!normal! template is always defined and set as default for any template element in \verb!tabularray!.
+The \verb!normal! template is always defined and set as default for any element in \verb!tabularray!.
Therefore you had better use another name when defining new templates.
If you use \verb!default! as template name in \verb!\DefTblrTemplate!,
@@ -1574,8 +1826,8 @@ Therefore the above code can be written in another way:
You may modify the code to customize continuation text to fit your needs.
-The \verb!contfoot! and \verb!conthead! templates normally
-include their sub templates with \verb!\UseTblrTemplate! commands.
+The templates for \verb!contfoot! and \verb!conthead! normally
+include the templates of their sub elements with \verb!\UseTblrTemplate! commands.
But you can also handle user settings such as horizontal alignment here.
\begin{codehigh}
@@ -1688,19 +1940,10 @@ Note that you can define the same template for multiple elements in \verb!\DefTb
\section{Change Styles}
-You may change the styles of template elements.
-
-\begin{codehigh}
-\SetTblrStyle{firsthead}{font=\bfseries}
-\SetTblrStyle{firstfoot}{fg=blue2}
-\SetTblrStyle{middlefoot}{\itshape}
-\SetTblrStyle{caption-tag}{red2}
-\end{codehigh}
-
All available keys for template elements are described in Table \ref{key:element}.
\begin{spectblr}[
- caption = {Keys for the Styles of Template Elements},
+ caption = {Keys for the Styles of Elements},
label = {key:element},
remark{Note} = {In most cases, you can omit the underlined key names and write only their values.
The keys \K{halign}, \K{indent} and \K{hang} are only for main templates.}
@@ -1713,9 +1956,18 @@ All available keys for template elements are described in Table \ref{key:element
\K{hang} & hangindent value \\
\end{spectblr}
+You may change the styles of elements with \verb!\SetTblrStyle! command:
+
+\begin{codehigh}
+\SetTblrStyle{firsthead}{font=\bfseries}
+\SetTblrStyle{firstfoot}{fg=blue2}
+\SetTblrStyle{middlefoot}{\itshape}
+\SetTblrStyle{caption-tag}{red2}
+\end{codehigh}
+
When you write \verb!\UseTblrTemplate{element}{default}! in defining a template,
-beside including the code of template \verb!element!, the foreground color and font commands
-of the template \verb!element! will be set up automatically.
+beside including template code of the \verb!element!, the foreground color and font commands
+of the \verb!element! will be set up automatically.
In contrast, \verb!\ExpTblrTemplate{element}{default}! will only include template code.
\section{Define Themes}
@@ -1736,14 +1988,39 @@ a theme consists of some template and style settings. For example:
After defining the theme \verb!fancy!, you can use it
by writing \verb!theme=fancy! in the optional argument of \verb!longtblr! environment.
-\chapter{Use Some Libraries}
+\section{Control Page Breaks}
-\mywarning{chapter}
+Just like \verb!longtable! package, inside \verb!longtblr! environment,
+you can use \verb!\\*! or \verb!\nopagebreak! to prohibit a page break,
+and use \verb!\pagebreak! to force a page break.
+
+\section{Floatable Tall Tables}
+
+There is also a \verb!talltblr! environment as an alternative to \verb!threeparttable! environment.
+It can not cross multiple pages, but it can be put inside \verb!table! environment.
+
+\begin{demohigh}
+TEXT\begin{talltblr}[
+ caption = {Long Long Long Long Tabular},
+ entry = {Short Caption},
+ label = {tblr:tall},
+ note{a} = {It is the first footnote.},
+ note{$\dag$} = {It is the second long long long long long long footnote.},
+]{
+ colspec = {XXX}, width = 0.5\linewidth, hlines,
+}
+ Alpha & Beta & Gamma \\
+ Epsilon & Zeta & Eta\TblrNote{a} \\
+ Iota & Kappa & Lambda\TblrNote{$\dag$} \\
+\end{talltblr}TEXT
+\end{demohigh}
+
+\chapter{Use Some Libraries}
The \verb!tabularray! package emulates or fixes some commands in other packages.
To avoid potential conflict, you need to enable them with \verb!\UseTblrLibrary! command.
-\section{Library \V{booktabs}}
+\section{Library \texttt{booktabs}}
When you write \verb!\UseTblrLibrary{booktabs}!,
\verb!tabularray! package will define commands \verb!\toprule!, \verb!\midrule!,
@@ -1764,6 +2041,7 @@ When you write \verb!\UseTblrLibrary{booktabs}!,
\end{demohigh}
At this moment, \verb!trim! options for \verb!\cmidrule! command are not supported.
+(As a workaround, you may insert an empty column to separate two \verb!\cmidrule!'s.)
But rule colors are possible just like \verb!\hline! and \verb!\cline! commands.
\begin{demohigh}
@@ -1780,7 +2058,7 @@ But rule colors are possible just like \verb!\hline! and \verb!\cline! commands.
\end{tblr}
\end{demohigh}
-\section{Library \V{diagbox}}
+\section{Library \texttt{diagbox}}
When writing \verb!\UseTblrLibrary{diagbox}! in the preamble of the document,
\verb!tabularray! package loads \verb!diagbox! package,
@@ -1815,48 +2093,70 @@ $\begin{tblr}{|c|cc|}
\end{tblr}$
\end{demohigh}
-\section{Library \V{siunitx}}
+\section{Library \texttt{siunitx}}
When writing \verb!\UseTblrLibrary{siunitx}! in the preamble of the document,
\verb!tabularray! package loads \verb!siunitx! package,
-and defines \verb!S! column for \verb!tblr! environment.
+and defines \verb!S! column as \verb!Q! column with \verb!si! key.
+
+\begin{demohigh}
+\begin{tblr}{
+ hlines, vlines,
+ colspec={
+ S[table-format=3.2]
+ S[table-format=3.2]
+ S[table-format=3.2]
+ }
+}
+ {{{Head}}} & {{{Head}}} & {{{Head}}} \\
+ 111 & 111 & 111 \\
+ 2.1 & 2.2 & 2.3 \\
+ 33.11 & 33.22 & 33.33 \\
+\end{tblr}
+\end{demohigh}
\begin{demohigh}
\begin{tblr}{
hlines, vlines,
colspec={
- S[table-format=2.2]
- S[table-format=2.2]
- S[table-format=2.2]
+ Q[si={table-format=3.2},c]
+ Q[si={table-format=3.2},c]
+ Q[si={table-format=3.2},c]
}
}
{{{Head}}} & {{{Head}}} & {{{Head}}} \\
- 11 & 11 & 11 \\
+ 111 & 111 & 111 \\
2.1 & 2.2 & 2.3 \\
33.11 & 33.22 & 33.33 \\
\end{tblr}
\end{demohigh}
Note that you need to use \underline{triple} pairs of braces to guard non-numeric cells.
-If you need to apply other specifications for the \verb!S! columns,
-you need to move \verb!siunitx! options into \verb!si! keys of the \verb!Q! columns.
+
+Also you must use \verb!l!, \verb!c! or \verb!r! to set horizontal alignment for non-numeric cells:
\begin{demohigh}
\begin{tblr}{
- hlines, vlines,
+ hlines, vlines, columns={6em},
colspec={
- Q[si={table-format=2.2},blue7]
- Q[si={table-format=2.2},teal7]
- Q[si={table-format=2.2},purple7]
+ Q[si={table-format=3.2,table-number-alignment=left},l,blue7]
+ Q[si={table-format=3.2,table-number-alignment=center},c,teal7]
+ Q[si={table-format=3.2,table-number-alignment=right},r,purple7]
}
}
{{{Head}}} & {{{Head}}} & {{{Head}}} \\
- 11 & 11 & 11 \\
+ 111 & 111 & 111 \\
2.1 & 2.2 & 2.3 \\
33.11 & 33.22 & 33.33 \\
\end{tblr}
\end{demohigh}
+Both \verb!S! and \verb!s! columns are supported. In fact, These two columns are defined as follows:
+\begin{codehigh}
+\NewColumnType{S}[1][]{Q[si={##1},c]}
+\NewColumnType{s}[1][]{Q[si={##1},c,cmd=\TblrUnit]}
+\end{codehigh}
+
\chapter{The Source Code}
%\CodeHigh{lite}