diff options
author | Norbert Preining <norbert@preining.info> | 2022-04-05 03:01:24 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-04-05 03:01:24 +0000 |
commit | a4e931576165d0a4a143915f4725399272e06fee (patch) | |
tree | ef5b6d71c2223b9f58e61fbb25423d4042430198 /macros/latex/contrib/minimalist/minimalist-plain.sty | |
parent | 7548e4d37c2aaefd32fe0a9bcd83f8e71326dde1 (diff) |
CTAN sync 202204050301
Diffstat (limited to 'macros/latex/contrib/minimalist/minimalist-plain.sty')
-rw-r--r-- | macros/latex/contrib/minimalist/minimalist-plain.sty | 142 |
1 files changed, 91 insertions, 51 deletions
diff --git a/macros/latex/contrib/minimalist/minimalist-plain.sty b/macros/latex/contrib/minimalist/minimalist-plain.sty index 3481c630dc..736c26aa2f 100644 --- a/macros/latex/contrib/minimalist/minimalist-plain.sty +++ b/macros/latex/contrib/minimalist/minimalist-plain.sty @@ -19,7 +19,7 @@ \RequirePackage{l3keys2e} \ProvidesExplPackage {minimalist-plain} - {2022/03/28} {} + {2022/04/03} {} {The plain style of minimalist} \@ifpackageloaded { minimalist } {} @@ -235,24 +235,6 @@ } %%================================ -%% Line numbers -%%================================ -\PassOptionsToPackage { pagewise,mathlines } { lineno } -\RequirePackage { linenoamsmath } -\renewcommand{\linenumberfont}{\ttfamily\color{main-text!7!paper}\footnotesize} -\setlength{\linenumbersep}{1em} - -\newif\ifLNturnsON -\def\LocallyStopLineNumbers{\LNturnsONfalse - \ifLineNumbers\LNturnsONtrue\fi\nolinenumbers} -\def\ResumeLineNumbers{\ifLNturnsON\linenumbers\fi} - -\hook_gput_code:nnn { cmd/tableofcontents/before } { minimalist } { \LocallyStopLineNumbers } -\hook_gput_code:nnn { cmd/tableofcontents/after } { minimalist } { \ResumeLineNumbers } -\hook_gput_code:nnn { env/bibliography/before } { minimalist } { \LocallyStopLineNumbers } -\hook_gput_code:nnn { env/bibliography/after } { minimalist } { \ResumeLineNumbers } - -%%================================ %% Title format %%================================ \RequirePackage [ explicit, newparttoc ] { titlesec } @@ -260,11 +242,12 @@ \RequirePackage { ulem } \cs_generate_variant:Nn \seq_set_split:Nnn { Nnx } -\cs_new:Nn \minimalist_apply_title_numbering_style:N +\cs_new:Nn \minimalist_apply_title_numbering_style:n { - \seq_set_split:Nnx \l_tmpa_seq { . } { #1 } - \seq_set_map:NNn \l_tmpb_seq \l_tmpa_seq { \usefont{U}{zeur}{b}{n} ##1 } - \textcolor{main-text!39!paper}{ \seq_use:Nn \l_tmpb_seq { $.$ } } + \tl_set:Nx \l_tmpa_tl { #1 } + \regex_replace_all:nnN { (\w) } { \c{textbf}{\1} } \l_tmpa_tl + \regex_replace_all:nnN { (\d) } { {\c{usefont}{U}{zeur}{b}{n}\1} } \l_tmpa_tl + \textcolor { main-text!39!paper } { \l_tmpa_tl } } \newcommand{\partstring}{\MakeUppercase{{\partname\nobreakspace\protect\thepart}}} @@ -388,7 +371,7 @@ \titleformat{\section} {\LocallyStopLineNumbers \g_minimalist_title_font_section_tl\centering} - {\raisebox{-.02\baselineskip}{\large \minimalist_apply_title_numbering_style:N { \thesection } }}{1em} + {\raisebox{-.02\baselineskip}{\large \minimalist_apply_title_numbering_style:n { \thesection } }}{1em} {#1} [\ResumeLineNumbers] @@ -396,7 +379,7 @@ \titleformat{\subsection} {\LocallyStopLineNumbers \g_minimalist_title_font_subsection_tl} - { \minimalist_apply_title_numbering_style:N { \thesubsection } }{.75em} + { \minimalist_apply_title_numbering_style:n { \thesubsection } }{.75em} {#1} [\ResumeLineNumbers] @@ -405,14 +388,14 @@ { \titleformat{\subsubsection}[runin] {\g_minimalist_title_font_subsubsection_tl} - { \minimalist_apply_title_numbering_style:N { \thesection } }{.5em} + { \minimalist_apply_title_numbering_style:n { \thesection } }{.5em} {#1.}[\hspace*{.3em}] } { \titleformat{\subsubsection} {\LocallyStopLineNumbers \g_minimalist_title_font_subsubsection_tl} - { \minimalist_apply_title_numbering_style:N { \thesubsubsection } }{.5em} + { \minimalist_apply_title_numbering_style:n { \thesubsubsection } }{.5em} {#1} [\ResumeLineNumbers] } @@ -432,7 +415,7 @@ \titlecontents{part} [0em] {\addvspace{1.5pc}\filcenter\normalfont} - { \minimalist_apply_title_numbering_style:N { \thecontentslabel } \nopagebreak\\\nopagebreak\uppercase} + { \minimalist_apply_title_numbering_style:n { \thecontentslabel } \nopagebreak\\\nopagebreak\uppercase} {} {} % without page number [\addvspace{.5pc}] @@ -442,25 +425,25 @@ \titlecontents{chapter} [2em] % i.e., 0em (part) + 2em {\addvspace{.5pc}\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{2em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2em}} {\hspace*{-2em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{section} [4em] % i.e., 2em (chapter) + 2em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{2em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2em}} {\hspace*{-2em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsection} [7em] % i.e., 4em (section) + 3em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{2.75em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} {\hspace*{-2.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsubsection} [9.5em] % i.e., 7em (subsection) + 3.5em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{3.25em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{3.25em}} {\hspace*{-3.25em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} } @@ -468,19 +451,19 @@ \titlecontents{section} [2em] % i.e., 0em (part) + 2em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{1.75em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{1.75em}} {\hspace*{-1.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsection} [4.5em] % i.e., 2em (section) + 2.5em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{2.25em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.25em}} {\hspace*{-2.25em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} \titlecontents{subsubsection} [7.5em] % i.e., 4.5em (subsection) + 3em {\normalfont} - {\contentslabel[ \minimalist_apply_title_numbering_style:N { \thecontentslabel } ]{2.75em}} + {\contentslabel[ \minimalist_apply_title_numbering_style:n { \thecontentslabel } ]{2.75em}} {\hspace*{-2.75em}} {\titlerule*[1em]{\textcolor{main-text!15!paper}{.}}\contentspage} } @@ -517,8 +500,8 @@ , PT = Esta~página~foi~intencionalmente~deixada~em~branco , BR = Esta~página~foi~intencionalmente~deixada~em~branco , ES = Esta~página~se~ha~dejado~intencionadamente~en~blanco - , CN = 此页为有意留为空白 - , TC = 此頁為有意留為空白 + , CN = \ziju{0.2} 此页为有意留为空白 + , TC = \ziju{0.2} 此頁為有意留為空白 , JP = このページは意図的に空白にしてあります , RU = Эта~страница~намеренно~оставлена~пустой } @@ -530,12 +513,73 @@ \hook_gput_next_code:nn { shipout/background } { \put(0.5\paperwidth,-0.5\paperheight){ - \makebox[0pt]{\large\color{main-text!10!paper}\bl@nkpagetext}} + \makebox[0pt]{\large\color{main-text!10!paper}\g_minimalist_title_font_common_tl\bl@nkpagetext}} } \null\newpage\fi\fi } %%================================ +%% Index +%%================================ +\RequirePackage { imakeidx } +\makeindex[intoc] + +\RequirePackage { silence } +\ExplSyntaxOff +\WarningFilter{latex}{Writing or overwriting file} +\begin{filecontents*}[overwrite]{\jobname.mst} +delim_0 "\\IndexDotfill " % Filler between section heading and page number +delim_1 "\\IndexDotfill " % Filler between subsection heading and page number +headings_flag 1 +heading_prefix "\\IndexHeading{" +heading_suffix "}\n" +\end{filecontents*} +\ExplSyntaxOn + +\projlib_langauge_define_multilingual_text:Nn \index_symbols_name + { + , EN = Symbols + , FR = Symboles + , DE = Symbole + , IT = Simboli + , PT = Símbolos + , BR = Símbolos + , ES = Símbolos + , CN = 符号 + , TC = 符號 + , JP = 記号 + , RU = Символы + } + +\newcommand*{\IndexDotfill} + { + \nobreakspace\nobreakspace + \titlerule*[.67em]{\textcolor{main-text!15!paper}{.}} + \nobreakspace\nobreakspace + } +\newcommand*{\IndexHeading}[1] + { + \str_if_eq:nnTF { #1 } { Symbols } + { \tl_set:Nn \l_tmpa_tl { \index_symbols_name } } + { \tl_set:Nn \l_tmpa_tl { #1 } } + \centerline{ \g_minimalist_title_font_common_tl \minimalist_apply_title_numbering_style:n { \l_tmpa_tl } } + \nopagebreak + \par + \vspace{.3\baselineskip} + } +\renewcommand*{\indexspace} + { + \par + \vspace{2pc~plus~.5pc~minus~.3pc} + } + +\hook_gput_code:nnn { begindocument/before } { minimalist } + { + \hook_gput_code:nnn { cmd/printindex/before } { minimalist } { \LocallyStopLineNumbers } + \hook_gput_code:nnn { cmd/printindex/after } { minimalist } { \ResumeLineNumbers } + } + +%%================================ %% Draft mark %%================================ \RequirePackage { projlib-draft } @@ -576,12 +620,15 @@ { \providecommand{\phantomsection}{} \RequirePackage { url } - \newcommand{\href}[2]{#2} + \providecommand{\href}[2]{#2} + \providecommand{\texorpdfstring}[2]{#1} } { - \PassOptionsToPackage { hidelinks,linktoc=all } { hyperref } - \RequirePackage { bookmark } \RequirePackage { hyperref } + \RequirePackage { bookmark } + \hypersetup{ hidelinks, linktoc = all } + \bookmarksetup{ numbered } + \renewcommand\Hy@numberline[1]{#1.~} } \RequirePackage { projlib-theorem } @@ -739,8 +786,8 @@ top = 0pt, bottom = 0pt, left = 0pt, right = 0pt, boxrule = 0pt, boxsep = 0pt, - before~skip = 1em+\parskip, - after~skip = 1.2em+\parskip, + before~skip = \parskip+\topsep+.25\baselineskip, + after~skip = \parskip+\topsep+.25\baselineskip, breakable, lines~before~break=3, ] } @@ -758,14 +805,7 @@ } } -%%================================ -%% Index -%%================================ -\hook_gput_code:nnn { begindocument/before } { minimalist } - { - \hook_gput_code:nnn { cmd/printindex/before } { minimalist } { \LocallyStopLineNumbers } - \hook_gput_code:nnn { cmd/printindex/after } { minimalist } { \ResumeLineNumbers } - } +\hook_gput_code:nnn { env/quote/begin } { minimalist } { \small } %%================================ %% Title block style |