% !TeX encoding = ISO-8859-1 % Ce fichier contient le code commenté de l'extension "hlist" % % IMPORTANT : pour que les commentaires s'affichent correctement, % ouvrir ce fichier avec l'encodage ISO-8859-1 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \def\hlstname {hlist} % \def\hlstver {0.11} % % % \def\hlstdate {2017/08/08} % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % -------------------------------------------------------------------- % 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 Christian Tellechea % email: unbonpetit@netc.fr % Commentaires, suggestions et signalement de bugs bienvenus ! % Comments, bug reports and suggestions are welcome. % Package URL: https://www.ctan.org/pkg/hlist % Copyright: Christian Tellechea 2017 % -------------------------------------------------------------------- % L'extension hlist est composée des 9 fichiers suivants : % - code : hlist (.tex et .sty) % - manuel en français : hlist-fr (.tex et .pdf) % - fichiers de test : hlist-latex (.tex et .pdf) % hlist-tex (.tex et .pdf) % - fichier lisezmoi : README % -------------------------------------------------------------------- \begingroup \ifdefined\skvname\let\hlsttmp\endgroup\else\def\hlsttmp{\endgroup\input simplekv.tex}\fi \hlsttmp\relax \expandafter\edef\csname hlst_restorecatcode\endcsname{\catcode`\noexpand\_=\the\catcode`\_\relax} \catcode`\_11 %################################################ %########### macros de développement ############ %################################################ % Cette macro est équivalente à 0 et sert notamment à stopper le développement % de \romannumeral \chardef\hlst_stop 0 % Définition du quark, notamment inséré à la fin d'une liste pour en reconnaitre % la fin et stopper la récursivité \def\hlst_quark{\hlst_quark} % Voici les macros habituelles de sélection d'arguments \def\hlst_gobarg#1{} \long\def\hlst_first#1#2{#1} \long\def\hlst_second#1#2{#2} \long\def\hlst_firsttonil#1#2\_nil{#1} % Voici la macro pour 1-développer ou 2-développer le 2e argument (le 1er étant % dépouillé des accolades) % \hlst_exparg{}{} devient {} \long\def\hlst_exparg#1#2{\expandafter\hlst_exparg_i\expandafter{#2}{#1}}% \long\def\hlst_exparg_i#1#2{#2{#1}} % Et la macro pour 1-développer le 2e argument (le 1er et le 2e argument sont % dépouillés des accolades)% % \hlst_expafter{}{} devient <*b> \long\def\hlst_expafter#1#2{\expandafter\hlst_expafter_i\expandafter{#2}{#1}} \long\def\hlst_expafter_i#1#2{#2#1} %################################################ %################ macros de test ################ %################################################ % Voici quelques macros à sélection d'arguments pour les tests \def\hlst_ifnum#1{\ifnum#1\expandafter\hlst_first\else\expandafter\hlst_second\fi} \def\hlst_ifcsname#1{\ifcsname#1\endcsname\expandafter\hlst_first\else\expandafter\hlst_second\fi} \long\def\hlst_ifx#1{\ifx#1\expandafter\hlst_first\else\expandafter\hlst_second\fi} \long\def\hlst_ifempty#1{\hlst_exparg\hlst_ifx{\expandafter\relax\detokenize{#1}\relax}} \def\hlst_ifstar#1#2{\def\hlst_ifstar_i{\hlst_ifx{*\hlst_nxttok}{\hlst_first{#1}}{#2}}\futurelet\hlst_nxttok\hlst_ifstar_i} % Ici, une macro pour définir le token \def\hlst_deftok#1#2{\let#1= #2\relax}\hlst_deftok\hlst_sptok{ } % Et une macro pour tester le prochain token \def\hlst_ifnxttok#1#2#3{\hlst_deftok\hlst_toktotest{#1}\def\__truecode{#2}\def\__falsecode{#3}\hlst_ifnxttok_a} \def\hlst_ifnxttok_a{\futurelet\_futurtok\hlst_ifnxttok_b} \def\hlst_ifnxttok_b{% \hlst_ifx{\_futurtok\hlst_sp} {\afterassignment\hlst_ifnxttok_a\let\_futurtok= } {\hlst_ifx{\_futurtok\hlst_toktotest}\__truecode\__falsecode}% } %################################################ %############### macros de hlist ############### %################################################ % Voici les registres utilisés : % 1) le compteur d'imbrication, incrémenté de 1 à chaque nouvelle liste % imbriquée : \newcount\hlst_nest % 2) Le compteur des \items sur chaque ligne : \newcount\hlst_colcnt % 3) La largeur des \hbox enfermant les (un est le