summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/colorist/colorist.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-08-09 03:00:45 +0000
committerNorbert Preining <norbert@preining.info>2021-08-09 03:00:45 +0000
commit36320cbe81185b9897691aaae9caae090e675fd0 (patch)
tree1115dfe769a208115a326db29c6d07e33e2a1774 /macros/latex/contrib/colorist/colorist.sty
parented204b296810be74994f70f76b7f5b849f6e9ecb (diff)
CTAN sync 202108090300
Diffstat (limited to 'macros/latex/contrib/colorist/colorist.sty')
-rw-r--r--macros/latex/contrib/colorist/colorist.sty114
1 files changed, 57 insertions, 57 deletions
diff --git a/macros/latex/contrib/colorist/colorist.sty b/macros/latex/contrib/colorist/colorist.sty
index 354006dc4b..f5f9766e09 100644
--- a/macros/latex/contrib/colorist/colorist.sty
+++ b/macros/latex/contrib/colorist/colorist.sty
@@ -17,7 +17,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesPackage{colorist}
- [2021/07/30 A colorful style for articles and books]
+ [2021/08/08 A colorful style for articles and books]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{%
@@ -71,6 +71,7 @@
\ifdefined\c@chapter\IsBooktrue\else\IsBookfalse\fi
\let\colorist@sffamily\sffamily
+\let\colorist@scshape\scshape
\let\colorist@textsc\textsc
%%================================
@@ -79,7 +80,7 @@
\RequirePackage{anyfontsize}
\newcommand{\partfont}{\conditionalbfseries\colorist@sffamily}
-\newcommand{\chapfont}{\conditionalbfseries\colorist@sffamily}
+\newcommand{\chapfont}{\conditionalbfseries\colorist@sffamily\colorist@scshape}
\newcommand{\secfont}{\conditionalbfseries\colorist@sffamily}
\newcommand{\subsecfont}{\conditionalbfseries\colorist@sffamily}
\newcommand{\subsubsecfont}{\conditionalbfseries\colorist@sffamily}
@@ -169,7 +170,7 @@
\gappto{\PJLlang@langconfig@common}{%
\renewcommand{\partstring}{\MakeUppercase{{\partname~\protect\thepart}}}%
}
-\gappto{\PJLlang@langconfig@chinese}{%
+\gappto{\PJLlang@langconfig@schinese}{%
\renewcommand{\partstring}{第~\thepart~部分}%
}
\gappto{\PJLlang@langconfig@tchinese}{%
@@ -184,13 +185,25 @@
\titleclass{\part}{top} % make part like a chapter
\titleformat{\part}[display]
{\partfont\filleft}
- {\partstring}
+ {%
+ \thispagestyle{empty}%
+ \begin{tikzpicture}[remember picture,overlay]
+ \fill[maintheme!10!paper] (current page.north west) rectangle (current page.south east);
+ \node at ($(current page.north west)+(15em,-15em)$) {\normalfont\textcolor{maintheme}{\scalebox{12}{\thepart}}};
+ \end{tikzpicture}%
+ }
{1em}
{\fontsize{20}{0}\selectfont\MakeUppercase{#1}}
\titleformat{name=\part,numberless}[display]
{% \phantomsection\addcontentsline{toc}{part}{#1}%
\partfont\filleft}
- {\phantom{\MakeUppercase{\partname}}}
+ {%
+ \thispagestyle{empty}%
+ \begin{tikzpicture}[remember picture,overlay]
+ \fill[maintheme!10!paper] (current page.north west) rectangle (current page.south east);
+ \node at ($(current page.north west)+(15em,-15em)$) {\normalfont\textcolor{maintheme}{\scalebox{12}{$*$}}};
+ \end{tikzpicture}%
+ }
{1em}
{\fontsize{20}{0}\selectfont\MakeUppercase{#1}}
\titlespacing*{\part}{0pt}{5em}{6em}
@@ -207,63 +220,48 @@
}
%% Chapter
- \newlength{\colorist@chapboxwidth}
-
- \newcommand{\MakeChapBox}[2]{%
- \settowidth{\colorist@chapboxwidth}{#1}
- \begin{tcolorbox}[
- enhanced,
- skin = bicolor,
- frame engine = path,
- % sharp corners = all,
- width = 0.9\textwidth,
- top = 4mm, bottom = 4mm,
- arc = .5mm,
- sidebyside,
- frame hidden,
- boxrule = 0mm,
- lefthand width = 1.5\colorist@chapboxwidth,
- colupper = white,
- colback = maintheme!80!paper,
- colbacklower = maintheme!20!paper,
- sidebyside align=center,
- halign=center]
- \Huge #1%
- \tcblower%
- #2%
- \end{tcolorbox}%
+ \newcommand{\TheChapter}[2]{%
+ \tcbsidebyside[enhanced,sidebyside adapt=right,sidebyside align=bottom,
+ colback=paper,frame hidden,
+ segmentation code={
+ \filldraw[maintheme] (segmentation.north)
+ -- ($(segmentation.east)-(12pt,0)$)
+ -- ($(segmentation.west)+(12pt,0)$)
+ -- (segmentation.south);}
+ ]{\filleft#2}{\normalfont\textcolor{maintheme}{\scalebox{4}{#1}}}
}
- \newcommand{\MakeChapBoxSingle}[1]{%
+ \newcommand{\TheChapterSingle}[1]{%
\begin{tcolorbox}[
enhanced,
- width = 0.7\textwidth,
- % sharp corners = all,
- top = 4mm, bottom = 4mm,
- arc = .5mm,
- frame hidden,
- boxrule = 0mm,
- colback = maintheme!20!paper,
+ width = 0.67\textwidth,
+ colback=paper,frame hidden,
halign=center]
#1
+ \vspace{-.6em}
+ \begin{center}
+ \begin{tikzpicture}
+ \filldraw[maintheme] (-4em,0) -- (4em,0) -- (0,-.1em) -- (0,.1em);
+ \end{tikzpicture}
+ \end{center}
\end{tcolorbox}
}
\titleformat{name=\chapter}
- {\filright\chapfont\huge} % Format
+ {\chapfont\huge} % Format
{} % Label
{0mm} % Sep
- {\MakeChapBox{\thechapter}{#1}} % Before-code
+ {\TheChapter{\thechapter}{#1}} % Before-code
\titlespacing*{name=\chapter}
{0em}{*2}{0em} % {left}{before-sep}{after-sep}
\titleformat{name=\chapter, numberless}
- {\filcenter\chapfont\huge} % Format
- {} % Label
- {0mm} % Sep
- {\MakeChapBoxSingle{#1}} % Before-code
+ {\filcenter\chapfont\huge}
+ {}
+ {0mm}
+ {\TheChapterSingle{#1}}
\titlespacing*{name=\chapter, numberless}
- {0em}{*2}{0em} % {left}{before-sep}{after-sep}
+ {0em}{*2}{0em}
%% Section
\titleformat{\section}
@@ -327,7 +325,7 @@
\titlespacing{\section}{0pt}{\baselineskip}{.6\baselineskip}
\titlespacing{\subsection}{0pt}{.75\baselineskip}{.4\baselineskip}
-\titlespacing{\subsubsection}{0pt}{.5\baselineskip}{.2\baselineskip}
+\titlespacing{\subsubsection}{0pt}{.6\baselineskip}{.3\baselineskip}
%%================================
%% TOC format
@@ -336,7 +334,7 @@
\titlecontents{part}
[0em]
{\addvspace{1.5pc}\filcenter\colorist@sffamily}
- {\thecontentslabel\nopagebreak\\\nopagebreak\uppercase}
+ {{\normalfont\color{maintheme}\thecontentslabel}\nopagebreak\\\nopagebreak\uppercase}
{}
{} % without page number
[\addvspace{.5pc}]
@@ -360,10 +358,10 @@
{\hspace*{-2.75em}}
{\titlerule*[1em]{\textcolor{maintext!15!paper}{.}}\color{maintext!45!paper}\contentspage}
\titlecontents{subsubsection}
- [9em] % i.e., 7em (subsection) + 2em
+ [10em] % i.e., 7em (subsection) + 3em
{\normalfont\colorist@sffamily}
- {\contentslabel{2.75em}}
- {\hspace*{-2.75em}}
+ {\contentslabel{3.25em}}
+ {\hspace*{-3.25em}}
{\titlerule*[1em]{\textcolor{maintext!15!paper}{.}}\color{maintext!45!paper}\contentspage}
}{
\titlecontents{section}
@@ -375,11 +373,11 @@
\titlecontents{subsection}
[5em] % i.e., 2em (section) + 3em
{\addvspace{.15pc}\normalfont\colorist@sffamily}
- {\contentslabel{2.75em}}
- {\hspace*{-2.75em}}
+ {\contentslabel{2.25em}}
+ {\hspace*{-2.25em}}
{\titlerule*[1em]{\textcolor{maintext!15!paper}{.}}\color{maintext!45!paper}\contentspage}
\titlecontents{subsubsection}
- [7em] % i.e., 5em (subsection) + 2em
+ [8em] % i.e., 5em (subsection) + 3em
{\normalfont\colorist@sffamily}
{\contentslabel{2.75em}}
{\hspace*{-2.75em}}
@@ -750,8 +748,8 @@
\expandafter\def\csname definition-theoremnameRU\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{Определение}-\theoremnameRU}
\AtEndPreamble{
-\theoremstyle{basic}
\if@colorist@nothms\else
+\theoremstyle{basic}
\if@colorist@nothmnum
\CreateTheorem*{theorem}
\CreateTheorem*{lemma}
@@ -826,9 +824,13 @@
\fi
\CreateTheorem*{remark*}
\CreateTheorem*{observation*}
+
+\theoremstyle{simple}
\fi
}
+\theoremstyle{simple}
+
\creflabelformat{PJLtheorem}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLlemma}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLproposition}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
@@ -1137,8 +1139,6 @@
}}
\fi
-\theoremstyle{simple}% as the default style for user-defined environments
-
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
@@ -1460,7 +1460,7 @@
%% Abstract style
%%================================
\renewenvironment{abstract}
-{\small{\centerline{\textsc{\conditionalbfseries\abstractname}}\vspace{-0.3\baselineskip}}
+{\small{\centerline{\textsc{\conditionalbfseries\sffamily\abstractname}}\vspace{-0.3\baselineskip}}
\color{maintext!80!paper}\begin{quotation}}
{\end{quotation}\medskip}