summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/colorist
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-31 03:00:52 +0000
committerNorbert Preining <norbert@preining.info>2021-07-31 03:00:52 +0000
commit6476d9b56070f64c62d6a81514c0c9b25aad1eda (patch)
treebbcbbc5af76f023abb6d36c84ae8a2c2e46dc601 /macros/latex/contrib/colorist
parent83b88676e8526454a292a894c5f30451eb75b828 (diff)
CTAN sync 202107310300
Diffstat (limited to 'macros/latex/contrib/colorist')
-rw-r--r--macros/latex/contrib/colorist/colorart.cls16
-rw-r--r--macros/latex/contrib/colorist/colorbook.cls16
-rw-r--r--macros/latex/contrib/colorist/colorist-doc.pdfbin93735 -> 95143 bytes
-rw-r--r--macros/latex/contrib/colorist/colorist-doc.tex32
-rw-r--r--macros/latex/contrib/colorist/colorist.sty46
5 files changed, 79 insertions, 31 deletions
diff --git a/macros/latex/contrib/colorist/colorart.cls b/macros/latex/contrib/colorist/colorart.cls
index 64c68139bd..5d45070c7a 100644
--- a/macros/latex/contrib/colorist/colorart.cls
+++ b/macros/latex/contrib/colorist/colorart.cls
@@ -17,7 +17,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesClass{colorart}
- [2021/07/27 A colorful article style]
+ [2021/07/30 A colorful article style]
\def\colorclass@baseclass{article}
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
@@ -31,6 +31,7 @@
\DeclareBoolOption[false]{palatino}
\DeclareBoolOption[false]{times}
\DeclareBoolOption[false]{garamond}
+\DeclareBoolOption[false]{noto}
\DeclareBoolOption[false]{biolinum}
\DeclareBoolOption[false]{customfont}
@@ -55,6 +56,9 @@
\if@colorclass@garamond
\@colorclass@customfonttrue
\fi
+\if@colorclass@noto
+ \@colorclass@customfonttrue
+\fi
\if@colorclass@biolinum
\@colorclass@customfonttrue
\fi
@@ -149,6 +153,16 @@
\let\colorist@textsc\relax
\fi
+\if@colorclass@noto
+ \RequirePackage{amssymb}
+ \if@colorclass@useosf
+ \PassOptionsToPackage{oldstyle}{notomath}
+ \fi
+ \RequirePackage{anyfontsize}
+ \RequirePackage{notomath}
+ \PJLsetlinespacing{\setstretch{1.00}}
+\fi
+
\if@colorclass@biolinum
\RequirePackage{amssymb}
% \RequirePackage{mathpazo}
diff --git a/macros/latex/contrib/colorist/colorbook.cls b/macros/latex/contrib/colorist/colorbook.cls
index 45efb1360c..798ec0bcb3 100644
--- a/macros/latex/contrib/colorist/colorbook.cls
+++ b/macros/latex/contrib/colorist/colorbook.cls
@@ -17,7 +17,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesClass{colorbook}
- [2021/07/27 A colorful book style]
+ [2021/07/30 A colorful book style]
\def\colorclass@baseclass{book}
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
@@ -31,6 +31,7 @@
\DeclareBoolOption[false]{palatino}
\DeclareBoolOption[false]{times}
\DeclareBoolOption[false]{garamond}
+\DeclareBoolOption[false]{noto}
\DeclareBoolOption[false]{biolinum}
\DeclareBoolOption[false]{customfont}
@@ -55,6 +56,9 @@
\if@colorclass@garamond
\@colorclass@customfonttrue
\fi
+\if@colorclass@noto
+ \@colorclass@customfonttrue
+\fi
\if@colorclass@biolinum
\@colorclass@customfonttrue
\fi
@@ -149,6 +153,16 @@
\let\colorist@textsc\relax
\fi
+\if@colorclass@noto
+ \RequirePackage{amssymb}
+ \if@colorclass@useosf
+ \PassOptionsToPackage{oldstyle}{notomath}
+ \fi
+ \RequirePackage{anyfontsize}
+ \RequirePackage{notomath}
+ \PJLsetlinespacing{\setstretch{1.00}}
+\fi
+
\if@colorclass@biolinum
\RequirePackage{amssymb}
% \RequirePackage{mathpazo}
diff --git a/macros/latex/contrib/colorist/colorist-doc.pdf b/macros/latex/contrib/colorist/colorist-doc.pdf
index 0a038390b7..56badd7b1f 100644
--- a/macros/latex/contrib/colorist/colorist-doc.pdf
+++ b/macros/latex/contrib/colorist/colorist-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/colorist/colorist-doc.tex b/macros/latex/contrib/colorist/colorist-doc.tex
index f8bea775a1..e17a0ba207 100644
--- a/macros/latex/contrib/colorist/colorist-doc.tex
+++ b/macros/latex/contrib/colorist/colorist-doc.tex
@@ -1,16 +1,4 @@
-\documentclass[English,Chinese,French,allowbf,puretext]{colorart}
-
-\theoremstyle{basic}
-\CreateTheorem{definition}<highest>
-\CreateTheorem{theorem}[definition]
-\CreateTheorem{conjecture}[definition]
-\CreateTheorem*{example*}
-\CreateTheorem{problem}[definition]
-
-\theoremstyle{emphasis}
-\CreateTheorem{remark}<highest>
-
-\theoremstyle{simple}
+\documentclass[English,Chinese,French,allowbf]{colorart}
%%================================
%% Import toolkit
@@ -105,7 +93,7 @@
\title{\colorist{}, write your articles or books in a colorful way}
\author{Jinwen XU}
-\thanks{Corresponding to: \texttt{\colorist{} 2021/07/27}}
+\thanks{Corresponding to: \texttt{\colorist{} 2021/07/30}}
\email{\href{mailto:ProjLib@outlook.com}{ProjLib@outlook.com}}
\date{July 2021, Beijing}
@@ -322,6 +310,7 @@ If you like the current document class, but want a more ``plain'' style, then yo
\end{code}
\end{tip}
+\vspace{1.5\baselineskip}
\LevelTwoTitle{Example - \colorbook}
Now let's look at an example of \colorbook{} (the same works for \beaulivre{}).
@@ -366,6 +355,7 @@ There is no much differences with \colorart{}, only that the title and author in
In the next section, we will go through the options available.
+\clearpage
\LevelOneTitle{The options}
\colorist{} offers the following options:
@@ -400,9 +390,14 @@ In the next section, we will go through the options available.
\begin{itemize}
\item Pure text mode. Does not load theorem-like environments.
\end{itemize}
- \item \texttt{nothmnum}
+ \item \texttt{nothmnum}, \texttt{thmnum} or \texttt{thmnum=}\meta{counter}
\begin{itemize}
- \item Theorem-like environments will not be numbered.
+ \item Theorem-like environments will not be numbered / numbered in order 1, 2, 3... / numbered within \meta{counter}. Here, \meta{counter} should be a built-in counter (such as \texttt{subsection}) or a custom counter defined in the preamble. If no option is used, they will be numbered within \texttt{chapter} (book) or \texttt{section} (article).
+ \end{itemize}
+ \item \texttt{regionalref}, \texttt{originalref}
+ \begin{itemize}
+ \item When referencing, whether the name of the theorem-like environment changes with the current language. The default is \texttt{regionalref}, \emph{i.e.}, the name corresponding to the current language is used; for example, when referencing a theorem-like environment in English context, the names "Theorem, Definition..." will be used no matter which language context the original environment is in. If \texttt{originalref} is enabled, then the name will always remain the same as the original place; for example, when referencing a theorem written in the French context, even if one is currently in the English context, it will still be displayed as ``Théorème''.
+ \item In \texttt{fast} mode, the option \texttt{originalref} will have no effect.
\end{itemize}
\end{itemize}
@@ -412,7 +407,7 @@ Additionally, \colorart{} and \colorbook{} offers the following options:
\begin{itemize}
\item Optional paper size. The default paper size is 8.5in $\times$ 11in.
\end{itemize}
- \item \texttt{palatino}, \texttt{times}, \texttt{garamond}, \texttt{biolinum} ~$|$~ \texttt{useosf}
+ \item \texttt{palatino}, \texttt{times}, \texttt{garamond}, \texttt{noto}, \texttt{biolinum} ~$|$~ \texttt{useosf}
\begin{itemize}
\item Font options. As the name suggest, font with corresponding name will be loaded.
\item The \texttt{useosf} option is used to enable the old-style figures.
@@ -488,7 +483,7 @@ After using \lstinline|\UseLanguage{French}|, a theorem will be displayed as:
Un théorème en français.
\end{theorem}
-By default, when referenced, the name of the theorem always matches the language of the context in which the theorem is located. For example, the definition above is still displayed in English in the current French mode: \cref{def: strange} and \cref{thm}. If you want the name of the theorem to match the current context when referencing, you can add \texttt{regionalref} to the global options.
+By default, when referenced, the name of the theorem matches the current context. For example, the definition above will be displayed in French in the current French context: \cref{def: strange,thm}. If you want the name of the theorem to always match the language of the context in which the theorem is located, you can add \texttt{originalref} to the global options.
\end{tip}
\UseLanguage{English}
@@ -535,6 +530,7 @@ If you need to define a new theorem-like environment, you must first define the
\begin{itemize}
\item \lstinline|\NameTheorem[|\meta{language name}\lstinline|]{|\meta{name of environment}\lstinline|}{|\meta{name string}\lstinline|}|
\end{itemize}
+
For \meta{language name}, please refer to the section on language configuration. When \meta{language name} is not specified, the name will be set for all supported languages. In addition, environments with or without asterisk share the same name, therefore, \lstinline|\NameTheorem{envname*}{...}| has the same effect as \lstinline|\NameTheorem{envname}{...}| .
\medskip
diff --git a/macros/latex/contrib/colorist/colorist.sty b/macros/latex/contrib/colorist/colorist.sty
index ddc6055a05..354006dc4b 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/27 A colorful style for articles and books]
+ [2021/07/30 A colorful style for articles and books]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{%
@@ -29,10 +29,16 @@
\DeclareBoolOption[false]{puretext}
\DeclareBoolOption[false]{nothms}
\DeclareBoolOption[false]{nothmnum}
+\DeclareStringOption{thmnum}[colorist@thmnum@default]
+\DeclareBoolOption[true]{regionalref}
+\DeclareBoolOption[false]{originalref}
\DeclareBoolOption[false]{allowbf}
\DeclareBoolOption[false]{runin}
\ProcessKeyvalOptions*\relax
+\if@colorist@originalref
+ \@colorist@regionalreffalse
+\fi
\if@colorist@draft
\@colorist@fasttrue
\fi
@@ -40,6 +46,21 @@
\@colorist@nothmstrue
\fi
+\if@colorist@fast
+ \PassOptionsToPackage{fast}{PJLdraft}
+ \PassOptionsToPackage{fast}{PJLthm}
+\fi
+\expandafter\ifstrempty\expandafter{\@colorist@thmnum}{}{
+ \expandafter\ifstrequal\expandafter{\@colorist@thmnum}{colorist@thmnum@default}{
+ \PassOptionsToPackage{thmnum}{PJLthm}
+ }{
+ \PassOptionsToPackage{thmnum=\@colorist@thmnum}{PJLthm}
+ }
+}
+\if@colorist@regionalref\else
+ \PassOptionsToPackage{originalref}{PJLthm}
+\fi
+
\if@colorist@allowbf
\newcommand{\conditionalbfseries}{\bfseries\colorlet{PJLtempcolor}{.}\color{PJLtempcolor!90!paper}}
\else
@@ -728,12 +749,8 @@
\expandafter\def\csname definition-propositionnameRU\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{Определение}-\propositionnameRU}
\expandafter\def\csname definition-theoremnameRU\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{Определение}-\theoremnameRU}
+\AtEndPreamble{
\theoremstyle{basic}
-\ifbool{IsBook}{
- \newaliascnt{highest}{chapter}
-}{
- \newaliascnt{highest}{section}
-}
\if@colorist@nothms\else
\if@colorist@nothmnum
\CreateTheorem*{theorem}
@@ -746,7 +763,7 @@
\CreateTheorem*{fact}
\CreateTheorem*{conjecture}
\else
-\CreateTheorem{theorem}<highest>
+\CreateTheorem@thmnum{theorem}
\CreateTheorem{lemma}[theorem]
\CreateTheorem{proposition}[theorem]
\CreateTheorem{corollary}[theorem]
@@ -804,14 +821,13 @@
\CreateTheorem*{remark}
\CreateTheorem*{observation}
\else
-\CreateTheorem{remark}<highest>
-\CreateTheorem{observation}<highest>
+\CreateTheorem@thmnum{remark}
+\CreateTheorem@thmnum{observation}
\fi
\CreateTheorem*{remark*}
\CreateTheorem*{observation*}
\fi
-
-\numberwithin{equation}{highest}
+}
\creflabelformat{PJLtheorem}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLlemma}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
@@ -1287,27 +1303,35 @@
\tcolorboxenvironment{question}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{question*}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{exercise}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{exercise*}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{remark}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{remark*}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{observation}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{observation*}
{enhanced jigsaw,pad at break*=1mm,breakable,oversize,
+ top=0mm,bottom=0mm,
opacityframe=0,opacityback=0,lines before break=3}
\ExplSyntaxOn