summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/colorist/colorist-doc.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/colorist/colorist-doc.tex')
-rw-r--r--macros/latex/contrib/colorist/colorist-doc.tex127
1 files changed, 74 insertions, 53 deletions
diff --git a/macros/latex/contrib/colorist/colorist-doc.tex b/macros/latex/contrib/colorist/colorist-doc.tex
index 4f6c342273..a6b2ab9788 100644
--- a/macros/latex/contrib/colorist/colorist-doc.tex
+++ b/macros/latex/contrib/colorist/colorist-doc.tex
@@ -16,38 +16,66 @@
%% For typesetting code
%%================================
\usepackage{listings}
-\definecolor{maintheme}{RGB}{70,130,180}
-\definecolor{forestgreen}{RGB}{21,122,81}
-\definecolor{lightergray}{gray}{0.99}
-\lstset{language=[LaTeX]TeX,
- keywordstyle=\color{maintheme},
- basicstyle=\ttfamily,
- commentstyle=\color{forestgreen}\ttfamily,
- stringstyle=\rmfamily,
- showstringspaces=false,
- breaklines=true,
- frame=lines,
- backgroundcolor=\color{lightergray},
- flexiblecolumns=true,
- escapeinside={(*}{*)},
- % numbers=left,
- numberstyle=\scriptsize, stepnumber=1, numbersep=5pt,
- % firstnumber=last,
+\usepackage{xcolor}
+\usepackage{setspace}
+\definecolor{code-main}{RGB}{70,130,180}
+\definecolor{code-expl3}{RGB}{240,50,60}
+\definecolor{code-option}{RGB}{40,110,20}
+\definecolor{code-keys}{RGB}{100,130,150}
+\definecolor{code-comment}{RGB}{20,120,80}
+\definecolor{code-background}{gray}{0.99}
+\lstset{
+ language = [LaTeX]TeX,
+ basicstyle = \ttfamily,
+ keywordstyle = \color{code-main},
+ commentstyle = \color{code-comment},
+ showstringspaces = false,
+ breaklines = true,
+ frame = lines,
+ backgroundcolor = \color{code-background},
+ flexiblecolumns = true,
+ escapeinside = {(*}{*)},
+ alsoletter = {_,:},
+ % numbers = left,
+ % firstnumber = last,
+ numberstyle = \scriptsize\ttfamily,
+ stepnumber = 1,
+ numbersep = 5pt,
}
-\providecommand{\meta}[1]{$\langle${\normalfont\itshape#1}$\rangle$}
-\lstset{moretexcs=%
- {part,parttext,chapter,section,subsection,subsubsection,frontmatter,mainmatter,backmatter,tableofcontents,href,
- color,NameTheorem,CreateTheorem,cref,DNF,needgraph,UseLanguage,UseOtherLanguage,AddLanguageSetting,maketitle,address,curraddr,email,keywords,subjclass,thanks,dedicatory,TheDate,ProjLib,qedhere
- }
+\newcommand{\meta}[1]{$\langle${\normalfont\itshape#1}$\rangle$}
+\lstset{% LaTeX2 commands
+ classoffset = 0,
+ texcsstyle =* \color{code-main},
+ moretexcs =
+ {
+ linenumbers,nolinenumbers,
+ part,parttext,chapter,section,subsection,subsubsection,
+ frontmatter,mainmatter,backmatter,
+ tableofcontents,
+ href,
+ color,
+ NameTheorem,CreateTheorem,
+ cref,
+ ProjLib,
+ DNF,
+ UseLanguage,UseOtherLanguage,AddLanguageSetting,
+ maketitle,address,curraddr,email,keywords,subjclass,thanks,dedicatory,TheDate,
+ qedhere,
+ }
}
-\lstnewenvironment{code}%
-{\setstretch{1.07}%
-\setkeys{lst}{columns=fullflexible,keepspaces=true}%
-}{}
-\lstnewenvironment{code*}%
-{\setstretch{1.07}%
-\setkeys{lst}{numbers=left,columns=fullflexible,keepspaces=true}%
-}{}
+\lstset{% LaTeX3 commands
+ classoffset = 1,
+ texcsstyle =* \color{code-expl3},
+ moretexcs =
+ {
+ }
+}
+\lstnewenvironment{code}{\setstretch{1.05}}{\vspace{-.3\baselineskip}\vspace{-.5\parskip}}
+\lstnewenvironment{code*}{\setstretch{1.05}\lstset{numbers=left}}{\vspace{-.3\baselineskip}\vspace{-.5\parskip}}
+
+\newcommand{\classoption}[1]{\texttt{\textcolor{code-option}{#1}}}
+\newcommand{\packageoption}[1]{\texttt{\textcolor{code-option}{#1}}}
+\newcommand{\commandoption}[1]{\texttt{\textcolor{code-keys}{#1}}}
%%================================
%% tip
@@ -91,7 +119,7 @@
%%================================
\begin{document}
-\def\PackageVersion{2022/06/16}
+\def\PackageVersion{2022/09/03}
\title{{\normalfont\bfseries\color{main-text}\colorist{}}\\write your articles or books in a colorful way}
\author{Jinwen XU}
@@ -104,7 +132,7 @@
\begin{abstract}
\colorist{} is a series of styles and classes for you to typeset your articles or books in a colorful manner. The original intention in designing this series was to write drafts and notes that look colorful yet not dazzling. With the help of the \ProjLib{} toolkit, also developed by the author, the classes provided here have multi-language support, preset theorem-like environments with clever reference support, and many other functionalities. Notably, using these classes, one can organize the author information in the \AmS{} fashion, makes it easy to switch to journal classes later for publication.
- Finally, this documentation is typeset using the \colorart{} class (with the option \texttt{use boldface}). You can think of it as a short introduction and demonstration.
+ Finally, this documentation is typeset using the \colorart{} class (with the option \classoption{use boldface}). You can think of it as a short introduction and demonstration.
\end{abstract}
@@ -304,13 +332,6 @@ or to use the \AmS{} class:
\end{tip}
-\begin{tip}
-If you like the current document class, but want a more ``plain'' style, then you can use the option \texttt{classical}, like this:
-
-\begin{code}
-\documentclass[classical]{colorart}
-\end{code}
-\end{tip}
\vspace{1.5\baselineskip}
\LevelTwoTitle{Example - \colorbook}
@@ -362,13 +383,13 @@ In the next section, we will go through the options available.
\colorist{} offers the following options:
-\begin{itemize}
- \item The language options \texttt{EN} / \texttt{english} / \texttt{English}, \texttt{FR} / \texttt{french} / \texttt{French}, etc.
+\begin{itemize}[label=,leftmargin=1.25em,itemindent=-1.25em]
+ \item The language options \classoption{EN} / \classoption{english} / \classoption{English}, \classoption{FR} / \classoption{french} / \classoption{French}, etc.
\begin{itemize}
\item For the option names of a specific language, please refer to \meta{language name} in the next section. The first specified language will be used as the default language.
\item The language options are optional, mainly for increasing the compilation speed. Without them the result would be the same, only slower.
\end{itemize}
- \item \texttt{draft} or \texttt{fast}
+ \item \classoption{draft} or \classoption{fast}
\begin{itemize}
\item The option \verb|fast| enables a faster but slightly rougher style, main differences are:
\begin{itemize}
@@ -380,39 +401,39 @@ In the next section, we will go through the options available.
\begin{tip}
During the draft stage, it is recommended to use the \verb|fast| option to speed up compilation. When in \verb|fast| mode, there will be a watermark ``DRAFT'' to indicate that you are currently in the draft mode.
\end{tip}
- \item \texttt{use boldface}
+ \item \classoption{use boldface}
\begin{itemize}
\item Allow boldface. When this option is enabled, the main title, the titles of all levels and the names of theorem-like environments will be bolded.
\end{itemize}
- \item \texttt{runin}
+ \item \classoption{runin}
\begin{itemize}
\item Use the ``runin'' style for \lstinline|\subsubsection|
\end{itemize}
- \item \texttt{nothms}
+ \item \classoption{nothms}
\begin{itemize}
\item Pure text mode. Do not load theorem-like environments.
\end{itemize}
- \item \texttt{nothmnum}, \texttt{thmnum} or \texttt{thmnum=}\meta{counter}
+ \item \classoption{nothmnum}, \classoption{thmnum} or \classoption{thmnum=}\meta{counter}
\begin{itemize}
\item Theorem-like environments will not be numbered / numbered in order 1, 2, 3... / numbered within \meta{counter}. If no option is used, they will be numbered within \texttt{chapter} (book) or \texttt{section} (article).
\end{itemize}
- \item \texttt{regionalref}, \texttt{originalref}
+ \item \classoption{regionalref}, \classoption{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.
+ \item When referencing, whether the name of the theorem-like environment changes with the current language. The default is \classoption{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 \classoption{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 \classoption{fast} mode, the option \classoption{originalref} will have no effect.
\end{itemize}
\end{itemize}
Additionally, \colorart{} and \colorbook{} offers the following options:
-\begin{itemize}
- \item \texttt{a4paper} or \texttt{b5paper}
+\begin{itemize}[label=,leftmargin=1.25em,itemindent=-1.25em]
+ \item \classoption{a4paper} or \classoption{b5paper}
\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{noto}, \texttt{biolinum} ~$|$~ \texttt{useosf}
+ \item \classoption{palatino}, \classoption{times}, \classoption{garamond}, \classoption{noto}, \classoption{biolinum} ~$|$~ \classoption{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.
+ \item The \classoption{useosf} option is used to enable the old-style figures.
\end{itemize}
\end{itemize}