summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/colorist/colorist-fancy.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/colorist/colorist-fancy.sty')
-rw-r--r--macros/latex/contrib/colorist/colorist-fancy.sty89
1 files changed, 58 insertions, 31 deletions
diff --git a/macros/latex/contrib/colorist/colorist-fancy.sty b/macros/latex/contrib/colorist/colorist-fancy.sty
index cc3db07f88..409bb5b7c9 100644
--- a/macros/latex/contrib/colorist/colorist-fancy.sty
+++ b/macros/latex/contrib/colorist/colorist-fancy.sty
@@ -15,11 +15,10 @@
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%%
-\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\RequirePackage{l3keys2e}
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{colorist-fancy}
- {2022/06/16} {}
+ {2022/09/03} {}
{The fancy style of colorist}
\IfPackageLoadedTF { colorist } {}
@@ -405,9 +404,15 @@
\titleformat{\paragraph}[runin]
{\color{main-text!50!paper} \g_colorist_title_font_paragraph_tl }{\theparagraph}{1em}{#1}
-\titlespacing{\section}{0pt}{\baselineskip}{.6\baselineskip}
-\titlespacing{\subsection}{0pt}{.75\baselineskip}{.4\baselineskip}
-\titlespacing{\subsubsection}{0pt}{.5\baselineskip}{.3\baselineskip}
+\titlespacing{\section}{0pt}{1\baselineskip plus .5\baselineskip minus .2\baselineskip}{.6\baselineskip plus .3\baselineskip minus .2\baselineskip}
+\titlespacing{\subsection}{0pt}{.75\baselineskip plus .3\baselineskip minus .2\baselineskip}{.4\baselineskip plus .2\baselineskip minus .1\baselineskip}
+\bool_if:NTF \l__colorist_runin_bool
+ {
+ \titlespacing{\subsubsection}{0pt}{.5\baselineskip plus .2\baselineskip minus .1\baselineskip}{0pt}
+ }
+ {
+ \titlespacing{\subsubsection}{0pt}{.5\baselineskip plus .2\baselineskip minus .1\baselineskip}{.3\baselineskip plus .2\baselineskip minus .1\baselineskip}
+ }
%%================================
%% ToC format
@@ -476,21 +481,21 @@
\setlistdepth{10}
\setlist{noitemsep, topsep=.33\topsep-.5\parskip}
\setlist[enumerate]{labelsep=*, leftmargin=*}
-\setlist[enumerate,1]{label=\arabic*$)$,
- ref = \arabic*$)$}
-\setlist[enumerate,2]{label=\emph{\roman*}$)$,
- ref = \arabic{enumi}.\emph{\roman*}$)$}
-\setlist[enumerate,3]{label=\emph{\alph*}$)$,
- ref = \arabic{enumi}.\emph{\roman{enumii}}.\emph{\alph*}$)$}
+\setlist[enumerate,1]{label = \normalfont\arabic*$\mskip-.5mu\big)$,
+ ref = \normalfont\color{.!45!paper}\arabic*$\mskip-.5mu\big)$}
+\setlist[enumerate,2]{label = \normalfont\emph{\roman*}$\mskip-.5mu\big)$,
+ ref = \normalfont\color{.!45!paper}\arabic{enumi}.\emph{\roman*}$\mskip-.5mu\big)$}
+\setlist[enumerate,3]{label = \normalfont\emph{\alph*}$\mskip-.5mu\big)$,
+ ref = \normalfont\color{.!45!paper}\arabic{enumi}.\emph{\roman{enumii}}.\emph{\alph*}$\mskip-.5mu\big)$}
\setlist[description]{font=\normalfont\colorist_bfseries:}
\renewlist{itemize}{itemize}{10}
-\setlist[itemize]{leftmargin=*,label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\cdot$}}
-\AddLanguageSetting { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\bullet$}} }
-\AddLanguageSetting [french] { \setlist[itemize,1]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{\rule[.2\baselineskip]{.8em}{.75pt}}} }
-\setlist[itemize,2]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{\rule[.2\baselineskip]{.5em}{.75pt}}}
-\setlist[itemize,3]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\circ$}}
-\setlist[itemize,4]{label=\colorlet{currentcolor}{.}\textcolor{currentcolor!27!paper}{$\ast$}}
+\setlist[itemize]{leftmargin=*,label=\textcolor{.!27!paper}{$\cdot$}}
+\AddLanguageSetting { \setlist[itemize,1]{label=\textcolor{.!27!paper}{$\bullet$},leftmargin=\maxof{\parindent}{1.5em}} }
+\AddLanguageSetting [french] { \setlist[itemize,1]{label=\textcolor{.!39!paper}{\rule[.2\baselineskip]{.8em}{.75pt}},leftmargin=\maxof{\parindent}{1.5em}} }
+\setlist[itemize,2]{label=\textcolor{.!27!paper}{\rule[.2\baselineskip]{.55em}{.75pt}}}
+\setlist[itemize,3]{label=\textcolor{.!27!paper}{$\circ$}}
+\setlist[itemize,4]{label=\textcolor{.!27!paper}{$\ast$}}
%%================================
%% Blank page
@@ -557,8 +562,17 @@ heading_suffix "}\n"
\newcommand*{\IndexDotfill}
{
- \leaders \hbox to .67em {\hss \textcolor{main-text!15!paper}{.} \hss} \hfill
+ \null\nobreak
+ \leaders \hbox to .67em {\hss \textcolor{main-text!15!paper}{.} \hss} \hskip1em plus1fill
+ }
+\newcommand*{\IndexLinebreak}
+ {
+ \nobreakspace\textcolor{main-text!45!paper}{\raisebox{.4ex}{.}\raisebox{.2ex}{.}}
+ \item\hspace*{\hangindent}
+ \textcolor{main-text!45!paper}{\raisebox{.45ex}{.}\raisebox{.25ex}{.}}\:
+ \unskip
}
+
\newcommand*{\IndexHeading}[1]
{
\str_if_eq:nnTF { #1 } { Symbols }
@@ -582,7 +596,7 @@ heading_suffix "}\n"
\renewcommand*{\indexspace}
{
\par
- \vspace{2pc ~ plus ~ .5pc ~ minus ~ .3pc}
+ \vspace{2pc plus .5pc minus .3pc}
}
\bool_new:N \l__colorist_if_first_subitem_bool
@@ -654,6 +668,10 @@ heading_suffix "}\n"
\RequirePackage { mathtools }
\RequirePackage { amsthm }
+\def\tagform@#1{\maketag@@@{\textcolor{main-text!39!paper}{(\ignorespaces#1\unskip\@@italiccorr)}}}
+
+\PassOptionsToPackage { nopatch = eqnum } { microtype }
+
\bool_if:NTF \l__colorist_theorem_in_new_line_bool
{
\newtheoremstyle{simple}
@@ -678,9 +696,9 @@ heading_suffix "}\n"
{\color{main-text!50!paper}\thmnote{\hspace{.4em}$($#3$)$}}\nobreakspace\nobreakspace{\normalfont\textcolor{main-text!27!paper}{---}}\nobreakspace\nobreakspace}
}
-\renewcommand{\qedsymbol}{
+\newcommand{\customqedsymbol}{
\makebox[1em]{\color{main-text!27!paper}\rule[-0.1em]{.95em}{.95em}}}
-\let\qedsymbolOriginal\qedsymbol
+\let\qedsymbol\customqedsymbol
\bool_if:NTF \l__colorist_theorem_in_new_line_bool
{
@@ -735,6 +753,13 @@ heading_suffix "}\n"
\hypersetup{ hidelinks, linktoc = all }
\bookmarksetup{ numbered }
\renewcommand\Hy@numberline[1]{#1.~}
+ % https://tex.stackexchange.com/a/1821
+ % Add the bookmark of ToC
+ \hook_gput_code:nnn { cmd/tableofcontents/before } { colorist }
+ {
+ \if@openright\cleardoublepage\else\clearpage\fi
+ \pdfbookmark[0]{\contentsname}{toc}
+ }
}
@@ -751,7 +776,9 @@ heading_suffix "}\n"
\tl_gset:Nn \g_crthm_combined_name_sep_tl { \textcolor{main-text}{-} }
-\SetTheorem { theorem, lemma, proposition, corollary, property, axiom, construction, definition-theorem, definition-proposition, theorem-with-name }
+\SetTheorem { proof, proof* } { qed-symbol = { \customqedsymbol } }
+
+\SetTheorem { theorem, lemma, proposition, corollary, property, axiom, construction, theorem-with-name }
{
name style = {
heading style = { \color{orange}\colorist_bfseries:\g_colorist_title_font_common_tl\textsc }
@@ -781,7 +808,7 @@ heading_suffix "}\n"
\bool_if:NF \l__projlib_theorem_complexname_bool
{
- \SetTheorem { theorem, lemma, proposition, corollary, property, axiom, construction, definition-theorem, definition-proposition, theorem-with-name }
+ \SetTheorem { theorem, lemma, proposition, corollary, property, axiom, construction, theorem-with-name }
{
name style = {
, crefname style = { \color{orange}\colorist_bfseries:\g_colorist_title_font_common_tl\textsc }
@@ -923,7 +950,7 @@ heading_suffix "}\n"
\tcolorboxenvironment { #1 } { #2 }
}
-\colorist_add_colorbox:nn { theorem, lemma, proposition, corollary, property, axiom, construction, definition-proposition, definition-theorem, theorem-with-name }
+\colorist_add_colorbox:nn { theorem, lemma, proposition, corollary, property, axiom, construction, definition-corollary, definition-proposition, definition-theorem, theorem-with-name }
{
enhanced~jigsaw, breakable, lines~before~break=3,
left=3.5mm, right=3.5mm,
@@ -931,7 +958,7 @@ heading_suffix "}\n"
opacityframe=0.9, colframe=orange, arc=.7mm
}
- \colorist_add_colorbox:nn { definition, assumption, convention, hypothesis, notation, proposition-definition, theorem-definition }
+ \colorist_add_colorbox:nn { definition, assumption, convention, hypothesis, notation, corollary-definition, proposition-definition, theorem-definition }
{
enhanced~jigsaw, breakable, lines~before~break=3,
left=4mm, right=4mm, top=1mm, bottom=1mm,
@@ -1030,21 +1057,21 @@ heading_suffix "}\n"
}
\cs_new_protected:Nn \__colorist_add_scan_env_do:n
{
- \tl_const:cn { l__colorist_scan_env_ #1 }
+ \tl_const:cn { l__colorist_scan_env_ #1 _tl }
{
\AfterEnvEnd
{
\ScanEnv* { #1 }
- { \skip_vertical:n { -0.9\baselineskip } }
+ { \vspace { -1.15\baselineskip } }
{
\ScanEnv* { #1* }
- { \skip_vertical:n { -0.9\baselineskip } }
+ { \vspace { -1.15\baselineskip } }
{}
}
}
}
- \hook_gput_code:nnn { env/#1/end } { colorist } { \tl_use:c { l__colorist_scan_env_ #1 } }
- \hook_gput_code:nnn { env/#1*/end } { colorist } { \tl_use:c { l__colorist_scan_env_ #1 } }
+ \hook_gput_code:nnn { env/#1/end } { colorist } { \tl_use:c { l__colorist_scan_env_ #1 _tl } }
+ \hook_gput_code:nnn { env/#1*/end } { colorist } { \tl_use:c { l__colorist_scan_env_ #1 _tl } }
}
\colorist_add_scan_env:n { definition, assumption, convention, hypothesis, notation }