summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-09-26 03:02:59 +0000
committerNorbert Preining <norbert@preining.info>2024-09-26 03:02:59 +0000
commitfa060b9d7dc676b5066735b16477c21000084c3c (patch)
tree0c62361f5cd28589e5fcec4d07773e08018d17fa /macros/latex
parent224bec647afdf054bb090ee64640e2a736b6b4ed (diff)
CTAN sync 202409260302
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/commalists-tools/README.md6
-rw-r--r--macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.pdfbin0 -> 61757 bytes
-rw-r--r--macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.tex415
-rw-r--r--macros/latex/contrib/commalists-tools/tex/commalists-tools.sty188
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-cn.pdfbin190787 -> 189359 bytes
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-cn.tex18
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-demo.pdfbin57383 -> 56608 bytes
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-demo.tex68
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-en.pdfbin502959 -> 118137 bytes
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-en.tex24
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-hk.pdfbin208137 -> 200254 bytes
-rw-r--r--macros/latex/contrib/litetable/doc/litetable-hk.tex34
-rw-r--r--macros/latex/contrib/litetable/tex/litetable.cls519
-rw-r--r--macros/latex/contrib/randintlist/doc/randintlist-doc.pdfbin82179 -> 84893 bytes
-rw-r--r--macros/latex/contrib/randintlist/doc/randintlist-doc.tex40
-rw-r--r--macros/latex/contrib/randintlist/tex/randintlist.sty90
-rw-r--r--macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty6
-rw-r--r--macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty6
-rw-r--r--macros/latex/contrib/tutodoc/code/tutodoc.sty386
-rw-r--r--macros/latex/contrib/tutodoc/doc/tutodoc-en.pdfbin714026 -> 768956 bytes
-rw-r--r--macros/latex/contrib/tutodoc/doc/tutodoc-en.tex630
-rw-r--r--macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdfbin748835 -> 824856 bytes
-rw-r--r--macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex649
23 files changed, 2103 insertions, 976 deletions
diff --git a/macros/latex/contrib/commalists-tools/README.md b/macros/latex/contrib/commalists-tools/README.md
new file mode 100644
index 0000000000..2691841bce
--- /dev/null
+++ b/macros/latex/contrib/commalists-tools/README.md
@@ -0,0 +1,6 @@
+This package provides some macros for manipulating numeral comma separated lists.
+Available tools are adding, removing, counting, testing, reversing, sorting, etc
+---------------------------------------------------------------------------------
+Author..: Cédric Pierquet
+email...: cpierquet@outlook.fr
+Licence.: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt \ No newline at end of file
diff --git a/macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.pdf b/macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.pdf
new file mode 100644
index 0000000000..8720ca502e
--- /dev/null
+++ b/macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.tex b/macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.tex
new file mode 100644
index 0000000000..daab3e3183
--- /dev/null
+++ b/macros/latex/contrib/commalists-tools/doc/commalists-tools-doc.tex
@@ -0,0 +1,415 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+
+\documentclass[11pt,a4paper]{ltxdoc}
+\usepackage{bera}
+\usepackage{inconsolata}
+\usepackage[T1]{fontenc}
+\usepackage[scale=0.875]{cabin}
+\usepackage{commalists-tools}
+\usepackage{fancyvrb}
+\usepackage{fancyhdr}
+\usepackage{tabularray}
+\usepackage{fontawesome5}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\lfoot{\sffamily\small [commalists-tools]}
+\cfoot{\sffamily\small - \thepage{} -}
+\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
+\usepackage{hologo}
+\providecommand\tikzlogo{Ti\textit{k}Z}
+\providecommand\TeXLive{\TeX{}Live\xspace}
+\let\TikZ\tikzlogo
+
+\usepackage{hyperref}
+\urlstyle{same}
+\hypersetup{pdfborder=0 0 0}
+\usepackage[margin=2cm]{geometry}
+\setlength{\parindent}{0pt}
+\def\TPversion{0.1.0}
+\def\TPdate{25/09/2024}
+\usepackage{tcolorbox}
+\usepackage{pgffor}
+\tcbuselibrary{breakable,skins,hooks,listingsutf8}
+%\usepackage{soul}
+%\sethlcolor{lightgray!25}
+
+\lstset{
+ language=[LaTeX]TeX,%
+ basicstyle=\ttfamily,%
+ keywordstyle={\color{blue}},%
+ classoffset=0,%
+ keywords={},%
+ alsoletter={-},%
+ keywordstyle={\color{blue}},%
+ classoffset=1,%
+ alsoletter={-},%
+ morekeywords={commalists-tools},%
+ keywordstyle={\color{violet}},%
+ classoffset=2,%
+ alsoletter={-},%
+ morekeywords={\sortasclist,\sortdeslist,\addvalinlist,\removevalinlist,\boolvalinlist,\xintifvalinlist,\countvalinlist,\minoflist,\maxoflist,\meanoflist,\sumoflist,\prodoflist,\reverselist,\getvaluefromlist},%
+ keywordstyle={\color{green!50!black}},%
+ classoffset=3,%
+ morekeywords={},%
+ keywordstyle={\color{orange}}
+}
+
+\newtcblisting{DemoCode}[1]{%
+ enhanced,width=\linewidth,%
+ bicolor,size=title,%
+ colback=cyan!10!white,%
+ colbacklower=cyan!5!white,%
+ colframe=cyan!75!black,%
+ listing options={%
+ breaklines=true,%
+ breakatwhitespace=true,%
+ style=tcblatex,basicstyle=\small\ttfamily,%
+ tabsize=4,%
+ commentstyle={\itshape\color{gray}},
+ keywordstyle={\color{blue}},%
+ classoffset=0,%
+ keywords={\usepackage,\includegraphics,xstring,listofitems,\readlist,\showitems,\xintFor,\xintSeq},%
+ alsoletter={-},%
+ keywordstyle={\color{blue}},%
+ classoffset=1,%
+ alsoletter={-},%
+ morekeywords={euromoney},%
+ keywordstyle={\color{violet}},%
+ classoffset=2,%
+ alsoletter={-},%
+ morekeywords={\sortasclist,\sortdeslist,\addvalinlist,\removevalinlist,\boolvalinlist,\xintifvalinlist,\countvalinlist,\minoflist,\maxoflist,\meanoflist,\sumoflist,\prodoflist,\reverselist,\getvaluefromlist},%
+ keywordstyle={\color{green!50!black}},%
+ classoffset=3,%
+ morekeywords={},%
+ keywordstyle={\color{orange}}
+ },%
+ #1
+}
+
+\newtcbinputlisting\DemoCodeFile[1]{%
+ enhanced,width=\linewidth,%
+ bicolor,size=title,%
+ colback=lightgray!10!white,%
+ colbacklower=lightgray!5!white,%
+ colframe=lightgray!75!black,%
+ listing options={%
+ breaklines=true,%
+ breakatwhitespace=true,%
+ style=tcblatex,
+ basicstyle=\scriptsize\ttfamily,%
+ tabsize=4,%
+ commentstyle={\itshape\color{gray}},%
+ %lastline=148
+ },%
+ breakable,
+ listing only,%
+ listing file={#1}
+}
+
+\NewDocumentCommand\ShowCode{ m }{%
+ \lstinline{#1}%
+}
+
+\begin{document}
+
+\thispagestyle{empty}
+
+\begin{center}
+ \begin{minipage}{0.88\linewidth}
+ \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
+ \begin{center}
+ \renewcommand{\arraystretch}{1.25}%
+ \begin{tabular}{c}
+ {\Huge \texttt{commalists-tools}}\\
+ \\
+ {\LARGE Macros for manipulating numeral} \\
+ {\LARGE comma separated lists :} \\
+ {\LARGE sorting, adding, removing, etc} \\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+ \end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://github.com/cpierquet/commalists-tools}} \\
+ \end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
+\def\mytestlist{14,10,15,11,9,10}
+\minoflist*{\mytestlist}
+\maxoflist*{14,10,15,11,9,10}
+\sortasclist*{\mytestlist}
+\meanoflist*{\mytestlist}
+\removevalinlist*{10}{\mytestlist}
+\xintifvalinlist{15}{\mytestlist}{true}{false}
+\end{tcblisting}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+\def\mytestlist{14,10,15,11,9,10}
+We consider the list : \mytestlist\par\smallskip
+The minimum value is \minoflist*{\mytestlist} and the maximum is \maxoflist*{14,10,15,11,9,10}\par\smallskip
+Ascending sorted list is \sortasclist*{\mytestlist}\par\smallskip
+Meaning value of the list is \meanoflist*{\mytestlist}\par\smallskip
+If we remove the value 10, the the list is \removevalinlist*{10}{\mytestlist}\par\smallskip
+We test if 15 is in the list : \xintifvalinlist{15}{\mytestlist}{true}{false}
+\end{tcolorbox}
+
+\vfill~
+
+%\hrule
+%
+%\medskip
+
+%\emph{%
+% The \textsf{luarandom} package do the same things, but with the obligation to compile with \hologo{LuaLaTeX}.
+%}
+%
+%\medskip
+
+\hrule
+
+\vspace*{5mm}
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+%\hrule
+
+\pagebreak
+
+\section{Loading, useful packages}
+
+In order to load \texttt{randintlist}, simply use :
+
+\begin{DemoCode}{listing only}
+\usepackage{commalists-tools}
+\end{DemoCode}
+
+Loaded packages are \texttt{listofitems}, \texttt{xintexpr} and \texttt{xstring}.
+
+\smallskip
+
+The idea is to propose "reusage" of lists with \texttt{listofitems} or other commands, for example.
+
+\section{The Macros}
+
+\subsection{Global usage}
+
+Package \texttt{commalists-tools} supports (basic) manipulations on numeral comma separated lists :
+
+\begin{itemize}
+ \item sorting ;
+ \item adding values ;
+ \item removing values ;
+ \item counting values ;
+ \item mean, sum, product ;
+ \item etc
+\end{itemize}
+
+Starred versions only print the result, whereas non starred versions store the result into a macro.
+
+\medskip
+
+\hfill\textbf{All engines \TeX\ are compatible with this package.}\hfill~
+
+\subsection{The macros for calculing}
+
+\begin{DemoCode}{listing only}
+%getting min of list, only printing
+\minoflist*{list}
+%storing min of list into \macro (\resmin by default)
+\minoflist{list}[\macro]
+%getting max of list, only printing
+\maxoflist*{list}
+%storing max of list into \macro (\resmax by default)
+\maxoflist{list}[\macro]
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%only printing
+\minoflist*{14,10,15,11,9,10} and \maxoflist*{14,10,15,11,9,10} \\
+%storing min/max of list
+\def\mytestlist{10,14.5,20,12,8.5}
+\minoflist{\mytestlist}[\mymin]Min of list is \mymin\ \&
+\maxoflist{\mytestlist}[\mymax]Max of list is \mymax
+\end{DemoCode}
+
+\begin{DemoCode}{listing only}
+%getting mean of list, only printing
+\meanoflist*{list}
+%storing mean of list into \macro (\resmean by default)
+\meanoflist{list}[\macro]
+%getting sum of list, only printing
+\sumoflist*{list}
+%storing max of list into \macro (\ressum by default)
+\sumoflist{list}[\macro]
+%getting prod of list, only printing
+\prodoflist*{list}
+%storing max of list into \macro (\resprod by default)
+\prodoflist{list}[\macro]
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%only printing
+\meanoflist*{14,10,15,11,9,10} \\
+%storing
+\meanoflist{14,10,15,11,9,10}[\mymean]\mymean \\
+%only printing
+\sumoflist*{14,10,15,11,9,10} and \prodoflist*{14,10,15,11,9,10} \\
+%storing
+\sumoflist{14,10,15,11,9,10}[\mysum]\prodoflist{14,10,15,11,9,10}[\myprod]
+The sum is \mysum\ and the prod is \myprod
+\end{DemoCode}
+
+\subsection{Macros for manipulating}
+
+\begin{DemoCode}{listing only}
+%sorting (asc), only printing
+\sortasclist*{list}
+%sorting (asc) and storing (overwrite)
+\sortasclist{list}
+%sorting (des), only printing
+\sortdeslist*{list}
+%sorting (des) and storing (overwrite)
+\sortdeslist{list}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%sorting (asc), only printing
+\sortasclist*{14,10,15,11,9,10}\\
+%sorting (asc) and storing (overwrite)
+\def\tmpsortlist{14,10,15,11,9,10}
+\sortasclist{\tmpsortlist}\tmpsortlist\\
+%analysing
+\readlist*\tmpSORTlist{\tmpsortlist}
+\showitems{\tmpSORTlist}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%sorting (des), only printing
+\sortdeslist*{14,10,15,11,9,10}\\
+%sorting (asc) and storing (overwrite)
+\def\tmpsortlist{14,10,15,11,9,10}
+\sortdeslist{\tmpsortlist}\tmpsortlist\\
+%analysing
+\readlist*\tmpSORTlist{\tmpsortlist}
+\showitems{\tmpSORTlist}
+\end{DemoCode}
+
+\begin{DemoCode}{listing only}
+%adding, only printing
+\addvalinlist*{values}{list}
+%adding and storing (overwrite)
+\addvalinlist{values}{list}
+%removing, only printing
+\removevalinlist*{value}{list}
+%removing and storing (overwrite)
+\removevalinlist{value}{list}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%only printing
+\addvalinlist*{3}{1,2,5,6}\\
+%defining and adding
+\def\tmpaddlist{1,2,4,5,6}
+\addvalinlist{3}{\tmpaddlist}\tmpaddlist\\
+%analysing
+\readlist*\tmpADDlist{\tmpaddlist}
+\showitems{\tmpADDlist}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%only printing
+\removevalinlist*{3}{1,2,3,6,3,1,5,7,3}\\
+%defining and removing
+\def\tmpremlist{1,2,3,6,3,1,5,7,3}
+\removevalinlist{3}{\tmpremlist}\tmpremlist\\
+%analysing
+\readlist*\tmpREMlist{\tmpremlist}
+\showitems{\tmpREMlist}
+\end{DemoCode}
+
+\begin{DemoCode}{listing only}
+%reversing, only printing
+\reverselist*{list}
+%reversing and storing (overwrite)
+\reverselist{list}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%only printing
+\reverselist*{14,10,15,11,9,10}\\
+%reversing and storing
+%storing
+\reverselist{14,10,15,11,9,10}[\myreverse]\myreverse\\
+%analysing
+\readlist*\tmpREVERSElist{\myreverse}
+\showitems{\tmpREVERSElist}
+\end{DemoCode}
+
+\subsection{Macros with testing}
+
+\begin{DemoCode}{listing only}
+%testing if value is in list, with boolean result in \macro (\resisinlist by default)
+\boolvalinlist{value}{list}[\macro]
+%conditionnal test if value is in list, according to xint syntax
+\xintifvalinlist{3}{0,1,2,3}{true}{false}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%test with xint syntax
+\xintifvalinlist{-1}{0,1,2,3}{true}{false}\\
+%test with xint syntax
+\xintifvalinlist{3}{0,1,2,3}{true}{false}\\
+%boolean macro
+\def\myteslist{0,5,10,5,6,9,7,8}
+\boolvalinlist{5}{\myteslist}[\resisinlist]\resisinlist
+\end{DemoCode}
+
+\begin{DemoCode}{listing only}
+%counting value, only printing
+\countvalinlist*{value}{list}
+%counting value, with result in \macro (\rescount by default)
+\countvalinlist{value}{list}[\macro]
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%only printing
+\countvalinlist*{8}{1,2,3,4,5,6,6,7,8,8,8,9}\\
+%storing
+\def\tmpcountlist{1,2,3,4,5,6,6,7,8,8,8,9}
+\countvalinlist{6}{\tmpcountlist}[\rescountsix]\rescountsix\\
+\countvalinlist{10}{\tmpcountlist}[\rescountten]\rescountten
+\end{DemoCode}
+
+\pagebreak
+
+\section{History}
+
+\texttt{0.1.0 : Initial version}
+
+\section{The code}
+
+\DemoCodeFile{commalists-tools.sty}
+
+\end{document}
diff --git a/macros/latex/contrib/commalists-tools/tex/commalists-tools.sty b/macros/latex/contrib/commalists-tools/tex/commalists-tools.sty
new file mode 100644
index 0000000000..7809c82721
--- /dev/null
+++ b/macros/latex/contrib/commalists-tools/tex/commalists-tools.sty
@@ -0,0 +1,188 @@
+% Author : C. Pierquet
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{commalists-tools}[2024/09/25 0.1.0 Basic operations for numeral comma separated lists]
+
+%------History
+% 0.1.0 Initial version
+
+%------Packages
+\RequirePackage{listofitems}
+\RequirePackage{xintexpr}
+\RequirePackage{xstring}
+
+%-----Macros (LaTeX3...) for sorting
+\ExplSyntaxOn
+\NewDocumentCommand\sortasclist{ s m }
+{
+ \clist_set:Nx \l_foo_clist {#2}
+ \clist_sort:Nn \l_foo_clist{
+ \int_compare:nNnTF { ##1 } > { ##2 }
+ { \sort_return_swapped: }
+ { \sort_return_same: }
+ }
+ \IfBooleanTF{#1}%if star := just printing // if not, storing
+ {%
+ {\l_foo_clist}%
+ }%
+ {%
+ \xdef#2{\l_foo_clist}%
+ }%
+}
+
+\NewDocumentCommand\sortdeslist{ s m }
+{
+ \clist_set:Nx \l_foo_clist {#2}
+ \clist_sort:Nn \l_foo_clist{
+ \int_compare:nNnTF { ##1 } < { ##2 }
+ { \sort_return_swapped: }
+ { \sort_return_same: }
+ }
+ \IfBooleanTF{#1}%if star := just printing // if not, storing
+ {%
+ {\l_foo_clist}%
+ }%
+ {%
+ \xdef#2{\l_foo_clist}%
+ }%
+}
+\ExplSyntaxOff
+
+%----Macros (LaTeX2)
+\NewDocumentCommand\addvalinlist{ s m m }{%
+ \IfBooleanTF{#1}%if star := just printing // if not, storing
+ {%
+ #3,#2%
+ }%
+ {%
+ \xdef#3{#3,#2}%
+ }%
+}
+
+\NewDocumentCommand\removevalinlist{ s m m }{%
+ \readlist*\tmplistread{#3}%
+ \xdef\tmpresremovelist{}%
+ \xintFor* ##1 in {\xintSeq{1}{\tmplistreadlen}}\do{%
+ \xintifboolexpr{ \tmplistread[##1] == #2}%
+ {}%
+ {%
+ \xintifboolexpr{ ##1 == 1 }%
+ {%
+ \xdef\tmpresremovelist{\tmplistread[##1]}%
+ }%
+ {%
+ \xdef\tmpresremovelist{\tmpresremovelist,\tmplistread[##1]}%
+ }%
+ }%
+ }%
+ \IfBooleanTF{#1}%if star := just printing // if not, storing
+ {%
+ \tmpresremovelist%
+ }%
+ {%
+ \xdef#3{\tmpresremovelist}%
+ }%
+}
+
+\NewDocumentCommand\boolvalinlist{ m m O{\resisinlist} }{%
+ \IfSubStr{,#2,}{,#1,}{\def#3{1}}{\def#3{0}}%
+}
+
+\NewDocumentCommand\xintifvalinlist{ m m m m }{%
+ \IfSubStr{,#2,}{,#1,}{\xdef\RESTMPVALUE{1}}{\xdef\RESTMPVALUE{0}}%
+ \xintifboolexpr{ \RESTMPVALUE == 1}{#3}{#4}%
+}
+
+\NewDocumentCommand\countvalinlist{ s m m O{\rescount} }{%
+ \readlist*\tmplistread{#3}%
+ \xdef#4{0}%
+ \xintFor* ##1 in {\xintSeq{1}{\tmplistreadlen}}\do{%
+ \xintifboolexpr{ \tmplistread[##1] == #2}%
+ {%
+ \xdef#4{\fpeval{#4+1}}%
+ }%
+ {}%
+ }%
+ \IfBooleanT{#1}%if star := just printing // if not, storing
+ {%
+ #4%
+ }%
+}
+
+\NewDocumentCommand\minoflist{ s m O{\resmin} }{%
+ \IfBooleanTF{#1}%
+ {%
+ \fpeval{min(#2)}%
+ }%
+ {%
+ \xdef#3{\fpeval{min(#2)}}%
+ }%
+}
+
+\NewDocumentCommand\maxoflist{ s m O{\resmax} }{%
+ \IfBooleanTF{#1}%
+ {%
+ \fpeval{max(#2)}%
+ }%
+ {%
+ \xdef#3{\fpeval{max(#2)}}%
+ }%
+}
+
+\NewDocumentCommand\meanoflist{ s m O{\resmean} }{%
+ \xdef#3{0}%
+ \readlist*\tmpmeanlist{#2}%
+ \xintFor* ##1 in {\xintSeq{1}{\tmpmeanlistlen}}\do{%
+ \xdef#3{\fpeval{#3+\tmpmeanlist[##1]}}%
+ }%
+ \xdef#3{\fpeval{(#3)/\tmpmeanlistlen}}%
+ \IfBooleanT{#1}%if star := just printing // if not, storing
+ {%
+ #3%
+ }%
+}
+
+\NewDocumentCommand\sumoflist{ s m O{\ressum} }{%
+ \xdef#3{0}%
+ \readlist*\tmpsumlist{#2}%
+ \xintFor* ##1 in {\xintSeq{1}{\tmpsumlistlen}}\do{%
+ \xdef#3{\fpeval{#3+\tmpsumlist[##1]}}%
+ }%
+ \IfBooleanT{#1}%if star := just printing // if not, storing
+ {%
+ #3%
+ }%
+}
+
+\NewDocumentCommand\prodoflist{ s m O{\resprod} }{%
+ \xdef#3{1}%
+ \readlist*\tmpprodlist{#2}%
+ \xintFor* ##1 in {\xintSeq{1}{\tmpprodlistlen}}\do{%
+ \xdef#3{\fpeval{(#3)*\tmpprodlist[##1]}}%
+ }%
+ \IfBooleanT{#1}%if star := just printing // if not, storing
+ {%
+ #3%
+ }%
+}
+
+\NewDocumentCommand\reverselist{ s m O{\resrevlist} }{%
+ \readlist*\tmpreverselist{#2}%
+ \xdef#3{\tmpreverselist[-1]}%
+ \xintFor* ##1 in {\xintSeq{2}{\tmpreverselistlen}}\do{%
+ \xdef#3{#3,\tmpreverselist[-##1]}%
+ }%
+ \IfBooleanT{#1}%if star := just printing // if not, storing
+ {%
+ #3%
+ }%
+}
+
+\NewDocumentCommand\getvaluefromlist{ s m m O{\resmyelt} }{%
+ \readlist*\tmpreadlist{#2}%
+ \xdef#4{\tmpreadlist[#3]}%
+ \IfBooleanT{#1}{#4}%
+}
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/litetable/doc/litetable-cn.pdf b/macros/latex/contrib/litetable/doc/litetable-cn.pdf
index f4a6fbad83..44673f1a19 100644
--- a/macros/latex/contrib/litetable/doc/litetable-cn.pdf
+++ b/macros/latex/contrib/litetable/doc/litetable-cn.pdf
Binary files differ
diff --git a/macros/latex/contrib/litetable/doc/litetable-cn.tex b/macros/latex/contrib/litetable/doc/litetable-cn.tex
index e5974b21f7..0ae4001a44 100644
--- a/macros/latex/contrib/litetable/doc/litetable-cn.tex
+++ b/macros/latex/contrib/litetable/doc/litetable-cn.tex
@@ -20,7 +20,7 @@
\affil{\href{mailto:xiamyphys@gmail.com}{xiamyphys@gmail.com}}
-\date{Version 3.0a, \today}
+\date{Version 3.0B, \today}
\begin{document}
@@ -74,13 +74,14 @@
\cs{timelist}\oarg{rows}\marg{time list}
\end{example}
-此命令有两个参数,第一个可选参数 \oarg{\#1} 可直接决定课程表的行数,第二个强制参数 \marg{\#2} 可在课程表的左侧添加时间列表. 输入列表格式如下:开始时间与结束时间之间用短线 (-) 分隔,并用逗号 (,) 在时间组之间分隔. 例如
+此命令有两个参数,第一个可选参数 \oarg{\#1} 可直接决定课程表的行数,第二个强制参数 \marg{\#2} 可在课程表的左侧添加时间列表. 输入数组的用例如下
\begin{Verbatim}
- \timelist[13]{%
- 08:05 - 08:50, 08:55 - 09:40, 10:00 - 10:45, 10:50 - 11:35,
- 11:40 - 12:25, 13:30 - 14:15, 14:20 - 15:05, 15:15 - 16:00,
- 16:05 - 16:50, 18:30 - 19:15, 19:20 - 20:05, 20:10 - 20:55,
+ \timelist[13]{
+ 08:05 -> 08:50, 08:55 -> 09:40, 10:00 -> 10:45,
+ 10:50 -> 11:35, 11:40 -> 12:25, 13:30 -> 14:15,
+ 14:20 -> 15:05, 15:15 -> 16:00, 16:05 -> 16:50,
+ 18:30 -> 19:15, 19:20 -> 20:05, 20:10 -> 20:55
}
\end{Verbatim}
@@ -119,10 +120,7 @@
此命令有两个参数. 第一个可选参数可决定默认的星期数并会在每个课程块的右下角显示,第二个强制参数可在课程表的顶部添加对应宽度比例的工作日. 输入列表的第一行为工作日格式,第二行为对应的宽度比例,两行之间用分号 (;) 分隔. 例如
\begin{Verbatim}
- \weeklist[Weeks 1 - 16]{%
- \scshape Mon, \scshape Tue, \scshape Wed,
- \scshape Thu, \scshape Fri; 4,5,4,6,5
- }
+ \weeklist[Weeks 1 - 16]{Mon -> 4, Tue -> 5, Wed -> 4, Thu -> 6, Fri -> 5}
\end{Verbatim}
\begin{figure}[!ht]
diff --git a/macros/latex/contrib/litetable/doc/litetable-demo.pdf b/macros/latex/contrib/litetable/doc/litetable-demo.pdf
index 19a726cd7c..7b58f47b83 100644
--- a/macros/latex/contrib/litetable/doc/litetable-demo.pdf
+++ b/macros/latex/contrib/litetable/doc/litetable-demo.pdf
Binary files differ
diff --git a/macros/latex/contrib/litetable/doc/litetable-demo.tex b/macros/latex/contrib/litetable/doc/litetable-demo.tex
index e26d5455ea..bbe750acb8 100644
--- a/macros/latex/contrib/litetable/doc/litetable-demo.tex
+++ b/macros/latex/contrib/litetable/doc/litetable-demo.tex
@@ -1,50 +1,70 @@
-\documentclass[letterpaper]{litetable}
+\documentclass[letterpaper, svgnames]{litetable}
\usepackage{twemojis,newtxtext}
\usepackage[scaled = .9]{helvet}
\renewcommand*\familydefault{\sfdefault}
-
-\timelist[13]{%
- 08:05 - 08:50, 08:55 - 09:40, 10:00 - 10:45, 10:50 - 11:35, 11:40 - 12:25,% morning
- 13:30 - 14:15, 14:20 - 15:05, 15:15 - 16:00, 16:05 - 16:50,% afternoon
- 18:30 - 19:15, 19:20 - 20:05, 20:10 - 20:55,% evening
+\timelist [ 13 ]
+{
+ 08:05 -> 08:50, 08:55 -> 09:40, 10:00 -> 10:45,
+ 10:50 -> 11:35, 11:40 -> 12:25, 13:30 -> 14:15,
+ 14:20 -> 15:05, 15:15 -> 16:00, 16:05 -> 16:50,
+ 18:30 -> 19:15, 19:20 -> 20:05, 20:10 -> 20:55
}
-\weeklist[Weeks 1 - 16]{%
- \scshape\texttwemoji{1f312}~Mon, \scshape\texttwemoji{1f525}~Tue,
- \scshape\texttwemoji{1f30a}~Wed, \scshape\texttwemoji{1f332}~Thu,
- \scshape\texttwemoji{1fa99}~Fri; 1,1,1,1,1
+\weeklist [ Weeks 1 - 16 ]
+{
+ \texttwemoji{1f312}\scshape~Mon -> 1,
+ \texttwemoji{1f525}\scshape~Tue -> 1,
+ \texttwemoji{1f30a}\scshape~Wed -> 1,
+ \texttwemoji{1f332}\scshape~Thu -> 1,
+ \texttwemoji{1fa99}\scshape~Fri -> 1
}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
- \maketable{Skyrmion's Timetable}[SEM 7]
+ \maketable [SEM 6] {Skyrmion's Timetable}
\newday
- \course [subject = {xia-my@ctan}] {4} {4}
- \course [color = DarkBlue, subject = interface3, teacher = The {\LaTeX} Project] {7} {9}
+ \course [ subject = {xia-my@ctan}] {4} {4}
+ \course [ color = DarkBlue, subject = interface3,
+ teacher = The {\LaTeX} Project
+ ] {7} {9}
\newday
- \course [color = FireBrick, subject = usrguide, teacher = {\LaTeX} Project Team, weeks = Weeks 7 - 14] {1} {2}
+ \course [ color = FireBrick, subject = usrguide,
+ teacher = {\LaTeX} Project Team,
+ weeks = Weeks 7 - 14
+ ] {1} {2}
\newday
- \course [subject = Keep on {\TeX}ing] {7} {8}
- \course [color = DarkGreen, subject = listofitems, location = French, teacher = Christian Tellechea] {10} {12}
+ \course [ color = DarkSlateGray,
+ subject = Keep on {\TeX}ing
+ ] {7} {8}
+ \course [ color = DarkGreen, subject = listofitems,
+ location = French, teacher = Christian Tellechea
+ ] {10} {12}
\newday
- \course [color = Crimson, subject = Ti\textit{k\/}Z\\library: calc, teacher = The PGF/Ti\textit{k\/}Z Team] {3} {5}
+ \course [ color = Crimson,
+ subject = Ti\textit{k\/}Z\\library: calc,
+ teacher = The PGF/Ti\textit{k\/}Z Team
+ ] {3} {5}
\newday
- \course [color = DarkViolet, subject = xcolor, weeks = Week 1 - 16, location = Germany, teacher = Dr. Uwe Kern] {8} {8}
- \more {School Starts: 06 / 09 / 2024\quad Summer Vacation: 26 / 01 / 2025}
+ \course [ color = DarkViolet, subject = xcolor,
+ weeks = Week 1 - 16, location = Germany,
+ teacher = Dr. Uwe Kern
+ ] {8} {8}
+ \more {School Starts: 06 / 09 / 2024\quad
+ Summer Vacation: 26 / 01 / 2025
+ }
\end{tikzpicture}
\clearpage
\timelist[12]{}
-\weeklist{%
- \scshape\texttwemoji{1f312}~Mon, \scshape\texttwemoji{1f525}~Tue,
- \scshape\texttwemoji{1f30a}~Wed, \scshape\texttwemoji{1f332}~Thu,
- \scshape\texttwemoji{1fa99}~Fri; 1,1,1,1,1
+\weeklist[Weeks 1 - 16]
+{
+ Mon -> 1, Tue -> 1, Wed -> 1, Thu -> 1, Fri -> 1
}
\begin{tikzpicture}[remember picture, overlay]
- \maketable{Skyrmion's Timetable}[SEM 8]
+ \maketable [SEM 7] {Skyrmion's Timetable}
\end{tikzpicture}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/litetable/doc/litetable-en.pdf b/macros/latex/contrib/litetable/doc/litetable-en.pdf
index 996bbd3750..201030c03a 100644
--- a/macros/latex/contrib/litetable/doc/litetable-en.pdf
+++ b/macros/latex/contrib/litetable/doc/litetable-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/litetable/doc/litetable-en.tex b/macros/latex/contrib/litetable/doc/litetable-en.tex
index 6345b74a78..ea1ff8b28e 100644
--- a/macros/latex/contrib/litetable/doc/litetable-en.tex
+++ b/macros/latex/contrib/litetable/doc/litetable-en.tex
@@ -20,7 +20,7 @@
\affil{\href{mailto:xiamyphys@gmail.com}{xiamyphys@gmail.com}}
-\date{Version 3.0a, \today}
+\date{Version 3.0B, \today}
\begin{document}
@@ -58,7 +58,7 @@ The following commands need the \cmd{tikzpicture} environment with \cmd{remember
\cs{maketable}\oarg{semester}\marg{title}
\end{example}
-This command has two arguments that can create an empty timetable frame. The first optional argument can add the semester block at the northeast corner of the page, the second mandatory argument can assign the title.
+This command has two arguments that can create an empty timetable frame. The first optional argument can add the semester block at the northeast corner of the page, and the second mandatory argument can assign the title.
\subsubsection{The \cs{more} command}
@@ -74,13 +74,14 @@ This command can add a comment at the southwest corner of the page.
\cs{timelist}\oarg{rows}\marg{time list}
\end{example}
-This command has two arguments, the first optional argument \oarg{\#1} can directly assign the number of rows on the timetable, and the second mandatory argument \marg{\#2} can add time to the left side of the timetable. Format for inputting array is the following: separate the start time and the end time with a dash (-) and separate the time groups with a comma (,). For example
+This command has two arguments, the first optional argument \oarg{\#1} can directly assign the number of rows on the timetable, and the second mandatory argument \marg{\#2} can add time to the left side of the timetable. The following example is the format for inputting array
\begin{Verbatim}
- \timelist[13]{%
- 08:05 - 08:50, 08:55 - 09:40, 10:00 - 10:45, 10:50 - 11:35,
- 11:40 - 12:25, 13:30 - 14:15, 14:20 - 15:05, 15:15 - 16:00,
- 16:05 - 16:50, 18:30 - 19:15, 19:20 - 20:05, 20:10 - 20:55,
+ \timelist[13]{
+ 08:05 -> 08:50, 08:55 -> 09:40, 10:00 -> 10:45,
+ 10:50 -> 11:35, 11:40 -> 12:25, 13:30 -> 14:15,
+ 14:20 -> 15:05, 15:15 -> 16:00, 16:05 -> 16:50,
+ 18:30 -> 19:15, 19:20 -> 20:05, 20:10 -> 20:55
}
\end{Verbatim}
@@ -107,7 +108,7 @@ For different usage scenarios of the two arguments, \cls{litetable} will generat
\begin{itemize}
\item If the mandatory argument \marg{\#2} receives $X$ sets of time, and the optional argument \oarg{\#1} receives a value of $X+a$, then only lines $1\sim X$ on the left side of the timetable display the time, while the other lines do not display the time.
- \item If the mandatory argument \marg{\#2} receives $X+a$ sets of time, and the optional \oarg{\#1} receives a value of $X$, then there will generate a timetable with only $X$ rows with extra time sets ignored, and it will return a warning.
+ \item If the mandatory argument \marg{\#2} receives $X+a$ sets of time, and the optional \oarg{\#1} receives a value of $X$, then the extra time sets ignored, and it will return a warning.
\end{itemize}
\subsubsection{The \cs{weeklist} command}
@@ -116,13 +117,10 @@ For different usage scenarios of the two arguments, \cls{litetable} will generat
\cs{weeklist}\oarg{default weeks}\marg{week list}
\end{example}
-This command has two arguments. The first optional argument can determine the default number of weeks and print at every course block's southeast corner. The second mandatory argument can add workdays with corresponding width ratios at the top of the timetable. The first line of the input array is the formats of the working days, and the second line is the corresponding width ratio. Two lines are separated by a semicolon (;). For example
+This command has two arguments. The first optional argument can determine the default number of weeks and print at every course block's southeast corner. The second mandatory argument can add workdays with corresponding width ratios at the top of the timetable. The following example is the format for inputting array
\begin{Verbatim}
- \weeklist[Weeks 1 - 16]{%
- \scshape Mon, \scshape Tue, \scshape Wed,
- \scshape Thu, \scshape Fri; 4,5,4,6,5
- }
+ \weeklist[Weeks 1 - 16]{Mon -> 4, Tue -> 5, Wed -> 4, Thu -> 6, Fri -> 5}
\end{Verbatim}
\begin{figure}[!ht]
diff --git a/macros/latex/contrib/litetable/doc/litetable-hk.pdf b/macros/latex/contrib/litetable/doc/litetable-hk.pdf
index 3d318b82ca..747410fdb4 100644
--- a/macros/latex/contrib/litetable/doc/litetable-hk.pdf
+++ b/macros/latex/contrib/litetable/doc/litetable-hk.pdf
Binary files differ
diff --git a/macros/latex/contrib/litetable/doc/litetable-hk.tex b/macros/latex/contrib/litetable/doc/litetable-hk.tex
index ebb2bee438..8715b4ef51 100644
--- a/macros/latex/contrib/litetable/doc/litetable-hk.tex
+++ b/macros/latex/contrib/litetable/doc/litetable-hk.tex
@@ -20,21 +20,21 @@
\affil{\href{mailto:xiamyphys@gmail.com}{xiamyphys@gmail.com}}
-\date{Version 3.0a, \today}
+\date{Version 3.0B, \today}
\begin{document}
\maketitle
\begin{abstract}
- 本文檔系 \cls{litetable} 文檔类嘅用戶手冊放. 應該文檔類提供咗個多彩嘅課程表設計. 歡迎通過郵件 \href{mailto:xiamyphys@gmail.com}{xiamyphys@gmail.com} 或者 \href{https://github.com/xiamyphys/litetable/issues}{GitHub} 建議或者反饋bug. 本手冊提供英語、中文和\textbf{粵語}版本.
+ 本文檔系 \cls{litetable} 文檔類嘅用户手冊放. 應該文檔類提供咗個多彩嘅課程表設計. 歡迎通過郵件 \href{mailto:xiamyphys@gmail.com}{xiamyphys@gmail.com} 或者 \href{https://github.com/xiamyphys/litetable/issues}{GitHub} 建議或者反饋bug. 本手冊提供英語、中文和\textbf{粵語}版本.
\end{abstract}
\section{介紹}
\subsection{所使宏包}
-應該文檔類基於 \cls{article} 文檔类. 要 \pkg{expl3},\pkg{xparse},\pkg{tikz},\pkg{listofitems} 同 \pkg{xcolor} 宏包.
+應該文檔類基於 \cls{article} 文檔類. 要 \pkg{expl3},\pkg{xparse},\pkg{tikz},\pkg{listofitems} 同 \pkg{xcolor} 宏包.
\subsection{相容性}
@@ -55,10 +55,10 @@
\subsubsection{命令:\cs{maketable}}
\begin{example}
- \cs{maketable}\oarg{semester}\marg{title}
+ \cs{maketable}\marg{title}\oarg{semester}
\end{example}
-此命令有兩個參數,可建置一個空白嘅課程表框架. 第一個可選參數可喺頁面嘅嘅右度角添加學期塊,第二個強制參數可指定標題.
+此命令有兩個參數,可建置一個空白嘅課程表框架. 第一個可選參數可喺頁面嘅嘅右度角添加學期,第二個強制參數可指定標題.
\subsubsection{命令:\cs{more}}
@@ -74,17 +74,18 @@
\cs{timelist}\oarg{rows}\marg{time list}
\end{example}
-此命令有兩個參數,第一個可選參數可直接決定課程表嘅行數,第二個強制参数可喺課程表嘅左側添加時間表. 輸入表格式如下:開始時間同結束時間之間用短線 (-) 分隔,並用逗號 (,) 系咪喺時間組之間分隔. 例如
+此命令有兩個參數,第一個可選參數可直接決定課程表嘅行數,第二個強制參數可喺課程表嘅左側添加時間表. 輸入數組嘅用例如下
\begin{Verbatim}
- \timelist[13]{%
- 08:05 - 08:50, 08:55 - 09:40, 10:00 - 10:45, 10:50 - 11:35,
- 11:40 - 12:25, 13:30 - 14:15, 14:20 - 15:05, 15:15 - 16:00,
- 16:05 - 16:50, 18:30 - 19:15, 19:20 - 20:05, 20:10 - 20:55,
+ \timelist[13]{
+ 08:05 -> 08:50, 08:55 -> 09:40, 10:00 -> 10:45,
+ 10:50 -> 11:35, 11:40 -> 12:25, 13:30 -> 14:15,
+ 14:20 -> 15:05, 15:15 -> 16:00, 16:05 -> 16:50,
+ 18:30 -> 19:15, 19:20 -> 20:05, 20:10 -> 20:55
}
\end{Verbatim}
-对于两个参数唔同使用情况,\cls{litetable} 会以如下规则建置对应行数嘅课程表框架.
+對於兩個參數唔同使用情況,\cls{litetable} 會以如下規則建置對應行數嘅課程表框架.
\begin{table}[htbp]
\centering
@@ -106,8 +107,8 @@
\end{table}
\begin{itemize}
- \item 若强制参数 \marg{\#2} 接受咗$X$组时间,可选参数 \oarg{\#1} 接受嘅值为$X+a$,就课程表嘅左侧得$1 \sim X$行会显示时间,后面几行唔显示时间.
- \item 若强制参数 \marg{\#2} 接受咗$X+a$组时间,可选参数 \oarg{\#1} 接收嘅值为$X$, 就课程表嘅左侧得$X$行嘅課程表,多餘嘅時間組將畀忽略,並返回一個警告.
+ \item 若強制參數 \marg{\#2} 接受咗$X$組時間,可選參數 \oarg{\#1} 接受嘅值為$X+a$,就課程表嘅左側得$1 \sim X$行會顯示時間,後面幾行唔顯示時間.
+ \item 若強制參數 \marg{\#2} 接受咗$X+a$組時間,可選參數 \oarg{\#1} 接收嘅值為$X$, 就課程表嘅左側得$X$行嘅課程表,多餘嘅時間組將畀忽略,並返回一個警告.
\end{itemize}
\subsubsection{命令:\cs{weeklist}}
@@ -116,13 +117,10 @@
\cs{weeklist}\oarg{default weeks}\marg{week list}
\end{example}
-此命令有两个参数. 第一个可选参数可决定预设嘅星期数并会喺每课程塊嘅嘅右下角显示,第二个强制参数可喺课程表嘅顶部添加对应宽度比例嘅工作日. 输入表嘅第一行为工作日格式,第二行为对应嘅宽度比例,两得之间用分号 (;) 分隔. 例如
+此命令有兩個參數. 第一個可選參數可決定預設嘅星期數並會喺每課程塊嘅嘅右下角顯示,第二個強制參數可喺課程表嘅頂部添加對應寬度比例嘅工作日. 輸入數組嘅用例如下
\begin{Verbatim}
- \weeklist[Weeks 1 - 16]{%
- \scshape Mon, \scshape Tue, \scshape Wed,
- \scshape Thu, \scshape Fri; 4,5,4,6,5
- }
+ \weeklist[Weeks 1 - 16]{Mon -> 4, Tue -> 5, Wed -> 4, Thu -> 6, Fri -> 5}
\end{Verbatim}
\begin{figure}[!ht]
diff --git a/macros/latex/contrib/litetable/tex/litetable.cls b/macros/latex/contrib/litetable/tex/litetable.cls
index 22fffd3f7c..a87d3cb9bd 100644
--- a/macros/latex/contrib/litetable/tex/litetable.cls
+++ b/macros/latex/contrib/litetable/tex/litetable.cls
@@ -17,349 +17,404 @@
%% and README.md. *
%% available at https://github.com/xiamyphys/litetable *
%% ***********************************************************
-% !Mode:: "TeX:UTF-8"
-\ProvidesExplClass {litetable} {2024/09/22} {3.0a} {Colorful timetable class}
+\ProvidesExplClass{litetable}{2024/09/25}{3.0B}{Course Schedule}
\ExplSyntaxOff
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\LoadClass{article}
-
-\RequirePackage[svgnames]{xcolor}
-\definecolor{darkergray}{HTML}{F1F3F5}% Blocks
-\definecolor{lightergray}{HTML}{FCFDFE}% Pagecolor
-\pagecolor{lightergray}
-
-\RequirePackage{tikz}
-\tikzset{%
- every picture/.append style = { line join = round, line cap = round }
-}
+\pagestyle{empty}
+\RequirePackage{listofitems,tikz,xcolor}
+\ignoreemptyitems\setsepchar{,/->}
\usetikzlibrary{calc}
-
-\RequirePackage{listofitems}
-\ignoreemptyitems
+\definecolor{darkergray}{HTML}{F4F6F8}% Blocks
\ExplSyntaxOn
-\int_new:N \l_course_num_int
-\dim_new:N \l_course_vunit_dim
-\NewDocumentCommand{\timelist}{om}{%
- \setsepchar{,/-}
- \IfBlankTF{#2}{%
- \int_set:Nn \l_course_num_int { #1 }
+\int_new:N \l_time_num_int
+\dim_new:N \l__time_vunit_dim
+\msg_new:nnn {litetable} {timelist}
+{\noexpand\timelist~extra~time~group(s)~were~ignored}
+\NewDocumentCommand{\timelist}{om}
+{
+ \IfBlankTF{#2}
+ {
+ \int_set:Nn \l_time_num_int { #1 }
\tl_clear:N \@timelist
- }{%
+ }{
\readlist*\@timelist{#2}
- \IfNoValueTF{#1}{%
- \int_set:Nn \l_course_num_int { \@timelistlen }
- }{%
- \int_set:Nn \l_course_num_int { #1 }
- \int_compare:nNnT {\@timelistlen} > {#1} {%
- \msg_new:nnn {litetable} {timelist}
- {\noexpand\timelist~extra~time~group(s)~were~ignored}
+ \IfNoValueTF{#1}
+ {
+ \int_set:Nn \l_time_num_int {\@timelistlen}
+ }{
+ \int_set:Nn \l_time_num_int { #1 }
+ \int_compare:nNnT {\@timelistlen} > {#1}
+ {
\msg_warning:nn {litetable} {timelist}
}
}
}
- \dim_set:Nn \l_course_vunit_dim {%
- \fp_eval:n {1/(2*\l_course_num_int+3.5)}\paperheight
+ \dim_set:Nn \l__time_vunit_dim
+ {
+ \fp_eval:n {1/(2*\l_time_num_int+3.5)}\paperheight
}
}
-\NewDocumentCommand{\partialsums}{mmm}{%
- % #1 = list name, #2 = row, #3 = macro name for storing
- \clist_set:Ne \l__sums_in_clist { #1[#2] }
- \clist_clear:N \l__sums_out_clist
- \int_step_inline:nn { \clist_count:N \l__sums_in_clist }{%
- % ##1 is the highest term
- \clist_clear:N \l__sums_tmp_clist
- \int_step_inline:nn { ##1 }{%
- % populate the tmp clist
- \clist_put_right:Ne \l__sums_tmp_clist
- { \clist_item:Nn \l__sums_in_clist {####1} }
+\clist_new:N \l__week_ratios_clist
+\clist_new:N \l__week_accum_clist
+\int_new:N \l__week_num_int
+\dim_new:N \l__week_hunit_dim
+\NewDocumentCommand{\weeklist}{om}
+{
+ \IfValueT{ #1 }{\tl_set:Nn \l_weeks_tl { #1 }}
+ \readlist*\@weeklist{#2}
+ \int_step_inline:nn {\@weeklistlen}
+ {
+ \clist_put_right:Ne \l__week_ratios_clist
+ {
+ \@weeklist[##1,2]
}
- \clist_put_right:Ne \l__sums_out_clist{%
- % do the partial sum
- \int_eval:n { \clist_use:Nn \l__sums_tmp_clist { + } }
+ }
+ \int_step_inline:nn {\@weeklistlen}
+ {
+ \clist_clear:N \l__week_accumtmp_clist
+ \int_step_inline:nn { ##1 }
+ {
+ \clist_put_right:Ne \l__week_accumtmp_clist
+ {
+ \clist_item:Nn \l__week_ratios_clist { ####1 }
+ }
+ }
+ \clist_put_right:Ne \l__week_accum_clist
+ {
+ \int_eval:n
+ {
+ \clist_use:Nn \l__week_accumtmp_clist { + }
+ }
}
}
- \tl_set:Ne #3 { \clist_use:Nn \l__sums_out_clist {,} }
-}
-
-\dim_new:N \l_course_hunit_dim
-\NewDocumentCommand{\weeklist}{om}{%
- \IfValueT{#1}{\tl_set:Nn \l_weeks_tl { #1 }}
- \setsepchar{;/,}
- \readlist*\@weeklist{#2}
- \partialsums{\@weeklist}{2}{\@weeklistaccumulate}
- \int_compare:nNnT {\listlen\@weeklist[1]} > {\listlen\@weeklist[2]} {%
- \msg_new:nnn {litetable} {weeklist}
- {\noexpand\weeklist~extra~weekday~item(s)~were~ignored}
- \msg_warning:nn {litetable} {weeklist}
+ \int_set:Nn \l__week_num_int
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \@weeklistlen
+ }
}
- \readlist*\@weeklistshifts{\@weeklistaccumulate}
- \dim_set:Nn \l_course_hunit_dim {%
- \fp_eval:n {%
- 1/\@weeklistshifts[1,\int_eval:n {\listlen\@weeklist[2]}]*14/15
- }\paperwidth
+ \dim_set:Nn \l__week_hunit_dim
+ {
+ \fp_eval:n {1/\l__week_num_int*14/15}\paperwidth
}
}
-\NewDocumentCommand{\maketable}{mo}{%
+\int_new:N \l__week_day_int
+\newcommand{\newday}{\int_incr:N \l__week_day_int}
+\NewDocumentCommand{\maketable}{om}{
% Gray Block at top
\fill [ darkergray ] (current~page.north~west)
- rectangle + (\paperwidth,{-1.5*\l_course_vunit_dim})
- node [ midway, black, font = \huge\bfseries ] {#1};
- % Semester
- \IfNoValueF{#2}{%
- \node [ left, rectangle, fill=DarkBlue!10, text=DarkBlue!60,
- inner~sep=2ex, rounded~corners=8pt, font = \large ]
- at ($
- (current~page.north~east)+
- (-.02\paperwidth,-.75*\l_course_vunit_dim)
- $) {$\rightleftharpoons$~#2};
+ rectangle + (\paperwidth,{-1.5*\l__time_vunit_dim})
+ node [ midway, black, font = \huge\bfseries ] {#2};
+ \IfValueT{#1}% Semester
+ {
+ \node [ left, rectangle, fill = DarkBlue!10,
+ text = DarkBlue!60, inner~sep = 2ex,
+ rounded~corners = 8pt, font = \large
+ ] at ($
+ (current~page.north~east)+
+ (-.02\paperwidth,-.75*\l__time_vunit_dim)
+ $) {\ensuremath\rightleftharpoons\ #1};
}
% Darker Blocks
- \foreach \a in {0,2,...,\l_course_num_int}
- \fill [ densely~dashed,darkergray ]
- ([yshift=-2*\a*\l_course_vunit_dim]$
- (current~page.north~west)+
- (0,-2.5*\l_course_vunit_dim)
- $) rectangle +
- (\paperwidth,-2*\l_course_vunit_dim);
- % Sepdashes
- \foreach \a in {0,1,2,...,\l_course_num_int}
- \draw [ densely~dashed, gray, thick ]
- ([yshift = -2*\a*\l_course_vunit_dim]$
- (current~page.north~west)+
- (0,-2.5*\l_course_vunit_dim)
- $) --++ (\paperwidth,0);
- \tl_if_empty:NTF {\@timelist}{%
- % Classes numbering without time
- \foreach \a in {1,2,...,\l_course_num_int}
- \node [ yshift = -2*(\a-1)*\l_course_vunit_dim, darkgray!80,
- font = \bfseries\large\ttfamily ]
- at ($
- (current~page.north~west)+
- (\paperwidth/30,-3.5*\l_course_vunit_dim)
- $){\a};
- }{%
- % Classes numbering with time
- \foreach \a in {1,2,...,\l_course_num_int}
- \node [ yshift = -2*(\a-1)*\l_course_vunit_dim,
- darkgray!80, font = \bfseries\large\ttfamily]
- at ($
+ \int_step_inline:nnnn {0} {2} {\l_time_num_int} {
+ \filldraw [ fill = darkergray, draw = gray, thick,
+ densely~dashed, line~cap = round
+ ] ([yshift = -2*##1*\l__time_vunit_dim]$
+ (current~page.north~west)+(-.4pt,0)+
+ (0,-2.5*\l__time_vunit_dim)
+ $) rectangle + ($
+ (\paperwidth,-2*\l__time_vunit_dim)+
+ (.8pt,0)
+ $);
+ }
+ \tl_if_empty:NTF {\@timelist}% Classes numbering
+ {
+ \int_step_inline:nn {\l_time_num_int} {
+ \node [ yshift = -2*##1*\l__time_vunit_dim,
+ darkgray!80, font = \bfseries\large\ttfamily
+ ] at ($
(current~page.north~west)+
- (\paperwidth/30,-3*\l_course_vunit_dim)
- $){\a};
- % Classes start time
- \foreach \a in {1,2,...,\@timelistlen}
- \node [ yshift = -2*(\a-1)*\l_course_vunit_dim,
- gray, font = \ttfamily ]
- at ($
+ (\paperwidth/30,-1.5*\l__time_vunit_dim)
+ $) {##1};
+ }
+ }{
+ \int_step_inline:nn {\l_time_num_int} {
+ \node [ yshift = -2*##1*\l__time_vunit_dim,
+ darkgray!80, font = \bfseries\large\ttfamily
+ ] at ($
(current~page.north~west)+
- (\paperwidth/30,-3.65*\l_course_vunit_dim)
- $){\@timelist[\a,1]};
- % Classes end time
- \foreach \a in {1,2,...,\@timelistlen}
- \node [ yshift=-2*(\a-1)*\l_course_vunit_dim,
- gray, font = \ttfamily ]
+ (\paperwidth/30,-\l__time_vunit_dim)
+ $) {##1};
+ }
+ % Classes time
+ \int_step_inline:nn {\@timelistlen} {
+ \node [ yshift = -2*##1*\l__time_vunit_dim,
+ gray, font = \ttfamily ,align = center]
at ($
(current~page.north~west)+
- (\paperwidth/30,-4.15*\l_course_vunit_dim)
- $){\@timelist[\a,2]};
+ (\paperwidth/30,-1.9*\l__time_vunit_dim)
+ $) {\@timelist[##1,1]\\\@timelist[##1,2]};
+ }
}
% Weekdays
- \foreach \a in {1,2,...,\listlen\@weeklist[2]}
- \node [ font = \large\bfseries,
- xshift = \fp_eval:n {(
- \@weeklistshifts[1,\a]-\@weeklist[2,\a]/2)/
- \@weeklistshifts[1,\int_eval:n {\listlen\@weeklist[2]}]
- *14/15}*\paperwidth ]
+ \int_step_inline:nn {\@weeklistlen}
+ {
+ \node [ font = \large\bfseries,
+ xshift = \clist_item:Nn \l__week_accum_clist {##1}/
+ \l__week_num_int*14/15*\paperwidth
+ ]
at ($
- (current~page.north~west)+
- (\paperwidth/15,-2*\l_course_vunit_dim)
- $){\@weeklist[1,\a]};
+ (current~page.north~west)-
+ (\fp_eval:n {(
+ \clist_item:Nn
+ \l__week_ratios_clist { ##1 }
+ /2)/\l__week_num_int*14/15-1/15
+ }*\paperwidth,2*\l__time_vunit_dim)
+ $) {\@weeklist[##1,1]};
+ }
}
-\int_new:N \l_course_weekday_int
-\newcommand{\newday}{\int_add:Nn \l_course_weekday_int {1}}
-\keys_define:nn{course}{%
+\keys_define:nn{course}{
color.tl_set:N = \l_color_tl,
- color.initial:n = DarkSlateGray,
- color.default:n = DarkSlateGray,
+ color.initial:n = teal,
subject.tl_set:N = \l_subject_tl,
teacher.tl_set:N = \l_teacher_tl,
location.tl_set:N = \l_location_tl,
weeks.tl_set:N = \l_weeks_tl,
weeks.initial:n = \l_weeks_tl,
- weeks.default:n = \l_weeks_tl,
}
-\dim_new:N \l_course_shift_dim
-\NewDocumentCommand{\course}{O{}mm}{%
+\dim_new:N \l__course_infoshift_dim
+\NewDocumentCommand{\course}{O{}mm}
+{
\group_begin:
- \keys_set:nn{course}{#1}
+ \keys_set:nn { course } { #1 }
% Course block fg
\fill [ \l_color_tl!60, rounded~corners = 8pt ] ($
(current~page.north~west)+(.4pt,-.4pt)+
- (\fp_eval:n {
- \@weeklistshifts[1,\int_use:N \l_course_weekday_int]-
- \@weeklist[2,\int_use:N \l_course_weekday_int]
- }*\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-.5-2*#2}*\l_course_vunit_dim)
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-.5-2*#2}*\l__time_vunit_dim)
$) rectangle ($
(current~page.north~west)+(-.4pt,.4pt)+
- (\@weeklistshifts[1,\int_use:N \l_course_weekday_int]
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-2.5-2*#3}*\l_course_vunit_dim)
+ (\clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-2.5-2*#3}*\l__time_vunit_dim)
$);
% Course block bg
\fill [ \l_color_tl!10 ] ($
(current~page.north~west)+(1.2pt,-.4pt)+
- (\fp_eval:n {
- \@weeklistshifts[1,\int_use:N \l_course_weekday_int]-
- \@weeklist[2,\int_use:N \l_course_weekday_int]
- }*\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-1-2*#2}*\l_course_vunit_dim)
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-1-2*#2}*\l__time_vunit_dim)
$) -- ($
(current~page.north~west)+(-1.2pt,-.4pt)+
- (\@weeklistshifts[1,\int_use:N \l_course_weekday_int]
- *\l_course_hunit_dim+\paperwidth/15,
- {\fp_eval:n {-1-2*#2}*\l_course_vunit_dim})
+ (\clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-1-2*#2}*\l__time_vunit_dim)
$) {[rounded~corners = 7.2pt] -- ($
(current~page.north~west)+(-1.2pt,1.2pt)+
- (\@weeklistshifts[1,\int_use:N \l_course_weekday_int]
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-2.5-2*#3}*\l_course_vunit_dim)
+ (\clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-2.5-2*#3}*\l__time_vunit_dim)
$) -- ($
(current~page.north~west)+(1.2pt,1.2pt)+
- (\fp_eval:n {
- \@weeklistshifts[1,\int_use:N \l_course_weekday_int]
- -\@weeklist[2,\int_use:N \l_course_weekday_int]
- }*\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-2.5-2*#3}*\l_course_vunit_dim)
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-2.5-2*#3}*\l__time_vunit_dim)
$)} -- cycle;
% Course info
- \tl_if_eq:NNTF {#2} {#3} {%
- % Single-unit height course block
- \bool_if:nTF {%
+ \tl_if_eq:NNTF {#2} {#3}% Single-unit height course block
+ {
+ \bool_if:nTF
+ {
\tl_if_empty_p:N \l_location_tl &&
\tl_if_empty_p:N \l_teacher_tl
- }{%
+ }{
\tl_set:Nn \l_shortcourse_anchor_tl { }
- }{%
+ }{
\tl_set:Nn \l_shortcourse_anchor_tl { above }
}
- \cs_if_exist:NT {\l_subject_tl } {%
+ \cs_if_exist:NT {\l_subject_tl }
+ {
\node [ \l_shortcourse_anchor_tl,
\l_color_tl!60, align = center,
font = \large\bfseries ]
at ($
(current~page.north~west)+
- (\fp_eval:n {%
- \@weeklistshifts[1,
- \int_use:N \l_course_weekday_int]-
- \@weeklist[2,
- \int_use:N \l_course_weekday_int]/2}
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-1.75-#2-#3}*\l_course_vunit_dim)
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }/2
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-1.75-#2-#3}*\l__time_vunit_dim)
$) { \l_subject_tl };
- }
- \bool_if:nTF {%
+ }
+ \bool_if:nTF
+ {
!\tl_if_empty_p:N \l_location_tl &&
!\tl_if_empty_p:N \l_teacher_tl
- }{%
+ }{
\tl_set:Nn \l_shortcourse_sep_tl { ,~ }
- }{%
+ }{
\tl_set:Nn \l_shortcourse_sep_tl { }
}
\node [ below, \l_color_tl!60, align = center ]
at ($
(current~page.north~west)+
- (\fp_eval:n {%
- \@weeklistshifts[1,
- \int_use:N \l_course_weekday_int]-
- \@weeklist[2,\int_use:N \l_course_weekday_int]/2}
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-1.75-#2-#3}*\l_course_vunit_dim)
- $) {%
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }/2
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-1.75-#2-#3}*\l__time_vunit_dim)
+ $) {
\tl_if_exist:NT
{ \l_location_tl } { \l_location_tl }
\l_shortcourse_sep_tl
\tl_if_exist:NT
{ \l_teacher_tl } { \l_teacher_tl }
- };
- }{%
- % Multiply-unit height course block
- \bool_if:nTF {%
+ };
+ }{
+ \bool_if:nTF% Multiply-unit height course block
+ {
\tl_if_empty_p:N \l_location_tl &&
\tl_if_empty_p:N \l_teacher_tl
- }{%
+ }{
\tl_set:Nn \l_course_anchor_tl {}
- \dim_set:Nn \l_course_shift_dim { 0\l_course_vunit_dim }
- }{%
+ \dim_set:Nn \l__course_infoshift_dim { 0pt }
+ }{
\tl_set:Nn \l_course_anchor_tl { above }
- \dim_set:Nn \l_course_shift_dim { .125\l_course_vunit_dim }
- }
- \cs_if_exist:NT { \l_subject_tl }{%
- \node [%
- \l_course_anchor_tl,
- yshift = \dim_use:N \l_course_shift_dim,
- \l_color_tl!60, align = center,
- font = \large\bfseries ]
- at ($
- (current~page.north~west)+
- (\fp_eval:n {%
- \@weeklistshifts[1,
- \int_use:N \l_course_weekday_int]-
- \@weeklist[2,
- \int_use:N \l_course_weekday_int]/2}
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-1.5-#2-#3}*\l_course_vunit_dim)
- $) { \l_subject_tl };
+ \dim_set:Nn \l__course_infoshift_dim
+ {
+ .125\l__time_vunit_dim
}
- \bool_if:nTF {%
+ }
+ \cs_if_exist:NT { \l_subject_tl }
+ {
+ \node [ \l_course_anchor_tl,
+ yshift = \l__course_infoshift_dim,
+ \l_color_tl!60, align = center,
+ font = \large\bfseries
+ ] at ($
+ (current~page.north~west)+
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }/2
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-1.5-#2-#3}*\l__time_vunit_dim)
+ $) { \l_subject_tl };
+ }
+ \bool_if:nTF
+ {
!\tl_if_empty_p:N \l_location_tl &&
!\tl_if_empty_p:N \l_teacher_tl
- }{%
+ }{
\tl_set:Nn \l_courseinfo_sep_tl { \\ }
- }{%
+ }{
\tl_set:Nn \l_courseinfo_sep_tl { }
}
\node [ below, \l_color_tl!60, align = center ]
at ($
(current~page.north~west)+
- (\fp_eval:n {%
- \@weeklistshifts[1,
- \int_use:N \l_course_weekday_int]-
- \@weeklist[2,\int_use:N \l_course_weekday_int]/2}
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-1.625-#2-#3}*\l_course_vunit_dim)
- $) {%
+ (\fp_eval:n
+ {
+ \clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }-
+ \clist_item:Nn \l__week_ratios_clist
+ {
+ \l__week_day_int
+ }/2
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-1.625-#2-#3}*\l__time_vunit_dim)
+ $) {
\tl_if_exist:NT
{ \l_location_tl } { \l_location_tl }
\l_courseinfo_sep_tl
\tl_if_exist:NT
{ \l_teacher_tl } { \l_teacher_tl }
- };
- \node [ above~left, \l_color_tl!60,
- inner~sep = {7.2pt-.5ex} ]
+ };
+ \node [ above~left, \l_color_tl!60, outer~sep = .5ex ]
at ($
(current~page.north~west)+
- (\@weeklistshifts[1,\int_use:N \l_course_weekday_int]
- *\l_course_hunit_dim+\paperwidth/15,
- \fp_eval:n {-2.5-2*#3}*\l_course_vunit_dim)
+ (\clist_item:Nn \l__week_accum_clist
+ {
+ \l__week_day_int
+ }*\l__week_hunit_dim+\paperwidth/15,
+ \fp_eval:n {-2.5-2*#3}*\l__time_vunit_dim)
$) { \l_weeks_tl };
}
\group_end:
}
-% Additional info
-\newcommand{\more}[1]{%
- \node [ left = 1ex, darkgray, font = \small\bfseries ] at
- ($(current~page.south~east)+(0,.5*\l_course_vunit_dim)$) {#1};
+\newcommand{\more}[1]% Additional info
+{
+ \node [ left = 1ex, darkgray, font = \small\bfseries ]
+ at ($
+ (current~page.south~east)+(0,.5*\l__time_vunit_dim)
+ $) {#1};
}
-\tl_clear:N \thepage
-\endinput
-%% \ No newline at end of file
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/randintlist/doc/randintlist-doc.pdf b/macros/latex/contrib/randintlist/doc/randintlist-doc.pdf
index 4d1e3e4d34..373177badb 100644
--- a/macros/latex/contrib/randintlist/doc/randintlist-doc.pdf
+++ b/macros/latex/contrib/randintlist/doc/randintlist-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/randintlist/doc/randintlist-doc.tex b/macros/latex/contrib/randintlist/doc/randintlist-doc.tex
index 1dbeec2aff..d08d3edbb6 100644
--- a/macros/latex/contrib/randintlist/doc/randintlist-doc.tex
+++ b/macros/latex/contrib/randintlist/doc/randintlist-doc.tex
@@ -27,8 +27,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.0}
-\def\TPdate{23/09/2024}
+\def\TPversion{0.1.1}
+\def\TPdate{24/09/2024}
\usepackage{tcolorbox}
\usepackage{pgffor}
\tcbuselibrary{breakable,skins,hooks,listingsutf8}
@@ -52,7 +52,7 @@
morekeywords={\randintlist,\getitemfromrandintlist},%
keywordstyle={\color{green!50!black}},%
classoffset=3,%
- morekeywords={min,max,nb,seed,sort,sep,repeat},%
+ morekeywords={min,max,nb,seed,sort,sep,repeat,exclude},%
keywordstyle={\color{orange}}
}
@@ -82,7 +82,7 @@
morekeywords={\randintlist,\getitemfromrandintlist,\ListeRandint,\ExtraireEltListeRandint},%
keywordstyle={\color{green!50!black}},%
classoffset=3,%
- morekeywords={min,max,nb,seed,sort,sep,repeat,Min,Max,Nb,Graine,Sep,Tri,Repet},%
+ morekeywords={min,max,nb,seed,sort,sep,repeat,Min,Max,Nb,Graine,Sep,Tri,Repet,exclude,Exclure},%
keywordstyle={\color{orange}}
},%
#1
@@ -101,7 +101,7 @@
basicstyle=\scriptsize\ttfamily,%
tabsize=4,%
commentstyle={\itshape\color{gray}},%
- lastline=113
+ lastline=148
},%
breakable,
listing only,%
@@ -158,6 +158,16 @@ The 5th value is :
\end{tcolorbox}
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+10 numbers, between 1 and 100, without multiples of 5 :
+
+\hfill\randintlist[min=1,max=100,nb=10,exclude={5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100}]{\mylist}\textcolor{olive}{\mylist}\hfill~
+
+The 9th value is :
+
+\hfill\textcolor{purple}{\getitemfromrandintlist{\mylist}{9}}\hfill~
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
15 numbers, between 1 and 20, with repetition :
\hfill\randintlist[min=1,max=20,nb=15,repeat]{\mylist}\textcolor{red}{\mylist}\hfill~
@@ -213,7 +223,7 @@ In order to load \texttt{randintlist}, simply use :
\usepackage{randintlist}
\end{DemoCode}
-Loaded packages are \texttt{simplekv}, \texttt{listofitems}, \texttt{randomlist}, \texttt{xintexpr} and \texttt{xstring}
+Loaded packages are \texttt{ifthen}, \texttt{simplekv}, \texttt{listofitems}, \texttt{randomlist}, \texttt{xintexpr} and \texttt{xstring}
\section{The Macros}
@@ -239,6 +249,7 @@ Available keys are :
\item \ShowCode{sep} : separator for the list (default \ShowCode{,}) ;
\item \ShowCode{sort} : sorting options, within \ShowCode{no/asc/dec} (default \ShowCode{no}) ;
\item \ShowCode{repeat} : boolean to authorize repeating values (default \ShowCode{false}) ;
+ \item \ShowCode{exclude} : list of excluded values (default \ShowCode{empty}) ;
\item \ShowCode{seed} : random seed value according to used packages (default \ShowCode{-}).
\end{itemize}
@@ -258,6 +269,14 @@ Available keys are :
\end{DemoCode}
\begin{DemoCode}{}
+%15 between 1 and 50, without multiples of 5
+\randintlist[%
+ sort=asc,min=1,max=50,nb=15,repeat,%
+ exclude={5,10,15,20,25,30,35,40,45,50}]%
+ {\mylistC}\mylistC
+\end{DemoCode}
+
+\begin{DemoCode}{}
%list used with listofitems
\randintlist{\mylistD}\mylistD\par
\readlist*\mylistused{\mylistD}\showitems{\mylistused}\par
@@ -276,7 +295,7 @@ Available keys are :
\randintlist{\mylistE}raw list : \mylistE\par
items list :\par
\xintFor* #1 in {\xintSeq{1}{6}}\do{\getitemfromrandintlist{\mylistE}{#1}\par}
-\getitemfromrandintlist{\mylistE}{1}
+first element : \getitemfromrandintlist{\mylistE}{1}
\end{DemoCode}
\subsection{Version française}
@@ -285,7 +304,7 @@ Voilà les commandes en version française, la syntaxe et les clés ne seront pa
\begin{DemoCode}{listing only}
%obtenir la liste
-\ListeRandint[Min=...,Max=...,Nb=...,Repet=...,Graine=...,Tri=...,Sep=...]{\macro}
+\ListeRandint[Min=..,Max=..,Nb=..,Repet=..,Graine=..,Tri=..,Sep=..,Exclure=..]{\macro}
%extraire un élément
\ExtraireEltListeRandint[sep]{\macro}{position}
@@ -293,8 +312,7 @@ Voilà les commandes en version française, la syntaxe et les clés ne seront pa
\begin{DemoCode}{}
%liste
-\ListeRandint[Min=5,Max=15,Nb=7,Repet,Tri=croiss,Sep={/}]{\maliste}\maliste
-
+\ListeRandint[Min=5,Max=15,Nb=7,Repet,Tri=croiss,Sep={/}]{\maliste}\maliste\\
%élément
\ExtraireEltListeRandint[/]{\maliste}{4}
\end{DemoCode}
@@ -322,6 +340,8 @@ The following example uses \TikZ, and comes from \texttt{luarandom}'s documentat
\section{History}
+\texttt{0.1.1 : Possibility to exclude values}
+
\texttt{0.1.0 : Initial version}
\section{The code}
diff --git a/macros/latex/contrib/randintlist/tex/randintlist.sty b/macros/latex/contrib/randintlist/tex/randintlist.sty
index 87ed2de022..4c15af336e 100644
--- a/macros/latex/contrib/randintlist/tex/randintlist.sty
+++ b/macros/latex/contrib/randintlist/tex/randintlist.sty
@@ -2,9 +2,10 @@
% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{randintlist}[2024/09/23 0.1.0 Create a list of random numbers with or without multiple values]
+\ProvidesPackage{randintlist}[2024/09/24 0.1.1 Create a list of random numbers with or without multiple values]
%------History
+% 0.1.1 Possibility to exclude values
% 0.1.0 Initial version
%------Packages
@@ -13,8 +14,9 @@
\RequirePackage{randomlist}
\RequirePackage{xintexpr}
\RequirePackage{xstring}
+\RequirePackage{ifthen}
-%-----Macros for sorting and seed
+%-----Macros (latex3) for sorting and seed
\ExplSyntaxOn
\cs_new_eq:NN \randintseed \sys_gset_rand_seed:n
\NewDocumentCommand\intascsortlist{m}
@@ -37,6 +39,16 @@
}
\ExplSyntaxOff
+%----Internal macro (latex2) for testing if element is in list
+\newcommand\ifintvalueinlist[2]{\IfSubStr{,#2,}{,#1,}}
+
+\newcommand\boolvalueinlist[2]{\IfSubStr{,#2,}{,#1,}{\def\resisinlist{1}}{\def\resisinlist{0}}}
+
+\newcommand\xintifintvalueinlist[4]{%
+ \IfSubStr{,#2,}{,#1,}{\xdef\RESTMPVALUE{1}}{\xdef\RESTMPVALUE{0}}%
+ \xintifboolexpr{ \RESTMPVALUE == 1}{#3}{#4}%
+}
+
%----Macro for generating
\defKV[randomlistintegers]{%
min=\def\TAEEmin{#1},%
@@ -44,7 +56,8 @@
nb=\def\TAEEnb{#1},%
sep=\def\TAEEsep{#1},%
sort=\def\TAEEtri{#1},%
- seed=\def\TAEEseed{#1}
+ seed=\def\TAEEseed{#1},%
+ exclude=\def\TAEEexcluded{#1}
}
\setKVdefault[randomlistintegers]{%
@@ -54,7 +67,8 @@
sep={,},%
sort=no,%
repeat=false,%
- seed={-}
+ seed={-},%
+ exclude={}
}
\NewList{tmprandintlist}
@@ -69,10 +83,23 @@
{%
\randintseed{\TAEEseed}%
}%
- %list creation (first then other)
- \xdef#2{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ %list creation of first element
+ \def\resisinlist{1}%
+ \whiledo{\resisinlist=1}{%
+ \xdef\tmpresrandint{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ \boolvalueinlist{\tmpresrandint}{\TAEEexcluded}%
+ }%
+ \xdef#2{\tmpresrandint}%
+ %list creation of other elements
\xintFor* ##1 in {\xintSeq{2}{\TAEEnb}}%
- \do{\xdef#2{#2,\fpeval{randint(\TAEEmin,\TAEEmax)}}}%
+ \do{%
+ \def\resisinlist{1}%
+ \whiledo{\resisinlist=1}{%
+ \xdef\tmpresrandint{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ \boolvalueinlist{\tmpresrandint}{\TAEEexcluded}%
+ }%
+ \xdef#2{#2,\tmpresrandint}%
+ }%
}%
{%no repeating
%randomize numbers
@@ -83,11 +110,19 @@
}%
\ClearList{tmprandintlist}%clearing the list
\xintFor* ##1 in {\xintSeq{\TAEEmin}{\TAEEmax}}%
- \do{\InsertRandomItem{tmprandintlist}{##1}}%
+ \do{%
+ \ifintvalueinlist{##1}{\TAEEexcluded}%
+ {}%
+ {%
+ \InsertRandomItem{tmprandintlist}{##1}%
+ }%
+ }%
%list creation (first then other)
\xdef#2{\tmprandintlist[0]}%
\xintFor* ##1 in {\xintSeq{1}{\TAEEnb-1}}%
- \do{\xdef#2{#2,\tmprandintlist[##1]}}%
+ \do{%
+ \xdef#2{#2,\tmprandintlist[##1]}%
+ }%
}%
%sorting
\IfStrEq{\TAEEtri}{asc}%if ascending
@@ -119,7 +154,8 @@
Nb=\def\TAEEnb{#1},%
Sep=\def\TAEEsep{#1},%
Tri=\def\TAEEtri{#1},%
- Graine=\def\TAEEseed{#1}
+ Graine=\def\TAEEseed{#1},%
+ Exclure=\def\TAEEexcluded{#1}
}
\setKVdefault[randomlisteentiers]{%
@@ -129,7 +165,8 @@
Sep={,},%
Tri=non,%
Repet=false,%
- Graine={-}
+ Graine={-},%
+ Exclure={}
}
\NewDocumentCommand\ListeRandint{ O{} m }{%1=keys,2=listname
@@ -142,10 +179,23 @@
{%
\randintseed{\TAEEseed}%
}%
- %list creation (first then other)
- \xdef#2{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ %list creation of first element
+ \def\resisinlist{1}%
+ \whiledo{\resisinlist=1}{%
+ \xdef\tmpresrandint{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ \boolvalueinlist{\tmpresrandint}{\TAEEexcluded}%
+ }%
+ \xdef#2{\tmpresrandint}%
+ %list creation of other elements
\xintFor* ##1 in {\xintSeq{2}{\TAEEnb}}%
- \do{\xdef#2{#2,\fpeval{randint(\TAEEmin,\TAEEmax)}}}%
+ \do{%
+ \def\resisinlist{1}%
+ \whiledo{\resisinlist=1}{%
+ \xdef\tmpresrandint{\fpeval{randint(\TAEEmin,\TAEEmax)}}%
+ \boolvalueinlist{\tmpresrandint}{\TAEEexcluded}%
+ }%
+ \xdef#2{#2,\tmpresrandint}%
+ }%
}%
{%no repeating
%randomize numbers
@@ -156,11 +206,19 @@
}%
\ClearList{tmprandintlist}%clearing the list
\xintFor* ##1 in {\xintSeq{\TAEEmin}{\TAEEmax}}%
- \do{\InsertRandomItem{tmprandintlist}{##1}}%
+ \do{%
+ \ifintvalueinlist{##1}{\TAEEexcluded}%
+ {}%
+ {%
+ \InsertRandomItem{tmprandintlist}{##1}%
+ }%
+ }%
%list creation (first then other)
\xdef#2{\tmprandintlist[0]}%
\xintFor* ##1 in {\xintSeq{1}{\TAEEnb-1}}%
- \do{\xdef#2{#2,\tmprandintlist[##1]}}%
+ \do{%
+ \xdef#2{#2,\tmprandintlist[##1]}%
+ }%
}%
%sorting
\IfStrEq{\TAEEtri}{croiss}%if ascending
diff --git a/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty
index 339f10240c..a9bb8d7bdf 100644
--- a/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty
+++ b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-english.cfg.sty
@@ -4,13 +4,13 @@
\NewDocumentCommand{\tutodoc@trans@latex@show@start}{}{Start ~ of ~ the ~ real ~ output}
\NewDocumentCommand{\tutodoc@trans@latex@show@end}{}{End ~ of ~ the ~ real ~ output}
\NewDocumentCommand{\tutodoc@trans@exa@title}{}{Example}
-\NewDocumentCommand{\tutodoc@trans@rmk@title}{}{Remark}
+\NewDocumentCommand{\tutodoc@trans@rem@title}{}{Remark}
\NewDocumentCommand{\tutodoc@trans@note@title}{}{Note}
\NewDocumentCommand{\tutodoc@trans@tip@title}{}{Tip}
-\NewDocumentCommand{\tutodoc@trans@important@title}{}{Important}
+\NewDocumentCommand{\tutodoc@trans@imp@title}{}{Important}
\NewDocumentCommand{\tutodoc@trans@caution@title}{}{Caution}
\NewDocumentCommand{\tutodoc@trans@warn@title}{}{Warning}
-\NewDocumentCommand{\tutodoc@trans@chges@pb}{}{Problem}
+\NewDocumentCommand{\tutodoc@trans@chges@prob}{}{Problem}
\NewDocumentCommand{\tutodoc@trans@chges@break}{}{Break}
\NewDocumentCommand{\tutodoc@trans@chges@fix}{}{Fix}
\NewDocumentCommand{\tutodoc@trans@chges@new}{}{New}
diff --git a/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty
index 5c97cb2f18..91bdbab5f4 100644
--- a/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty
+++ b/macros/latex/contrib/tutodoc/code/tutodoc-locale-main-french.cfg.sty
@@ -4,13 +4,13 @@
\NewDocumentCommand{\tutodoc@trans@latex@show@start}{}{Début ~ du ~ rendu ~ réel}
\NewDocumentCommand{\tutodoc@trans@latex@show@end}{}{Fin ~ du ~ rendu ~ réel}
\NewDocumentCommand{\tutodoc@trans@exa@title}{}{Exemple}
-\NewDocumentCommand{\tutodoc@trans@rmk@title}{}{Remarque}
+\NewDocumentCommand{\tutodoc@trans@rem@title}{}{Remarque}
\NewDocumentCommand{\tutodoc@trans@note@title}{}{Note}
\NewDocumentCommand{\tutodoc@trans@tip@title}{}{Astuce}
-\NewDocumentCommand{\tutodoc@trans@important@title}{}{Important}
+\NewDocumentCommand{\tutodoc@trans@imp@title}{}{Important}
\NewDocumentCommand{\tutodoc@trans@caution@title}{}{Mise ~ en ~ garde}
\NewDocumentCommand{\tutodoc@trans@warn@title}{}{Avertissement}
-\NewDocumentCommand{\tutodoc@trans@chges@pb}{}{Problème}
+\NewDocumentCommand{\tutodoc@trans@chges@prob}{}{Problème}
\NewDocumentCommand{\tutodoc@trans@chges@break}{}{Bifurcation}
\NewDocumentCommand{\tutodoc@trans@chges@fix}{}{Réparation}
\NewDocumentCommand{\tutodoc@trans@chges@new}{}{Nouveau}
diff --git a/macros/latex/contrib/tutodoc/code/tutodoc.sty b/macros/latex/contrib/tutodoc/code/tutodoc.sty
index a1e0acdd13..b32d98df35 100644
--- a/macros/latex/contrib/tutodoc/code/tutodoc.sty
+++ b/macros/latex/contrib/tutodoc/code/tutodoc.sty
@@ -1,17 +1,22 @@
-% ------------------------------------------------------- %
-% - This is file `tutodoc.sty' generated automatically. - %
-% - - %
-% - Copyright (C) 2023-2024 by Christophe BAL - %
-% - - %
-% - This file may be distributed and/or modified under - %
-% - the conditions of the GNU 3 License. - %
-% ------------------------------------------------------- %
+% ********************************************************* %
+% ** This is file `tutodoc.sty' generated automatically. ** %
+% ** ** %
+% ** Copyright (C) 2023-2024 by Christophe BAL ** %
+% ** ** %
+% ** This file may be distributed and/or modified under ** %
+% ** the conditions of the GNU 3 License. ** %
+% ********************************************************* %
\ProvidesExplPackage
- {tutodoc}
- {2024-08-23} % Creation: 2023-11-29
- {1.2.0-a}
- {This package proposes tools for writing "human friendly" documentations of LaTeX packages.}
+ {tutodoc}
+ {2024-09-25} % Creation: 2023-11-29
+ {1.3.0}
+ {This package proposes tools for writing "human friendly" documentations of LaTeX packages.}
+
+
+% =================== %
+% == PACKAGES USED == %
+% =================== %
\RequirePackage[
top = 2.5cm,
@@ -43,34 +48,63 @@
[2022-09-14]
-\RequirePackage{amsthm}%
- [2017/09]
+\RequirePackage{fontawesome5}%
+ [2022-05-02]
+
+\RequirePackage{keytheorems}%
+ [2024/09/19]
+
+\RequirePackage[svgnames]%
+ {xcolor}%
+ [2023/11/15]
+
+\RequirePackage{tcolorbox}%
+ [2024/07/10]
+
+\tcbuselibrary{breakable, skins}
\RequirePackage{clrstrip}%
[2021-08-28]
-\RequirePackage{tcolorbox}[2023/06/19]
+\RequirePackage{minted2}% Temporary patch? minted3 seems very slow8
+
+\RequirePackage{tcolorbox}%
+ [2024/07/10]
+
\tcbuselibrary{minted, breakable, skins}
+\RequirePackage{fontawesome5}%
+ [2022-05-02]
+
\RequirePackage{marginnote}%
[2023-09-07]
+% ======================= %
+% == AVAILABLE OPTIONS == %
+% ======================= %
+
+% ----------------- %
% -- LOCALE LANG -- %
+% ----------------- %
\ExplSyntaxOn
+% ::::::::::::::::::: %
% :: SOME MESSAGES :: %
+% ::::::::::::::::::: %
\msg_set:nnnn { tdoc } { package-option-lang-unknown }
{ Unknown ~ language. }
{ See ~ the ~ documentation ~ for ~ the ~ supported ~ languages. }
+% ::::::::::::::::::::::: %
% :: SETTING SOME KEYS :: %
+% ::::::::::::::::::::::: %
\str_new:N \l_tdoc_opt_lang_str
@@ -97,7 +131,13 @@
\ExplSyntaxOff
+% =============== %
+% == MAIN CODE == %
+% =============== %
+
+% --------------------- %
% -- LOCALE SETTINGS -- %
+% --------------------- %
\NewDocumentCommand{\tutodoc@colon}{}{:}
@@ -115,12 +155,16 @@
\ExplSyntaxOff
+% ---------------------- %
% -- GENERAL SETTINGS -- %
+% ---------------------- %
\setlength{\parindent}{0cm}
+% ----------- %
% -- LINKS -- %
+% ----------- %
\hypersetup{
colorlinks,
@@ -131,7 +175,9 @@
}
+% --------------- %
% -- TOC & Co. -- %
+% --------------- %
\ifcsundef{chapter}%
{}%
@@ -173,7 +219,35 @@
\DeclareTOCStyleEntry[indentfollows = chapter]{tocline}{section}
+% --------------------------- %
+% -- COLOR TRANSFORMATIONS -- %
+% --------------------------- %
+
+%%%
+% prototype::
+% #1 : one color following the ''xcolor'' format.
+%
+% :return: a "darker" version of the color ''#1''.
+%%%
+\NewExpandableDocumentCommand{\tdocdarkcolor}{m}{%
+ #1!50!black%
+}
+
+
+%%%
+% prototype::
+% #1 : one color following the ''xcolor'' format.
+%
+% :return: a "transparent" version of the color `#1`.
+%%%
+\NewExpandableDocumentCommand{\tdoclightcolor}{m}{%
+ #1!5%
+}
+
+
+% ------------- %
% -- QUOTING -- %
+% ------------- %
%%%
% prototype::
@@ -186,7 +260,9 @@
}
+% ------------------------------ %
% -- EXPLAINING ENGLISH NAMES -- %
+% ------------------------------ %
%%%
% prototype::
@@ -215,9 +291,13 @@
}
-% -- FOCUS ON SOME CONTENT -- %
+% ----------------------------------- %
+% -- SOBER HIGHLIGHTING OF CONTENT -- %
+% ----------------------------------- %
+% ::::::::::::::::::::::::::::::: %
% :: EXAMPLE - HIDDEN VERSIONS :: %
+% ::::::::::::::::::::::::::::::: %
%%%
% See the \doc of the macro ''\newtheorem'' from the package ''amsthm''
@@ -240,7 +320,9 @@
\newtheorem*{@@tdocexa@no@nb}{\tutodoc@trans@exa@title}
+% :::::::::::::::::::::::::::::: %
% :: EXAMPLE - PUBLIC VERSION :: %
+% :::::::::::::::::::::::::::::: %
\ExplSyntaxOn
@@ -248,7 +330,7 @@
{ Unknown ~ rafters ~ option. }
{ See ~ the ~ documentation ~ for ~ the ~ supported ~ options. }
-\NewDocumentEnvironment{tdocexa}{D<>{nb} O{}}{
+\NewDocumentEnvironment{ tdocexa } { D<>{nb} O{} } {
\str_case:nnF { #1 } {
{ nb } {
\begin{@@tdocexa@nb}[#2]
@@ -261,7 +343,7 @@
}
}{
\str_case:nnF { #1 } {
- { nb } {
+ { nb } {
\end{@@tdocexa@nb}
}
{ nonb } {
@@ -273,61 +355,85 @@
\ExplSyntaxOff
+% :::::::::::: %
% :: REMARK :: %
+% :::::::::::: %
%%%
% See the \doc of the macro ''\newtheorem*'' from the package ''amsthm''
% to have \infos about the environment ''tdocrem''.
%%%
-\newtheorem*{tdocrem}{\tutodoc@trans@rmk@title}
+\newtheorem*{tdocrem}{\tutodoc@trans@rem@title}
-% :: IMPORTANT :: %
+% -------------------------------------- %
+% -- COLORFUL HIGHLIGHTING OF CONTENT -- %
+% -------------------------------------- %
-%%%
-% See the \doc of the macro ''\newtheorem*'' from the package ''amsthm''
-% to have \infos about the environment ''tdocimportant''.
-%%%
-\newtheorem*{tdocimportant}{\tutodoc@trans@important@title}
-
-
-% :: NOTE :: %
-
-%%%
-% See the \doc of the macro ''\newtheorem*'' from the package ''amsthm''
-% to have \infos about the environment ''tdocnote''.
-%%%
-\newtheorem*{tdocnote}{\tutodoc@trans@note@title}
+% ::::::::::::::::: %
+% :: ABSTRACTION :: %
+% ::::::::::::::::: %
+% Sources used.
+% + https://tex.stackexchange.com/a/727022/6880
+% + https://tex.stackexchange.com/a/682332/6880
-% :: TIP :: %
+\tcbset{
+ tutodoc-focus-color-style/.style = {
+ breakable,
+ enhanced,
+% fonttitle = \itshape,
+% halign title = center,
+ fontupper = \color{\tdocdarkcolor{#1}},
+ colback = \tdoclightcolor{#1},
+ colframe = #1!75!black!45,
+ shadow = {.75mm}{-.75mm}{0mm}{black!30},
+% We want to use the same color for the footnotes in the frame.
+ before upper = {\let\default@color\current@color},
+ }
+}
-%%%
-% See the \doc of the macro ''\newtheorem*'' from the package ''amsthm''
-% to have \infos about the environment ''tdoctip''.
-%%%
-\newtheorem*{tdoctip}{\tutodoc@trans@tip@title}
+% ::::::::::::::::::::::::::::::::::::: %
+% :: LET'S GO BACK TO THE REAL WORLD :: %
+% ::::::::::::::::::::::::::::::::::::: %
-% :: CUATION :: %
+\ExplSyntaxOn
-%%%
-% See the \doc of the macro ''\newtheorem*'' from the package ''amsthm''
-% to have \infos about the environment ''tdoccaution''.
-%%%
-\newtheorem*{tdoccaution}{\tutodoc@trans@caution@title}
+\prop_set_from_keyval:Nn \__g_tutodoc_focus_color_prop {
+ note = cyan,
+ tip = ForestGreen,%lime,
+ imp = orange,
+ caution = violet,
+ warn = red,
+}
+\prop_set_from_keyval:Nn \__g_tutodoc_focus_icon_prop {
+ note = \faInfoCircle,
+ tip = \faLightbulb,
+ imp = \faHighlighter,
+ caution = \faBiohazard,
+ warn = \faSkullCrossbones,
+}
-% :: WARNING :: %
+\prop_map_inline:Nn \__g_tutodoc_focus_color_prop {
+ \newkeytheorem{tdoc#1}[
+ numbered = false,
+% tcolorbox-no-titlebar can be used.
+ tcolorbox = {tutodoc-focus-color-style=#2},
+ name = {
+ \prop_item:Nn \__g_tutodoc_focus_icon_prop { #1 } \kern3.5pt
+ \use:c { tutodoc@trans@#1@title }
+ },
+ ]
+}
-%%%
-% See the \doc of the macro ''\newtheorem*'' from the package ''amsthm''
-% to have \infos about the environment ''tdocwarn''.
-%%%
-\newtheorem*{tdocwarn}{\tutodoc@trans@warn@title}
+\ExplSyntaxOff
+% ---------------------------------------------- %
% -- NAMES OF PACKAGES, MACROS & ENVIRONMENTS -- %
+% ---------------------------------------------- %
%%%
% prototype::
@@ -380,18 +486,24 @@
}
+% ------------------------- %
% -- EXPLAINING PREFIXES -- %
+% ------------------------- %
\ExplSyntaxOn
+% :::::::::::::: %
% :: MESSAGES :: %
+% :::::::::::::: %
\msg_set:nnnn { bdoc } { prefixwhy-bad-format }
{ Bad ~ format, ~ something ~ like ~ ''pre.fix'' ~ expected. }
{ You ~ must ~ use ~ one ~ single ~ point. }
+% :::::::::::::::::::: %
% :: PREFIX FROM... :: %
+% :::::::::::::::::::: %
%%%
% prototype::
@@ -421,7 +533,9 @@
\ExplSyntaxOff
+% ::::::::::::::::::::: %
% :: JUST ONE PREFIX :: %
+% ::::::::::::::::::::: %
%%%
% prototype::
@@ -438,9 +552,13 @@
}
+% ------------------------ %
% -- GENERAL FORMATTING -- %
+% ------------------------ %
+% :::::::::::::::::::::::: %
% :: TEXT INSIDE A RULE :: %
+% :::::::::::::::::::::::: %
\ExplSyntaxOn
@@ -483,31 +601,9 @@
\ExplSyntaxOff
-% :: COLOR TRANSFORMATIONS :: %
-
-%%%
-% prototype::
-% #1 : one color following the ''xcolor'' format.
-%
-% :return: a "darker" version of the color ''#1''.
-%%%
-\NewExpandableDocumentCommand{\tdocdarkcolor}{m}{%
- #1!50!black%
-}
-
-
-%%%
-% prototype::
-% #1 : one color following the ''xcolor'' format.
-%
-% :return: a "transparent" version of the color `#1`.
-%%%
-\NewExpandableDocumentCommand{\tdoclightcolor}{m}{%
- #1!5%
-}
-
-
+% ::::::::::::::::::::::::::: %
% :: INTERNAL ENVIRONMENTS :: %
+% ::::::::::::::::::::::::::: %
%%%
% prototype::
@@ -556,7 +652,9 @@
\ExplSyntaxOn
+% ::::::::::::::::::::::: %
% :: SETTING SOME KEYS :: %
+% ::::::::::::::::::::::: %
\tl_new:N \l_tdoc_showcase_before_tl
\tl_new:N \l_tdoc_showcase_after_tl
@@ -585,7 +683,9 @@
}
+% :::::::::::::::::::::::::::::: %
% :: SHOWCASE FROM TYPED CODE :: %
+% :::::::::::::::::::::::::::::: %
% prototype::
% #1 : the key-value options.
@@ -625,7 +725,9 @@
}
+% :::::::::::::::::::::::: %
% :: SHOWCASE FROM FILE :: %
+% :::::::::::::::::::::::: %
%%%
% prototype::
@@ -647,9 +749,13 @@
\ExplSyntaxOff
+% -------------------- %
% -- LATEX EXAMPLES -- %
+% -------------------- %
+% ::::::::::::::::::::::::::::: %
% :: INLINE SHORT LATEX CODE :: %
+% ::::::::::::::::::::::::::::: %
%%%
% See the \doc of the macro ''\newmintinline'' from the package ''minted''
@@ -658,7 +764,9 @@
\newmintinline[tdocinlatex]{latex}{bgcolor = yellow!4}
+% ::::::::::::::::::::::::::::::::::::::::::::::: %
% :: SHORTCUTS FOR TCOLORBOX LISTING FORMATING :: %
+% ::::::::::::::::::::::::::::::::::::::::::::::: %
\ExplSyntaxOn
@@ -684,7 +792,9 @@
\ExplSyntaxOff
+% ::::::::::::::::::::::::::::::::: %
% :: THE TCOLORBOX LISTING STYLE :: %
+% ::::::::::::::::::::::::::::::::: %
%%%
% note::
@@ -696,6 +806,7 @@
tdoclatex_tcbstyle/.style = {
minted language = latex,
breakable,
+ enhanced,
% Code and output
colback = yellow!5,
% Frame
@@ -707,7 +818,6 @@
% We can use ''sharp corners'' to obtain an "old school" style.
%
% Separating line
- enhanced,
segmentation style = {
gray,
dash pattern = {on 5pt off 2.5pt},
@@ -718,7 +828,9 @@
}
+% ::::::::::::::::::::::::::::::::::: %
% :: TCOLORBOX LISTING ENVIRONMENT :: %
+% ::::::::::::::::::::::::::::::::::: %
%%%
% prototype::
@@ -736,7 +848,9 @@
}
+% :::::::::::::::::::::::::::::::::::::: %
% :: TCOLORBOX IMPORTED LISTING MACRO :: %
+% :::::::::::::::::::::::::::::::::::::: %
%%%
% prototype::
@@ -753,11 +867,15 @@
}
+% -------------------------- %
% -- LATEX REAL USE CASES -- %
+% -------------------------- %
\ExplSyntaxOn
+% ::::::::::::::::::::::: %
% :: SETTING SOME KEYS :: %
+% ::::::::::::::::::::::: %
\tl_new:N \l_tdoc_listing_explain_tl
@@ -773,7 +891,9 @@
}
+% ::::::::::::::::::::: %
% :: LATEXSHOW MACRO :: %
+% ::::::::::::::::::::: %
%%%
% prototype::
@@ -805,14 +925,18 @@
\ExplSyntaxOn
+% :::::::::::::: %
% :: MESSAGES :: %
+% :::::::::::::: %
\msg_set:nnnn { tdoc } { date-bad-format }
{ Bad ~ format ~ for ~ a ~ date. }
{ Use ~ YYYY-MM-DD. }
+% ::::::::::::::::: %
% :: MARGIN NOTE :: %
+% ::::::::::::::::: %
\reversemarginpar{}
@@ -890,8 +1014,12 @@
{#3}
}
+\ExplSyntaxOff
+
+% :::::::::::::::::::::: %
% :: VERSION AND DATE :: %
+% :::::::::::::::::::::: %
%%%
% prototype::
@@ -916,7 +1044,9 @@
}
+% :::::::::: %
% :: DATE :: %
+% :::::::::: %
%%%
% prototype::
@@ -928,22 +1058,30 @@
%%%
\NewDocumentCommand{\tdocdate}{O{blue} m}{
\tutodoc@new@change@margin{#1} % Color
- {#2} % Date
- {} % Version
- {-5.35pt} % Last negative spacing
+ {#2} % Date
+ {} % Version
+ {-5.35pt} % Last negative spacing
}
+% --------------------- %
% -- CHANGES - WHAT? -- %
+% --------------------- %
+\ExplSyntaxOn
+
+% :::::::::::::: %
% :: MESSAGES :: %
+% :::::::::::::: %
\msg_set:nnnn { tdoc } { changes-topic-missing-title }
{ Missing ~ title. }
{ One ~ single ~ title ~ must ~ be ~ indicated. }
+% ::::::::::::::::::::: %
% :: CHANGES - TOPIC :: %
+% ::::::::::::::::::::: %
%%%
% prototype::
@@ -952,12 +1090,13 @@
% :action: this environment prints some ¨infos about specific changes
% achieved in a new version (no special formatting is applied).
%%%
-\NewDocumentEnvironment{tdoctopic}{ m }{
+\NewDocumentEnvironment{tdoctopic}{ m O{} }{
\IfBlankT{#1}{
\msg_fatal:nn { tdoc } { changes-topic-missing-title }
}
\textbf{
+ \IfBlankF{#2}{#2\kern3.5pt}%
\textsc{#1.}
}
@@ -967,89 +1106,40 @@
}
+% :::::::::::::::::::::::::: %
% :: CHANGES - NEW THINGS :: %
-
-%%%
-% prototype::
-% :see: env.tdoctopic
-%
-% :action: similar to the \env ''tdoctopic'' with the title "New"
-% translated into the good language.
-%%%
-\NewDocumentEnvironment{tdocnew}{}{
- \begin{tdoctopic}{\tutodoc@trans@chges@new}
-}{
- \end{tdoctopic}
+% :::::::::::::::::::::::::: %
+
+\prop_set_from_keyval:Nn \__g_tutodoc_topic_change_prop {
+ break = \faCodeBranch,
+ fix = \faWrench,
+ new = \faGem,
+ prob = \faFire*,
+ update = \faMagic,
}
-% :: CHANGES - UPDATE :: %
-
%%%
% prototype::
% :see: env.tdoctopic
%
-% :action: similar to the \env ''tdoctopic'' with the title "Update"
-% translated into the good language.
-%%%
-\NewDocumentEnvironment{tdocupdate}{}{
- \begin{tdoctopic}{\tutodoc@trans@chges@update}
-}{
- \end{tdoctopic}
-}
-
-
-% :: CHANGES - BREAK :: %
-
-%%%
-% prototype::
-% :see: env.tdoctopic
-%
-% :action: similar to the \env ''tdoctopic'' with the title "Break"
-% translated into the good language.
-%%%
-\NewDocumentEnvironment{tdocbreak}{}{
- \begin{tdoctopic}{\tutodoc@trans@chges@break}
-}{
- \end{tdoctopic}
-}
-
-
-% :: CHANGES - PROBLEM :: %
-
-%%%
-% prototype::
-% :see: env.tdoctopic
-%
-% :action: similar to the \env ''tdoctopic'' with the title "Problem"
-% translated into the good language.
-%%%
-\NewDocumentEnvironment{tdocprob}{}{
- \begin{tdoctopic}{\tutodoc@trans@chges@pb}
-}{
- \end{tdoctopic}
-}
-
-
-% :: CHANGES - FIX :: %
-
-%%%
-% prototype::
-% :see: env.tdoctopic
-%
-% :action: similar to the \env ''tdoctopic'' with the title "Fix"
+% :action: similar to the \env ''tdoctopic'' with the title "New"
% translated into the good language.
%%%
-\NewDocumentEnvironment{tdocfix}{}{
- \begin{tdoctopic}{\tutodoc@trans@chges@fix}
-}{
- \end{tdoctopic}
+\prop_map_inline:Nn \__g_tutodoc_topic_change_prop {
+ \NewDocumentEnvironment{ tdoc#1 } {} {
+ \begin{tdoctopic}{ \use:c { tutodoc@trans@chges@#1 } } [ #2 ]
+ }{
+ \end{tdoctopic}
+ }
}
\ExplSyntaxOff
+% ----------------- %
% -- DECORATIONS -- %
+% ----------------- %
% Source for \addvspace{\medskipamount} instead of \medskip.
% * https://tex.stackexchange.com/a/705938/6880
diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf b/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf
index 506a75b5d2..670d8d9337 100644
--- a/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf
+++ b/macros/latex/contrib/tutodoc/doc/tutodoc-en.pdf
Binary files differ
diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex b/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex
index a66ebc0ea8..81d7e1e40b 100644
--- a/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex
+++ b/macros/latex/contrib/tutodoc/doc/tutodoc-en.tex
@@ -1,27 +1,100 @@
+% ==================== %
+% == RESOURCES USED == %
+% ==================== %
-% -------------------- %
-% -- RESOURCES USED -- %
-% -------------------- %
+\begin{filecontents*}[overwrite]{examples-version-n-change-dating.tex}
+Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\begin{filecontents*}[overwrite]{examples-focus-exa.tex}
-Bla, bla, bla...
+\medskip % CAUTION! This prevents overlapping.
-\begin{tdocexa}
- Ble, ble, ble...
-\end{tdocexa}
+\tdocdate{2023-09-24}
-\begin{tdocexa}[Wonderful]
- Bli, bli, bli...
-\end{tdocexa}
+Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
-\begin{tdocexa}<nonb>
- Blo, blo, blo...
-\end{tdocexa}
+\medskip % CAUTION! This prevents overlapping.
-\begin{tdocexa}<nonb>[Superb]
- Blu, blu, blu...
-\end{tdocexa}
+\tdocdate[gray]{2020-05-08}
+
+Bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli...
+
+Blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo...
+
+Blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu...
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-user-choice-icon.tex}
+\begin{tdoctopic}{Don't look}[\faEyeSlash]
+% An icon from fontawesome5.
+ \item Info 1...
+ \item Info 2...
+\end{tdoctopic}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-user-choice.tex}
+\begin{tdoctopic}{End of icons}
+% This is where the point needs to be put.
+ \item Info 1...
+ \item Info 2...
+\end{tdoctopic}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-update.tex}
+\begin{tdocupdate}
+ \item Info 1...
+ \item Info 2...
+\end{tdocupdate}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-versioning.tex}
+\tdocversion[red]{10.2.0-beta}[2023-12-01]
+
+Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+
+\bigskip % CAUTION! This prevents overlapping.
+
+\tdocversion{10.2.0-alpha}
+
+Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
+ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
+ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
+ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-break.tex}
+\begin{tdocbreak}
+ \item Info 1...
+ \item Info 2...
+\end{tdocbreak}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-pb.tex}
+\begin{tdocprob}
+ \item Info 1...
+ \item Info 2...
+\end{tdocprob}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-new.tex}
+\begin{tdocnew}
+ \item Info 1...
+ \item Info 2...
+\end{tdocnew}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-fix.tex}
+\begin{tdocfix}
+ \item Info 1...
+ \item Info 2...
+\end{tdocfix}
\end{filecontents*}
@@ -38,25 +111,14 @@ Bla, bla, bla...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-focus-rmk.tex}
-\begin{tdocrem}
- Just one remark...
-\end{tdocrem}
-
-\begin{tdocrem}[Mini title]
- Useful?
-\end{tdocrem}
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-focus-tip.tex}
-\begin{tdoctip}
- A tip.
-\end{tdoctip}
+\begin{filecontents*}[overwrite]{examples-focus-important.tex}
+\begin{tdocimp}
+ Important and harmless.
+\end{tdocimp}
-\begin{tdoctip}[Mini title]
+\begin{tdocimp}[Mini title]
Useful?
-\end{tdoctip}
+\end{tdocimp}
\end{filecontents*}
@@ -71,17 +133,6 @@ Bla, bla, bla...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-focus-important.tex}
-\begin{tdocimportant}
- Important and harmless.
-\end{tdocimportant}
-
-\begin{tdocimportant}[Mini title]
- Useful?
-\end{tdocimportant}
-\end{filecontents*}
-
-
\begin{filecontents*}[overwrite]{examples-focus-caution.tex}
\begin{tdoccaution}
Caution, caution...
@@ -93,6 +144,17 @@ Bla, bla, bla...
\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-focus-tip.tex}
+\begin{tdoctip}
+ A tip.
+\end{tdoctip}
+
+\begin{tdoctip}[Mini title]
+ Useful?
+\end{tdoctip}
+\end{filecontents*}
+
+
\begin{filecontents*}[overwrite]{examples-focus-warn.tex}
\begin{tdocwarn}
Avoid the dangers...
@@ -104,52 +166,44 @@ Bla, bla, bla...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-showcase-default.tex}
-\begin{tdocshowcase}
- \bfseries A bit of code \LaTeX.
-
- \bigskip
-
- \emph{\large End of the awful demo.}
-\end{tdocshowcase}
-\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-focus-exa.tex}
+Bla, bla, bla...
+\begin{tdocexa}
+ Ble, ble, ble...
+\end{tdocexa}
-\begin{filecontents*}[overwrite]{examples-showcase-customized.tex}
-\begin{tdocshowcase}[before = My beginning,
- after = My end,
- color = red]
- Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\end{tdocshowcase}
-\end{filecontents*}
+\begin{tdocexa}[Wonderful]
+ Bli, bli, bli...
+\end{tdocexa}
+\begin{tdocexa}<nonb>
+ Blo, blo, blo...
+\end{tdocexa}
-\begin{filecontents*}[overwrite]{examples-showcase-hook.tex}
-\begin{tdocshowcase}
- \string[This works...]
-\end{tdocshowcase}
+\begin{tdocexa}<nonb>[Superb]
+ Blu, blu, blu...
+\end{tdocexa}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip.tex}
-\begin{tdocshowcase}[nostripe]
- Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\end{tdocshowcase}
-\end{filecontents*}
-
+\begin{filecontents*}[overwrite]{examples-focus-rmk.tex}
+\begin{tdocrem}
+ Just one remark...
+\end{tdocrem}
-\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip-customized.tex}
-\begin{tdocshowcase}[nostripe,
- before = My beginning,
- after = My end,
- color = green]
- Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\end{tdocshowcase}
+\begin{tdocrem}[Mini title]
+ Useful?
+\end{tdocrem}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-showcase-external.tex}
-Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
+\begin{filecontents*}[overwrite]{examples-listing-latexshow-options.tex}
+\tdoclatexshow[explain = What comes next is colourful...,
+ before = Rendering below.,
+ after = Finished rendering.,
+ color = orange]
+ {examples-listing-xyz.tex}
\end{filecontents*}
@@ -160,6 +214,12 @@ Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-listing-xyz.tex}
+% Just one demo.
+$x y z = 1$
+\end{filecontents*}
+
+
\begin{filecontents*}[overwrite]{examples-listing-strange.tex}
\begin{tdoclatex}[std]
[Strange... Or not!]
@@ -174,110 +234,58 @@ Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-listing-xyz.tex}
-% Just one demo.
-$x y z = 1$
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-listing-latexshow-options.tex}
-\tdoclatexshow[explain = What comes next is colourful...,
- before = Rendering below.,
- after = Finished rendering.,
- color = orange]
- {examples-listing-xyz.tex}
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-version-n-change-dating.tex}
-Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-
-\medskip % CAUTION! This prevents overlapping.
-
-\tdocdate{2023-09-24}
-
-Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
-
-\medskip % CAUTION! This prevents overlapping.
-
-\tdocdate[gray]{2020-05-08}
-
-Bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli...
-
-Blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo...
-
-Blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu...
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-version-n-change-versioning.tex}
-\tdocversion[red]{10.2.0-beta}[2023-12-01]
-
-Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-
-\bigskip % CAUTION! This prevents overlapping.
-
-\tdocversion{10.2.0-alpha}
-
-Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
-ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
-ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
-ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
+\begin{filecontents*}[overwrite]{examples-showcase-customized.tex}
+\begin{tdocshowcase}[before = My beginning,
+ after = My end,
+ color = red]
+ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-new.tex}
-\begin{tdocnew}
- \item Info 1...
- \item Info 2...
-\end{tdocnew}
+\begin{filecontents*}[overwrite]{examples-showcase-hook.tex}
+\begin{tdocshowcase}
+ \string[This works...]
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-update.tex}
-\begin{tdocupdate}
- \item Info 1...
- \item Info 2...
-\end{tdocupdate}
+\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip-customized.tex}
+\begin{tdocshowcase}[nostripe,
+ before = My beginning,
+ after = My end,
+ color = green]
+ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-break.tex}
-\begin{tdocbreak}
- \item Info 1...
- \item Info 2...
-\end{tdocbreak}
+\begin{filecontents*}[overwrite]{examples-showcase-external.tex}
+Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-pb.tex}
-\begin{tdocprob}
- \item Info 1...
- \item Info 2...
-\end{tdocprob}
-\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-showcase-default.tex}
+\begin{tdocshowcase}
+ \bfseries A bit of code \LaTeX.
+ \bigskip
-\begin{filecontents*}[overwrite]{examples-version-n-change-fix.tex}
-\begin{tdocfix}
- \item Info 1...
- \item Info 2...
-\end{tdocfix}
+ \emph{\large End of the awful demo.}
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-user-choice.tex}
-\begin{tdoctopic}{It's my choice}
-% This is where the point needs to be put.
- \item Info 1...
- \item Info 2...
-\end{tdoctopic}
+\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip.tex}
+\begin{tdocshowcase}[nostripe]
+ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+\end{tdocshowcase}
\end{filecontents*}
-% ------------------------ %
-% -- SOURCE FOR THE DOC -- %
-% ------------------------ %
+% ======================== %
+% == SOURCE FOR THE DOC == %
+% ======================== %
\documentclass[10pt, a4paper]{article}
@@ -288,15 +296,36 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
\usepackage{enumitem}
-\usepackage{tabularray}
+\usepackage{multicol}
+
\usepackage{fmtcount}
\setlength{\parindent}{0em}
+\newcommand\thispack{\tdocpack{tutodoc}}
+
% Package documented.
\usepackage[lang = english]{tutodoc}
+% --------------- %
+% -- IMPORTANT -- %
+% --------------- %
+%
+% See the French version of this file for the text to be used
+% for languages other than English.
+
+
+% --------------- %
+% -- IMPORTANT -- %
+% --------------- %
+%
+% See the French version of this file for the text to be used
+% for languages other than English.
+
+
+% == FORDOC == %
+
% Source.
% * https://tex.stackexchange.com/a/604698/6880
@@ -311,6 +340,8 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
}
+% == FORDOC == %
+
% Source.
% * https://tex.stackexchange.com/a/604698/6880
@@ -340,36 +371,42 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
}
-
\begin{document}
-\title{The \texttt{tutodoc} package - Tutorial-type documentation}
+
+\title{The \texttt{tutodoc} package - Tutorial-style documentation}
\author{Christophe BAL}
-\date{23 Aug. 2024 - Version 1.2.0-a}
+\date{Sep 25, 2024 - Version 1.3.0}
\maketitle
\begin{abstract}
-The \tdocpack{tutodoc} package
-\footnote{
- The name comes from \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}}.
-}
-is used by its author to semantically produce documentation of \LaTeX\ packages and classes in a tutorial style
-\footnote{
- The idea is to produce an efficient \texttt{PDF} file that can be browsed for one-off needs. This is generally what is expected of coding documentation.
-},
-and with a sober rendering for reading on screen.
+ The \thispack{} package
+ \footnote{
+ The name comes from \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}}.
+ }
+ is used by its author to semantically produce documentation of \LaTeX\ packages and classes in a tutorial style
+ \footnote{
+ The idea is to produce an efficient \texttt{PDF} file that can be browsed for one-off needs. This is generally what is expected of coding documentation.
+ },
+ and with a sober rendering for reading on screen.
+ \medskip
-\begin{tdocnote}
- This package imposes a formatting style. In the not-too-distant future, \tdocpack{tutodoc} will probably be split into a class and a package.
-\end{tdocnote}
+ Two important points to note.
+ \begin{itemize}
+ \item This package imposes a formatting style. In the not-too-distant future, \thispack{} will probably be split into a class and a package.
+
+ \item This documentation is also available in French.
+ \end{itemize}
\end{abstract}
\newpage
\tableofcontents
\newpage
+
+
\section{General formatting imposed}
\subsection{Page geometry}
@@ -458,7 +495,7 @@ The \tdocpack{hyperref} package is imported behind the scenes with the settings
\section{Select language when loading package}
-By default, \tdocpack{tutodoc} is set for English, but it is possible to change the language: for example, a French documentation will use \tdocinlatex|\usepackage[lang = french]{tutodoc}| .
+By default, \thispack{} is set for English, but it is possible to change the language: for example, a French documentation will use \tdocinlatex|\usepackage[lang = french]{tutodoc}| .
For the moment, we only have the following two choices.
\begin{enumerate}
@@ -487,7 +524,7 @@ The macro \tdocmacro{tdocinEN} and its starred version are based on \tdocmacro{t
\begin{tdocnote}
- As the text \tdocquote{in English} is translated into the language indicated when \tdocpack{tutodoc} is imported, the macro \tdocmacro{tdocinEN} and its starred version become useful for non-English speakers.
+ As the text \tdocquote{in English} is translated into the language indicated when \thispack{} is imported, the macro \tdocmacro{tdocinEN} and its starred version become useful for non-English speakers.
\end{tdocnote}
@@ -496,15 +533,13 @@ The macro \tdocmacro{tdocinEN} and its starred version are based on \tdocmacro{t
\begin{tdocnote}
The environments presented in this section
\footnote{
- The formatting comes from the \tdocpack{amsthm} package.
+ The formatting comes from the \tdocpack{keytheorems} package.
}
add a short title indicating the type of information provided.
- This short text will always be translated into the language indicated when the \tdocpack{tutodoc} package is loaded.
+ This short text will always be translated into the language indicated when the \thispack{} package is loaded.
\end{tdocnote}
-% ------------------ %
-
\subsection{Examples}
@@ -522,12 +557,13 @@ Here are some possible uses.
\tdoclatexinput[sbs]{examples-focus-exa.tex}
+
% ------------------ %
-\begin{tdocimportant}
+\begin{tdocimp}
The numbering of the examples is reset to zero as soon as a section with a level at least equal to a \tdocinlatex|\subsubsection| is opened.
-\end{tdocimportant}
+\end{tdocimp}
% ------------------ %
@@ -537,6 +573,7 @@ Here are some possible uses.
It can sometimes be useful to return to the line at the start of the content. Here's how to do it (this trick remains valid for the environments presented in the following sub-sections). Note in passing that the numbering follows that of the previous example as desired.
\tdoclatexinput[sbs]{examples-focus-exa-leavevmode.tex}
+
\end{tdoctip}
@@ -547,6 +584,7 @@ Everything happens via the \tdocenv{tdocrem} environment, as in the following ex
\tdoclatexinput[sbs]{examples-focus-rmk.tex}
+
\subsection{A tip}
The \tdocenv{tdoctip} environment is used to give tips. Here's how to use it.
@@ -554,6 +592,19 @@ The \tdocenv{tdoctip} environment is used to give tips. Here's how to use it.
\tdoclatexinput[sbs]{examples-focus-tip.tex}
+
+\smallskip
+
+\begin{tdocnote}
+ Colors are provided by the extensible macros \tdocmacro{tdocbackcolor} and \tdocmacro{tdocdarkcolor}, which have the following codes.
+
+ \begin{tdoclatex}[code]
+\NewExpandableDocumentCommand{\tdocbackcolor}{m}{#1!5}
+\NewExpandableDocumentCommand{\tdocdarkcolor}{m}{#1!50!black}
+ \end{tdoclatex}
+\end{tdocnote}
+
+
\subsection{Informative note}
The \tdocenv{tdocnote} environment is used to highlight useful information. Here's how to use it.
@@ -561,13 +612,15 @@ The \tdocenv{tdocnote} environment is used to highlight useful information. Here
\tdoclatexinput[sbs]{examples-focus-note.tex}
+
\subsection{Something important}
-The \tdocenv{tdocimportant} environment is used to indicate something important but harmless.
+The \tdocenv{tdocimp} environment is used to indicate something important but harmless.
\tdoclatexinput[sbs]{examples-focus-important.tex}
+
\subsection{Caution about a delicate point}
The \tdocenv{tdoccaution} environment is used to indicate a delicate point to the user. Here's how to use it.
@@ -575,6 +628,7 @@ The \tdocenv{tdoccaution} environment is used to indicate a delicate point to th
\tdoclatexinput[sbs]{examples-focus-caution.tex}
+
\subsection{Warning of danger}
The \tdocenv{tdocwarn} environment is used to warn the user of a trap to avoid. Here's how to use it.
@@ -582,6 +636,7 @@ The \tdocenv{tdocwarn} environment is used to warn the user of a trap to avoid.
\tdoclatexinput[sbs]{examples-focus-warn.tex}
+
\section{Specify packages, classes, macros or environments}
Here's what you can type semantically.
@@ -621,8 +676,6 @@ We also have :
\end{tdocwarn}
-% -------------------- %
-
\section{Origin of a prefix or suffix}
@@ -648,30 +701,30 @@ To explain the names chosen, there is nothing like indicating and explaining the
It is sometimes useful to render code directly in the documentation. This type of rendering must be dissociable from the explanatory text.
-% ------------------ %
-
\subsection{With a coloured stripe}
\begin{tdocexa} [With default text]
- It can be useful to show a real rendering directly in a document
+ It can be useful to show a real rendering directly in a document.
\footnote{
Typically when making a demo.
- }.
+ }
This is done via \tdocenv{tdocshowcase} as follows.
\tdoclatexinput[code]{examples-showcase-default.tex}
- The result is the following rendering
+
+ The result is the following rendering.
\footnote{
Behind the scenes, the strip is created effortlessly using the \tdocpack{clrstrip} package.
- }.
+ }
+\end{tdocexa}
+
+\input{examples-showcase-default.tex}
- \medskip
- \input{examples-showcase-default.tex}
-\end{tdocexa}
+\smallskip
\begin{tdocrem}
See the section \ref{tdoc-latexshow} on page \pageref{tdoc-latexshow} to easily obtain code followed by its actual rendering as in the previous example.
@@ -679,7 +732,7 @@ It is sometimes useful to render code directly in the documentation. This type o
\begin{tdocnote}
- The explanatory texts adapt to the language chosen when \tdocpack{tutodoc} is loaded.
+ The explanatory texts adapt to the language chosen when \thispack{} is loaded.
\end{tdocnote}
@@ -691,21 +744,36 @@ It is sometimes useful to render code directly in the documentation. This type o
\tdoclatexinput[code]{examples-showcase-customized.tex}
+
This will produce the following.
\medskip
\input{examples-showcase-customized.tex}
+
\end{tdocexa}
\begin{tdocnote}
- You will have noticed that we don't obtain a pure red: behind the scenes, the expandable macros \tdocmacro{tdocbackcolor} and \tdocmacro{tdocdarkcolor} are used to create the background and title colours respectively from the ones proposed in \tdocenv{tdocshowcase}.
- These macros have a single argument, the chosen colour, and accept the following codes.
+ You've probably noticed that red is used as a base to obtain the colors used.
+
+ \begin{itemize}
+ \item The background color is provided by \tdocmacro{tdocbackcolor}.
+
+ \item The color of titles and lines is provided by \tdocmacro{tdocdarkcolor}.
+ \end{itemize}
+
+ These expandable macros have a single argument, the chosen color, and accept the following codes.
\begin{tdoclatex}[code]
-\NewExpandableDocumentCommand{\tdocbackcolor}{m}{#1!5}
-\NewExpandableDocumentCommand{\tdocdarkcolor}{m}{#1!50!black}
+\NewExpandableDocumentCommand{tdocbackcolor}{m}{#1!5}
+\NewExpandableDocumentCommand{tdocdarkcolor}{m}{#1!50!black}
+ \end{tdoclatex}
+
+ You also have to know that behind the scene, the \tdocmacro{tdocruler} macro is used.
+
+ \begin{tdoclatex}[std]
+ \tdocruler{A decorated pseudo-title}{red}
\end{tdoclatex}
\end{tdocnote}
@@ -718,21 +786,13 @@ It is sometimes useful to render code directly in the documentation. This type o
\tdoclatexinput[code]{examples-showcase-hook.tex}
- This will produce the following.
- \medskip
-
- \input{examples-showcase-hook.tex}
+ This will produce the following.
\end{tdocwarn}
-\begin{tdocnote}
- Behind the scenes, the \tdocmacro{tdocruler} macro is used.
+\input{examples-showcase-hook.tex}
- \begin{tdoclatex}[std]
- \tdocruler{Un pseudo-titre décoré}{red}
- \end{tdoclatex}
-\end{tdocnote}
\subsection{Without a colour strip}
@@ -747,11 +807,13 @@ It is possible not to use a coloured strip, as we will see straight away.
\tdoclatexinput[code]{examples-showcase-no-clrstrip.tex}
+
This will produce the following.
\medskip
\input{examples-showcase-no-clrstrip.tex}
+
\end{tdocexa}
@@ -763,11 +825,13 @@ It is possible not to use a coloured strip, as we will see straight away.
\tdoclatexinput[code]{examples-showcase-no-clrstrip-customized.tex}
+
This will produce the following.
\medskip
\input{examples-showcase-no-clrstrip-customized.tex}
+
\end{tdocexa}
@@ -783,6 +847,7 @@ To obtain renderings by importing the code from an external file, instead of typ
\tdocshowcaseinput{examples-showcase-external.tex}
+
\medskip
As for \tdocinlatex+\tdocshowcaseinput[color = orange]{external.tex}+\,, this will produce the colour change shown below.
@@ -790,15 +855,16 @@ To obtain renderings by importing the code from an external file, instead of typ
\medskip
\tdocshowcaseinput[color = orange]{examples-showcase-external.tex}
+
\end{tdocexa}
\section{Use cases in \LaTeX}
-Documenting a package or a class is done efficiently using use cases showing both the code and the corresponding result.
-
-
-% ------------------ %
+Documenting a package or class is best done through use cases showing both the code and the corresponding result.
+\footnote{
+ Code is formatted using the \tdocpack{minted} package.
+}
\subsection{\tdocquote{Inline} codes} \label{tdoc-listing-inline}
@@ -822,7 +888,7 @@ Here are some examples.
The \tdocmacro{tdocinlatex} macro can be used in a footnote: see below.
\footnote{
\tdocinlatex+$minted = TOP$+ has been typed \tdocinlatex|\tdocinlatex+$minted = TOP$+| in this footnote...
- }.
+ }
In addition, a background color is deliberately used to subtly highlight the codes \tdocinlatex#\LaTeX#\,.
\end{tdocnote}
@@ -835,6 +901,7 @@ Here are some examples.
\begin{tdocexa}[Side by side]
Using \tdocenv[{[sbs]}]{tdoclatex}, we can display a code and its rendering side by side.
\tdocdocbasicinput{examples-listing-ABC.tex}
+
\end{tdocexa}
@@ -842,10 +909,10 @@ Here are some examples.
\begin{tdocexa}[Following]
- \tdocenv{tdoclatex} produces the following result, which corresponds to the default option \tdocinlatex#std#
+ \tdocenv{tdoclatex} produces the following result, which corresponds to the default option \tdocinlatex#std#\,.
\footnote{
\tdocinlatex{std} refers to the \tdocquote{standard} behaviour of \tdocpack{tcolorbox} in relation to the \tdocpack{minted} library.
- }.
+ }
\begin{tdoclatex}
$A = B + C$
@@ -872,10 +939,12 @@ Here are some examples.
With default formatting, if the code begins with an opening bracket, the default option must be explicitly indicated.
\tdocdocbasicinput{examples-listing-strange.tex}
+
\smallskip
Another method is to use the \tdocmacro{string} primitive.
\tdocdocbasicinput{examples-listing-strange-bis.tex}
+
\end{tdocwarn}
@@ -885,6 +954,7 @@ For the following codes, consider a file with the relative path \verb+examples-l
\tdoclatexinput[code]{examples-listing-xyz.tex}
+
\medskip
The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file and offers the same options as the \tdocenv{tdoclatex} environment.
@@ -898,11 +968,13 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\begin{tdoclatex}[code]
\tdoclatexinput[sbs]{examples-listing-xyz.tex}
+
\end{tdoclatex}
This produces the following layout.
\tdoclatexinput[sbs]{examples-listing-xyz.tex}
+
\end{tdocexa}
@@ -914,11 +986,13 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\begin{tdoclatex}[code]
\tdoclatexinput{examples-listing-xyz.tex}
+
\end{tdoclatex}
This produces the following formatting where the default option is \tdocinlatex#std#.
\tdoclatexinput{examples-listing-xyz.tex}
+
\end{tdocexa}
@@ -930,11 +1004,13 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\begin{tdoclatex}[code]
\tdoclatexinput[code]{examples-listing-xyz.tex}
+
\end{tdoclatex}
This produces the following layout.
\tdoclatexinput[code]{examples-listing-xyz.tex}
+
\end{tdocexa}
@@ -950,12 +1026,13 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\begin{tdoc-doc-showcase}
\tdoclatexshow{examples-listing-xyz.tex}
+
\end{tdoc-doc-showcase}
\end{tdocexa}
\begin{tdocnote}
- The default texts take into account the language chosen when loading the package \tdocpack{tutodoc}.
+ The default texts take into account the language chosen when loading the package \thispack{}.
\end{tdocnote}
@@ -969,6 +1046,7 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\begin{tdoc-doc-showcase}
\tdoclatexshow[explain = Here is the actual rendering.]{examples-listing-xyz.tex}
+
\end{tdoc-doc-showcase}
\end{tdocexa}
@@ -984,6 +1062,7 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\tdoclatexinput[code]{examples-listing-latexshow-options.tex}
+
\medskip
This will produce the following.
@@ -992,6 +1071,7 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
\begin{tdoc-doc-showcase}
\input{examples-listing-latexshow-options.tex}
+
\end{tdoc-doc-showcase}
\end{tdocexa}
@@ -1001,8 +1081,6 @@ The \tdocmacro{tdoclatexinput} macro, shown below, expects the path of a file an
To make it easier to monitor a package, it is essential to provide a history indicating the changes made when a new version is published.
-% ------------------ %
-
\subsection{When?}
@@ -1016,6 +1094,7 @@ You can either date something, or version it, in which case the version number c
The \tdocmacro{tdocdate} macro is used to indicate a date in the margin, as in the following example.
\tdoclatexshow{examples-version-n-change-dating.tex}
+
\end{tdocexa}
@@ -1026,18 +1105,17 @@ You can either date something, or version it, in which case the version number c
Associating a version number with a new feature is done using the \tdocmacro{tdocversion} macro, with the colour and date being optional arguments.
\tdoclatexshow{examples-version-n-change-versioning.tex}
-\end{tdocexa}
+\end{tdocexa}
-\begin{tdocimportant}
- \leavevmode
+\begin{tdocimp}
\begin{enumerate}
\item The \tdocmacro{tdocdate} and \tdocmacro{tdocversion} macros require two compilations.
- \item The final rendering of the dates takes into account the language specified when loading the package \tdocpack{tutodoc}: for example, if French is selected, the dates will be displayed in the format \texttt{DD/MM/YYYY}.
+ \item The final rendering of the dates takes into account the language specified when loading the package \thispack{}: for example, if French is selected, the dates will be displayed in the format \texttt{DD/MM/YYYY}.
\end{enumerate}
-\end{tdocimportant}
+\end{tdocimp}
\begin{tdocwarn}
@@ -1051,17 +1129,17 @@ You can either date something, or version it, in which case the version number c
\subsection{What's new?}
-\tdocpack{tutodoc} offers different environments to indicate quickly and clearly what has been done
+\thispack{} offers different environments to indicate quickly and clearly what has been done during the latest changes.%
\footnote{
The user doesn't need all the technical details.
}
-during the latest changes.
\begin{tdocexa}[For new features]
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-new.tex}
+
\end{tdocexa}
@@ -1072,6 +1150,7 @@ during the latest changes.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-update.tex}
+
\end{tdocexa}
@@ -1082,6 +1161,7 @@ during the latest changes.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-break.tex}
+
\end{tdocexa}
@@ -1092,6 +1172,7 @@ during the latest changes.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-pb.tex}
+
\end{tdocexa}
@@ -1102,16 +1183,29 @@ during the latest changes.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-fix.tex}
+
\end{tdocexa}
% ------------------ %
-\begin{tdocexa}[Chosen topics]
+\begin{tdocexa}[Selectable themes with an icon]
+ \leavevmode
+
+ \tdoclatexinput[sbs]{examples-version-n-change-user-choice-icon.tex}
+
+\end{tdocexa}
+
+
+% ------------------ %
+
+
+\begin{tdocexa}[Selectable themes without icons]
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-user-choice.tex}
+
\end{tdocexa}
@@ -1147,54 +1241,106 @@ Blo, blo, blo...
Blu, blu, blu...
\end{tdoclatex}
+
+
\section{History}
+\small
+
+\tdocversion{1.3.0}[2024-09-25]
+
+\begin{tdocprob}
+ \item Version 3 of \tdocpack{minted} cannot be used for the moment as it contains bugs: see \url{https://github.com/gpoore/minted/issues/401}. We therefore force the use of version 2 of \tdocpack{minted}.
+\end{tdocprob}
+
+
+\begin{tdocbreak}
+ \item The \verb#tdocimportant# environment has been renamed \verb#tdocimp# for simplified input.
+\end{tdocbreak}
+
+
+\begin{tdocnew}
+ \item Change log: proposed environments use icons.
+
+
+ \item Content highlighting: colored frames with icons are proposed for the following environments.
+ \bgroup
+ \setlength{multicolsep}{3.0pt plus 1.0pt minus 0.75pt}
+ \begin{multicols}{3}
+ \begin{enumerate}
+ \item \verb#tdoccaution#
+ \item \verb#tdocimp#
+ \item \verb#tdocnote#
+ \item \verb#tdoctip#
+ \item \verb#tdocwarn#
+ \end{enumerate}
+ \end{multicols}
+ \egroup
+\end{tdocnew}
+
+\tdocsep
+
+
+% ------------------ %
+
+
\tdocversion{1.2.0-a}[2024-08-23]
\begin{tdocupdate}
- \item \tdocmacro{tdocversion}
+ \item \tdocmacro{tdocversion}
\begin{enumerate}
- \item The version number is above the date.
+ \item The version number is above the date.
- \item The spacing is better managed when the date is absent.
+ \item The spacing is better managed when the date is absent.
\end{enumerate}
\end{tdocupdate}
\begin{tdocfix}
- \item Content highlighting: the French translations of \tdocinEN*{caution} and \tdocinEN*{danger} were incorrect.
+ \item Content highlighting: the French translations of \tdocinEN*{caution} and \tdocinEN*{danger} were incorrect.
\end{tdocfix}
\tdocsep
+
+% ------------------ %
+
+
\tdocversion{1.1.0}[2024-01-06]
\begin{tdocnew}
- \item Change log : two new environments.
+ \item Change log : two new environments.
\begin{enumerate}
\item \tdocenv{tdocbreak} for breaking changes which are not backward compatible.
\item \tdocenv{tdocprob} for identified problems.
\end{enumerate}
- \item \tdocmacro{tdocinlatex}: a light yellow is used as the background color.
+ \item \tdocmacro{tdocinlatex}: a light yellow is used as the background color.
\end{tdocnew}
\tdocsep
+
+% ------------------ %
+
+
\tdocversion{1.0.1}[2023-12-08]
\begin{tdocfix}
- \item \tdocmacro{tdocenv}: spacing is now correct, even if the \tdocpack{babel} package is not loaded with the French language.
+ \item \tdocmacro{tdocenv}: spacing is now correct, even if the \tdocpack{babel} package is not loaded with the French language.
- \item \tdocenv[{[nostripe]}]{tdocshowcase}: page breaks around \tdocquote{framing} lines should be rare from now on.
+ \item \tdocenv[{[nostripe]}]{tdocshowcase}: page breaks around \tdocquote{framing} lines should be rare from now on.
\end{tdocfix}
\tdocsep
+
+% ------------------ %
+
+
\tdocversion{1.0.0}[2023-11-29]
First public version of the project.
-
\end{document}
diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf
index 070a6b3f5a..8dba0b257b 100644
--- a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf
+++ b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.pdf
Binary files differ
diff --git a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex
index 011e390f25..97159d3759 100644
--- a/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex
+++ b/macros/latex/contrib/tutodoc/doc/tutodoc-fr.tex
@@ -1,27 +1,100 @@
+% ==================== %
+% == RESOURCES USED == %
+% ==================== %
-% -------------------- %
-% -- RESOURCES USED -- %
-% -------------------- %
+\begin{filecontents*}[overwrite]{examples-version-n-change-dating.tex}
+Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\begin{filecontents*}[overwrite]{examples-focus-exa.tex}
-Bla, bla, bla...
+\medskip % ATTENTION ! Ceci évite le chevauchement.
-\begin{tdocexa}
- Ble, ble, ble...
-\end{tdocexa}
+\tdocdate{2023-09-24}
-\begin{tdocexa}[Magnifique]
- Bli, bli, bli...
-\end{tdocexa}
+Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
-\begin{tdocexa}<nonb>
- Blo, blo, blo...
-\end{tdocexa}
+\medskip % ATTENTION ! Ceci évite le chevauchement.
-\begin{tdocexa}<nonb>[Superbe]
- Blu, blu, blu...
-\end{tdocexa}
+\tdocdate[gray]{2020-05-08}
+
+Bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli...
+
+Blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo...
+
+Blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu...
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-user-choice-icon.tex}
+\begin{tdoctopic}{Ne pas regarder}[\faEyeSlash]
+% Une icône venant de fontawesome5.
+ \item Info 1...
+ \item Info 2...
+\end{tdoctopic}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-user-choice.tex}
+\begin{tdoctopic}{La fin des icônes}
+% Ici le point s'impose.
+ \item Info 1...
+ \item Info 2...
+\end{tdoctopic}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-update.tex}
+\begin{tdocupdate}
+ \item Info 1...
+ \item Info 2...
+\end{tdocupdate}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-versioning.tex}
+\tdocversion[red]{10.2.0-beta}[2023-12-01]
+
+Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+
+\bigskip % ATTENTION ! Ceci évite le chevauchement.
+
+\tdocversion{10.2.0-alpha}
+
+Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
+ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
+ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
+ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-break.tex}
+\begin{tdocbreak}
+ \item Info 1...
+ \item Info 2...
+\end{tdocbreak}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-pb.tex}
+\begin{tdocprob}
+ \item Info 1...
+ \item Info 2...
+\end{tdocprob}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-new.tex}
+\begin{tdocnew}
+ \item Info 1...
+ \item Info 2...
+\end{tdocnew}
+\end{filecontents*}
+
+
+\begin{filecontents*}[overwrite]{examples-version-n-change-fix.tex}
+\begin{tdocfix}
+ \item Info 1...
+ \item Info 2...
+\end{tdocfix}
\end{filecontents*}
@@ -38,25 +111,14 @@ Bla, bla, bla...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-focus-rmk.tex}
-\begin{tdocrem}
- Juste une remarque...
-\end{tdocrem}
-
-\begin{tdocrem}[Mini titre]
- Utile ?
-\end{tdocrem}
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-focus-tip.tex}
-\begin{tdoctip}
- Une astuce.
-\end{tdoctip}
+\begin{filecontents*}[overwrite]{examples-focus-important.tex}
+\begin{tdocimp}
+ Un truc important sans danger.
+\end{tdocimp}
-\begin{tdoctip}[Mini titre]
+\begin{tdocimp}[Mini titre]
Utile ?
-\end{tdoctip}
+\end{tdocimp}
\end{filecontents*}
@@ -71,17 +133,6 @@ Bla, bla, bla...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-focus-important.tex}
-\begin{tdocimportant}
- Un truc important sans danger.
-\end{tdocimportant}
-
-\begin{tdocimportant}[Mini titre]
- Utile ?
-\end{tdocimportant}
-\end{filecontents*}
-
-
\begin{filecontents*}[overwrite]{examples-focus-caution.tex}
\begin{tdoccaution}
Prudence, prudence...
@@ -93,6 +144,17 @@ Bla, bla, bla...
\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-focus-tip.tex}
+\begin{tdoctip}
+ Une astuce.
+\end{tdoctip}
+
+\begin{tdoctip}[Mini titre]
+ Utile ?
+\end{tdoctip}
+\end{filecontents*}
+
+
\begin{filecontents*}[overwrite]{examples-focus-warn.tex}
\begin{tdocwarn}
Evitez les dangers...
@@ -104,52 +166,44 @@ Bla, bla, bla...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-showcase-default.tex}
-\begin{tdocshowcase}
- \bfseries Un peu de code \LaTeX.
-
- \bigskip
-
- \emph{\large Fin de l'affreuse démo.}
-\end{tdocshowcase}
-\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-focus-exa.tex}
+Bla, bla, bla...
+\begin{tdocexa}
+ Ble, ble, ble...
+\end{tdocexa}
-\begin{filecontents*}[overwrite]{examples-showcase-customized.tex}
-\begin{tdocshowcase}[before = Mon début,
- after = Ma fin à moi,
- color = red]
- Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\end{tdocshowcase}
-\end{filecontents*}
+\begin{tdocexa}[Magnifique]
+ Bli, bli, bli...
+\end{tdocexa}
+\begin{tdocexa}<nonb>
+ Blo, blo, blo...
+\end{tdocexa}
-\begin{filecontents*}[overwrite]{examples-showcase-hook.tex}
-\begin{tdocshowcase}
- \string[Cela fonctionne...]
-\end{tdocshowcase}
+\begin{tdocexa}<nonb>[Superbe]
+ Blu, blu, blu...
+\end{tdocexa}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip.tex}
-\begin{tdocshowcase}[nostripe]
- Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\end{tdocshowcase}
-\end{filecontents*}
-
+\begin{filecontents*}[overwrite]{examples-focus-rmk.tex}
+\begin{tdocrem}
+ Juste une remarque...
+\end{tdocrem}
-\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip-customized.tex}
-\begin{tdocshowcase}[nostripe,
- before = Mon début,
- after = Ma fin à moi,
- color = green]
- Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-\end{tdocshowcase}
+\begin{tdocrem}[Mini titre]
+ Utile ?
+\end{tdocrem}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-showcase-external.tex}
-Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
+\begin{filecontents*}[overwrite]{examples-listing-latexshow-options.tex}
+\tdoclatexshow[explain = Ce qui vient est coloré...,
+ before = Rendu ci-après.,
+ after = Rendu fini.,
+ color = orange]
+ {examples-listing-xyz.tex}
\end{filecontents*}
@@ -160,6 +214,12 @@ Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-listing-xyz.tex}
+% Juste une démo.
+$x y z = 1$
+\end{filecontents*}
+
+
\begin{filecontents*}[overwrite]{examples-listing-strange.tex}
\begin{tdoclatex}[std]
[Étrange... Ou pas !]
@@ -174,110 +234,58 @@ Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-listing-xyz.tex}
-% Juste une démo.
-$x y z = 1$
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-listing-latexshow-options.tex}
-\tdoclatexshow[explain = Ce qui vient est coloré...,
- before = Rendu ci-après.,
- after = Rendu fini.,
- color = orange]
- {examples-listing-xyz.tex}
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-version-n-change-dating.tex}
-Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-
-\medskip % ATTENTION ! Ceci évite le chevauchement.
-
-\tdocdate{2023-09-24}
-
-Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
-
-\medskip % ATTENTION ! Ceci évite le chevauchement.
-
-\tdocdate[gray]{2020-05-08}
-
-Bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli, bli...
-
-Blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo, blo...
-
-Blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu, blu...
-\end{filecontents*}
-
-
-\begin{filecontents*}[overwrite]{examples-version-n-change-versioning.tex}
-\tdocversion[red]{10.2.0-beta}[2023-12-01]
-
-Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
-
-\bigskip % ATTENTION ! Ceci évite le chevauchement.
-
-\tdocversion{10.2.0-alpha}
-
-Ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
-ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
-ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble,
-ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
+\begin{filecontents*}[overwrite]{examples-showcase-customized.tex}
+\begin{tdocshowcase}[before = Mon début,
+ after = Ma fin à moi,
+ color = red]
+ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-new.tex}
-\begin{tdocnew}
- \item Info 1...
- \item Info 2...
-\end{tdocnew}
+\begin{filecontents*}[overwrite]{examples-showcase-hook.tex}
+\begin{tdocshowcase}
+ \string[Cela fonctionne...]
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-update.tex}
-\begin{tdocupdate}
- \item Info 1...
- \item Info 2...
-\end{tdocupdate}
+\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip-customized.tex}
+\begin{tdocshowcase}[nostripe,
+ before = Mon début,
+ after = Ma fin à moi,
+ color = green]
+ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-break.tex}
-\begin{tdocbreak}
- \item Info 1...
- \item Info 2...
-\end{tdocbreak}
+\begin{filecontents*}[overwrite]{examples-showcase-external.tex}
+Blablobli, blablobli, blablobli, blablobli, blablobli, blablobli...
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-pb.tex}
-\begin{tdocprob}
- \item Info 1...
- \item Info 2...
-\end{tdocprob}
-\end{filecontents*}
+\begin{filecontents*}[overwrite]{examples-showcase-default.tex}
+\begin{tdocshowcase}
+ \bfseries Un peu de code \LaTeX.
+ \bigskip
-\begin{filecontents*}[overwrite]{examples-version-n-change-fix.tex}
-\begin{tdocfix}
- \item Info 1...
- \item Info 2...
-\end{tdocfix}
+ \emph{\large Fin de l'affreuse démo.}
+\end{tdocshowcase}
\end{filecontents*}
-\begin{filecontents*}[overwrite]{examples-version-n-change-user-choice.tex}
-\begin{tdoctopic}{C'est mon choix}
-% Ici le point s'impose.
- \item Info 1...
- \item Info 2...
-\end{tdoctopic}
+\begin{filecontents*}[overwrite]{examples-showcase-no-clrstrip.tex}
+\begin{tdocshowcase}[nostripe]
+ Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla, bla...
+\end{tdocshowcase}
\end{filecontents*}
-% ------------------------ %
-% -- SOURCE FOR THE DOC -- %
-% ------------------------ %
+% ======================== %
+% == SOURCE FOR THE DOC == %
+% ======================== %
\documentclass[10pt, a4paper]{article}
@@ -289,6 +297,10 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
\usepackage{enumitem}
\frenchsetup{StandardItemLabels=true}
+\usepackage{multicol}
+
+\newcommand\thispack{\tdocpack{tutodoc}}
+
% Package documented.
\usepackage[lang = french]{tutodoc}
@@ -336,57 +348,71 @@ ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble, ble...
}
-
\begin{document}
+
\title{Le package \texttt{tutodoc} - Documentation de type tutoriel}
\author{Christophe BAL}
-\date{23 Août 2024 - Version 1.2.0-a}
+\date{25 sept. 2024 - Version 1.3.0}
\maketitle
\begin{abstract}
-Le package \tdocpack{tutodoc}
-\footnote{
- Le nom vient de \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}} se traduit en \tdocquote{documentation de type tutoriel}.
-}
-est utilisé par son auteur pour produire de façon sémantique des documentations de packages et de classes \LaTeX\ dans un style de type tutoriel
-\footnote{
- L'idée est de produire un fichier \texttt{PDF} efficace à parcourir pour des besoins ponctuels. C'est généralement ce que l'on attend d'une documentation liée au codage.
-},
-et avec un rendu sobre pour une lecture sur écran.
-
-
-\begin{tdocnote}
- Ce package impose un style de mise en forme.
- Dans un avenir plus ou moins proche, \tdocpack{tutodoc} sera sûrement éclaté en une classe et un package.
-\end{tdocnote}
-
-\tdocsep
-
-{\small\itshape
-\textbf{Abstract.}
-The \tdocpack{tutodoc} package
-\footnote{
- The name comes from \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}}.
-}
-is used by its author to semantically produce documentation of \LaTeX\ packages and classes in a tutorial style
-\footnote{
- The idea is to produce an efficient \texttt{PDF} file that can be browsed for one-off needs. This is generally what is expected of coding documentation.
-},
-and with a sober rendering for reading on screen.
+ Le package \thispack{}
+ \footnote{
+ Le nom vient de \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}} qui se traduit en \tdocquote{documentation de type tutoriel}.
+ }
+ est utilisé par son auteur pour produire de façon sémantique des documentations de packages et de classes \LaTeX\ dans un style de type tutoriel
+ \footnote{
+ L'idée est de produire un fichier \texttt{PDF} efficace à parcourir pour des besoins ponctuels. C'est généralement ce que l'on attend d'une documentation liée au codage.
+ },
+ et avec un rendu sobre pour une lecture sur écran.
+ \medskip
-\begin{tdocnote}
- This package imposes a formatting style. In the not-too-distant future, \tdocpack{tutodoc} will probably be split into a class and a package.
-\end{tdocnote}
-}
+ \noindent
+ Deux points importants à noter.
+ \begin{itemize}
+ \item Ce package impose un style de mise en forme. Dans un avenir plus ou moins proche, \thispack{} sera sûrement éclaté en une classe et un package.
+
+ \item Cette documentation est aussi disponible en anglais.
+ \end{itemize}
+
+ \tdocsep
+
+ {\small\itshape
+ \vspace{-5pt}
+ \begin{center}
+ \textbf{Abstract.}
+ \end{center}
+
+ The \thispack{} package
+ \footnote{
+ The name comes from \tdocquote{\tdocprewhy{tuto.rial-type} \tdocprewhy{doc.umentation}}.
+ }
+ is used by its author to semantically produce documentation of \LaTeX\ packages and classes in a tutorial style
+ \footnote{
+ The idea is to produce an efficient \texttt{PDF} file that can be browsed for one-off needs. This is generally what is expected of coding documentation.
+ },
+ and with a sober rendering for reading on screen.
+
+ \medskip
+
+ Two important points to note.
+ \begin{itemize}
+ \item This package imposes a formatting style. In the not-too-distant future, \thispack{} will probably be split into a class and a package.
+
+ \item This documentation is also available in French.
+ \end{itemize}
+ }
\end{abstract}
\newpage
\tableofcontents
\newpage
+
+
\section{Mises en forme générales imposées}
\subsection{Géométrie de la page}
@@ -504,7 +530,7 @@ La macro \tdocmacro{tdocinEN} et sa version étoilée s'appuient sur \tdocmacro{
\begin{tdocnote}
- Le texte \tdocquote{en anglais} est traduit dans la langue indiquée lors de l'importation de \tdocpack{tutodoc}.
+ Le texte \tdocquote{en anglais} est traduit dans la langue indiquée lors de l'importation de \thispack{}.
\end{tdocnote}
@@ -513,15 +539,13 @@ La macro \tdocmacro{tdocinEN} et sa version étoilée s'appuient sur \tdocmacro{
\begin{tdocnote}
Les environnements présentés dans cette section
\footnote{
- La mise en forme provient du package \tdocpack{amsthm}.
+ La mise en forme provient du package \tdocpack{keytheorems}.
}
ajoutent un court titre indiquant le type d'informations fournies.
- Ce court texte sera toujours traduit dans la langue indiquée lors du chargement du package \tdocpack{tutodoc}.
+ Ce court texte sera toujours traduit dans la langue indiquée lors du chargement du package \thispack{}.
\end{tdocnote}
-% ------------------ %
-
\subsection{Des exemples}
@@ -539,12 +563,13 @@ Voici différents emplois possibles.
\tdoclatexinput[sbs]{examples-focus-exa.tex}
+
% ------------------ %
-\begin{tdocimportant}
+\begin{tdocimp}
La numérotation des exemples est remise à zéro dès qu'une section de niveau au moins égale à une \tdocinlatex|\subsubsection| est ouverte.
-\end{tdocimportant}
+\end{tdocimp}
% ------------------ %
@@ -554,6 +579,7 @@ Voici différents emplois possibles.
Il peut parfois être utile de revenir à la ligne dès le début du contenu. Voici comment faire (ce tour de passe-passe reste valable pour les environnements présentés dans les sous-sections suivantes). Noter au passage que la numérotation suit celle de l'exemple précédent comme souhaité.
\tdoclatexinput[sbs]{examples-focus-exa-leavevmode.tex}
+
\end{tdoctip}
@@ -564,6 +590,7 @@ Tout se passe via l'environnement \tdocenv{tdocrem} comme dans l'exemple suivant
\tdoclatexinput[sbs]{examples-focus-rmk.tex}
+
\subsection{Une astuce}
L'environnement \tdocenv{tdoctip} sert à donner des astuces. Voici comment l'employer.
@@ -571,6 +598,19 @@ L'environnement \tdocenv{tdoctip} sert à donner des astuces. Voici comment l'em
\tdoclatexinput[sbs]{examples-focus-tip.tex}
+
+\smallskip
+
+\begin{tdocnote}
+ Les couleurs sont fournies par les macros développables \tdocmacro{tdocbackcolor} et \tdocmacro{tdocdarkcolor} qui admettent les codes suivants.
+
+ \begin{tdoclatex}[code]
+\NewExpandableDocumentCommand{\tdocbackcolor}{m}{#1!5}
+\NewExpandableDocumentCommand{\tdocdarkcolor}{m}{#1!50!black}
+ \end{tdoclatex}
+\end{tdocnote}
+
+
\subsection{Note informative}
L'environnement \tdocenv{tdocnote} sert à mettre en avant des informations utiles. Voici comment l'utiliser.
@@ -578,13 +618,15 @@ L'environnement \tdocenv{tdocnote} sert à mettre en avant des informations util
\tdoclatexinput[sbs]{examples-focus-note.tex}
+
\subsection{Un truc important}
-L'environnement \tdocenv{tdocimportant} permet d'indiquer quelque chose d'important mais sans danger.
+L'environnement \tdocenv{tdocimp} permet d'indiquer quelque chose d'important mais sans danger.
\tdoclatexinput[sbs]{examples-focus-important.tex}
+
\subsection{Avertir d'un point très délicat}
L'environnement \tdocenv{tdoccaution} sert à indiquer un point délicat à l'utilisateur. Voici comment l'employer.
@@ -592,6 +634,7 @@ L'environnement \tdocenv{tdoccaution} sert à indiquer un point délicat à l'u
\tdoclatexinput[sbs]{examples-focus-caution.tex}
+
\subsection{Avertir d'un danger}
L'environnement \tdocenv{tdocwarn} sert à avertir l'utilisateur d'un piège à éviter. Voici comment l'employer.
@@ -599,6 +642,7 @@ L'environnement \tdocenv{tdocwarn} sert à avertir l'utilisateur d'un piège à
\tdoclatexinput[sbs]{examples-focus-warn.tex}
+
\section{Indiquer des packages, des classes, des macros ou des environnements}
Voici ce qu'il est possible de taper de façon sémantique.
@@ -638,8 +682,6 @@ On a aussi :
\end{tdocwarn}
-% -------------------- %
-
\section{Origine d'un préfixe ou d'un suffixe}
@@ -665,8 +707,6 @@ Pour expliquer les noms retenus, rien de tel que d'indiquer et expliciter les co
Il est parfois utile d'obtenir directement le rendu d'un code dans la documentation. Ceci nécessite que ce type de rendu soit dissociable du texte donnant des explications.
-% ------------------ %
-
\subsection{Avec une bande colorée}
@@ -679,6 +719,7 @@ Il est parfois utile d'obtenir directement le rendu d'un code dans la documentat
\tdoclatexinput[code]{examples-showcase-default.tex}
+
On obtient alors le rendu suivant.
\footnote{
En coulisse, la bande est créée sans effort grâce au package \tdocpack{clrstrip}.
@@ -687,6 +728,7 @@ Il est parfois utile d'obtenir directement le rendu d'un code dans la documentat
\medskip
\input{examples-showcase-default.tex}
+
\end{tdocexa}
@@ -696,7 +738,7 @@ Il est parfois utile d'obtenir directement le rendu d'un code dans la documentat
\begin{tdocnote}
- Les textes explicatifs s'adaptent à la langue choisie lors du chargement de \tdocpack{tutodoc}.
+ Les textes explicatifs s'adaptent à la langue choisie lors du chargement de \thispack{}.
\end{tdocnote}
@@ -708,22 +750,37 @@ Il est parfois utile d'obtenir directement le rendu d'un code dans la documentat
\tdoclatexinput[code]{examples-showcase-customized.tex}
+
Ceci produira ce qui suit.
\medskip
\input{examples-showcase-customized.tex}
+
\end{tdocexa}
\begin{tdocnote}
- Vous avez sûrement noté que l'on n'obtient pas un rouge pur : en coulisse les macros développables \tdocmacro{tdocbackcolor} et \tdocmacro{tdocdarkcolor} sont utilisées pour créer celles du fond et des titres respectivement à partir de la couleur proposée à \tdocenv{tdocshowcase}.
- Ces macros à un seul argument, la couleur choisie, admettent les codes suivants.
+ Vous avez sûrement remarqué que le rouge sert de base pour obtenir les couleurs utilisées.
+
+ \begin{itemize}
+ \item La couleur de fond est fournie par \tdocmacro{tdocbackcolor}.
+
+ \item La couleur des titres et des lignes est fournie par \tdocmacro{tdocdarkcolor}.
+ \end{itemize}
+
+ Ces macros développables et à un seul argument, la couleur choisie, admettent les codes suivants.
\begin{tdoclatex}[code]
\NewExpandableDocumentCommand{\tdocbackcolor}{m}{#1!5}
\NewExpandableDocumentCommand{\tdocdarkcolor}{m}{#1!50!black}
\end{tdoclatex}
+
+ Il faut également savoir qu'en coulisses, la macro \tdocmacro{tdocruler} est utilisée.
+
+ \begin{tdoclatex}[std]
+ \tdocruler{Un pseudo-titre décoré}{red}
+ \end{tdoclatex}
\end{tdocnote}
@@ -735,21 +792,12 @@ Il est parfois utile d'obtenir directement le rendu d'un code dans la documentat
\tdoclatexinput[code]{examples-showcase-hook.tex}
- Ceci produira ce qui suit.
-
- \medskip
- \input{examples-showcase-hook.tex}
+ Ceci produira ce qui suit.
\end{tdocwarn}
+\input{examples-showcase-hook.tex}
-\begin{tdocnote}
- Il faut savoir qu'en coulisse la macro \tdocmacro{tdocruler} est utilisée.
-
- \begin{tdoclatex}[std]
- \tdocruler{Un pseudo-titre décoré}{red}
- \end{tdoclatex}
-\end{tdocnote}
\subsection{Sans bande colorée}
@@ -764,11 +812,13 @@ Il est possible de ne pas utiliser une bande colorée comme nous allons le voir
\tdoclatexinput[code]{examples-showcase-no-clrstrip.tex}
+
Ceci produira ce qui suit.
\medskip
\input{examples-showcase-no-clrstrip.tex}
+
\end{tdocexa}
@@ -780,11 +830,13 @@ Il est possible de ne pas utiliser une bande colorée comme nous allons le voir
\tdoclatexinput[code]{examples-showcase-no-clrstrip-customized.tex}
+
Ceci produira ce qui suit.
\medskip
\input{examples-showcase-no-clrstrip-customized.tex}
+
\end{tdocexa}
@@ -800,6 +852,7 @@ Pour obtenir des rendus en important le code depuis un fichier externe, au lieu
\tdocshowcaseinput{examples-showcase-external.tex}
+
\medskip
Quant à \tdocinlatex+\tdocshowcaseinput[color = orange]{external.tex}+\,, ceci produira le changement de couleur observable ci-après.
@@ -807,15 +860,21 @@ Pour obtenir des rendus en important le code depuis un fichier externe, au lieu
\medskip
\tdocshowcaseinput[color = orange]{examples-showcase-external.tex}
+
\end{tdocexa}
\section{Cas d'utilisation en \LaTeX}
-Documenter un package ou une classe se fait efficacement via des cas d'utilisation montrant à la fois du code et le résultat correspondant.
+Documenter un package ou une classe se fait efficacement via des cas d'utilisation montrant à la fois du code et le résultat correspondant.%
+\footnote{
+ La mise en forme des codes se fait via le package \tdocpack{minted}.
+}
-% ------------------ %
+\begin{tdocwarn}
+ Version 3 of \tdocpack{minted} cannot be used at the moment, as it contains bugs: see \url{https://github.com/gpoore/minted/issues/401}. We therefore force the use of version 2 of \tdocpack{minted}.
+\end{tdocwarn}
\subsection{Codes \tdocquote{en ligne}} \label{tdoc-listing-inline}
@@ -836,16 +895,14 @@ Voici des exemples d'utilisation.
\begin{tdocnote}
- La macro \tdocmacro{tdocinlatex} est utilisable dans une note de pied de page : voir plus bas
+ La macro \tdocmacro{tdocinlatex} est utilisable dans une note de pied de page : voir ci-dessous.
\footnote{
\tdocinlatex+$minted = TOP$+ a été tapé \tdocinlatex|\tdocinlatex+$minted = TOP$+| dans cette note de bas de page..
- }.
+ }
De plus, une couleur de fond est volontairement utilisée pour subtilement faire ressortir les codes \tdocinlatex#\LaTeX#\,.
\end{tdocnote}
-% ------------------ %
-
\subsection{Codes tapés directement}
@@ -853,6 +910,7 @@ Voici des exemples d'utilisation.
Via \tdocenv[{[sbs]}]{tdoclatex}, on affichera un code et son rendu côte à côte.
Indiquons que \tdocinlatex#sbs# est pour \tdocquote{\tdocprewhy{s.ide} \tdocprewhy{b.y} \tdocprewhy{s.ide}} soit \tdocinEN{côte à côte}.
\tdocdocbasicinput{examples-listing-ABC.tex}
+
\end{tdocexa}
@@ -860,10 +918,10 @@ Voici des exemples d'utilisation.
\begin{tdocexa}[À la suite]
- \tdocenv{tdoclatex} produit le résultat suivant qui correspond à l'option par défaut \tdocinlatex#std#
+ \tdocenv{tdoclatex} produit le résultat suivant qui correspond à l'option par défaut \tdocinlatex#std#\,.
\footnote{
\tdocinlatex{std} fait référence au comportement \tdocquote{standard} de \tdocpack{tcolorbox} vis à vis de la librairie \tdocpack{minted}.
- }.
+ }
\begin{tdoclatex}
$A = B + C$
@@ -890,10 +948,12 @@ Voici des exemples d'utilisation.
Avec la mise en forme par défaut, si le code commence par un crochet ouvrant, il faudra indiquer explicitement l'option par défaut.
\tdocdocbasicinput{examples-listing-strange.tex}
+
\smallskip
Une autre méthode consiste à utiliser la primitive \tdocmacro{string}.
\tdocdocbasicinput{examples-listing-strange-bis.tex}
+
\end{tdocwarn}
@@ -903,6 +963,7 @@ Pour les codes suivants, on considère un fichier de chemin relatif \verb+exampl
\tdoclatexinput[code]{examples-listing-xyz.tex}
+
\medskip
La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'un fichier et propose les mêmes options que l'environnement \tdocenv{tdoclatex}.
@@ -916,11 +977,13 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\begin{tdoclatex}[code]
\tdoclatexinput[sbs]{examples-listing-xyz.tex}
+
\end{tdoclatex}
Ceci produit la mise en forme suivante.
\tdoclatexinput[sbs]{examples-listing-xyz.tex}
+
\end{tdocexa}
@@ -932,11 +995,13 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\begin{tdoclatex}[code]
\tdoclatexinput{examples-listing-xyz.tex}
+
\end{tdoclatex}
Ceci produit la mise en forme suivante où l'option employée par défaut est \tdocinlatex#std#.
\tdoclatexinput{examples-listing-xyz.tex}
+
\end{tdocexa}
@@ -948,15 +1013,15 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\begin{tdoclatex}[code]
\tdoclatexinput[code]{examples-listing-xyz.tex}
+
\end{tdoclatex}
Ceci produit la mise en forme suivante.
\tdoclatexinput[code]{examples-listing-xyz.tex}
-\end{tdocexa}
+\end{tdocexa}
-% ------------------ %
\subsection{Codes importés et mis en situation} \label{tdoc-latexshow}
@@ -968,12 +1033,13 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\begin{tdoc-doc-showcase}
\tdoclatexshow{examples-listing-xyz.tex}
+
\end{tdoc-doc-showcase}
\end{tdocexa}
\begin{tdocnote}
- Les textes par défaut tiennent compte de la langue choisie lors du chargement du package \tdocpack{tutodoc}.
+ Les textes par défaut tiennent compte de la langue choisie lors du chargement du package \thispack{}.
\end{tdocnote}
@@ -987,6 +1053,7 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\begin{tdoc-doc-showcase}
\tdoclatexshow[explain = Voici le rendu réel.]{examples-listing-xyz.tex}
+
\end{tdoc-doc-showcase}
\end{tdocexa}
@@ -1002,6 +1069,7 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\tdoclatexinput[code]{examples-listing-latexshow-options.tex}
+
\medskip
Ceci va produire ce qui suit.
@@ -1010,6 +1078,7 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
\begin{tdoc-doc-showcase}
\input{examples-listing-latexshow-options.tex}
+
\end{tdoc-doc-showcase}
\end{tdocexa}
@@ -1019,8 +1088,6 @@ La macro \tdocmacro{tdoclatexinput}, présentée ci-dessous, attend le chemin d'
Afin de faciliter le suivi d'un package, il est indispensable de fournir un historique indiquant les changements effectués lors de la publication d'une nouvelle version.
-% ------------------ %
-
\subsection{À quel moment ?}
@@ -1034,6 +1101,7 @@ On peut au choix dater quelque chose, ou bien le versionner, dans ce second cas
La macro \tdocmacro{tdocdate} permet d'indiquer une date dans la marge comme dans l'exemple suivant.
\tdoclatexshow{examples-version-n-change-dating.tex}
+
\end{tdocexa}
@@ -1044,18 +1112,17 @@ On peut au choix dater quelque chose, ou bien le versionner, dans ce second cas
Associer un numéro de version à une nouveauté se fait via la macro \tdocmacro{tdocversion}, la couleur et la date étant des arguments optionnels.
\tdoclatexshow{examples-version-n-change-versioning.tex}
+
\end{tdocexa}
-\begin{tdocimportant}
- \leavevmode
-
+\begin{tdocimp}
\begin{enumerate}
\item Les macros \tdocmacro{tdocdate} et \tdocmacro{tdocversion} nécessitent deux compilations.
\item Comme la langue indiquée pour cette documentation est le français, la date dans le rendu final est au format \texttt{JJ/MM/AAAA} alors que dans le code celle-ci devra toujours être saisie au format anglais \texttt{AAAA-MM-JJ}.
\end{enumerate}
-\end{tdocimportant}
+\end{tdocimp}
\begin{tdocwarn}
@@ -1065,24 +1132,24 @@ On peut au choix dater quelque chose, ou bien le versionner, dans ce second cas
}
et ceci est un choix ! Pourquoi cela ? Tout simplement car dater et versionner des explications devrait se faire de façon semi-automatisée afin d'éviter tout bug humain.
% \footnote{
-% L'auteur de \tdocpack{tutodoc} est entrain de mettre en place un ensemble d'outils permettant une telle semi-automatisation.
+% L'auteur de \thispack{} est entrain de mettre en place un ensemble d'outils permettant une telle semi-automatisation.
% }.
\end{tdocwarn}
-\subsection{Quoi de neuf ?}
+\subsection{Quoi de neuf ?}
-\tdocpack{tutodoc} propose différents environnements pour indiquer rapidement et clairement ce qui a été fait
+\thispack{} propose différents environnements pour indiquer rapidement et clairement ce qui a été fait lors des derniers changements.%
\footnote{
L'utilisateur n'a pas besoin de tous les détails techniques.
}
-lors des derniers changements.
\begin{tdocexa}[Pour les nouveautés]
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-new.tex}
+
\end{tdocexa}
@@ -1093,6 +1160,7 @@ lors des derniers changements.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-update.tex}
+
\end{tdocexa}
@@ -1103,6 +1171,7 @@ lors des derniers changements.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-break.tex}
+
\end{tdocexa}
@@ -1113,6 +1182,7 @@ lors des derniers changements.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-pb.tex}
+
\end{tdocexa}
@@ -1123,22 +1193,35 @@ lors des derniers changements.
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-fix.tex}
+
\end{tdocexa}
% ------------------ %
-\begin{tdocexa}[Thématiques aux choix]
+\begin{tdocexa}[Thématiques aux choix avec une icône]
+ \leavevmode
+
+ \tdoclatexinput[sbs]{examples-version-n-change-user-choice-icon.tex}
+
+\end{tdocexa}
+
+
+% ------------------ %
+
+
+\begin{tdocexa}[Thématiques aux choix sans icône]
\leavevmode
\tdoclatexinput[sbs]{examples-version-n-change-user-choice.tex}
+
\end{tdocexa}
\section{Décorations}
-Finissons cette documentation avec de petites outils de mise en forme pouvant rendre de grands services.
+Finissons cette documentation avec de petits outils de mise en forme pouvant rendre de grands services.
\begin{tdoclatex}[sbs]
@@ -1168,54 +1251,106 @@ Blo, blo, blo...
Blu, blu, blu...
\end{tdoclatex}
+
+
\section{Historique}
+\small
+
+\tdocversion{1.3.0}[2024-09-25]
+
+\begin{tdocprob}
+ \item La version 3 de \tdocpack{minted} ne peut pas être prise en compte pour le moment car elle comporte des bugs : voir \url{https://github.com/gpoore/minted/issues/401}. On force donc l'usage de la version 2 de \tdocpack{minted}.
+\end{tdocprob}
+
+
+\begin{tdocbreak}
+ \item L'environnement \verb#tdocimportant# a été renommé \verb#tdocimp# pour une saisie simplifiée.
+\end{tdocbreak}
+
+
+\begin{tdocnew}
+ \item Journal des changements : les environnements proposés utilisent des icônes.
+
+
+ \item Mise en avant de contenus : des cadres colorés avec des icônes sont proposés pour les environnements suivants.
+ \bgroup
+ \setlength{\multicolsep}{3.0pt plus 1.0pt minus 0.75pt}
+ \begin{multicols}{3}
+ \begin{enumerate}
+ \item \verb#tdoccaution#
+ \item \verb#tdocimp#
+ \item \verb#tdocnote#
+ \item \verb#tdoctip#
+ \item \verb#tdocwarn#
+ \end{enumerate}
+ \end{multicols}
+ \egroup
+\end{tdocnew}
+
+\tdocsep
+
+
+% ------------------ %
+
+
\tdocversion{1.2.0-a}[2024-08-23]
\begin{tdocupdate}
- \item \tdocmacro{tdocversion}
+ \item \tdocmacro{tdocversion}
\begin{enumerate}
- \item Le numéro de version est au-dessus de la date.
+ \item Le numéro de version est au-dessus de la date.
- \item L'espacement est mieux géré lorsque la date est absente.
+ \item L'espacement est mieux géré lorsque la date est absente.
\end{enumerate}
\end{tdocupdate}
\begin{tdocfix}
- \item Mise en avant de contenus : les traductions françaises de \tdocinEN*{caution} et \tdocinEN*{danger} étaient erronées.
+ \item Mise en avant de contenus : les traductions françaises de \tdocinEN*{caution} et \tdocinEN*{danger} étaient erronées.
\end{tdocfix}
\tdocsep
+
+% ------------------ %
+
+
\tdocversion{1.1.0}[2024-01-06]
\begin{tdocnew}
- \item Journal des changements : deux nouveaux environnements.
+ \item Journal des changements : deux nouveaux environnements.
\begin{enumerate}
\item \tdocenv{tdocbreak} pour les \tdocquote{bifurcations}\,, soit les modifications non rétrocompatibles.
\item \tdocenv{tdocprob} pour les problèmes repérés.
\end{enumerate}
- \item \tdocmacro{tdocinlatex}: un jaune léger est utilisé comme couleur de fond.
+ \item \tdocmacro{tdocinlatex}: un jaune léger est utilisé comme couleur de fond.
\end{tdocnew}
\tdocsep
+
+% ------------------ %
+
+
\tdocversion{1.0.1}[2023-12-08]
\begin{tdocfix}
- \item \tdocmacro{tdocenv}: l'espacement est maintenant correct, même si le paquet \tdocpack{babel} n'est pas chargé avec la langue française.
+ \item \tdocmacro{tdocenv}: l'espacement est maintenant correct, même si le paquet \tdocpack{babel} n'est pas chargé avec la langue française.
- \item \tdocenv[{[nostripe]}]{tdocshowcase}: les sauts de page autour des lignes \tdocquote{cadrantes} devraient être rares dorénavant.
+ \item \tdocenv[{[nostripe]}]{tdocshowcase}: les sauts de page autour des lignes \tdocquote{cadrantes} devraient être rares dorénavant.
\end{tdocfix}
\tdocsep
+
+% ------------------ %
+
+
\tdocversion{1.0.0}[2023-11-29]
Première version publique du projet.
-
\end{document}