From f69513397ac0e1f02c6b4a5f50588d411413271a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 7 Jan 2022 03:01:08 +0000 Subject: CTAN sync 202201070301 --- macros/latex/contrib/dbshow/dbshow-doc.pdf | Bin 252249 -> 348241 bytes macros/latex/contrib/dbshow/dbshow-doc.tex | 386 +++++++++++++++++------ macros/latex/contrib/dbshow/dbshow.sty | 22 +- macros/latex/contrib/easybook/easybook.dtx | 18 +- macros/latex/contrib/easybook/easybook.pdf | Bin 594531 -> 595245 bytes macros/latex/contrib/easybook/easybook.tex | 10 +- macros/latex/contrib/siunitx/CHANGELOG.md | 9 +- macros/latex/contrib/siunitx/siunitx-code.pdf | Bin 607911 -> 608193 bytes macros/latex/contrib/siunitx/siunitx-complex.dtx | 30 +- macros/latex/contrib/siunitx/siunitx-number.dtx | 80 +++-- macros/latex/contrib/siunitx/siunitx.dtx | 2 +- macros/latex/contrib/siunitx/siunitx.pdf | Bin 638349 -> 638333 bytes 12 files changed, 389 insertions(+), 168 deletions(-) (limited to 'macros/latex') diff --git a/macros/latex/contrib/dbshow/dbshow-doc.pdf b/macros/latex/contrib/dbshow/dbshow-doc.pdf index 5f709c5f0a..3809cbc296 100644 Binary files a/macros/latex/contrib/dbshow/dbshow-doc.pdf and b/macros/latex/contrib/dbshow/dbshow-doc.pdf differ diff --git a/macros/latex/contrib/dbshow/dbshow-doc.tex b/macros/latex/contrib/dbshow/dbshow-doc.tex index 7799f42dc6..02332a1257 100644 --- a/macros/latex/contrib/dbshow/dbshow-doc.tex +++ b/macros/latex/contrib/dbshow/dbshow-doc.tex @@ -7,6 +7,9 @@ \usepackage{geometry} \usepackage{tabularray} \usepackage{xcolor} +\usepackage{tcolorbox} +\tcbuselibrary{listings, skins, raster, breakable} +\usepackage{tabularray} \IndexPrologue { @@ -56,6 +59,10 @@ } \ExplSyntaxOn +\NewDocumentCommand { \strcs } { m } { + \texttt{\tl_to_str:n { #1 }} +} + \dim_new:N \l__my_syntax_dim \box_new:N \g__my_syntax_box \NewDocumentEnvironment { Syntax } { s } @@ -128,14 +135,11 @@ \protect\hypertarget{zh}{} }} } -\author{\textit{李昌锴} \texttt{}} -\date{2022年1月3日} +\author{\textit{李昌锴} \texttt{}} +\date{2022年1月7日} \maketitle -{\small \tableofcontents -} -\newpage \begin{documentation} @@ -235,6 +239,26 @@ 为当前样式设置由 \cs{dbCombineFilters} 所定义的过滤器 \end{option} +\begin{option}{opt=raw-filter, desc={= \meta{cond combination}}} + 用已定义的条件为当前样式设置匿名过滤器。下面两个例子的作用是等同的。 +\end{option} + +\begin{verbatim} + % method 1 + \begin{dbFilters}{db} + \dbNewConditional{cond1}{int-attr}{\rval > 1} + \dbNewConditional*{cond2}{str-attr}{\d+} + \end{dbFilters} + \dbNewStyle{style}{db}{raw-filter={cond1 && cond2}} + % method 2 + \begin{dbFilters}{db} + \dbNewConditional{cond1}{int-attr}{\rval > 1} + \dbNewConditional*{cond2}{str-attr}{\d+} + \dbCombineFilters{filter}{cond1 && cond2} + \end{dbFilters} + \dbNewStyle{style}{db}{filter=filter} +\end{verbatim} + \begin{option}{ opt = sort, desc = {= \{ \meta{attr spec1}, \meta{attr spec2}, \ldots{} \}}, @@ -528,12 +552,29 @@ } \end{verbatim} -\subsection{常量} +\subsection{特殊命令} -\begin{function}{\dbDatabase, \dbFilterName, \dbFilterInfo, \dbIndex} - \cs{dbDatabase} 指代数据库名,\cs{dbFilterName} 指代过滤器名称, - \cs{dbFilterInfo} 指代过滤器额外信息,\cs{dbIndex} 指代当前索引。 -\end{function} +\pkg{dbshow} 定义了一些特殊的命令,会根据语境展开为不同的内容。 + +\DescribeMacro{\dbval}当前属性的值,只能在 \cs{dbNewConditional} 中使用 + +\DescribeMacro{\dbDatabase}数据库名称 + +\DescribeMacro{\dbFilterName}过滤器名称 + +\DescribeMacro{\dbFilterInfo}过滤器信息 + +\DescribeMacro{\dbIndex}原始数据索引,等同于 |\dbuse{id}| 但是 \cs{dbuse} 是不可展开的 + +\DescribeMacro{\dbarabic}用数字表示的查询集数据计数 + +\DescribeMacro{\dbalph}用小写字母表示的查询集数据计数 + +\DescribeMacro{\dbAlph}用小写字母表示的查询集数据计数 + +\DescribeMacro{\dbroman}用小写罗马数字表示的查询集数据计数 + +\DescribeMacro{\dbRoman}用大写罗马数字表示的查询集数据计数 \section{错题本示例} 见第 \ref{sec:example} 节。 @@ -547,8 +588,8 @@ \protect\hypertarget{en}{} }} } -\author{Li Changkai \texttt{}} -\date{2022/01/03} +\author{Li Changkai \texttt{}} +\date{2022/01/07} \maketitle \section{Introduction} @@ -647,6 +688,27 @@ from a list of \meta{base styles} such as Set the \meta{filter} defined by \cs{dbCombineFilters}. \end{option} +\begin{option}{opt=raw-filter, desc={= \meta{cond combination}}} + Set anonymous with defined conditionals. Two examples below perform the same + function. +\end{option} + +\begin{verbatim} + % method 1 + \begin{dbFilters}{db} + \dbNewConditional{cond1}{int-attr}{\rval > 1} + \dbNewConditional*{cond2}{str-attr}{\d+} + \end{dbFilters} + \dbNewStyle{style}{db}{raw-filter={cond1 && cond2}} + % method 2 + \begin{dbFilters}{db} + \dbNewConditional{cond1}{int-attr}{\rval > 1} + \dbNewConditional*{cond2}{str-attr}{\d+} + \dbCombineFilters{filter}{cond1 && cond2} + \end{dbFilters} + \dbNewStyle{style}{db}{filter=filter} +\end{verbatim} + \begin{option}{ opt = sort, desc = {= \{ \meta{attr spec1}, \meta{attr spec2}, \ldots{} \}}, @@ -956,102 +1018,240 @@ code is showned below. } \end{verbatim} -\subsection{Constants} +\subsection{Special Macros} -\begin{function}{\dbDatabase, \dbFilterName, \dbFilterInfo, \dbIndex} - \cs{dbDatabase} represents for the database name, \cs{dbFilterName} represents for - the filter name, \cs{dbFilterInfo} represents for the extra info of the - filter and \cs{dbIndex} represents for the item index. -\end{function} +Some special macros are defined to expand to different contents according to context. + +\DescribeMacro{\dbval} Attribute value, only accessible in \cs{dbNewConditional}. + +\DescribeMacro{\dbDatabase} Database name. + +\DescribeMacro{\dbFilterName} Filter name. + +\DescribeMacro{\dbFilterInfo} Filter information. + +\DescribeMacro{\dbIndex} Index of original records, which is equal to |\rvuse{id}| but \cs{rvuse} is nonexpandable. + + +\DescribeMacro{\dbarabic} Show the counter of query set as digits. + +\DescribeMacro{\dbalph} Show the counter of query set as lowercase letters. + +\DescribeMacro{\dbAlph} Show the counter of query set as uppercase letters. + +\DescribeMacro{\dbroman} Show the counter of query set as roman numerals. + +\DescribeMacro{\dbRoman} Show the counter of query set as Roman numerals. \section{Example of Flaw Sweeper Template} \label{sec:example} -\begin{verbatim} - \documentclass{article} - \usepackage{dbshow} - \usepackage{hyperref} +\begin{tcblisting}{enhanced jigsaw,lower separated=false, +leftlower=0pt,rightlower=0pt, +colframe=red!50!black,colback=yellow!10!white, +listing options={style=tcblatex,texcsstyle=*\color{red!70!black}}, +listing and comment, +pdf comment,freeze pdf, +compilable listing, +breakable, +run pdflatex +} +\documentclass{article} +\usepackage{amsmath, physics} +\usepackage{geometry} +\usepackage{dbshow} +\usepackage{tikz} +\usepackage{tcolorbox} +\tcbuselibrary{skins} +\usetikzlibrary{shadings} +\usepackage[hidelinks]{hyperref} - \NewDocumentCommand { \hyperlinktarget } { m m m } {% - \hyperlink{#1}{#3}\hypertarget{#2}{} - } +\geometry{ + margin=2cm +} - \dbNewDatabase{ques}{ - question=tl, - answer=tl, - date=date, - count=int, - labels=clist - } - \dbNewReviewPoints{review}{1, 3, 7, 15, 30, 60} - - \begin{dbFilters}{ques} - % which need reviewed today? - \dbNewConditional{date}{date}{review|2021-12-25} - \dbNewConditional{easy}{labels}{easy} - \dbNewConditional{not-easy}{labels}{mid, hard} - % questions you haven't answered correctly for more than 3 times! - \dbNewConditional{bad}{count}{\dbval > 3} - \dbCombineConditionals{date}{date}[to be review today] - \dbCombineConditionals{easy}{easy}[easy questions] - \dbCombineConditionals{not-easy}{not-easy}[hard questions] - \dbCombineConditionals{bad}{bad}[bad questions] - \dbCombineConditionals{bad-easy}{bad && easy}[bad but easy questions] - \end{dbFilters} +% #1 link node #2 target node #3 text to show +\NewDocumentCommand \linktarget { m m m } {% + \hyperlink{#1}{#3}% + \raisebox{1em}{\hypertarget{#2}{}}% +} - \newcounter{ques} - - \dbNewStyle{test}{ques} { - before-code = {\setcounter{ques}{0}\section{Test}}, - item-code = { - \refstepcounter{ques} - \par\noindent\arabic{ques}. \dbuse{labels} \dbuse{date}\hfill \dbuse{count} - \par\noindent ques: \dbuse{question} - \par\noindent\hyperlinktarget - {answer_\dbIndex}{ques_\dbIndex}{go to answer} - }, - } - \dbNewStyle{check}{ques} { - before-code = {\setcounter{ques}{0}\section{Answer}}, - item-code = { - \refstepcounter{ques} - \par\noindent\arabic{ques}. \dbuse{labels} \dbuse{date}\hfill \dbuse{count} - \par\noindent ques: \dbuse{question} - \par\noindent\hyperlinktarget - {ques_\dbIndex}{answer_\dbIndex}{back to question} - \par\noindent answer: \dbuse{answer} - }, - } - \dbNewStyle[test]{test-bad}{ques}{ - filter=bad, - before-code = {\setcounter{ques}{0}\section{Bad Question}} +% question box +\tcbset{ + base/.style={ + empty, + frame engine=path, + colframe=yellow!10, + coltitle=red!70, + fonttitle=\bfseries\sffamily, + sharp corners, + left=4pt, + right=4pt, + drop fuzzy shadow, + drop fuzzy shadow, + borderline west={3pt}{-3pt}{red!80}, } +} - \AtEndDocument{ - \dbshow{test}{ques} - \dbshow{test-bad}{ques} - \dbshow{check}{ques} - } +\newtcolorbox{mybox}[1]{% + base, title = {#1} +} - \begin{document} +\dbNewReviewPoints{review}{1, 3, 7, 15, 30, 60} - \begin{dbitem}{ques}[date=2021-12-21, count=1, labels=easy] - \dbsave{question}{This is test question 1.} - \dbsave{answer}{This is test question 1.} - \end{dbitem} +\dbNewDatabase{ques-book}{ + ques = tl, + answer = tl, + count = int|1, + labels = clist, + date = date, +} - \begin{dbitem}{ques}[date=2021-12-22, count=4, labels=easy] - \dbsave{question}{This is test question 2.} - \dbsave{answer}{This is test question 2.} - \end{dbitem} +\begin{dbFilters}{ques-book} + \dbNewConditional{hard}{labels}{hard} + \dbNewConditional{bad}{count}{\dbval > 1} + \dbNewConditional{review}{date}{review|2022-01-07} +\end{dbFilters} + +% show all questions with hyperlink to answers +\dbNewStyle{ques}{ques-book}{ + before-code = {\section{Questions}}, + item-code = { + \begin{mybox}{% + \linktarget{answer_\dbIndex}{ques_\dbIndex}{% + Question \dbarabic% + \hspace{2em}\dbuse{date}% + \hspace{2em}\dbuse{labels}% + \hfill\dbuse{count}% + }% + } + \dbuse{ques}% + \end{mybox} + }, + labels/sep = /, +} - \begin{dbitem}{ques}[date=2021-12-23, count=3, labels=hard] - \dbsave{question}{This is test question 3.} - \dbsave{answer}{This is test question 3.} - \end{dbitem} +% show all questions and answers with hyperlink to questions +\dbNewStyle{answer}{ques-book}{ + before-code = {\section{Questions and Answers}}, + item-code = { + \begin{mybox}{% + \linktarget{ques_\dbIndex}{answer_\dbIndex}{% + Question \dbarabic% + \hspace{2em}\dbuse{date}% + \hspace{2em}\dbuse{labels}% + \hfill\dbuse{count}% + }% + } + \dbuse{ques}\tcbsubtitle{Answer}\dbuse{answer}% + \end{mybox} + }, + labels/sep = /, +} - \end{document} -\end{verbatim} +% show all hard questions with hyperlink to answers +\dbNewStyle{hard}{ques-book}{ + before-code = {\section{Hard Questions}}, + item-code = { + \begin{mybox}{% + \hyperlink{answer_\dbIndex}{% + Question \dbarabic% + \hspace{2em}\dbuse{date}% + \hspace{2em}\dbuse{labels}% + \hfill\dbuse{count}% + }% + } + \dbuse{ques}% + \end{mybox} + }, + raw-filter = hard, + labels/sep = /, +} + +% show all hard questions that have answered incorrectly for more than one +% time with hyperlink to answers +\dbNewStyle[hard]{bad}{ques-book}{ + before-code = {\section{Bad Questions}}, + raw-filter = {bad && hard}, +} +% show all questions that plan to be reviewed on 2022-01-07 with hyperlink to +% answers +\dbNewStyle[hard]{review}{ques-book}{ + before-code = {\section{Questions to be Reviewed}}, + raw-filter = {review}, +} + +\AtEndDocument{ + \dbshow{review}{ques-book} + \dbshow{hard}{ques-book} + \dbshow{bad}{ques-book} + \dbshow{ques}{ques-book} + \dbshow{answer}{ques-book} +} + +\begin{document} + +\begin{dbitem}{ques-book}[ + date=2022-01-01, + labels={math, equation, easy}, + count=2 + ] + \dbsave{ques}{% + Solve the linear equation: $x + 16 = 31$. + } + \dbsave{answer}{% + $x = 31 - 16 = 15$ + } +\end{dbitem} + +\begin{dbitem}{ques-book}[ + date=2022-01-01, + labels={math, equation, hard}, + count=3 + ] + \dbsave{ques}{% + Solve the linear equation: $2y = 16$. + } + \dbsave{answer}{% + $y = 16 / 2 = 8$ + } +\end{dbitem} + +\begin{dbitem}{ques-book}[ + date=2022-01-04, + labels={math, integral, hard}, + count=1 + ] + \dbsave{ques}{% + Find the indefinite integral: $\int 2x \dd x$. + } + \dbsave{answer}{% + $\int 2x \dd x = x^2$ + } +\end{dbitem} + +\end{document} +\end{tcblisting} + +\section*{Change History} +\markboth{Change History}{Change History} +\addcontentsline{toc}{section}{Change History} +\noindent +\begin{tblr}{ + colspec = {lll}, + row{1} = {font=\bfseries}, +} + Date & Ver. & Describe \\ + 2022-01-05 & 1.0 & { + First version \\ + Add macro: \cmd{\dbarabic}, \cmd{\dbalph}, \cmd{\dbAlph}, \cmd{\dbroman}, \cmd{\dbRoman} + } \\ + 2022-01-06 & & { + Fix bug: \cmd{\dbIndex} undefined \\ + Add style option: \opt{raw-filter} + } \\ + 2022-01-07 & 1.1 & Improve example \\ +\end{tblr} \end{documentation} diff --git a/macros/latex/contrib/dbshow/dbshow.sty b/macros/latex/contrib/dbshow/dbshow.sty index 6e51f048a4..0b02c20311 100644 --- a/macros/latex/contrib/dbshow/dbshow.sty +++ b/macros/latex/contrib/dbshow/dbshow.sty @@ -14,8 +14,8 @@ % The Current Maintainer of this work is Li Changkai. % % This work consists of the files dbshow.sty, dbshow-doc.tex. -\def\myfileversion{1.0} -\def\myfiledate{2022/01/02} +\def\myfileversion{1.1} +\def\myfiledate{2022/01/07} \RequirePackage{expl3, xparse} \RequirePackage[calc]{datetime2} \ProvidesExplPackage @@ -444,7 +444,6 @@ \tl_gset_eq:cN { g__dbshow_filter_bool_tl_#1_#2 } \l_tmpa_tl } -\cs_generate_variant:Nn \regex_replace_all:nnN { nnc } % #1 database #2 content \NewDocumentEnvironment { dbFilters } { m +b } { \seq_gclear_new:c { g__dbshow_cond_list_#1 } @@ -488,12 +487,19 @@ } } +\int_gzero_new:N \g__dbshow_raw_filter_int % #1 style name #2 database name \cs_new_protected:Nn \dbshow_new_database_style:nn { \dbshow_check_database:n { #2 } \keys_define:nn { dbshow/style/#1 } { filter .tl_gset:c = { g__dbshow_filter_#1_#2 }, filter .initial:n = -none-, + raw-filter .code:n = { + \int_gincr:N \g__dbshow_raw_filter_int + \str_set:Nx \l_tmpa_str { -raw\int_use:N \g__dbshow_raw_filter_int - } + \exp_args:NnV \tl_gset:cn { g__dbshow_filter_#1_#2 } \l_tmpa_str + \exp_args:NnV \dbshow_combine_conditional:nnn { #2 } \l_tmpa_str { ##1 } + }, sort .clist_gset:c = { g__dbshow_sort_#1_#2 }, before-code .tl_gset:c = { g__dbshow_style_before_#1_#2 }, before-code .initial:n = , @@ -604,7 +610,16 @@ { \dbshow_sort:nNn { #2 } \l_index { #1 } } % ##1 index + \int_zero_new:N \l_counter_int \cs_set:Nn \dbshow_iter:n { + \int_incr:N \l_counter_int + \tl_set:Nx \dbalph { \int_to_alph:n { \l_counter_int } } + \tl_set:Nx \dbAlph { \int_to_Alph:n { \l_counter_int } } + \tl_set:Nx \dbarabic { \int_to_arabic:n { \l_counter_int } } + \tl_set:Nx \dbRoman { \int_to_Roman:n { \l_counter_int } } + \tl_set:Nx \dbroman { \int_to_roman:n { \l_counter_int } } + \tl_set:Nn \dbIndex { ##1 } + % ####1 attr \cs_set:Npn \dbuse ####1 { \dbshow_check_attr:nn { #2 } { ####1 } @@ -614,7 +629,6 @@ { g__dbshow_style_item_before_#1_#2_####1 } \tl_set_eq:Nc \l_style_item_after_code { g__dbshow_style_item_after_#1_#2_####1 } - \tl_set:Nn \dbIndex { ##1 } \prop_get:cnN { g__dbshow_type_map_#2 } { ####1 } \l_tmp_type % \tl_show:N \l_tmp_type diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 3e4820e2e0..16cdd91b88 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -15,14 +15,13 @@ %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2022/01/05}{1.42N} +\ProvidesExplClass{easybook}{2022/01/05}{1.42P} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool \bool_set_false:N \l__eb_title_newline_bool \bool_set_true:N \l__eb_class_mode_book_bool \tl_new:N \l__eb_font_value_tl -\clist_new:N \g__eb_config_file_clist \clist_new:N \g__eb_options_clist \cs_new_protected:Npn \eb_put_ctexbook:n #1 { \PassOptionsToClass{#1}{ctexbook} } @@ -307,7 +306,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2022/01/05}{1.42N} +\ProvidesExplPackage{easybase}{2022/01/05}{1.42P} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -1851,8 +1850,7 @@ \SetEnumitemValue{font}{sf}{\color{ctex@emph}\normalfont\sffamily} \SetEnumitemValue{ref}{enumii}{\arabic{enumi}.\alph*} \SetEnumitemValue{ref}{enumiii}{\arabic{enumi}.\alph{enumii}.\roman*} -\setlist{nosep,align = left,mode = unboxed} -\setlist*{labelsep = 0.5em,listparindent = 2em,leftmargin = *} +\setlist{nosep,align = left,mode = unboxed,leftmargin = *,listparindent = 2em} \setlist[itemize,1]{label = bullet} \setlist[itemize,2]{label = endash} \setlist[itemize,3]{label = asterisk} @@ -1951,8 +1949,8 @@ \cs_new_protected:Npn \eb_thm_biname_set:nnn #1#2#3 { \tl_if_eq:NnTF \l__ctex_scheme_tl { chinese } - { \tl_set:cn { eb@thm@name@#1 } {#3} } - { \tl_set:cn { eb@thm@name@#1 } {#2} } + { \tl_set:cn { #1name } {#3} } + { \tl_set:cn { #1name } {#2} } } \cs_set_eq:NN \eb@declaretheorem@save \declaretheorem \cs_set_eq:NN \eb@declaretheoremsyle@save \declaretheoremstyle @@ -1976,7 +1974,7 @@ } \eb_thm_biname_set:nnn {#1} {#2} {#3} \declaretheorem{#1}[ - name = \tl_use:c { eb@thm@name@#1 }, + name = \tl_use:c { #1name }, style = fancy,#5 ] \eb_if_thmframe_with_tcolorbox:TF @@ -1987,7 +1985,7 @@ \bool_if:cF { l__eb_tcb_repeat_env_#1_bool } { \tcolorboxenvironment{#1}{#4} } } { } - \labelformat{#1}{\tl_use:c { eb@thm@name@#1 }~##1} + \labelformat{#1}{\tl_use:c { #1name }~##1} } \prop_new:N \l__eb_thmtools_entry_prop @@ -2424,7 +2422,7 @@ } % %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/05}{1.42N} +\ProvidesExplFile{eb-tcolorbox.cfg}{2022/01/05}{1.42P} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \setexercise #1 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf index 0b5688124e..4ad198fe22 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 f9883f13f4..7b654d9281 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.42N, + version = v1.42P, date = 2022/01/05, authors = 瞿毅, info = 排版简体中文学位论文和书籍, @@ -44,7 +44,7 @@ \addtokomafont{subsubsection}{\normalfont\sffamily} \DeclareTOCStyleEntry[entryformat = \sffamily]{default}{section} \geometry{margin = 1in,marginparwidth = 0.65in} -\setlist{nosep,labelindent = \parindent,leftmargin = *,labelsep = 0.5em} +\setlist{nosep,labelindent = \parindent,leftmargin = *} \setlist[itemize,1]{label = \small\color{Blue}\textbullet} \setcounter{tocdepth}{2} \SetTblrInner{hline{1,Z} = {0.8pt,Blue}} @@ -144,7 +144,7 @@ 您在使用 \cls*{easybook} 文档类编写文档前可能需要具备以下的条件: \begin{itemize} \item 使用 \hologo{XeLaTeX}(推荐)或 \hologo{LuaLaTeX} 两种编译方式。 - \item 由于用到了一些 \LaTeX 和宏包较新的功能,建议安装最新的 \TeX 发行版,例如 \TeX Live 2021 或 \hologo{MiKTeX} 21.2 之后的版本。 + \item 由于文档类用到了一些 \LaTeX 和依赖宏包较新的功能,需要版本至少在 2020/10/01 以后的 \LaTeX 内核支持,建议您安装最新的 \TeX 发行版。 \item 虽然手册对基本用法做了介绍,但这并不是入门教程,所涉及到宏包的用法与命令也需要有了解。您应当具有一定的 \LaTeX 使用基础,可以在 \TeX 综合网站 \href{https://www.ctan.org/}{CTAN} 查看相关资源。 \end{itemize} @@ -635,11 +635,11 @@ \subsubsection{新建定理环境} \begin{commands} - \command{declaretheorem}[\oarg{键值列表1}\marg{定理环境}\oarg{键值列表2}] + \command{declaretheorem}[\oarg{键值列表1}\marg{环境名}\oarg{键值列表2}] 定理环境声明命令,命令 \cs{newtheorem} 与它等效。可选参数的 \meta{键值列表1} 与 \meta{键值列表2} 等效,用法与原来的同名命令一致。键值列表中常用的选项如下: \begin{options} \keyval*-{name}{定理名} - 定理名的默认值是首字母大写的环境名称(英文标题)。 + 预置定理环境的标题根据语言模式自动切换,也可以重新定义 \cs*{\black{\normalfont\meta{环境名}}name} 命令修改。 \keychoice*{numbered}{no,yes,unless unique} 定理可以被编号、不被编号或者只有在文档中多次出现时才被编号。 \keyval*-{numberlike}{计数器} diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md index 48348bc593..93a82bfb26 100644 --- a/macros/latex/contrib/siunitx/CHANGELOG.md +++ b/macros/latex/contrib/siunitx/CHANGELOG.md @@ -7,6 +7,12 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.0.39]: 2022-01-05 + +### Fixed +- Differentiate unity- and missing mantissa values (see issue + [#565](https://github.com/josephwright/siunitx/issues/565)) + ## [v3.0.38]: 2022-01-04 ### Changed @@ -1643,7 +1649,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### Added - First public testing release (as `si`) -[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.38...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.0.39...HEAD +[v3.0.39]: https://github.com/josephwright/siunitx/compare/v3.0.38...v3.0.39 [v3.0.38]: https://github.com/josephwright/siunitx/compare/v3.0.37...v3.0.38 [v3.0.37]: https://github.com/josephwright/siunitx/compare/v3.0.36...v3.0.37 [v3.0.36]: https://github.com/josephwright/siunitx/compare/v3.0.35...v3.0.36 diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf index 1a2ea316e7..9f60ecef85 100644 Binary files a/macros/latex/contrib/siunitx/siunitx-code.pdf and b/macros/latex/contrib/siunitx/siunitx-code.pdf differ diff --git a/macros/latex/contrib/siunitx/siunitx-complex.dtx b/macros/latex/contrib/siunitx/siunitx-complex.dtx index 247d9acc0d..8aa6e8ebc1 100644 --- a/macros/latex/contrib/siunitx/siunitx-complex.dtx +++ b/macros/latex/contrib/siunitx/siunitx-complex.dtx @@ -603,7 +603,6 @@ % \begin{macro}{\@@_format_sign:nnnnnnn} % \begin{macro}{\@@_extract_exponent:nw} % \begin{macro}{\@@_extract_exponent_aux:w} -% \begin{macro}{\@@_format_unary:nnnnnnn} % \begin{macro}[EXP]{\@@_format_bracket:n} % We start here checking that there is something to do. % \begin{macrocode} @@ -643,7 +642,6 @@ \tl_if_empty:NF \l_@@_real_tl { \exp_after:wN \@@_drop_exponent:nnnnnnn \l_@@_real_tl } \exp_after:wN \@@_format_sign:nnnnnnn \l_@@_img_tl - \exp_after:wN \@@_format_unary:nnnnnnn \l_@@_img_tl \tl_set:Nx \l_@@_tmp_tl { \siunitx_number_output:NN \l_@@_img_tl \q_nil } \exp_after:wN \@@_extract_exponent:w \l_@@_tmp_tl \q_stop @@ -708,13 +706,20 @@ } % \end{macrocode} % Pull out the formatted exponent: we also need the sign. +% An imaginary part that is exactly $1$ is omitted, with only the complex +% root printed. That means checking and removing a lone $1$ here. % \begin{macrocode} \cs_new_protected:Npn \@@_extract_exponent:w #1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_nil #7 \q_nil #8 \q_nil #9 \q_stop { \tl_set:Nn \l_@@_sign_tl {#1#2} - \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} #9 \q_stop + \bool_lazy_and:nnTF + { \str_if_eq_p:nn {#3} { 1 } } + { \tl_if_blank_p:n {#5} } + { \@@_extract_exponent_aux:nw {#6#7#8} } + { \@@_extract_exponent_aux:nw {#3#4#5#6#7#8} } + #9 \q_stop } \cs_new:Npn \@@_extract_exponent_aux:nw #1#2 \q_nil #3 \q_nil #4 \q_stop @@ -722,25 +727,6 @@ \tl_set:Nn \l_@@_tmp_tl {#1#2} \tl_set:Nn \l_@@_exp_tl {#3#4} } -% \end{macrocode} -% An imaginary part that is exactly $1$ is omitted, with only the complex -% root printed. That means checking and removing a lone $1$ here. -% \begin{macrocode} -\cs_new_protected:Npn \@@_format_unary:nnnnnnn #1#2#3#4#5#6#7 - { - \tl_set:Nx \l_@@_img_tl - { - \exp_not:n { {#1} {#2} } - \tl_if_blank:nTF {#4} - { - \str_if_eq:nnTF {#3} { 1 } - { { } { } } - { \exp_not:n { {#3} {#4} } } - } - { \exp_not:n { {#3} {#4} } } - \exp_not:n { {#5} {#6} {#7} } - } - } \cs_new_protected:Npn \@@_format_bracket:n #1 { \exp_not:V \l_@@_bracket_open_tl diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx index bb3abd6b7a..6b457a2ff8 100644 --- a/macros/latex/contrib/siunitx/siunitx-number.dtx +++ b/macros/latex/contrib/siunitx/siunitx-number.dtx @@ -1196,8 +1196,8 @@ % Valid cases here are % \begin{itemize} % \item Entirely blank if the original input was for example |+e10|: -% simply clean up if in the integer part of issue an error if in -% a second part (complex number, \foreign{etc.}). +% simply clean up if in the integer part or issue an error if in +% a second part (uncertainty). % \item An integer part digit: pass through to the main collection % routine. % \item A decimal marker: store an empty integer part and move to @@ -1210,7 +1210,7 @@ \quark_if_recursion_tail_stop_do:Nn #3 { \bool_if:NTF #2 - { \tl_put_right:Nn #1 { { 1 } { } { } } } + { \tl_put_right:Nn #1 { { } { } { } } } { \@@_parse_loop_break:wN \q_recursion_stop } } \tl_if_in:NnTF \l_@@_input_digit_tl {#3} @@ -3198,9 +3198,9 @@ % } % \begin{macro}[rEXP] % { -% \@@_output_exponent:nnnn , -% \@@_output_exponent_auxi:nnnn , -% \@@_output_exponent_auxii:nnnn +% \@@_output_exponent:nnnnn , +% \@@_output_exponent_auxi:nnnnn , +% \@@_output_exponent_auxii:nnnnn % } % \begin{macro}[rEXP]{\@@_output_exponent_auxiii:nn} % \begin{macro}[rEXP]{\@@_output_end:} @@ -3236,7 +3236,7 @@ \@@_output_integer:nnn {#3} {#4} {#7} \@@_output_decimal:nn {#4} {#8} \@@_output_uncertainty:nnn {#5} {#4} {#8} - \@@_output_exponent:nnnn {#6} {#7} { #3 . #4 } {#8} + \@@_output_exponent:nnnnn {#6} {#7} {#3} {#4} {#8} \@@_output_end: } % \end{macrocode} @@ -3259,12 +3259,12 @@ } \@@_output_bracket:w } -\cs_new:Npn \@@_output_bracket:w #1 \@@_output_exponent:nnnn +\cs_new:Npn \@@_output_bracket:w #1 \@@_output_exponent:nnnnn { \exp_not:V \l_@@_bracket_open_tl #1 \exp_not:V \l_@@_bracket_close_tl - \@@_output_exponent:nnnn + \@@_output_exponent:nnnnn } % \end{macrocode} % As color for negative values applies to the \emph{whole} output, we have @@ -3340,17 +3340,26 @@ % \begin{macrocode} \cs_new:Npn \@@_output_integer:nnn #1#2#3 { - \bool_lazy_any:nT + \tl_if_blank:nTF {#1} { - { \l_@@_unity_mantissa_bool } - { ! \str_if_eq_p:nn { #1 . #2 } { 1. } } - { - \bool_lazy_and_p:nn - { \str_if_eq_p:nn {#3} { 0 } } - { ! \l_@@_zero_exponent_bool } - } + \bool_lazy_and:nnT + { \str_if_eq_p:nn {#3} { 0 } } + { ! \l_@@_zero_exponent_bool } + { \@@_output_digits:nn { integer } { 1 } } + } + { + \bool_lazy_any:nT + { + { \l_@@_unity_mantissa_bool } + { ! \str_if_eq_p:nn { #1 . #2 } { 1. } } + { + \bool_lazy_and_p:nn + { \str_if_eq_p:nn {#3} { 0 } } + { ! \l_@@_zero_exponent_bool } + } + } + { \@@_output_digits:nn { integer } {#1} } } - { \@@_output_digits:nn { integer } {#1} } } \cs_new:Npn \@@_output_decimal:nn #1#2 { @@ -3553,40 +3562,47 @@ % For signs, the auxiliary from the main sign routine can be used, but not % the main function: negative exponents don't have special handling. % \begin{macrocode} -\cs_new:Npn \@@_output_exponent:nnnn #1#2#3#4 +\cs_new:Npn \@@_output_exponent:nnnnn #1#2#3#4#5 { - \exp_not:n {#4} + \exp_not:n {#5} \bool_lazy_or:nnTF { \l_@@_zero_exponent_bool } { ! \str_if_eq_p:nn {#2} { 0 } } { \tl_if_empty:NTF \l_@@_output_exp_marker_tl - { \@@_output_exponent_auxi:nnnn } - { \@@_output_exponent_auxii:nnnn } - {#1} {#2} {#3} {#4} + { \@@_output_exponent_auxi:nnnnn } + { \@@_output_exponent_auxii:nnnnn } + {#1} {#2} {#3} {#4} {#5} } - { \exp_not:n {#4} } + { \exp_not:n {#5} } } -\cs_new:Npn \@@_output_exponent_auxi:nnnn #1#2#3#4 +\cs_new:Npn \@@_output_exponent_auxi:nnnnn #1#2#3#4#5 { - \bool_lazy_or:nnTF - { \l_@@_unity_mantissa_bool } - { ! \str_if_eq_p:nn {#3} { 1. } } + \bool_lazy_or:nnT + { + \bool_lazy_and_p:nn + { \l_@@_unity_mantissa_bool } + { \str_if_eq_p:nn { #3 . #4 } { 1. } } + } + { + ! \bool_lazy_or_p:nn + { \str_if_eq_p:nn { #3 . #4 } { 1. } } + { \tl_if_blank_p:n {#3} } + } { \bool_if:NTF \l_@@_tight_bool { \exp_not:N \mathord } { \use:n } { \exp_not:V \l_@@_exponent_product_tl } - \exp_not:n {#4} } - { \exp_not:n {#4} } + \exp_not:n {#5} \exp_not:V \l_@@_exponent_base_tl ^ { \@@_output_exponent_auxiii:nn {#1} {#2} } } -\cs_new:Npn \@@_output_exponent_auxii:nnnn #1#2#3#4 +\cs_new:Npn \@@_output_exponent_auxii:nnnnn #1#2#3#4#5 { - \exp_not:n {#4} + \exp_not:n {#5} \exp_not:V \l_@@_output_exp_marker_tl \@@_output_exponent_auxiii:nn {#1} {#2} } diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx index 228b98047c..7ef3f726df 100644 --- a/macros/latex/contrib/siunitx/siunitx.dtx +++ b/macros/latex/contrib/siunitx/siunitx.dtx @@ -121,7 +121,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2022-01-04} {3.0.38} +\ProvidesExplPackage {siunitx} {2022-01-05} {3.0.39} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf index a7432ee6c6..049b99b62e 100644 Binary files a/macros/latex/contrib/siunitx/siunitx.pdf and b/macros/latex/contrib/siunitx/siunitx.pdf differ -- cgit v1.2.3