% !TEX TS-program = lualatex
% encoding : utf8
% Documentation of tkz-doc.cls
% Copyright 2022-2026  Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                               %
%   doc   tkz-doc.cls      encodage : utf8                      %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                               %
%           Créé par Alain Matthes le 21/03/2009                %
%  Copyright (c) 2009-2026 __AlterMundus__ All rights reserved. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\PassOptionsToPackage{unicode}{hyperref}

\documentclass[DIV         = 14,
               fontsize    = 10,
               index       = totoc,
               twoside,
               cadre,
               headings    = small,
               ]{tkz-doc}
% version and date: updated by pkg-version (.pkg.conf)
\gdef\tkznameofpack{tkz-doc.cls}
\gdef\tkzversionofpack{1.46c}
\gdef\tkzdateofpack{2026/10/20}
\gdef\tkznameofdoc{doc-tkz-doc}
\gdef\tkzversionofdoc{1.46c}
\gdef\tkzdateofdoc{2026/10/20}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
\gdef\tkznamecollection{AlterMundus}
\gdef\tkzurlauthor{http://altermundus.fr}
\gdef\tkzurlauthorcom{http://altermundus.fr}
\gdef\tkzengine{lualatex}
\nameoffile{\tkznameofpack}

\RequirePackage{fancybox}
\usepackage{fontspec,pgfornament}
\setmainfont{texgyrepagella}[
  Extension = .otf,
  UprightFont = *-regular ,
  ItalicFont  = *-italic  ,
  BoldFont    = *-bold    ,
  BoldItalicFont = *-bolditalic
]
\setsansfont{texgyreheros}[
  Extension = .otf,
  UprightFont = *-regular ,
  ItalicFont  = *-italic  ,
  BoldFont    = *-bold    ,
  BoldItalicFont = *-bolditalic ,
]
\setmonofont{lmmono10-regular.otf}[
  Numbers={Lining,SlashedZero},
  ItalicFont=lmmonoslant10-regular.otf,
  BoldFont=lmmonolt10-bold.otf,
  BoldItalicFont=lmmonolt10-boldoblique.otf,
]
\newfontfamily\ttcondensed{lmmonoltcond10-regular.otf}
%% (La)TeX font-related declarations:
\linespread{1.05}      % Pagella needs more space between lines
\usepackage[math-style=literal,bold-style=literal]{unicode-math}
\usepackage{fourier-otf}
\let\rmfamily\ttfamily
\usepackage{multicol,lscape}
\usepackage[english]{babel}
\usepackage[normalem]{ulem}
\usepackage{multirow,multido,booktabs,cellspace}
\usepackage{shortvrb,fancyvrb}
\usepackage{tkzexample}
\usepackage[colorlinks]{hyperref}
\hypersetup{linkcolor=MidnightBlue,urlcolor=MidnightBlue}
\usepackage{bookmark}
\usepackage{makeidx}
\makeindex

%<------------------------------------------------------------------------->
% settings styles
\tkzSetUpColors[background=white,text=black]
\AtBeginDocument{\MakeShortVerb{\|}} % link to shortvrb

\begin{document}
%<------------------------------------------------------------------------->
\parindent=0pt
\tkzTitleFrame{tkz-doc.cls\\A class to present \\ the tkz packages}
\clearpage

\nameoffile{\tkznameofpack}
\defoffile{\textbf{tkz-doc.cls} is the class I use to write the documentation
of my packages (\tkzname{tkz-euclide}, \tkzname{tkz-elements}, \tkzname{tkz-tab},
\tkzname{tkzexample}, \dots). It is based on the class \tkzname{scrartcl} and is
designed to be compiled with \tkzname{lualatex}. It adds a cover, a layout,
boxes to present the macros with their options, and a set of macros to
typeset and index the names of macros, options and arguments.
The colours are defined in the file \tkzname{tkz-doc.cfg}.}

\presentation

\vfill
Please report typos or any other comments to this documentation to:
\href{mailto:al.ma@mac.com}{\textcolor{blue}{Alain Matthes}}.
This file can be redistributed and/or modified under the terms of the \LaTeX{}
Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ archives.

\clearpage
\tableofcontents
\clearpage

%<------------------------------------------------------------------------->
\section{Overview}

\tkzname{tkz-doc} is a personal class. It is distributed because the
sources of the documentation of my packages need it, but it is not designed
as a general purpose class: if you want to use it, read the source code
first.

\subsection{Files}
\begin{itemize}
\item \tkzname{tkz-doc.cls}: the class;
\item \tkzname{tkz-doc.cfg}: the colours used by the class (read at loading time).
  If you want other colours, copy this file in a directory searched by \TeX{}
  and modify the copy.
\end{itemize}

\subsection{Packages loaded by the class}
The class loads \NamePack{scrartcl} (options \tkzname{titlepage} and
\tkzname{a4paper}), \NamePack{tikz} with the libraries
\NameLib{decorations.shapes}, \NameLib{decorations.text},
\NameLib{decorations.pathreplacing}, \NameLib{decorations.pathmorphing},
\NameLib{decorations.markings} and \NameLib{shadows}, then
\NamePack{ragged2e}, \NamePack{footmisc}, \NamePack{framed}, \NamePack{eso-pic},
\NamePack{scrlayer-scrpage}, \NamePack{datetime} (option \tkzname{yyyymmdd}),
\NamePack{booktabs}, \NamePack{cellspace} and \NamePack{multicol}.
The options \tkzname{dvipsnames} and \tkzname{svgnames} are passed to
\NamePack{xcolor}.

The document should load \NamePack{hyperref} (or \NamePack{url}); without
it, the url and the links of the first pages are simply printed. With the
option \tkzname{cadre}, \NamePack{pgfornament} is loaded automatically if the
document does not load it (a warning is given if it is not installed).

%<------------------------------------------------------------------------->
\section{Options}

\begin{tabular}{ll}
\toprule
\texttt{option} & \texttt{effect} \\
\midrule
\tkzname{cadre} & adds a framed title with ornaments on the cover (\tkzcname{tkzTitleFrame})\\
\textit{other options} & passed to \tkzname{scrartcl} (\tkzname{DIV}, \tkzname{fontsize}, \tkzname{index=totoc}, \tkzname{headings}, \dots)\\
\bottomrule
\end{tabular}

\medskip
A typical beginning of a documentation:

\begin{tkzexample}[code only,small]
\documentclass[DIV         = 14,
               fontsize    = 10,
               index       = totoc,
               twoside,
               cadre,
               headings    = small]{tkz-doc}
\gdef\tkznameofpack{tkz-tab}
\gdef\tkzversionofpack{2.13c}
\gdef\tkzversionofdoc{2.13c}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkznamecollection{AlterMundus}
\gdef\tkzurlauthor{http://altermundus.fr}
\gdef\tkzurlauthorcom{http://altermundus.fr}
\nameoffile{\tkznameofpack}
\usepackage{tkzexample}
\usepackage[colorlinks]{hyperref}
\usepackage{makeidx}
\makeindex
\end{tkzexample}

%<------------------------------------------------------------------------->
\section{Information about the package}

These macros are defined with |\gdef| (or |\let|) in the preamble. They are
used on the cover, in the footers and by \tkzcname{presentation}. They all
have a default value, so a missing definition is not an error.

\begin{tabular}{lll}
\toprule
\texttt{macro} & \texttt{default} & \texttt{used by} \\
\midrule
\tkzcname{tkznameofpack}     & empty                  & title, left footer \\
\tkzcname{tkzversionofpack}  & empty                  & cover (vertical title) \\
\tkzcname{tkzversionofdoc}   & empty                  & cover (``Documentation V.'') \\
\tkzcname{tkzauthorofpack}   & Alain Matthes          & cover, \tkzcname{presentation} \\
\tkzcname{tkznamecollection} & AlterMundus            & cover, right footer \\
\tkzcname{tkzurlauthor}      & http://altermundus.fr  & link of \tkzcname{presentation} \\
\tkzcname{tkzurlauthorcom}   & http://altermundus.fr  & url on the cover \\
\tkzcname{tkzmailofauthor}   & al.ma@mac.com          & mail link of \tkzcname{presentation} \\
\bottomrule
\end{tabular}

%<------------------------------------------------------------------------->
\section{The first pages}

\subsection{The cover: \tkzcname{tkzTitleFrame}}

\begin{NewMacroBox}{tkzTitleFrame}{\marg{text}}
Sets \tkzcname{author}, \tkzcname{title} (with \tkzcname{tkznameofpack}) and
\tkzcname{date}, then builds the cover: a coloured page, the name of the
package and its version written vertically, the name of the collection in
shadowed letters, random balls, the author, the date and the url.
With the option \tkzname{cadre}, \meta{text} is written in a frame decorated
with four ornaments of \NamePack{pgfornament} (number 61); |\\| can be used to
break the lines.
\end{NewMacroBox}

\begin{tkzexample}[code only,small]
\tkzTitleFrame{tkz-doc.cls\\A class to present \\ the tkz packages}
\clearpage
\end{tkzexample}

\subsection{The presentation page: \tkzcname{presentation}}

\begin{NewMacroBox}{presentation}{}
Prints a page with the name given by \tkzcname{nameoffile}, the name of the
collection written vertically (a link to \tkzcname{tkzurlauthor}), the name of
the author (a mail link) and the text given by \tkzcname{defoffile}.
\end{NewMacroBox}

\begin{NewMacroBox}{nameoffile}{\marg{name}}
Name printed at the top of the presentation page.
\end{NewMacroBox}

\begin{NewMacroBox}{defoffile}{\marg{text}}
Text of the presentation page. Successive uses are concatenated.
\end{NewMacroBox}

\begin{tkzexample}[code only,small]
\nameoffile{\tkznameofpack}
\defoffile{\textbf{tkz-tab} is a package to draw tables of variations ...}
\presentation
\end{tkzexample}

%<------------------------------------------------------------------------->
\section{Colours}

\subsection{The file \tkzname{tkz-doc.cfg}}
The colours are defined in \tkzname{tkz-doc.cfg}. The main ones are:

\begin{tabular}{lll}
\toprule
\texttt{name} & \texttt{definition} & \texttt{use} \\
\midrule
\tkzname{myblue}        & RGB 20,120,180   & cover, optional arguments (\tkzcname{opt})\\
\tkzname{sectioncolor}  & MidnightBlue     & titles, headers, footers, rules \\
\tkzname{titlecolorbox} & gray!10          & background of the name in the boxes \\
\tkzname{framecolor}    & myblue           & frame of the cover (option \tkzname{cadre}) \\
\tkzname{codebackground}, \tkzname{graphicbackground} & & used by \NamePack{tkzexample} \\
\bottomrule
\end{tabular}

\medskip
If the file is not found, the class defines \tkzname{myblue},
\tkzname{sectioncolor}, \tkzname{titlecolorbox} and \tkzname{framecolor}
with the same values.

\subsection{Background and text: \tkzcname{tkzSetUpColors}}

\begin{NewMacroBox}{tkzSetUpColors}{\oarg{local options}}
Sets the colour of the pages and of the text.

\medskip
\begin{tabular}{lll}
\toprule
\texttt{options} & \texttt{default} & \texttt{definition} \\
\midrule
\TOline{background}{white}{colour of the pages}
\TOline{text}{black}{colour of the text}
\bottomrule
\end{tabular}
\end{NewMacroBox}

\begin{tkzexample}[code only,small]
\tkzSetUpColors[background=white,text=black]
\end{tkzexample}

%<------------------------------------------------------------------------->
\section{Presenting a macro or an environment}

\subsection{The environment \tkzname{NewMacroBox}}\Ienv{NewMacroBox}

\begin{NewEnvBox}{NewMacroBox}
\tkzname{NewMacroBox} has two arguments: the name of the macro
(without backslash) and its arguments. The name and the arguments are
printed in a box at the top of a framed area; the name of the macro is
indexed. Inside the environment, the name of the macro is stored in
\tkzcname{ActivBoxName}, used by the macros \tkzcname{TOline} and
\tkzcname{TAline} to index the options and the arguments.
\end{NewEnvBox}

\begin{tkzexample}[code only,small]
\begin{NewMacroBox}{tkzDemo}{\oarg{local options}\parg{A,B}}
\begin{tabular}{lll}
\toprule
\texttt{arguments} & \texttt{default} & \texttt{definition}\\
\midrule
\TAline{A,B}{no default}{two points}
\bottomrule
\end{tabular}

\medskip
\begin{tabular}{lll}
\toprule
\texttt{options} & \texttt{default} & \texttt{definition}\\
\midrule
\TOline{color}{black}{colour of the line}
\TOline{add}{0 and 0}{extension of the segment}
\bottomrule
\end{tabular}
\end{NewMacroBox}
\end{tkzexample}

gives:

\begin{NewMacroBox}{tkzDemo}{\oarg{local options}\parg{A,B}}
\begin{tabular}{lll}
\toprule
\texttt{arguments} & \texttt{default} & \texttt{definition}\\
\midrule
\TAline{A,B}{no default}{two points}
\bottomrule
\end{tabular}

\medskip
\begin{tabular}{lll}
\toprule
\texttt{options} & \texttt{default} & \texttt{definition}\\
\midrule
\TOline{color}{black}{colour of the line}
\TOline{add}{0 and 0}{extension of the segment}
\bottomrule
\end{tabular}
\end{NewMacroBox}

\subsection{Lines of the tables}

These macros produce a whole line of a table with three columns and end it
with |\\|. The first column is indexed.

\begin{tabular}{ll}
\toprule
\texttt{macro} & \texttt{first column indexed as} \\
\midrule
\tkzcname{TOline}\marg{option}\marg{default}\marg{definition}    & option of \tkzcname{ActivBoxName} \\
\tkzcname{TAline}\marg{argument}\marg{default}\marg{definition}  & argument of \tkzcname{ActivBoxName} \\
\tkzcname{TOenvline}\marg{option}\marg{default}\marg{definition} & option of the environment \tkzcname{ActivBoxName} \\
\tkzcname{TMline}\marg{macro}\marg{default}\marg{definition}     & macro \\
\bottomrule
\end{tabular}

\subsection{The environment \tkzname{NewEnvBox}}\Ienv{NewEnvBox}

The environment \tkzname{NewEnvBox} has one argument, the name of the
environment presented. It prints
|\begin{|\meta{name}|}[options] |\meta{environment contents}| \end{|\meta{name}|}|
in the box and indexes the environment. Use \tkzcname{TOenvline} for its options.

%<------------------------------------------------------------------------->
\section{Typesetting names}

\begin{tabular}{lll}
\toprule
\texttt{macro} & \texttt{result} & \texttt{index} \\
\midrule
|\tkzname{name}|   & \tkzname{name}   & no \\
|\tkzcname{name}|  & \tkzhname{name} & yes (macro) \\
|\tkzhname{name}|  & \tkzhname{name}  & no \\
|\tkzimp{text}|    & \tkzimp{text}    & no \\
|\tkzdft{value}|   & \tkzdft{value}   & no \\
|\addbs{name}|     & \addbs{name}     & no \\
|\cmd{\foo}|       & \cmd{\foo}       & no \\
|\NamePack{tikz}|  & \texttt{\textcolor{MidnightBlue}{tikz}} & yes (Packages) \\
|\NameLib{calc}|   & \texttt{\textcolor{MidnightBlue}{calc}} & yes (Ti\emph{k}Z Library) \\
|\NameSys{MacOS}|  & \texttt{MacOS}   & yes (Operating System) \\
|\NameDist{TeX Live}| & \texttt{\textcolor{MidnightBlue}{TeX Live}} & yes (TeX Distributions) \\
|\NameFonct{sin}|  & \texttt{\textcolor{MidnightBlue}{sin}} & yes (Functions) \\
\bottomrule
\end{tabular}

\subsection{Arguments}

\begin{tabular}{ll}
\toprule
\texttt{macro} & \texttt{result} \\
\midrule
|\meta{name}| & \meta{name} \\
|\marg{name}| & \marg{name} \\
|\oarg{name}| & \oarg{name} \\
|\parg{name}| & \parg{name} \\
|\ooarg{name}| & \ooarg{name} \\
|\var{name}|  & \var{name}  \\
|\varp{name}| & \varp{name} \\
|\opt{text}|  & \opt{text}  \\
\bottomrule
\end{tabular}

\subsection{Logos and signs}
|\tkz| gives \tkz, |\TIKZ| gives \TIKZ, |\tikzname| gives \tikzname,
|\pgfname| gives \pgfname, |\BS| gives \BS.
\tkzcname{tkzHand}, \tkzcname{tkzBomb}, \tkzcname{tkzTwoBomb} and
\tkzcname{tkzHandBomb} put a sign in the left margin; they need the
symbols |\lefthand| and |\bomb| (package \NamePack{fourier}).

%<------------------------------------------------------------------------->
\section{Index}

The index is sorted with keys: a macro \tkzname{name} is indexed as
|name_1|, its arguments as |name_2| and its options as |name_3|, so that
the options and the arguments follow the macro.

\begin{tabular}{ll}
\toprule
\texttt{macro} & \texttt{entry} \\
\midrule
\tkzcname{Imacro}\marg{macro}                 & \tkzhname{macro} \\
\tkzcname{Iarg}\marg{macro}\marg{arg}         & \tkzhname{macro: arguments} $\to$ arg \\
\tkzcname{Iopt}\marg{macro}\marg{opt}         & \tkzhname{macro: options} $\to$ opt \\
\tkzcname{Istyle}\marg{macro}\marg{style}     & \tkzhname{macro: styles} $\to$ style \\
\tkzcname{Ienv}\marg{env}                     & Environment $\to$ env \\
\tkzcname{IoptEnv}\marg{env}\marg{opt}        & env: options $\to$ opt \\
\tkzcname{IargEnv}\marg{env}\marg{arg}        & env: arguments $\to$ arg \\
\tkzcname{Ilib}\marg{library}                 & Library $\to$ library \\
\bottomrule
\end{tabular}

\medskip
\tkzcname{IargName}, \tkzcname{IoptName}, \tkzcname{IargNameEnv} and
\tkzcname{IoptNameEnv} take the same arguments, print the second one and
index it. \tkzcname{tkzNameMacro}\marg{macro} prints and indexes a macro,
\tkzcname{tkzNameEnv}\marg{env} an environment.

The index is printed with |\printindex| (package \NamePack{makeidx}); the
class option \tkzname{index=totoc} adds it to the table of contents.

%<------------------------------------------------------------------------->
\section{Tables}

With the column type \tkzname{I}, \tkzcname{thead}\oarg{font} changes the font
of the following cells (default |\em\ttfamily|) and \tkzcname{tbody} restores
the normal font. \tkzcname{tkzsubf}\marg{a}\marg{b} writes $a$ above $b$ in a
cell, in small size.

\begin{tkzexample}[small]
\begin{tabular}{IlIl}
\thead
name & value \\ \tbody
\midrule
a & 1 \\
b & 2 \\
\end{tabular}
\end{tkzexample}

%<------------------------------------------------------------------------->
\section{Layout}

\begin{itemize}
\item header: the current section and subsection on the left, the page number
  on the right; footer: \tkzcname{tkznameofpack} on the left,
  \tkzcname{tkznamecollection} on the right; rules in \tkzname{sectioncolor};
\item titles in bold typewriter in \tkzname{sectioncolor}; the font is
  given by \tkzcname{SectionFontStyle} (|\ttfamily|);
\item no indentation, |--| for the items, numbering down to subsubsections;
\item a part is printed alone on a page, centred.
\end{itemize}

%<------------------------------------------------------------------------->
\section{History}

\begin{description}
\item[1.46c (2026/10/20)] Correction of old problems. The text of the
  documents is the same as with 1.45c, but the index changes:
  \tkzname{NewMacroBox} and \tkzname{NewEnvBox} no longer write a wrong index
  entry (name and arguments together); \tkzcname{presentation} can be used
  twice; \tkzcname{tkzTitleFrame} accepts fragile commands; with the option
  \tkzname{cadre}, \NamePack{pgfornament} is loaded if needed; default values
  for colours and information macros; |\tikzstyle| replaced by |\tikzset|;
  new macro \tkzcname{tkzmailofauthor}; |\TeX| is robust again (an index
  entry containing |\TeX| may be sorted differently);
  \tkzcname{tkzSetUpColors} no longer adds spurious spaces.
\item[1.45c (2022/07/14)] Last version of the old class.
\end{description}

\printindex
\end{document}
