summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/easybook/easybook.dtx212
-rw-r--r--macros/latex/contrib/easybook/easybook.pdfbin579740 -> 584973 bytes
-rw-r--r--macros/latex/contrib/easybook/easybook.tex107
-rw-r--r--macros/latex/contrib/huawei/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/huawei/huawei.cls52
-rw-r--r--macros/latex/contrib/huawei/huawei.pdfbin332659 -> 332985 bytes
-rw-r--r--macros/latex/contrib/huawei/huawei.tex12
-rw-r--r--macros/latex/contrib/huawei/samples/huawei-charter.tex2
8 files changed, 218 insertions, 168 deletions
diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx
index de8fd66f10..73196e000b 100644
--- a/macros/latex/contrib/easybook/easybook.dtx
+++ b/macros/latex/contrib/easybook/easybook.dtx
@@ -15,7 +15,7 @@
%<*class>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/10/25}{1.40C}
+\ProvidesExplClass{easybook}{2021/10/25}{1.40E}
{Typeset Chinese theses or books}
\bool_set_false:N \l__eb_compile_draft_bool
@@ -325,7 +325,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\RequirePackage{l3keys2e,etoolbox}
-\ProvidesExplPackage{easybase}{2021/10/25}{1.40C}
+\ProvidesExplPackage{easybase}{2021/10/25}{1.40E}
{Typeset Chinese theses or books}
\cs_generate_variant:Nn \dim_set:Nn { NV }
@@ -1207,6 +1207,10 @@
\seq_put_right:Nn \c__ctex_headings_seq { table }
\seq_put_right:Nn \c__ctex_headings_seq { lstlisting }
\seq_remove_duplicates:N \c__ctex_headings_seq
+\ctex_define:n { lstlisting/#1 .meta:nn = { ctex/#1 } {##1} }
+\ctex_define:n { figure/#1 .meta:nn = { ctex/#1 } {##1} }
+\ctex_define:n { table/#1 .meta:nn = { ctex/#1 } {##1} }
+\ctex_define:n { list/#1 .meta:nn = { ctex/#1 } {##1} }
\cs_new_protected:Npn \eb_titletoc_hang_fix:n #1
{
\bool_if:NT \eb@titletoc@hang@fix@bool
@@ -1216,24 +1220,22 @@
\bool_if:NT \l__eb_toc_number_color_bool
{ \color{ctex@toc@number} }
\thecontentslabel
- \hspace{\use:c { eb@toc@#1@numsep }}
+ \tl_use:c { l__eb_toc_#1_after_tl }
}
}
}
\cs_new_protected:Npn \eb_toc_assign_keys:n #1
{
- \ctex_define:n { tocset/#1 .meta:nn = { ctex/tocset/#1 } {##1} }
- \ctex_define:nn { tocset }
+ \ctex_define:n
{
- #1/format .tl_set:c = l__eb_toc_#1_format_tl,
- #1/format+ .code:n =
+ #1/tocformat .tl_set:c = l__eb_toc_#1_format_tl,
+ #1/tocformat+ .code:n =
{ \tl_put_right:cn { l__eb_toc_#1_format_tl } {##1} },
- #1/format~+ .code:n =
+ #1/tocformat~+ .code:n =
{ \tl_put_right:cn { l__eb_toc_#1_format_tl } {##1} },
- #1/indent .dim_set:c = l__eb_toc_#1_indent_dim,
- #1/rule .tl_set:c = l__eb_toc_#1_rule_tl,
- #1/numsep .dim_set:c = eb@toc@#1@numsep,
- #1/unknown .code:n = \eb_msg_unknown_option:n { tocset }
+ #1/tocindent .dim_set:c = l__eb_toc_#1_indent_dim,
+ #1/tocrule .tl_set:c = l__eb_toc_#1_rule_tl,
+ #1/tocafter .tl_set:c = l__eb_toc_#1_after_tl
}
\titlecontents{#1}
[\dim_use:c { l__eb_toc_#1_indent_dim }]
@@ -1243,20 +1245,23 @@
}
\seq_map_function:NN
\c__ctex_headings_seq \eb_toc_assign_keys:n
-\ctex_define:n { tocset/list .meta:nn = { ctex/tocset/list } {#1} }
\eb_clist_map_inline:nn
{ figure,table,lstlisting }
{
- \ctex_define:nn { tocset }
+ \ctex_define:n
{
#1/voffset .skip_set:c = l__eb_toc_#1_voffset_skip,
#1/tocline .cs_set:cp = { eb@toc@label@#1 } ##1,
}
}
\eb_clist_map_inline:nn
- { format,format+,format~+,indent,rule,numsep,voffset,tocline }
{
- \ctex_define:nn { tocset }
+ tocformat,tocformat+,tocformat~+,
+ tocindent,tocrule,tocline,
+ voffset,tocafter
+ }
+ {
+ \ctex_define:n
{
list/#1 .meta:n =
{
@@ -1267,59 +1272,39 @@
}
}
\eb_clist_map_inline:nn
- { numsep,indent,rule }
+ { tocafter,tocindent,tocrule }
{
\ctex_define:nn { tocset }
{
- #1-all .meta:n =
+ #1-all .code:n =
{
- part/#1 = ##1,
- chapter/#1 = ##1,
- section/#1 = ##1,
- subsection/#1 = ##1,
- list/#1 = ##1
+ \ctex_set:n
+ {
+ part/#1 = ##1,
+ chapter/#1 = ##1,
+ section/#1 = ##1,
+ subsection/#1 = ##1,
+ list/#1 = ##1
+ }
}
}
}
-\cs_set_eq:NN \ctexnumberline \CTEXnumberline
-\cs_set:Npn \CTEXnumberline #1
- {
- \CTEXifname
- {
- \bool_if:NTF \eb@titletoc@hang@fix@bool
- { \eb@numberline{\use:c { CTEXthe#1 }} }
- {
- \use:c { CTEXthe#1 }
- \hspace{\use:c { eb@toc@#1@numsep }}
- }
- }{}
- }
-\cs_new:Npn \eb@numberline { \protect\numberline }
-\cs_set_eq:NN \EBNumberLine \CTEXnumberline
\ctex_define:nn { tocset }
{
- lolskip .skip_set:N = \eb@toc@lolskip,
- lolskip .initial:n = 10pt,
- tocvoffset .skip_set:N = \l__eb_toc_voffset_skip,
- tocvoffset .initial:n =
+ lolskip .skip_set:N = \eb@toc@lolskip,
+ lolskip .initial:n = 10pt,
+ main-voffset .skip_set:N = \l__eb_toc_main_voffset_skip,
+ main-voffset .initial:n =
{ \bool_if:NTF \l__eb_class_book_bool { 1pc } { 0.35pc } },
- line-align .bool_set:N = \l__eb_toc_line_align_bool,
- line-align .default:n = true,
- line-align .initial:n = true,
- hang .bool_set:N = \eb@titletoc@hang@fix@bool,
- hang .default:n = true,
- hang .initial:n = false,
+ line-align .bool_set:N = \l__eb_toc_line_align_bool,
+ line-align .default:n = true,
+ line-align .initial:n = true,
+ hang .bool_set:N = \eb@titletoc@hang@fix@bool,
+ hang .default:n = true,
+ hang .initial:n = false,
unknown .code:n = \eb_msg_unknown_option:n { tocset }
}
-\ctex_set:n
- {
- part/tocline = \CTEXnumberline{#1}#2,
- chapter/tocline = \CTEXnumberline{#1}#2,
- section/tocline = \CTEXnumberline{#1}#2,
- subsection/tocline = \CTEXnumberline{#1}#2
- }
-
\NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}}
{
\normalsize\normalfont
@@ -1334,62 +1319,69 @@
}
}
}
-\ctex_set:nn { tocset }
+\cs_set_eq:NN \ctexnumberline \CTEXnumberline
+\cs_new:Npn \eb@numberline { \protect\numberline }
+\cs_set:Npn \CTEXnumberline #1
+ {
+ \CTEXifname
+ {
+ \bool_if:NTF \eb@titletoc@hang@fix@bool
+ { \eb@numberline{\use:c { CTEXthe#1 }} }
+ {
+ \use:c { CTEXthe#1 }
+ \tl_use:c { l__eb_toc_#1_after_tl }
+ }
+ }{}
+ }
+\cs_new:Npn \listnumberline #1
+ {
+ \use:c { #1name }~\use:c { the#1 }
+ \bool_if:NF \eb@titletoc@hang@fix@bool
+ { \tl_use:c { l__eb_toc_#1_after_tl } }
+ }
+\ctex_set:n
{
- part/format = \addvspace{1pc}\sffamily\large,
- part/indent = 0em,
- part/rule = \tocrule{}[\bfseries],
+ part/tocformat = \addvspace{1pc}\sffamily\large,
+ part/tocindent = 0em,
+ part/tocrule = \tocrule{}[\bfseries],
+ part/tocline = \CTEXnumberline{#1}#2,
- chapter/format = \addvspace{1pc}\sffamily\large,
- chapter/indent = 0em,
- chapter/rule = \tocrule{$\cdot$}[\bfseries],
+ chapter/tocformat = \addvspace{1pc}\sffamily\large,
+ chapter/tocindent = 0em,
+ chapter/tocrule = \tocrule{$\cdot$}[\bfseries],
+ chapter/tocline = \CTEXnumberline{#1}#2,
- section/format =
+ section/tocformat =
{
\addvspace{0.35pc}
\bool_if:NF \l__eb_class_book_bool { \sffamily }
},
- section/indent =
+ section/tocindent =
{ \bool_if:NTF \l__eb_class_book_bool { 1.5em } { 0em } },
- section/rule =
+ section/tocrule =
{
\bool_if:NTF \l__eb_class_book_bool
{ \tocrule{$\cdot$} }
{ \tocrule{$\cdot$}[\bfseries] }
},
+ section/tocline = \CTEXnumberline{#1}#2,
- subsection/format = \addvspace{0.35pc},
- subsection/indent =
+ subsection/tocformat = \addvspace{0.35pc},
+ subsection/tocindent =
{ \bool_if:NTF \l__eb_class_book_bool { 3.8em } { 1.4em } },
- subsection/rule = \tocrule{$\cdot$},
+ subsection/tocrule = \tocrule{$\cdot$},
+ subsection/tocline = \CTEXnumberline{#1}#2,
- list/format = \addvspace{0.2pc},
- list/indent = 0em,
- list/rule = \tocrule{$\cdot$},
- list/voffset =
+ list/tocformat = \addvspace{0.2pc},
+ list/tocindent = 0em,
+ list/tocrule = \tocrule{$\cdot$},
+ list/voffset =
{ 0.2pc\bool_if:NT \l__eb_class_book_bool { + 10pt } },
-
- figure/tocline =
- {
- \figurename~#1
- \bool_if:NF \eb@titletoc@hang@fix@bool
- { \hspace{\eb@toc@figure@numsep} }
- },
- table/tocline =
- {
- \tablename~#1
- \bool_if:NF \eb@titletoc@hang@fix@bool
- { \hspace{\eb@toc@table@numsep} }
- },
- lstlisting/tocline =
- {
- \lstlistingname~\thelstlisting
- \bool_if:NF \eb@titletoc@hang@fix@bool
- { \hspace{\eb@toc@lstlisting@numsep} }
- },
- numsep-all = 1em
+ table/tocline = \listnumberline{table},
+ figure/tocline = \listnumberline{figure},
+ lstlisting/tocline = \listnumberline{lstlisting}
}
-
+\ctex_set:nn { tocset } { tocafter-all = \hspace{1em} }
\prop_new:N \l__eb_list_label_name_prop
\prop_set_from_keyval:Nn \l__eb_list_label_name_prop
{
@@ -1649,12 +1641,12 @@
\tl_set:Nn \eb@bitoc@title { Contents }
\IfValueT{#2}{\keys_set:nn { eb/listoc } {#2}}
\eb_title_mark_notoc:n { \eb@toc@title }
- \vspace*{-\dim_use:N \l__eb_toc_voffset_skip}
+ \vspace*{-\dim_use:N \l__eb_toc_main_voffset_skip}
\eb_toc_start_multi_column_ext:n { toc }#3
\IfBooleanT{#1}
{
\eb_title_mark_notoc:n { \eb@bitoc@title }
- \vspace*{-\dim_use:N \l__eb_toc_voffset_skip}
+ \vspace*{-\dim_use:N \l__eb_toc_main_voffset_skip}
\eb_toc_start_multi_column_ext:n { tec }
}
\group_end:
@@ -2120,17 +2112,19 @@
\keys_define:nn { eb/exercise }
{
- color .tl_set:N = \eb@tc@background@color,
- color .initial:n = DeepSkyBlue,
- number .tl_set:N = \eb@tc@list@number,
- number .initial:n = { 1. },
- title .tl_set:N = \eb@tc@exercise@title,
- title .initial:n = \c__eb_name_exercise_tl,
- numsep .dim_set:N = \eb@toc@exercise@numsep,
- numsep .initial:n = 0.5em,
- label .tl_set:N = \eb@tc@exercise@label,
- enumitem .code:n = \setexerlist{#1},
- tcolorbox .code:n = \addtcbstyle{exercise}{#1}
+ color .tl_set:N = \eb@tc@background@color,
+ color .initial:n = DeepSkyBlue,
+ number .tl_set:N = \eb@tc@list@number,
+ number .initial:n = { 1. },
+ title .tl_set:N = \eb@tc@exercise@title,
+ title .initial:n = \c__eb_name_exercise_tl,
+ numsep .dim_set:N = \eb@toc@exercise@numsep,
+ numsep .initial:n = 0.5em,
+ tocnumsep .dim_set:N = \eb@toc@exertoc@numsep,
+ tocnumsep .initial:n = 1em,
+ label .tl_set:N = \eb@tc@exercise@label,
+ enumitem .code:n = \setexerlist{#1},
+ tcolorbox .code:n = \addtcbstyle{exercise}{#1}
}
\cs_set_protected:Npn \setexercise #1
{ \keys_set:nn { eb/exercise } {#1} }
@@ -2457,7 +2451,7 @@
}
%</package>
%<*tcolorbox>
-\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/25}{1.40C}
+\ProvidesExplFile{eb-tcolorbox.cfg}{2021/10/25}{1.40E}
{Customization of tcolorbox for easybook}
\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip }
@@ -2555,7 +2549,7 @@
}
\addcontentsline{toc}{section}
{
- \eb_tcb_toc_counter_numsep:n { section }
+ \eb_tcb_toc_counter_numsep:n { exertoc }
\eb@tc@exercise@title
}
}{}
diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf
index 464fac5232..32b1dcb767 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 3212c48e3b..ebde41673e 100644
--- a/macros/latex/contrib/easybook/easybook.tex
+++ b/macros/latex/contrib/easybook/easybook.tex
@@ -20,7 +20,7 @@
name = easybook,
color-scheme = blue,
title = EASYBOOK 使用手册,
- version = v1.40C,
+ version = v1.40E,
date = 2021/10/25,
authors = 瞿毅,
info = 排版简体中文学位论文和书籍,
@@ -175,6 +175,24 @@
当然也可以使用 \code{latexmk} 及一些软件自带的编译工具,这里就不做介绍。 \\
\ding{72} 需要注意正确\textbf{编译索引}要增加 \code{-shell-escape} 命令行选项。
+\subsection{依赖宏包}
+以下为 \pkg*{easybase} 直接调用的关键宏包清单。灰色的宏包表示并未调用它们,但做了一些预配置,可在导言区手动载入以实现相关的功能。
+\begin{center}
+ \begin{tblr}
+ {
+ colspec = @{}*{5}{c}@{},
+ hline{1,6} = {1pt,Blue},
+ cells = {cmd = \pkg*},
+ cell{5}{2-5} = {font = \color{gray}}
+ }
+ ctex & spbmark & ulem & enumitem & etoolbox \\
+ siunitx & pifont & amsthm & thmtools & marginnote \\
+ pdfpages & multicol & fancyhdr & titletoc & tabularray \\
+ setspace & listings & chemformula & geometry & caption \\
+ hyperref & bicaption & imakeidx & mathtools & tcolorbox
+ \end{tblr}
+\end{center}
+
\section{文档类选项}
\label{sec:document class options}
文档类选项应当在使用 \cls*{easybook} 文档类或 \pkg*{easybase} 宏包(部分支持)时载入,可见小节 \ref{subsec:basic usage} 的例子。目前 \pkg*{easybase} 宏包可用的选项有 \option{class}、\option{draft}、\option{paper} 和 \option{floatpage}。除了下面列举的选项,还可使用标准文档类和 C\TeX 文档类的选项。
@@ -268,13 +286,13 @@
\subsection{目录命令}
\begin{commands}
\command{tableofcontents}[\parg\oarg{键值列表}\darg{附加代码}]
- 主文档目录命令。带有 \parg{} 号参数的命令输出双语目录,需要与双语目录标题命令 \cs{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入目录样式和换页等命令。
+ 文档主目录命令。带有 \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}
@@ -287,7 +305,7 @@
\keyval-{columns}{目录栏数}\Default{2}
设置目录的栏数,仅在 \keyis-{multoc}{true} 时有效,默认为双栏。
\kvsplit{title}{中文目录标题,英文目录标题}\newline
- 用于更改目录的标题,标题之间用一个英文逗号分开,也可以只有一部分,表示中文目录的标题。当设置了英文目录标题时,英文目录标题将会自动加入主文档目录 \cs*{tableofcontents}\parg{} 命令。
+ 用于更改目录的标题,标题之间用一个英文逗号分开,也可以只有一部分,表示中文目录的标题。当设置了英文目录标题时,英文目录标题将会自动加入文档主目录 \cs*{tableofcontents}\parg{} 命令。
\keyval-{format}{目录标题格式}
在 \cls*{book} 模式且 \option{chapter} 选项开启或者 \cls*{article} 模式的情况下,\option{format} 用于设置目录标题的格式。
\keyval-{aftertitle}{目录标题格式}\Default
@@ -616,7 +634,7 @@
\subsection{页面尺寸}
\label{subsec:page margins}
-模块 \module*{geoset} 会将除了前两个附加的选项交给页面尺寸宏包 \pkg*{geometry} 处理,并且支持它的键值列表,预置的页面尺寸与 \cls*{Word} 的默认值接近。下面是列举的一小部分选项,其它选项可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。
+模块 \module*{geoset} 会将除了前两个附加的选项交给页面尺寸宏包 \pkg*{geometry} 处理,并且支持它的键值列表,预置的页面尺寸与 \cls*{Word} 的默认值接近。下面列举的仅是一小部分选项,其它选项可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。
\begin{options}\noitemsep
\keyval-{headruleskip}{页眉线间距}\Module{geoset}\Default*
\keyval-{footruleskip}{页脚线间距}\Default*
@@ -692,7 +710,7 @@
\end{ctexexam}
\end{commands}
-\subsubsection{脚注格式}
+\subsection{脚注格式}
模块 \module*{hdrset} 还可以灵活调整脚注编号和内容的格式。格式主要包括脚注标记的编号类型、字体、附加符号、对齐方式和缩进距离等,以及脚注内容的首行缩进、行距和字体等。基本思想是默认脚注和自定义编号脚注标记的格式分离,两种类型脚注各自正文和内容的标记又共享格式,默认脚注中正文和内容标记的编号类型分离。
\begin{options}
\keychoice{footnotetype}{hang,default,flush,bottom}\Module{hdrset}\Default{hang}
@@ -756,64 +774,64 @@
\subsection{目录样式}
\label{subsec:catalog style}
-模块 \module*{tocset} 将使用 \pkg*{titletoc} 处理目录样式。模块包括 \module*{part}、\module*{chapter}、\module*{section}、\module*{subsection}、\module*{figure}、\module*{table} 和 \module*{lstlisting} 二级路径,而使用 \module*{list} 路径可以统一设置图片、表格和代码目录的样式。模块中 \option{format}、\option{format+}、\option{indent}、\option{rule} 和 \option{numsep} 这 5 个选项支持所有路径类型,没有特别说明的其它选项则没有二级路径。目前支持常规的论文目录样式,更复杂的样式可以查看 \pkg*{titletoc} 宏包的相关用法。
+模块 \module*{tocset} 将使用 \pkg*{titletoc} 宏包处理目录样式。模块或扩展包括了 \module*{part}、\module*{chapter}、\module*{section}、\module*{subsection}、\module*{figure}、\module*{table} 和 \module*{lstlisting} 二级路径,而使用 \module*{list} 路径可以统一设置图片、表格和代码目录的样式。模块中 \option{tocformat}、\option{tocformat+}、\option{tocindent}、\option{tocrule}、\option{tocafter} 和 \option{tocline} 这 6 个选项支持所有相应\textbf{标题级别}的路径,没有特别说明的其它选项则处于 \module*{tocset} 路径下。目前支持标准的论文目录样式,更复杂的样式可以查看 \pkg*{titletoc} 的相关用法。
\begin{options}
- \keyval-{format}{条目格式}\Module{tocset}
+ \keyval-{tocformat}{条目格式}\Module{tocset}
目录中各级别条目的格式,可以设置条目字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。
- \keyval-{format+}{条目格式}
- 与 \option{format} 用法一样,只是在已有的格式命令后附加代码。
- \keyval-{indent}{刚性长度}
+ \keyval-{tocformat+}{条目格式}
+ 与 \option{tocformat} 用法一样,只是在已有的格式命令后附加代码。
+ \keyval-{tocindent}{刚性长度}
各级别目录中的标题左边缩进距离,通常标题级别越低缩进越大。
- \keyval-{rule}{目录引导线样式}
- 引导线选项 \option{rule} 中一般应当使用 \cs{tocrule} 命令绘制引导线,将会在下面介绍。
- \keyval-{numsep}{刚性长度}\Default{1em}
- 有编号的标题在各级别目录中编号与标题的间距,默认距离统一为 \code{1em}。
+ \keyval-{tocrule}{目录引导线样式}
+ 引导线选项 \option{tocrule} 中一般应当使用 \cs{tocrule} 命令绘制引导线,将会在下面介绍。
+ \keyval-{tocafter}{距离命令}\Default{\cs*{hspace}\Carg{1em}}
+ 在各级别目录中标签与标题间的代码,默认为插入 \code{1em} 横向距离。
+ \keyval-{tocline}{目录标签}
+ 这个选项扩展了图片、表格或代码的目录标签。图片或表格的选项中参数 \code{\#1} 代表编号,代码中 \cs*{thelstlisting} 代表编号。选项还可包含标签名称,默认标签名称与对应题注名称一致。
+ \begin{ctexexam}
+ \ctexset
+ {
+ figure/tocline = 图 #1\hspace{1em},
+ lstlisting/tocline = 代码\thelstlisting\hspace{1em}
+ }
+ \end{ctexexam}
\end{options}
\begin{commands}
\command{tocrule}[\sarg\oarg{引导点间距}\darg{放大因子}\marg{引导点}\oarg{页码格式}]
- 目录命令 \cs{tocrule} 生成目录引导线,需要在引导线选项 \option{rule} 中使用。带有星号的命令会使当前级别的目录引导线右边与页码相连而不是对齐。\meta{引导点间距} 需带有长度单位,\meta{放大因子} 不带单位,为 \meta{引导点} 的放大倍数,\meta{引导点} 一般为英文句号或 \cs*{cdot} 中心点符号。\meta{页码格式} 的代码位于页码前面,可以设置页码字体和距离等,最后一个命令可以带有一个参数,这个参数为页码编号。
+ 目录命令 \cs{tocrule} 生成目录引导线,需要在引导线选项 \option{tocrule} 中使用。带有星号的命令会使当前级别的目录引导线右边与页码相连而不是对齐。\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{tocafter} 仍然有效。\meta{编号级别} 为 \code{chapter} 和 \code{section} 等,也可用参数 \code{\#1} 代替当前级别类型,标题名用参数 \code{\#2} 代替一般不变。
\begin{ctexexam}
- \tocset
+ \ctexset
{
- chapter =
+ chapter =
{
- format = \addvspace{8pt}\large,
- indent = 1.5em,
- rule = \tocrule[0.6pc](1.1){.}[\zihao{5}]
+ tocformat = \addvspace{8pt}\large,
+ tocindent = 1.5em,
+ tocrule = \tocrule[0.6pc](1.1){.}[\zihao{5}],
+ tocline = \CTEXnumberline{#1}#2
}
}
\end{ctexexam}
\end{commands}
\begin{options}
+ \keybool{hang}\Default{false}
+ 悬挂缩进选项 \option{hang} 使目录标题为悬挂缩进形式,缩进距离为标签及其与标题间距的长度,但此时目录编号会失去超链接。这个选项对所有标题级别有效。
\keyval-{lolskip}{弹性长度}\Default{10pt}
代码目录中每章代码标题的额外距离,与 C\TeX 的表格和图片目录中每章间的标题距离选项 \option*{lotskip} 和 \option*{lofskip} 类似,在 \cls*{article} 模式中此选项失效。
- \keyval-{tocvoffset}{弹性长度}
- 主文档目录标题下方的间距补偿,一般为正值,用于抵消目录中首行的额外垂直间距。
\keyval-{voffset}{弹性长度}
图片、表格或代码目录标题下方的间距补偿,一般为正值,用于抵消目录中首行的额外垂直间距。路径为 \module*{figure}、\module*{table} 和 \module*{lstlisting},或者用 \module*{list} 路径统一设置。
- \keyval-{tocline}{目录标签}
- 图片、表格或代码的目录标签,图片或表格的选项参数中 \code{\#1} 代表编号,代码中 \cs*{thelstlisting} 代表编号。参数还可包含标签名称,默认标签名称与对应题注名称一致。路径为 \module*{figure}、\module*{table} 和 \module*{lstlisting},或者用 \module*{list} 路径统一设置。
- \begin{ctexexam}
- \tocset
- {
- hang = false,
- figure/tocline = 图 #1\hspace{1em},
- lstlisting/tocline = 代码\thelstlisting\hspace{1em}
- }
- \end{ctexexam}
+ \keyval-{main-voffset}{弹性长度}
+ 文档主目录标题下方的间距补偿,一般为正值,用于抵消目录中首行的额外垂直间距。
\keybool{line-align}\Default{true}
- 引导线选项 \option{line-align} 可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码相连。
- \keybool{hang}\Default{false}
- 悬挂缩进选项 \option{hang} 使目录标题为悬挂缩进形式,缩进距离为编号及其与标题间距的长度,但此时目录编号会失去超链接。
- \keyval-{numsep-all}{刚性长度}\Default{1em}
- 统一设置所有级别有编号的标题在目录中编号与标题的间距。
- \keyval-{indent-all}{刚性长度}
+ 引导线选项 \option{line-align} 可以使目录引导线右边对齐并与页码保持一定间隙,否则会与页码连接。
+ \keyval-{tocafter-all}{距离命令}\Default{\cs*{hspace}\Carg{1em}}
+ 统一设置所有级别在目录中标签与标题间的代码。
+ \keyval-{tocindent-all}{刚性长度}
统一设置所有级别的目录标题左边缩进。
- \keyval-{rule-all}{目录引导线样式}
+ \keyval-{tocrule-all}{目录引导线样式}
统一设置所有级别的目录引导线样式。
\end{options}
@@ -981,6 +999,8 @@
标题编号输出选项 \option{number} 为短编号形式,应当包含 \code{A}、\code{a}、\code{I}、\code{i}、或 \code{1} 其中一个符号。
\keyval-{numsep}{编号与标题的间距}\Default{0.5em}
习题标题编号与后方标题文本的间距,习题环境使用星号参数时无效。
+ \keyval-{tocnumsep}{目录编号与标题的间距}\Default{1em}
+ 目录中习题标题编号与后方标题文本的间距,习题环境使用星号参数时无效。
\keyval-{tcolorbox}{键值列表2}
局部传递 \pkg*{tcolorbox} 宏包的格式选项给习题标题(如果存在)。
\keyval-{enumitem}{键值列表3}
@@ -1215,7 +1235,6 @@
\end{commands}
\appendix
-\clearpage
\nocite{*}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/huawei/DEPENDS.txt b/macros/latex/contrib/huawei/DEPENDS.txt
index 0b4ee96ab5..9fd9cd6677 100644
--- a/macros/latex/contrib/huawei/DEPENDS.txt
+++ b/macros/latex/contrib/huawei/DEPENDS.txt
@@ -29,3 +29,4 @@ hard svg
hard textpos
hard fancyhdr
hard changepage
+hard pagecolor
diff --git a/macros/latex/contrib/huawei/huawei.cls b/macros/latex/contrib/huawei/huawei.cls
index 0e63e27b3c..0d63a46f55 100644
--- a/macros/latex/contrib/huawei/huawei.cls
+++ b/macros/latex/contrib/huawei/huawei.cls
@@ -21,11 +21,15 @@
% SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{huawei}[2021/09/13 0.12.0 Template for Huawei Documents]
+\ProvidesClass{huawei}[2021/10/26 0.13.1 Template for Huawei Documents]
\LoadClass[12pt]{article}
\makeatletter
+\newif\ifhuawei@dark
+\DeclareOption{dark}{\huawei@darktrue}
+\newif\ifhuawei@slides
+\DeclareOption{slides}{\huawei@slidestrue}
\newif\ifhuawei@nosecurity
\DeclareOption{nosecurity}{\huawei@nosecuritytrue}
\newif\ifhuawei@authordraft
@@ -85,6 +89,7 @@
\definecolor{yellow}{HTML}{F2DC5D}
\definecolor{blue}{HTML}{2274A5}
\definecolor{green}{HTML}{499167}
+ \definecolor{orange}{HTML}{F06543}
\RequirePackage{tikz}
\RequirePackage{tabularx}
\RequirePackage{titling}
@@ -93,8 +98,13 @@
\TPGrid{16}{16}
\makeatletter\newcommand\huawei@header[1]{{%
- \setstretch{0.8}%
- \fontsize{11pt}{13pt}\selectfont%
+ \ifhuawei@slides%
+ \setstretch{0.8}%
+ \fontsize{19pt}{24pt}\selectfont%
+ \else%
+ \setstretch{0.8}%
+ \fontsize{11pt}{13pt}\selectfont%
+ \fi%
\sffamily\color{gray}#1\par%
}}\makeatother
@@ -105,16 +115,19 @@
}\makeatother
\makeatletter\newcommand\huawei@logo{
- \begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-1, inner sep=0pt, outer sep=0pt]
+ \def\BLACK{\ifhuawei@dark white\else black\fi}
+ \def\BLANK{\ifhuawei@dark black\else white\fi}
+ \def\SCALE{\ifhuawei@slides 1.8\else 1\fi}
+ \begin{tikzpicture}[y=0.80pt, x=0.80pt, yscale=-\SCALE, xscale=\SCALE, inner sep=0pt, outer sep=0pt]
\begin{scope}[even odd rule,line width=0.800pt]
\begin{scope}[shift={(0,-0.00024)}]
- \path[fill=black] (10.9375,30.2240) -- (10.9375,33.6097) .. controls (10.9375,34.5713) and (10.4603,35.0845) .. (9.5932,35.0845) .. controls (8.7212,35.0845) and (8.2411,34.5565) .. (8.2411,33.5686) -- (8.2411,30.2278) -- (7.0415,30.2278) -- (7.0415,33.6097) .. controls (7.0415,35.2737) and (7.9658,36.2272) .. (9.5774,36.2272) .. controls (11.2041,36.2272) and (12.1371,35.2554) .. (12.1371,33.5609) -- (12.1371,30.2240) -- (10.9375,30.2240) -- cycle;
- \path[fill=black] (15.3511,30.2240) -- (12.7456,36.1351) -- (13.9702,36.1351) -- (14.4731,34.9903) -- (14.5091,34.9045) -- (17.2158,34.9045) -- (17.7467,36.1351) -- (19.0045,36.1351) -- (16.4233,30.2590) -- (16.4001,30.2240) -- cycle;
- \path[fill=black] (22.4840,30.2240) -- (21.1414,34.2912) -- (19.8344,30.2271) -- (18.5578,30.2271) -- (20.6186,36.1388) -- (21.6120,36.1388) -- (22.9573,32.2553) -- (24.3016,36.1388) -- (25.3034,36.1388) -- (27.3592,30.2271) -- (26.1152,30.2271) -- (24.8055,34.2912) -- (23.4626,30.2240) -- cycle;
- \path[fill=black] (34.2236,30.2240) -- (34.2236,36.1300) -- (35.4074,36.1300) -- (35.4074,30.2240) -- cycle;
- \path[fill=black] (0.2686,30.2244) -- (0.2686,36.1384) -- (1.4686,36.1384) -- (1.4686,33.7365) -- (4.1780,33.7365) -- (4.1780,36.1384) -- (5.3783,36.1384) -- (5.3783,30.2244) -- (4.1780,30.2244) -- (4.1780,32.6102) -- (1.4686,32.6102) -- (1.4686,30.2244) -- cycle;
- \path[fill=black] (28.3267,30.2284) -- (28.3267,36.1344) -- (32.7928,36.1344) -- (32.7928,35.0575) -- (29.5105,35.0575) -- (29.5105,33.5931) -- (31.6931,33.5931) -- (31.6931,32.5160) -- (29.5105,32.5160) -- (29.5105,31.3052) -- (32.6785,31.3052) -- (32.6785,30.2284) -- cycle;
- \path[fill=white] (15.8594,31.7207) -- (16.7149,33.7008) -- (16.7119,33.7008) -- (16.7701,33.8374) -- (14.9552,33.8374) -- (15.0127,33.7008) -- (15.0117,33.7008) -- cycle;
+ \path[fill=\BLACK] (10.9375,30.2240) -- (10.9375,33.6097) .. controls (10.9375,34.5713) and (10.4603,35.0845) .. (9.5932,35.0845) .. controls (8.7212,35.0845) and (8.2411,34.5565) .. (8.2411,33.5686) -- (8.2411,30.2278) -- (7.0415,30.2278) -- (7.0415,33.6097) .. controls (7.0415,35.2737) and (7.9658,36.2272) .. (9.5774,36.2272) .. controls (11.2041,36.2272) and (12.1371,35.2554) .. (12.1371,33.5609) -- (12.1371,30.2240) -- (10.9375,30.2240) -- cycle;
+ \path[fill=\BLACK] (15.3511,30.2240) -- (12.7456,36.1351) -- (13.9702,36.1351) -- (14.4731,34.9903) -- (14.5091,34.9045) -- (17.2158,34.9045) -- (17.7467,36.1351) -- (19.0045,36.1351) -- (16.4233,30.2590) -- (16.4001,30.2240) -- cycle;
+ \path[fill=\BLACK] (22.4840,30.2240) -- (21.1414,34.2912) -- (19.8344,30.2271) -- (18.5578,30.2271) -- (20.6186,36.1388) -- (21.6120,36.1388) -- (22.9573,32.2553) -- (24.3016,36.1388) -- (25.3034,36.1388) -- (27.3592,30.2271) -- (26.1152,30.2271) -- (24.8055,34.2912) -- (23.4626,30.2240) -- cycle;
+ \path[fill=\BLACK] (34.2236,30.2240) -- (34.2236,36.1300) -- (35.4074,36.1300) -- (35.4074,30.2240) -- cycle;
+ \path[fill=\BLACK] (0.2686,30.2244) -- (0.2686,36.1384) -- (1.4686,36.1384) -- (1.4686,33.7365) -- (4.1780,33.7365) -- (4.1780,36.1384) -- (5.3783,36.1384) -- (5.3783,30.2244) -- (4.1780,30.2244) -- (4.1780,32.6102) -- (1.4686,32.6102) -- (1.4686,30.2244) -- cycle;
+ \path[fill=\BLACK] (28.3267,30.2284) -- (28.3267,36.1344) -- (32.7928,36.1344) -- (32.7928,35.0575) -- (29.5105,35.0575) -- (29.5105,33.5931) -- (31.6931,33.5931) -- (31.6931,32.5160) -- (29.5105,32.5160) -- (29.5105,31.3052) -- (32.6785,31.3052) -- (32.6785,30.2284) -- cycle;
+ \path[fill=\BLANK] (15.8594,31.7207) -- (16.7149,33.7008) -- (16.7119,33.7008) -- (16.7701,33.8374) -- (14.9552,33.8374) -- (15.0127,33.7008) -- (15.0117,33.7008) -- cycle;
\path[fill=red] (15.2113,0.0001) .. controls (14.7353,0.0422) and (13.4491,0.3349) .. (13.4491,0.3349) -- (13.4486,0.3349) .. controls (10.5495,1.0843) and (9.8643,3.7151) .. (9.8643,3.7151) .. controls (9.7227,4.1575) and (9.6584,4.6109) .. (9.6395,5.0380) -- (9.6395,5.6194) .. controls (9.6780,6.5176) and (9.8777,7.1883) .. (9.8777,7.1883) .. controls (10.8461,11.4823) and (15.6075,18.5379) .. (16.6308,20.0200) .. controls (16.7034,20.0920) and (16.7615,20.0660) .. (16.7615,20.0660) .. controls (16.8720,20.0355) and (16.8633,19.9296) .. (16.8633,19.9296) -- (16.8654,19.9301) .. controls (18.4416,4.1760) and (15.2113,0.0001) .. (15.2113,0.0001) -- (15.2113,0.0001) -- cycle;
\path[fill=red] (20.4192,0.0000) .. controls (20.4192,0.0000) and (17.1748,4.1782) .. (18.7521,19.9415) -- (18.7542,19.9415) .. controls (18.7664,20.0416) and (18.8374,20.0624) .. (18.8374,20.0624) .. controls (18.9430,20.1033) and (18.9971,20.0019) .. (18.9971,20.0019) -- (18.9976,20.0029) .. controls (20.0472,18.4829) and (24.7814,11.4657) .. (25.7455,7.1882) .. controls (25.7455,7.1882) and (26.2683,5.1179) .. (25.7636,3.7150) .. controls (25.7636,3.7150) and (25.0470,1.0434) .. (22.1442,0.3375) .. controls (22.1442,0.3375) and (21.3077,0.1251) .. (20.4193,0.0000) -- (20.4192,0.0000) -- cycle;
\path[fill=red] (5.4542,4.7294) .. controls (5.4542,4.7294) and (2.6920,7.3513) .. (2.5547,10.1307) -- (2.5558,10.1307) -- (2.5558,10.5519) .. controls (2.5579,10.5836) and (2.5595,10.6157) .. (2.5615,10.6480) .. controls (2.6804,12.8893) and (4.3665,14.2157) .. (4.3665,14.2157) .. controls (7.0831,16.8634) and (13.6611,20.2062) .. (15.1896,20.9647) .. controls (15.2110,20.9727) and (15.2900,20.9985) .. (15.3364,20.9399) .. controls (15.3364,20.9399) and (15.3605,20.9216) .. (15.3715,20.8887) -- (15.3715,20.8189) .. controls (15.3704,20.8149) and (15.3683,20.8109) .. (15.3663,20.8065) -- (15.3669,20.8065) .. controls (11.1809,11.6620) and (5.4543,4.7294) .. (5.4543,4.7294) -- (5.4542,4.7294) -- cycle;
@@ -141,6 +154,8 @@
};%
\end{textblock}%
\else\fi%
+ }\makeatother
+ \makeatletter\fancyhead[L]{
\ifnum\value{page}=1\else%
\ifhuawei@nobrand\else%
\begin{textblock}{8}[0,0](1.2,0.2)%
@@ -148,6 +163,8 @@
\end{textblock}%
\fi%
\fi%
+ }\makeatother
+ \makeatletter\fancyhead[R]{
\begin{textblock}{8}[1,0](15.8,0.2)%
\raggedleft\huawei@header{%
\ifhuawei@nosecurity\else%
@@ -155,13 +172,15 @@
\fi%
}%
\end{textblock}%
+ }\makeatother
+ \makeatletter\fancyfoot[R]{
\begin{textblock}{8}[0,1](1.2,15.8)%
\ifnum\value{page}=1\else%
\huawei@header{%
\ifhuawei@anonymous\else%
\theauthor%
\ifhuawei@nosecurity\else%
- \ifx\theid\empty\else,\theid\fi
+ \ifx\theid\empty\else, \theid\fi
\fi%
\ifhuawei@nobrand\else%
\newline
@@ -349,8 +368,17 @@
\fi
}\makeatother
+\makeatletter\ifhuawei@dark
+ \RequirePackage{pagecolor}
+ \pagecolor{black}
+ \color{white}
+\fi
+
\AtBeginDocument{%
\raggedbottom%
+ \raggedcolumns%
+ \setlength\headheight{32pt}%
+ \setlength\footskip{32pt}%
\setlength\topskip{0mm}%
\setlength\parindent{0pt}%
\setlength\parskip{6pt}%
diff --git a/macros/latex/contrib/huawei/huawei.pdf b/macros/latex/contrib/huawei/huawei.pdf
index 61d6c68931..f288913d02 100644
--- a/macros/latex/contrib/huawei/huawei.pdf
+++ b/macros/latex/contrib/huawei/huawei.pdf
Binary files differ
diff --git a/macros/latex/contrib/huawei/huawei.tex b/macros/latex/contrib/huawei/huawei.tex
index ade62504a9..6b697a03af 100644
--- a/macros/latex/contrib/huawei/huawei.tex
+++ b/macros/latex/contrib/huawei/huawei.tex
@@ -29,9 +29,9 @@
\begin{document}
\maketitle
-\ff{Version: 0.12.0}
+\ff{Version: 0.13.1}
\newline
-\ff{Date: 2021/09/13}
+\ff{Date: 2021/10/26}
\section{Overview}
@@ -87,6 +87,14 @@ the layout of your document:
\href{https://en.wikipedia.org/wiki/Paper_size}{A4}),
making it perfect for presentations.
+\ff{dark}
+ turns on a dark layout, where the page color is black and the text
+ is white.
+
+\ff{slides}
+ makes all headers a bit larger, assuming that the document
+ is in the landscape mode and being presented as a slide deck.
+
\ff{nocover}
avoid printing the cover images on the first page by the
\ff{\char`\\PrintTitlePage} command.
diff --git a/macros/latex/contrib/huawei/samples/huawei-charter.tex b/macros/latex/contrib/huawei/samples/huawei-charter.tex
index cb948574dd..e352802f36 100644
--- a/macros/latex/contrib/huawei/samples/huawei-charter.tex
+++ b/macros/latex/contrib/huawei/samples/huawei-charter.tex
@@ -20,7 +20,7 @@
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
% SOFTWARE.
-\documentclass[landscape,nocover,XL]{../huawei}
+\documentclass[landscape,nocover,XL,dark,slides]{../huawei}
% \renewcommand*\thetitle{Test Charter}
% \renewcommand*\thesubtitle{Technology Project Charter}
% \renewcommand*\theauthor{Yegor Bugayenko}