| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
%%%% Copyright (C) 2004, 2020 by Josselin Noirel |
| 4 |
%%%% and Yvon Henel aka Le TeXnicien de surface |
| 5 |
%%%% -------------------------------------------------------- |
| 6 |
% |
| 7 |
% This file may be distributed and/or modified under the |
| 8 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 9 |
% of this license or (at your option) any later version. |
| 10 |
% The latest version of this license is in: |
| 11 |
% |
| 12 |
% http://www.latex-project.org/lppl.txt |
| 13 |
% |
| 14 |
% \fi |
| 15 |
% |
| 16 |
% \iffalse |
| 17 |
%<package>\NeedsTeXFormat{LaTeX2e} |
| 18 |
%<package>\def\fileversion{v0.1} |
| 19 |
%<package>\def\filedate{2020/07/27} |
| 20 |
%<packfra>\def\fileinfo{d\'efinir et utiliser des paires cle/valeurs} |
| 21 |
%<packeng>\def\fileinfo{define and use pair of key/values} |
| 22 |
%<package>\ProvidesPackage{clefval} |
| 23 |
%<package> [\filedate\space\fileversion\space\fileinfo] |
| 24 |
%<*driver> |
| 25 |
\documentclass[a4paper]{ltxdoc} |
| 26 |
\usepackage[T1]{fontenc} |
| 27 |
\usepackage{clefval} |
| 28 |
\usepackage{xspace,url,multicol,ifthen} |
| 29 |
\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} |
| 30 |
\usepackage[english, main=french]{babel} |
| 31 |
% commentez la ligne suivante pour avoir un document avec le code |
| 32 |
% \OnlyDescription |
| 33 |
% comment out the preceding line to obtain the full code |
| 34 |
% with explanations in French only, sorry. |
| 35 |
\EnableCrossrefs |
| 36 |
\CodelineIndex |
| 37 |
\RecordChanges |
| 38 |
\makeatletter |
| 39 |
%%% quelques redéfinition de commande de la classe ltxdoc.cls ou de |
| 40 |
%%% l'extension doc.sty pour une documentation en français. |
| 41 |
\GlossaryPrologue{\section*{{Changements -- |
| 42 |
Changes}}\markboth{{Changements -- Changes}}{{Changements -- Changes}}} |
| 43 |
\IndexPrologue{\section*{Index}\markboth{Index}{Index}% |
| 44 |
\begin{Morciau}\selectlanguage{french} |
| 45 |
Les nombres en italique renvoient à la page où l'entrée est décrite ; les |
| 46 |
nombres soulignés renvoient à la ligne de code de la définition ; les |
| 47 |
nombres en caractères romains renvoient à la ligne de code où l'entrée est |
| 48 |
utilisée.\EnAnglais Numbers written in italic refer to the page where the |
| 49 |
corresponding entry is described; numbers underlined refer to the code |
| 50 |
line of the definition; numbers in roman refer to the code line where the |
| 51 |
entry is used.\end{Morciau}} |
| 52 |
\renewcommand{\SpecialMainEnvIndex}[1]{% |
| 53 |
\@bsphack\special@index{% |
| 54 |
#1\actualchar {\string\ttfamily\space#1}(environnement)% |
| 55 |
\encapchar main}% |
| 56 |
\special@index{environnements:\levelchar{% |
| 57 |
\string\ttfamily\space#1}\encapchar main}\@esphack} |
| 58 |
\makeatother |
| 59 |
\def\generalname{Général} |
| 60 |
%%% fin de la francisation |
| 61 |
\setlength{\columnseprule}{0.5pt} |
| 62 |
\setlength{\multicolsep}{6pt plus 2.0pt minus 1.5pt} |
| 63 |
\def\FraTitre{\relax} |
| 64 |
\def\EngTitre{\relax} |
| 65 |
\newcommand{\TraiteTitre}[1]{\TraiteTitreAux#1/Z} |
| 66 |
\def\TraiteTitreAux#1/#2/Z{\def\FraTitre{\TitreMorciau{#1}}% |
| 67 |
\ifthenelse{\equal{#2}{}}{\def\LarGuMent{#1}}{\def\LarGuMent{#2}} |
| 68 |
\def\EngTitre{\TitreMorciau{\LarGuMent}}} |
| 69 |
\newcommand{\TitreMorciau}[1]{% |
| 70 |
\noindent\textbf{#1}\par\noindent\ignorespaces} |
| 71 |
\newenvironment{Morciau}[1][ZXZXZ]{\raggedcolumns\begin{multicols}{2}% |
| 72 |
\selectlanguage{french}% |
| 73 |
\ifthenelse{\equal{#1}{ZXZXZ}}{\relax}{\TraiteTitre{#1}\FraTitre}}% |
| 74 |
{\end{multicols}} |
| 75 |
\newcommand{\EnAnglais}{\columnbreak\mbox{} |
| 76 |
\par\selectlanguage{english}\EngTitre} |
| 77 |
\newcommand{\NomDeModule}[1]{\texttt{#1.sty}\xspace} |
| 78 |
\newcommand{\fctt}{\texttt{fr.comp.text.tex}\xspace} |
| 79 |
\newcommand{\Sourire}{\texttt{;-)}\xspace} |
| 80 |
\newcommand{\LB}{\linebreak[2]} |
| 81 |
%%% fin de la personalisation |
| 82 |
\begin{document} |
| 83 |
\DocInput{clefval.dtx} |
| 84 |
\end{document} |
| 85 |
%</driver> |
| 86 |
% \fi |
| 87 |
% |
| 88 |
% \CheckSum{76} |
| 89 |
% |
| 90 |
% \CharacterTable |
| 91 |
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 92 |
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 93 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 94 |
% Exclamation \! Double quote \" Hash (number) \# |
| 95 |
% Dollar \$ Percent \% Ampersand \& |
| 96 |
% Acute accent \' Left paren \( Right paren \) |
| 97 |
% Asterisk \* Plus \+ Comma \, |
| 98 |
% Minus \- Point \. Solidus \/ |
| 99 |
% Colon \: Semicolon \; Less than \< |
| 100 |
% Equals \= Greater than \> Question mark \? |
| 101 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 102 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 103 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 104 |
% Right brace \} Tilde \~} |
| 105 |
% |
| 106 |
% \GetFileInfo{clefval.sty} |
| 107 |
% |
| 108 |
% \changes{v0}{2004/05/20}{1\iere version |
| 109 |
% publique. \textit{\foreignlanguage{english}{1st public version.}}} |
| 110 |
% \changes{v0.1}{2020/07/27}{Amélioration du message d'erreur dans le |
| 111 |
% document. \textit{\foreignlanguage{english}{Improved error message |
| 112 |
% in document.}}} |
| 113 |
% \changes{v0.1}{2020/07/27}{Version permettant l'utilisation du |
| 114 |
% codage utf-8 avec \texttt{pdflatex}, \texttt{lualatex} et |
| 115 |
% \texttt{xelatex}. \textit{\foreignlanguage{english}{This version can |
| 116 |
% be used in utf-8 encoded source with \texttt{pdflatex}, |
| 117 |
% \texttt{lualatex} and \texttt{xelatex}.}}} |
| 118 |
|
| 119 |
% |
| 120 |
% \DoNotIndex{\newcommand, \renewcommand, \providecommand,^^A |
| 121 |
% \def, \let,\csname, \endcsname, \afterassignment,^^A |
| 122 |
% \long, \global, \gdef, \edef, \xdef, \null, \write,^^A |
| 123 |
% \newenvironment,\renewenvironment, \expandafter, \relax,^^A |
| 124 |
% \protect, \begingroup, \endgroup, \bgroup, \egroup^^A |
| 125 |
% \DeclareOption, \ExecuteOptions, \RequirePackage,^^A |
| 126 |
% \ProcessOptions, \newif, \fi, \if, \or, \ifnum, \ifcase,\ifx,^^A |
| 127 |
% \ifvmode, \@ifundefined, \@bsphack, \@esphack,^^A |
| 128 |
% \nobreak, \if@nobreak, \@onlypreamble, \@unexpandable@protect,^^A |
| 129 |
% \space, \string, \AtBeginDocument, \AtEndDocument,^^A |
| 130 |
% \bfseries, \reset@font, \nfss@text, \',^^A |
| 131 |
% \@latex@warning, \@latex@warning@no@line,^^A |
| 132 |
% \@testdef, \@namedef, \reserved@a,^^A |
| 133 |
% \else, \@ctrerr, \text,\textup, \value, \thepage, \@auxout} |
| 134 |
% |
| 135 |
% \title{Le module\thanks{Ce document correspond au fichier |
| 136 |
% \textsf{clefval}~\fileversion, du \filedate.}\hspace{2cm} |
| 137 |
% The package\thanks{This document corresponds to the file |
| 138 |
% \textsf{clefval}~\fileversion, dated \filedate.}\\ |
| 139 |
% \textsf{clefval}} |
| 140 |
% |
| 141 |
% \author{Le \TeX nicien de |
| 142 |
% surface\thanks{\texttt{[email protected]}}\and |
| 143 |
% Josselin Noirel} |
| 144 |
% |
| 145 |
% \maketitle |
| 146 |
% |
| 147 |
% \section{Introduction} |
| 148 |
% \label{secIntro} |
| 149 |
% \noindent\textbf{Description}\DescribeMacro{\TheKey}\DescribeMacro{\TheValue} |
| 150 |
% \begin{Morciau}[Macros~publiques/Public~Macros] |
| 151 |
% Deux macros \cs{TheKey} et \cs{TheValue} pour définir puis utiliser |
| 152 |
% des paires clef/valeur. |
| 153 |
% \EnAnglais |
| 154 |
% Two macros \cs{TheKey} and \cs{TheValue} to define then use pairs |
| 155 |
% of key/value. |
| 156 |
% \end{Morciau} |
| 157 |
% \begin{Morciau}[Syntaxe/Syntax] |
| 158 |
% \cs{TheKey}\marg{clé}\marg{valeur} pour définir la \emph{valeur} |
| 159 |
% associée à la \emph{clé}, ne produit pas de texte ; |
| 160 |
% \cs{TheValue}\marg{clé} pour insérer la \emph{valeur} associée à la |
| 161 |
% \emph{clé}. |
| 162 |
% \EnAnglais |
| 163 |
% \cs{TheKey}\marg{key}\marg{value} to define the \emph{value} |
| 164 |
% associated to the \emph{key}, does not produce text ; |
| 165 |
% \cs{TheValue}\marg{key} to insert the \emph{value} linked to the |
| 166 |
% \emph{key}. |
| 167 |
% \end{Morciau} |
| 168 |
% |
| 169 |
% |
| 170 |
% \subsection{Version 0.1} |
| 171 |
% |
| 172 |
% \begin{Morciau} |
| 173 |
% Edd \textsc{Barrett}, le 27 juillet 2020, a signalé sur |
| 174 |
% \texttt{stackexchange} un problème lié à l'utilisation de |
| 175 |
% \texttt{clefval}. C'est lui, également, qui a fourni un ECM et |
| 176 |
% trouvé la cause dudit problème: la présence d'un espace insécable |
| 177 |
% dans le fichier codé en \texttt{iso-8859-15} entrainait l'arrêt de |
| 178 |
% \LaTeX{} avec le message: |
| 179 |
% \EnAnglais |
| 180 |
% On the 27th July 2020, Edd \textsc{Barrett} wrote on |
| 181 |
% \texttt{stackexchange} about a problem linked to the use of |
| 182 |
% \texttt{clefval}. He also wrote a MCE and found the cause of the |
| 183 |
% said problem: an unbreakable space in the file encoded in |
| 184 |
% \texttt{iso-8859-15} forced \LaTeX{} to stop with the following |
| 185 |
% error message: |
| 186 |
% \end{Morciau} |
| 187 |
% |
| 188 |
% \texttt{Package inputenc Error: Invalid UTF-8 byte "A0.} |
| 189 |
% |
| 190 |
% \begin{Morciau} |
| 191 |
% Comme tout le travail avait été fait, il m'a été facile de |
| 192 |
% corriger l'erreur dans le code. J'en ai profité pour faire |
| 193 |
% apparaître, \emph{dans le document}, un message d'erreur plus |
| 194 |
% explicite nommant la clé indéfinie et pour moderniser un peu cette |
| 195 |
% extension. |
| 196 |
% \EnAnglais |
| 197 |
% As all the work was already done I easily wrote the correction in |
| 198 |
% the code. I've taken the opportunity to make appear, \emph{in the |
| 199 |
% document}, a more explicit error message in case of undefined key |
| 200 |
% and to modernise a bit this package. |
| 201 |
% \end{Morciau} |
| 202 |
% |
| 203 |
% \section{Utilisation -- Usage} |
| 204 |
% |
| 205 |
% \begin{Morciau}[Procédé/Process] |
| 206 |
% Le procédé mis en œuvre par ce module est le même que celui des |
| 207 |
% références classiques de \LaTeX{} avec \cs{label} et \cs{ref}. Il |
| 208 |
% faut donc deux compilations pour en voir l'effet. |
| 209 |
% \EnAnglais |
| 210 |
% \texttt{clefval} uses the process which \LaTeX's \cs{label} and \cs{ref} |
| 211 |
% use. You must therefore compile twice to obtain the full effect. |
| 212 |
% \end{Morciau} |
| 213 |
% \begin{Morciau} |
| 214 |
% Lors de la 1\iere compilation, \cs{TheKey}\LB|{clé}|\LB|{valeur}| écrit, |
| 215 |
% dans le fichier \texttt{aux}, \cs{newkey}\LB|{clé}|\LB|{valeur}|. |clé| et |
| 216 |
% |valeur| sont développés à moins qu'ils ne soient protégés soit pour avoir |
| 217 |
% été déclarés robustes (voir \cs{DeclareRobustCommand}) soit pour avoir été |
| 218 |
% protégés (voir \cs{protect}) par vous. |
| 219 |
% \EnAnglais |
| 220 |
% During the 1st run of \LaTeX, \cs{TheKey}\LB|{key}|\LB|{value}| writes |
| 221 |
% \cs{newkey}\LB|{key}|\LB|{value}| in the \texttt{aux} file. |key| |
| 222 |
% and |value| are expanded unless they are protected since they have been |
| 223 |
% declared robust (see \cs{DeclareRobustCommand}) or since they have been |
| 224 |
% protected (see \cs{protect}) by you. |
| 225 |
% \end{Morciau} |
| 226 |
% \begin{Morciau} |
| 227 |
% Lors de la 2\ieme compilation, après lecture du fichier \texttt{aux}, |
| 228 |
% \cs{TheValue}|{clé}| écrit |valeur|. |
| 229 |
% \EnAnglais |
| 230 |
% During the 2nd run, the \texttt{aux} file having been read, |
| 231 |
% \cs{TheValue}|{key}| writes |value|. |
| 232 |
% \end{Morciau} |
| 233 |
% \begin{Morciau}[Attention/Caution] |
| 234 |
% Les deux arguments de \cs{TheKey} sont \og mobiles \fg au sens de \LaTeX{} |
| 235 |
% et il faudra donc parfois les protéger. |
| 236 |
% \EnAnglais |
| 237 |
% Both arguments of \cs{TheKey} are `moving' as \LaTeX{} defines it and we have |
| 238 |
% sometimes to protect them. |
| 239 |
% \end{Morciau} |
| 240 |
% |
| 241 |
% \begin{Morciau} |
| 242 |
% Par ailleurs, les arguments ne doivent pas contenir de saut de |
| 243 |
% paragraphe (\cs{par}) ---~ou tout autre truc interdit dans les |
| 244 |
% arguments d'une commande qui n'est pas \cs{long}. |
| 245 |
% \EnAnglais |
| 246 |
% In addition the arguments must not contain end of paragraph |
| 247 |
% (\cs{par}) ---~or any other thingummy which is forbidden in the |
| 248 |
% arguments of a macro which is not \cs{long}. |
| 249 |
% \end{Morciau} |
| 250 |
% |
| 251 |
% \begin{Morciau}[Exemples/Examples] |
| 252 |
% On peut écrire |
| 253 |
% \EnAnglais |
| 254 |
% On can write |
| 255 |
% \end{Morciau} |
| 256 |
% |
| 257 |
% {\centering \TheKey{clou}{$2+5=7$}|\TheKey{clou}{$2+5=7$}| |
| 258 |
% \TheKey{glue}{\(2+6=8\)}|\TheKey{glue}{\(2+6=8\)}| |
| 259 |
% \par} |
| 260 |
% |
| 261 |
% \begin{Morciau} |
| 262 |
% puis \EnAnglais then |
| 263 |
% \end{Morciau} |
| 264 |
% |
| 265 |
% {\centering |\TheValue{clou}|, |\TheValue{glue}|\par} |
| 266 |
% |
| 267 |
% \begin{Morciau} |
| 268 |
% pour obtenir \EnAnglais to obtain |
| 269 |
% \end{Morciau} |
| 270 |
% |
| 271 |
% {\centering \TheValue{clou}, \TheValue{glue}.\par} |
| 272 |
% |
| 273 |
% \begin{Morciau} |
| 274 |
% On peut utiliser |$2+3$| comme clé --- même si on ne voit pas |
| 275 |
% pourquoi on le ferait --- mais \textbf{pas} |\(2+3\)|. Ce qui |
| 276 |
% tient à la manière dont les commandes |\(| et |\)| ont été |
| 277 |
% robustifiées. \emph{Ce n'est pas un bogue mais une fonctionnalité.} |
| 278 |
% \EnAnglais |
| 279 |
% On can use |$2+3$| as a key ---and I don't say that one should--- |
| 280 |
% but \textbf{not} |\(2+3\)|. That is due to the way the macros |\(| |
| 281 |
% and |\)| have been robustified. \emph{It's not a bug but a feature.} |
| 282 |
% \end{Morciau} |
| 283 |
% |
| 284 |
% |
| 285 |
% \begin{Morciau}[Avertissements/Warnings] |
| 286 |
% Le module signale les définitions multiples d'une même clef et |
| 287 |
% marque {\selectlanguage{english}\textbf{[?? clou ??]}} là où l'on utilise |
| 288 |
% \cs{TheValue}\LB|{clou}| alors que |clou| n'est pas définie comme |
| 289 |
% clef. En cas d'erreur, le fichier \texttt{log} contient la ligne : |
| 290 |
% \EnAnglais |
| 291 |
% The package warns about multiple definitions of the same key and |
| 292 |
% writes \textbf{[?? kew ??]} where one used \cs{TheValue}\LB|{kew}| whereas |
| 293 |
% |kew| was not defined as a key. In case of error, the \texttt{log} |
| 294 |
% file contains the line: |
| 295 |
% \end{Morciau} |
| 296 |
% \noindent\hspace*{\stretch{1}}\texttt{LaTeX Warning: There were undefined |
| 297 |
% references.}\hspace*{\stretch{1}} |
| 298 |
% |
| 299 |
% \vspace{\baselineskip} |
| 300 |
% |
| 301 |
% \begin{Morciau}[Remarque/Remark] |
| 302 |
% Josselin \textsc{Noirel} est intervenu efficacement, tant sur \fctt |
| 303 |
% que par courriel, pour corriger les modifications que j'avais fait |
| 304 |
% subir au code tiré de \texttt{ltxref} et \texttt{ltfiles}. C'est |
| 305 |
% pour sa contribution décisive qu'il est cité comme co-auteur de ce |
| 306 |
% module. Qu'il trouve là l'expression de ma profonde gratitude. |
| 307 |
% |
| 308 |
% Cependant, j'assume l'entière responsabilité de la rédaction de |
| 309 |
% cette documentation et de sa traduction ainsi que la paternité de |
| 310 |
% l'idée d'utiliser le mécanisme des \cs{label} pour accéder à un |
| 311 |
% \texttt{hashage} rudimentaire. |
| 312 |
% \EnAnglais |
| 313 |
% Josselin \textsc{Noirel} has efficiently helped me, on \fctt and by |
| 314 |
% email, to correct the hack I have made in the code taken from |
| 315 |
% \texttt{ltxref} and \texttt{ltfiles}. For he made that decisive |
| 316 |
% contribution, he is mentionned here as a co-author of this |
| 317 |
% package. May he find there the expression of my deep gratefulness. |
| 318 |
% |
| 319 |
% Howerver I take the entire responsability for the writing of the |
| 320 |
% present documentation and its English translation and I do recognise |
| 321 |
% having fathered the idea of using the \cs{label} mecanism to obtain |
| 322 |
% a rudimentary \texttt{hash}. |
| 323 |
% \end{Morciau} |
| 324 |
% |
| 325 |
% \vspace{\baselineskip} |
| 326 |
% |
| 327 |
% \begin{Morciau}[Version 0.1/Version 0.1] |
| 328 |
% Cette version est compatible avec un fichier codé en utf-8 compilé |
| 329 |
% avec \texttt{pdflatex}, \texttt{lualatex} ou \texttt{xelatex} |
| 330 |
% d'après mes --- quelques --- essais. Si ce n'était pas le cas, |
| 331 |
% n'hésitez pas à me signaler le problème. |
| 332 |
% \EnAnglais |
| 333 |
% This version is usable with a utf-8 encoded source run through |
| 334 |
% \texttt{pdflatex}, \texttt{lualatex} or \texttt{xelatex} as it |
| 335 |
% appears from my ---not very numerous--- trials. If it was not the |
| 336 |
% case don't hesitate to contact me. |
| 337 |
% \end{Morciau} |
| 338 |
% |
| 339 |
% \hspace*{\stretch{1}}Le \TeX nicien de |
| 340 |
% surface. \hspace*{0.125\linewidth} |
| 341 |
% |
| 342 |
% \vspace{2\baselineskip} |
| 343 |
% |
| 344 |
% \begingroup |
| 345 |
% \small |
| 346 |
% \hspace*{\stretch{1}}\textbf{In memoriam Énola Néra}\hspace*{\stretch{1}} |
| 347 |
% |
| 348 |
% \begin{Morciau} |
| 349 |
% Gentille chienne aimante et fidèle, compagne de plus de 10 ans que |
| 350 |
% son cœur a laché le 27 juillet 2020. |
| 351 |
% \EnAnglais |
| 352 |
% Kind, loving and faithfull bitch, companion of more than 10 years |
| 353 |
% whose heart stopped on the 27th July 2020. |
| 354 |
% \end{Morciau} |
| 355 |
% \endgroup |
| 356 |
% |
| 357 |
% \StopEventually{} |
| 358 |
% \section{Le code} |
| 359 |
% \label{secCode} |
| 360 |
% |
| 361 |
% Le code comporte des balises utilisable par \texttt{DocStrip} avec |
| 362 |
% lesquelles on peut produire une version francisée ou une version |
| 363 |
% anglaise de \NomDeModule{clefval}. Voir la documentation de |
| 364 |
% \texttt{DocStrip} pour de plus amples renseignements. |
| 365 |
% |
| 366 |
% On dit boujour, en français ou en anglais suivant la manière dont on |
| 367 |
% a créé \NomDeModule{clefval}. Puis on entre dans le vif du |
| 368 |
% sujet. |
| 369 |
% |
| 370 |
% Le code a d'abord été repris de \texttt{ltxref} mais j'avais |
| 371 |
% quelques ennuis avec les avertissements concernant les clefs non |
| 372 |
% définies ou définies plusieurs fois. Josselin Noirel a bien voulu |
| 373 |
% répondre à mon appel au secours sur \fctt. Le code qui suit est donc |
| 374 |
% la correction par Josselin de mes modifications du code de |
| 375 |
% \texttt{ltxref}, moyennant quoi, je signe \Sourire |
| 376 |
% |
| 377 |
% \iffalse |
| 378 |
%<*package> |
| 379 |
% \fi |
| 380 |
% \begin{macro}{\@setTheValue} |
| 381 |
% Le code est copié sur celui de |\@setref| dans |
| 382 |
% \texttt{ltxref}. Cette macro est appelée par \cs{TheValue}. Elle |
| 383 |
% vérifie que la \meta{clef} appelée existe. Si elle n'existe pas elle |
| 384 |
% imprime {\selectlanguage{english}\textbf{[?? \meta{clef} ??]}} et place un |
| 385 |
% avertissement dans le \texttt{log}. Sinon elle rend son premier |
| 386 |
% argument. |
| 387 |
% |
| 388 |
% On utilise |\G@refundefinedtrue| pour provoquer le message d'erreur |
| 389 |
% \og There were undefined references \fg. Un peu sybillin pour ce qui |
| 390 |
% nous concerne, il a l'avantage d'être reconnu par au moins |
| 391 |
% \texttt{emacs} plus \texttt{Auctex} et d'indiquer qu'il faut |
| 392 |
% relancer la compilation. |
| 393 |
% \begin{macrocode} |
| 394 |
\newcommand*{\@setTheValue}[2]{% |
| 395 |
\ifx#1\relax |
| 396 |
\protect\G@refundefinedtrue |
| 397 |
\nfss@text{\reset@font\bfseries[?? #2 ??]}% |
| 398 |
% \end{macrocode} |
| 399 |
% \end{macro} |
| 400 |
% \iffalse |
| 401 |
%</package> |
| 402 |
%<*packfra> |
| 403 |
% \fi |
| 404 |
% \textsf{Messages d'avertissement en français} |
| 405 |
% \begin{macrocode} |
| 406 |
\@latex@warning{Valeur de #2 en page \thepage\space non d\'efinie}% |
| 407 |
% \end{macrocode} |
| 408 |
% \iffalse |
| 409 |
%</packfra> |
| 410 |
%<*packeng> |
| 411 |
% \fi |
| 412 |
% \textsf{Warning messages in English } |
| 413 |
% \begin{macrocode} |
| 414 |
\@latex@warning{Value of `#2' on page \thepage\space undefined}% |
| 415 |
% \end{macrocode} |
| 416 |
% \iffalse |
| 417 |
%</packeng> |
| 418 |
%<*package> |
| 419 |
% \fi |
| 420 |
% \begin{macrocode} |
| 421 |
\else #1\null \fi} |
| 422 |
% \end{macrocode} |
| 423 |
% \begin{macro}{\TheValue} |
| 424 |
% Le code est copié sur celui de |\ref| dans \texttt{ltxref}. Si |
| 425 |
% l'argument de \cs{TheValue} est une clef valide, on obtient la |
| 426 |
% valeur référencée par cette clef. |
| 427 |
% \begin{macrocode} |
| 428 |
\newcommand*{\TheValue}[1]{\expandafter\@setTheValue\csname |
| 429 |
V@#1\endcsname{#1}} |
| 430 |
% \end{macrocode} |
| 431 |
% \end{macro} |
| 432 |
% \begin{macro}{\@newk@ey} |
| 433 |
% Le code est copié sur celui de |\@newl@bel| dans \texttt{ltxref}. |
| 434 |
% \begin{macrocode} |
| 435 |
\newcommand*{\@newk@ey}[3]{{% |
| 436 |
\@ifundefined{#1@#2}% |
| 437 |
{\relax}% |
| 438 |
{\gdef \@multiplekeys {% |
| 439 |
% \end{macrocode} |
| 440 |
% \end{macro} |
| 441 |
% \iffalse |
| 442 |
%</package> |
| 443 |
%<*packfra> |
| 444 |
% \fi |
| 445 |
% \textsf{Messages d'avertissement en français} |
| 446 |
% \begin{macrocode} |
| 447 |
\@latex@warning@no@line{Des clefs sont d\'efinies plusieurs fois.}}% |
| 448 |
\@latex@warning@no@line{La clef #2 est d\'efinie plusieurs fois}}% |
| 449 |
% \end{macrocode} |
| 450 |
% \iffalse |
| 451 |
%</packfra> |
| 452 |
%<*packeng> |
| 453 |
% \fi |
| 454 |
% \textsf{Warning messages in English } |
| 455 |
% \begin{macrocode} |
| 456 |
\@latex@warning@no@line{There were multiply-defined keys.}}% |
| 457 |
\@latex@warning@no@line{Key `#2' multiply defined}}% |
| 458 |
% \end{macrocode} |
| 459 |
% \iffalse |
| 460 |
%</packeng> |
| 461 |
%<*package> |
| 462 |
% \fi |
| 463 |
% \begin{macrocode} |
| 464 |
\global\@namedef{#1@#2}{#3}}} |
| 465 |
% \end{macrocode} |
| 466 |
% \begin{macro}{\newkey} |
| 467 |
% On opère ici une puissante magie qui fait que tout marche comme |
| 468 |
% attendu \Sourire |
| 469 |
% \begin{macrocode} |
| 470 |
\def\newkey{\@newk@ey V} |
| 471 |
\@onlypreamble\@newk@ey |
| 472 |
\AtEndDocument{\let\@newk@ey=\@testdef} |
| 473 |
% \end{macrocode} |
| 474 |
% \end{macro} |
| 475 |
% \iffalse |
| 476 |
%</package> |
| 477 |
% ^^A fin du code de Josselin Noirel |
| 478 |
%<*package> |
| 479 |
% \fi |
| 480 |
% À partir d'ici votre serviteur s'est débrouillé tout seul pour |
| 481 |
% modifier le code des bases de \LaTeX. |
| 482 |
% |
| 483 |
% \begin{macro}{\@protected@write} |
| 484 |
% Le code est copié sur celui de |\protected@write| défini dans |
| 485 |
% \texttt{ltfiles}. On n'a besoin que d'un seul argument qui est écrit |
| 486 |
% dans le fichier |\@auxout| c-à-d. le fichier \texttt{aux}. |
| 487 |
% La macro prend soin de ce qui est protégé soit de manière définitive |
| 488 |
% pour avoir été défini par \cs{DeclareRobustCommand} et ses petits |
| 489 |
% amis, soit pour être précédé de \cs{protect} comme on doit le faire |
| 490 |
% parfois pour les arguments \og mobiles \fg (\emph{moving |
| 491 |
% argument}). |
| 492 |
% \begin{macrocode} |
| 493 |
\long\def \@protected@write#1{% |
| 494 |
\begingroup |
| 495 |
\let\protect\@unexpandable@protect |
| 496 |
\edef\reserved@a{% |
| 497 |
\write\@auxout{#1}}% |
| 498 |
\reserved@a \endgroup \if@nobreak\ifvmode\nobreak\fi\fi } |
| 499 |
% \end{macrocode} |
| 500 |
% \end{macro} |
| 501 |
% \begin{macro}{\@multiplekeys} |
| 502 |
% En mettant |\@multiplekeys| à \cs{relax}, on s'assure qu'il n'y aura |
| 503 |
% pas de hurlements alors que rien n'est encore défini et donc encore |
| 504 |
% moins défini plusieurs fois \Sourire |
| 505 |
% \begin{macrocode} |
| 506 |
\let \@multiplekeys \relax |
| 507 |
% \end{macrocode} |
| 508 |
% \end{macro} |
| 509 |
% \begin{macro}{\TheKey} |
| 510 |
% Le code remprend celui de \cs{label} mais il nous faut deux |
| 511 |
% arguments, le 1\ier pour la clef, le 2\textsuperscript{nd} pour la |
| 512 |
% valeur associée. |
| 513 |
% \begin{macrocode} |
| 514 |
\def\TheKey#1#2{{\@bsphack |
| 515 |
\@protected@write{\string\newkey{#1}{#2}}% |
| 516 |
\@esphack}} |
| 517 |
% \end{macrocode} |
| 518 |
% \end{macro} |
| 519 |
% \iffalse |
| 520 |
%</package> |
| 521 |
% \fi |
| 522 |
% \Finale \PrintChanges\PrintIndex |
| 523 |
\endinput |