texlive[45281] Master/texmf-dist: randomlist (12sep17)
commits+karl at tug.org
commits+karl at tug.org
Wed Sep 13 00:16:46 CEST 2017
Revision: 45281
http://tug.org/svn/texlive?view=revision&revision=45281
Author: karl
Date: 2017-09-13 00:16:46 +0200 (Wed, 13 Sep 2017)
Log Message:
-----------
randomlist (12sep17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/generic/randomlist/Makefile
trunk/Master/texmf-dist/doc/generic/randomlist/randomlist.pdf
trunk/Master/texmf-dist/doc/generic/randomlist/test.pdf
trunk/Master/texmf-dist/doc/generic/randomlist/testtex.pdf
trunk/Master/texmf-dist/source/generic/randomlist/randomlist.dtx
trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.sty
trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.tex
Added Paths:
-----------
trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.pdf
trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.tex
Modified: trunk/Master/texmf-dist/doc/generic/randomlist/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/generic/randomlist/Makefile 2017-09-12 22:16:24 UTC (rev 45280)
+++ trunk/Master/texmf-dist/doc/generic/randomlist/Makefile 2017-09-12 22:16:46 UTC (rev 45281)
@@ -1,6 +1,6 @@
base=randomlist
-default: package doc test # package ou class
-final: package doc-final test
+default: package doc doc-fr test test-fr # package ou class
+final: package doc-final doc-fr-final test test-fr
package: $(base).sty
$(base).sty: $(base).ins $(base).dtx
@@ -26,16 +26,32 @@
ps2pdf $(base).ps $(base).pdf
rm $(base).dvi $(base).ps
+doc-fr: $(base)-doc-fr.pdf
+$(base)-doc-fr.pdf: $(base)-doc-fr.tex
+ latex '\nonstopmode \input $(base)-doc-fr'
+ dvips $(base)-doc-fr
+ ps2pdf $(base)-doc-fr.ps $(base)-doc-fr.pdf
+ rm $(base)-doc-fr.dvi $(base)-doc-fr.ps
+
+doc-fr-final:
+ latex '\nonstopmode \input $(base)-doc-fr'
+ latex '\nonstopmode \input $(base)-doc-fr'
+ makeindex -s gind.ist -o $(base)-doc-fr.ind $(base)-doc-fr.idx
+ latex '\nonstopmode \input $(base)-doc-fr'
+ dvips $(base)-doc-fr
+ ps2pdf $(base)-doc-fr.ps $(base)-doc-fr.pdf
+ rm $(base)-doc-fr.dvi $(base)-doc-fr.ps
+
test: randomlist.tex test.tex testtex.tex
pdflatex '\nonstopmode \input test.tex'
etex '\nonstopmode \input testtex.tex'
pdftex '\nonstopmode \input testtex.tex'
-ecm: ecm.tex
- pdflatex '\nonstopmode \input ecm.tex'
+test-fr: randomlist.tex test-fr.tex
+ pdflatex '\nonstopmode \input test-fr.tex'
clean:
- rm -rf *~ *.aux *.dvi *.glo *.gls *.idx *.ilg *.ind *.log *.out *.ps *.toc
+ rm -rf *~ *.aux *.dvi *.ps *.glo *.gls *.idx *.ilg *.ind *.log *.out *.tmp *.toc
zip:
- cd .. ; zip $(base).zip randomlist/$(base).dtx randomlist/$(base).ins randomlist/$(base).pdf randomlist/$(base).sty randomlist/readme.txt randomlist/Makefile randomlist/comets.dat randomlist/pupils.dat randomlist/pythagoras.dat randomlist/test.tex randomlist/test.pdf randomlist/testtex.tex randomlist/testtex.pdf; mv $(base).zip randomlist/
+ cd .. ; zip $(base).zip randomlist/$(base).dtx randomlist/$(base).ins randomlist/$(base).pdf randomlist/$(base).tex randomlist/$(base).sty randomlist/README.txt randomlist/Makefile randomlist/comets.dat randomlist/pupils.dat randomlist/pythagoras.dat randomlist/test.tex randomlist/test.pdf randomlist/test-fr.tex randomlist/test-fr.pdf randomlist/testtex.tex randomlist/testtex.pdf; mv $(base).zip randomlist/
Modified: trunk/Master/texmf-dist/doc/generic/randomlist/randomlist.pdf
===================================================================
(Binary files differ)
Added: trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.pdf 2017-09-12 22:16:24 UTC (rev 45280)
+++ trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.pdf 2017-09-12 22:16:46 UTC (rev 45281)
Property changes on: trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.tex 2017-09-12 22:16:46 UTC (rev 45281)
@@ -0,0 +1,62 @@
+\documentclass{article}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[a4paper, margin=2.5cm, noheadfoot]{geometry}
+\usepackage{amsmath}
+\usepackage[seed=1]{randomlist}
+\usepackage[french]{babel}
+
+\pagestyle{empty}
+\setlength{\parindent}{0pt}
+
+\NewList{Eleves}
+\NewList{Triplets}
+
+\begin{document}
+\ReadFileList{Eleves}{pupils.dat}
+\ExtractFirstItem{Eleves}{NULL} % retire la ligne de titre
+\ReadFileList{Triplets}{pythagoras.dat}
+\ForEachFirstItem{Eleves}{Eleve}
+{%
+ \ReadFieldItem{\Eleve}{0}{Nom}
+ \ReadFieldItem{\Eleve}{1}{Prenom}
+ \ReadFieldItem{\Eleve}{2}{Note}
+ \ExtractRandomItem{Triplets}{Triplet}
+ \ReadFieldItem{\Triplet}{0}{Tripleta}
+ \ReadFieldItem{\Triplet}{1}{Tripletb}
+ \ReadFieldItem{\Triplet}{2}{Tripletc}
+ \begin{center}
+ \fbox{\huge\bfseries Devoir pour \Nom{} \Prenom}
+ \end{center}
+ \textbf{Exercise} \par
+ \if A\Note
+ La diagonale d'un rectangle fait \Tripletc\,cm et un des côtés de
+ ce rectangle fait \Tripleta\,cm. Quelle est la longueur de l'autre
+ côté du rectangle ?
+ \else
+ Calculer la longueur de la diagonale d'un rectangle de
+ \Tripleta\,cm sur \Tripletb\,cm.
+ \fi
+ \newpage
+ \begin{center}
+ \fbox{\huge\bfseries Corrigé du devoir de \Nom{} \Prenom}
+ \end{center}
+ \textbf{Exercise} \par
+ \if A\Note
+ Il faut utiliser le théorème de Pythagore. On a :
+ \[\text{diagonale}^2=\text{côté}_1^2+\text{côté}_2^2.\]
+ Donc :
+ \[\Tripletc^2=\Tripleta^2+\text{côté}_2^2\]
+ et donc :
+ \[\text{côté}_2=\sqrt{\Tripletc^2-\Tripleta^2} = \Tripletb.\]
+ \else
+ Avec le théorème de Pythagore, on a :
+ \[\text{diagonale}^2=\text{côté}_1^2+\text{côté}_2^2.\]
+ Here:
+ \[\text{diagonale}^2=\Tripleta^2+\Tripletb^2\]
+ and then
+ \[\text{diagonale}=\sqrt{\Tripleta^2+\Tripletb^2} = \Tripletc.\]
+ \fi
+ \newpage
+}
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/generic/randomlist/test-fr.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/generic/randomlist/test.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/generic/randomlist/testtex.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/generic/randomlist/randomlist.dtx
===================================================================
--- trunk/Master/texmf-dist/source/generic/randomlist/randomlist.dtx 2017-09-12 22:16:24 UTC (rev 45280)
+++ trunk/Master/texmf-dist/source/generic/randomlist/randomlist.dtx 2017-09-12 22:16:46 UTC (rev 45281)
@@ -1,10 +1,10 @@
% \iffalse
%
%% randomlist.dtx
-%% Copyleft 2013-2016 J.-C. Charpentier & C. Tellechea
+%% Copyleft 2013-2017 J.-C. Charpentier & C. Tellechea
%
%% Packages `randomlist' to use with (La)eTeX
-%% Copyleft (L) 2013-2016 Jean-C\^ome Charpentier & Christian Tellechea.
+%% Copyleft (L) 2013-2017 Jean-C\^ome Charpentier & Christian Tellechea.
% \fi
%
%% \CharacterTable
@@ -77,6 +77,9 @@
\newcommand*\environ[1]{\texttt{#1}}
\newcommand*\Environ[1]{\texttt{#1}\index{#1=\texttt{#1}}}
\makeatletter
+\edef\quotechar{\string!}
+\edef\actualchar{\string=}
+\edef\verbatimchar{\string+}
\def\SpecialPageIndex#1{%
\immediate\write\@indexfile{%
\string\indexentry{\expandafter\@gobble\string#1\actualchar
@@ -1140,6 +1143,9 @@
% \changes{v1.2}{2016/07/13}{%
% First public release.
% }
+% \changes{v1.3}{2017/09/11}{%
+% Random operations are \global.
+% }
% \CheckSum{0}
% \iffalse
%<*latex>
@@ -1150,7 +1156,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{randomlist}
- [2016/07/13 v1.2 Package for random list (JCC, CT)]
+ [2017/09/11 v1.3 Package for random list (JCC, CT)]
% \end{macrocode}
% \LaTeX's wrapper has the possibility to use option. There is only
% one option: the seed one. It requires the \package{(x)keyval} package.
@@ -1326,9 +1332,9 @@
\newcount\RL at random@b
\def\RLsetrandomseed#1{%
\ifnum#1=0
- \RL at random \numexpr \time + \year * \month * \day \relax
+ \global\RL at random \numexpr \time + \year * \month * \day \relax
\else
- \RL at random \numexpr \ifnum#1<0 -\fi#1 \relax
+ \global\RL at random \numexpr \ifnum#1<0 -\fi#1 \relax
\fi
}
% \end{macrocode}
@@ -1362,19 +1368,19 @@
% \[x_{n+1} = 7^5(x_n \pmod{q}) - r\times\mathrm{E}\left(\frac{x_n}{q}\right).\]
% If $x_{n+1} < 0$ then $x_{n+1} = x_{n+1} + 2^{31}-1$
% \begin{macrocode}
- \RL at random@a=\RL at random
- \divide\RL at random@a 127773
- \RL at random@b=\RL at random@a
- \multiply\RL at random@a -2836
- \multiply\RL at random@b -127773
- \advance\RL at random\RL at random@b
- \multiply\RL at random 16807
- \advance\RL at random\RL at random@a
+ \global\RL at random@a=\RL at random
+ \global\divide\RL at random@a 127773
+ \global\RL at random@b=\RL at random@a
+ \global\multiply\RL at random@a -2836
+ \global\multiply\RL at random@b -127773
+ \global\advance\RL at random\RL at random@b
+ \global\multiply\RL at random 16807
+ \global\advance\RL at random\RL at random@a
% \end{macrocode}
% If random number is negative add $2^{31}-1$.
% \begin{macrocode}
\ifnum\RL at random<0
- \advance\RL at random 2147483647
+ \global\advance\RL at random 2147483647
\fi
}
% \end{macrocode}
@@ -1391,10 +1397,10 @@
% \end{macrocode}
% Compute $|\RL at random| \pmod{\mathtt{\string#1}}$.
% \begin{macrocode}
- \RL at random@a=\RL at random
- \RL at random@b=\RL at random
- \divide\RL at random@a \numexpr#1\relax
- \RL at random@b \numexpr\RL at random@b - \RL at random@a * (#1)\relax
+ \global\RL at random@a=\RL at random
+ \global\RL at random@b=\RL at random
+ \global\divide\RL at random@a \numexpr#1\relax
+ \global\RL at random@b \numexpr\RL at random@b - \RL at random@a * (#1)\relax
\expandafter\edef\csname #2\endcsname{\number\RL at random@b}%
}%
% \end{macrocode}
Modified: trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.sty
===================================================================
--- trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.sty 2017-09-12 22:16:24 UTC (rev 45280)
+++ trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.sty 2017-09-12 22:16:46 UTC (rev 45281)
@@ -7,9 +7,9 @@
%% randomlist.dtx (with options: `latex')
%%
%% randomlist.dtx
-%% Copyleft 2013-2016 J.-C. Charpentier & C. Tellechea
+%% Copyleft 2013-2017 J.-C. Charpentier & C. Tellechea
%% Packages `randomlist' to use with (La)eTeX
-%% Copyleft (L) 2013-2016 Jean-C\^ome Charpentier & Christian Tellechea.
+%% Copyleft (L) 2013-2017 Jean-C\^ome Charpentier & Christian Tellechea.
%% \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
@@ -28,7 +28,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{randomlist}
- [2016/07/13 v1.2 Package for random list (JCC, CT)]
+ [2017/09/11 v1.3 Package for random list (JCC, CT)]
\RequirePackage{xkeyval}
\DeclareOptionX{seed}{\gdef\RL at seed{#1}}
\ExecuteOptions{seed=0}
Modified: trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.tex 2017-09-12 22:16:24 UTC (rev 45280)
+++ trunk/Master/texmf-dist/tex/generic/randomlist/randomlist.tex 2017-09-12 22:16:46 UTC (rev 45281)
@@ -7,9 +7,9 @@
%% randomlist.dtx (with options: `tex')
%%
%% randomlist.dtx
-%% Copyleft 2013-2016 J.-C. Charpentier & C. Tellechea
+%% Copyleft 2013-2017 J.-C. Charpentier & C. Tellechea
%% Packages `randomlist' to use with (La)eTeX
-%% Copyleft (L) 2013-2016 Jean-C\^ome Charpentier & Christian Tellechea.
+%% Copyleft (L) 2013-2017 Jean-C\^ome Charpentier & Christian Tellechea.
%% \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
@@ -98,9 +98,9 @@
\newcount\RL at random@b
\def\RLsetrandomseed#1{%
\ifnum#1=0
- \RL at random \numexpr \time + \year * \month * \day \relax
+ \global\RL at random \numexpr \time + \year * \month * \day \relax
\else
- \RL at random \numexpr \ifnum#1<0 -\fi#1 \relax
+ \global\RL at random \numexpr \ifnum#1<0 -\fi#1 \relax
\fi
}
\ifx\RL at seed\@undefined
@@ -109,24 +109,24 @@
\RLsetrandomseed{\RL at seed}
\fi
\def\RL at nextrand{%
- \RL at random@a=\RL at random
- \divide\RL at random@a 127773
- \RL at random@b=\RL at random@a
- \multiply\RL at random@a -2836
- \multiply\RL at random@b -127773
- \advance\RL at random\RL at random@b
- \multiply\RL at random 16807
- \advance\RL at random\RL at random@a
+ \global\RL at random@a=\RL at random
+ \global\divide\RL at random@a 127773
+ \global\RL at random@b=\RL at random@a
+ \global\multiply\RL at random@a -2836
+ \global\multiply\RL at random@b -127773
+ \global\advance\RL at random\RL at random@b
+ \global\multiply\RL at random 16807
+ \global\advance\RL at random\RL at random@a
\ifnum\RL at random<0
- \advance\RL at random 2147483647
+ \global\advance\RL at random 2147483647
\fi
}
\def\RLuniformdeviate#1#2{%
\RL at nextrand
- \RL at random@a=\RL at random
- \RL at random@b=\RL at random
- \divide\RL at random@a \numexpr#1\relax
- \RL at random@b \numexpr\RL at random@b - \RL at random@a * (#1)\relax
+ \global\RL at random@a=\RL at random
+ \global\RL at random@b=\RL at random
+ \global\divide\RL at random@a \numexpr#1\relax
+ \global\RL at random@b \numexpr\RL at random@b - \RL at random@a * (#1)\relax
\expandafter\edef\csname #2\endcsname{\number\RL at random@b}%
}%
\newtoks\@ListOfList
More information about the tex-live-commits
mailing list