From 5991e0faa2ab9a1b9bdb72d6399cff4444b02f35 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 7 Aug 2021 03:02:24 +0000 Subject: CTAN sync 202108070302 --- macros/latex/contrib/easybook/easybook.dtx | 6 +- macros/latex/contrib/easybook/easybook.pdf | Bin 583267 -> 583938 bytes macros/latex/contrib/easybook/easybook.tex | 48 +- macros/latex/contrib/huawei/huawei.cls | 88 ++-- macros/latex/contrib/huawei/huawei.pdf | Bin 336192 -> 336961 bytes macros/latex/contrib/huawei/huawei.tex | 10 +- .../contrib/huawei/samples/huawei-charter.tex | 2 +- macros/latex/contrib/smart-eqn/README.md | 6 + macros/latex/contrib/smart-eqn/smart-eqn.dtx | 550 +++++++++++++++++++++ macros/latex/contrib/smart-eqn/smart-eqn.ins | 46 ++ macros/latex/contrib/smart-eqn/smart-eqn.pdf | Bin 0 -> 85510 bytes 11 files changed, 694 insertions(+), 62 deletions(-) create mode 100644 macros/latex/contrib/smart-eqn/README.md create mode 100644 macros/latex/contrib/smart-eqn/smart-eqn.dtx create mode 100644 macros/latex/contrib/smart-eqn/smart-eqn.ins create mode 100644 macros/latex/contrib/smart-eqn/smart-eqn.pdf (limited to 'macros/latex') diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index c899f15504..821c06cf7c 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/08/03}{1.28d} +\ProvidesExplClass{easybook}{2021/08/06}{1.28e} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -292,7 +292,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/08/03}{1.28d} +\ProvidesExplPackage{easybase}{2021/08/06}{1.28e} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_add:Nn { NV,Nv } @@ -2372,7 +2372,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/03}{1.28d} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/06}{1.28e} {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 2034dc889f..793816f3a7 100644 Binary files a/macros/latex/contrib/easybook/easybook.pdf and b/macros/latex/contrib/easybook/easybook.pdf differ diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index 4ff8fe9be0..202a35ab0c 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -11,8 +11,8 @@ { name = easybook, title = EASYBOOK 使用手册, - version = v1.28d, - date = 2021/08/03, + version = v1.28e, + date = 2021/08/06, authors = 瞿毅, info = 排版简体中文学位论文和书籍, email = quee123@foxmail.com, @@ -224,10 +224,10 @@ \begin{options} \keychoice{class}{book,article}\Default{book} 使用 \cls*{easybook} 文档类可以有两种模式,默认为 \cls*{book} 模式。选用 \option{article} 会变为 \option*{oneside} 单面排版,同时使文档编号、结构等与标准 \cls*{article} 文档类的特性相似,可用于短篇幅的文章,不需要再使用 \cs*{chapter} 命令,此时节 \ref{sec:document command} 中目录命令的 \option{chapter} 选项会失效,将以 \option{section} 标题级别输出目录。如果使用 \cls*{ctexart} 配合 \pkg*{easybase} 宏包,则选项值 \code{book} 会失效。 - \opt{book}\Default - 开启 \cls*{book} 模式,与 \keyis*-{class}{book} 等效。 - \opt{article}\Default - 开启 \cls*{article} 模式,与 \keyis*-{class}{article} 等效。 + \opt{book}\Default! + 开启 \cls*{book} 书籍模式,与 \keyis*-{class}{book} 等效。 + \opt{article}\Default! + 开启 \cls*{article} 文章模式,与 \keyis*-{class}{article} 等效。 \end{options} \section{文档命令} @@ -249,7 +249,7 @@ \subsection{目录命令} \begin{commands} \command{tableofcontents}[\parg\oarg{键值列表}\darg{附加代码}] - 主文档目录命令。带有 \parg{} 号参数的命令输出双语目录,需要与双语目录标题命令 \cs{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入目录样式和换页等命令 + 主文档目录命令。带有 \parg{} 号参数的命令输出双语目录,需要与双语目录标题命令 \cs{bichapter} 等或设置图片、表格和代码等英文目录的标题配合使用,附加代码是中文与英文目录之间的代码,可以插入目录样式和换页等命令。 \command{listoffigures}[\sarg\parg\oarg{键值列表}] 输出图片目录命令。带有星号的目录命令不将目录标题添加进主文档目录,带有 \parg{} 号的目录命令可以使当前标题编号。 \command{listoftables}[\sarg\parg\oarg{键值列表}] @@ -264,7 +264,7 @@ \opt{section}\Default! 使目录标题按照 \code{section} 级别输出。 \keybool{multoc}\Default{false} - 与 \code{style/multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否多栏排版,栏数默认为双栏,可使用 \option{columns} 更改。 + 与 \module*{style/}\option{multoc} 选项具有相同的效果,但是具有优先性且可单独设置不同目录是否多栏排版,栏数默认为双栏,可使用 \option{columns} 更改。 \keyval-{columns}{目录栏数}\Default{2} 设置目录的栏数,仅在 \keyis-{multoc}{true} 时有效,默认为双栏。 \kvsplit{title}{中文目录标题,英文目录标题}\Default @@ -298,8 +298,8 @@ \begin{commands} \command{appendix}[\splitoarg{前名字,后名字}\darg{数字输出命令}] - 附录开始命令,其后的章节标题变为附录形式。英文目录中附录标题的 \meta{前名字} 为英文附录目录前名字,\meta{后名字} 为英文附录目录后名字。前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。\meta{数字输出命令} 为附录标题在英文目录中的编号命令。 - \command{BeforeAddBitoc}[\sarg\marg{加入目录英文标题前的代码}] + 附录起始命令,其后的章节标题变为附录形式。英文目录中附录标题的 \meta{前名字} 为英文附录目录前名字,\meta{后名字} 为英文附录目录后名字。前后名字之间用一个半角逗号分开,也可以只有一部分,表示英文附录目录前名字。\meta{数字输出命令} 为附录标题计数器在英文目录中的编号命令。 + \command{BeforeAddBitoc}[\sarg\marg{英文标题加入目录前的代码}] 作用于局部范围的英文目录钩子,可以插入标题或目录设置的命令改变英文目录中标题的显示格式,也可以覆盖上述的目录前后名字和编号等设置,带有星号的命令会重置之前的代码,放置在导言区或 \cs{bichapter} 等命令前生效。 \end{commands} @@ -589,7 +589,7 @@ \subsection{页面尺寸} \label{subsec:page margins} -预置的页面尺寸与 \cls*{Word} 的默认值接近,\module*{geoset} 会将前两个之外的选项交给 \pkg*{geometry} 宏包接口命令 \cs*{geometry} 处理,并且 \meta{键值列表} 的选项与之相同,上面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。 +预置的页面尺寸与 \cls*{Word} 的默认值接近,\module*{geoset} 会将前两个之外的选项交给 \pkg*{geometry} 宏包接口命令 \cs*{geometry} 处理,并且 \meta{键值列表} 的选项与之相同,下面的选项仅是一小部分,支持的参数可查阅宏包帮助文档。当在此设置页面大小时,会覆盖 \option{paper} 选项的设置。 \begin{options}\noitemsep \keyval-{headruleskip}{页眉线间距}\Module{geoset}\Default* \keyval-{footruleskip}{页脚线间距}\Default* @@ -623,8 +623,8 @@ 标题标记命令 \cs*{sectionmark} 的内容,包括了标签选项 \option{sec-label} 的内容。 \keyval-{subsec-mark}{标题标记} 标题标记命令 \cs*{subsectionmark} 的内容,包括了标签选项 \option{subsec-label} 的内容。 - \kvsplit-{chap-label}{\oarg{编号}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}} - 标题标记命令 \cs*{chaptermark} 内容的标签,比标记命令内容选项更常用,可选参数是页眉的标题编号形式,必选参数是编号与标题之间的距离命令: + \kvsplit-{chap-label}{\oarg{数字输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{1em}} + 标题标记命令 \cs*{chaptermark} 内容的标签(标题有编号时),比标记命令内容选项更常用,可选参数是对应于章节编号计数器的输出命令,必选参数是编号与标题之间的距离命令: \begin{ctexexam} \hdrset { @@ -632,12 +632,12 @@ sec-mark = \CTEXifname{\CTEXthesection——}{}#1 } \end{ctexexam} - \kvsplit-{sec-label}{\oarg{编号}\marg{距离命令}}\Default{\cs*{hspace}\Marg{0.5em}} + \kvsplit-{sec-label}{\oarg{数字输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{0.5em}} 标题标记命令 \cs*{sectionmark} 内容的标签,用法与 \option{chap-label} 类似。 - \kvsplit-{subsec-label}{\oarg{编号}\marg{距离命令}}\Default{\cs*{hspace}\Marg{0.5em}} + \kvsplit-{subsec-label}{\oarg{数字输出命令}\marg{距离命令}}\Default{\cs*{hspace}\Marg{0.5em}} 标题标记命令内容 \cs*{subsectionmark} 的标签,用法与 \option{chap-label} 类似。 \keyval-{headrule}{横线命令} - 绘制页眉横线的选项,可以使用 \cs*{hrule}、\cs*{rule} 或下述 \cs{markrule} 等画线命令来绘制横线。手动绘制横线时线条粗细选项 \code{style/rulewidth} 会失效。 + 绘制页眉横线的选项,可以使用 \cs*{hrule}、\cs*{rule} 或下述 \cs{markrule} 等画线命令来绘制横线。手动绘制横线时线条粗细选项 \module*{style/}\option{rulewidth} 会失效。 \keyval-{footrule}{横线命令}\Default 绘制页脚横线的选项,可以使用 \cs*{hrule}、\cs*{rule} 或下述 \cs{markrule} 等画线命令来绘制横线。 \keyval-{footnoterule}{横线命令} @@ -658,7 +658,7 @@ \begin{commands} \command{markrule}[\oarg{长度}\darg{颜色名}\marg{线宽}\spemcoarg{上间距,下间距}] - 命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,间距长度之间用 \code{!} 号分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子: + 命令 \cs{markrule} 既可在 \meta{横线命令} 中用于绘制页眉页脚横线,也可以在正文中使用。\meta{长度} 默认为页面文本区的宽度,上下间距为横线与上下方部件的间距,带有长度单位,上下间距之间用 \code{!} 号分开,若只有一部分则表示 \meta{上间距}。下面举一个设置页眉内容的例子: \begin{ctexexam} \hdrset { @@ -688,7 +688,7 @@ \hdrset{footnotetype = {hang,bottom}} \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。 @@ -711,7 +711,7 @@ \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} 级别可以统一设置图片、表格和代码目录的样式。目前目录支持适用于论文的常规样式,如果您需要例如段落或更复杂的样式可以使用本模块基于的 \cs*{titlecontents} 命令。 \begin{options} \keyval-{format}{目录标题格式}\Module{/(level)} 各级别目录中标题的格式,可以设置字体和加入垂直间距等,垂直间距最好使用防止垂直间距重合的 \cs*{addvspace} 命令。 @@ -1017,7 +1017,7 @@ \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{计数器} 设为指定值。 + 命令 \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} @@ -1056,7 +1056,7 @@ \begin{commands} \command{symb}[\sarg\marg{符号}\oarg{引导符}] - \cs{symb} 类似列表条目 \cs*{item},需要在环境内使用,带有星号的命令可在文本段落单独使用。 + 符号条目命令 \cs{symb} 类似 \cs*{item},需要在环境内使用,带有星号的命令可在文本段落单独使用。 \command{seteqcomplist}[\marg{键值列表2}] 对照列表条目格式的 \meta{键值列表2} 可以使用 \cs{seteqcomplist} 全局设置。 \command{seteqcomp}[\marg{键值列表1}] @@ -1108,9 +1108,9 @@ \subsubsection{自定义脚注} \begin{commands}\noitemsep \command{Footnote}[\oarg{内容标记}\marg{正文标记}\marg{脚注文本}]\default{} - \command{Footnotetext}[\marg{标记}\marg{脚注文本}]\default{} - \command{Footnotemark}[\marg{标记}] - 这些是自定义 \meta{标记} 且不影响正常编号的脚注命令,用法与它们对应首字母小写的命令类似。\meta{内容标记} 默认与 \meta{正文标记} 一致,可以进行微调。如果 \meta{标记} 为空,那么将会使用上一个脚注标记。 + \command{Footnotetext}[\marg{内容标记}\marg{脚注文本}]\default{} + \command{Footnotemark}[\marg{正文标记}] + 这些是自定义标记且不影响正常编号的脚注命令,用法与它们对应首字母小写的命令类似。\meta{内容标记} 默认与 \meta{正文标记} 一致,可以进行微调。如果当前标记为空,那么将会使用上一个脚注标记。 \begin{ctexexam} \Footnote{*}{这是可以自定义标记的脚注。} \end{ctexexam} diff --git a/macros/latex/contrib/huawei/huawei.cls b/macros/latex/contrib/huawei/huawei.cls index c05ba70175..9dabf913a4 100644 --- a/macros/latex/contrib/huawei/huawei.cls +++ b/macros/latex/contrib/huawei/huawei.cls @@ -21,8 +21,12 @@ % SOFTWARE. \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{huawei}[2021/07/15 0.8.0 Template for Huawei Documents] +\ProvidesClass{huawei}[2021/08/06 0.9.0 Template for Huawei Documents] +\newif\ifXL +\DeclareOption{XL}{\XLtrue} +\newif\ifXXL +\DeclareOption{XXL}{\XXLtrue} \newif\ifnosecurity \DeclareOption{nosecurity}{\nosecuritytrue} \newif\ifauthordraft @@ -101,6 +105,22 @@ \newcommand\headers[1]{\setstretch{0.8}{\small\sffamily\color{gray}#1\par}} \newcommand\crumb[2]{\begin{minipage}{\columnwidth}\raggedright\textsc{#1}:\\#2\end{minipage}\vspace{4pt}} +\usepackage{titlesec} + \ifXL + \titleformat*{\section}{\LARGE\bfseries} + \titleformat*{\subsection}{\Large\bfseries} + \titleformat*{\subsubsection}{\large\bfseries} + \titleformat*{\paragraph}{\large\bfseries} + \titleformat*{\subparagraph}{\large\bfseries} + \fi + \ifXXL + \titleformat*{\section}{\huge\bfseries} + \titleformat*{\subsection}{\LARGE\bfseries} + \titleformat*{\subsubsection}{\Large\bfseries} + \titleformat*{\paragraph}{\large\bfseries} + \titleformat*{\subparagraph}{\large\bfseries} + \fi + \AtBeginDocument{% \raggedbottom% \setlength\topskip{0mm}% @@ -108,6 +128,8 @@ \setlength\parskip{6pt}% \setlength\columnsep{32pt}% \def\arraystretch{1.5}% + \ifXL\large\fi + \ifXXL\Large\fi } \newcommand\LeftHuaweiBar{% @@ -240,7 +262,8 @@ \newpage \vspace*{\fill} \begin{center} - {\Huge\color{huawei-red}\textbf{Thank you!}} + \normalsize + {\Huge\color{huawei-red}\textbf{Thank you!}} \end{center} \vspace*{\fill} } @@ -298,41 +321,42 @@ \newpage \vspace*{1in} \begin{center} - \begin{minipage}{0.6\columnwidth}\raggedright - \setlength{\parskip}{6pt} - {\Huge\color{huawei-red}\textbf{Thank you!}} + \begin{minipage}{0.6\columnwidth}\raggedright + \normalsize + \setlength{\parskip}{6pt} + {\Huge\color{huawei-red}\textbf{Thank you!}} - \vspace{0.5in} + \vspace{0.5in} - \begin{CJK}{UTF8}{gbsn} - 把数字世界带入每个人、每个家庭、
每个组织、构建万物互联的智能世界。 - \end{CJK} + \begin{CJK}{UTF8}{gbsn} + 把数字世界带入每个人、每个家庭、
每个组织、构建万物互联的智能世界。 + \end{CJK} - Bring digital to every person, home and organization - \newline - for a fully connected, intelligent world. + Bring digital to every person, home and organization + \newline + for a fully connected, intelligent world. - \textbf{% - Copyright \copyright{} \the\year{} \thecompany{} - \newline - All Rights Reserved.% - } + \textbf{% + Copyright \copyright{} \the\year{} \thecompany{} + \newline + All Rights Reserved.% + } - The information in this document may contain predictive - statements including, without limitation, statements regarding - the future financial and operating results, future product - portfolio, new technology, etc. There are a number of factors that - could cause actual results and developments to differ materially - from those expressed or implied in the predictive statements. - Therefore, such information is provided for reference purpose - only and constitutes neither an offer nor an acceptance. - \ifnobrand% - The author% - \else% - \thecompany{}% - \fi - may change the information at any time without notice. - \end{minipage} + The information in this document may contain predictive + statements including, without limitation, statements regarding + the future financial and operating results, future product + portfolio, new technology, etc. There are a number of factors that + could cause actual results and developments to differ materially + from those expressed or implied in the predictive statements. + Therefore, such information is provided for reference purpose + only and constitutes neither an offer nor an acceptance. + \ifnobrand% + The author% + \else% + \thecompany{}% + \fi + may change the information at any time without notice. + \end{minipage} \end{center}% } diff --git a/macros/latex/contrib/huawei/huawei.pdf b/macros/latex/contrib/huawei/huawei.pdf index b7a570f9a1..ce0d26f55b 100644 Binary files a/macros/latex/contrib/huawei/huawei.pdf and b/macros/latex/contrib/huawei/huawei.pdf differ diff --git a/macros/latex/contrib/huawei/huawei.tex b/macros/latex/contrib/huawei/huawei.tex index 5e0cc72416..226f2980e0 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.8.0} +\ff{Version: 0.9.0} \newline -\ff{Date: 2021/07/15} +\ff{Date: 2021/08/06} \section{Overview} @@ -126,6 +126,12 @@ the layout of your document: \ff{authordraft} prints a big ``It's a draft'' message across each page. +\ff{XL} + makes the font of the entire document a bit larger. + +\ff{XXL} + makes the font of the entire document much larger. + \section{Preamble} In the preamble you can specify meta information about the document, diff --git a/macros/latex/contrib/huawei/samples/huawei-charter.tex b/macros/latex/contrib/huawei/samples/huawei-charter.tex index 0cbc02b9d2..399e1cdc7d 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]{../huawei} +\documentclass[landscape,nocover,XL]{../huawei} \renewcommand*\thetitle{Test Charter} \renewcommand*\thesubtitle{Technology Project Charter} \renewcommand*\theauthor{Yegor Bugayenko} diff --git a/macros/latex/contrib/smart-eqn/README.md b/macros/latex/contrib/smart-eqn/README.md new file mode 100644 index 0000000000..256a62e139 --- /dev/null +++ b/macros/latex/contrib/smart-eqn/README.md @@ -0,0 +1,6 @@ +# The `smart-eqn` package + +- Author: Ziyue "Alan" Xiang +- VC: + +This package provides automatic math symbol styling for LaTeX documents. For more information, see `smart-eqn.pdf`. \ No newline at end of file diff --git a/macros/latex/contrib/smart-eqn/smart-eqn.dtx b/macros/latex/contrib/smart-eqn/smart-eqn.dtx new file mode 100644 index 0000000000..c2526ecc8a --- /dev/null +++ b/macros/latex/contrib/smart-eqn/smart-eqn.dtx @@ -0,0 +1,550 @@ +% \iffalse meta-comment +% +% Copyright (C) 2021 by Ziyue "Alan" Xiang +% +% This file may be distributed and/or modified under the conditions of +% the LaTeX Project Public License, either version 1.3c of this license +% 28 or (at your option) any later version. The latest version of this +% 29 license is in: +% +% http://www.latex-project.org/lppl.txt +% +% and version 1.3c or later is part of all distributions of LaTeX +% version 2006/05/20 or later. +% +% \fi +% +% \iffalse +%<*driver> +\ProvidesFile{smart-eqn.dtx} +% +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesExplPackage{smart-eqn}{08/05/2021}{1.0}{Automatic Math Symbol Styling} +% +% +%<*driver> +\makeatletter +\@namedef{ver@fourier.sty}{} % suppress the loading of fourier +\makeatother +\documentclass{ydoc} +\usepackage[english]{babel} +\usepackage{fontspec, unicode-math} +\usepackage{smart-eqn} +\usepackage{microtype} +\usepackage{etoolbox} +\usepackage{titlesec} +\usepackage{chngcntr} +\usepackage[skins,listings,xparse]{tcolorbox} +\usepackage{hyperref} + +\ExplSyntaxOff + +\AlsoImplementation + +\setmainfont{ETbb-Regular}[ + Extension=.otf, + BoldFont=ETbb-Bold, + ItalicFont=ETbb-Italic, + BoldItalicFont=ETbb-BoldItalic +] +\setsansfont{QTAvanti}[ + Extension=.otf, + ItalicFont=QTAvanti-Italic, + Scale=0.8 +] +\setmonofont{NewCMMono10-Regular}[ + Extension=.otf, + BoldFont=NewCMMono10-Bold, + ItalicFont=NewCMMono10-Italic +] +\newfontfamily{\QTFloraline}{QTFloraline}[ + Extension=.otf, + BoldFont=QTFloraline-Bold +] +\newfontfamily{\dejavumono}{DejaVuSansMono}[ + Extension=.ttf, + BoldFont=DejaVuSansMono-Bold, + ItalicFont=DejaVuSansMono-Oblique, + BoldItalicFont=DejaVuSansMono-BoldOblique +] +\setmathfont{Asana-Math}[Extension=.otf] + +\newcommand{\thispkg}{\pkg{smart-eqn}} +\title{\QTFloraline The \thispkg~Package:\\ Automatic Math Symbol Styling} +\author{\href{https://www.alanshawn.com}{Ziyue ``Alan'' Xiang}} +\date{\today} +\repository{https://github.com/xziyue/smart-eqn} +\email{ziyue.alan.xiang@gmail.com} + +\titleformat*{\section}{\QTFloraline\large\bfseries} +\titleformat*{\subsection}{\QTFloraline\bfseries} + +%\newcounter{example} +%\counterwithin{example}{section} + +\DeclareTCBListing{exbox}{soo}{ + IfBooleanTF={#1}{listing only}{}, + enhanced, + sharp corners, + boxrule=0pt, + attach boxed title to top left, + title={\sffamily\large EXAMPLE~\refstepcounter{example}\theexample% + \IfValueT{#2}{\label{#2}}% + \IfValueT{#3}{\space #3} + }, + boxed title style={sharp corners, boxrule=0pt, colback=black!25}, + listing options={ + basicstyle={\dejavumono\scriptsize}, + xleftmargin=0pt, + xrightmargin=0pt, + framesep=0pt, + aboveskip=0pt, + belowskip=0pt, + framexbottommargin=0pt, + breaklines=true, + breakatwhitespace=false + } +} + +\def\PrintMacroCode{% + \begingroup + \dejavumono + \fontsize{6}{8}\selectfont + \noindent\themacrocode + \par + \endgroup +} +\def\linenumberbox{% + \hbox to 1.25em{}% + \llap{% + \stepcounter{linenumber}% + {\color{gray}\tiny\thelinenumber~}% + }% +} +\ExplSyntaxOn +\def\PrintMacroImplName#1{% + \str_set:Nn \l_tmpa_str {#1} + \regex_replace_all:nnN {\s} {} \l_tmpa_str + \implstyle{\str_use:N \l_tmpa_str}% +} +\ExplSyntaxOff + +\begin{document} +\DocInput{smart-eqn.dtx} +\end{document} +% +% \fi +% \maketitle +% \tableofcontents +% \section{Introduction} +% \makeatmath +% \smesetsym{symbfup}{A,v} +% In \LaTeX~typesetting, it is usually the case that one needs to use different variants of a math symbol to clarify the meanings. For example, in linear algebra literature, it is common to use boldfaced symbols to represent vectors, and use normal symbols to represent scalars, which makes equations like @Av=\lambda v@ easier to understand. However, applying these variants by typing |\mathbf|, |\mathrm| commands manually can be daunting. The \thispkg~package aims to provide an automatic and customizable approach for math symbol styling, which eliminates the need to enter style commands repeatedly. +% \makeatother + +%\section{Usage} + +%\subsection{Style Configuration} + +% \DescribeMacro\smesetsym{