diff options
author | Karl Berry <karl@freefriends.org> | 2021-04-21 20:32:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-04-21 20:32:55 +0000 |
commit | 999ad04d318dfe7f8a232b8f052b681fbeb8255d (patch) | |
tree | d202734d326a33516e908926ef5e7ca17afb3727 /Master/texmf-dist/tex/latex/easybook | |
parent | 32a557d6151d93fe3a81954dae61d98f8a6f2d7e (diff) |
easybook (21apr21)
git-svn-id: svn://tug.org/texlive/trunk@58936 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/easybook')
-rw-r--r-- | Master/texmf-dist/tex/latex/easybook/easybook.cls | 168 |
1 files changed, 113 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/latex/easybook/easybook.cls b/Master/texmf-dist/tex/latex/easybook/easybook.cls index 7e550bf31c2..410de43f383 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/19}{1.24o}{beta} +\ProvidesExplClass{easybook}{2021/04/21}{1.24q}{beta} \cs_generate_variant:Nn \__ctex_define:nn {nx} \cs_generate_variant:Nn \int_to_arabic:n {v} @@ -36,6 +36,7 @@ \bool_set_true:N \l__eb_zhtitle_bool \bool_set_true:N \l__eb_page_twoside_bool \bool_set_true:N \l__eb_class_book_bool +\tl_new:N \g__eb_config_tl \clist_new:N \g__eb_options_clist \keys_define:nn {easybook} @@ -87,6 +88,7 @@ }, class .initial:n = book, + config .tl_set:N = \g__eb_config_tl, unknown .code:n = {\clist_gput_right:No \g__eb_options_clist{\CurrentOption}} } @@ -115,7 +117,6 @@ \bool_new:N \l__eb_uppercase_bool \bool_new:N \l__eb_chap_withpart_bool \tl_new:N \l__eb_foot_numberwith_tl -\tl_new:N \g__eb_config_tl \seq_const_from_clist:Nn \c__eb_options_path_seq { @@ -130,7 +131,6 @@ } \ctex_define:n { - config .tl_set:N = \g__eb_config_tl, lstlistlistingname .tl_set:N = \lstlistlistingname, lstlistingname .tl_set:N = \lstlistingname } @@ -184,8 +184,13 @@ } \ctex_at_end_preamble:n { - \bool_if:NT \l__eb_notomath_bool{\RequirePackage{newtxmath,bm}} - \tl_if_empty:NF \g__eb_config_tl{\file_input:n {\g__eb_config_tl}} + \bool_if:NT \l__eb_notomath_bool + {\RequirePackage{newtxmath,bm}} + } +\ctex_at_end:n + { + \tl_if_empty:NF \g__eb_config_tl + {\file_input:n {\g__eb_config_tl}} } \cs_new_protected:Npn \__eb_package_later_bool:nn #1#2 @@ -321,8 +326,6 @@ footparskip .initial:n = 0ex, footparindent .tl_set:N = \hangfootparindent, footparindent .initial:n = 2\ccwd, - list-labelsep .dim_set:N = \eb@list@labelsep, - list-labelsep .initial:n = \ccwd, unknown .code:n = { \clist_gput_right:Nx \g__eb_geometry_clist @@ -489,11 +492,21 @@ \ctex_define:n {tocset/#1 .meta:nn = {ctex/tocset/#1}{##1}} \__ctex_define:nn {tocset} { - #1/format .tl_set:c = l__toc_#1_format_tl, - #1/indent .tl_set:c = l__toc_#1_indent_tl, - #1/rule .tl_set:c = l__toc_#1_rule_tl + #1/format .tl_set:c = l__eb_toc_#1_format_tl, + #1/indent .tl_set:c = l__eb_toc_#1_indent_tl, + #1/rule .tl_set:c = l__eb_toc_#1_rule_tl, + #1/numsep .tl_set:c = eb@toc@#1@numsep } } + +\cs_new:Npn \EbNumberline#1 + { + \CTEXifname + { + \use:c {CTEXthe#1} + \hspace{\use:c {eb@toc@#1@numsep}} + }{} + } \__ctex_define:nn {tocset} { lists/lolskip .skip_set:N = \l__eb_toc_lolskip_skip, @@ -502,46 +515,105 @@ lists/belowoffset .initial:n = 0pc, tocline-fig .cs_set:Np = \eb@labelname@lof#1, tocline-fig .initial:n = - {\figurename\space#1\hspace{\eb@list@labelsep}}, + { + \figurename\space#1 + \ifodd\eb@titletoc@hang@fix + \else + \hspace{\eb@toc@lists@numsep} + \fi + }, tocline-tab .cs_set:Np = \eb@labelname@lot#1, tocline-tab .initial:n = - {\tablename\space#1\hspace{\eb@list@labelsep}}, + { + \tablename\space#1 + \ifodd\eb@titletoc@hang@fix + \else + \hspace{\eb@toc@lists@numsep} + \fi + }, tocline-lst .tl_set:N = \eb@labelname@lol, tocline-lst .initial:n = { \lstlistingname\space - \thelstlisting\hspace{\eb@list@labelsep} + \thelstlisting + \ifodd\eb@titletoc@hang@fix + \else + \hspace{\eb@toc@lists@numsep} + \fi }, belowoffset .dim_set:N = \l__eb_toc_offset_dim, belowoffset .initial:n = -1pc, line-align .bool_set:N = \l__eb_toc_line_align_bool, line-align .default:n = true, line-align .initial:n = true, - hang .bool_set:N = \eb@titletoc@hang@fix, + + hang .choice:, + hang/true .code:n = + { + \bool_set_true:N \eb@titletoc@hang@fix + \ctex_set:n + { + chapter/tocline = \CTEXnumberline{##1}##2, + section/tocline = \CTEXnumberline{##1}##2, + subsection/tocline = \CTEXnumberline{##1}##2 + } + }, + hang/false .code:n = + { + \bool_set_false:N \eb@titletoc@hang@fix + \ctex_set:n + { + chapter/tocline = \EbNumberline{##1}##2, + section/tocline = \EbNumberline{##1}##2, + subsection/tocline = \EbNumberline{##1}##2 + } + }, hang .default:n = true, - hang .initial:n = false + hang .initial:n = false, + + numsep-all .meta:n = + { + part/numsep = {#1}, + chapter/numsep = {#1}, + section/numsep = {#1}, + subsection/numsep = {#1}, + lists/numsep = {#1} + }, + indent-all .meta:n = + { + part/indent = {#1}, + chapter/indent = {#1}, + section/indent = {#1}, + subsection/indent = {#1}, + lists/indent = {#1} + } } \ctex_set:nn {tocset} { part/format = \addvspace{1pc}\sffamily\large, part/indent = 0\ccwd, part/rule = \tocrule{}[\bfseries], + part/numsep = \ccwd, chapter/format = \addvspace{1pc}\sffamily\large, chapter/indent = 0\ccwd, chapter/rule = \tocrule{$\cdot$}[\bfseries], + chapter/numsep = \ccwd, section/format = \addvspace{0.35pc}, section/indent = 1.5\ccwd, section/rule = \tocrule{$\cdot$}, + section/numsep = \ccwd, subsection/format = \addvspace{0.35pc}, subsection/indent = 3.8\ccwd, subsection/rule = \tocrule{$\cdot$}, + subsection/numsep = \ccwd, lists/format = \addvspace{0.2pc}, lists/indent = 0\ccwd, - lists/rule = \tocrule{$\cdot$} + lists/rule = \tocrule{$\cdot$}, + lists/numsep = \ccwd } \NewDocumentCommand{\tocrule}{sO{0.7pc}D(){1.2}mO{}} @@ -558,14 +630,19 @@ \cs_new_protected:Npn \__eb_titlecontents_set:nn #1#2 { \titlecontents{#1} - [\use:c {l__toc_#2_indent_tl}] - {\use:c {l__toc_#2_format_tl}} + [\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} + \contentspush + { + \color{ctex@link} + \thecontentslabel + \hspace{\use:c {eb@toc@#2@numsep}} + } \fi }{} - {\use:c {l__toc_#2_rule_tl}} + {\use:c {l__eb_toc_#2_rule_tl}} } \contentsuse{lstlisting}{lol} \clist_map_inline:nn @@ -579,20 +656,12 @@ {lstlisting}{lists} }{\__eb_titlecontents_set:nn #1} -\prop_new:N \l_label_name_prop -\prop_set_from_keyval:Nn \l_label_name_prop +\prop_new:N \l__eb_label_name_prop +\prop_set_from_keyval:Nn \l__eb_label_name_prop { figure = \eb@labelname@lof, table = \eb@labelname@lot } -\cs_new:Npn \eb@numberline#1#2 - { - \CTEXifname - { - \protect\numberline{\use:c {CTEXthe#1}} - \hspace{#2} - }{} - } \ctex_at_end_preamble:n { \cs_gset:Npn \caption@@@addcontentsline#1#2#3#4 @@ -602,7 +671,7 @@ \ifodd\eb@titletoc@hang@fix \protect\numberline \fi - {\prop_item:Nn \l_label_name_prop{#2}{#3}}{#4} + {\prop_item:Nn \l__eb_label_name_prop{#2}{#3}}{#4} } } \ctex_patch_cmd:Nnn \lst@MakeCaption @@ -618,14 +687,6 @@ {\eb@labelname@lol}\lst@@caption } } - \ifodd\eb@titletoc@hang@fix - \ctex_set:n - { - chapter/tocline = \eb@numberline{#1}{\ccwd}#2, - section/tocline = \eb@numberline{#1}{\ccwd}#2, - subsection/tocline = \eb@numberline{#1}{\ccwd}#2 - } - \fi } \__eb_appto_cmd:Nn \@chapter @@ -962,10 +1023,10 @@ \setcounter{topnumber}{4} \setcounter{bottomnumber}{4} \setcounter{totalnumber}{8} -\cs_gset:Npn \textfraction{0.18} -\cs_gset:Npn \topfraction{0.85} -\cs_gset:Npn \bottomfraction{0.65} -\cs_gset:Npn \floatpagefraction{0.60} +\tl_gset:Nn \textfraction{0.18} +\tl_gset:Nn \topfraction{0.85} +\tl_gset:Nn \bottomfraction{0.65} +\tl_gset:Nn \floatpagefraction{0.60} \newcolumntype{L}{X} \newcolumntype{C}{>{\centering\arraybackslash}X} @@ -1198,7 +1259,7 @@ { blank,on~line,center, fontupper = \Large\sffamily, - before~skip = 3.5ex,after~skip = 2.25ex + before~skip = 3.75ex,after~skip = 2.5ex }, breakable, boxsep = 0pt, @@ -1279,17 +1340,17 @@ beforeafter~skip = 1.5ex, colframe = #2,coltitle = #2,#4 } - \DeclareTotalTCBox{\fuzzy}{O{DarkSeaGreen}vO{}} + \DeclareTotalTCBox{\ebemph}{O{DarkSeaGreen}vO{}} { nobeforeafter,tcbox~raise~base, blank,fuzzy~halo = 2pt~with~#1,#3 }{#2} - \DeclareTotalTCBox{\concise}{O{Aqua}vO{}} + \DeclareTotalTCBox{\eblink}{O{Aqua}vO{}} { nobeforeafter,tcbox~raise~base, - top = 2pt,bottom = 2.5pt,left = 2pt,right = 2pt, + top = 1.25pt,bottom = 1.25pt,left = 1.25pt,right = 1.25pt, boxrule = 0.75pt,arc = 1pt, - colback = #1!15!white,#3 + colback = #1!12!white,colframe = #1,#3 }{#2} } \ctex_at_end_preamble:n @@ -1687,7 +1748,7 @@ format = \color{ctex@frame}\sffamily\Huge, aftername = {\bool_if:NTF \l__eb_newline_bool{\par\nobreak}{\hspace{\ccwd}}}, - tocline = \CTEXifname{\CTEXthepart\hspace{\ccwd}}{}#2 + tocline = \CTEXifname{\CTEXthepart\hspace{\eb@toc@part@numsep}}{}#2 }, chapter = { @@ -1707,8 +1768,7 @@ beforeskip = -1.5ex, afterskip = 3ex, lotskip = 0.8pc, - lofskip = 0.8pc, - tocline = \CTEXifname{\CTEXthechapter\hspace{\ccwd}}{}#2 + lofskip = 0.8pc }, section = { @@ -1716,8 +1776,7 @@ format = \color{ctex@frame}\sffamily\Large, aftername = \hspace{0.5\ccwd}, beforeskip = 1.5ex plus .2ex minus .1ex, - afterskip = 1.5ex plus .2ex minus .1ex, - tocline = \CTEXifname{\CTEXthesection\hspace{\ccwd}}{}#2 + afterskip = 1.5ex plus .2ex minus .1ex }, subsection = { @@ -1725,8 +1784,7 @@ format = \color{ctex@frame}\sffamily\large, aftername = \hspace{0.5\ccwd}, beforeskip = 1.3ex plus .2ex minus .1ex, - afterskip = 1.3ex plus .2ex minus .1ex, - tocline = \CTEXifname{\CTEXthesubsection\hspace{\ccwd}}{}#2 + afterskip = 1.3ex plus .2ex minus .1ex }, subsubsection = { |