diff options
author | Karl Berry <karl@freefriends.org> | 2021-03-12 22:59:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-03-12 22:59:37 +0000 |
commit | 4af369ed7bfe93250ca4d5b05216a4aeb52e3117 (patch) | |
tree | 3ff0c7d1cbb52a7be8590dbbee717e8489062c0b /Master/texmf-dist/tex/latex | |
parent | 420795cb8dc7a058e826580bd85daa4f3f71226c (diff) |
easybook (12mar21)
git-svn-id: svn://tug.org/texlive/trunk@58294 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 193 |
1 files changed, 99 insertions, 94 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 055b403aed3..f639eeb5700 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -9,7 +9,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e} \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/03/10}{1.23m}{} +\ProvidesExplClass{easybook}{2021/03/12}{1.23o}{} \cs_generate_variant:Nn \keys_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -81,8 +81,19 @@ {\__put_ctexbook:n {scheme = chinese}} {\__put_ctexbook:n {scheme = plain}} +\clist_map_inline:nn + { + {svgnames}{xcolor}, + {hang,stable}{footmisc}, + {normalem}{ulem}, + {protrusion = false}{microtype}, + {shortlabels,inline}{enumitem}, + {most}{tcolorbox}, + {xindy}{imakeidx}, + {CJKmath = true}{xeCJK}, + {no-math}{fontspec} + }{\PassOptionsToPackage#1} \__put_ctexbook:n {\g__options_clist} -\PassOptionsToPackage{CJKmath = true}{xeCJK} \LoadClass[UTF8]{ctexbook} \bool_new:N \l__capdash_bool @@ -136,30 +147,18 @@ uppercase .initial:n = true } -\clist_map_inline:nn - { - {svgnames}{xcolor}, - {hang,stable}{footmisc}, - {normalem}{ulem}, - {protrusion = false}{microtype}, - {shortlabels,inline}{enumitem}, - {most}{tcolorbox}, - {xindy}{imakeidx} - }{\PassOptionsToPackage#1} \RequirePackage { xcolor, pdfpages, footmisc,setspace, amsmath,amsthm,thmtools,cases, - chemformula,chemfig,siunitx,ulem, - microtype, - geometry,marginnote, + chemformula,siunitx,ulem, + geometry,marginnote,nccfoots, rotfloat,graphicx, - nccfoots,tablefootnote, fancyhdr,titletoc, caption,bicaption,subcaption, - zhlipsum,fontawesome,pifont, + microtype,zhlipsum,pifont, tabularx,multirow,makecell,booktabs, paralist,tasks,enumitem, tcolorbox, @@ -171,9 +170,6 @@ modifier = {by}, version = {4.0} ]{doclicense} -\cs_new_eq:NN \github\faGithub -\cs_new:Npn \git{\textcolor[HTML]{c71d23}{\faGit}} -\cs_new:Npn \edge{\textcolor[HTML]{00c2ff}{\faEdge}} \ctex_at_end_preamble:n { \bool_if:NT \l__notomath_bool @@ -365,11 +361,13 @@ { \markboth { - \bool_if:NT \l__uppercase_bool{\MakeUppercase} - {\l__fancyhf_chap_mark_tl#1} + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} + {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} }{ - \bool_if:NT \l__uppercase_bool{\MakeUppercase} - {\l__fancyhf_chap_mark_tl#1} + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} + {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} } } \l__fancyhf_content_tl @@ -379,8 +377,9 @@ { \markboth { - \bool_if:NT \l__uppercase_bool{\MakeUppercase} - {\l__fancyhf_chap_mark_tl#1} + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {\l__fancyhf_chap_mark_tl#1}} + {\text_titlecase_first:n {\l__fancyhf_chap_mark_tl#1}} }{} } \l__fancyhf_content_tl @@ -390,13 +389,14 @@ { \markright { - \bool_if:NT \l__uppercase_bool{\MakeUppercase} - {\l__fancyhf_sec_mark_tl#1} + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {\l__fancyhf_sec_mark_tl#1}} + {\text_titlecase_first:n {\l__fancyhf_sec_mark_tl#1}} } } \cs_gset:Npn \headrule { - \color{ctex@frame}\vspace{2.5pt} + \color{ctex@frame}\vspace{1.5pt} \hrule width\textwidth height \l__rule_width_dim } \bool_if:NT \l__draft_bool @@ -506,12 +506,22 @@ \bool_if:NTF \l__page_twoside_bool { \markboth - {\bool_if:NT \l__uppercase_bool{\MakeUppercase}#1} - {\bool_if:NT \l__uppercase_bool{\MakeUppercase}#1} + { + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {#1}} + {\text_titlecase_first:n {#1}} + }{ + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {#1}} + {\text_titlecase_first:n {#1}} + } }{ \markboth - {\bool_if:NT \l__uppercase_bool{\MakeUppercase}#1} - {} + { + \bool_if:NTF \l__uppercase_bool + {\text_uppercase:n {#1}} + {\text_titlecase_first:n {#1}} + }{} } } \cs_new_protected:Npn \__title_mark_intoc:n #1 @@ -583,30 +593,22 @@ } \cs_new:Npn \listoflistings { - \group_begin: - \@ifundefined{@restonecoltrue}{} - { - \if@twocolumn - \@restonecoltrue\onecolumn - \bool_if:NT \l__multoc_bool{\twocolumn} - \else - \@restonecolfalse - \bool_if:NT \l__multoc_bool{\twocolumn} - \fi - } + \if@twocolumn + \@restonecoltrue\onecolumn + \bool_if:NT \l__multoc_bool{\twocolumn} + \else + \@restonecolfalse + \bool_if:NT \l__multoc_bool{\twocolumn} + \fi \__title_mark_intoc:n {\lstlistlistingname} \dim_add:NV \l__toc_offset_dim\l__toc_listsoffset_dim \vspace*{\dim_use:N \l__toc_offset_dim} \@starttoc{lol} - \@ifundefined{@restonecoltrue}{} - { - \if@restonecol - \twocolumn - \else - \onecolumn - \fi - } - \group_end: + \if@restonecol + \twocolumn + \else + \onecolumn + \fi } \makeindex[ @@ -626,44 +628,45 @@ {\@mkboth{\MakeUppercase\indexname}{\MakeUppercase\indexname}} {\__markboth:n {\indexname}} -\tl_new:N \l__table_font_tl -\tl_new:N \l__figure_font_tl -\tl_new:N \l__listing_font_tl -\tl_new:N \l__footnote_font_tl -\tl_new:N \l__marginpar_font_tl +\tl_new:N \l__font_table_tl +\tl_new:N \l__font_figure_tl +\tl_new:N \l__font_listing_tl +\tl_new:N \l__font_footnote_tl +\tl_new:N \l__font_marginpar_tl \__ctex_define:nn {elfont} { - table-cap .tl_set:N = \l__table_font_tl, + table-cap .tl_set:N = \l__font_table_tl, table-cap .initial:n = \sffamily\small, - figure-cap .tl_set:N = \l__figure_font_tl, + figure-cap .tl_set:N = \l__font_figure_tl, figure-cap .initial:n = \sffamily\small, - listing-cap .tl_set:N = \l__listing_font_tl, + listing-cap .tl_set:N = \l__font_listing_tl, listing-cap .initial:n = \sffamily\small, - footnote .tl_set:N = \l__footnote_font_tl, + footnote .tl_set:N = \l__font_footnote_tl, footnote .initial:n = \rmfamily, - marginpar .tl_set:N = \l__marginpar_font_tl, + marginpar .tl_set:N = \l__font_marginpar_tl, marginpar .initial:n = \rmfamily\footnotesize } \DeclareCaptionLabelSeparator{ccwd}{\hspace{\ccwd}} \DeclareCaptionLabelFormat{parens}{\bothIfFirst{#1}{~}(#2)} -\DeclareCaptionFont{table@font}{\l__table_font_tl} -\DeclareCaptionFont{figure@font}{\l__figure_font_tl} -\DeclareCaptionFont{listing@font}{\l__listing_font_tl} +\DeclareCaptionFont{table@font}{\l__font_table_tl} +\DeclareCaptionFont{figure@font}{\l__font_figure_tl} +\DeclareCaptionFont{listing@font}{\l__font_listing_tl} \captionsetup { format = hang, % figurewithin = section, % tablewithin = section, - font = {stretch = {\fp_use:N \l__caption_spread_fp}}, + font = {stretch = {\fp_use:N \l__spread_caption_fp}}, labelfont = {color = ctex@frame}, labelsep = ccwd, + singlelinecheck = true, belowskip = 0pt,aboveskip = 10pt } \captionsetup[table]{font += table@font} \captionsetup[figure]{font += figure@font} -\captionsetup[lstlisting]{singlelinecheck = false,font += listing@font} +\captionsetup[lstlisting]{font += listing@font} \captionsetup[subfigure] { labelformat = parens, @@ -683,27 +686,27 @@ } } \AtBeginEnvironment{tabularx} - {\exp_args:Nx \linespread{\fp_use:N \l__table_spread_fp}\selectfont\ignorespaces} + {\exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp}\selectfont\ignorespaces} \AtBeginEnvironment{tabular} - {\exp_args:Nx \linespread{\fp_use:N \l__table_spread_fp}\selectfont\ignorespaces} + {\exp_args:Nx \linespread{\fp_use:N \l__spread_table_fp}\selectfont\ignorespaces} -\fp_new:N \l__line_spread_fp -\fp_new:N \l__table_spread_fp -\fp_new:N \l__math_spread_fp -\fp_new:N \l__caption_spread_fp -\fp_new:N \l__footnote_spread_fp +\fp_new:N \l__spread_line_fp +\fp_new:N \l__spread_table_fp +\fp_new:N \l__spread_math_fp +\fp_new:N \l__spread_caption_fp +\fp_new:N \l__spread_footnote_fp \__ctex_define:nn {spread} { - line .fp_set:N = \l__line_spread_fp, + line .fp_set:N = \l__spread_line_fp, line .initial:n = 1.3, - table .fp_set:N = \l__table_spread_fp, + table .fp_set:N = \l__spread_table_fp, table .initial:n = 1.05, - math .fp_set:N = \l__math_spread_fp, + math .fp_set:N = \l__spread_math_fp, math .initial:n = 1.05, - caption .fp_set:N = \l__caption_spread_fp, + caption .fp_set:N = \l__spread_caption_fp, caption .initial:n = 1, - footnote .fp_set:N = \l__footnote_spread_fp, + footnote .fp_set:N = \l__spread_footnote_fp, footnote .initial:n = 1 } @@ -721,7 +724,7 @@ \cs_gset:Npn \bottomfraction{0.65} \cs_gset:Npn \floatpagefraction{0.60} \ctex_after_end_preamble:n - {\exp_args:Nx \linespread{\fp_use:N \l__line_spread_fp}\selectfont} + {\exp_args:Nx \linespread{\fp_use:N \l__spread_line_fp}\selectfont} \newcolumntype{L}{X} \newcolumntype{C}{>{\centering\arraybackslash}X} @@ -790,6 +793,8 @@ \tl_new:N \l__thm_spaceabove_tl \tl_new:N \l__thm_spacebelow_tl +\RenewDocumentCommand{\newtheorem}{O{}m} + {\AfterPreamble{\declaretheorem[#1]{#2}}} \__ctex_define:nn {thmset} { thmbox .bool_set:N = \l__thmbox_bool, @@ -882,7 +887,7 @@ \cs_new_protected:Npn \l__math_restore:n #1 { \AtBeginEnvironment{#1} - {\linespread{\fp_use:N \l__math_spread_fp}\selectfont\ignorespaces} + {\linespread{\fp_use:N \l__spread_math_fp}\selectfont\ignorespaces} } \clist_map_inline:nn { @@ -893,16 +898,16 @@ }{\l__math_restore:n {#1}} \__patch_cmd:Nnn \start@gather {\collect@body} - {\linespread{\fp_use:N \l__math_spread_fp}\selectfont\collect@body} + {\linespread{\fp_use:N \l__spread_math_fp}\selectfont\collect@body} \__patch_cmd:Nnn \start@align {\collect@body} - {\linespread{\fp_use:N \l__math_spread_fp}\selectfont\collect@body} + {\linespread{\fp_use:N \l__spread_math_fp}\selectfont\collect@body} \__patch_cmd:Nnn \start@multline {\collect@body} - {\linespread{\fp_use:N \l__math_spread_fp}\selectfont\collect@body} + {\linespread{\fp_use:N \l__spread_math_fp}\selectfont\collect@body} \__patch_cmd:Nnn \gather@split {\spread@equation} - {\linespread{\fp_use:N \l__math_spread_fp}\selectfont\spread@equation} + {\linespread{\fp_use:N \l__spread_math_fp}\selectfont\spread@equation} \ctex_after_end_preamble:n { \skip_set:Nn \abovedisplayskip{5pt plus 1pt minus 1pt} @@ -1125,7 +1130,7 @@ \skip_set:Nn \footnotemargin{0.5\ccwd} \group_begin: \footnotesize - \exp_args:Nx \linespread{\fp_use:N \l__footnote_spread_fp}\selectfont + \exp_args:Nx \linespread{\fp_use:N \l__spread_footnote_fp}\selectfont \skip_gset:Nn \footnotesep{\ht\strutbox} \group_end: \cs_gset:Npn \hangfootparskip{0ex} @@ -1151,13 +1156,13 @@ } \__patch_cmd:Nnn \@footnotetext {\reset@font} - {\def\baselinestretch{\fp_use:N \l__footnote_spread_fp}\l__footnote_font_tl} + {\def\baselinestretch{\fp_use:N \l__spread_footnote_fp}\l__font_footnote_tl} \__patch_cmd:Nnn \@mpfootnotetext {\reset@font} - {\def\baselinestretch{\fp_use:N \l__footnote_spread_fp}\l__footnote_font_tl} + {\def\baselinestretch{\fp_use:N \l__spread_footnote_fp}\l__font_footnote_tl} \__patch_cmd:Nnn \@makefnmark - {\normalfont}{\l__footnote_font_tl} -\cs_gset:Npn \marginfont{\l__marginpar_font_tl} + {\normalfont}{\l__font_footnote_tl} +\cs_gset:Npn \marginfont{\l__font_marginpar_tl} \lstdefinestyle{mystyle} { @@ -1192,7 +1197,7 @@ % numbers = left, numberstyle = \footnotesize, abovecaptionskip = -1ex, - belowcaptionskip = 1ex, + belowcaptionskip = 1.5ex, aboveskip = 1.5ex plus .2ex minus .1ex, belowskip = 0.55ex plus .2ex minus .1ex, keepspaces = true, @@ -1306,7 +1311,7 @@ listtablename = {表格索引}, abstractname = {摘\hspace{\ccwd}要}, lstlistlistingname = {代码索引}, - lstlistingname = {\faCode 代码} + lstlistingname = {代码} } \crefformat{equation}{#2式(#1)#3} \crefformat{align}{#2式(#1)#3} @@ -1328,7 +1333,7 @@ { abstractname = {Abstract}, lstlistlistingname = {List~of~Listings}, - lstlistingname = {\faCode\space Code} + lstlistingname = {Code} } \crefformat{equation}{#2Equation~(#1)#3} \crefformat{align}{#2Equation~(#1)#3} |