diff options
author | Karl Berry <karl@freefriends.org> | 2021-04-27 21:54:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-04-27 21:54:17 +0000 |
commit | 9dc8932b741f61f16f9699c223fbc3c412d747f7 (patch) | |
tree | dc1d87e089f1112ca47dead46494fd3d9f7ec473 /Master/texmf-dist/tex/latex | |
parent | d83f78ed3ec0fa3f5a0d13b9c370172b4be16691 (diff) |
easybook (27apr21)
git-svn-id: svn://tug.org/texlive/trunk@59008 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 137 |
1 files changed, 71 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 519d1f72d66..aeb580d2cfe 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,etoolbox} -\ProvidesExplClass{easybook}{2021/04/25}{1.24t}{beta} +\ProvidesExplClass{easybook}{2021/04/27}{1.24u}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -507,6 +507,7 @@ \hspace{\use:c {eb@toc@#1@numsep}} }{} } +\newtoggle{eb@titletoc@hang@fix} \__ctex_define:nn {tocset} { lists/lolskip .skip_set:N = \l__eb_toc_lolskip_skip, @@ -521,29 +522,22 @@ tocline-fig .initial:n = { \figurename\space#1 - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, tocline-tab .cs_set:Np = \eb@labelname@lot#1, tocline-tab .initial:n = { \tablename\space#1 - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, tocline-lst .tl_set:N = \eb@labelname@lol, tocline-lst .initial:n = { - \lstlistingname\space - \thelstlisting - \ifodd\eb@titletoc@hang@fix - \else - \hspace{\eb@toc@lists@numsep} - \fi + \lstlistingname\space\thelstlisting + \iftoggle{eb@titletoc@hang@fix}{} + {\hspace{\eb@toc@lists@numsep}} }, line-align .bool_set:N = \l__eb_toc_line_align_bool, line-align .default:n = true, @@ -552,7 +546,7 @@ hang .choice:, hang/true .code:n = { - \bool_set_true:N \eb@titletoc@hang@fix + \toggletrue{eb@titletoc@hang@fix} \ctex_set:n { chapter/tocline = \CTEXnumberline{##1}##2, @@ -562,7 +556,6 @@ }, hang/false .code:n = { - \bool_set_false:N \eb@titletoc@hang@fix \ctex_set:n { chapter/tocline = \EbNumberline{##1}##2, @@ -636,14 +629,15 @@ [\use:c {l__eb_toc_#2_indent_tl}] {\use:c {l__eb_toc_#2_format_tl}} { - \ifodd\eb@titletoc@hang@fix - \contentspush - { - \color{ctex@link} - \thecontentslabel - \hspace{\use:c {eb@toc@#2@numsep}} - } - \fi + \iftoggle{eb@titletoc@hang@fix} + { + \contentspush + { + \bool_if:NT \l__eb_toc_color_bool{\color{ctex@toc}} + \thecontentslabel + \hspace{\use:c {eb@toc@#2@numsep}} + } + }{} }{} {\use:c {l__eb_toc_#2_rule_tl}} } @@ -669,9 +663,7 @@ { \addcontentsline{#1}{#2} { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi + \iftoggle{eb@titletoc@hang@fix}{\protect\numberline}{} {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} } } @@ -682,9 +674,7 @@ }{ \addcontentsline{lol}{lstlisting} { - \ifodd\eb@titletoc@hang@fix - \protect\numberline - \fi + \iftoggle{eb@titletoc@hang@fix}{\protect\numberline}{} {\eb@labelname@lol}\lst@@caption } } @@ -1166,7 +1156,7 @@ { label = (\Alph*), after-item-skip = 0ex plus .1ex, - column-sep = .5\ccwd, + column-sep = \ccwd, item-indent = 2\ccwd, label-width = 1.5\ccwd } @@ -1278,7 +1268,7 @@ \end{tcolorbox} }{} \NewDocumentEnvironment{exercise} - {st+O{LightBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} + {st+O{LightSkyBlue}O{1.}D(){\c__eb_name_exercise_tl}o+O{}+b} { \IfBooleanTF{#2} { @@ -1602,29 +1592,43 @@ }, } -\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:} - } -\tl_const:Nn \c__eb_urlbreak_points_tl - { - ABCDEFGHIJKLMNOPQRSTUVWXYZ - abcdefghijklmnopqrstuvwxyz - 0123456789 - } - -\__ctex_define:nx {link} +\bool_set_false:N \l__eb_toc_color_bool +\__ctex_define:nn {link} { hyperlink .choice:, hyperlink/edge .code:n = {}, - hyperlink/various .code:n = \__eb_put_hyperref:n {colorlinks}, hyperlink/none .code:n = \__eb_put_hyperref:n {hidelinks}, + hyperlink/various .code:n = + { + \bool_set_true:N \l__eb_toc_color_bool + \__eb_put_hyperref:n {colorlinks} + }, hyperlink .default:n = edge, hyperlink .initial:n = edge, + linktoc .choice:, + linktoc/unknown .code:n = + { + \__eb_put_hyperref:n {linktoc = #1} + \clist_map_inline:nn {page,none} + { + \tl_if_eq:NnT \l_keys_value_tl{##1} + {\clist_map_break:n {\colorlet{ctex@toc}{black}}} + } + }, + linktoc .default:n = all, + linktoc .initial:n = all, + unknown .code:n = + { + \__eb_put_hyperref:x + { + \l_keys_key_str + \tl_if_empty:NF \l_keys_value_tl{ = {#1}} + } + } + } +\__ctex_define:nx {link} + { linkcolor .choice:, \clist_map_function:nN { @@ -1636,23 +1640,10 @@ \__eb_linkcolor_set:n linkcolor .default:n = navyblue, linkcolor .initial:n = navyblue, - linkcol-all .code:n = \__eb_define_linkcolor:n {\exp_not:n {#1}}, - - linktoc .choice:, - linktoc/unknown .code:n = - {\__eb_put_hyperref:n {linktoc = \exp_not:n {#1}}}, - linktoc .default:n = all, - linktoc .initial:n = all, - unknown .code:n = - { - \__eb_put_hyperref:x - { - \exp_not:N \l_keys_key_str - \exp_not:N \tl_if_empty:NF - \exp_not:N \l_keys_value_tl{ = \exp_not:n {#1}} - } - } + linkcol-all .code:n = + {\__eb_define_linkcolor:n {\exp_not:n {#1}}} } +\colorlet{ctex@toc}{ctex@link} \__ctex_define:nx {style} { color .choice:, @@ -1666,9 +1657,23 @@ } \__eb_themecolor_set:n color .initial:n = none, - color-all .code:n = \__eb_define_themecolor:n {\exp_not:n {#1}} + color-all .code:n = + {\__eb_define_themecolor:n {\exp_not:n {#1}}} } +\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:} + } +\tl_const:Nn \c__eb_urlbreak_points_tl + { + ABCDEFGHIJKLMNOPQRSTUVWXYZ + abcdefghijklmnopqrstuvwxyz + 0123456789 + } \ctex_at_end_preamble:n { \RequirePackage{hyperref} |