diff options
author | Karl Berry <karl@freefriends.org> | 2021-07-14 21:11:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-07-14 21:11:30 +0000 |
commit | a1ce037dac21c122c2252645490ffbb4f8733b08 (patch) | |
tree | 228b20c480410fc6e56963a0713be8b8a3e22694 /Master/texmf-dist/tex/latex/easybook | |
parent | 77927048ddfb38038b1cd5e4ce779a1181dddbf5 (diff) |
easybook (14jul21)
git-svn-id: svn://tug.org/texlive/trunk@59931 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/easybook')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybase.sty | 185 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg | 63 |
3 files changed, 121 insertions, 129 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybase.sty b/Master/texmf-dist/tex/latex/easybook/easybase.sty index 2a7e98a7335..fe061543ac1 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybase.sty +++ b/Master/texmf-dist/tex/latex/easybook/easybase.sty @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/07/12}{1.27c} +\ProvidesExplPackage{easybase}{2021/07/13}{1.27d} {Typeset Chinese theses or books} \cs_generate_variant:Nn \ctex_define:nn { nx } @@ -118,8 +118,8 @@ \bool_set_false:N \l__eb_page_twoside_bool }, class .initial:n = book, - book .meta:n = { class = #1 }, - article .meta:n = { class = #1 }, + book .meta:n = { class = book }, + article .meta:n = { class = article }, unknown .code:n = { \clist_gput_right:NV \g__eb_ctex_options_clist \CurrentOption } @@ -258,7 +258,7 @@ headruleskip .tl_set:N = \headruleskip, headruleskip .initial:n = 1.5pt, footruleskip .tl_set:N = \footruleskip, - unknown .code:n = + unknown .code:n = { \clist_gput_right:Nx \g__eb_geometry_clist { @@ -952,8 +952,8 @@ \cs_new_protected:Npn \eb_biber_title_level_bool:n #1 { \bool_if:NTF \l__eb_class_book_bool - { \bichapter*{#1}{\l__eb_bib_bitoc_title} } - { \bisection*{#1}{\l__eb_bib_bitoc_title} } + { \bichapter*{#1}{\l__eb_bib_en_bitoc_title_tl} } + { \bisection*{#1}{\l__eb_bib_en_bitoc_title_tl} } \eb@level@section@mark{#1} } \cs_new_protected:Npn \eb_toc_start_multicol_bool:n #1 @@ -1108,7 +1108,7 @@ \l__eb_subfont_math_choice_tl \l_keys_choice_tl }, math .value_required:n = true, - math .initial:n = noto + math .initial:n = times } \cs_new_protected:Npn \eb_put_newtxmath:n #1 @@ -1286,30 +1286,32 @@ { \tl_const:cn { c__eb_name_#1_tl } {#3} } { \tl_const:cn { c__eb_name_#1_tl } {#2} } } +\cs_set_eq:NN \eb@declaretheorem@save \declaretheorem +\cs_set_eq:NN \eb@declaretheoremsyle@save \declaretheoremstyle +\RenewDocumentCommand{\declaretheorem}{O{}mO{}} + {\AfterPreamble{\eb@declaretheorem@save[#1,#3]{#2}}} +\cs_new_protected:Npn \eb@declaretheorem #1#2 + { \declaretheorem[#2]{#1} } +\RenewDocumentCommand{\declaretheoremstyle}{O{}mO{}} + {\eb@declaretheoremsyle@save[#1,#3]{#2}} +\cs_set_eq:NN \newtheorem \declaretheorem \NewDocumentCommand{\DeclareTheorem} {mO{\text_titlecase_first:n {#1}}mD(){tc-theorem}O{}} { - \ctex_at_end_preamble:n + \eb_thm_name_set:nnn {#1} {#2} {#3} + \eb@declaretheorem{#1} { - \eb_thm_name_set:nnn {#1} {#2} {#3} - \exp_args:No \declaretheorem@i - { - name = \tl_use:c { c__eb_name_#1_tl }, - style = easy-theorem,#5 - }{#1}[] - \bool_if:NT \l__eb_thmbox_bool - { - \@ifpackageloaded{tcolorbox} - {\tcolorboxenvironment{#1}{#4}}{} - } - \labelformat{#1}{\tl_use:c { c__eb_name_#1_tl }~##1} + name = \tl_use:c { c__eb_name_#1_tl }, + style = easy-theorem,#5 } + \bool_if:NT \l__eb_thmbox_bool + { + \@ifpackageloaded{tcolorbox} + {\tcolorboxenvironment{#1}{#4}}{} + } + \labelformat{#1}{\tl_use:c { c__eb_name_#1_tl }~##1} } \cs_set_eq:NN \EBNewTheorem \DeclareTheorem -\cs_set_eq:NN \eb@declare@theorem@save \declaretheorem -\RenewDocumentCommand{\declaretheorem}{O{}m} - {\AfterPreamble{\eb@declare@theorem@save[#1]{#2}}} -\cs_set_eq:NN \newtheorem \declaretheorem \prop_new:N \l__eb_thmtools_entry_prop \clist_const:Nn \c__eb_thmtools_entry_clist { @@ -1461,58 +1463,48 @@ } \bool_set_true:N \l__eb_backend_bibtex_bool -\tl_new:N \l__eb_bib_style_tl -\tl_new:N \l__eb_bib_otherstyle_tl -\tl_new:N \l__eb_bib_citestyle_tl +\tl_new:N \l__eb_bib_all_style_tl +\tl_new:N \l__eb_bib_cite_style_tl \clist_new:N \l__eb_bib_datafile_clist \ctex_define:nn { bibset } { backend .choice:, - backend .value_required:n = true, - backend/bibtex .code:n = { }, - backend/biblatex .code:n = + backend .value_required:n = true, + backend/bibtex .code:n = { }, + backend/biblatex .code:n = { \bool_set_false:N \l__eb_backend_bibtex_bool }, - bib-style .choice:, - bib-style .value_required:n = true, - bib-style/numerical .code:n = - { - \tl_set:Nn \l__eb_bib_style_tl {#1} - \tl_clear:N \l__eb_bib_otherstyle_tl - }, - bib-style/authoryear .code:n = - { - \tl_set:Nn \l__eb_bib_style_tl {#1} - \tl_clear:N \l__eb_bib_otherstyle_tl - }, - bib-style/unknown .code:n = - { \tl_set_eq:NN \l__eb_bib_otherstyle_tl \l_keys_value_tl }, - bib-style .initial:n = numerical, + bib-style .code:n = + { \tl_set:Nn \l__eb_bib_all_style_tl {#1} }, + bib-style .value_required:n = true, + bib-style .initial:n = numerical, cite-style .code:n = - { \tl_set:Nn \l__eb_bib_citestyle_tl {#1} }, + { \tl_set:Nn \l__eb_bib_cite_style_tl {#1} }, datafile .clist_set:N = \l__eb_bib_datafile_clist, - bitoc-title .tl_set:N = \l__eb_bib_bitoc_title, + bitoc-title .tl_set:N = \l__eb_bib_en_bitoc_title_tl, bitoc-title .initial:n = Reference } -\cs_new_protected:Npn \BibtexPostset - { - \tl_if_empty:NTF \l__eb_bib_otherstyle_tl - { - \tl_if_eq:NnT \l__eb_bib_style_tl { numerical } - { - \bibliographystyle{gbt7714-numerical} - \setcitestyle{comma,square,super} - } - \tl_if_eq:NnT \l__eb_bib_style_tl { authoryear } - { \bibliographystyle{gbt7714-author-year} } - \cs_set_eq:NN \cite \citep +\cs_new_protected:Npn \BibtexPreSet + { \PassOptionsToPackage{sort&compress}{natbib} } +\cs_new_protected:Npn \BibtexPostSet + { + \str_case:VnTF \l__eb_bib_all_style_tl + { + { numerical } + { + \bibliographystyle{gbt7714-numerical} + \setcitestyle{comma,square,super} + } + { authoryear } + { \bibliographystyle{gbt7714-author-year} } } + { \cs_set_eq:NN \cite \citep } { \exp_args:NV \bibliographystyle \l__eb_bib_otherstyle_tl } - \tl_if_empty:NF \l__eb_bib_citestyle_tl - { \exp_args:NV \setcitestyle \l__eb_bib_citestyle_tl } + \tl_if_empty:NF \l__eb_bib_cite_style_tl + { \exp_args:NV \setcitestyle \l__eb_bib_cite_style_tl } \skip_zero:N \bibsep \AtEndEnvironment{thebibliography} {\bool_if:NT \l__eb_toc_multi_column_bool { \end{multicols} }} @@ -1533,21 +1525,22 @@ } \cs_new_protected:Npn \eb_put_biblatex:n #1 { \PassOptionsToPackage{#1}{biblatex} } -\cs_new_protected:Npn \BiblatexPreset +\cs_new_protected:Npn \BiblatexPreSet { - \tl_if_empty:NTF \l__eb_bib_otherstyle_tl + \str_case:VnF \l__eb_bib_all_style_tl { - \tl_if_eq:NnT \l__eb_bib_style_tl { numerical } - { \eb_put_biblatex:n { style = gb7714-2015 } } - \tl_if_eq:NnT \l__eb_bib_style_tl { authoryear } - { \eb_put_biblatex:n { style = gb7714-2015ay } } + { numerical } { \use_i:nnn } + { authoryear } { \use_ii:nnn } } - { \eb_put_biblatex:n { style = \l__eb_bib_otherstyle_tl } } - \tl_if_empty:NF \l__eb_bib_citestyle_tl - { \eb_put_biblatex:n { citestyle = \l__eb_bib_citestyle_tl } } + { \use_iii:nnn } + { \eb_put_biblatex:n { style = gb7714-2015 } } + { \eb_put_biblatex:n { style = gb7714-2015ay } } + { \eb_put_biblatex:n { style = \l__eb_bib_all_style_tl } } + \tl_if_empty:NF \l__eb_bib_cite_style_tl + { \eb_put_biblatex:n { citestyle = \l__eb_bib_cite_style_tl } } \eb_put_biblatex:n { backend = biber } } -\cs_new_protected:Npn \BiblatexPostset +\cs_new_protected:Npn \BiblatexPostSet { \clist_map_function:NN \l__eb_bib_datafile_clist \addbibresource \tl_gset:Nn \blx@default@theheading { bibintoc } @@ -1561,43 +1554,33 @@ { \bool_if:NTF \l__eb_backend_bibtex_bool { - \LoadPackage[sort&compress]{natbib} - \BibtexPostset + \BibtexPreSet + \LoadPackage{natbib} + \BibtexPostSet } { - \BiblatexPreset + \BiblatexPreSet \LoadPackage{biblatex} - \BiblatexPostset + \BiblatexPostSet } } } +\cs_new:Npn \eb@lst@if@display #1#2 + { \lst@ifdisplaystyle #1\else #2\fi } \lstdefinestyle{easy-listings} { language = [LaTeX]TeX, - texcsstyle = - { - *\lst@ifdisplaystyle - \bfseries\color{ctex@verb} - \else - \color{ctex@verb} - \fi - }, + texcsstyle = {*}, basicstyle = { - \ttfamily\lst@ifdisplaystyle - \small - \else - \color{ctex@verb} - \fi + \ttfamily + \eb@lst@if@display{\small}{\color{ctex@verb}} }, keywordstyle = { - \lst@ifdisplaystyle - \bfseries\color{ctex@verb} - \else - \color{ctex@verb} - \fi + \color{ctex@verb} + \eb@lst@if@display{\bfseries}{} }, framexleftmargin = 0pt, framexrightmargin = 0pt, @@ -1608,12 +1591,7 @@ frame = single, rulecolor = \color{ctex@frame}, commentstyle = \color{SlateGray}, - emphstyle = \color{ctex@emph}, - % emph = {}, - morekeywords = - { - includegraphics,setmainfont,setsansfont,setmonofont,setCJKmainfont,setCJKsansfont,setCJKmonofont,setCJKfamilyfont,RequirePackage - } + emphstyle = \color{ctex@emph} } \lstset { @@ -1736,7 +1714,7 @@ \clist_map_function:nN { { none, 000000,000000,000000 }, - { seaside, 4169e1,007130,9932cc }, + { seaside, 4169e1,9932cc,eb6100 }, { energy, f39800,00a0e9,893895 }, { cyberpunk, 601986,eb6877,a4005b } } @@ -1748,10 +1726,11 @@ \cs_new:Npn \eb_allow_urlbreak: { - \cs_new:Npn \eb_add_urlbreak_points: - { \tl_map_function:NN \c__eb_urlbreak_points_tl \do } \eb_appto_cmd:Nn \UrlBreaks - { \UrlOrds\eb_add_urlbreak_points: } + { + \UrlOrds + \tl_map_function:NN \c__eb_urlbreak_points_tl \do + } } \tl_const:Nn \c__eb_urlbreak_points_tl { diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 3ece1ab9add..6e4e5082af8 100644 --- a/Master/texmf-dist/tex/latex/easybook/easybook.cls +++ b/Master/texmf-dist/tex/latex/easybook/easybook.cls @@ -13,7 +13,7 @@ %% https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/07/12}{1.27c} +\ProvidesExplClass{easybook}{2021/07/13}{1.27d} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool diff --git a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg index a5e142e7bc1..82cf72e7fd0 100644 --- a/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg +++ b/Master/texmf-dist/tex/latex/easybook/eb-tcolorbox.cfg @@ -11,7 +11,7 @@ %% conditions of the CC-BY 4.0 License. %% The latest version of this license is in %% https://creativecommons.org/licenses/by/4.0/legalcode -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/12}{1.27c} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/07/13}{1.27d} {Customization of tcolorbox for easybook} \cs_new_protected:Npn \eb_tcb_theorem_set:n #1 @@ -20,13 +20,17 @@ { \tcbset{tc-outline/.style = {#1}} } \cs_new_protected:Npn \eb_tcb_exercise_set:n #1 { \tcbset{tc-exercise/.style = {#1}} } +\tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } \eb_tcb_theorem_set:n { enhanced~jigsaw,pad~at~break* = 3pt, opacityback = 0, colframe = ctex@emph, sharpish~corners, - left = 6pt,right = 6pt,top = 8pt,bottom = 8pt,middle= 8pt + beforeafter~skip = 1.75ex plus .2ex minus .1ex, + left = 8pt,right = 8pt, + top = \eb@tc@line@skip,bottom = \eb@tc@line@skip, + middle = \eb@tc@line@skip } \eb_tcb_outline_set:n { @@ -37,7 +41,8 @@ fonttitle = \large\sffamily,fontupper = \itshape, boxed~title~style = {size = normal,opacityframe = 0,boxrule = 0pt}, attach~boxed~title~to~top~center = {yshift = -\tcboxedtitleheight/2}, - after~skip = 3ex,arc = 3pt, + after~skip = 3ex plus .2ex minus .1ex, + arc = 3pt, left = 2pc,right = 2pc,top = 1.5pc,bottom = 1pc } \eb_tcb_exercise_set:n @@ -45,7 +50,7 @@ blank,on~line,center, sharpish~corners, fontupper = \Large\sffamily, - before~skip = 3.75ex, + before~skip = 3.75ex plus.2ex minus .1ex, after~skip = 3ex\tl_if_empty:NF \eb@tc@list@prologue { + 0.75ex } } \tcbset @@ -141,16 +146,20 @@ { enhanced~jigsaw,pad~at~break* = 3pt, IfBooleanTF = {#1} - {toptitle = 8pt,top = 8pt} - {frame~hidden,boxrule = 0pt,toptitle = 8pt,top = 0pt}, + {toptitle = \eb@tc@line@skip,top = \eb@tc@line@skip} + { + frame~hidden,boxrule = 0pt, + toptitle = \eb@tc@line@skip,top = 0pt + }, IfValueT = {#3}{title = #3}, colback = #2,colbacktitle = #2, opacityback = 0.2,opacitybacktitle = 0.2, coltitle = black,colframe = black, sharpish~corners, - left = 6pt,right = 6pt,bottom = 8pt,middle= 8pt, - bottomtitle = 8pt, - beforeafter~skip = 2ex, + left = 8pt,right = 8pt, + bottom = \eb@tc@line@skip,middle = \eb@tc@line@skip, + bottomtitle = \eb@tc@line@skip, + beforeafter~skip = 1.75ex plus .2ex minus .1ex, halign~upper = left,halign~lower = left, center~title,#4 } @@ -162,34 +171,38 @@ borderline~west = {3pt}{0pt}{#2}, IfBooleanTF = {#1} { - colback = white, - IfValueT = {#3}{title = #3}, - top = 0pt,bottom = 0pt,toptitle = 0pt - }{ colback = #2,colbacktitle = #2, opacityback = 0.2,opacitybacktitle = 0.2, - IfValueTF = {#3}{title = #3,top = 0pt}{top = 8pt}, - bottom = 8pt,toptitle = 8pt + IfValueTF = {#3}{title = #3,top = 0pt}{top = \eb@tc@line@skip}, + bottom = \eb@tc@line@skip,toptitle = \eb@tc@line@skip, + right = 8pt + }{ + colback = white, + IfValueT = {#3}{title = #3}, + top = 0pt,bottom = 0pt,right = 0pt,toptitle = 0pt }, - left = 8pt,right = 8pt,middle= 8pt, sharpish~corners, - bottomtitle = 8pt, - beforeafter~skip = 2ex, + left = 8pt, + middle = \eb@tc@line@skip,bottomtitle = \eb@tc@line@skip, + beforeafter~skip = 1.75ex plus .2ex minus .1ex, colframe = #2,coltitle = #2,#4 } \DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}} - { - nobeforeafter,tcbox~raise~base, - blank,fuzzy~halo = 2pt~with~#1,#3 - }{#2} + {on~line,blank,fuzzy~halo = 2pt~with~#1,#3}{#2} \DeclareTotalTCBox{\eblink}{O{Aqua}vO{}} { - standard~jigsaw, - nobeforeafter,tcbox~raise~base, - top = 1.25pt,bottom = 1.25pt,left = 1.25pt,right = 1.25pt, + standard~jigsaw,on~line, + top = 1.5pt,bottom = 1.5pt,left = 1.5pt,right = 1.5pt, boxrule = 0.75pt,arc = 1pt, colback = #1,opacityback = 0.2,colframe = #1,#3 }{#2} +\DeclareTotalTCBox{\ebfbox}{O{Lime}vO{}} + { + on~line,sharpish~corners, + top = 2pt,bottom = 2pt,left = 1pt,right = 1pt, + leftrule = 0pt,rightrule = 0pt, + colback = #1!10!white,colframe = #1!50!black,#3 + }{#2} \endinput %% %% End of file `eb-tcolorbox.cfg'. |