From bc760bf42782cd2acdebbd360ceca4a5609c658a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 9 Apr 2010 23:57:50 +0000 Subject: modroman 1 (9apr10) git-svn-id: svn://tug.org/texlive/trunk@17778 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/modroman/LISEZMOI | 31 - .../texmf-dist/doc/latex/modroman/MODRdoctools.sty | 117 ++ Master/texmf-dist/doc/latex/modroman/README | 30 - .../texmf-dist/doc/latex/modroman/modroman-en.pdf | Bin 0 -> 539338 bytes .../texmf-dist/doc/latex/modroman/modroman-en.tex | 462 +++++ .../texmf-dist/doc/latex/modroman/modroman-fr.pdf | Bin 0 -> 539175 bytes .../texmf-dist/doc/latex/modroman/modroman-fr.tex | 468 +++++ Master/texmf-dist/doc/latex/modroman/modroman.dtx | 1749 ++++++++++++++++++ Master/texmf-dist/doc/latex/modroman/modroman.pdf | Bin 314901 -> 562106 bytes Master/texmf-dist/source/latex/modroman/LISEZMOI | 37 + Master/texmf-dist/source/latex/modroman/Makefile | 63 +- Master/texmf-dist/source/latex/modroman/README | 38 + .../texmf-dist/source/latex/modroman/modroman.dtx | 1929 +++++++++++++++++--- .../texmf-dist/source/latex/modroman/modroman.ins | 23 +- Master/texmf-dist/tex/latex/modroman/modroman.sty | 207 ++- 15 files changed, 4760 insertions(+), 394 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/modroman/LISEZMOI create mode 100644 Master/texmf-dist/doc/latex/modroman/MODRdoctools.sty delete mode 100644 Master/texmf-dist/doc/latex/modroman/README create mode 100644 Master/texmf-dist/doc/latex/modroman/modroman-en.pdf create mode 100644 Master/texmf-dist/doc/latex/modroman/modroman-en.tex create mode 100644 Master/texmf-dist/doc/latex/modroman/modroman-fr.pdf create mode 100644 Master/texmf-dist/doc/latex/modroman/modroman-fr.tex create mode 100644 Master/texmf-dist/doc/latex/modroman/modroman.dtx create mode 100755 Master/texmf-dist/source/latex/modroman/LISEZMOI create mode 100755 Master/texmf-dist/source/latex/modroman/README diff --git a/Master/texmf-dist/doc/latex/modroman/LISEZMOI b/Master/texmf-dist/doc/latex/modroman/LISEZMOI deleted file mode 100644 index 7f2639c2565..00000000000 --- a/Master/texmf-dist/doc/latex/modroman/LISEZMOI +++ /dev/null @@ -1,31 +0,0 @@ --*- coding: utf-8 -*- -MODROMAN 0.4 2008-05-04 - -Édition du cinquantenaire ;-) - -LISEZMOI -README -Makefile -modroman.dtx -modroman.pdf % documentation bilingue -modroman.ins - -====================================================================== - -modroman.sty, deux macros pour écrire les nombres en chiffres romains -minuscules sous la forme i, ij, iij, iv etc. -(Avez-vous noté le j final ?) - -Avec l’option « upourv » modroman 6 affiche uj au lieu de vj. L’option -vpourv lui fait afficher vj, c’est l’option par défaut. - -Pour produire le fichier modroman.sty lancer : -latex modroman.ins - -Sous *nix, on peut utiliser le Makefile fourni, -make help -pour obtenir de l’aide. - --- -Le \TeX nicien de surface -le.texnicien.de.surface@wanadoo.fr diff --git a/Master/texmf-dist/doc/latex/modroman/MODRdoctools.sty b/Master/texmf-dist/doc/latex/modroman/MODRdoctools.sty new file mode 100644 index 00000000000..8d7c7ba016e --- /dev/null +++ b/Master/texmf-dist/doc/latex/modroman/MODRdoctools.sty @@ -0,0 +1,117 @@ +%% +%% This is file `MODRdoctools.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% modroman.dtx (with options: `doc-sty') +%% +%% This is a generated file. +%% +%% Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, +%% dit «le TeXnicien de surface» +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version +%% 1999/12/01 or later. +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\def\fileversion{v1} +\def\filedate{2010/04/09} +\def\fileinfo{fichier MODRdoctools par Le TeXnicien de surface} +\ProvidesPackage{MODRdoctools} + [\filedate\space\fileversion\space\fileinfo] +\RequirePackage{ifthen} +\newcommand{\TO}{\textemdash\ \ignorespaces} +\newcommand{\TF}{\unskip\ \textemdash\xspace} +\newcommand{\CAD}{% + \iflanguage{frenchb}{c.-à-d.}{% + \iflanguage{english}{i.~e.}{% + \PackageError{MODRdoctools}% + {undefined language}% + {fix it before going on}}}\xspace} +\newcommand\BOP{\discretionary{}{}{}} +\newcommand\Option[1]{\textsc{#1}} +\newcommand\Pkg[1]{\textsf{#1}} +\newcommand\NOUVO{% + \marginpar{\hspace*{\stretch{1}}% + \textbf{N (v1)}\hspace*{.5em}}\xspace} +\newcommand\DescribeOption[1]{\leavevmode\@bsphack + \marginpar{\raggedleft \textsc{#1}}\index{#1 (option)}\@esphack} +\newcommand\PD{\textbf{[PD]}} +\newcommand\LT{\textbf{[\LaTeX]}} +\newcommand\TX{\textbf{[\TeX]}} + +\newcounter{EXEMPLE} +\newcommand\Exemple[1]{\setcounter{EXEMPLE}{#1}\modroman{EXEMPLE}} + +\newcommand\UnExemple[2]{\par\noindent\cs{nb#1}\texttt{\{#2\}} + \(\longrightarrow\) \csuse{nb#1}{#2}\par} +\newcommand\Exemples[1]{% + \par\noindent\hrulefill\par\noindent + \iflanguage{frenchb}{\textbf{Exemples}}{% + \iflanguage{english}{\textbf{Examples}}{}} + \UnExemple{#1}{1}\UnExemple{#1}{11}% + \UnExemple{#1}{444}% + \UnExemple{#1}{888}\UnExemple{#1}{1999}% + \par\noindent\hrulefill\par} + +\newenvironment{Anglais}[1][***]{% + \par\ifthenelse{\equal{#1}{***}}{\noindent}{}% + \begin{otherlanguage}{english}\itshape}% + {\end{otherlanguage}} +\newcommand\EnAnglais[1]{ / \emph{\foreignlanguage{english}{#1}}} +\newcommand\MODRdescrofr{% + Cette petite extension fournit des macros qui permettent d'écrire + les nombres en chiffres romains avec quelques modifications. + + On dispose de macros permettant d'obtenir \og \nbshortroman{1}\fg + pour~1 et \og \nbshortroman{18}\fg pour~18; \og + \nblongroman{999}\fg ou \og \nbLongRoman{999}\fg pour~999. + + Avec l'option \Option{upourv} \TO opposée de \Option{vpourv} option + par défaut\TF on obtient \og xuj\fg pour~15. Avec l'option + \Option{ifinal} \TO opposée de \Option{jfinal} option par défaut\TF + on peut obtenir \og xiiii\fg pour~14. + + Certaines macros s'utilisent comme le \cs{romannumeral} de \TeX, + d'autres, purement développables, sont destinées à formater un + compteur \TO comme le \cs{roman} de \LaTeX\TF ou un nombre. + + Elle offre aussi une macro \TO + \cs{printntimes}\marg{nombre}\marg{texte}\TF qui permet d'obtenir + \meta{nombre} fois le \marg{texte} comme + \texttt{\printntimes{10}{*}} obtenu avec + \texttt{\cs{printntimes}\{10\}\{*\}}.} + +\newcommand\MODRdescroen{% + This short package provides macros which enable one to write roman + numerals with some modifications. + + It provides macros with which one can obtain `\nbshortroman{1}' + for~1 and `\nbshortroman{18}' for~18; `\nblongroman{999}' or + `\nbLongRoman{999}' for~999. + + With option \Option{upourv} \TO opposite of \Option{vpourv} default + option \TF one obtains `xuj' for~15. With option \Option{ifinal} \TO + opposite of \Option{jfinal} default option\TF one can obtain `xiiii' + for~14. + + Some of the macros are used as \TeX{} \cs{romannumeral}, others, + purely expandable, are devoted to format a counter \TO as \LaTeX{} + \cs{roman}\TF or a number. + + It also provides a macro \TO + \cs{printntimes}\marg{number}\marg{text}\TF which produces + \meta{number} times the \marg{text} as e.g. + \texttt{\printntimes{10}{*}} obtained with + \texttt{\cs{printntimes}\{10\}\{*\}}.} +\endinput +%% +%% End of file `MODRdoctools.sty'. diff --git a/Master/texmf-dist/doc/latex/modroman/README b/Master/texmf-dist/doc/latex/modroman/README deleted file mode 100644 index 8894210133b..00000000000 --- a/Master/texmf-dist/doc/latex/modroman/README +++ /dev/null @@ -1,30 +0,0 @@ -MODROMAN 0.4 2008-05-04 - -====================================================================== -Files: -LISEZMOI -README -Makefile -modroman.dtx -modroman.pdf % bilingual documentation -modroman.ins - -====================================================================== - -modroman.sty, two macros to write numbers in lower case -roman numerals thus i, ij, iij, iv and so on. (See the -final j?) - -With option ``upourv'' modroman 6 writes uj instead of vj. -The default option ``vpourv'' makes it write vj. - -To produce the modroman.sty file run: -latex modroman.ins - -*nix users should use the provided Makefile, run -make help -to obtain help. - --- -Le \TeX nicien de surface -le.texnicien.de.surface@wanadoo.fr diff --git a/Master/texmf-dist/doc/latex/modroman/modroman-en.pdf b/Master/texmf-dist/doc/latex/modroman/modroman-en.pdf new file mode 100644 index 00000000000..59b399fd610 Binary files /dev/null and b/Master/texmf-dist/doc/latex/modroman/modroman-en.pdf differ diff --git a/Master/texmf-dist/doc/latex/modroman/modroman-en.tex b/Master/texmf-dist/doc/latex/modroman/modroman-en.tex new file mode 100644 index 00000000000..d1945dc6ff7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/modroman/modroman-en.tex @@ -0,0 +1,462 @@ +%% +%% This is file `modroman-en.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% modroman.dtx (with options: `doc,en') +%% +%% This is a generated file. +%% +%% Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, +%% dit «le TeXnicien de surface» +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version +%% 1999/12/01 or later. +%% +\documentclass[a4paper]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{modroman}[2010/04/09] +\usepackage{xspace} +\usepackage{array} +\usepackage{ifthen} +\usepackage{MODRdoctools} +\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} +\usepackage[frenchb,english]{babel} +\usepackage[colorlinks=true, + linkcolor=blue, + urlcolor=blue, + citecolor=blue]{hyperref} + +\begin{document} +\renewcommand\thepage{\textit{\modroman{page}}} +\title{The package \textsf{modroman}\thanks{ + This document corresponds to the file + \textsf{modroman}~\fileversion, dated \filedate.}} +\author{\href{mailto:le.texnicien.de.surface@wanadoo.fr}{Le \TeX + nicien de surface}} + +\maketitle + +\begin{abstract} +\begin{otherlanguage} +{french} +\bfseries{} + Documentation anglaise pour l'utilisateur final de l'extension + \Pkg{modroman}. + La documentation française est disponible sous le nom de + \texttt{modroman-fr}. +\end{otherlanguage} + +\vspace{6pt} +\noindent\hrulefill +\vspace{6pt} + +This is the English documentation of \Pkg{modroman} for the final +user. + +\MODRdescroen +\end{abstract} + +\tableofcontents{} + +\section{Introduction} + +\subsection{Motivation} + +The ways of writing numbers with roman numerals are more diverse than +it could be thought when one considers the \TeX{} \cs{romannumeral} +and \LaTeX{} \cs{roman} and \cs{Roman}. Many other forms were used at +a time or another through history. I saw, many years ago, the form +\nbshortroman{8} in a manuscript. The first versions \TO from 0.1 to +0.4\TF of this package provided just that form, with, user willing, +the use of a~|u| to denote a group of~5 as in `xuij' for~17. + +The interested reader could cast a glance on the page wikipedia +devotes to roman numerals to see that the world is not always as +simple as one would like it to be. + +\subsection{ +Technical Remarks +} + +The code of the first versions enable one to number the pages with +\emph{modified} roman numerals but one could not then use the +reference tools such as \cs{label} and \cs{ref} or even hope to see +the page numbers correctly written in the table of contents. + +As the years go by I don't really become more clever but, for I read +not a few documentations of packages, I end with knowing a bit more +and I happen to stumble upon the solution to a problem I had just +caught a glimpse of. + +I don't forget what I owe to T.~\textsc{Lachand}-\textsc{Robert} +in~\cite{tlachand} -- numerous ideas, detailed examples, clear +explanations -- but I now use other sources -- +\texttt{source2e}~\cite{source2e} to be accurate. That is where I have +found the \emph{trick} which enables me to provide this new version of +\Pkg{modroman}. The reader who would like to know more should have a +look at the definition of the macro \cs{Roman} and its auxiliary +macros. + +While rewriting the code I happen to understand that I was able to go +a bit farther than I have gone previously without a tremendous extra +cost. That's why one will now find more macros and more presentations +of the roman numerals and an additional macro. + +This version~1 keeps the compatibility with the previous version but +the code has been completely rewritten and the package now provides to +the user in addition to \cs{modroman} and \cs{modromannumeral} about +fifteen other macros. + +However, the main change introduced by this version~1 is the fact that +from now on \cs{modroman} \TO and its pals \TF is purely expandable +\TO see page~\pageref{puredev} for more details. One can then use it +to number pages and obtain the correct thing in the table of content +-- which was not the case until now. Caution, I do \emph{not} say that +\cs{modromannumeral} is purely expandable -- it is not. + +\subsection{ +Purely Expandable Macros +} + +One could, if one understands French, read the thread +`\foreignlanguage{frenchb}{test de développabilité pure ?}' on the +news group \texttt{fr.comp.text.tex} to see that that notion is not as +simple as one could think at n-th sight \texttt{:-)} however, here, +when I will say that a macro is `purely expandable' I will understand +what follows. + +Let's assume that the macro \cs{thing} is such that +\cs{thing}\marg{12} gives `xij' \TO does it ring a bell?\TF +then\label{puredev} +\begin{enumerate} +\item the macro \cs{THING} defined by + |\edef|\BOP|\TRUC|\BOP|{|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|}| + is such that: + \begin{enumerate} + \item \cs{THING} gives `xij' and + \item |\meaning\THING| gives `\texttt{macro:->xij}' + \end{enumerate} +\item moreover, if one defines \cs{Axij} then the construct + |\csname| |A|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|\endcsname| + truly calls the macro \cs{Axij}. +\end{enumerate} + +\section{ +Usage +} + +\subsection{ +The Macros +} + +Macros the name of which ends with \texttt{numeral} are to be used as +\TeX{} \cs{romannumeral}. They must be followed by a number and eat +the spaces which are after it, e.~g. +|\longromannumeral| \verb*+368 AND+ gives `\longromannumeral +368 AND'. + +Macros the name of which begins with \cs{nb} take a number as argument +such as |\nbLongRoman{127}| which gives `\nbLongRoman{127}'. + +Macros the name of which doesn't begin with \cs{nb} but ends with +\texttt{roman} are used as \LaTeX{} \cs{roman}: their only argument is +the name of a counter. With |\newcounter{machin}|, +|\setcounter{machin}{124}|, |\shortroman{machin}| one obtains +`\nbshortroman{124}'. + +In what follows \meta{nbr} denotes a number, \meta{ctr} denotes the +\LaTeX{} name of a counter such as \texttt{page} or \texttt{chapter}. + +Here comes a presentation of all the macros available with this +package. They are grouped by family where a family is defined with +respect to the obtained presentation of roman numerals. + +After the macro's syntax, there will be \PD to mean that the macro is +purely expandable \TO see page~\pageref{puredev}\TF, \LT to mean that +it is used the \LaTeX{} way, \TX to mean that it is used as the \TeX{} +\cs{romannumeral}. + +The examples are governed by the default options: \Option{jfinal}, +\Option{vpourv}, \Option{court}, \Option{min}. + +\subsubsection{ +shortroman +Family +} + +\begin{macro}{\shortroman} + \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\shortromannumeral} + \cs{shortromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbshortroman} + \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{shortroman} + +\subsubsection{ +longroman +Family +} + +\begin{macro}{\longroman} + \cs{longroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\longromannumeral} + \cs{longromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nblongroman} + \cs{nblongroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{longroman} + +\subsubsection{ +LongRoman +Family +} + +\begin{macro}{\LongRoman} + \cs{LongRoman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\LongRomannumeral} + \cs{LongRomannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbLongRoman} + \cs{nbLongRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{LongRoman} + +\subsubsection{ +roman +Family +} + +\TeX{} provides \cs{romannumeral} and \LaTeX{} \cs{roman}. I +complete the family with \cs{nbroman}. + +\begin{macro}{\nbroman} + \cs{nbroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{roman} + +\subsubsection{ +Roman +Family +} + +\LaTeX{} provides \cs{Roman}. I complete the family with \cs{nbRoman} and +\cs{Romannumeral}. + +\begin{macro}{\Romannumeral} + \cs{Romannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbRoman} + \cs{nbRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{Roman} + +\subsubsection{ +modroman +Family +} + +The output of the macros \cs{modroman}, \cs{modromannumeral}, and +\cs{nbmodroman} is determined by the chosen options. By default: + +\begin{macro}{\modroman} + \cs{modroman}\marg{ctr} $=$ \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\modromannumeral} + \cs{modromannumeral}\meta{nbr} $=$ \cs{shortromannumeral}\meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbmodroman} + \cs{nbmodroman}\marg{nbr} $=$ \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{modroman} + +\subsubsection{ +Other macros +} + +One can redefine the behaviour of families \cs{shortroman} and +\cs{longroman} with the macro \cs{RedefineMRmdclxvij}. + +\begin{macro}{\RedefineMRmdclxvij} + \cs{RedefineMRmdclxvij}\oarg{ISOL}\BOP\marg{M}\BOP\marg{D}\BOP\marg{C}% + \BOP\marg{L}\BOP\marg{X}\BOP\marg{V}\BOP\marg{I}\BOP\marg{J} +\end{macro} + +The above arguments determine the look of the roman numerals produced +after \TO one should take care of the side effects and one would have +to limit the scope of the redefinition ot a group if necessary\TF by +the families \cs{shortroman}, \cs{longroman}, and, if it is linked to +one of the two preceding, \cs{modroman}. + +The optional argument \meta{ISOL} gives the look of the isolated |i| \CAD the +number~1. If one doesn't give the argument the look of the isolated +|i| is the look of the non-final |i| determined by \meta{I} + +The look of the final~|i| is given by the argument \meta{J}. All other +arguments give the look of the corresponding (lowercase) digit, +e.~g. \meta{M} gives the look of~|m|. + +\begin{macro}{\printntimes} + \cs{printntimes}\marg{nbr}% +\marg{text} +\end{macro} + +Here are two examples using the macro. + +|$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$| + +gives + +$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$ + +\bigskip + +|\newcommand\truc{\par\centering ***\par}|\par +|\newcommand\saut{\par\noindent\hrulefill\par}|\par +|\saut\texttt{\printntimes{5}{\truc}}\saut| + +gives + +\newcommand\truc{\par\centering ***\par} +\newcommand\saut{\par\noindent\hrulefill\par} +\saut\texttt{\printntimes{5}{\truc}}\saut + +\subsection{ +The Options +} + +There exist -- since the version~0.2 -- options \Option{vpourv} and +\Option{upourv}. The default option is \Option{vpourv} with which +\cs{modromannumeral}|5| is written as `v'. With the option +\Option{upourv} the same \cs{modromannumeral}|5| is written as `u'. It +was a special requirement from \emph{one} person posting on +\url{fr.comp.text.tex}. \emph{The (almost) French `vpourv' stands for + `v for v'.} + +For sake of symetry, I add, with this version~1, two +antithetical options \Option{jfinal} -- final j -- the default, and +\Option{ifinal} -- final i -- by which one can choose if the last~i of +the number will be written as a~|j| or not. + +I add also two pairs of antithetic options. First \Option{min} \TO +\CAD \emph{minuscule} lowercase, default option \TF and \Option{maj} +\TO \CAD \emph{majuscule} uppercase\TF then \Option{court} \TO short, +default option \TF and \Option{long}. + +Last, with this version~1, I add the option \Option{sansmod} -- +without modification -- which makes the macros of the \cs{modroman} +family aliases of those of \cs{roman} family. + +The last five options determine the behaviour of the macros of the +family \cs{modroman}. + +\DescribeOption{upourv} +With that option, the roman numeral `v' is turn into an~`u' and one +obtains, e.g., `xuij' for~17. + +\DescribeOption{vpourv} +That option, enforced by default, is the opposite of the previous +one. With it, one obtains \Exemple{17} for~17. + +The next three options appear with the version~1 of the package. + +\DescribeOption{jfinal} +With that default option, if the processed number is greater than~1 +and if the last roman \emph{digit} is an~i then it is turned into +a~j. See the examples above. + +\DescribeOption{ifinal} +That option is the opposite of the previous one. When enforced, one +obtains \romannumeral 17{} for~17. + +\DescribeOption{sansmod} +With that option \cs{modroman}, \cs{modromannumeral} and +\cs{nbmodroman} are just aliases -- obtained with \cs{let} -- of +\cs{roman}, \cs{romannumeral}, and \cs{nbroman} respectively. + +If one choses options \Option{vpourv}, , \Option{court}, \Option{min}, +and \Option{ifinal} together, one enforces the option +\Option{sansmod}. + +\bigskip + +The following table shows which family is linked to the \cs{modroman} +family according to the chosen options when \Option{sansmod} is not +enforced. + +\begin{center} + \begin{tabular}{|*{3}{c|}}\hline + & \Option{court} & \Option{long}\\ \hline + \Option{min} & \cs{shortroman} & \cs{longroman} \\ \hline + \Option{maj} & \cs{Roman} & \cs{LongRoman} \\ \hline + \end{tabular} +\end{center} + +\input{MODRbiblio} + +\iffalse +\newpage +\section{ +Numbers from \nbmodroman{1} to \nbmodroman{1000} +} + +\newcounter{machin}\setcounter{machin}{1} +\noindent +\whiledo{\value{machin}<1001}{% + \mbox{\arabic{machin} -- \shortroman{machin} -- \longroman{machin} + -- \LongRoman{machin}}\stepcounter{machin}\par\noindent} +\newpage +\fi +\vspace*{\stretch{4}} +\noindent\hrulefill +\begin{center} +In the preambule of this document, there is +\\ +|\renewcommand\thepage{\textit{\modroman{page}}}| +\\ +hence the page numbering. +\end{center} +\noindent\hrulefill + +\vspace*{\stretch{2}} + +\begin{center} +\framebox{ + Here ends the documentation of \Pkg{modroman}. +} +\end{center} +\vspace*{\stretch{4}} +\end{document} +\endinput +%% +%% End of file `modroman-en.tex'. diff --git a/Master/texmf-dist/doc/latex/modroman/modroman-fr.pdf b/Master/texmf-dist/doc/latex/modroman/modroman-fr.pdf new file mode 100644 index 00000000000..304fa1deed0 Binary files /dev/null and b/Master/texmf-dist/doc/latex/modroman/modroman-fr.pdf differ diff --git a/Master/texmf-dist/doc/latex/modroman/modroman-fr.tex b/Master/texmf-dist/doc/latex/modroman/modroman-fr.tex new file mode 100644 index 00000000000..900a16400c6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/modroman/modroman-fr.tex @@ -0,0 +1,468 @@ +%% +%% This is file `modroman-fr.tex', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% modroman.dtx (with options: `doc,fr') +%% +%% This is a generated file. +%% +%% Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, +%% dit «le TeXnicien de surface» +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version +%% 1999/12/01 or later. +%% +\documentclass[a4paper]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{modroman}[2010/04/09] +\usepackage{xspace} +\usepackage{array} +\usepackage{ifthen} +\usepackage{MODRdoctools} +\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} +\usepackage[english,frenchb]{babel} +\usepackage[colorlinks=true, + linkcolor=blue, + urlcolor=blue, + citecolor=blue]{hyperref} + +\begin{document} +\renewcommand\thepage{\textit{\modroman{page}}} +\title{L'extension \textsf{modroman}\thanks{ + Ce document correspond au fichier + \textsf{modroman}~\fileversion, du \filedate.}} +\author{\href{mailto:le.texnicien.de.surface@wanadoo.fr}{Le \TeX + nicien de surface}} + +\maketitle + +\begin{abstract} +\begin{otherlanguage} +{english} +\bfseries{} + This is the French documentation of \Pkg{modroman} for the final + user. + The English documentation is provided under the name + \texttt{modroman-en}. +\end{otherlanguage} + +\vspace{6pt} +\noindent\hrulefill +\vspace{6pt} + +Documentation française pour l'utilisateur final de l'extension +\Pkg{modroman}. + +\MODRdescrofr +\end{abstract} + +\tableofcontents{} + +\section{Introduction} + +\subsection{Motivation} + +Les formes d'écriture des nombres en chiffres romains telles que les +proposent \TeX, avec \cs{romannumeral}, et \LaTeX, avec \cs{roman} et +\cs{Roman}, sont loin d'être les seules qui furent en usage. J'avais +vu, il y a bien longtemps, la notation \nbshortroman{8} dans un +manuscrit. Les premières versions \TO de 0.1 à 0.4\TF de cette +extension ne permettaient que cette écriture, avec, au gré de +l'utilisateur, l'utilisation d'un |u| pour noter la \emph{cinquaine} +comme dans \og xuij\fg pour~17. + +Le lecteur interessé pourra jeter un \oe il sur la page que wikipedia +consacre aux chiffres romains pour voir que le monde n'est pas +toujours aussi simple que l'on voudrait qu'il soit. + +\subsection{ +Remarques techniques +} + +Le code des premières versions permettait de numéroter les pages avec +les chiffres romains \emph{modifiés} mais on ne pouvait plus alors +utiliser les outils de référence comme \cs{label} et \cs{ref} ni même +espérer voir les nombres écrits correctement dans la table des +matières. + +Si les années qui passent ne me rendent pas beaucoup plus malin, elles +ont un avantage: à force de lire des documentations d'extension, je +finis par en connaitre davantage et il m'arrive de buter par hasard +sur la solution à un problème que je n'avais fait qu'entrevoir. + +Je n'oublie pas les idées --~nombreuses~--, les exemples +--~détaillés~-- et les explications --~claires~-- fournis par +T.~\textsc{Lachand}-\textsc{Robert} dans~\cite{tlachand} mais je +m'abreuve désormais aussi à d'autres sources -- +\texttt{source2e}~\cite{source2e} pour être précis -- et c'est là +que j'ai trouvé l'\emph{astuce} qui me permet de fournir cette +nouvelle version de \Pkg{modroman}. Le lecteur intéressé jettera +un coup d'\oe il sur la définition de la macro \cs{Roman} et ses macros +auxiliaires. + +En réécrivant le code je me suis apperçu que je pouvais aller un peu +plus loin que je ne l'avais fait sans qu'il m'en coute beaucoup +plus. Voila pourquoi on trouvera désormais plus de macros et plus de +présentations des nombres en chiffres romains et une macro +supplémentaire. + +Cette version~1 conserve la compatibilité avec la version précédente +mais le code a été complètement réécrit et l'extension fournit +désormais à l'utilisateur outre les macros \cs{modroman} et +\cs{modromannumeral} une bonne quinzaine d'autres. + +Toutefois, la grande nouveauté de cette version~1 est que, désormais, +la macro \cs{modroman} \TO et ses petites camarades\TF est \og +purement développable\fg \TO voir page~\pageref{puredev} pour plus de +détails\TF, on peut donc l'utiliser pour numéroter des pages \emph{et} +obtenir ce qu'il faut dans la table des matières -- ce qui n'était pas +le cas jusqu'ici. Attention, je ne dis rien de tel à propos de +\cs{modromannumeral}. + +\subsection{ +Macros purement développables +} + +On pourra lire le fil de discussion \og test de développabilité pure ? +\fg dans le forum \texttt{fr.comp.text.tex} pour voir que cette notion +n'est pas aussi simple qu'elle parait au n\ieme abord \texttt{:-)} +toutefois, ici, lorsque je dirais qu'une macro est \og purement +développable\fg j'entendrai ce qui suit. + +Supposons que la macro \cs{truc} soit telle que \cs{truc}\marg{12} +donne \og xij\fg \TO ça vous dit quelque chose? \TF +alors\label{puredev} +\begin{enumerate} +\item la macro \cs{TRUC} définie par + |\edef|\BOP|\TRUC|\BOP|{|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|}| + est telle que: + \begin{enumerate} + \item \cs{TRUC} donne bien \og xij\fg et + \item |\meaning\TRUC| donne \og \texttt{macro:->xij}\fg + \end{enumerate} +\item de plus, si on définit \cs{Axij}, alors la construction +|\csname| |A|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|\endcsname| +appelle bien la macro \cs{Axij}. +\end{enumerate} + +\section{ +Utilisation +} + +\subsection{ +Les macros +} + +Les macros dont le nom finit par \texttt{numeral} s'utilisent comme la +macro \TeX{} \cs{romannumeral}. Elles doivent être suivies d'un nombre +et mangent les espaces qui le suivent. P.~ex. +|\longromannumeral| \verb*+368 ET+ donne \og\longromannumeral +368 ET\fg. + +Les macros dont le nom commence par \cs{nb} prennent un argument qui +est un nombre comme |\nbLongRoman{127}| qui donne \og +\nbLongRoman{127}\fg. + +Les macros dont le nom ne commencent pas par \cs{nb} mais +finissent par \texttt{roman} s'utilisent comme le \cs{roman} de +\LaTeX: leur unique argument est le nom d'un compteur. Avec +|\newcounter{machin}|, |\setcounter{machin}{124}|, +|\shortroman{machin}| on obtient \og \nbshortroman{124}\fg. + +Dans ce qui suit \meta{nbr} indique un nombre, \meta{ctr} indique +le nom d'un compteur à la \LaTeX{} comme \texttt{page} ou +\texttt{chapter}. + +Voici maintenant une présentation de toutes les macros disponibles +dans cette extension. Elles sont rangées par famille, étant entendu +qu'une famille est définie par l'aspect de la représentation obtenue. + +Après la syntaxe de la macro, on trouvera \PD pour dire que cette +macro est purement développable \TO voir page~\pageref{puredev}\TF, +\LT pour signifier qu'elle s'utilise comme une macro \LaTeX, \TX pour +signifier qu'elle s'utilise comme la macro \cs{romannumeral} de \TeX. + +Les exemples sont soumis aux options par défaut: \Option{jfinal}, +\Option{vpourv}, \Option{court}, \Option{min}. + +\subsubsection{ +Famille +shortroman +} + +\begin{macro}{\shortroman} + \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\shortromannumeral} + \cs{shortromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbshortroman} + \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{shortroman} + +\subsubsection{ +Famille +longroman +} + +\begin{macro}{\longroman} + \cs{longroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\longromannumeral} + \cs{longromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nblongroman} + \cs{nblongroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{longroman} + +\subsubsection{ +Famille +LongRoman +} + +\begin{macro}{\LongRoman} + \cs{LongRoman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\LongRomannumeral} + \cs{LongRomannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbLongRoman} + \cs{nbLongRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{LongRoman} + +\subsubsection{ +Famille +roman +} + +\TeX{} fournit \cs{romannumeral} et \LaTeX{} \cs{roman}. Je +complète la famille avec \cs{nbroman}. + +\begin{macro}{\nbroman} + \cs{nbroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{roman} + +\subsubsection{ +Famille +Roman +} + +\LaTeX{} fournit \cs{Roman}. Je complète la famille avec \cs{nbRoman} +et \cs{Romannumeral}. + +\begin{macro}{\Romannumeral} + \cs{Romannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbRoman} + \cs{nbRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{Roman} + +\subsubsection{ +Famille +modroman +} + +Les macros \cs{modroman}, \cs{modromannumeral} et \cs{nbmodroman} ont +un rendu défini par les options choisies. Par défaut: + +\begin{macro}{\modroman} + \cs{modroman}\marg{ctr} $=$ \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\modromannumeral} + \cs{modromannumeral}\meta{nbr} $=$ \cs{shortromannumeral}\meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbmodroman} + \cs{nbmodroman}\marg{nbr} $=$ \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{modroman} + +\subsubsection{ +Autres macros +} + +On peut redéfinir le comportement des familles \cs{shortroman} et +\cs{longroman} en utilisant la macro \cs{RedefineMRmdclxvij}. + +\begin{macro}{\RedefineMRmdclxvij} + \cs{RedefineMRmdclxvij}\oarg{ISOL}\BOP\marg{M}\BOP\marg{D}\BOP\marg{C}% + \BOP\marg{L}\BOP\marg{X}\BOP\marg{V}\BOP\marg{I}\BOP\marg{J} +\end{macro} + +Les arguments ci-dessus déterminent l'aspect des nombres romains +produits ensuite \TO on fera attention aux effets de bord et on +limitera la portée de la redéfinition à un groupe si nécessaire\TF par +les familles \cs{shortroman}, \cs{longroman} et, si elle est liée à +une de ces deux précédentes, \cs{modroman}. + +L'argument optionnel \meta{ISOL} donne l'aspect du |i| isolé \CAD le +nombre~1. Si on ne donne pas cet argument l'aspect du |i| isolé est +celui du |i| non-final déterminé par \meta{I}. + +L'argument \meta{J} donne l'aspect du |i| final. Les autres arguments +donne l'aspect du chiffre (minuscule) correspond, p.~ex. \meta{M} +donne l'aspect du~|m|. + +\begin{macro}{\printntimes} + \cs{printntimes}\marg{nbr}% +\marg{texte} +\end{macro} + +Voici deux exemples d'utilisation de cette macro. + +|$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$| + +donne + +$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$ + +\bigskip + +|\newcommand\truc{\par\centering ***\par}|\par +|\newcommand\saut{\par\noindent\hrulefill\par}|\par +|\saut\texttt{\printntimes{5}{\truc}}\saut| + +donne + +\newcommand\truc{\par\centering ***\par} +\newcommand\saut{\par\noindent\hrulefill\par} +\saut\texttt{\printntimes{5}{\truc}}\saut + +\subsection{ +Les options +} + +Il existe -- depuis la version~0.2 -- à la demande générale +d'\textbf{un} contributeur de \url{fr.comp.text.tex} deux options qui +s'excluent mutuellement : l'option par défaut \Option{vpourv} qui +conserve le comportement de la version précédente et l'option +\Option{upourv} qui remplace \og v \fg par \og u \fg dans l'écriture +des chiffres romains. + +Par souci de symétrie, j'ajoute, avec la version~1, deux +options antithétiques \Option{jfinal} -- option par défaut -- et +\Option{ifinal} qui permettent de choisir si le dernier |i| d'un +nombre sera transformé en~|j| ou pas. + +J'ajoute encore deux couples d'options antithétiques. D'abord +\Option{min} \TO pour \emph{minuscule}, option par défaut \TF et +\Option{maj} \TO pour \emph{majuscule}\TF puis \Option{court} \TO +option par défaut\TF et \Option{long}. + +J'ajoute enfin, une option \Option{sansmod} -- sans modification -- +qui a pour effet de faire des macros de la famille \cs{modroman} des +alias de celles de la famille \cs{roman}. + +Les cinq dernières options déterminent le comportement des macros de +la famille \cs{modroman}. + +\DescribeOption{upourv} +Avec cette option, le chiffre romain \og v\fg est transformé en \og +u\fg et on a, par exemple, \og xuij\fg pour~17. + +\DescribeOption{vpourv} +Cette option, active par défaut, est l'opposée de la précédente. Avec +elle, on obtient \Exemple{17} pour~17. + +Les trois options suivantes apparaissent avec la version~1 de +l'extension. + +\DescribeOption{jfinal} +Avec cette option, active par défaut, si le nombre traité est plus +grand que~1 et si le dernier chiffre romain est un~i, ce dernier est +remplacé par un~j. Voir l'exemple précédent. + +\DescribeOption{ifinal} +Cette option s'oppose à la précédente. Lorsqu'on l'a choisie, on +obtient \romannumeral 17{} pour~17. + +\DescribeOption{sansmod} +Avec cette option, les macros \cs{modroman}, \cs{modromannumeral} et +\cs{nbmodroman} deviennent des alias -- avec \cs{let} -- de +\cs{roman}, \cs{romannumeral} et \cs{nbroman} respectivement. + +Choisir simultanément les options \Option{vpourv}, \Option{court}, +\Option{min} et \Option{ifinal} revient à choisir l'option +\Option{sansmod}. + +\bigskip + +Le tableau suivant indique quelle famille est liée à la famille +\cs{modroman} suivant les options choisies lorsque \Option{sansmod} +n'est pas en vigueur. + +\begin{center} + \begin{tabular}{|*{3}{c|}}\hline + & \Option{court} & \Option{long}\\ \hline + \Option{min} & \cs{shortroman} & \cs{longroman} \\ \hline + \Option{maj} & \cs{Roman} & \cs{LongRoman} \\ \hline + \end{tabular} +\end{center} + +\input{MODRbiblio} + +\iffalse +\newpage +\section{ +Nombres de \nbmodroman{1} à \nbmodroman{1000} +} + +\newcounter{machin}\setcounter{machin}{1} +\noindent +\whiledo{\value{machin}<1001}{% + \mbox{\arabic{machin} -- \shortroman{machin} -- \longroman{machin} + -- \LongRoman{machin}}\stepcounter{machin}\par\noindent} +\newpage +\fi +\vspace*{\stretch{4}} +\noindent\hrulefill +\begin{center} +Dans le préambule de ce document, on trouve +\\ +|\renewcommand\thepage{\textit{\modroman{page}}}| +\\ +d'où la numérotation des pages. +\end{center} +\noindent\hrulefill + +\vspace*{\stretch{2}} + +\begin{center} +\framebox{ + Ici finit la documentation de \Pkg{modroman}. +} +\end{center} +\vspace*{\stretch{4}} +\end{document} +\endinput +%% +%% End of file `modroman-fr.tex'. diff --git a/Master/texmf-dist/doc/latex/modroman/modroman.dtx b/Master/texmf-dist/doc/latex/modroman/modroman.dtx new file mode 100644 index 00000000000..63dea16a99d --- /dev/null +++ b/Master/texmf-dist/doc/latex/modroman/modroman.dtx @@ -0,0 +1,1749 @@ +% \iffalse meta-comment +% +% Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, +% dit « le TeXnicien de surface » +% +% -------------------------------------------------------------------- +% +% This file may be distributed and/or modified under the conditions of +% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX +% version 1999/12/01 or later. +% +% \fi +% +% \iffalse +%\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%\def\fileversion{v1} +%\def\filedate{2010/04/09} +%\def\fileinfo{fichier modroman par Le TeXnicien de surface} +%\def\fileinfo{fichier MODRdoctools par Le TeXnicien de surface} +%\ProvidesPackage{modroman} +%\ProvidesPackage{MODRdoctools} +% [\filedate\space\fileversion\space\fileinfo] +%<*driver> +\documentclass{ltxdoc} +\usepackage{xspace,url,multicol} +\usepackage{modroman}[2010/04/09] +\usepackage[latin9]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[english,frenchb]{babel} +\usepackage{MODRdoctools} +\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}% +\usepackage[pdfpagelabels, + colorlinks=true, + linkcolor=blue, + urlcolor=blue, + citecolor=blue]{hyperref} + + +% commenter la ligne suivante pour avoir un document avec le code +% \OnlyDescription +% comment out the preceding line to obtain the full code +% with explanations in French only, sorry. +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\GlossaryPrologue{% + \section*{{Changements / Changes}}% + \markboth{{Changements}}{{Changements}}} +\IndexPrologue{\section*{Index}\markboth{Index}{Index}% + Les nombres en italique renvoient à la page où l'entrée est décrite ; les + nombres soulignés renvoient à la ligne de code de la définition ; les + nombres en caractères romains renvoient à la ligne de code où l'entrée est + utilisée. + + \begin{otherlanguage}{english}\itshape{} + Numbers written in italic refer to the page where the + corresponding entry is described; numbers underlined refer to the + code line of the definition; numbers in roman refer to the code + lines where the entry is used. + \end{otherlanguage}} +\def\generalname{Général / \emph{General}} +\begin{document} + \DocInput{modroman.dtx} +\end{document} +% +% \fi +% +% \CheckSum{506} +% +% \CharacterTable +% {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 +% 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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \changes{v0.1}{2003/04/20}{Version initiale\EnAnglais{Initial +% version}} +% +% \changes{v0.2}{2004/02/11}{Ajout des options upourv et +% vpourv\EnAnglais{Add options upourv and vpourv}} +% +% \changes{v0.3}{2004/05/18}{Correction de bogue: 101 s'écrit enfin +% cj\EnAnglais{Bug corrected: 101 is at last written cj}} +% +% \changes{v0.3}{2004/05/18}{Quelques actions cosmétiques sur la +% documentation\EnAnglais{Some cosmetic actions on the documentation}} +% +% \changes{v0.3}{2004/05/18}{Attirail pour *nix et +% CTAN\EnAnglais{Provides CTAN-ware and *nix tool}} +% +% \changes{v1}{2010/04/03}{Réécriture complete du code, versions +% purement développables\EnAnglais{Rewriting of the code, purely +% expandable versions}} +% +% \changes{v1}{2010/04/03}{Renommage des macros +% internes\EnAnglais{Renaming of the internal macros}} +% +% \changes{v1}{2010/04/04}{Nouvelles options: ifinal, jfinal, +% sansmod\EnAnglais{New options: ifinal, jfinal, sansmod}} +% +% \changes{v1}{2010/04/04}{Utilisation de l'extension +% \texttt{etoolbox}\EnAnglais{Uses the \texttt{etoolbox} package}} +% +% \changes{v1}{2010/04/04}{Réorganisation de la +% documentation\EnAnglais{Reorganisation of the documentation}} +% +% \GetFileInfo{modroman.sty} +% +% \DoNotIndex{\newcommand,\newenvironment,\fi,\ ,\ifx,\if,\ifnum,^^A +% \def,\csname,\endcsname,\expandafter,\ExecuteOptions,\else,^^A +% \afterassignment,\let,\@ifdefinable,\ProcessOptions,^^A +% \renewcommand,\newcounter,\providecommand,\numexpr,^^A +% \newtoggle,\toggletrue,\togglefalse,\iftoggle,\nottoggle,^^A +% \csuse,^^A +% \ifthenelse,\equal,^^A +% \Roman,\roman,\romannumeral,\@Roman,^^A +% \DeclareOption,\RequirePackage,\newcount,\relax,{}} +% +% \title{L'extension \textsf{modroman}\thanks{% +% Ce document correspond au fichier +% \textsf{modroman}~\fileversion, du \filedate.}\quad +% The package \textsf{modroman}\thanks{% +% This document corresponds to the file +% \textsf{modroman}~\fileversion, dated \filedate.}} +% +% \author{\href{mailto:le.texnicien.de.surface@wanadoo.fr}{Le \TeX +% nicien de surface}} +% +% \maketitle +% +% \begin{abstract} +% \MODRdescrofr +% +% La documentation française pour l'utilisateur finale est désormais +% disponible sous le nom de \texttt{modroman-fr}. +% \end{abstract} +% \begin{otherlanguage}{english} +% \begin{abstract} +% \MODRdescroen +% +% The English documentation for the final user of the package +% \Pkg{modroman} is available in the file \texttt{modroman-en}. +% \end{abstract} +% \end{otherlanguage} +% +% \StopEventually{\input{MODRbiblio}\newpage\PrintIndex\PrintChanges} +% +% \iffalse +%<*doc-sty> +\RequirePackage{ifthen} +\newcommand{\TO}{\textemdash\ \ignorespaces} +\newcommand{\TF}{\unskip\ \textemdash\xspace} +\newcommand{\CAD}{% + \iflanguage{frenchb}{c.-à-d.}{% + \iflanguage{english}{i.~e.}{% + \PackageError{MODRdoctools}% + {undefined language}% + {fix it before going on}}}\xspace} +\newcommand\BOP{\discretionary{}{}{}} +\newcommand\Option[1]{\textsc{#1}} +\newcommand\Pkg[1]{\textsf{#1}} +\newcommand\NOUVO{% + \marginpar{\hspace*{\stretch{1}}% + \textbf{N (v1)}\hspace*{.5em}}\xspace} +\newcommand\DescribeOption[1]{\leavevmode\@bsphack + \marginpar{\raggedleft \textsc{#1}}\index{#1 (option)}\@esphack} +\newcommand\PD{\textbf{[PD]}} +\newcommand\LT{\textbf{[\LaTeX]}} +\newcommand\TX{\textbf{[\TeX]}} + +\newcounter{EXEMPLE} +\newcommand\Exemple[1]{\setcounter{EXEMPLE}{#1}\modroman{EXEMPLE}} + +\newcommand\UnExemple[2]{\par\noindent\cs{nb#1}\texttt{\{#2\}} + \(\longrightarrow\) \csuse{nb#1}{#2}\par} +\newcommand\Exemples[1]{% + \par\noindent\hrulefill\par\noindent + \iflanguage{frenchb}{\textbf{Exemples}}{% + \iflanguage{english}{\textbf{Examples}}{}} + \UnExemple{#1}{1}\UnExemple{#1}{11}% + \UnExemple{#1}{444}% + \UnExemple{#1}{888}\UnExemple{#1}{1999}% + \par\noindent\hrulefill\par} + +\newenvironment{Anglais}[1][***]{% + \par\ifthenelse{\equal{#1}{***}}{\noindent}{}% + \begin{otherlanguage}{english}\itshape}% + {\end{otherlanguage}} +\newcommand\EnAnglais[1]{ / \emph{\foreignlanguage{english}{#1}}} +\newcommand\MODRdescrofr{% + Cette petite extension fournit des macros qui permettent d'écrire + les nombres en chiffres romains avec quelques modifications. + + On dispose de macros permettant d'obtenir \og \nbshortroman{1}\fg + pour~1 et \og \nbshortroman{18}\fg pour~18; \og + \nblongroman{999}\fg ou \og \nbLongRoman{999}\fg pour~999. + + Avec l'option \Option{upourv} \TO opposée de \Option{vpourv} option + par défaut\TF on obtient \og xuj\fg pour~15. Avec l'option + \Option{ifinal} \TO opposée de \Option{jfinal} option par défaut\TF + on peut obtenir \og xiiii\fg pour~14. + + Certaines macros s'utilisent comme le \cs{romannumeral} de \TeX, + d'autres, purement développables, sont destinées à formater un + compteur \TO comme le \cs{roman} de \LaTeX\TF ou un nombre. + + Elle offre aussi une macro \TO + \cs{printntimes}\marg{nombre}\marg{texte}\TF qui permet d'obtenir + \meta{nombre} fois le \marg{texte} comme + \texttt{\printntimes{10}{*}} obtenu avec + \texttt{\cs{printntimes}\{10\}\{*\}}.} + +\newcommand\MODRdescroen{% + This short package provides macros which enable one to write roman + numerals with some modifications. + + It provides macros with which one can obtain `\nbshortroman{1}' + for~1 and `\nbshortroman{18}' for~18; `\nblongroman{999}' or + `\nbLongRoman{999}' for~999. + + With option \Option{upourv} \TO opposite of \Option{vpourv} default + option \TF one obtains `xuj' for~15. With option \Option{ifinal} \TO + opposite of \Option{jfinal} default option\TF one can obtain `xiiii' + for~14. + + Some of the macros are used as \TeX{} \cs{romannumeral}, others, + purely expandable, are devoted to format a counter \TO as \LaTeX{} + \cs{roman}\TF or a number. + + It also provides a macro \TO + \cs{printntimes}\marg{number}\marg{text}\TF which produces + \meta{number} times the \marg{text} as e.g. + \texttt{\printntimes{10}{*}} obtained with + \texttt{\cs{printntimes}\{10\}\{*\}}.} +% +% \fi +% +% \iffalse +%<*biblio> +\begin{thebibliography}{9} +\bibitem{tlachand} T.~\textsc{Lachand-Robert}. +\emph{La maîtrise de \TeX{} et \LaTeX{}}. +Masson, Paris, Milan, Barcelone, \oldstylenums{1995}. +\textsc{isbn} : \texttt{2-225-84832-7}. +\bibitem{source2e} Johannes \textsc{Braams}, David + \textsc{Carlisle}, Alan \textsc{Jeffrey}, Leslie \textsc{Lamport}, + Frank \textsc{Mittelbach}, Chris \textsc{Rowley}, Rainer + \textsc{Schöpf}. \emph{The \LaTeXe{} sources}. 2009/09/24. +\end{thebibliography} +% +% \fi +% +% \iffalse +%<*package> +% \fi +% \section{Le code/The Code} +% +% Si les années qui passent ne me rendent pas beaucoup plus malin, +% elles ont un avantage: à force de lire des documentations +% d'extension, je finis par en connaitre davantage et il m'arrive de +% buter par hasard sur la solution à un problème que je n'avais fait +% qu'entrevoir. +% \begin{Anglais} +% As the years go by I don't really become more clever but, for I +% read not a few documentations of packages I happen to know a bit +% more and I happen to stumble upon the solution to a problem I had +% just caught a glimpse of. +% \end{Anglais} +% +% Je n'oublie pas les idées --~nombreuses~-- , les exemples +% --~détaillés~-- et les explications --~claires~-- fournis par +% T.~\textsc{Lachand}-\textsc{Robert} dans~\cite{tlachand} mais je +% m'abreuve désormais aussi à d'autres sources -- +% \texttt{source2e}~\cite{source2e} pour être précis -- et c'est là +% que j'ai trouvé l'\emph{astuce} qui me permet de fournir cette +% nouvelle version de \Pkg{modroman}. Le lecteur intéressé jettera +% un coup d'\oe il sur la définition de la macro \cs{Roman} et ses macros +% auxiliaires. +% \begin{Anglais}[1] +% I don't forget what I owe to T.~\textsc{Lachand}-\textsc{Robert} +% in~\cite{tlachand} -- numerous ideas, detailed examples, clear +% explanations -- but I now use other sources -- +% \texttt{source2e}~\cite{source2e} to be accurate. That is where I +% have found the \emph{trick} which enables me to provide this new +% version of \Pkg{modroman}. The reader who would like to know +% more should have a look at the definition of the macro \cs{Roman} +% and its auxiliary macros. +% \end{Anglais} +% +% Il est temps de présenter le code. +% \begin{Anglais}[1] +% And now for the code. +% \end{Anglais} +% +% Je charge, et j'utilise, désormais l'extension \Pkg{etoolbox}. Les +% \emph{toggle}s \TO en français \og touche à bascule\fg, je parlerai +% désormais de \og bascule\fg\TF correspondent à des booléens mais qui +% offrent quelques avantages par rapport aux traditionnels \cs{if} de +% \TeX. Je définis les options dont les cinq qui apparaissent avec la +% version~1. +% \begin{Anglais}[1] +% I load, and use, the package \Pkg{etoolbox}. The \emph{toggle}s +% are booleans which provides some interresting properties different +% from those of the traditionnal \cs{if} of \TeX. I define the +% options among which the five ones appearing with the version~1. +% \end{Anglais} +% +% Les macros internes de l'extension portent toutes un nom commençant +% par \cs{M@DR@}. Pour elles je ne fais pas de vérification avant +% définition à moins qu'elle ne soit faite automatiquement comme avec +% \cs{newcommand}. +% \begin{Anglais}[1] +% The internal macros of this package have all a name which begins +% with \cs{M@DR@}. I don't check if those are definable unless it is +% automatically done as when using \cs{newcommand}. +% \end{Anglais} +% \begin{macrocode} +\RequirePackage{ifthen} +\RequirePackage{etoolbox} +% \end{macrocode} +% Quatre bascules pour 5~options toutes placées à \texttt{faux} pour +% commencer. +% \begin{Anglais} +% Four toggles for 5~options, all of them set to \texttt{false} at +% the beginning. +% \end{Anglais} +% \begin{macrocode} +\newtoggle{M@DR@upourv}\togglefalse{M@DR@upourv} +\newtoggle{M@DR@ifinal}\togglefalse{M@DR@ifinal} +\newtoggle{M@DR@longrn}\togglefalse{M@DR@longrn} +\newtoggle{M@DR@majrn}\togglefalse{M@DR@majrn} +\newtoggle{M@DR@sansmod}\togglefalse{M@DR@sansmod} +% \end{macrocode} +% \begin{macrocode} +\DeclareOption{vpourv}{\togglefalse{M@DR@upourv}} +\DeclareOption{upourv}{\toggletrue{M@DR@upourv}} +\DeclareOption{jfinal}{\togglefalse{M@DR@ifinal}} +\DeclareOption{ifinal}{\toggletrue{M@DR@ifinal}} +\DeclareOption{long} {\toggletrue{M@DR@longrn}} +\DeclareOption{court} {\togglefalse{M@DR@longrn}} +\DeclareOption{maj} {\toggletrue{M@DR@majrn}} +\DeclareOption{min} {\togglefalse{M@DR@majrn}} +\DeclareOption{sansmod}{\toggletrue{M@DR@sansmod}} +\DeclareOption*{\PackageError{modroman}{% +The option \CurrentOption\space is not known!\MessageBreak +}{% +The possible options are (the first is the default):\MessageBreak +``vpourv'' or ``upourv''\MessageBreak +``jfinal'' or ``ifinal''\MessageBreak +``court'' or ``long''\MessageBreak +``min'' or ``maj''\MessageBreak +``sansmod''.}} +\ExecuteOptions{vpourv,jfinal,court,min} +\ProcessOptions\relax +% \end{macrocode} +% Si les bascules |M@DR@upourv|, |M@DR@longrn| et +% |M@DR@|\BOP|maj|\BOP|rn| sont fausses et que la bascule +% |M@DR@ifinal| est vraie, on fait comme si l'on avait passé l'option +% |sansmod| vu que ça revient à ça. +% \begin{Anglais} +% If the toggles |M@DR@upourv|, |M@DR@majrn| and +% |M@DR@|\BOP|long|\BOP|rn| are false and the toggle +% |M@DR@|\BOP|i|\BOP|fi|\BOP|nal| is true, it is as if one had +% chosen the option |sansmod|, in any case the result is the same. +% \end{Anglais} +% \begin{macrocode} +\nottoggle{M@DR@upourv}{% + \iftoggle{M@DR@ifinal}{% + \nottoggle{M@DR@longrn}{% + \nottoggle{M@DR@majrn}{% + \toggletrue{M@DR@sansmod}}{}}{}}{}}{} +% \end{macrocode} +% +% J'ai besoin d'un compteur, je le déclare à la mode \LaTeX{} ce qui +% permet de ne pas pertuber la gestion des compteurs dont \LaTeX{} se +% charge mais qui obligera, plus bas, à utiliser \cs{c@M@DR@romt@mp} +% qui est le nom \TeX{} du compteur. +% \begin{Anglais}[1] +% I need a counter and I declare it \emph{à la} \LaTeX{} so not to +% disturb the management \LaTeX{} does of the counters but, below, I +% will have to use \cs{c@M@DR@romt@mp} which is the name of the +% counter for \TeX. +% \end{Anglais} +% \begin{macrocode} +\newcounter{M@DR@romt@mp} +% \end{macrocode} +% Suivant l'option choisie parmi \Option{upourv} et \Option{vpourv} je +% définis la commande \cs{M@DR@v} qui contient la représentation du +% chiffre romain \og v\fg. +% \begin{Anglais} +% According to the option chosen among \Option{upourv} and +% \Option{vpourv}, I define the macro \cs{M@DR@v} which contains the +% representation of the roman digit `v'. +% \end{Anglais} +% \begin{macrocode} +\iftoggle{M@DR@upourv}{\newcommand*\M@DR@v{u}}{\newcommand*\M@DR@v{v}} +% \end{macrocode} +% Je fais la même chose pour \cs{M@DR@j} qui contient la +% représentation du i final \TO comme dans \nbroman{8}\TF, en accord +% avec les options \Option{ifinal} ou \Option{jfinal}. +% \begin{Anglais} +% I do the same for \cs{M@DR@j} which contains the representation of +% the final i \TO as seen in \nbroman{8}\TF, according to the option +% \Option{ifinal} or \Option{jfinal}. +% \end{Anglais} +% \begin{macrocode} +\iftoggle{M@DR@ifinal}{\newcommand*\M@DR@j{i}}{\newcommand*\M@DR@j{j}} +% \end{macrocode} +% Maintenant, les représentations des autres chiffres romains. +% \begin{Anglais} +% Now the representations of the other roman digits. +% \end{Anglais} +% \begin{macrocode} +\newcommand*\M@DR@m{m} +\newcommand*\M@DR@d{d} +\newcommand*\M@DR@c{c} +\newcommand*\M@DR@l{l} +\newcommand*\M@DR@x{x} +\newcommand*\M@DR@i{i} +\newcommand*\M@DR@isol{i} +% \end{macrocode} +% +% \begin{macro}{\RedefineMRmdclxvij} Une macro qui permet à +% l'utilisateur de redéfinir les représentations des chiffres +% romains. Elle permet quelques effets amusants comme le montre la +% macro \cs{printntimes}. +% +% Elle a 9~arguments dont un par optionnel, si l'argument optionnel +% est égal à |M@DR@***| \TO cas par défaut\TF \cs{M@DR@isol} prend +% la même valeur que \cs{M@DR@i} \CAD que le \og i isolé\fg pour~1 +% et le \og i intermédiaire\fg \TO celui de \og +% \nbshortroman{12}\fg\TF ont la même forme, sinon l'argument +% optionnel fixe la valeur de \cs{M@DR@isol}. +% \begin{Anglais}[1] +% The macro \cs{RedefineMRmdclxvij} enables the user to redefine +% the roman digits. It makes possible some funny tricks of which +% \cs{printntimes} is but an example. +% +% It takes 9~arguments the first of which is optional. If that +% argument equals |M@DR@***| \TO default value\TF \cs{M@DR@isol} +% has the same value as \cs{M@DR@i} \CAD the `isolated i' for~1 +% and the `intermediary i' \TO the one in +% `\nbshortroman{12}'\TF has the same shape, else the optional +% argument set the value of \cs{M@DR@isol}. +% \end{Anglais} +% \begin{macrocode} +\newcommand*\RedefineMRmdclxvij[9][M@DR@***]{% + \ifthenelse{\equal{#1}{M@DR@***}}% + {\renewcommand*\M@DR@isol{#8}}% + {\renewcommand*\M@DR@isol{#1}}% + \renewcommand*\M@DR@m{#2}% + \renewcommand*\M@DR@d{#3}% + \renewcommand*\M@DR@c{#4}% + \renewcommand*\M@DR@l{#5}% + \renewcommand*\M@DR@x{#6}% + \renewcommand*\M@DR@v{#7}% + \renewcommand*\M@DR@i{#8}% + \renewcommand*\M@DR@j{#9}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Version courte minuscule / Short lowercase version} +% +% \begin{macro}{\shortroman} +% Cette macro prend un seul argument qui est un nom de compteur +% \LaTeX \TO p.~ex. \texttt{machin}. Elle se contente de lancer +% \cs{M@DR@shortmodromain} sur le compteur \TeX{} associé \TO +% \cs{c@machin}. +% \begin{Anglais} +% The macro takes one argument which is the name of a \LaTeX{} +% counter \TO e.g. \texttt{thingummy}. It just passes to +% \cs{M@DR@shortmodromain} the \TeX{} associated counter \TO +% \cs{c@thingummy}. +% \end{Anglais} +% \begin{macrocode} +\newcommand\shortroman[1]{% + \expandafter\M@DR@shortmodromain\csname c@#1\endcsname} +% \end{macrocode} +% Si le compteur a pour valeur~1, on obtient \og \cs{M@DR@isol}\fg +% sinon on lance +% \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main| sur la +% représentation du compteur en nombre romain minuscule suivi de |@@| +% qui servira de sentinelle ci-dessous. +% \begin{Anglais} +% If the value of the counter is~1, one obtains `\cs{M@DR@isol}' +% else the lowercase roman numeral representation of the counter, +% completed by |@@| which will be used below as a sentry, is passed +% to \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main|. +% \end{Anglais} +% \begin{macrocode} +\newcommand\M@DR@shortmodromain[1]{% + \ifnum #1=1 \M@DR@isol\else + \expandafter\M@DR@shmdromain\romannumeral #1@@\fi} +% \end{macrocode} +% La macro \cs{M@DR@shmdromain} prend deux arguments; ce seront +% deux chiffres romains ou |@|. +% \begin{Anglais} +% The macro \cs{M@DR@shmdromain} takes two arguments which +% will be two roman digits or |@|. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@shmdromain#1#2{% + \ifx#1@% +% \end{macrocode} +% L'aventure s'achève ici si le 1\ier argument est~|@| sinon on +% poursuit en regardant si on a un~|v| auquel cas on place +% \cs{M@DR@v}. +% \begin{Anglais} +% Here finishes the adventure if the 1st argument is~|@| else it +% goes on and looks if we have a~|v| in which case we place +% \cs{M@DR@v}. +% \end{Anglais} +% \begin{macrocode} + \else + \if#1v\M@DR@v +% \end{macrocode} +% Sinon, on regarde si on a un |i| +% \begin{Anglais}Else it tests for an~|i|\end{Anglais} +% \begin{macrocode} + \else + \if#1i% +% \end{macrocode} +% puis on regarde le 2\ieme argument et si ce dernier est un |@| c'est +% que le~|i| est final et on place \cs{M@DR@j} sinon on place +% \cs{M@DR@i} +% \begin{Anglais} +% then it looks at the 2nd argument. If that argument is a~|@| then +% the~|i| is final and we put \cs{M@DR@j} else we put \cs{M@DR@i} +% \end{Anglais} +% \begin{macrocode} + \ifx#2@\M@DR@j\else\M@DR@i\fi +% \end{macrocode} +% dans les autres cas \TO \CAD le 1\ier argument n'est ni |v| ni +% |i|\TF on place la bonne macro en la construisant à la volée avec le +% \cs{csuse} de \Pkg{etoolbox}. +% \begin{Anglais} +% in the other cases \TO i.~e. the 1st argument is neither~|v| +% nor~|i| \TF we place the correct macro by building it on fly with +% the \cs{csuse} of \Pkg{etoolbox}. +% \end{Anglais} +% \begin{macrocode} + \else\csuse{M@DR@#1}% + \fi + \fi +% \end{macrocode} +% On termine en appelant une macro auxiliaire en replaçant le 2\ieme +% argument en tête. +% \begin{Anglais} +% We end by calling an auxiliary macro putting back the 2nd argument +% at the head. +% \end{Anglais} +% \begin{macrocode} + \M@DR@shmdromainAux#2\fi} +% \end{macrocode} +% Le \emph{truc} du \cs{fi} permet de fermer correctement le test +% principal de +% \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main|. +% \begin{Anglais} +% The \emph{trick} of \cs{fi} enables us to correctly close the main +% test of \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main|. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@shmdromainAux#1\fi{\fi\M@DR@shmdromain#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nbshortroman} +% Cette macro prend un nombre et le passe à +% \cs{M@DR@shortmodromain}. Les accolades dans la définition sont +% absolument nécessaires si on ne veut pas que seul le 1\ier chiffre +% soit traité. +% \begin{Anglais} +% The macro \cs{nbshortroman} takes a number as only +% argument. The curly braces in the definition are absolutely +% indispensable for without them only the first digit would be taken +% into account. +% \end{Anglais} +% \begin{macrocode} +\newcommand\nbshortroman[1]{\M@DR@shortmodromain{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\shortromannumeral} +% Cette macro s'emploie comme \cs{romannumeral} de \TeX. Elle doit +% être suivie d'un nombre et elle mange les espaces qui le suivent. +% Grace à \cs{afterassignment}, la macro +% \cs{M@DR@}\BOP|short|\BOP|mod|\BOP|ro|\BOP|main| reçoit le +% compteur comme argument après qu'il a reçu pour valeur le nombre +% qui doit suivre. +% \begin{Anglais} +% The macro is used as \TeX{} \cs{romannumeral}. It must be +% followed by a number and eats the spaces that follow it. Thanks +% to \cs{afterassignment}, the macro +% \cs{M@DR@}\BOP|short|\BOP|mod|\BOP|ro|\BOP|main| receives the +% counter after it has been assigned the number which must follow. +% \end{Anglais} +% \begin{macrocode} +\newcommand\shortromannumeral{% + \afterassignment\M@DR@shortmodrom@naux \c@M@DR@romt@mp=} +\def\M@DR@shortmodrom@naux{\M@DR@shortmodromain\c@M@DR@romt@mp} +% \end{macrocode} +% \end{macro} +% +% \subsection{Version longue minuscule / Long Lowercase Version} +% +% Cette fois il s'agit d'écrire les nombres romains \emph{à +% l'ancienne} \CAD sans utiliser la préposition pour soustraire. Dans +% ce cas 49 est écrit \nblongroman{49}. +% \begin{Anglais}[1] +% Now the aim is to write roman numerals the \emph{old way} +% i.~e. without using the preposition to subtract. In that case 49 +% is written \nblongroman{49}. +% \end{Anglais} +% +% \begin{macro}{\longroman} +% Macro pour l'utilisateur, elle attend un nom de compteur \LaTeX{} +% pour unique argument. +% \begin{Anglais} +% User macro which must be given a \LaTeX{} counter name as only +% argument. +% \end{Anglais} +% \begin{macrocode} +\newcommand\longroman[1]{% + \expandafter\M@DR@longmodromain\csname c@#1\endcsname} +% \end{macrocode} +% Macro auxiliaire qui ressemble à \cs{M@DR@shortmodromain} sauf +% qu'elle n'ajoute qu'un |@| comme sentinelle. +% \begin{Anglais} +% Auxiliary macro which looks like \cs{M@DR@shortmodromain} but add +% just one |@| as a sentry. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@longmodromain#1{% + \ifnum#1=1 \M@DR@isol\else + \expandafter\M@DR@Faire\romannumeral #1@\fi} +% \end{macrocode} +% J'ai besoin de connaitre deux chiffres romains pour décider d'une +% action mais je ne peux pas prendre un groupe de deux chiffres +% directement. Les macros \cs{M@DR@Faire@}|| sont là pour +% conserver la mémoire du dernier chiffre lu et agir en fonction du +% suivant. +% \begin{Anglais} +% I need to know two roman digits to decide which action to perform +% but I can't take a group of two letters directly. The +% \cs{M@DR@Faire@}\BOP|| are there to keep the memory of +% the last read digit and act according to the next. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire#1{\ifx#1@\else\csuse{M@DR@Faire@#1}\fi} +% \end{macrocode} +% La macro \cs{M@DR@Faireaux} ferme le \cs{if} principal et relance la +% procédure. +% \begin{Anglais} +% The macro \cs{M@DR@Faireaux} closes the main \cs{if} and restart +% the process. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faireaux\fi{\fi\M@DR@Faire} +% \end{macrocode} +% Pour les lettres |m|, |d|, |l| et |v| les choses sont simples. +% \begin{Anglais} +% For the letters |m|, |d|, |l|, and |v| things are simples. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@m\fi{\fi\M@DR@m\M@DR@Faire} +\def\M@DR@Faire@d\fi{\fi\M@DR@d\M@DR@Faire} +\def\M@DR@Faire@l\fi{\fi\M@DR@l\M@DR@Faire} +\def\M@DR@Faire@v\fi{\fi\M@DR@v\M@DR@Faire} +% \end{macrocode} +% Cas du |i| qui sera réécrit ou pas suivant la valeur du chiffre +% suivant. Une condition supplémentaire pour le~|i|, il faut écrire +% \cs{M@DR@j} lorsque le~|i| est final. +% \begin{Anglais} +% The case of |i| which will be rewritten or not according to the +% value of the next digit. An additional condition for~|i|, we have +% to write \cs{M@DR@j} if it is final. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@i\fi{\fi\M@DR@Faire@i@aux} +\def\M@DR@Faire@i@aux#1{% + \ifx#1@\M@DR@j% + \else\if#1x\M@DR@v\M@DR@i\M@DR@i\M@DR@i\M@DR@j% + \else\if#1v\M@DR@i\M@DR@i\M@DR@i\M@DR@j% + \else \M@DR@i\M@DR@Faire@i@auxaux\fi\fi + \M@DR@Faireaux\fi} +\def\M@DR@Faire@i@auxaux\fi\fi\M@DR@Faireaux{\fi\fi \M@DR@Faire@i} +% \end{macrocode} +% Cas du |x|, pas de |x| final. +% \begin{Anglais}The cas of |x|, no final |x|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@x\fi{\fi \M@DR@Faire@x@aux} +\def\M@DR@Faire@x@aux#1{% + \ifx#1@\M@DR@x% + \else + \if#1c\M@DR@l\M@DR@x\M@DR@x\M@DR@x\M@DR@x + \else + \if#1l\M@DR@x\M@DR@x\M@DR@x\M@DR@x + \else \M@DR@x\M@DR@FaireAuxAux#1\fi\fi + \M@DR@Faireaux\fi} +\def\M@DR@FaireAuxAux#1\fi\fi\M@DR@Faireaux\fi{\fi\fi\fi\M@DR@Faire#1} +% \end{macrocode} +% Cas du |c|, pas de |c| final non plus. +% \begin{Anglais}The case of |c|, no final |c| either.\end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@c\fi{\fi \M@DR@Faire@c@aux} +\def\M@DR@Faire@c@aux#1{% + \ifx#1@\M@DR@c% FIN + \else + \if#1d\M@DR@c\M@DR@c\M@DR@c\M@DR@c + \else + \if#1m\M@DR@d\M@DR@c\M@DR@c\M@DR@c\M@DR@c + \else \M@DR@c\M@DR@FaireAuxAux#1\fi\fi + \M@DR@Faireaux\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nblongroman} +% \begin{macrocode} +\newcommand\nblongroman[1]{\M@DR@longmodromain{#1}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\longromannumeral} +% \begin{macrocode} +\newcommand\longromannumeral{% + \afterassignment\M@DR@longmodrom@naux \c@M@DR@romt@mp=} +\def\M@DR@longmodrom@naux{\M@DR@longmodromain\c@M@DR@romt@mp} +% \end{macrocode} +% \end{macro} +% \subsection{Version longue capitale / Long Uppercase Version} +% +% L'idée principale est la même que ci-dessus sauf que on ne fait pas +% appel au macro \cs{M@DR@}\BOP|| car la version courte, +% fournie par \LaTeX{} avec \cs{Roman} ne permet pas les +% fantaisies. Si l'on voulait des effets spéciaux, il suffirait +% d'utiliser la version longue minuscule et jouer avec +% \cs{Re}\BOP|de|\BOP|fi|\BOP|ne|\BOP|MR|\BOP|md|\BOP|cl|\BOP|xv|\BOP|ij|. +% \begin{Anglais}[1] +% The main idea is the same as above but here I don't use macro +% \cs{M@DR@}\BOP|| for the short version provided for by +% \LaTeX{} with \cs{Roman} doesn't allow fancy work. If one wants +% special effects, one can use the long lowercase version and play +% with +% \cs{Re}\BOP|de|\BOP|fi|\BOP|ne|\BOP|MR|\BOP|md|\BOP|cl|\BOP|xv|\BOP|ij|. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@LongRomain#1{% + \ifnum#1=1 I\else + \expandafter\M@DR@FAIRE\romannumeral #1@\fi} +% \end{macrocode} +% \begin{macrocode} +\def\M@DR@FAIRE#1{\ifx#1@\else\csuse{M@DR@FAIRE#1}\fi} +% \end{macrocode} +% \begin{macrocode} +\def\M@DR@FAIREaux\fi{\fi \M@DR@FAIRE} +% \end{macrocode} +% \begin{macrocode} +\def\M@DR@FAIREm\fi{\fi M\M@DR@FAIRE} +\def\M@DR@FAIREd\fi{\fi D\M@DR@FAIRE} +\def\M@DR@FAIREl\fi{\fi L\M@DR@FAIRE} +\def\M@DR@FAIREv\fi{\fi V\M@DR@FAIRE} +% \end{macrocode} +% Cas du |i|.\begin{Anglais}The case of |i|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@FAIREi\fi{\fi \M@DR@FAIREIaux} +\def\M@DR@FAIREIaux#1{% + \ifx#1@I% FIN + \else\if#1xVIIII\else\if#1vIIII\else I\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +% \end{macrocode} +% Cas du |x|.\begin{Anglais}The case of |x|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@FAIREx\fi{\fi \M@DR@FAIREXaux} +\def\M@DR@FAIREXaux#1{% + \ifx#1@X% FIN + \else\if#1cLXXXX\else\if#1lXXXX\else X\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +\def\M@DR@FAIREAuxAux#1\fi\fi\M@DR@FAIREaux\fi{\fi\fi\fi\M@DR@FAIRE#1} +% \end{macrocode} +% Cas du |c|.\begin{Anglais}The case of |c|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@FAIREc\fi{\fi \M@DR@FAIRECaux} +\def\M@DR@FAIRECaux#1{% + \ifx#1@C% FIN + \else\if#1dCCCC\else\if#1mDCCCC\else C\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +% \end{macrocode} +% \begin{macro}{\LongRoman} +% \begin{macrocode} +\newcommand\LongRoman[1]{% + \expandafter\M@DR@LongRomain\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nbLongRoman} +% \begin{macrocode} +\newcommand\nbLongRoman[1]{\M@DR@LongRomain{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\LongRomannumeral} +% \begin{macrocode} +\newcommand\LongRomannumeral{% + \afterassignment\M@DR@LongRom@naux \c@M@DR@romt@mp=} +\def\M@DR@LongRom@naux{\M@DR@LongRomain\c@M@DR@romt@mp} +% \end{macrocode} +% \end{macro} +% +% \subsection{Autres macros / Other macros} +% +% Je fournis ici quelques macros d'accompagnement des macros \TeX{} et +% \LaTeX{}. +% \begin{Anglais}[1] +% I provide here some macros to go with the \TeX{} and \LaTeX{} +% macros. +% \end{Anglais} +% \begin{macro}{\nbroman} +% \begin{macrocode} +\newcommand\nbroman[1]{\romannumeral #1\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nbRoman} +% \cs{@Roman} est une \emph{macro cachée} du noyau de \LaTeXe. +% \begin{Anglais} +% \cs{@Roman} is a \emph{hidden macro} of the kernel of \LaTeXe. +% \end{Anglais} +% \begin{macrocode} +\newcommand\nbRoman[1]{\@Roman{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\Romannumeral} +% Je ne reprends pas le code de \cs{Romannumeral} que l'on peut +% trouver dans \Pkg{bulgarian.ldf} car je pense que ma version, qui +% tire profit de l'existence du compteur \LaTeX ien +% \texttt{M@DR@romt@mp} est \emph{moins pire} \texttt{;-)} D'où le +% \cs{providecommand}. +% \begin{Anglais} +% I don't take the code of \cs{Romannumeral} which can be found in +% \Pkg{bulgarian.ldf} for I think that my version, which makes +% profit of the \LaTeX{} counter \texttt{M@DR@romt@mp} is \emph{less +% worse} \texttt{;-)}. Hence the \cs{providecommand}. +% \end{Anglais} +% \begin{macrocode} +\providecommand\Romannumeral{% + \afterassignment\M@DR@Rom@naux \c@M@DR@romt@mp=} +\def\M@DR@Rom@naux{\Roman{M@DR@romt@mp}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Options} +% +% \begin{macro}{\modroman} +% Je traite maintenant les options qui déterminent le +% comportement des macros \cs{modroman}, \cs{modromannumeral} et +% \cs{nbmodroman}. +% \begin{Anglais} +% I now use the options which determine the behaviour of the macros +% \cs{modroman}, \cs{modromannumeral}, and \cs{nbmodroman}. +% \end{Anglais} +% \begin{macrocode} +\iftoggle{M@DR@sansmod} +% \end{macrocode} +% option \Option{sansmod} +% \begin{macrocode} +{\let\modroman=\roman + \let\modromannumeral=\romannumeral + \let\nbmodroman=\nbroman} +% \end{macrocode} +% avec / \emph{with} modifications +% \begin{macrocode} +{\iftoggle{M@DR@majrn} +% \end{macrocode} +% en majuscules / \emph{uppercase} +% \begin{macrocode} + {\iftoggle{M@DR@longrn} +% \end{macrocode} +% option \Option{long} +% \begin{macrocode} + {\let\modroman=\LongRoman + \let\modromannumeral=\LongRomannumeral + \let\nbmodroman=\nbLongRoman} +% \end{macrocode} +% option \Option{court} +% \begin{macrocode} + {\let\modroman=\Roman + \let\modromannumeral=\Romannumeral + \let\nbmodroman=\nbRoman}} +% \end{macrocode} +% en minuscules / \emph{lowercase} +% \begin{macrocode} + {\iftoggle{M@DR@longrn} +% \end{macrocode} +% option \Option{long} +% \begin{macrocode} + {\let\modroman=\longroman + \let\modromannumeral=\longromannumeral + \let\nbmodroman=\nblongroman} +% \end{macrocode} +% option \Option{court} +% \begin{macrocode} + {\let\modroman=\shortroman + \let\modromannumeral=\shortromannumeral + \let\nbmodroman=\nbshortroman}}} +% \end{macrocode} +% \end{macro} +% +% \subsection{\cs{printntimes}} +% +% \begin{macro}{\printntimes} +% Pour finir, une petite macro pour écrire \meta{nbr} \TO 1\ier +% argument\TF fois le contenu du 2\ieme argument. J'utilise ici une +% idée présentée par David \textsc{Kastrup} dans un papier intitulé \og +% Iterating with roman numeral\fg que l'on pourra trouver dans la +% page dédiée aux \og +% \href{http://www.gust.org.pl/projects/pearls/2005p/index_html} +% {Pearls 2005} \fg de GUST. +% \begin{Anglais} +% I end with a tiny macro which writes \meta{nbr} \TO 1st +% argument\TF times the content of the 2nd argument. I use here an +% idea presented by David \textsc{Kastrup} in a paper entitled +% `Iterating with roman numeral' which is available on the page of +% the +% \href{http://www.gust.org.pl/projects/pearls/2005p/index_html} +% {Pearls 2005} \fg of GUST. +% \end{Anglais} +% \begin{macrocode} +\newcommand\printntimes[2]{{% + \renewcommand\M@DR@m{#2}% + \nblongroman{\numexpr 1000*#1}}} +% \end{macrocode} +% \end{macro} +% +% Ici finit l'extension. +% \begin{Anglais}[1]Here finishes the package.\end{Anglais} +% \Finale +% \iffalse +% +%<*doc> +\documentclass[a4paper]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{modroman}[2010/04/09] +\usepackage{xspace} +\usepackage{array} +\usepackage{ifthen} +\usepackage{MODRdoctools} +\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} +%\usepackage[english,frenchb]{babel} +%\usepackage[frenchb,english]{babel} +\usepackage[colorlinks=true, + linkcolor=blue, + urlcolor=blue, + citecolor=blue]{hyperref} + +\begin{document} +\renewcommand\thepage{\textit{\modroman{page}}} +%<*fr> +\title{L'extension \textsf{modroman}\thanks{ + Ce document correspond au fichier + \textsf{modroman}~\fileversion, du \filedate.}} +% +%<*en> +\title{The package \textsf{modroman}\thanks{ + This document corresponds to the file + \textsf{modroman}~\fileversion, dated \filedate.}} +% +\author{\href{mailto:le.texnicien.de.surface@wanadoo.fr}{Le \TeX + nicien de surface}} + +\maketitle + +\begin{abstract} +\begin{otherlanguage} +%{english} +%{french} +\bfseries{} +%<*fr> + This is the French documentation of \Pkg{modroman} for the final + user. + The English documentation is provided under the name + \texttt{modroman-en}. +% +%<*en> + Documentation anglaise pour l'utilisateur final de l'extension + \Pkg{modroman}. + La documentation française est disponible sous le nom de + \texttt{modroman-fr}. +% +\end{otherlanguage} + +\vspace{6pt} +\noindent\hrulefill +\vspace{6pt} + +%<*fr> +Documentation française pour l'utilisateur final de l'extension +\Pkg{modroman}. + +\MODRdescrofr +% +%<*en> +This is the English documentation of \Pkg{modroman} for the final +user. + +\MODRdescroen +% +\end{abstract} + +\tableofcontents{} + +\section{Introduction} + +\subsection{Motivation} + +%<*fr> +Les formes d'écriture des nombres en chiffres romains telles que les +proposent \TeX, avec \cs{romannumeral}, et \LaTeX, avec \cs{roman} et +\cs{Roman}, sont loin d'être les seules qui furent en usage. J'avais +vu, il y a bien longtemps, la notation \nbshortroman{8} dans un +manuscrit. Les premières versions \TO de 0.1 à 0.4\TF de cette +extension ne permettaient que cette écriture, avec, au gré de +l'utilisateur, l'utilisation d'un |u| pour noter la \emph{cinquaine} +comme dans \og xuij\fg pour~17. +% +%<*en> +The ways of writing numbers with roman numerals are more diverse than +it could be thought when one considers the \TeX{} \cs{romannumeral} +and \LaTeX{} \cs{roman} and \cs{Roman}. Many other forms were used at +a time or another through history. I saw, many years ago, the form +\nbshortroman{8} in a manuscript. The first versions \TO from 0.1 to +0.4\TF of this package provided just that form, with, user willing, +the use of a~|u| to denote a group of~5 as in `xuij' for~17. +% + +%<*fr> +Le lecteur interessé pourra jeter un \oe il sur la page que wikipedia +consacre aux chiffres romains pour voir que le monde n'est pas +toujours aussi simple que l'on voudrait qu'il soit. +% +%<*en> +The interested reader could cast a glance on the page wikipedia +devotes to roman numerals to see that the world is not always as +simple as one would like it to be. +% + +\subsection{ +%Remarques techniques +%Technical Remarks +} + +%<*fr> +Le code des premières versions permettait de numéroter les pages avec +les chiffres romains \emph{modifiés} mais on ne pouvait plus alors +utiliser les outils de référence comme \cs{label} et \cs{ref} ni même +espérer voir les nombres écrits correctement dans la table des +matières. +% +%<*en> +The code of the first versions enable one to number the pages with +\emph{modified} roman numerals but one could not then use the +reference tools such as \cs{label} and \cs{ref} or even hope to see +the page numbers correctly written in the table of contents. +% + +%<*fr> +Si les années qui passent ne me rendent pas beaucoup plus malin, elles +ont un avantage: à force de lire des documentations d'extension, je +finis par en connaitre davantage et il m'arrive de buter par hasard +sur la solution à un problème que je n'avais fait qu'entrevoir. +% +%<*en> +As the years go by I don't really become more clever but, for I read +not a few documentations of packages, I end with knowing a bit more +and I happen to stumble upon the solution to a problem I had just +caught a glimpse of. +% + +%<*fr> +Je n'oublie pas les idées --~nombreuses~--, les exemples +--~détaillés~-- et les explications --~claires~-- fournis par +T.~\textsc{Lachand}-\textsc{Robert} dans~\cite{tlachand} mais je +m'abreuve désormais aussi à d'autres sources -- +\texttt{source2e}~\cite{source2e} pour être précis -- et c'est là +que j'ai trouvé l'\emph{astuce} qui me permet de fournir cette +nouvelle version de \Pkg{modroman}. Le lecteur intéressé jettera +un coup d'\oe il sur la définition de la macro \cs{Roman} et ses macros +auxiliaires. +% +%<*en> +I don't forget what I owe to T.~\textsc{Lachand}-\textsc{Robert} +in~\cite{tlachand} -- numerous ideas, detailed examples, clear +explanations -- but I now use other sources -- +\texttt{source2e}~\cite{source2e} to be accurate. That is where I have +found the \emph{trick} which enables me to provide this new version of +\Pkg{modroman}. The reader who would like to know more should have a +look at the definition of the macro \cs{Roman} and its auxiliary +macros. +% + +%<*fr> +En réécrivant le code je me suis apperçu que je pouvais aller un peu +plus loin que je ne l'avais fait sans qu'il m'en coute beaucoup +plus. Voila pourquoi on trouvera désormais plus de macros et plus de +présentations des nombres en chiffres romains et une macro +supplémentaire. +% +%<*en> +While rewriting the code I happen to understand that I was able to go +a bit farther than I have gone previously without a tremendous extra +cost. That's why one will now find more macros and more presentations +of the roman numerals and an additional macro. +% + +%<*fr> +Cette version~1 conserve la compatibilité avec la version précédente +mais le code a été complètement réécrit et l'extension fournit +désormais à l'utilisateur outre les macros \cs{modroman} et +\cs{modromannumeral} une bonne quinzaine d'autres. +% +%<*en> +This version~1 keeps the compatibility with the previous version but +the code has been completely rewritten and the package now provides to +the user in addition to \cs{modroman} and \cs{modromannumeral} about +fifteen other macros. +% + +%<*fr> +Toutefois, la grande nouveauté de cette version~1 est que, désormais, +la macro \cs{modroman} \TO et ses petites camarades\TF est \og +purement développable\fg \TO voir page~\pageref{puredev} pour plus de +détails\TF, on peut donc l'utiliser pour numéroter des pages \emph{et} +obtenir ce qu'il faut dans la table des matières -- ce qui n'était pas +le cas jusqu'ici. Attention, je ne dis rien de tel à propos de +\cs{modromannumeral}. +% +%<*en> +However, the main change introduced by this version~1 is the fact that +from now on \cs{modroman} \TO and its pals \TF is purely expandable +\TO see page~\pageref{puredev} for more details. One can then use it +to number pages and obtain the correct thing in the table of content +-- which was not the case until now. Caution, I do \emph{not} say that +\cs{modromannumeral} is purely expandable -- it is not. +% + +\subsection{ +%Macros purement développables +%Purely Expandable Macros +} + +%<*fr> +On pourra lire le fil de discussion \og test de développabilité pure ? +\fg dans le forum \texttt{fr.comp.text.tex} pour voir que cette notion +n'est pas aussi simple qu'elle parait au n\ieme abord \texttt{:-)} +toutefois, ici, lorsque je dirais qu'une macro est \og purement +développable\fg j'entendrai ce qui suit. +% +%<*en> +One could, if one understands French, read the thread +`\foreignlanguage{frenchb}{test de développabilité pure ?}' on the +news group \texttt{fr.comp.text.tex} to see that that notion is not as +simple as one could think at n-th sight \texttt{:-)} however, here, +when I will say that a macro is `purely expandable' I will understand +what follows. +% + +%<*fr> +Supposons que la macro \cs{truc} soit telle que \cs{truc}\marg{12} +donne \og xij\fg \TO ça vous dit quelque chose? \TF +alors\label{puredev} +\begin{enumerate} +\item la macro \cs{TRUC} définie par + |\edef|\BOP|\TRUC|\BOP|{|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|}| + est telle que: + \begin{enumerate} + \item \cs{TRUC} donne bien \og xij\fg et + \item |\meaning\TRUC| donne \og \texttt{macro:->xij}\fg + \end{enumerate} +\item de plus, si on définit \cs{Axij}, alors la construction +|\csname| |A|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|\endcsname| +appelle bien la macro \cs{Axij}. +\end{enumerate} +% +%<*en> +Let's assume that the macro \cs{thing} is such that +\cs{thing}\marg{12} gives `xij' \TO does it ring a bell?\TF +then\label{puredev} +\begin{enumerate} +\item the macro \cs{THING} defined by + |\edef|\BOP|\TRUC|\BOP|{|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|}| + is such that: + \begin{enumerate} + \item \cs{THING} gives `xij' and + \item |\meaning\THING| gives `\texttt{macro:->xij}' + \end{enumerate} +\item moreover, if one defines \cs{Axij} then the construct + |\csname| |A|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|\endcsname| + truly calls the macro \cs{Axij}. +\end{enumerate} +% + +\section{ +%Utilisation +%Usage +} + +\subsection{ +%Les macros +%The Macros +} + +%<*fr> +Les macros dont le nom finit par \texttt{numeral} s'utilisent comme la +macro \TeX{} \cs{romannumeral}. Elles doivent être suivies d'un nombre +et mangent les espaces qui le suivent. P.~ex. +|\longromannumeral| \verb*+368 ET+ donne \og\longromannumeral +368 ET\fg. +% +%<*en> +Macros the name of which ends with \texttt{numeral} are to be used as +\TeX{} \cs{romannumeral}. They must be followed by a number and eat +the spaces which are after it, e.~g. +|\longromannumeral| \verb*+368 AND+ gives `\longromannumeral +368 AND'. +% + +%<*fr> +Les macros dont le nom commence par \cs{nb} prennent un argument qui +est un nombre comme |\nbLongRoman{127}| qui donne \og +\nbLongRoman{127}\fg. +% +%<*en> +Macros the name of which begins with \cs{nb} take a number as argument +such as |\nbLongRoman{127}| which gives `\nbLongRoman{127}'. +% + +%<*fr> +Les macros dont le nom ne commencent pas par \cs{nb} mais +finissent par \texttt{roman} s'utilisent comme le \cs{roman} de +\LaTeX: leur unique argument est le nom d'un compteur. Avec +|\newcounter{machin}|, |\setcounter{machin}{124}|, +|\shortroman{machin}| on obtient \og \nbshortroman{124}\fg. +% +%<*en> +Macros the name of which doesn't begin with \cs{nb} but ends with +\texttt{roman} are used as \LaTeX{} \cs{roman}: their only argument is +the name of a counter. With |\newcounter{machin}|, +|\setcounter{machin}{124}|, |\shortroman{machin}| one obtains +`\nbshortroman{124}'. +% + +%<*fr> +Dans ce qui suit \meta{nbr} indique un nombre, \meta{ctr} indique +le nom d'un compteur à la \LaTeX{} comme \texttt{page} ou +\texttt{chapter}. +% +%<*en> +In what follows \meta{nbr} denotes a number, \meta{ctr} denotes the +\LaTeX{} name of a counter such as \texttt{page} or \texttt{chapter}. +% + +%<*fr> +Voici maintenant une présentation de toutes les macros disponibles +dans cette extension. Elles sont rangées par famille, étant entendu +qu'une famille est définie par l'aspect de la représentation obtenue. +% +%<*en> +Here comes a presentation of all the macros available with this +package. They are grouped by family where a family is defined with +respect to the obtained presentation of roman numerals. +% + +%<*fr> +Après la syntaxe de la macro, on trouvera \PD pour dire que cette +macro est purement développable \TO voir page~\pageref{puredev}\TF, +\LT pour signifier qu'elle s'utilise comme une macro \LaTeX, \TX pour +signifier qu'elle s'utilise comme la macro \cs{romannumeral} de \TeX. +% +%<*en> +After the macro's syntax, there will be \PD to mean that the macro is +purely expandable \TO see page~\pageref{puredev}\TF, \LT to mean that +it is used the \LaTeX{} way, \TX to mean that it is used as the \TeX{} +\cs{romannumeral}. +% + +%<*fr> +Les exemples sont soumis aux options par défaut: \Option{jfinal}, +\Option{vpourv}, \Option{court}, \Option{min}. +% +%<*en> +The examples are governed by the default options: \Option{jfinal}, +\Option{vpourv}, \Option{court}, \Option{min}. +% + +\subsubsection{ +%Famille +shortroman +%Family +} + +\begin{macro}{\shortroman} + \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\shortromannumeral} + \cs{shortromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbshortroman} + \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{shortroman} + + +\subsubsection{ +%Famille +longroman +%Family +} + +\begin{macro}{\longroman} + \cs{longroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\longromannumeral} + \cs{longromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nblongroman} + \cs{nblongroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{longroman} + +\subsubsection{ +%Famille +LongRoman +%Family +} + +\begin{macro}{\LongRoman} + \cs{LongRoman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\LongRomannumeral} + \cs{LongRomannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbLongRoman} + \cs{nbLongRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{LongRoman} + + +\subsubsection{ +%Famille +roman +%Family +} + +%<*fr> +\TeX{} fournit \cs{romannumeral} et \LaTeX{} \cs{roman}. Je +complète la famille avec \cs{nbroman}. +% +%<*en> +\TeX{} provides \cs{romannumeral} and \LaTeX{} \cs{roman}. I +complete the family with \cs{nbroman}. +% + +\begin{macro}{\nbroman} + \cs{nbroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{roman} + +\subsubsection{ +%Famille +Roman +%Family +} + +%<*fr> +\LaTeX{} fournit \cs{Roman}. Je complète la famille avec \cs{nbRoman} +et \cs{Romannumeral}. +% +%<*en> +\LaTeX{} provides \cs{Roman}. I complete the family with \cs{nbRoman} and +\cs{Romannumeral}. +% + +\begin{macro}{\Romannumeral} + \cs{Romannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbRoman} + \cs{nbRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{Roman} + +\subsubsection{ +%Famille +modroman +%Family +} + +%<*fr> +Les macros \cs{modroman}, \cs{modromannumeral} et \cs{nbmodroman} ont +un rendu défini par les options choisies. Par défaut: +% +%<*en> +The output of the macros \cs{modroman}, \cs{modromannumeral}, and +\cs{nbmodroman} is determined by the chosen options. By default: +% + +\begin{macro}{\modroman} + \cs{modroman}\marg{ctr} $=$ \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\modromannumeral} + \cs{modromannumeral}\meta{nbr} $=$ \cs{shortromannumeral}\meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbmodroman} + \cs{nbmodroman}\marg{nbr} $=$ \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{modroman} + +\subsubsection{ +%Autres macros +%Other macros +} + +%<*fr> +On peut redéfinir le comportement des familles \cs{shortroman} et +\cs{longroman} en utilisant la macro \cs{RedefineMRmdclxvij}. +% +%<*en> +One can redefine the behaviour of families \cs{shortroman} and +\cs{longroman} with the macro \cs{RedefineMRmdclxvij}. +% + +\begin{macro}{\RedefineMRmdclxvij} + \cs{RedefineMRmdclxvij}\oarg{ISOL}\BOP\marg{M}\BOP\marg{D}\BOP\marg{C}% + \BOP\marg{L}\BOP\marg{X}\BOP\marg{V}\BOP\marg{I}\BOP\marg{J} +\end{macro} + +%<*fr> +Les arguments ci-dessus déterminent l'aspect des nombres romains +produits ensuite \TO on fera attention aux effets de bord et on +limitera la portée de la redéfinition à un groupe si nécessaire\TF par +les familles \cs{shortroman}, \cs{longroman} et, si elle est liée à +une de ces deux précédentes, \cs{modroman}. +% +%<*en> +The above arguments determine the look of the roman numerals produced +after \TO one should take care of the side effects and one would have +to limit the scope of the redefinition ot a group if necessary\TF by +the families \cs{shortroman}, \cs{longroman}, and, if it is linked to +one of the two preceding, \cs{modroman}. +% + +%<*fr> +L'argument optionnel \meta{ISOL} donne l'aspect du |i| isolé \CAD le +nombre~1. Si on ne donne pas cet argument l'aspect du |i| isolé est +celui du |i| non-final déterminé par \meta{I}. +% +%<*en> +The optional argument \meta{ISOL} gives the look of the isolated |i| \CAD the +number~1. If one doesn't give the argument the look of the isolated +|i| is the look of the non-final |i| determined by \meta{I} +% + +%<*fr> +L'argument \meta{J} donne l'aspect du |i| final. Les autres arguments +donne l'aspect du chiffre (minuscule) correspond, p.~ex. \meta{M} +donne l'aspect du~|m|. +% +%<*en> +The look of the final~|i| is given by the argument \meta{J}. All other +arguments give the look of the corresponding (lowercase) digit, +e.~g. \meta{M} gives the look of~|m|. +% + +\begin{macro}{\printntimes} + \cs{printntimes}\marg{nbr}% +%\marg{texte} +%\marg{text} +\end{macro} + +%<*fr> +Voici deux exemples d'utilisation de cette macro. +% +%<*en> +Here are two examples using the macro. +% + +|$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$| + +%donne +%gives + +$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$ + +\bigskip + +|\newcommand\truc{\par\centering ***\par}|\par +|\newcommand\saut{\par\noindent\hrulefill\par}|\par +|\saut\texttt{\printntimes{5}{\truc}}\saut| + +%donne +%gives + +\newcommand\truc{\par\centering ***\par} +\newcommand\saut{\par\noindent\hrulefill\par} +\saut\texttt{\printntimes{5}{\truc}}\saut + +\subsection{ +%Les options +%The Options +} + +%<*fr> +Il existe -- depuis la version~0.2 -- à la demande générale +d'\textbf{un} contributeur de \url{fr.comp.text.tex} deux options qui +s'excluent mutuellement : l'option par défaut \Option{vpourv} qui +conserve le comportement de la version précédente et l'option +\Option{upourv} qui remplace \og v \fg par \og u \fg dans l'écriture +des chiffres romains. +% +%<*en> +There exist -- since the version~0.2 -- options \Option{vpourv} and +\Option{upourv}. The default option is \Option{vpourv} with which +\cs{modromannumeral}|5| is written as `v'. With the option +\Option{upourv} the same \cs{modromannumeral}|5| is written as `u'. It +was a special requirement from \emph{one} person posting on +\url{fr.comp.text.tex}. \emph{The (almost) French `vpourv' stands for + `v for v'.} +% + +%<*fr> +Par souci de symétrie, j'ajoute, avec la version~1, deux +options antithétiques \Option{jfinal} -- option par défaut -- et +\Option{ifinal} qui permettent de choisir si le dernier |i| d'un +nombre sera transformé en~|j| ou pas. +% +%<*en> +For sake of symetry, I add, with this version~1, two +antithetical options \Option{jfinal} -- final j -- the default, and +\Option{ifinal} -- final i -- by which one can choose if the last~i of +the number will be written as a~|j| or not. +% + +%<*fr> +J'ajoute encore deux couples d'options antithétiques. D'abord +\Option{min} \TO pour \emph{minuscule}, option par défaut \TF et +\Option{maj} \TO pour \emph{majuscule}\TF puis \Option{court} \TO +option par défaut\TF et \Option{long}. +% +%<*en> +I add also two pairs of antithetic options. First \Option{min} \TO +\CAD \emph{minuscule} lowercase, default option \TF and \Option{maj} +\TO \CAD \emph{majuscule} uppercase\TF then \Option{court} \TO short, +default option \TF and \Option{long}. +% + +%<*fr> +J'ajoute enfin, une option \Option{sansmod} -- sans modification -- +qui a pour effet de faire des macros de la famille \cs{modroman} des +alias de celles de la famille \cs{roman}. +% +%<*en> +Last, with this version~1, I add the option \Option{sansmod} -- +without modification -- which makes the macros of the \cs{modroman} +family aliases of those of \cs{roman} family. +% + +%<*fr> +Les cinq dernières options déterminent le comportement des macros de +la famille \cs{modroman}. +% +%<*en> +The last five options determine the behaviour of the macros of the +family \cs{modroman}. +% + +\DescribeOption{upourv} +%<*fr> +Avec cette option, le chiffre romain \og v\fg est transformé en \og +u\fg et on a, par exemple, \og xuij\fg pour~17. +% +%<*en> +With that option, the roman numeral `v' is turn into an~`u' and one +obtains, e.g., `xuij' for~17. +% + +\DescribeOption{vpourv} +%<*fr> +Cette option, active par défaut, est l'opposée de la précédente. Avec +elle, on obtient \Exemple{17} pour~17. +% +%<*en> +That option, enforced by default, is the opposite of the previous +one. With it, one obtains \Exemple{17} for~17. +% + +%<*fr> +Les trois options suivantes apparaissent avec la version~1 de +l'extension. +% +%<*en> +The next three options appear with the version~1 of the package. +% + + +\DescribeOption{jfinal} +%<*fr> +Avec cette option, active par défaut, si le nombre traité est plus +grand que~1 et si le dernier chiffre romain est un~i, ce dernier est +remplacé par un~j. Voir l'exemple précédent. +% +%<*en> +With that default option, if the processed number is greater than~1 +and if the last roman \emph{digit} is an~i then it is turned into +a~j. See the examples above. +% + + +\DescribeOption{ifinal} +%<*fr> +Cette option s'oppose à la précédente. Lorsqu'on l'a choisie, on +obtient \romannumeral 17{} pour~17. +% +%<*en> +That option is the opposite of the previous one. When enforced, one +obtains \romannumeral 17{} for~17. +% + +\DescribeOption{sansmod} +%<*fr> +Avec cette option, les macros \cs{modroman}, \cs{modromannumeral} et +\cs{nbmodroman} deviennent des alias -- avec \cs{let} -- de +\cs{roman}, \cs{romannumeral} et \cs{nbroman} respectivement. +% +%<*en> +With that option \cs{modroman}, \cs{modromannumeral} and +\cs{nbmodroman} are just aliases -- obtained with \cs{let} -- of +\cs{roman}, \cs{romannumeral}, and \cs{nbroman} respectively. +% + +%<*fr> +Choisir simultanément les options \Option{vpourv}, \Option{court}, +\Option{min} et \Option{ifinal} revient à choisir l'option +\Option{sansmod}. +% +%<*en> +If one choses options \Option{vpourv}, , \Option{court}, \Option{min}, +and \Option{ifinal} together, one enforces the option +\Option{sansmod}. +% + +\bigskip + +%<*fr> +Le tableau suivant indique quelle famille est liée à la famille +\cs{modroman} suivant les options choisies lorsque \Option{sansmod} +n'est pas en vigueur. +% +%<*en> +The following table shows which family is linked to the \cs{modroman} +family according to the chosen options when \Option{sansmod} is not +enforced. +% + +\begin{center} + \begin{tabular}{|*{3}{c|}}\hline + & \Option{court} & \Option{long}\\ \hline + \Option{min} & \cs{shortroman} & \cs{longroman} \\ \hline + \Option{maj} & \cs{Roman} & \cs{LongRoman} \\ \hline + \end{tabular} +\end{center} + +\input{MODRbiblio} + +% Il suffit de commenter le \iffalse et le \fi correspondant pour +% avoir ces quelques pages d'exemples. +% Suffices to comment out the \iffalse and the corresponding \fi to +% obtain those not few pages of examples. +\iffalse +\newpage +\section{ +%Nombres de \nbmodroman{1} à \nbmodroman{1000} +%Numbers from \nbmodroman{1} to \nbmodroman{1000} +} + +\newcounter{machin}\setcounter{machin}{1} +\noindent +\whiledo{\value{machin}<1001}{% + \mbox{\arabic{machin} -- \shortroman{machin} -- \longroman{machin} + -- \LongRoman{machin}}\stepcounter{machin}\par\noindent} +\newpage +\fi +\vspace*{\stretch{4}} +\noindent\hrulefill +\begin{center} +%Dans le préambule de ce document, on trouve +%In the preambule of this document, there is +\\ +|\renewcommand\thepage{\textit{\modroman{page}}}| +\\ +%d'où la numérotation des pages. +%hence the page numbering. +\end{center} +\noindent\hrulefill + +\vspace*{\stretch{2}} + +\begin{center} +\framebox{ +% Ici finit la documentation de \Pkg{modroman}. +% Here ends the documentation of \Pkg{modroman}. +} +\end{center} +\vspace*{\stretch{4}} +\end{document} +% +% \fi +\endinput +%%% Local Variables: +%%% mode: doctex +%%% coding: iso-8859-15 +%%% fill-column: 70 +%%% End: diff --git a/Master/texmf-dist/doc/latex/modroman/modroman.pdf b/Master/texmf-dist/doc/latex/modroman/modroman.pdf index 5246b57e5d6..fe24aa26f4d 100644 Binary files a/Master/texmf-dist/doc/latex/modroman/modroman.pdf and b/Master/texmf-dist/doc/latex/modroman/modroman.pdf differ diff --git a/Master/texmf-dist/source/latex/modroman/LISEZMOI b/Master/texmf-dist/source/latex/modroman/LISEZMOI new file mode 100755 index 00000000000..1d837285c3c --- /dev/null +++ b/Master/texmf-dist/source/latex/modroman/LISEZMOI @@ -0,0 +1,37 @@ +-*- coding: utf-8 -*- +MODROMAN 1 2010-04-09 + +LISEZMOI +README +Makefile +modroman.dtx +modroman.pdf % documentation bilingue du code +modroman-fr.pdf % documentation française pour l’utilisateur +modroman-en.pdf % documentation anglaise pour l’utilisateur +modroman.ins + +====================================================================== + +modroman.sty, deux macros pour écrire les nombres en chiffres romains +minuscules sous la forme i, ij, iij, iv etc. +(Avez-vous noté le j final ?) + +Avec l’option « upourv » modroman 6 affiche uj au lieu de vj. L’option +vpourv lui fait afficher vj, c’est l’option par défaut. + +Pour produire le fichier modroman.sty lancer : +latex modroman.ins + +Sous *nix, on peut utiliser le Makefile fourni, +make help +pour obtenir de l’aide. + +---------------------------------------------------------------------- + +v1 +nombreuses nouvelles macros pour présenter les nombres en chiffres +romains, cinq nouvelles options + +-- +Le \TeX nicien de surface +le.texnicien.de.surface@wanadoo.fr diff --git a/Master/texmf-dist/source/latex/modroman/Makefile b/Master/texmf-dist/source/latex/modroman/Makefile index c830cdf1c5e..0df7d1f8be0 100644 --- a/Master/texmf-dist/source/latex/modroman/Makefile +++ b/Master/texmf-dist/source/latex/modroman/Makefile @@ -5,49 +5,65 @@ # hacked to obtain my modroman.xml # --------------------------------------------------------------- PKGNAME = modroman -VERSION=0-4 # Edition du cinquantenaire - -TEX= \ - $(PKGNAME).sty \ - -DOC= \ - $(PKGNAME).pdf \ - LISEZMOI \ - README \ +VERSION=1 SOURCE= \ Makefile \ $(PKGNAME).dtx \ $(PKGNAME).ins \ + LISEZMOI \ + README \ PRODUITS = \ $(PKGNAME).sty \ + MODRdoctools.sty \ $(PKGNAME).pdf \ + $(PKGNAME)-fr.pdf \ + $(PKGNAME)-en.pdf \ + MODRbiblio.tex \ + +SRCDOC= \ + $(PKGNAME).dtx + +TEXDOC= \ + MODRdoctools.sty \ + $(PKGNAME)-fr.tex \ + $(PKGNAME)-en.tex \ + +PDFDOC= \ + $(PKGNAME).pdf \ + $(PKGNAME)-fr.pdf \ + $(PKGNAME)-en.pdf \ + +DOC= \ + $(PDFDOC)\ + $(SRCDOC)\ + $(TEXDOC) + +CTANDOC= \ + $(PDFDOC) DECHETS = \ - $(PKGNAME).glo \ - $(PKGNAME).gls \ - $(PKGNAME).idx \ - $(PKGNAME).ilg \ - $(PKGNAME).ind \ - $(PKGNAME).aux \ - $(PKGNAME).log \ - $(PKGNAME).toc + $(TEXDOC)\ + $(PDFDOC)\ + $(PKGNAME).{toc,aux,glo,gls,idx,ind,ilg,out,log}\ + $(PKGNAME)-en.{toc,aux,glo,gls,idx,ind,ilg,out,log}\ + $(PKGNAME)-fr.{toc,aux,glo,gls,idx,ind,ilg,out,log}\ REPERTS = \ doc \ tex \ source +TEX = $(PKGNAME).sty # --------------------------------------------------------------- -.SUFFIXES: .sty .ins .dtx .dvi .ps .pdf +.SUFFIXES: .sty .ins .dtx .dvi .ps .pdf .tex # --------------------------------------------------------------- .ins.sty: latex $< - .dtx.pdf: pdflatex $< makeindex -s gind.ist $(*D)/$(*F) @@ -60,12 +76,13 @@ REPERTS = \ # --------------------------------------------------------------- -all: $(PKGNAME).sty $(PKGNAME).pdf +all: distclean $(TEXDOC) $(PRODUITS) help: @-echo "******************************************************" @-echo "*" @-echo "* Choisir une des options :" + @-echo "* Choose one option:" @-echo "* 'all' -> modroman.sty " @-echo "* 'doc' pour la documentation" @-echo "* 'doc' for the documentation" @@ -98,7 +115,7 @@ texlive: all clean @-cp $(DOC) doc/latex/$(PKGNAME) @-cp $(SOURCE) source/latex/$(PKGNAME) @-mkdir -p $(PKGNAME) - @-cp $(DOC) ./$(PKGNAME) + @-cp $(CTANDOC) ./$(PKGNAME) @-cp $(SOURCE) ./$(PKGNAME) # --------------------------------------------------------------- @@ -116,6 +133,8 @@ zip: texlive $(PKGNAME).sty: $(PKGNAME).ins $(PKGNAME).dtx doc: $(PKGNAME).ins $(PKGNAME).pdf +$(TEXDOC): $(PKGNAME).ins $(PKGNAME).dtx +$(PDFDOC): $(TEXDOC) # --------------------------------------------------------------- # echu e an abaden -# Le \TeX nicien de surface 2008-05-04 +# Le \TeX nicien de surface 2010-04-09 diff --git a/Master/texmf-dist/source/latex/modroman/README b/Master/texmf-dist/source/latex/modroman/README new file mode 100755 index 00000000000..ad9e6a4afa9 --- /dev/null +++ b/Master/texmf-dist/source/latex/modroman/README @@ -0,0 +1,38 @@ +MODROMAN 1 2010-04-09 + +====================================================================== +Files: +LISEZMOI +README +Makefile +modroman.dtx +modroman.pdf % bilingual documentation of the code +modroman-fr.pdf % French user documentation +modroman-en.pdf % English user documentation +modroman.ins + +====================================================================== + +modroman.sty, two macros to write numbers in lower case +roman numerals thus i, ij, iij, iv and so on. (See the +final j?) + +With option ``upourv'' modroman 6 writes uj instead of vj. +The default option ``vpourv'' makes it write vj. + +To produce the modroman.sty file run: +latex modroman.ins + +*nix users should use the provided Makefile, run +make help +to obtain help. + +---------------------------------------------------------------------- + +v1 +many new macros to format roman numerals, five new options + + +-- +Le \TeX nicien de surface +le.texnicien.de.surface@wanadoo.fr diff --git a/Master/texmf-dist/source/latex/modroman/modroman.dtx b/Master/texmf-dist/source/latex/modroman/modroman.dtx index 70952fdeb01..63dea16a99d 100644 --- a/Master/texmf-dist/source/latex/modroman/modroman.dtx +++ b/Master/texmf-dist/source/latex/modroman/modroman.dtx @@ -1,64 +1,77 @@ % \iffalse meta-comment % -% Copyright (C) 2003, 2004, 2008 by Yvon Henel, -% dit « le TeXnicien de surface » +% Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, +% dit « le TeXnicien de surface » % -% -------------------------------------------------------------- +% -------------------------------------------------------------------- % -% This file may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.2 -% of this license or (at your option) any later version. -% The latest version of this license is in: +% This file may be distributed and/or modified under the conditions of +% the LaTeX Project Public License, either version 1.2 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 +% http://www.latex-project.org/lppl.txt % -% and version 1.2 or later is part of all distributions of LaTeX +% and version 1.2 or later is part of all distributions of LaTeX % version 1999/12/01 or later. % % \fi % % \iffalse -%\NeedsTeXFormat{LaTeX2e}[1999/12/01] -%\def\fileversion{v0.4} -%\def\filedate{2008/05/03} -%\def\fileinfo{fichier modroman.dtx par Le TeXnicien de surface} +%\NeedsTeXFormat{LaTeX2e}[1999/12/01] +%\def\fileversion{v1} +%\def\filedate{2010/04/09} +%\def\fileinfo{fichier modroman par Le TeXnicien de surface} +%\def\fileinfo{fichier MODRdoctools par Le TeXnicien de surface} %\ProvidesPackage{modroman} -% [\filedate\space\fileversion\space\fileinfo] -% +%\ProvidesPackage{MODRdoctools} +% [\filedate\space\fileversion\space\fileinfo] %<*driver> \documentclass{ltxdoc} \usepackage{xspace,url,multicol} -\usepackage{modroman}[2008/05/03] -\usepackage[latin1]{inputenc} +\usepackage{modroman}[2010/04/09] +\usepackage[latin9]{inputenc} \usepackage[T1]{fontenc} \usepackage[english,frenchb]{babel} +\usepackage{MODRdoctools} \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}% +\usepackage[pdfpagelabels, + colorlinks=true, + linkcolor=blue, + urlcolor=blue, + citecolor=blue]{hyperref} + + % commenter la ligne suivante pour avoir un document avec le code -\OnlyDescription +% \OnlyDescription % comment out the preceding line to obtain the full code % with explanations in French only, sorry. \EnableCrossrefs \CodelineIndex \RecordChanges \GlossaryPrologue{% - \section*{{Changements}}\markboth{{Changements}}{{Changements}}} + \section*{{Changements / Changes}}% + \markboth{{Changements}}{{Changements}}} \IndexPrologue{\section*{Index}\markboth{Index}{Index}% Les nombres en italique renvoient à la page où l'entrée est décrite ; les nombres soulignés renvoient à la ligne de code de la définition ; les nombres en caractères romains renvoient à la ligne de code où l'entrée est - utilisée.} -\def\generalname{Général} -\setlength{\columnseprule}{0.5pt} -\setlength{\multicolsep}{6pt plus 2.0pt minus 1.5pt} -\newenvironment{EnAnglais}{\columnbreak\mbox{} - \par\begin{otherlanguage}{english}}{\end{otherlanguage}} + utilisée. + + \begin{otherlanguage}{english}\itshape{} + Numbers written in italic refer to the page where the + corresponding entry is described; numbers underlined refer to the + code line of the definition; numbers in roman refer to the code + lines where the entry is used. + \end{otherlanguage}} +\def\generalname{Général / \emph{General}} \begin{document} \DocInput{modroman.dtx} \end{document} % % \fi % -% \CheckSum{101} +% \CheckSum{506} % % \CharacterTable % {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 @@ -76,299 +89,1661 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% -% \changes{v0.1}{2003/04/20}{Version initiale} -% \changes{v0.2}{2004/02/11}{Ajout des options upourv et vpourv} -% \changes{v0.3}{2004/05/18}{Quelques actions cosmétiques sur la documentation} -% \changes{v0.3}{2004/05/18}{Attirail pour *nix et CTAN.} -% \changes{v0.4}{2008/05/03}{Je me débarrasse des \cs{if}s.} -% \changes{v0.4}{2008/05/03}{Protection par \cs{@ifdefinable} des \cs{def}.} -% \changes{v0.4}{2008/05/03}{J'introduis \cs{modrom@actuelV}.} -%\iffalse -%<*eng> -\changes{v0.1}{2003/04/20}{Initial version} -\changes{v0.2}{2004/02/11}{Two options: upourv (u for v) and vpourv (v for v).} -\changes{v0.3}{2004/05/18}{Some cosmetic actions on the doc.} -\changes{v0.3}{2004/05/18}{Provides CTAN-ware and *nix tool.} -\changes{v0.3}{2004/05/18}{Bug corrected: 101 is at last written cj.} -\changes{v0.4}{2008/05/03}{Get rid of the \cs{if}s.} -\changes{v0.4}{2008/05/03}{Creation of \cs{modrom@actuelV}.} -% -%\fi +% \changes{v0.1}{2003/04/20}{Version initiale\EnAnglais{Initial +% version}} +% +% \changes{v0.2}{2004/02/11}{Ajout des options upourv et +% vpourv\EnAnglais{Add options upourv and vpourv}} +% +% \changes{v0.3}{2004/05/18}{Correction de bogue: 101 s'écrit enfin +% cj\EnAnglais{Bug corrected: 101 is at last written cj}} +% +% \changes{v0.3}{2004/05/18}{Quelques actions cosmétiques sur la +% documentation\EnAnglais{Some cosmetic actions on the documentation}} +% +% \changes{v0.3}{2004/05/18}{Attirail pour *nix et +% CTAN\EnAnglais{Provides CTAN-ware and *nix tool}} +% +% \changes{v1}{2010/04/03}{Réécriture complete du code, versions +% purement développables\EnAnglais{Rewriting of the code, purely +% expandable versions}} +% +% \changes{v1}{2010/04/03}{Renommage des macros +% internes\EnAnglais{Renaming of the internal macros}} +% +% \changes{v1}{2010/04/04}{Nouvelles options: ifinal, jfinal, +% sansmod\EnAnglais{New options: ifinal, jfinal, sansmod}} +% +% \changes{v1}{2010/04/04}{Utilisation de l'extension +% \texttt{etoolbox}\EnAnglais{Uses the \texttt{etoolbox} package}} +% +% \changes{v1}{2010/04/04}{Réorganisation de la +% documentation\EnAnglais{Reorganisation of the documentation}} +% % \GetFileInfo{modroman.sty} % -% \DoNotIndex{\newcommand,\newenvironment,\fi,\ ,{}} +% \DoNotIndex{\newcommand,\newenvironment,\fi,\ ,\ifx,\if,\ifnum,^^A +% \def,\csname,\endcsname,\expandafter,\ExecuteOptions,\else,^^A +% \afterassignment,\let,\@ifdefinable,\ProcessOptions,^^A +% \renewcommand,\newcounter,\providecommand,\numexpr,^^A +% \newtoggle,\toggletrue,\togglefalse,\iftoggle,\nottoggle,^^A +% \csuse,^^A +% \ifthenelse,\equal,^^A +% \Roman,\roman,\romannumeral,\@Roman,^^A +% \DeclareOption,\RequirePackage,\newcount,\relax,{}} % -% \title{Le module \textsf{modroman}\thanks{ -% Ce document correspond au fichier -% \textsf{modroman}~\fileversion, du \filedate\ -% et en est l'édition du cinquantenaire.}} -% \author{Le \TeX nicien de surface\\ \url{Yvon.Henel@orange.fr}} +% \title{L'extension \textsf{modroman}\thanks{% +% Ce document correspond au fichier +% \textsf{modroman}~\fileversion, du \filedate.}\quad +% The package \textsf{modroman}\thanks{% +% This document corresponds to the file +% \textsf{modroman}~\fileversion, dated \filedate.}} +% +% \author{\href{mailto:le.texnicien.de.surface@wanadoo.fr}{Le \TeX +% nicien de surface}} % % \maketitle % -% \section{Introduction} -% -% Ce petit module fournit une commande \cs{modromannumeral} pour écrire -% des nombres en chiffres romains minuscules avec une variante que je me -% souviens avoir vu sur des manuscrits : lorsque le nombre est supérieur -% ou égal à 2 et qu'il se termine normalement par un i, on écrit un j à -% la place. Cette commande s'emploie comme la primitive \TeX -% \cs{romannumeral}. -% -% Il fournit également une commande \cs{modroman}\marg{UnCompteur} pour -% écrire la valeur d'un \emph{compteur} de la même manière. Elle s'emploie -% comme la commande \LaTeX{} \cs{roman}. -% -% Il existe désormais à la demande générale d'\textbf{un} contributeur de -% \url{fr.comp.text.tex} deux options qui s'excluent mutuellement : l'option -% par défaut |vpourv| qui conserve le comportement de la version précédente -% et l'option |upourv| qui remplace \og v \fg par \og u \fg dans l'écriture -% des chiffres romains. -% -% \vspace{\stretch{1}} -% -% \hspace*{\stretch{1}}\makebox[0.5\linewidth][c]{\hrulefill} \hspace*{\stretch{1}} -% -% \vspace{\stretch{1}} -% +% \begin{abstract} +% \MODRdescrofr +% +% La documentation française pour l'utilisateur finale est désormais +% disponible sous le nom de \texttt{modroman-fr}. +% \end{abstract} % \begin{otherlanguage}{english} -% This package provides only two macros viz.\ \cs{modromannumeral} which -% writes the number given as argument in lower case roman numeral with a -% `j' instead of a `i' as the final letter of numbers greater than 1 -% such as \modromannumeral 2{} or \modromannumeral 101{} and -% \cs{modroman}\marg{MyCounter} which writes the value of a \emph{counter} in -% the same way. -% -% You have to use the first as the \TeX{} primitive -% \cs{romannumeral} and the second as \LaTeX{} command \cs{roman}. -% -% The default option is `vpourv' with which \cs{modromannumeral}| 5| is -% written as v. With the option `upourv' the same \cs{modromannumeral}| 5| is -% written as u. It was a special requirement from \emph{one} person posting on -% \url{fr.comp.text.tex}. \emph{The (almost) French `vpourv' stands for `v for -% v'.} -% -% I have not translated the detailed explanations of the code given in French -% for I wrote them mainly for me and because they are rather low -% level. Moreover all the ideas and technics used here come from -% \cite{tlachand}. +% \begin{abstract} +% \MODRdescroen +% +% The English documentation for the final user of the package +% \Pkg{modroman} is available in the file \texttt{modroman-en}. +% \end{abstract} % \end{otherlanguage} -% \vspace*{\baselineskip} -% \newpage -% \bgroup \setlength{\parindent}{0pt} -% \section{Utilisation} -% \begin{multicols}{2} -% On écrit |\modromannumeral 123| pour obtenir \modromannumeral 123. -% -% On écrit\\ -% |\newcounter{moncompt}|\\ -% |\setcounter{moncompt}{213}|\\ -% |\modroman{moncompt}|\\ -% pour obtenir -% \newcounter{moncompt}\setcounter{moncompt}{213} \og \modroman{moncompt} \fg. -% -% Avec \\ -% |\usepackage[upourv]{modroman}|\\ -% on passe l'option |upourv| à l'extension et les |v| des chiffres romains -% sont écrits |u|. Sinon, par défaut ou avec l'option |vpourv| on aura bien un -% |v| pour \og traduire \fg 5. -% \begin{EnAnglais} -% One writes |\modromannumeral 123| to obtain \modromannumeral 123. % -% With \\ -% |\newcounter{mycount}|\\ -% |\setcounter{mycount}{213}|\\ -% |\modroman{mycount}|\\ -% one obtains `\modroman{moncompt}'. -% -% With \\ -% |\usepackage[upourv]{modroman}|\\ -% the option |upourv| is enforced and the -% |v| of the roman numerals are written |u|. By default, or with the explicit -% option |vpourv| one will obtain the more classical |v| as a `translation' of -% 5. -% \end{EnAnglais} -% \end{multicols} -% -% \DescribeMacro{\modromannumeral} Syntaxe : -% \cs{modromannumeral}\verb*! !\emph{Nbr} -% \begin{multicols}{2} -% La première macro de ce module, écrite en \TeX. Elle écrit un nombre -% en chiffres romains minuscules et si ce nombre est supérieur à 2 et -% que son écriture habituelle se termine par un \og i \fg, ce \og i \fg -% sera changé en \og j \fg. -% -% Elle s'utilise comme la primitive \TeX{} \cs{romannumeral}, elle peut -% être suivie d'un ou plusieurs espaces suivis, obligatoirement, d'un -% nombre \emph{Nbr} qui \emph{ne doit pas} être entre accolades puis il faut -% assurer, si besoin, l'espace qui suit par \verb*!\ ! ou |{}| car la macro -% mange les espaces qui suivent le nombre. -% \begin{EnAnglais} -% The first macro of the package, written in \TeX. It writes a number in lower -% case roman numerals and if this number is greater than 1 and if its usual -% written form ends with an `i', that `i' is changed into a `j'. -% -% It is used as the \TeX{} primitive \cs{romannumeral}, it can be followed by -% one or many spaces and then a mandatory number \emph{Nbr} which is -% \emph{not} between curly braces then one has to ensure, if needed, the -% following space with \verb*!\ ! or |{}| for the macro eats the spaces that -% follow the number. -% \end{EnAnglais} -% \end{multicols} -% -% \DescribeMacro{\modroman} Syntaxe : -% \cs{modroman}\marg{Cptr} -% \begin{multicols}{2} -% Cette macro dans le mode \LaTeX, prend pour argument un compteur \emph{Cptr} -% comme le font les macros \cs{roman} ou \cs{alph} et écrit la valeur de ce -% compteur sous la forme indiquée ci-dessus à l'aide de -% \cs{modromannumeral}. -% \begin{EnAnglais} -% This is a \LaTeX-style macro. The mandatory argument is a counter -% \emph{Cptr}. One uses it as the \cs{roman} or \cs{alph} commands. It writes -% the value of \emph{Cptr} in the form explained above via -% \cs{modromannumeral}. -% \end{EnAnglais} -% \end{multicols} -% \egroup -% \begin{thebibliography}{9} -% \bibitem{tlachand} T.~\textsc{Lachand-Robert}. -% \emph{La maîtrise de \TeX{} et \LaTeX{}}. -% Masson, Paris, Milan, Barcelone, \oldstylenums{1995}. -% \textsc{isbn} : \texttt{2-225-84832-7}. -% \end{thebibliography} -% -% \StopEventually{} +% \StopEventually{\input{MODRbiblio}\newpage\PrintIndex\PrintChanges} +% +% \iffalse +%<*doc-sty> +\RequirePackage{ifthen} +\newcommand{\TO}{\textemdash\ \ignorespaces} +\newcommand{\TF}{\unskip\ \textemdash\xspace} +\newcommand{\CAD}{% + \iflanguage{frenchb}{c.-à-d.}{% + \iflanguage{english}{i.~e.}{% + \PackageError{MODRdoctools}% + {undefined language}% + {fix it before going on}}}\xspace} +\newcommand\BOP{\discretionary{}{}{}} +\newcommand\Option[1]{\textsc{#1}} +\newcommand\Pkg[1]{\textsf{#1}} +\newcommand\NOUVO{% + \marginpar{\hspace*{\stretch{1}}% + \textbf{N (v1)}\hspace*{.5em}}\xspace} +\newcommand\DescribeOption[1]{\leavevmode\@bsphack + \marginpar{\raggedleft \textsc{#1}}\index{#1 (option)}\@esphack} +\newcommand\PD{\textbf{[PD]}} +\newcommand\LT{\textbf{[\LaTeX]}} +\newcommand\TX{\textbf{[\TeX]}} + +\newcounter{EXEMPLE} +\newcommand\Exemple[1]{\setcounter{EXEMPLE}{#1}\modroman{EXEMPLE}} + +\newcommand\UnExemple[2]{\par\noindent\cs{nb#1}\texttt{\{#2\}} + \(\longrightarrow\) \csuse{nb#1}{#2}\par} +\newcommand\Exemples[1]{% + \par\noindent\hrulefill\par\noindent + \iflanguage{frenchb}{\textbf{Exemples}}{% + \iflanguage{english}{\textbf{Examples}}{}} + \UnExemple{#1}{1}\UnExemple{#1}{11}% + \UnExemple{#1}{444}% + \UnExemple{#1}{888}\UnExemple{#1}{1999}% + \par\noindent\hrulefill\par} + +\newenvironment{Anglais}[1][***]{% + \par\ifthenelse{\equal{#1}{***}}{\noindent}{}% + \begin{otherlanguage}{english}\itshape}% + {\end{otherlanguage}} +\newcommand\EnAnglais[1]{ / \emph{\foreignlanguage{english}{#1}}} +\newcommand\MODRdescrofr{% + Cette petite extension fournit des macros qui permettent d'écrire + les nombres en chiffres romains avec quelques modifications. + + On dispose de macros permettant d'obtenir \og \nbshortroman{1}\fg + pour~1 et \og \nbshortroman{18}\fg pour~18; \og + \nblongroman{999}\fg ou \og \nbLongRoman{999}\fg pour~999. + + Avec l'option \Option{upourv} \TO opposée de \Option{vpourv} option + par défaut\TF on obtient \og xuj\fg pour~15. Avec l'option + \Option{ifinal} \TO opposée de \Option{jfinal} option par défaut\TF + on peut obtenir \og xiiii\fg pour~14. + + Certaines macros s'utilisent comme le \cs{romannumeral} de \TeX, + d'autres, purement développables, sont destinées à formater un + compteur \TO comme le \cs{roman} de \LaTeX\TF ou un nombre. + + Elle offre aussi une macro \TO + \cs{printntimes}\marg{nombre}\marg{texte}\TF qui permet d'obtenir + \meta{nombre} fois le \marg{texte} comme + \texttt{\printntimes{10}{*}} obtenu avec + \texttt{\cs{printntimes}\{10\}\{*\}}.} + +\newcommand\MODRdescroen{% + This short package provides macros which enable one to write roman + numerals with some modifications. + + It provides macros with which one can obtain `\nbshortroman{1}' + for~1 and `\nbshortroman{18}' for~18; `\nblongroman{999}' or + `\nbLongRoman{999}' for~999. + + With option \Option{upourv} \TO opposite of \Option{vpourv} default + option \TF one obtains `xuj' for~15. With option \Option{ifinal} \TO + opposite of \Option{jfinal} default option\TF one can obtain `xiiii' + for~14. + + Some of the macros are used as \TeX{} \cs{romannumeral}, others, + purely expandable, are devoted to format a counter \TO as \LaTeX{} + \cs{roman}\TF or a number. + + It also provides a macro \TO + \cs{printntimes}\marg{number}\marg{text}\TF which produces + \meta{number} times the \marg{text} as e.g. + \texttt{\printntimes{10}{*}} obtained with + \texttt{\cs{printntimes}\{10\}\{*\}}.} +% +% \fi % -% \section{Le code} -% Je ne fais que suivre les idées --~nombreuses~-- , les exemples +% \iffalse +%<*biblio> +\begin{thebibliography}{9} +\bibitem{tlachand} T.~\textsc{Lachand-Robert}. +\emph{La maîtrise de \TeX{} et \LaTeX{}}. +Masson, Paris, Milan, Barcelone, \oldstylenums{1995}. +\textsc{isbn} : \texttt{2-225-84832-7}. +\bibitem{source2e} Johannes \textsc{Braams}, David + \textsc{Carlisle}, Alan \textsc{Jeffrey}, Leslie \textsc{Lamport}, + Frank \textsc{Mittelbach}, Chris \textsc{Rowley}, Rainer + \textsc{Schöpf}. \emph{The \LaTeXe{} sources}. 2009/09/24. +\end{thebibliography} +% +% \fi +% +% \iffalse +%<*package> +% \fi +% \section{Le code/The Code} +% +% Si les années qui passent ne me rendent pas beaucoup plus malin, +% elles ont un avantage: à force de lire des documentations +% d'extension, je finis par en connaitre davantage et il m'arrive de +% buter par hasard sur la solution à un problème que je n'avais fait +% qu'entrevoir. +% \begin{Anglais} +% As the years go by I don't really become more clever but, for I +% read not a few documentations of packages I happen to know a bit +% more and I happen to stumble upon the solution to a problem I had +% just caught a glimpse of. +% \end{Anglais} +% +% Je n'oublie pas les idées --~nombreuses~-- , les exemples % --~détaillés~-- et les explications --~claires~-- fournis par -% T.~\textsc{Lachand}-\textsc{Robert} dans~\cite{tlachand}. +% T.~\textsc{Lachand}-\textsc{Robert} dans~\cite{tlachand} mais je +% m'abreuve désormais aussi à d'autres sources -- +% \texttt{source2e}~\cite{source2e} pour être précis -- et c'est là +% que j'ai trouvé l'\emph{astuce} qui me permet de fournir cette +% nouvelle version de \Pkg{modroman}. Le lecteur intéressé jettera +% un coup d'\oe il sur la définition de la macro \cs{Roman} et ses macros +% auxiliaires. +% \begin{Anglais}[1] +% I don't forget what I owe to T.~\textsc{Lachand}-\textsc{Robert} +% in~\cite{tlachand} -- numerous ideas, detailed examples, clear +% explanations -- but I now use other sources -- +% \texttt{source2e}~\cite{source2e} to be accurate. That is where I +% have found the \emph{trick} which enables me to provide this new +% version of \Pkg{modroman}. The reader who would like to know +% more should have a look at the definition of the macro \cs{Roman} +% and its auxiliary macros. +% \end{Anglais} % -% Les erreurs que l'on pourrait trouver dans ce fichier sont entièrement -% de moi. +% Il est temps de présenter le code. +% \begin{Anglais}[1] +% And now for the code. +% \end{Anglais} % -% On définit les deux options, on sélectionne l'option |vpourv| par défaut, on -% charge les options. +% Je charge, et j'utilise, désormais l'extension \Pkg{etoolbox}. Les +% \emph{toggle}s \TO en français \og touche à bascule\fg, je parlerai +% désormais de \og bascule\fg\TF correspondent à des booléens mais qui +% offrent quelques avantages par rapport aux traditionnels \cs{if} de +% \TeX. Je définis les options dont les cinq qui apparaissent avec la +% version~1. +% \begin{Anglais}[1] +% I load, and use, the package \Pkg{etoolbox}. The \emph{toggle}s +% are booleans which provides some interresting properties different +% from those of the traditionnal \cs{if} of \TeX. I define the +% options among which the five ones appearing with the version~1. +% \end{Anglais} % +% Les macros internes de l'extension portent toutes un nom commençant +% par \cs{M@DR@}. Pour elles je ne fais pas de vérification avant +% définition à moins qu'elle ne soit faite automatiquement comme avec +% \cs{newcommand}. +% \begin{Anglais}[1] +% The internal macros of this package have all a name which begins +% with \cs{M@DR@}. I don't check if those are definable unless it is +% automatically done as when using \cs{newcommand}. +% \end{Anglais} % \begin{macrocode} -\DeclareOption{vpourv}{% +\RequirePackage{ifthen} +\RequirePackage{etoolbox} % \end{macrocode} -% \begin{macro}{\modrom@actuelV} Cette macro contient la forme effective du -% chiffre romain V: ce sera |u| avec l'option |upourv| et |v| avec |vpourv|, -% l'option par défaut. Dans le 2\ieme \cs{DeclareOption}, qui définit l'option -% |upourv|, la macro \cs{modrom@actuelV} étant déjà définie lors du traitement -% de l'option par défaut, \emph{via} |\ExecuteOptions{vpourv}|, on ne contrôle -% pas la \cs{def} avec \cs{@ifdefinable}, sinon on a une erreur systématique! +% Quatre bascules pour 5~options toutes placées à \texttt{faux} pour +% commencer. +% \begin{Anglais} +% Four toggles for 5~options, all of them set to \texttt{false} at +% the beginning. +% \end{Anglais} % \begin{macrocode} - \@ifdefinable\modrom@actuelV{\def\modrom@actuelV{v}} -} +\newtoggle{M@DR@upourv}\togglefalse{M@DR@upourv} +\newtoggle{M@DR@ifinal}\togglefalse{M@DR@ifinal} +\newtoggle{M@DR@longrn}\togglefalse{M@DR@longrn} +\newtoggle{M@DR@majrn}\togglefalse{M@DR@majrn} +\newtoggle{M@DR@sansmod}\togglefalse{M@DR@sansmod} % \end{macrocode} -% \end{macro} % \begin{macrocode} -\DeclareOption{upourv}{\def\modrom@actuelV{u}} -\ExecuteOptions{vpourv} +\DeclareOption{vpourv}{\togglefalse{M@DR@upourv}} +\DeclareOption{upourv}{\toggletrue{M@DR@upourv}} +\DeclareOption{jfinal}{\togglefalse{M@DR@ifinal}} +\DeclareOption{ifinal}{\toggletrue{M@DR@ifinal}} +\DeclareOption{long} {\toggletrue{M@DR@longrn}} +\DeclareOption{court} {\togglefalse{M@DR@longrn}} +\DeclareOption{maj} {\toggletrue{M@DR@majrn}} +\DeclareOption{min} {\togglefalse{M@DR@majrn}} +\DeclareOption{sansmod}{\toggletrue{M@DR@sansmod}} +\DeclareOption*{\PackageError{modroman}{% +The option \CurrentOption\space is not known!\MessageBreak +}{% +The possible options are (the first is the default):\MessageBreak +``vpourv'' or ``upourv''\MessageBreak +``jfinal'' or ``ifinal''\MessageBreak +``court'' or ``long''\MessageBreak +``min'' or ``maj''\MessageBreak +``sansmod''.}} +\ExecuteOptions{vpourv,jfinal,court,min} \ProcessOptions\relax % \end{macrocode} -% \begin{macro}{\romt@mp} -% On commence par créer un nouveau compteur \cs{romt@mp} à la mode \TeX, en -% s'assurant que c'est possible. +% Si les bascules |M@DR@upourv|, |M@DR@longrn| et +% |M@DR@|\BOP|maj|\BOP|rn| sont fausses et que la bascule +% |M@DR@ifinal| est vraie, on fait comme si l'on avait passé l'option +% |sansmod| vu que ça revient à ça. +% \begin{Anglais} +% If the toggles |M@DR@upourv|, |M@DR@majrn| and +% |M@DR@|\BOP|long|\BOP|rn| are false and the toggle +% |M@DR@|\BOP|i|\BOP|fi|\BOP|nal| is true, it is as if one had +% chosen the option |sansmod|, in any case the result is the same. +% \end{Anglais} % \begin{macrocode} -\@ifdefinable\romt@mp{\newcount\romt@mp} +\nottoggle{M@DR@upourv}{% + \iftoggle{M@DR@ifinal}{% + \nottoggle{M@DR@longrn}{% + \nottoggle{M@DR@majrn}{% + \toggletrue{M@DR@sansmod}}{}}{}}{}}{} +% \end{macrocode} +% +% J'ai besoin d'un compteur, je le déclare à la mode \LaTeX{} ce qui +% permet de ne pas pertuber la gestion des compteurs dont \LaTeX{} se +% charge mais qui obligera, plus bas, à utiliser \cs{c@M@DR@romt@mp} +% qui est le nom \TeX{} du compteur. +% \begin{Anglais}[1] +% I need a counter and I declare it \emph{à la} \LaTeX{} so not to +% disturb the management \LaTeX{} does of the counters but, below, I +% will have to use \cs{c@M@DR@romt@mp} which is the name of the +% counter for \TeX. +% \end{Anglais} +% \begin{macrocode} +\newcounter{M@DR@romt@mp} +% \end{macrocode} +% Suivant l'option choisie parmi \Option{upourv} et \Option{vpourv} je +% définis la commande \cs{M@DR@v} qui contient la représentation du +% chiffre romain \og v\fg. +% \begin{Anglais} +% According to the option chosen among \Option{upourv} and +% \Option{vpourv}, I define the macro \cs{M@DR@v} which contains the +% representation of the roman digit `v'. +% \end{Anglais} +% \begin{macrocode} +\iftoggle{M@DR@upourv}{\newcommand*\M@DR@v{u}}{\newcommand*\M@DR@v{v}} +% \end{macrocode} +% Je fais la même chose pour \cs{M@DR@j} qui contient la +% représentation du i final \TO comme dans \nbroman{8}\TF, en accord +% avec les options \Option{ifinal} ou \Option{jfinal}. +% \begin{Anglais} +% I do the same for \cs{M@DR@j} which contains the representation of +% the final i \TO as seen in \nbroman{8}\TF, according to the option +% \Option{ifinal} or \Option{jfinal}. +% \end{Anglais} +% \begin{macrocode} +\iftoggle{M@DR@ifinal}{\newcommand*\M@DR@j{i}}{\newcommand*\M@DR@j{j}} +% \end{macrocode} +% Maintenant, les représentations des autres chiffres romains. +% \begin{Anglais} +% Now the representations of the other roman digits. +% \end{Anglais} +% \begin{macrocode} +\newcommand*\M@DR@m{m} +\newcommand*\M@DR@d{d} +\newcommand*\M@DR@c{c} +\newcommand*\M@DR@l{l} +\newcommand*\M@DR@x{x} +\newcommand*\M@DR@i{i} +\newcommand*\M@DR@isol{i} +% \end{macrocode} +% +% \begin{macro}{\RedefineMRmdclxvij} Une macro qui permet à +% l'utilisateur de redéfinir les représentations des chiffres +% romains. Elle permet quelques effets amusants comme le montre la +% macro \cs{printntimes}. +% +% Elle a 9~arguments dont un par optionnel, si l'argument optionnel +% est égal à |M@DR@***| \TO cas par défaut\TF \cs{M@DR@isol} prend +% la même valeur que \cs{M@DR@i} \CAD que le \og i isolé\fg pour~1 +% et le \og i intermédiaire\fg \TO celui de \og +% \nbshortroman{12}\fg\TF ont la même forme, sinon l'argument +% optionnel fixe la valeur de \cs{M@DR@isol}. +% \begin{Anglais}[1] +% The macro \cs{RedefineMRmdclxvij} enables the user to redefine +% the roman digits. It makes possible some funny tricks of which +% \cs{printntimes} is but an example. +% +% It takes 9~arguments the first of which is optional. If that +% argument equals |M@DR@***| \TO default value\TF \cs{M@DR@isol} +% has the same value as \cs{M@DR@i} \CAD the `isolated i' for~1 +% and the `intermediary i' \TO the one in +% `\nbshortroman{12}'\TF has the same shape, else the optional +% argument set the value of \cs{M@DR@isol}. +% \end{Anglais} +% \begin{macrocode} +\newcommand*\RedefineMRmdclxvij[9][M@DR@***]{% + \ifthenelse{\equal{#1}{M@DR@***}}% + {\renewcommand*\M@DR@isol{#8}}% + {\renewcommand*\M@DR@isol{#1}}% + \renewcommand*\M@DR@m{#2}% + \renewcommand*\M@DR@d{#3}% + \renewcommand*\M@DR@c{#4}% + \renewcommand*\M@DR@l{#5}% + \renewcommand*\M@DR@x{#6}% + \renewcommand*\M@DR@v{#7}% + \renewcommand*\M@DR@i{#8}% + \renewcommand*\M@DR@j{#9}} % \end{macrocode} % \end{macro} -% \begin{macro}{\modromannumeral} -% On poursuit en écrivant la macro principale, définie à la \TeX\ mais en -% ayant pris soin de s'assurer que c'est possible avec \cs{@ifdefinable}. Elle -% fait appel à \cs{modrom@naux}. Le \cs{afterassignment} permet de commencer -% par lire le nombre \(N\) qui suit et l'affecter au compteur \cs{romt@mp} -% puis ensuite de lancer \cs{modrom@naux} avec \cs{romt@mp} comme argument. +% +% \subsection{Version courte minuscule / Short lowercase version} +% +% \begin{macro}{\shortroman} +% Cette macro prend un seul argument qui est un nom de compteur +% \LaTeX \TO p.~ex. \texttt{machin}. Elle se contente de lancer +% \cs{M@DR@shortmodromain} sur le compteur \TeX{} associé \TO +% \cs{c@machin}. +% \begin{Anglais} +% The macro takes one argument which is the name of a \LaTeX{} +% counter \TO e.g. \texttt{thingummy}. It just passes to +% \cs{M@DR@shortmodromain} the \TeX{} associated counter \TO +% \cs{c@thingummy}. +% \end{Anglais} +% \begin{macrocode} +\newcommand\shortroman[1]{% + \expandafter\M@DR@shortmodromain\csname c@#1\endcsname} +% \end{macrocode} +% Si le compteur a pour valeur~1, on obtient \og \cs{M@DR@isol}\fg +% sinon on lance +% \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main| sur la +% représentation du compteur en nombre romain minuscule suivi de |@@| +% qui servira de sentinelle ci-dessous. +% \begin{Anglais} +% If the value of the counter is~1, one obtains `\cs{M@DR@isol}' +% else the lowercase roman numeral representation of the counter, +% completed by |@@| which will be used below as a sentry, is passed +% to \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main|. +% \end{Anglais} +% \begin{macrocode} +\newcommand\M@DR@shortmodromain[1]{% + \ifnum #1=1 \M@DR@isol\else + \expandafter\M@DR@shmdromain\romannumeral #1@@\fi} +% \end{macrocode} +% La macro \cs{M@DR@shmdromain} prend deux arguments; ce seront +% deux chiffres romains ou |@|. +% \begin{Anglais} +% The macro \cs{M@DR@shmdromain} takes two arguments which +% will be two roman digits or |@|. +% \end{Anglais} % \begin{macrocode} -\@ifdefinable\modromannumeral{% - \def\modromannumeral{\afterassignment\modrom@naux \romt@mp=}} +\def\M@DR@shmdromain#1#2{% + \ifx#1@% +% \end{macrocode} +% L'aventure s'achève ici si le 1\ier argument est~|@| sinon on +% poursuit en regardant si on a un~|v| auquel cas on place +% \cs{M@DR@v}. +% \begin{Anglais} +% Here finishes the adventure if the 1st argument is~|@| else it +% goes on and looks if we have a~|v| in which case we place +% \cs{M@DR@v}. +% \end{Anglais} +% \begin{macrocode} + \else + \if#1v\M@DR@v +% \end{macrocode} +% Sinon, on regarde si on a un |i| +% \begin{Anglais}Else it tests for an~|i|\end{Anglais} +% \begin{macrocode} + \else + \if#1i% +% \end{macrocode} +% puis on regarde le 2\ieme argument et si ce dernier est un |@| c'est +% que le~|i| est final et on place \cs{M@DR@j} sinon on place +% \cs{M@DR@i} +% \begin{Anglais} +% then it looks at the 2nd argument. If that argument is a~|@| then +% the~|i| is final and we put \cs{M@DR@j} else we put \cs{M@DR@i} +% \end{Anglais} +% \begin{macrocode} + \ifx#2@\M@DR@j\else\M@DR@i\fi +% \end{macrocode} +% dans les autres cas \TO \CAD le 1\ier argument n'est ni |v| ni +% |i|\TF on place la bonne macro en la construisant à la volée avec le +% \cs{csuse} de \Pkg{etoolbox}. +% \begin{Anglais} +% in the other cases \TO i.~e. the 1st argument is neither~|v| +% nor~|i| \TF we place the correct macro by building it on fly with +% the \cs{csuse} of \Pkg{etoolbox}. +% \end{Anglais} +% \begin{macrocode} + \else\csuse{M@DR@#1}% + \fi + \fi +% \end{macrocode} +% On termine en appelant une macro auxiliaire en replaçant le 2\ieme +% argument en tête. +% \begin{Anglais} +% We end by calling an auxiliary macro putting back the 2nd argument +% at the head. +% \end{Anglais} +% \begin{macrocode} + \M@DR@shmdromainAux#2\fi} +% \end{macrocode} +% Le \emph{truc} du \cs{fi} permet de fermer correctement le test +% principal de +% \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main|. +% \begin{Anglais} +% The \emph{trick} of \cs{fi} enables us to correctly close the main +% test of \cs{M@DR@}\BOP|En|\BOP|short|\BOP|mod|\BOP|ro|\BOP|main|. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@shmdromainAux#1\fi{\fi\M@DR@shmdromain#1} % \end{macrocode} % \end{macro} -% \begin{macro}{\modrom@naux} -% On continue avec \cs{modrom@naux} qui regarde si \(N\) est strictement -% inférieure à 10. Si c'est le cas on exécute \cs{modrom@ni} avec \cs{romt@mp} -% pour argument. Sinon on exécute \cs{modrom@nii} avec ce même argument. +% +% \begin{macro}{\nbshortroman} +% Cette macro prend un nombre et le passe à +% \cs{M@DR@shortmodromain}. Les accolades dans la définition sont +% absolument nécessaires si on ne veut pas que seul le 1\ier chiffre +% soit traité. +% \begin{Anglais} +% The macro \cs{nbshortroman} takes a number as only +% argument. The curly braces in the definition are absolutely +% indispensable for without them only the first digit would be taken +% into account. +% \end{Anglais} % \begin{macrocode} -\@ifdefinable\modrom@naux{% - \def\modrom@naux{\ifnum\romt@mp<10 - \modrom@ni{\romt@mp}\else\modrom@nii{\romt@mp}\fi\relax}} +\newcommand\nbshortroman[1]{\M@DR@shortmodromain{#1}} % \end{macrocode} % \end{macro} -% \begin{macro}{\modrom@ni} Cette macro sert à écrire la version modifiée du -% nombre en chiffre romain quand ce nombre est inférieur à \(10\). Elle fait -% appel à \cs{modrom@actuelV} pour savoir quelle forme du $5$ romain écrire. On -% utilise un test \cs{ifcase} \cs{or} \texttt{\dots} \cs{fi}. On remarquera que -% le premier \cs{or} suit directement la condition puisque ce nombre ne peut -% être nul. -% \changes{v0.4}{2008/05/03}{Réécriture de la définition à l'aide de -% \cs{modrom@actuelV}.} -% \begin{macrocode} -\@ifdefinable\modrom@ni{% - \def\modrom@ni#1{\ifcase#1 \or i\or ij\or iij\or i\modrom@actuelV\or - \modrom@actuelV\or \modrom@actuelV j\or \modrom@actuelV ij\or - \modrom@actuelV iij\or ix\fi\relax}}% +% +% \begin{macro}{\shortromannumeral} +% Cette macro s'emploie comme \cs{romannumeral} de \TeX. Elle doit +% être suivie d'un nombre et elle mange les espaces qui le suivent. +% Grace à \cs{afterassignment}, la macro +% \cs{M@DR@}\BOP|short|\BOP|mod|\BOP|ro|\BOP|main| reçoit le +% compteur comme argument après qu'il a reçu pour valeur le nombre +% qui doit suivre. +% \begin{Anglais} +% The macro is used as \TeX{} \cs{romannumeral}. It must be +% followed by a number and eats the spaces that follow it. Thanks +% to \cs{afterassignment}, the macro +% \cs{M@DR@}\BOP|short|\BOP|mod|\BOP|ro|\BOP|main| receives the +% counter after it has been assigned the number which must follow. +% \end{Anglais} +% \begin{macrocode} +\newcommand\shortromannumeral{% + \afterassignment\M@DR@shortmodrom@naux \c@M@DR@romt@mp=} +\def\M@DR@shortmodrom@naux{\M@DR@shortmodromain\c@M@DR@romt@mp} % \end{macrocode} % \end{macro} -% \begin{macro}{\modrom@nii} -% La macro \cs{modrom@nii} admet un argument. Elle utilise la macro -% auxiliaire \cs{modrom@nij}. Elle crée dans un groupe ---~notez les doubles -% parenthèses ouvrantes et fermantes~--- deux compteurs temporaires. On -% affecte \(N\) aux deux compteurs. -% -% Après la 1\iere instruction de la deuxième ligne le compteur 0 |\count0| -% contient le quotient, \(q\), de l'argument principal, \(N\), dans la division -% euclidienne par \(10\). À la fin de cette ligne il contient \(10q\). -% -% Après la troisième ligne, le compteur 1 comptient contient \(r\), le reste de -% la division de \(N\) par \(10\). Pour finir, on écrit \(10q\) en chiffres -% romains grâce à la primitive \TeX{} \cs{romannumeral} et on écrit le reste~\(r\) -% grâce à \cs{modrom@nij}. -% \begin{macrocode} -\@ifdefinable\modrom@nii{% - \def\modrom@nii#1{{\count0 =#1\count1 =\count0 % - \divide\count0 by 10 \multiply\count0 by 10 % - \advance \count1 by -\count0 % - \romannumeral\count0\modrom@nij{\count1}}}} +% +% \subsection{Version longue minuscule / Long Lowercase Version} +% +% Cette fois il s'agit d'écrire les nombres romains \emph{à +% l'ancienne} \CAD sans utiliser la préposition pour soustraire. Dans +% ce cas 49 est écrit \nblongroman{49}. +% \begin{Anglais}[1] +% Now the aim is to write roman numerals the \emph{old way} +% i.~e. without using the preposition to subtract. In that case 49 +% is written \nblongroman{49}. +% \end{Anglais} +% +% \begin{macro}{\longroman} +% Macro pour l'utilisateur, elle attend un nom de compteur \LaTeX{} +% pour unique argument. +% \begin{Anglais} +% User macro which must be given a \LaTeX{} counter name as only +% argument. +% \end{Anglais} +% \begin{macrocode} +\newcommand\longroman[1]{% + \expandafter\M@DR@longmodromain\csname c@#1\endcsname} +% \end{macrocode} +% Macro auxiliaire qui ressemble à \cs{M@DR@shortmodromain} sauf +% qu'elle n'ajoute qu'un |@| comme sentinelle. +% \begin{Anglais} +% Auxiliary macro which looks like \cs{M@DR@shortmodromain} but add +% just one |@| as a sentry. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@longmodromain#1{% + \ifnum#1=1 \M@DR@isol\else + \expandafter\M@DR@Faire\romannumeral #1@\fi} +% \end{macrocode} +% J'ai besoin de connaitre deux chiffres romains pour décider d'une +% action mais je ne peux pas prendre un groupe de deux chiffres +% directement. Les macros \cs{M@DR@Faire@}|| sont là pour +% conserver la mémoire du dernier chiffre lu et agir en fonction du +% suivant. +% \begin{Anglais} +% I need to know two roman digits to decide which action to perform +% but I can't take a group of two letters directly. The +% \cs{M@DR@Faire@}\BOP|| are there to keep the memory of +% the last read digit and act according to the next. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire#1{\ifx#1@\else\csuse{M@DR@Faire@#1}\fi} +% \end{macrocode} +% La macro \cs{M@DR@Faireaux} ferme le \cs{if} principal et relance la +% procédure. +% \begin{Anglais} +% The macro \cs{M@DR@Faireaux} closes the main \cs{if} and restart +% the process. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faireaux\fi{\fi\M@DR@Faire} +% \end{macrocode} +% Pour les lettres |m|, |d|, |l| et |v| les choses sont simples. +% \begin{Anglais} +% For the letters |m|, |d|, |l|, and |v| things are simples. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@m\fi{\fi\M@DR@m\M@DR@Faire} +\def\M@DR@Faire@d\fi{\fi\M@DR@d\M@DR@Faire} +\def\M@DR@Faire@l\fi{\fi\M@DR@l\M@DR@Faire} +\def\M@DR@Faire@v\fi{\fi\M@DR@v\M@DR@Faire} +% \end{macrocode} +% Cas du |i| qui sera réécrit ou pas suivant la valeur du chiffre +% suivant. Une condition supplémentaire pour le~|i|, il faut écrire +% \cs{M@DR@j} lorsque le~|i| est final. +% \begin{Anglais} +% The case of |i| which will be rewritten or not according to the +% value of the next digit. An additional condition for~|i|, we have +% to write \cs{M@DR@j} if it is final. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@i\fi{\fi\M@DR@Faire@i@aux} +\def\M@DR@Faire@i@aux#1{% + \ifx#1@\M@DR@j% + \else\if#1x\M@DR@v\M@DR@i\M@DR@i\M@DR@i\M@DR@j% + \else\if#1v\M@DR@i\M@DR@i\M@DR@i\M@DR@j% + \else \M@DR@i\M@DR@Faire@i@auxaux\fi\fi + \M@DR@Faireaux\fi} +\def\M@DR@Faire@i@auxaux\fi\fi\M@DR@Faireaux{\fi\fi \M@DR@Faire@i} +% \end{macrocode} +% Cas du |x|, pas de |x| final. +% \begin{Anglais}The cas of |x|, no final |x|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@x\fi{\fi \M@DR@Faire@x@aux} +\def\M@DR@Faire@x@aux#1{% + \ifx#1@\M@DR@x% + \else + \if#1c\M@DR@l\M@DR@x\M@DR@x\M@DR@x\M@DR@x + \else + \if#1l\M@DR@x\M@DR@x\M@DR@x\M@DR@x + \else \M@DR@x\M@DR@FaireAuxAux#1\fi\fi + \M@DR@Faireaux\fi} +\def\M@DR@FaireAuxAux#1\fi\fi\M@DR@Faireaux\fi{\fi\fi\fi\M@DR@Faire#1} +% \end{macrocode} +% Cas du |c|, pas de |c| final non plus. +% \begin{Anglais}The case of |c|, no final |c| either.\end{Anglais} +% \begin{macrocode} +\def\M@DR@Faire@c\fi{\fi \M@DR@Faire@c@aux} +\def\M@DR@Faire@c@aux#1{% + \ifx#1@\M@DR@c% FIN + \else + \if#1d\M@DR@c\M@DR@c\M@DR@c\M@DR@c + \else + \if#1m\M@DR@d\M@DR@c\M@DR@c\M@DR@c\M@DR@c + \else \M@DR@c\M@DR@FaireAuxAux#1\fi\fi + \M@DR@Faireaux\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\nblongroman} +% \begin{macrocode} +\newcommand\nblongroman[1]{\M@DR@longmodromain{#1}} % \end{macrocode} % \end{macro} -% \begin{macro}{modrom@nij} La commande \cs{modrom@nij} écrit le dernier -% chiffre romain d'un nombre supérieur à \(10\). Elle admet un argument et -% pratique comme \cs{modrom@ni} en tenant compte toutefois que \(N\) est un -% nombre à au moins deux chiffres ce qui entraine que, p. ex., \(101\) s'écrit -% \modromannumeral 101. Elle fait également appel à \cs{modrom@actuelV} pour -% tenir compte de l'option choisie. -% \changes{v0.4}{2008/05/03}{Réécriture de la définition à l'aide de -% \cs{modrom@actuelV}.} -% \begin{macrocode} -\@ifdefinable\modrom@nij{% - \def\modrom@nij#1{\ifcase#1 \or j\or ij\or iij\or i\modrom@actuelV\or - \modrom@actuelV\or \modrom@actuelV j\or \modrom@actuelV ij\or - \modrom@actuelV iij\or ix\fi\relax}} +% +% \begin{macro}{\longromannumeral} +% \begin{macrocode} +\newcommand\longromannumeral{% + \afterassignment\M@DR@longmodrom@naux \c@M@DR@romt@mp=} +\def\M@DR@longmodrom@naux{\M@DR@longmodromain\c@M@DR@romt@mp} +% \end{macrocode} +% \end{macro} +% \subsection{Version longue capitale / Long Uppercase Version} +% +% L'idée principale est la même que ci-dessus sauf que on ne fait pas +% appel au macro \cs{M@DR@}\BOP|| car la version courte, +% fournie par \LaTeX{} avec \cs{Roman} ne permet pas les +% fantaisies. Si l'on voulait des effets spéciaux, il suffirait +% d'utiliser la version longue minuscule et jouer avec +% \cs{Re}\BOP|de|\BOP|fi|\BOP|ne|\BOP|MR|\BOP|md|\BOP|cl|\BOP|xv|\BOP|ij|. +% \begin{Anglais}[1] +% The main idea is the same as above but here I don't use macro +% \cs{M@DR@}\BOP|| for the short version provided for by +% \LaTeX{} with \cs{Roman} doesn't allow fancy work. If one wants +% special effects, one can use the long lowercase version and play +% with +% \cs{Re}\BOP|de|\BOP|fi|\BOP|ne|\BOP|MR|\BOP|md|\BOP|cl|\BOP|xv|\BOP|ij|. +% \end{Anglais} +% \begin{macrocode} +\def\M@DR@LongRomain#1{% + \ifnum#1=1 I\else + \expandafter\M@DR@FAIRE\romannumeral #1@\fi} +% \end{macrocode} +% \begin{macrocode} +\def\M@DR@FAIRE#1{\ifx#1@\else\csuse{M@DR@FAIRE#1}\fi} +% \end{macrocode} +% \begin{macrocode} +\def\M@DR@FAIREaux\fi{\fi \M@DR@FAIRE} +% \end{macrocode} +% \begin{macrocode} +\def\M@DR@FAIREm\fi{\fi M\M@DR@FAIRE} +\def\M@DR@FAIREd\fi{\fi D\M@DR@FAIRE} +\def\M@DR@FAIREl\fi{\fi L\M@DR@FAIRE} +\def\M@DR@FAIREv\fi{\fi V\M@DR@FAIRE} +% \end{macrocode} +% Cas du |i|.\begin{Anglais}The case of |i|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@FAIREi\fi{\fi \M@DR@FAIREIaux} +\def\M@DR@FAIREIaux#1{% + \ifx#1@I% FIN + \else\if#1xVIIII\else\if#1vIIII\else I\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +% \end{macrocode} +% Cas du |x|.\begin{Anglais}The case of |x|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@FAIREx\fi{\fi \M@DR@FAIREXaux} +\def\M@DR@FAIREXaux#1{% + \ifx#1@X% FIN + \else\if#1cLXXXX\else\if#1lXXXX\else X\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +\def\M@DR@FAIREAuxAux#1\fi\fi\M@DR@FAIREaux\fi{\fi\fi\fi\M@DR@FAIRE#1} +% \end{macrocode} +% Cas du |c|.\begin{Anglais}The case of |c|.\end{Anglais} +% \begin{macrocode} +\def\M@DR@FAIREc\fi{\fi \M@DR@FAIRECaux} +\def\M@DR@FAIRECaux#1{% + \ifx#1@C% FIN + \else\if#1dCCCC\else\if#1mDCCCC\else C\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +% \end{macrocode} +% \begin{macro}{\LongRoman} +% \begin{macrocode} +\newcommand\LongRoman[1]{% + \expandafter\M@DR@LongRomain\csname c@#1\endcsname} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nbLongRoman} +% \begin{macrocode} +\newcommand\nbLongRoman[1]{\M@DR@LongRomain{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\LongRomannumeral} +% \begin{macrocode} +\newcommand\LongRomannumeral{% + \afterassignment\M@DR@LongRom@naux \c@M@DR@romt@mp=} +\def\M@DR@LongRom@naux{\M@DR@LongRomain\c@M@DR@romt@mp} +% \end{macrocode} +% \end{macro} +% +% \subsection{Autres macros / Other macros} +% +% Je fournis ici quelques macros d'accompagnement des macros \TeX{} et +% \LaTeX{}. +% \begin{Anglais}[1] +% I provide here some macros to go with the \TeX{} and \LaTeX{} +% macros. +% \end{Anglais} +% \begin{macro}{\nbroman} +% \begin{macrocode} +\newcommand\nbroman[1]{\romannumeral #1\relax} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\nbRoman} +% \cs{@Roman} est une \emph{macro cachée} du noyau de \LaTeXe. +% \begin{Anglais} +% \cs{@Roman} is a \emph{hidden macro} of the kernel of \LaTeXe. +% \end{Anglais} +% \begin{macrocode} +\newcommand\nbRoman[1]{\@Roman{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\Romannumeral} +% Je ne reprends pas le code de \cs{Romannumeral} que l'on peut +% trouver dans \Pkg{bulgarian.ldf} car je pense que ma version, qui +% tire profit de l'existence du compteur \LaTeX ien +% \texttt{M@DR@romt@mp} est \emph{moins pire} \texttt{;-)} D'où le +% \cs{providecommand}. +% \begin{Anglais} +% I don't take the code of \cs{Romannumeral} which can be found in +% \Pkg{bulgarian.ldf} for I think that my version, which makes +% profit of the \LaTeX{} counter \texttt{M@DR@romt@mp} is \emph{less +% worse} \texttt{;-)}. Hence the \cs{providecommand}. +% \end{Anglais} +% \begin{macrocode} +\providecommand\Romannumeral{% + \afterassignment\M@DR@Rom@naux \c@M@DR@romt@mp=} +\def\M@DR@Rom@naux{\Roman{M@DR@romt@mp}} % \end{macrocode} % \end{macro} % +% \subsection{Options} +% % \begin{macro}{\modroman} -% La deuxième macro, dans le style \LaTeX, est bien plus courte. Elle -% fait appel à \cs{expandafter} pour que \cs{value} passe bien un nombre -% --~la valeur du compteur passé en argument~-- à \cs{modromannumeral} -% et l'histoire finit là. +% Je traite maintenant les options qui déterminent le +% comportement des macros \cs{modroman}, \cs{modromannumeral} et +% \cs{nbmodroman}. +% \begin{Anglais} +% I now use the options which determine the behaviour of the macros +% \cs{modroman}, \cs{modromannumeral}, and \cs{nbmodroman}. +% \end{Anglais} % \begin{macrocode} -\newcommand{\modroman}[1]{\expandafter\modromannumeral\value{#1}} -\endinput +\iftoggle{M@DR@sansmod} +% \end{macrocode} +% option \Option{sansmod} +% \begin{macrocode} +{\let\modroman=\roman + \let\modromannumeral=\romannumeral + \let\nbmodroman=\nbroman} +% \end{macrocode} +% avec / \emph{with} modifications +% \begin{macrocode} +{\iftoggle{M@DR@majrn} +% \end{macrocode} +% en majuscules / \emph{uppercase} +% \begin{macrocode} + {\iftoggle{M@DR@longrn} +% \end{macrocode} +% option \Option{long} +% \begin{macrocode} + {\let\modroman=\LongRoman + \let\modromannumeral=\LongRomannumeral + \let\nbmodroman=\nbLongRoman} +% \end{macrocode} +% option \Option{court} +% \begin{macrocode} + {\let\modroman=\Roman + \let\modromannumeral=\Romannumeral + \let\nbmodroman=\nbRoman}} +% \end{macrocode} +% en minuscules / \emph{lowercase} +% \begin{macrocode} + {\iftoggle{M@DR@longrn} +% \end{macrocode} +% option \Option{long} +% \begin{macrocode} + {\let\modroman=\longroman + \let\modromannumeral=\longromannumeral + \let\nbmodroman=\nblongroman} +% \end{macrocode} +% option \Option{court} +% \begin{macrocode} + {\let\modroman=\shortroman + \let\modromannumeral=\shortromannumeral + \let\nbmodroman=\nbshortroman}}} % \end{macrocode} % \end{macro} -% \Finale \PrintIndex\PrintChanges -\endinput +% +% \subsection{\cs{printntimes}} +% +% \begin{macro}{\printntimes} +% Pour finir, une petite macro pour écrire \meta{nbr} \TO 1\ier +% argument\TF fois le contenu du 2\ieme argument. J'utilise ici une +% idée présentée par David \textsc{Kastrup} dans un papier intitulé \og +% Iterating with roman numeral\fg que l'on pourra trouver dans la +% page dédiée aux \og +% \href{http://www.gust.org.pl/projects/pearls/2005p/index_html} +% {Pearls 2005} \fg de GUST. +% \begin{Anglais} +% I end with a tiny macro which writes \meta{nbr} \TO 1st +% argument\TF times the content of the 2nd argument. I use here an +% idea presented by David \textsc{Kastrup} in a paper entitled +% `Iterating with roman numeral' which is available on the page of +% the +% \href{http://www.gust.org.pl/projects/pearls/2005p/index_html} +% {Pearls 2005} \fg of GUST. +% \end{Anglais} +% \begin{macrocode} +\newcommand\printntimes[2]{{% + \renewcommand\M@DR@m{#2}% + \nblongroman{\numexpr 1000*#1}}} +% \end{macrocode} +% \end{macro} +% +% Ici finit l'extension. +% \begin{Anglais}[1]Here finishes the package.\end{Anglais} +% \Finale +% \iffalse +% +%<*doc> +\documentclass[a4paper]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{modroman}[2010/04/09] +\usepackage{xspace} +\usepackage{array} +\usepackage{ifthen} +\usepackage{MODRdoctools} +\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} +%\usepackage[english,frenchb]{babel} +%\usepackage[frenchb,english]{babel} +\usepackage[colorlinks=true, + linkcolor=blue, + urlcolor=blue, + citecolor=blue]{hyperref} + +\begin{document} +\renewcommand\thepage{\textit{\modroman{page}}} +%<*fr> +\title{L'extension \textsf{modroman}\thanks{ + Ce document correspond au fichier + \textsf{modroman}~\fileversion, du \filedate.}} +% +%<*en> +\title{The package \textsf{modroman}\thanks{ + This document corresponds to the file + \textsf{modroman}~\fileversion, dated \filedate.}} +% +\author{\href{mailto:le.texnicien.de.surface@wanadoo.fr}{Le \TeX + nicien de surface}} + +\maketitle + +\begin{abstract} +\begin{otherlanguage} +%{english} +%{french} +\bfseries{} +%<*fr> + This is the French documentation of \Pkg{modroman} for the final + user. + The English documentation is provided under the name + \texttt{modroman-en}. +% +%<*en> + Documentation anglaise pour l'utilisateur final de l'extension + \Pkg{modroman}. + La documentation française est disponible sous le nom de + \texttt{modroman-fr}. +% +\end{otherlanguage} + +\vspace{6pt} +\noindent\hrulefill +\vspace{6pt} + +%<*fr> +Documentation française pour l'utilisateur final de l'extension +\Pkg{modroman}. + +\MODRdescrofr +% +%<*en> +This is the English documentation of \Pkg{modroman} for the final +user. + +\MODRdescroen +% +\end{abstract} + +\tableofcontents{} + +\section{Introduction} + +\subsection{Motivation} + +%<*fr> +Les formes d'écriture des nombres en chiffres romains telles que les +proposent \TeX, avec \cs{romannumeral}, et \LaTeX, avec \cs{roman} et +\cs{Roman}, sont loin d'être les seules qui furent en usage. J'avais +vu, il y a bien longtemps, la notation \nbshortroman{8} dans un +manuscrit. Les premières versions \TO de 0.1 à 0.4\TF de cette +extension ne permettaient que cette écriture, avec, au gré de +l'utilisateur, l'utilisation d'un |u| pour noter la \emph{cinquaine} +comme dans \og xuij\fg pour~17. +% +%<*en> +The ways of writing numbers with roman numerals are more diverse than +it could be thought when one considers the \TeX{} \cs{romannumeral} +and \LaTeX{} \cs{roman} and \cs{Roman}. Many other forms were used at +a time or another through history. I saw, many years ago, the form +\nbshortroman{8} in a manuscript. The first versions \TO from 0.1 to +0.4\TF of this package provided just that form, with, user willing, +the use of a~|u| to denote a group of~5 as in `xuij' for~17. +% + +%<*fr> +Le lecteur interessé pourra jeter un \oe il sur la page que wikipedia +consacre aux chiffres romains pour voir que le monde n'est pas +toujours aussi simple que l'on voudrait qu'il soit. +% +%<*en> +The interested reader could cast a glance on the page wikipedia +devotes to roman numerals to see that the world is not always as +simple as one would like it to be. +% + +\subsection{ +%Remarques techniques +%Technical Remarks +} + +%<*fr> +Le code des premières versions permettait de numéroter les pages avec +les chiffres romains \emph{modifiés} mais on ne pouvait plus alors +utiliser les outils de référence comme \cs{label} et \cs{ref} ni même +espérer voir les nombres écrits correctement dans la table des +matières. +% +%<*en> +The code of the first versions enable one to number the pages with +\emph{modified} roman numerals but one could not then use the +reference tools such as \cs{label} and \cs{ref} or even hope to see +the page numbers correctly written in the table of contents. +% + +%<*fr> +Si les années qui passent ne me rendent pas beaucoup plus malin, elles +ont un avantage: à force de lire des documentations d'extension, je +finis par en connaitre davantage et il m'arrive de buter par hasard +sur la solution à un problème que je n'avais fait qu'entrevoir. +% +%<*en> +As the years go by I don't really become more clever but, for I read +not a few documentations of packages, I end with knowing a bit more +and I happen to stumble upon the solution to a problem I had just +caught a glimpse of. +% + +%<*fr> +Je n'oublie pas les idées --~nombreuses~--, les exemples +--~détaillés~-- et les explications --~claires~-- fournis par +T.~\textsc{Lachand}-\textsc{Robert} dans~\cite{tlachand} mais je +m'abreuve désormais aussi à d'autres sources -- +\texttt{source2e}~\cite{source2e} pour être précis -- et c'est là +que j'ai trouvé l'\emph{astuce} qui me permet de fournir cette +nouvelle version de \Pkg{modroman}. Le lecteur intéressé jettera +un coup d'\oe il sur la définition de la macro \cs{Roman} et ses macros +auxiliaires. +% +%<*en> +I don't forget what I owe to T.~\textsc{Lachand}-\textsc{Robert} +in~\cite{tlachand} -- numerous ideas, detailed examples, clear +explanations -- but I now use other sources -- +\texttt{source2e}~\cite{source2e} to be accurate. That is where I have +found the \emph{trick} which enables me to provide this new version of +\Pkg{modroman}. The reader who would like to know more should have a +look at the definition of the macro \cs{Roman} and its auxiliary +macros. +% + +%<*fr> +En réécrivant le code je me suis apperçu que je pouvais aller un peu +plus loin que je ne l'avais fait sans qu'il m'en coute beaucoup +plus. Voila pourquoi on trouvera désormais plus de macros et plus de +présentations des nombres en chiffres romains et une macro +supplémentaire. +% +%<*en> +While rewriting the code I happen to understand that I was able to go +a bit farther than I have gone previously without a tremendous extra +cost. That's why one will now find more macros and more presentations +of the roman numerals and an additional macro. +% + +%<*fr> +Cette version~1 conserve la compatibilité avec la version précédente +mais le code a été complètement réécrit et l'extension fournit +désormais à l'utilisateur outre les macros \cs{modroman} et +\cs{modromannumeral} une bonne quinzaine d'autres. +% +%<*en> +This version~1 keeps the compatibility with the previous version but +the code has been completely rewritten and the package now provides to +the user in addition to \cs{modroman} and \cs{modromannumeral} about +fifteen other macros. +% + +%<*fr> +Toutefois, la grande nouveauté de cette version~1 est que, désormais, +la macro \cs{modroman} \TO et ses petites camarades\TF est \og +purement développable\fg \TO voir page~\pageref{puredev} pour plus de +détails\TF, on peut donc l'utiliser pour numéroter des pages \emph{et} +obtenir ce qu'il faut dans la table des matières -- ce qui n'était pas +le cas jusqu'ici. Attention, je ne dis rien de tel à propos de +\cs{modromannumeral}. +% +%<*en> +However, the main change introduced by this version~1 is the fact that +from now on \cs{modroman} \TO and its pals \TF is purely expandable +\TO see page~\pageref{puredev} for more details. One can then use it +to number pages and obtain the correct thing in the table of content +-- which was not the case until now. Caution, I do \emph{not} say that +\cs{modromannumeral} is purely expandable -- it is not. +% + +\subsection{ +%Macros purement développables +%Purely Expandable Macros +} + +%<*fr> +On pourra lire le fil de discussion \og test de développabilité pure ? +\fg dans le forum \texttt{fr.comp.text.tex} pour voir que cette notion +n'est pas aussi simple qu'elle parait au n\ieme abord \texttt{:-)} +toutefois, ici, lorsque je dirais qu'une macro est \og purement +développable\fg j'entendrai ce qui suit. +% +%<*en> +One could, if one understands French, read the thread +`\foreignlanguage{frenchb}{test de développabilité pure ?}' on the +news group \texttt{fr.comp.text.tex} to see that that notion is not as +simple as one could think at n-th sight \texttt{:-)} however, here, +when I will say that a macro is `purely expandable' I will understand +what follows. +% + +%<*fr> +Supposons que la macro \cs{truc} soit telle que \cs{truc}\marg{12} +donne \og xij\fg \TO ça vous dit quelque chose? \TF +alors\label{puredev} +\begin{enumerate} +\item la macro \cs{TRUC} définie par + |\edef|\BOP|\TRUC|\BOP|{|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|}| + est telle que: + \begin{enumerate} + \item \cs{TRUC} donne bien \og xij\fg et + \item |\meaning\TRUC| donne \og \texttt{macro:->xij}\fg + \end{enumerate} +\item de plus, si on définit \cs{Axij}, alors la construction +|\csname| |A|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|\endcsname| +appelle bien la macro \cs{Axij}. +\end{enumerate} +% +%<*en> +Let's assume that the macro \cs{thing} is such that +\cs{thing}\marg{12} gives `xij' \TO does it ring a bell?\TF +then\label{puredev} +\begin{enumerate} +\item the macro \cs{THING} defined by + |\edef|\BOP|\TRUC|\BOP|{|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|}| + is such that: + \begin{enumerate} + \item \cs{THING} gives `xij' and + \item |\meaning\THING| gives `\texttt{macro:->xij}' + \end{enumerate} +\item moreover, if one defines \cs{Axij} then the construct + |\csname| |A|\BOP|\truc|\BOP|{|\BOP|12|\BOP|}|\BOP|\endcsname| + truly calls the macro \cs{Axij}. +\end{enumerate} +% + +\section{ +%Utilisation +%Usage +} + +\subsection{ +%Les macros +%The Macros +} + +%<*fr> +Les macros dont le nom finit par \texttt{numeral} s'utilisent comme la +macro \TeX{} \cs{romannumeral}. Elles doivent être suivies d'un nombre +et mangent les espaces qui le suivent. P.~ex. +|\longromannumeral| \verb*+368 ET+ donne \og\longromannumeral +368 ET\fg. +% +%<*en> +Macros the name of which ends with \texttt{numeral} are to be used as +\TeX{} \cs{romannumeral}. They must be followed by a number and eat +the spaces which are after it, e.~g. +|\longromannumeral| \verb*+368 AND+ gives `\longromannumeral +368 AND'. +% + +%<*fr> +Les macros dont le nom commence par \cs{nb} prennent un argument qui +est un nombre comme |\nbLongRoman{127}| qui donne \og +\nbLongRoman{127}\fg. +% +%<*en> +Macros the name of which begins with \cs{nb} take a number as argument +such as |\nbLongRoman{127}| which gives `\nbLongRoman{127}'. +% + +%<*fr> +Les macros dont le nom ne commencent pas par \cs{nb} mais +finissent par \texttt{roman} s'utilisent comme le \cs{roman} de +\LaTeX: leur unique argument est le nom d'un compteur. Avec +|\newcounter{machin}|, |\setcounter{machin}{124}|, +|\shortroman{machin}| on obtient \og \nbshortroman{124}\fg. +% +%<*en> +Macros the name of which doesn't begin with \cs{nb} but ends with +\texttt{roman} are used as \LaTeX{} \cs{roman}: their only argument is +the name of a counter. With |\newcounter{machin}|, +|\setcounter{machin}{124}|, |\shortroman{machin}| one obtains +`\nbshortroman{124}'. +% + +%<*fr> +Dans ce qui suit \meta{nbr} indique un nombre, \meta{ctr} indique +le nom d'un compteur à la \LaTeX{} comme \texttt{page} ou +\texttt{chapter}. +% +%<*en> +In what follows \meta{nbr} denotes a number, \meta{ctr} denotes the +\LaTeX{} name of a counter such as \texttt{page} or \texttt{chapter}. +% + +%<*fr> +Voici maintenant une présentation de toutes les macros disponibles +dans cette extension. Elles sont rangées par famille, étant entendu +qu'une famille est définie par l'aspect de la représentation obtenue. +% +%<*en> +Here comes a presentation of all the macros available with this +package. They are grouped by family where a family is defined with +respect to the obtained presentation of roman numerals. +% + +%<*fr> +Après la syntaxe de la macro, on trouvera \PD pour dire que cette +macro est purement développable \TO voir page~\pageref{puredev}\TF, +\LT pour signifier qu'elle s'utilise comme une macro \LaTeX, \TX pour +signifier qu'elle s'utilise comme la macro \cs{romannumeral} de \TeX. +% +%<*en> +After the macro's syntax, there will be \PD to mean that the macro is +purely expandable \TO see page~\pageref{puredev}\TF, \LT to mean that +it is used the \LaTeX{} way, \TX to mean that it is used as the \TeX{} +\cs{romannumeral}. +% + +%<*fr> +Les exemples sont soumis aux options par défaut: \Option{jfinal}, +\Option{vpourv}, \Option{court}, \Option{min}. +% +%<*en> +The examples are governed by the default options: \Option{jfinal}, +\Option{vpourv}, \Option{court}, \Option{min}. +% + +\subsubsection{ +%Famille +shortroman +%Family +} + +\begin{macro}{\shortroman} + \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\shortromannumeral} + \cs{shortromannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbshortroman} + \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{shortroman} + + +\subsubsection{ +%Famille +longroman +%Family +} + +\begin{macro}{\longroman} + \cs{longroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\longromannumeral} + \cs{longromannumeral} \meta{nbr} \TX +\end{macro} +\begin{macro}{\nblongroman} + \cs{nblongroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{longroman} + +\subsubsection{ +%Famille +LongRoman +%Family +} + +\begin{macro}{\LongRoman} + \cs{LongRoman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\LongRomannumeral} + \cs{LongRomannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbLongRoman} + \cs{nbLongRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{LongRoman} + + +\subsubsection{ +%Famille +roman +%Family +} + +%<*fr> +\TeX{} fournit \cs{romannumeral} et \LaTeX{} \cs{roman}. Je +complète la famille avec \cs{nbroman}. +% +%<*en> +\TeX{} provides \cs{romannumeral} and \LaTeX{} \cs{roman}. I +complete the family with \cs{nbroman}. +% + +\begin{macro}{\nbroman} + \cs{nbroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{roman} + +\subsubsection{ +%Famille +Roman +%Family +} + +%<*fr> +\LaTeX{} fournit \cs{Roman}. Je complète la famille avec \cs{nbRoman} +et \cs{Romannumeral}. +% +%<*en> +\LaTeX{} provides \cs{Roman}. I complete the family with \cs{nbRoman} and +\cs{Romannumeral}. +% + +\begin{macro}{\Romannumeral} + \cs{Romannumeral} \meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbRoman} + \cs{nbRoman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{Roman} + +\subsubsection{ +%Famille +modroman +%Family +} + +%<*fr> +Les macros \cs{modroman}, \cs{modromannumeral} et \cs{nbmodroman} ont +un rendu défini par les options choisies. Par défaut: +% +%<*en> +The output of the macros \cs{modroman}, \cs{modromannumeral}, and +\cs{nbmodroman} is determined by the chosen options. By default: +% + +\begin{macro}{\modroman} + \cs{modroman}\marg{ctr} $=$ \cs{shortroman}\marg{ctr} \PD \LT +\end{macro} + +\begin{macro}{\modromannumeral} + \cs{modromannumeral}\meta{nbr} $=$ \cs{shortromannumeral}\meta{nbr} \TX +\end{macro} + +\begin{macro}{\nbmodroman} + \cs{nbmodroman}\marg{nbr} $=$ \cs{nbshortroman}\marg{nbr} \PD \LT +\end{macro} + +\Exemples{modroman} + +\subsubsection{ +%Autres macros +%Other macros +} + +%<*fr> +On peut redéfinir le comportement des familles \cs{shortroman} et +\cs{longroman} en utilisant la macro \cs{RedefineMRmdclxvij}. +% +%<*en> +One can redefine the behaviour of families \cs{shortroman} and +\cs{longroman} with the macro \cs{RedefineMRmdclxvij}. +% + +\begin{macro}{\RedefineMRmdclxvij} + \cs{RedefineMRmdclxvij}\oarg{ISOL}\BOP\marg{M}\BOP\marg{D}\BOP\marg{C}% + \BOP\marg{L}\BOP\marg{X}\BOP\marg{V}\BOP\marg{I}\BOP\marg{J} +\end{macro} + +%<*fr> +Les arguments ci-dessus déterminent l'aspect des nombres romains +produits ensuite \TO on fera attention aux effets de bord et on +limitera la portée de la redéfinition à un groupe si nécessaire\TF par +les familles \cs{shortroman}, \cs{longroman} et, si elle est liée à +une de ces deux précédentes, \cs{modroman}. +% +%<*en> +The above arguments determine the look of the roman numerals produced +after \TO one should take care of the side effects and one would have +to limit the scope of the redefinition ot a group if necessary\TF by +the families \cs{shortroman}, \cs{longroman}, and, if it is linked to +one of the two preceding, \cs{modroman}. +% + +%<*fr> +L'argument optionnel \meta{ISOL} donne l'aspect du |i| isolé \CAD le +nombre~1. Si on ne donne pas cet argument l'aspect du |i| isolé est +celui du |i| non-final déterminé par \meta{I}. +% +%<*en> +The optional argument \meta{ISOL} gives the look of the isolated |i| \CAD the +number~1. If one doesn't give the argument the look of the isolated +|i| is the look of the non-final |i| determined by \meta{I} +% + +%<*fr> +L'argument \meta{J} donne l'aspect du |i| final. Les autres arguments +donne l'aspect du chiffre (minuscule) correspond, p.~ex. \meta{M} +donne l'aspect du~|m|. +% +%<*en> +The look of the final~|i| is given by the argument \meta{J}. All other +arguments give the look of the corresponding (lowercase) digit, +e.~g. \meta{M} gives the look of~|m|. +% + +\begin{macro}{\printntimes} + \cs{printntimes}\marg{nbr}% +%\marg{texte} +%\marg{text} +\end{macro} + +%<*fr> +Voici deux exemples d'utilisation de cette macro. +% +%<*en> +Here are two examples using the macro. +% + +|$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$| + +%donne +%gives + +$\ast$ \texttt{\printntimes{15}{*-*}} $\ast$ + +\bigskip + +|\newcommand\truc{\par\centering ***\par}|\par +|\newcommand\saut{\par\noindent\hrulefill\par}|\par +|\saut\texttt{\printntimes{5}{\truc}}\saut| + +%donne +%gives + +\newcommand\truc{\par\centering ***\par} +\newcommand\saut{\par\noindent\hrulefill\par} +\saut\texttt{\printntimes{5}{\truc}}\saut + +\subsection{ +%Les options +%The Options +} + +%<*fr> +Il existe -- depuis la version~0.2 -- à la demande générale +d'\textbf{un} contributeur de \url{fr.comp.text.tex} deux options qui +s'excluent mutuellement : l'option par défaut \Option{vpourv} qui +conserve le comportement de la version précédente et l'option +\Option{upourv} qui remplace \og v \fg par \og u \fg dans l'écriture +des chiffres romains. +% +%<*en> +There exist -- since the version~0.2 -- options \Option{vpourv} and +\Option{upourv}. The default option is \Option{vpourv} with which +\cs{modromannumeral}|5| is written as `v'. With the option +\Option{upourv} the same \cs{modromannumeral}|5| is written as `u'. It +was a special requirement from \emph{one} person posting on +\url{fr.comp.text.tex}. \emph{The (almost) French `vpourv' stands for + `v for v'.} +% + +%<*fr> +Par souci de symétrie, j'ajoute, avec la version~1, deux +options antithétiques \Option{jfinal} -- option par défaut -- et +\Option{ifinal} qui permettent de choisir si le dernier |i| d'un +nombre sera transformé en~|j| ou pas. +% +%<*en> +For sake of symetry, I add, with this version~1, two +antithetical options \Option{jfinal} -- final j -- the default, and +\Option{ifinal} -- final i -- by which one can choose if the last~i of +the number will be written as a~|j| or not. +% + +%<*fr> +J'ajoute encore deux couples d'options antithétiques. D'abord +\Option{min} \TO pour \emph{minuscule}, option par défaut \TF et +\Option{maj} \TO pour \emph{majuscule}\TF puis \Option{court} \TO +option par défaut\TF et \Option{long}. +% +%<*en> +I add also two pairs of antithetic options. First \Option{min} \TO +\CAD \emph{minuscule} lowercase, default option \TF and \Option{maj} +\TO \CAD \emph{majuscule} uppercase\TF then \Option{court} \TO short, +default option \TF and \Option{long}. +% + +%<*fr> +J'ajoute enfin, une option \Option{sansmod} -- sans modification -- +qui a pour effet de faire des macros de la famille \cs{modroman} des +alias de celles de la famille \cs{roman}. +% +%<*en> +Last, with this version~1, I add the option \Option{sansmod} -- +without modification -- which makes the macros of the \cs{modroman} +family aliases of those of \cs{roman} family. +% + +%<*fr> +Les cinq dernières options déterminent le comportement des macros de +la famille \cs{modroman}. +% +%<*en> +The last five options determine the behaviour of the macros of the +family \cs{modroman}. +% + +\DescribeOption{upourv} +%<*fr> +Avec cette option, le chiffre romain \og v\fg est transformé en \og +u\fg et on a, par exemple, \og xuij\fg pour~17. +% +%<*en> +With that option, the roman numeral `v' is turn into an~`u' and one +obtains, e.g., `xuij' for~17. +% + +\DescribeOption{vpourv} +%<*fr> +Cette option, active par défaut, est l'opposée de la précédente. Avec +elle, on obtient \Exemple{17} pour~17. +% +%<*en> +That option, enforced by default, is the opposite of the previous +one. With it, one obtains \Exemple{17} for~17. +% + +%<*fr> +Les trois options suivantes apparaissent avec la version~1 de +l'extension. +% +%<*en> +The next three options appear with the version~1 of the package. +% + + +\DescribeOption{jfinal} +%<*fr> +Avec cette option, active par défaut, si le nombre traité est plus +grand que~1 et si le dernier chiffre romain est un~i, ce dernier est +remplacé par un~j. Voir l'exemple précédent. +% +%<*en> +With that default option, if the processed number is greater than~1 +and if the last roman \emph{digit} is an~i then it is turned into +a~j. See the examples above. +% + + +\DescribeOption{ifinal} +%<*fr> +Cette option s'oppose à la précédente. Lorsqu'on l'a choisie, on +obtient \romannumeral 17{} pour~17. +% +%<*en> +That option is the opposite of the previous one. When enforced, one +obtains \romannumeral 17{} for~17. +% + +\DescribeOption{sansmod} +%<*fr> +Avec cette option, les macros \cs{modroman}, \cs{modromannumeral} et +\cs{nbmodroman} deviennent des alias -- avec \cs{let} -- de +\cs{roman}, \cs{romannumeral} et \cs{nbroman} respectivement. +% +%<*en> +With that option \cs{modroman}, \cs{modromannumeral} and +\cs{nbmodroman} are just aliases -- obtained with \cs{let} -- of +\cs{roman}, \cs{romannumeral}, and \cs{nbroman} respectively. +% + +%<*fr> +Choisir simultanément les options \Option{vpourv}, \Option{court}, +\Option{min} et \Option{ifinal} revient à choisir l'option +\Option{sansmod}. +% +%<*en> +If one choses options \Option{vpourv}, , \Option{court}, \Option{min}, +and \Option{ifinal} together, one enforces the option +\Option{sansmod}. +% + +\bigskip + +%<*fr> +Le tableau suivant indique quelle famille est liée à la famille +\cs{modroman} suivant les options choisies lorsque \Option{sansmod} +n'est pas en vigueur. +% +%<*en> +The following table shows which family is linked to the \cs{modroman} +family according to the chosen options when \Option{sansmod} is not +enforced. +% + +\begin{center} + \begin{tabular}{|*{3}{c|}}\hline + & \Option{court} & \Option{long}\\ \hline + \Option{min} & \cs{shortroman} & \cs{longroman} \\ \hline + \Option{maj} & \cs{Roman} & \cs{LongRoman} \\ \hline + \end{tabular} +\end{center} + +\input{MODRbiblio} + +% Il suffit de commenter le \iffalse et le \fi correspondant pour +% avoir ces quelques pages d'exemples. +% Suffices to comment out the \iffalse and the corresponding \fi to +% obtain those not few pages of examples. +\iffalse +\newpage +\section{ +%Nombres de \nbmodroman{1} à \nbmodroman{1000} +%Numbers from \nbmodroman{1} to \nbmodroman{1000} +} + +\newcounter{machin}\setcounter{machin}{1} +\noindent +\whiledo{\value{machin}<1001}{% + \mbox{\arabic{machin} -- \shortroman{machin} -- \longroman{machin} + -- \LongRoman{machin}}\stepcounter{machin}\par\noindent} +\newpage +\fi +\vspace*{\stretch{4}} +\noindent\hrulefill +\begin{center} +%Dans le préambule de ce document, on trouve +%In the preambule of this document, there is +\\ +|\renewcommand\thepage{\textit{\modroman{page}}}| +\\ +%d'où la numérotation des pages. +%hence the page numbering. +\end{center} +\noindent\hrulefill + +\vspace*{\stretch{2}} + +\begin{center} +\framebox{ +% Ici finit la documentation de \Pkg{modroman}. +% Here ends the documentation of \Pkg{modroman}. +} +\end{center} +\vspace*{\stretch{4}} +\end{document} +% +% \fi +\endinput %%% Local Variables: -%%% mode: latex +%%% mode: doctex %%% coding: iso-8859-15 -%%% TeX-master: t +%%% fill-column: 70 %%% End: - - diff --git a/Master/texmf-dist/source/latex/modroman/modroman.ins b/Master/texmf-dist/source/latex/modroman/modroman.ins index 23767fc4a1d..cd370fc5f96 100644 --- a/Master/texmf-dist/source/latex/modroman/modroman.ins +++ b/Master/texmf-dist/source/latex/modroman/modroman.ins @@ -18,7 +18,7 @@ This is a generated file. -Copyright (C) 2003, 2004, 2008 by Yvon Henel, +Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, dit «le TeXnicien de surface» This file may be distributed and/or modified under the conditions of @@ -34,17 +34,30 @@ and version 1.2 or later is part of all distributions of LaTeX version \endpreamble \askforoverwritefalse -\generate{\file{modroman.sty}{\from{modroman.dtx}{package}}} +\generate{ + \file{modroman.sty}{\from{modroman.dtx}{package}} + \file{MODRdoctools.sty}{\from{modroman.dtx}{doc-sty}} + \file{MODRbiblio.tex}{\from{modroman.dtx}{biblio}} + \file{modroman-en.tex}{\from{modroman.dtx}{doc,en}} + \file{modroman-fr.tex}{\from{modroman.dtx}{doc,fr}} + } -\Msg{***************************************************************} -\Msg{*} +\nopreamble + +\generate{ + \file{MODRbiblio.tex}{\from{modroman.dtx}{biblio}} + } + +\obeyspaces +\Msg{**********************************************************************} +\Msg{* *} \Msg{** To finish the installation you have to move the} \Msg{** file into a directory searched by TeX:} \Msg{*} \Msg{== Pour finir l'installation vous devez placer} \Msg{== le fichier suivant dans un répertoire parcouru par TeX.} \Msg{*} -\Msg{* \space\space modroman.sty} +\Msg{* modroman.sty} \Msg{*} \Msg{** To produce the documentation do:} \Msg{== Pour produire la documentation faire : } diff --git a/Master/texmf-dist/tex/latex/modroman/modroman.sty b/Master/texmf-dist/tex/latex/modroman/modroman.sty index 8da430821b3..1ec1fd077de 100644 --- a/Master/texmf-dist/tex/latex/modroman/modroman.sty +++ b/Master/texmf-dist/tex/latex/modroman/modroman.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2003, 2004, 2008 by Yvon Henel, +%% Copyright (C) 2003, 2004, 2008, 2010 by Yvon Henel, %% dit «le TeXnicien de surface» %% %% This file may be distributed and/or modified under the conditions of @@ -22,37 +22,186 @@ %% 1999/12/01 or later. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\def\fileversion{v0.4} -\def\filedate{2008/05/03} -\def\fileinfo{fichier modroman.dtx par Le TeXnicien de surface} +\def\fileversion{v1} +\def\filedate{2010/04/09} +\def\fileinfo{fichier modroman par Le TeXnicien de surface} \ProvidesPackage{modroman} [\filedate\space\fileversion\space\fileinfo] -\DeclareOption{vpourv}{% - \@ifdefinable\modrom@actuelV{\def\modrom@actuelV{v}} -} -\DeclareOption{upourv}{\def\modrom@actuelV{u}} -\ExecuteOptions{vpourv} +\RequirePackage{ifthen} +\RequirePackage{etoolbox} +\newtoggle{M@DR@upourv}\togglefalse{M@DR@upourv} +\newtoggle{M@DR@ifinal}\togglefalse{M@DR@ifinal} +\newtoggle{M@DR@longrn}\togglefalse{M@DR@longrn} +\newtoggle{M@DR@majrn}\togglefalse{M@DR@majrn} +\newtoggle{M@DR@sansmod}\togglefalse{M@DR@sansmod} +\DeclareOption{vpourv}{\togglefalse{M@DR@upourv}} +\DeclareOption{upourv}{\toggletrue{M@DR@upourv}} +\DeclareOption{jfinal}{\togglefalse{M@DR@ifinal}} +\DeclareOption{ifinal}{\toggletrue{M@DR@ifinal}} +\DeclareOption{long} {\toggletrue{M@DR@longrn}} +\DeclareOption{court} {\togglefalse{M@DR@longrn}} +\DeclareOption{maj} {\toggletrue{M@DR@majrn}} +\DeclareOption{min} {\togglefalse{M@DR@majrn}} +\DeclareOption{sansmod}{\toggletrue{M@DR@sansmod}} +\DeclareOption*{\PackageError{modroman}{% +The option \CurrentOption\space is not known!\MessageBreak +}{% +The possible options are (the first is the default):\MessageBreak +``vpourv'' or ``upourv''\MessageBreak +``jfinal'' or ``ifinal''\MessageBreak +``court'' or ``long''\MessageBreak +``min'' or ``maj''\MessageBreak +``sansmod''.}} +\ExecuteOptions{vpourv,jfinal,court,min} \ProcessOptions\relax -\@ifdefinable\romt@mp{\newcount\romt@mp} -\@ifdefinable\modromannumeral{% - \def\modromannumeral{\afterassignment\modrom@naux \romt@mp=}} -\@ifdefinable\modrom@naux{% - \def\modrom@naux{\ifnum\romt@mp<10 - \modrom@ni{\romt@mp}\else\modrom@nii{\romt@mp}\fi\relax}} -\@ifdefinable\modrom@ni{% - \def\modrom@ni#1{\ifcase#1 \or i\or ij\or iij\or i\modrom@actuelV\or - \modrom@actuelV\or \modrom@actuelV j\or \modrom@actuelV ij\or - \modrom@actuelV iij\or ix\fi\relax}}% -\@ifdefinable\modrom@nii{% - \def\modrom@nii#1{{\count0 =#1\count1 =\count0 % - \divide\count0 by 10 \multiply\count0 by 10 % - \advance \count1 by -\count0 % - \romannumeral\count0\modrom@nij{\count1}}}} -\@ifdefinable\modrom@nij{% - \def\modrom@nij#1{\ifcase#1 \or j\or ij\or iij\or i\modrom@actuelV\or - \modrom@actuelV\or \modrom@actuelV j\or \modrom@actuelV ij\or - \modrom@actuelV iij\or ix\fi\relax}} -\newcommand{\modroman}[1]{\expandafter\modromannumeral\value{#1}} +\nottoggle{M@DR@upourv}{% + \iftoggle{M@DR@ifinal}{% + \nottoggle{M@DR@longrn}{% + \nottoggle{M@DR@majrn}{% + \toggletrue{M@DR@sansmod}}{}}{}}{}}{} +\newcounter{M@DR@romt@mp} +\iftoggle{M@DR@upourv}{\newcommand*\M@DR@v{u}}{\newcommand*\M@DR@v{v}} +\iftoggle{M@DR@ifinal}{\newcommand*\M@DR@j{i}}{\newcommand*\M@DR@j{j}} +\newcommand*\M@DR@m{m} +\newcommand*\M@DR@d{d} +\newcommand*\M@DR@c{c} +\newcommand*\M@DR@l{l} +\newcommand*\M@DR@x{x} +\newcommand*\M@DR@i{i} +\newcommand*\M@DR@isol{i} +\newcommand*\RedefineMRmdclxvij[9][M@DR@***]{% + \ifthenelse{\equal{#1}{M@DR@***}}% + {\renewcommand*\M@DR@isol{#8}}% + {\renewcommand*\M@DR@isol{#1}}% + \renewcommand*\M@DR@m{#2}% + \renewcommand*\M@DR@d{#3}% + \renewcommand*\M@DR@c{#4}% + \renewcommand*\M@DR@l{#5}% + \renewcommand*\M@DR@x{#6}% + \renewcommand*\M@DR@v{#7}% + \renewcommand*\M@DR@i{#8}% + \renewcommand*\M@DR@j{#9}} +\newcommand\shortroman[1]{% + \expandafter\M@DR@shortmodromain\csname c@#1\endcsname} +\newcommand\M@DR@shortmodromain[1]{% + \ifnum #1=1 \M@DR@isol\else + \expandafter\M@DR@shmdromain\romannumeral #1@@\fi} +\def\M@DR@shmdromain#1#2{% + \ifx#1@% + \else + \if#1v\M@DR@v + \else + \if#1i% + \ifx#2@\M@DR@j\else\M@DR@i\fi + \else\csuse{M@DR@#1}% + \fi + \fi + \M@DR@shmdromainAux#2\fi} +\def\M@DR@shmdromainAux#1\fi{\fi\M@DR@shmdromain#1} +\newcommand\nbshortroman[1]{\M@DR@shortmodromain{#1}} +\newcommand\shortromannumeral{% + \afterassignment\M@DR@shortmodrom@naux \c@M@DR@romt@mp=} +\def\M@DR@shortmodrom@naux{\M@DR@shortmodromain\c@M@DR@romt@mp} +\newcommand\longroman[1]{% + \expandafter\M@DR@longmodromain\csname c@#1\endcsname} +\def\M@DR@longmodromain#1{% + \ifnum#1=1 \M@DR@isol\else + \expandafter\M@DR@Faire\romannumeral #1@\fi} +\def\M@DR@Faire#1{\ifx#1@\else\csuse{M@DR@Faire@#1}\fi} +\def\M@DR@Faireaux\fi{\fi\M@DR@Faire} +\def\M@DR@Faire@m\fi{\fi\M@DR@m\M@DR@Faire} +\def\M@DR@Faire@d\fi{\fi\M@DR@d\M@DR@Faire} +\def\M@DR@Faire@l\fi{\fi\M@DR@l\M@DR@Faire} +\def\M@DR@Faire@v\fi{\fi\M@DR@v\M@DR@Faire} +\def\M@DR@Faire@i\fi{\fi\M@DR@Faire@i@aux} +\def\M@DR@Faire@i@aux#1{% + \ifx#1@\M@DR@j% + \else\if#1x\M@DR@v\M@DR@i\M@DR@i\M@DR@i\M@DR@j% + \else\if#1v\M@DR@i\M@DR@i\M@DR@i\M@DR@j% + \else \M@DR@i\M@DR@Faire@i@auxaux\fi\fi + \M@DR@Faireaux\fi} +\def\M@DR@Faire@i@auxaux\fi\fi\M@DR@Faireaux{\fi\fi \M@DR@Faire@i} +\def\M@DR@Faire@x\fi{\fi \M@DR@Faire@x@aux} +\def\M@DR@Faire@x@aux#1{% + \ifx#1@\M@DR@x% + \else + \if#1c\M@DR@l\M@DR@x\M@DR@x\M@DR@x\M@DR@x + \else + \if#1l\M@DR@x\M@DR@x\M@DR@x\M@DR@x + \else \M@DR@x\M@DR@FaireAuxAux#1\fi\fi + \M@DR@Faireaux\fi} +\def\M@DR@FaireAuxAux#1\fi\fi\M@DR@Faireaux\fi{\fi\fi\fi\M@DR@Faire#1} +\def\M@DR@Faire@c\fi{\fi \M@DR@Faire@c@aux} +\def\M@DR@Faire@c@aux#1{% + \ifx#1@\M@DR@c% FIN + \else + \if#1d\M@DR@c\M@DR@c\M@DR@c\M@DR@c + \else + \if#1m\M@DR@d\M@DR@c\M@DR@c\M@DR@c\M@DR@c + \else \M@DR@c\M@DR@FaireAuxAux#1\fi\fi + \M@DR@Faireaux\fi} +\newcommand\nblongroman[1]{\M@DR@longmodromain{#1}} +\newcommand\longromannumeral{% + \afterassignment\M@DR@longmodrom@naux \c@M@DR@romt@mp=} +\def\M@DR@longmodrom@naux{\M@DR@longmodromain\c@M@DR@romt@mp} +\def\M@DR@LongRomain#1{% + \ifnum#1=1 I\else + \expandafter\M@DR@FAIRE\romannumeral #1@\fi} +\def\M@DR@FAIRE#1{\ifx#1@\else\csuse{M@DR@FAIRE#1}\fi} +\def\M@DR@FAIREaux\fi{\fi \M@DR@FAIRE} +\def\M@DR@FAIREm\fi{\fi M\M@DR@FAIRE} +\def\M@DR@FAIREd\fi{\fi D\M@DR@FAIRE} +\def\M@DR@FAIREl\fi{\fi L\M@DR@FAIRE} +\def\M@DR@FAIREv\fi{\fi V\M@DR@FAIRE} +\def\M@DR@FAIREi\fi{\fi \M@DR@FAIREIaux} +\def\M@DR@FAIREIaux#1{% + \ifx#1@I% FIN + \else\if#1xVIIII\else\if#1vIIII\else I\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +\def\M@DR@FAIREx\fi{\fi \M@DR@FAIREXaux} +\def\M@DR@FAIREXaux#1{% + \ifx#1@X% FIN + \else\if#1cLXXXX\else\if#1lXXXX\else X\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +\def\M@DR@FAIREAuxAux#1\fi\fi\M@DR@FAIREaux\fi{\fi\fi\fi\M@DR@FAIRE#1} +\def\M@DR@FAIREc\fi{\fi \M@DR@FAIRECaux} +\def\M@DR@FAIRECaux#1{% + \ifx#1@C% FIN + \else\if#1dCCCC\else\if#1mDCCCC\else C\M@DR@FAIREAuxAux#1\fi\fi + \M@DR@FAIREaux\fi} +\newcommand\LongRoman[1]{% + \expandafter\M@DR@LongRomain\csname c@#1\endcsname} +\newcommand\nbLongRoman[1]{\M@DR@LongRomain{#1}} +\newcommand\LongRomannumeral{% + \afterassignment\M@DR@LongRom@naux \c@M@DR@romt@mp=} +\def\M@DR@LongRom@naux{\M@DR@LongRomain\c@M@DR@romt@mp} +\newcommand\nbroman[1]{\romannumeral #1\relax} +\newcommand\nbRoman[1]{\@Roman{#1}} +\providecommand\Romannumeral{% + \afterassignment\M@DR@Rom@naux \c@M@DR@romt@mp=} +\def\M@DR@Rom@naux{\Roman{M@DR@romt@mp}} +\iftoggle{M@DR@sansmod} +{\let\modroman=\roman + \let\modromannumeral=\romannumeral + \let\nbmodroman=\nbroman} +{\iftoggle{M@DR@majrn} + {\iftoggle{M@DR@longrn} + {\let\modroman=\LongRoman + \let\modromannumeral=\LongRomannumeral + \let\nbmodroman=\nbLongRoman} + {\let\modroman=\Roman + \let\modromannumeral=\Romannumeral + \let\nbmodroman=\nbRoman}} + {\iftoggle{M@DR@longrn} + {\let\modroman=\longroman + \let\modromannumeral=\longromannumeral + \let\nbmodroman=\nblongroman} + {\let\modroman=\shortroman + \let\modromannumeral=\shortromannumeral + \let\nbmodroman=\nbshortroman}}} +\newcommand\printntimes[2]{{% + \renewcommand\M@DR@m{#2}% + \nblongroman{\numexpr 1000*#1}}} \endinput %% %% End of file `modroman.sty'. -- cgit v1.2.3