diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/easybook/easybook.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/easybook/easybook.dtx | 119 |
1 files changed, 63 insertions, 56 deletions
diff --git a/Master/texmf-dist/source/latex/easybook/easybook.dtx b/Master/texmf-dist/source/latex/easybook/easybook.dtx index d114859b141..970c1d7f521 100644 --- a/Master/texmf-dist/source/latex/easybook/easybook.dtx +++ b/Master/texmf-dist/source/latex/easybook/easybook.dtx @@ -2,13 +2,20 @@ % Copyright (C) 2021 by Qu Yi <quee123@foxmail.com> % % This work may be distributed and/or modified under the -% conditions of the CC-BY 4.0 License. -% The latest version of this license is in -% https://creativecommons.org/licenses/by/4.0/legalcode +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. The latest version of this license is in: +% +% http://www.latex-project.org/lppl.txt +% +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. %<*class> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e} -\ProvidesExplClass{easybook}{2021/08/13}{1.28N} +\ProvidesExplClass{easybook}{2021/08/13}{1.28o} {Typeset Chinese theses or books} \bool_set_false:N \l__eb_compile_draft_bool @@ -292,7 +299,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{l3keys2e,etoolbox} -\ProvidesExplPackage{easybase}{2021/08/13}{1.28N} +\ProvidesExplPackage{easybase}{2021/08/13}{1.28o} {Typeset Chinese theses or books} \cs_generate_variant:Nn \dim_add:Nn { NV,Nv } @@ -405,10 +412,10 @@ \keys_define:nn { easybase } { - draft .code:n = \bool_set_true:N \l__eb_compile_draft_bool, - floatpage .bool_set:N = \l__eb_float_page_bool, - floatpage .default:n = true, - floatpage .initial:n = false, + draft .code:n = \bool_set_true:N \l__eb_compile_draft_bool, + floatpage .bool_set:N = \l__eb_float_page_bool, + floatpage .default:n = true, + floatpage .initial:n = false, paper .choice:, paper .value_required:n = true, @@ -641,8 +648,8 @@ } \ctex_define:nn { hdrset } { - head-foot .tl_set:N = \l__eb_fancyhf_content_tl, - head-foot .initial:n = + head-foot .tl_set:N = \l__eb_fancyhf_content_tl, + head-foot .initial:n = { \ifbool{@twoside} { @@ -2010,16 +2017,16 @@ { \sisetup { - mode = match, + mode = match, table-parse-only, text-family-to-math, text-series-to-math, - reset-text-family = false, - reset-text-series = false, - reset-text-shape = false, - range-phrase = \ensuremath{\sim}, - range-units = single, - group-digits = none + reset-text-family = false, + reset-text-series = false, + reset-text-shape = false, + range-phrase = \ensuremath{\sim}, + range-units = single, + group-digits = none } }{} \eb_at_begin_environment:nn @@ -2102,11 +2109,11 @@ bib-style .value_required:n = true, bib-style .initial:n = numerical, - cite-style .code:n = + cite-style .code:n = { \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_en_bitoc_title_tl, - bitoc-title .initial:n = Reference, + datafile .clist_set:N = \l__eb_bib_datafile_clist, + bitoc-title .tl_set:N = \l__eb_bib_en_bitoc_title_tl, + bitoc-title .initial:n = Reference, unknown .code:n = \eb_msg_unknown_option:n { bibset } } @@ -2179,8 +2186,32 @@ \cs_new:Npn \eb@lst@if@display #1#2 { \lst@ifdisplaystyle #1\else #2\fi } -\lstdefinestyle{easy-listings} +\lstdefinestyle{lst-base} + { + breaklines = true, + resetmargins = true, + % numbers = left, + numberstyle = \footnotesize, + basewidth = 0.5em, + columns = flexible, + aboveskip = 1.5ex plus .2ex minus .1ex, + belowskip = 1.5ex plus .2ex minus .1ex, + abovecaptionskip = -1ex, + belowcaptionskip = 1.5ex, + keepspaces = true, + escapeinside = {(*}{*)}, + framerule = \l__eb_rule_width_dim, + xleftmargin = 5pt, + xrightmargin = 5pt, + framesep = \dimexpr(5pt - \l__eb_rule_width_dim), + frame = single, + rulecolor = \color{ctex@frame}, + commentstyle = \color{SlateGray}, + emphstyle = \color{ctex@emph} + } +\lstdefinestyle{lst-latex} { + style = lst-base, language = [LaTeX]TeX, texcsstyle = *\color{ctex@verb}\bfseries, basicstyle = @@ -2192,33 +2223,9 @@ { \color{ctex@verb} \eb@lst@if@display{\bfseries}{} - }, - framexleftmargin = 0pt, - framexrightmargin = 0pt, - xleftmargin = 3pt, - xrightmargin = 3pt, - numbersep = 10pt, - framesep = 3pt, - frame = single, - rulecolor = \color{ctex@frame}, - commentstyle = \color{SlateGray}, - emphstyle = \color{ctex@emph} - } -\lstset - { - style = easy-listings, - breaklines = true, - resetmargins = true, - % numbers = left, - numberstyle = \footnotesize, - aboveskip = 1.5ex plus .2ex minus .1ex, - belowskip = 1.5ex plus .2ex minus .1ex, - keepspaces = true, - framerule = \l__eb_rule_width_dim, - columns = flexible, - abovecaptionskip = -1ex, - belowcaptionskip = 1.5ex + } } +\lstset{style = lst-latex} \lstloadlanguages{C,C++,Java,Python,Matlab} \clist_new:N \l__eb_hyperref_clist @@ -2272,7 +2279,7 @@ linktype .initial:n = edge, linktoc .choice:, - linktoc/unknown .code:n = + linktoc/unknown .code:n = { \eb_put_hyperref:n { linktoc = #1 } \clist_map_inline:nn { page,none } @@ -2284,9 +2291,9 @@ } } }, - linktoc .default:n = all, - linktoc .initial:n = all, - unknown .code:n = + linktoc .default:n = all, + linktoc .initial:n = all, + unknown .code:n = { \eb_put_hyperref:x { @@ -2324,8 +2331,8 @@ { cyberpunk, 601986,eb6877,a4005b } } \eb_theme_color_set:n - color .initial:n = none, - color-all .code:n = + color .initial:n = none, + color-all .code:n = { \eb_define_theme_color:n { \exp_not:n {#1} } } } @@ -2396,7 +2403,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/13}{1.28N} +\ProvidesExplFile{eb-tcolorbox.cfg}{2021/08/13}{1.28o} {Customization of tcolorbox for easybook} \tl_gset:Nn \eb@tc@line@skip { 0.5\baselineskip } |