From 91b0647acf2a83b5c4277d371c93bcaf45df0f36 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 10 Apr 2021 21:10:43 +0000 Subject: easybook (10apr21) git-svn-id: svn://tug.org/texlive/trunk@58817 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/easybook/easybook.cls | 132 +++++++++++++--------- 1 file changed, 80 insertions(+), 52 deletions(-) (limited to 'Master/texmf-dist/tex/latex') diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 1388e2c4070..0b5f1562a0f 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/04/09}{1.24i}{beta} +\ProvidesExplClass{easybook}{2021/04/10}{1.24j}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -71,11 +71,20 @@ \bool_set_false:N \l__eb_page_twoside_bool \__eb_put_ctexbook:n {oneside} }, + twoside .code:n = + { + \bool_set_true:N \l__eb_page_twoside_bool + \__eb_put_ctexbook:n {twoside} + }, class .choice:, class .value_required:n = true, class/book .code:n = {}, - class/article .code:n = \bool_set_false:N \l__eb_class_book_bool, + class/article .code:n = + { + \bool_set_false:N \l__eb_class_book_bool + \keys_set:nn {easybook}{oneside} + }, class .initial:n = book, unknown .code:n = @@ -352,9 +361,15 @@ head-foot .tl_set:N = \l__eb_fancyhf_content_tl, head-foot .initial:n = { - \easyhead[EC]{\color{ctex@frame}\kaishu\leftmark} - \easyhead[OC]{\color{ctex@frame}\kaishu\rightmark} - \easyhead[EL,OR]{\color{ctex@frame}\thepage} + \bool_if:NTF \l__eb_page_twoside_bool + { + \easyhead[EC]{\color{ctex@frame}\kaishu\leftmark} + \easyhead[OC]{\color{ctex@frame}\kaishu\rightmark} + \easyhead[EL,OR]{\color{ctex@frame}\thepage} + }{ + \easyhead[L]{\color{ctex@frame}\kaishu\leftmark} + \easyhead[R]{\color{ctex@frame}\thepage} + } }, chap-mark .cs_set:Np = \__eb_fancyhf_chap_mark:n #1, @@ -410,19 +425,19 @@ \group_end: } } -\cs_new_protected:Npn \__eb_ifupper_chaptermark_set:n #1 +\cs_new:Npn \__eb_upper_chaptermark_bool:n #1 { \bool_if:NTF \l__eb_uppercase_bool {\text_uppercase:n {\__eb_fancyhf_chap_mark:n {#1}}} {\text_titlecase_first:n {\__eb_fancyhf_chap_mark:n {#1}}} } -\cs_new_protected:Npn \__eb_ifupper_sectionmark_set:n #1 +\cs_new:Npn \__eb_upper_sectionmark_bool:n #1 { \bool_if:NTF \l__eb_uppercase_bool {\text_uppercase:n {\__eb_fancyhf_sec_mark:n {#1}}} {\text_titlecase_first:n {\__eb_fancyhf_sec_mark:n {#1}}} } -\cs_new_protected:Npn \__eb_ifupper_subsectionmark_set:n #1 +\cs_new:Npn \__eb_upper_subsectionmark_bool:n #1 { \bool_if:NTF \l__eb_uppercase_bool {\text_uppercase:n {\__eb_fancyhf_subsec_mark:n {#1}}} @@ -442,36 +457,36 @@ \cs_gset:Npn \chaptermark#1 { \markboth - {\__eb_ifupper_chaptermark_set:n {#1}} - {\__eb_ifupper_chaptermark_set:n {#1}} + {\__eb_upper_chaptermark_bool:n {#1}} + {\__eb_upper_chaptermark_bool:n {#1}} } }{ \cs_gset:Npn \chaptermark#1 - {\markboth{\__eb_ifupper_chaptermark_set:n {#1}}{}} + {\markboth{\__eb_upper_chaptermark_bool:n {#1}}{}} } \cs_gset:Npn \sectionmark#1 - {\markright{\__eb_ifupper_sectionmark_set:n {#1}}} + {\markright{\__eb_upper_sectionmark_bool:n {#1}}} }{ \bool_if:NTF \l__eb_page_twoside_bool { \cs_gset:Npn \sectionmark#1 { \markboth - {\__eb_ifupper_sectionmark_set:n {#1}} - {\__eb_ifupper_sectionmark_set:n {#1}} + {\__eb_upper_sectionmark_bool:n {#1}} + {\__eb_upper_sectionmark_bool:n {#1}} } }{ \cs_gset:Npn \sectionmark#1 - {\markboth{\__eb_ifupper_sectionmark_set:n {#1}}{}} + {\markboth{\__eb_upper_sectionmark_bool:n {#1}}{}} } \cs_gset:Npn \subsectionmark#1 - {\markright{\__eb_ifupper_subsectionmark_set:n {#1}}} + {\markright{\__eb_upper_subsectionmark_bool:n {#1}}} } \bool_if:NT \l__eb_draft_bool { \bool_if:NTF \l__eb_page_twoside_bool {\easyfoot[C]{\color{gray!60}\sffamily\today}} - {\easyhead[L]{\color{gray!60}\sffamily\today}} + {\easyhead[C]{\color{gray!60}\sffamily\today}} \geometry{showframe} } } @@ -606,7 +621,7 @@ The~\string\chapter\space~command~will~not~be~used. } -\cs_new_protected:Npn \__eb_ifuppercase_set:n #1 +\cs_new_protected:Npn \__eb_uppercase_bool:n #1 { \bool_if:NTF \l__eb_uppercase_bool {\text_uppercase:n {#1}} @@ -617,9 +632,9 @@ \bool_if:NTF \l__eb_page_twoside_bool { \markboth - {\__eb_ifuppercase_set:n {#1}} - {\__eb_ifuppercase_set:n {#1}} - }{\markboth{\__eb_ifuppercase_set:n {#1}}{}} + {\__eb_uppercase_bool:n {#1}} + {\__eb_uppercase_bool:n {#1}} + }{\markboth{\__eb_uppercase_bool:n {#1}}{}} } \tl_set:Nn \l__eb_toc_type_tl{book} @@ -652,7 +667,19 @@ {\section*{\phantomsection#1}} \eb@markdouble{#1} } -\cs_new_protected:Npn \__eb_ifmultoc_pre_set: +\cs_new_protected:Npn \__eb_class_title_bool:n #1 + { + \bool_if:NTF \l__eb_class_book_bool + { + \chapter*{\phantomsection#1} + \CTEX@addtocline{chapter}{#1} + }{ + \section*{\phantomsection#1} + \CTEX@addtocline{section}{#1} + } + \eb@markdouble{#1} + } +\cs_new_protected:Npn \__eb_multoc_pre_bool: { \bool_if:NTF \l__eb_class_book_bool { @@ -665,7 +692,7 @@ \fi }{\tl_set:Nn \l__eb_toc_type_tl{article}} } -\cs_new_protected:Npn \__eb_ifmultoc_post_set: +\cs_new_protected:Npn \__eb_multoc_post_bool: { \bool_if:NTF \l__eb_class_book_bool { @@ -676,7 +703,7 @@ \fi }{\tl_set:Nn \l__eb_toc_type_tl{article}} } -\cs_new_protected:Npn \__eb_title_ifintoc_set:n #1 +\cs_new_protected:Npn \__eb_title_intoc_bool:n #1 { \IfBooleanTF{#1} {\__eb_title_mark_notoc:n {\eb@toc@title}} @@ -687,11 +714,11 @@ \group_begin: \tl_set_eq:NN \eb@toc@title\contentsname \IfValueT{#1}{\keys_set:nn {listoc}{#1}} - \__eb_ifmultoc_pre_set: + \__eb_multoc_pre_bool: \__eb_title_mark_notoc:n {\eb@toc@title} \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{toc} - \__eb_ifmultoc_post_set: + \__eb_multoc_post_bool: \group_end: } \RenewDocumentCommand{\listoffigures}{so} @@ -699,12 +726,12 @@ \group_begin: \tl_set_eq:NN \eb@toc@title\listfigurename \IfValueT{#2}{\keys_set:nn {listoc}{#2}} - \__eb_ifmultoc_pre_set: - \__eb_title_ifintoc_set:n {#1} + \__eb_multoc_pre_bool: + \__eb_title_intoc_bool:n {#1} \dim_add:NV \l__eb_toc_offset_dim\l__eb_toc_listsoffset_dim \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{lof} - \__eb_ifmultoc_post_set: + \__eb_multoc_post_bool: \group_end: } \RenewDocumentCommand{\listoftables}{so} @@ -712,12 +739,12 @@ \group_begin: \tl_set_eq:NN \eb@toc@title\listtablename \IfValueT{#2}{\keys_set:nn {listoc}{#2}} - \__eb_ifmultoc_pre_set: - \__eb_title_ifintoc_set:n {#1} + \__eb_multoc_pre_bool: + \__eb_title_intoc_bool:n {#1} \dim_add:NV \l__eb_toc_offset_dim\l__eb_toc_listsoffset_dim \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{lot} - \__eb_ifmultoc_post_set: + \__eb_multoc_post_bool: \group_end: } \NewDocumentCommand{\listoflistings}{so} @@ -725,12 +752,12 @@ \group_begin: \tl_set_eq:NN \eb@toc@title\lstlistlistingname \IfValueT{#2}{\keys_set:nn {listoc}{#2}} - \__eb_ifmultoc_pre_set: - \__eb_title_ifintoc_set:n {#1} + \__eb_multoc_pre_bool: + \__eb_title_intoc_bool:n {#1} \dim_add:NV \l__eb_toc_offset_dim\l__eb_toc_listsoffset_dim \vspace*{\dim_use:N \l__eb_toc_offset_dim} \@starttoc{lol} - \__eb_ifmultoc_post_set: + \__eb_multoc_post_bool: \group_end: } @@ -1107,14 +1134,14 @@ \cs_gset:Npn \tagform@#1 {\maketag@@@{\color{ctex@emph}(\ignorespaces#1\unskip\@@italiccorr)}} \ctex_at_end_package:nn {unicode-math} - {\unimathsetup{warnings-off = {mathtools-overbracket,mathtools-colon}}} + {\msg_redirect_module:nnn {unicode-math}{warning}{none}} \ctex_at_end_package:nn {tcolorbox} { \__eb_ifpackage_later:nn {tcolorbox}{2020/10/09} \tcbset { - thmsty/.style = + tc-theorem/.style = { enhanced~jigsaw,pad~at~break* = 3pt, opacityback = 0, @@ -1122,7 +1149,7 @@ left = .2pc,right = .2pc,top = .5pc,bottom = .5pc,middle= .5pc, arc = 0pt }, - outlinesty/.style = + tc-outline/.style = { enhanced,nofloat, tikznode~boxed~title, @@ -1136,7 +1163,7 @@ left = 1.5pc,right = 1.5pc,top = 1pc,bottom = 0.5pc, boxsep = 5pt }, - exersty/.style = + tc-exercise/.style = { enhanced,on~line, arc = 5pt, @@ -1150,7 +1177,7 @@ } \NewDocumentEnvironment{outline}{D(){\abstractname}o+b} { - \begin{tcolorbox}[outlinesty,title = #1,IfValueT = {#2}{#2}] + \begin{tcolorbox}[tc-outline,title = #1,IfValueT = {#2}{#2}] \begin{outlinelist} #3 \end{outlinelist} @@ -1163,7 +1190,7 @@ \bool_if:NTF \l__eb_thmbox_bool { \tcbox[ - exersty, + tc-exercise, colback = #2,colframe = black, drop~fuzzy~shadow = #2, IfValueT = {#5}{#5}, @@ -1225,12 +1252,12 @@ { \@ifpackageloaded{tcolorbox} { - \tcolorboxenvironment{theorem}{thmsty} - \tcolorboxenvironment{definition}{thmsty} - \tcolorboxenvironment{lemma}{thmsty} - \tcolorboxenvironment{corollary}{thmsty} - \tcolorboxenvironment{proposition}{thmsty} - \tcolorboxenvironment{example}{thmsty} + \tcolorboxenvironment{theorem}{tc-theorem} + \tcolorboxenvironment{definition}{tc-theorem} + \tcolorboxenvironment{lemma}{tc-theorem} + \tcolorboxenvironment{corollary}{tc-theorem} + \tcolorboxenvironment{proposition}{tc-theorem} + \tcolorboxenvironment{example}{tc-theorem} }{} } } @@ -1295,10 +1322,10 @@ \group_begin: \tl_set_eq:NN \eb@toc@title\bibname \IfValueT{##2}{\keys_set:nn {listoc}{##2}} - \__eb_ifmultoc_pre_set: - \cs_set:Npn \bibsection{\__eb_title_ifintoc_set:n {##1}} + \__eb_multoc_pre_bool: + \cs_set:Npn \bibsection{\__eb_title_intoc_bool:n {##1}} \exp_args:NV \bibliography\l__eb_bib_file_tl - \__eb_ifmultoc_post_set: + \__eb_multoc_post_bool: \group_end: } } @@ -1321,7 +1348,7 @@ { \exp_args:NV \addbibresource\l__eb_bib_file_tl \cs_gset:Npn \blx@default@theheading{bibintoc} - \defbibheading{bibintoc}[\bibname]{\__eb_title_mark_intoc:n {##1}} + \defbibheading{bibintoc}[\bibname]{\__eb_class_title_bool:n {##1}} \skip_set:Nn \bibitemsep{0ex} } \__eb_at_end_preamble:n @@ -1506,7 +1533,8 @@ linkcolor .initial:n = fresh, linktoc .choice:, - linktoc/unknown .code:n = \__eb_put_hyperref:n {linktoc = \exp_not:n {#1}}, + linktoc/unknown .code:n = + {\__eb_put_hyperref:n {linktoc = \exp_not:n {#1}}}, linktoc .default:n = all, linktoc .initial:n = all, unknown .code:n = -- cgit v1.2.3