From 7e432dc7f673471164ff0d31c8b9873870525478 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 3 Aug 2022 03:00:44 +0000 Subject: CTAN sync 202208030300 --- .../biblatex-contrib/biblatex-software/Changes | 1 + .../biblatex-contrib/biblatex-software/Makefile | 59 +- .../biblatex-software/english-software.lbx | 2 +- .../biblatex-software/french-software.lbx | 2 +- .../biblatex-contrib/biblatex-software/history.tex | 17 +- .../biblatex-software/sample-use-sty.pdf | Bin 129373 -> 128987 bytes .../biblatex-software/software-biblatex.pdf | Bin 172786 -> 172433 bytes .../biblatex-software/software-biblatex.tex | 2 +- .../biblatex-software/software.bbx | 12 +- .../biblatex-software/software.dbx | 2 +- macros/latex/contrib/postnotes/CHANGELOG.md | 8 +- macros/latex/contrib/postnotes/postnotes-code.pdf | Bin 812284 -> 814509 bytes macros/latex/contrib/postnotes/postnotes.dtx | 97 +- macros/latex/contrib/postnotes/postnotes.pdf | Bin 176560 -> 176261 bytes macros/latex/contrib/postnotes/postnotes.tex | 50 +- .../contrib/profcollege/doc/ProfCollege-doc.pdf | Bin 8600450 -> 8684452 bytes .../contrib/profcollege/latex/ProfCollege.sty | 2104 +++++++++++++------- .../contrib/profcollege/metapost/PfCPseudo.mp | 20 +- .../contrib/profcollege/metapost/PfCScratch.mp | 19 +- .../contrib/profcollege/metapost/PfCScratchpdf.mp | 19 +- macros/latex/contrib/sillypage/README.md | 8 +- .../latex/contrib/sillypage/sillypage-example.pdf | Bin 103728 -> 103728 bytes macros/latex/contrib/sillypage/sillypage.dtx | 20 +- macros/latex/contrib/sillypage/sillypage.pdf | Bin 219530 -> 219736 bytes 24 files changed, 1646 insertions(+), 796 deletions(-) mode change 100644 => 120000 macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex (limited to 'macros/latex') diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/Changes b/macros/latex/contrib/biblatex-contrib/biblatex-software/Changes index 76f1661405..ab3b8a524d 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/Changes +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/Changes @@ -1,3 +1,4 @@ +\begin{release}{bltx-v1.2-5}{2022-08-02} \item Fix mishandling of SWHID short toggle when hyperref is not loaded. \end{release} \begin{release}{bltx-v1.2-4}{2022-03-03} \item Add support for displaying short SWHID \end{release} \begin{release}{bltx-v1.2-3}{2021-08-20} \item Support backrefs. \end{release} \begin{release}{bltx-v1.2-2}{2020-06-27} \item Fix handling of related field; use date instead of year/month in examples; add swMATH definition \end{release} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/Makefile b/macros/latex/contrib/biblatex-contrib/biblatex-software/Makefile index 1b75b6374d..5d80961ef2 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/Makefile +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/Makefile @@ -17,18 +17,24 @@ swentries.tex: ../swentry.org ../bin/extract-entries.pl < ../swentry.tex > $@ software-biblatex.pdf: software-biblatex.tex swentries.tex history.tex biblio.bib manual.bib - pdflatex software-biblatex.tex + pdflatex software-biblatex.tex > /dev/null bibtex software-biblatex - pdflatex software-biblatex.tex - pdflatex software-biblatex.tex + pdflatex software-biblatex.tex > /dev/null + pdflatex software-biblatex.tex > /dev/null -sample-use-sty.pdf: biblio.bib sample-content.tex +sample-use-sty.pdf: biblio.bib sample-content.tex sample-use-sty.tex -sample-use-sty.backref.pdf: biblio.bib biblio.bib sample-content.tex +sample-use-sty.nohyperref.tex: sample-use-sty.tex + grep -v hyperref $< > $@ + +sample-use-sty.nohyperref.pdf: biblio.bib sample-content.tex sample-use-sty.nohyperref.tex + +sample-use-sty.backref.pdf: biblio.bib sample-content.tex # test that backrefs work - pdflatex "\PassOptionsToPackage{backref=true}{biblatex} \input{sample-use-sty.backref.tex}" - biber sample-use-sty.backref - pdflatex "\PassOptionsToPackage{backref=true}{biblatex} \input{sample-use-sty.backref.tex}" + pdflatex -jobname sample-use-sty.backref "\PassOptionsToPackage{backref=true}{biblatex} \input{sample-use-sty.tex}" > /dev/null + biber sample-use-sty.backref > /dev/null + pdflatex -jobname sample-use-sty.backref "\PassOptionsToPackage{backref=true}{biblatex} \input{sample-use-sty.tex}" > /dev/null + pdflatex -jobname sample-use-sty.backref "\PassOptionsToPackage{backref=true}{biblatex} \input{sample-use-sty.tex}" > /dev/null history.tex: git for-each-ref --format="\begin{release}{%(refname:short)}{%(taggerdate:short)} \item %(subject) \end{release}" refs/tags | grep bltx | tac > history.tex @@ -38,25 +44,48 @@ sample.tex : biblio.bib biblatex-styles %.pdf: %.tex ifeq (, $(shell PATH=$(PATH) which rubber)) echo "No rubber in $(PATH), falling back to basic pdflatex calls" - pdflatex $< - biber $* - pdflatex $< + pdflatex $< > /dev/null + biber $* > /dev/null + pdflatex $< > /dev/null + pdflatex $< > /dev/null else rubber -m pdftex $< endif +%.txt: %.pdf + pdftotext $< + +test: sample-use-sty.txt sample-use-sty.nohyperref.txt sample-use-sty.backref.txt + # check that we get the same results with and without hyperref + echo -n "Testing hyperref vs nohyperref: " + (diff sample-use-sty.txt sample-use-sty.nohyperref.txt > /dev/null; if [ $$? -ne 0 ]; then echo "FAIL"; else echo "SUCCESS"; fi) + # check that backrefs work + echo -n "Testing presence of backrefs: " + (grep "cited on page" sample-use-sty.backref.txt > /dev/null; if [ $$? -ne 0 ]; then echo "FAIL"; else echo "SUCCESS"; fi) distrib: # remind maintainer to update version number in the documentation - echo -n "Did you update the version number in software-biblatex.tex? [y/N]" - read ans; if [ ".$$ans" != ".y" ]; then echo "Please update it and run make distrib again"; exit 1; fi + echo -n "Updated version number in software-biblatex.tex, date strings in software.* ? [y/N]" + read ans; if [ ".$$ans" != ".y" ]; then echo "Please update this information and run make distrib again"; exit 1; fi # update history rm history.tex make software-biblatex.pdf tar --transform 's,^\(.\),biblatex-software/\1,' -czhvf biblatex-software.tar.gz `git ls-files` -clean: $(patsubst %,%/clean,$(TEXS)) - rm -f *+sw.bbx *+sw.dbx *+sw.cbx *+sw.lbx *~ +.PHONY: preserve restore clean distclean + +clean: + # preserve PDF files under version control + mkdir -p .save + mv `git ls-files | grep pdf` .save + # clean up the rest + make cleaninner + # restore PDF files under version control + mv .save/*.pdf . + rmdir .save + +cleaninner: $(patsubst %,%/clean,$(TEXS)) + rm -f *+sw.bbx *+sw.dbx *+sw.cbx *+sw.lbx *~ *.txt sample-use-sty.backref.* sample-use-sty.nohyperref.* %/clean: if [ -f $* ]; then rubber -m pdftex --clean $* ; fi diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/english-software.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-software/english-software.lbx index d18b35ed59..a256d3ef64 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/english-software.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/english-software.lbx @@ -1,4 +1,4 @@ - \ProvidesFile{english-software.lbx}[2020/04/02 english with additions for software] + \ProvidesFile{english-software.lbx}[2022/08/01 english with additions for software] \InheritBibliographyExtras{english} \InheritBibliographyStrings{english} \NewBibliographyString{software,edited,swmodule,swpartof,swversion,swexcerpt,swexc,refart,manual} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/french-software.lbx b/macros/latex/contrib/biblatex-contrib/biblatex-software/french-software.lbx index 5a77fd3dee..9a70c7c656 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/french-software.lbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/french-software.lbx @@ -1,4 +1,4 @@ - \ProvidesFile{french-software.lbx}[2020/04/02 french with additions for software] + \ProvidesFile{french-software.lbx}[2022/08/01 french with additions for software] \InheritBibliographyExtras{french} \InheritBibliographyStrings{french} \NewBibliographyString{software,edited,swmodule,swpartof,swversion,swexcerpt,swexc,refart,manual} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex b/macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex deleted file mode 100644 index 76f1661405..0000000000 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex +++ /dev/null @@ -1,16 +0,0 @@ -\begin{release}{bltx-v1.2-4}{2022-03-03} \item Add support for displaying short SWHID \end{release} -\begin{release}{bltx-v1.2-3}{2021-08-20} \item Support backrefs. \end{release} -\begin{release}{bltx-v1.2-2}{2020-06-27} \item Fix handling of related field; use date instead of year/month in examples; add swMATH definition \end{release} -\begin{release}{bltx-v1.2-1}{2020-06-01} \item Fix mishandling of SWHIDs and HALids when hyperref is not loaded. Fix wrong origins in some SWHIDs in the examples. Improve ASCL example. \end{release} -\begin{release}{bltx-v1.2}{2020-05-29} \item Bump version to 1.2 with clean support of multiline SWHIDs \end{release} -\begin{release}{bltx-v1.1}{2020-04-29} \item Add support for the institution, organization, eprint, eprinttype and eprintclass fields Force urls output when they are the only reference available Updates to the documentation \end{release} -\begin{release}{bltx-v1.0}{2020-04-25} \item First public release \end{release} -\begin{release}{bltx-v0.9}{2020-04-25} \item Preparing for public release: Licence, Readme, update documentation, handle suggestions from the Working Group \end{release} -\begin{release}{bltx-v0.8}{2020-04-09} \item Make the style usable as an extension, and keep possibility of generating extended styles \end{release} -\begin{release}{bltx-v0.7}{2020-04-09} \item Move to diff model approach to be more portable \end{release} -\begin{release}{bltx-v0.6}{2020-04-08} \item Standardise file names, make softwarebib.tex self contained, separate out sample.tex, update Makefile, use printdate macro \end{release} -\begin{release}{bltx-v0.5}{2020-04-08} \item Added standard list format for licenses \end{release} -\begin{release}{bltx-v0.4}{2020-04-07} \item Added repository and licence field \end{release} -\begin{release}{bltx-v0.3}{2020-04-05} \item Biblatex style with first complete example \end{release} -\begin{release}{bltx-v0.2}{2020-04-02} \item Biblatex style sent for review \end{release} -\begin{release}{bltx-v0.1}{2020-04-02} \item First version of the biblatex style \end{release} diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex b/macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex new file mode 120000 index 0000000000..c38de3d1dc --- /dev/null +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/history.tex @@ -0,0 +1 @@ +Changes \ No newline at end of file diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/sample-use-sty.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-software/sample-use-sty.pdf index b4edeebf1b..7f46d76a9c 100644 Binary files a/macros/latex/contrib/biblatex-contrib/biblatex-software/sample-use-sty.pdf and b/macros/latex/contrib/biblatex-contrib/biblatex-software/sample-use-sty.pdf differ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.pdf index e032a40d8c..1cb63e3216 100644 Binary files a/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.pdf and b/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.pdf differ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.tex b/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.tex index bead6d683a..5b76ac11ed 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.tex +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/software-biblatex.tex @@ -14,7 +14,7 @@ url={https://www.ctan.org/tex-archive/macros/latex/contrib/biblatex-contrib/biblatex-software}, author={Roberto Di Cosmo}, email={roberto@dicosmo.org}, - revision={1.2-4}, + revision={1.2-5}, date={\today}} \hypersetup{% diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/software.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-software/software.bbx index f7d27f471b..ad9edc6053 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/software.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/software.bbx @@ -1,8 +1,8 @@ -\ProvidesFile{software.bbx}[2020/04/02 bibliography driver extension for software entries, Roberto Di Cosmo] +\ProvidesFile{software.bbx}[2022/08/01 bibliography driver extension for software entries, Roberto Di Cosmo] % % Reference implementation of a BibLaTeX style for the software family of bibliographic entries % -% 2020/04/02 Roberto Di Cosmo +% 2020 - 2022 Roberto Di Cosmo % \RequireBiber[3] \RequirePackage{xurl} @@ -96,6 +96,10 @@ }% {}% } + +% +% Notice the use of \edef to force expansion of the macro parameters before calling \nolinkurl +% \DeclareFieldFormat[software,softwareversion,softwaremodule,codefragment]{swhid}{% \iftoggle{bbx:swhid}% {\mkbibacro{SWHID}\addcolon\addspace% @@ -103,9 +107,9 @@ {\href{http://archive.softwareheritage.org/#1}{\(\langle\)\nolinkurl{% \iftoggle{bbx:shortswhid}{\thefield{swhidcore}}{#1}% }\(\rangle\)}}% - {\(\langle\)\nolinkurl{% + {\(\langle\){\edef\temp{\noexpand\nolinkurl{% \iftoggle{bbx:shortswhid}{\thefield{swhidcore}}{#1}% - }\(\rangle\)}% + }}\temp}\(\rangle\)}% }% {}% } diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-software/software.dbx b/macros/latex/contrib/biblatex-contrib/biblatex-software/software.dbx index f3861cfedf..477122a513 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-software/software.dbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-software/software.dbx @@ -1,4 +1,4 @@ -\ProvidesFile{software.dbx}[2020/04/02 datamodel extension for software entries, Roberto Di Cosmo] +\ProvidesFile{software.dbx}[2022/08/01 datamodel extension for software entries, Roberto Di Cosmo] \RequireBiber[3] % % the software entry type family, with their fields diff --git a/macros/latex/contrib/postnotes/CHANGELOG.md b/macros/latex/contrib/postnotes/CHANGELOG.md index c3cb3d525a..6df07b54a7 100644 --- a/macros/latex/contrib/postnotes/CHANGELOG.md +++ b/macros/latex/contrib/postnotes/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog -## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.5...HEAD) +## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.6...HEAD) + +## [v0.1.6](https://github.com/gusbrs/postnotes/compare/v0.1.5...v0.1.6) (2022-08-01) + +### Removed +- Withdraw experimental attempt to support `biblatex`'s `refsegment`s and + `refcontext`s until upstream support is available. ## [v0.1.5](https://github.com/gusbrs/postnotes/compare/v0.1.4...v0.1.5) (2022-07-07) diff --git a/macros/latex/contrib/postnotes/postnotes-code.pdf b/macros/latex/contrib/postnotes/postnotes-code.pdf index e2b82b38c8..a47aefa002 100644 Binary files a/macros/latex/contrib/postnotes/postnotes-code.pdf and b/macros/latex/contrib/postnotes/postnotes-code.pdf differ diff --git a/macros/latex/contrib/postnotes/postnotes.dtx b/macros/latex/contrib/postnotes/postnotes.dtx index f4cbdfe7a2..aa53abda40 100644 --- a/macros/latex/contrib/postnotes/postnotes.dtx +++ b/macros/latex/contrib/postnotes/postnotes.dtx @@ -147,7 +147,7 @@ % % % \begin{macrocode} -\ProvidesExplPackage {postnotes} {2022-07-07} {0.1.5} +\ProvidesExplPackage {postnotes} {2022-08-01} {0.1.6} {Endnotes for LaTeX} % \end{macrocode} % @@ -2014,18 +2014,55 @@ % Thanks \contributor{Moritz Wemheuer}: % \url{https://tex.stackexchange.com/q/597359#comment1594585_597389}. % -% We can make \pkg{biblatex}'s \texttt{refsegment}s and \texttt{refcontext}s -% work, but \texttt{refsection}s are more complicated. Currently, -% \texttt{refsection}s are only supported if \cs{printpostnotes} is called -% within each \texttt{refsection}, one cannot ``accumulate'' the notes from -% all \texttt{refsection}s and print them at the end. Well, one can, but they -% will be considered part of the current \texttt{refsection} of wherever -% \cs{printpostnotes} is placed (unless they were also cited in the original -% \texttt{refsection} out of a \cs{postnote} which, of course, is not -% something to rely on). % -% Note that support for these features of \pkg{biblatex} is -% \emph{experimental}. +% \begin{macrocode} +\AddToHook { package/biblatex/after } + { +% \end{macrocode} +% Let \pkg{biblatex} know we are in a ``notes'' context. See +% \url{https://tex.stackexchange.com/a/304464}, including comments. +% \begin{macrocode} + \AddToHook { postnotes/print/begin } [ postnotes ] + { \toggletrue { blx@footnote } } +% \end{macrocode} +% Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very +% likely desired in most cases, but may occasionally not be, so we add it to +% an individually labeled hook, which can be disabled with +% \texttt{\textbackslash{}RemoveFromHook\{begindocument/before\}[postnotes/mkbibendnote]} +% in the preamble. +% \begin{macrocode} + \AddToHook { begindocument/before } [ postnotes/mkbibendnote ] + { + \cs_set:Npn \blx@theendnote { \postnote } + \cs_set:Npn \blx@theendnotetext + { \blx@err@endnote \footnotetext } + } + } +% \end{macrocode} +% +% +% \begin{macrocode} +%<*gobble> +% \end{macrocode} +% +% I had made an initial experimental attempt to support \pkg{biblatex}'s +% \texttt{refsegment}s, \texttt{refcontext}s and \texttt{refsection}s. +% However, this attempt was rash. Even if I could get many example files to +% work for \texttt{refsegment}s and \texttt{refcontext}s, I could not do so +% for \texttt{refsection}s. More importantly, with this partial +% implementation, I could also generate documents which confused +% \pkg{biblatex} more than it helped. Things I couldn't understand well, or +% fix. All in all, I don't think this partial implementation is tenable, and +% I could not take it further. Hence, \pkg{postnotes} support for this +% feature set of \pkg{biblatex} will depend, as it should, on proper upstream +% support for ``saving'' and ``restoring'' citation ``context'' information. +% +% I have made a feature request at \pkg{biblatex} for this +% (\url{https://github.com/plk/biblatex/issues/1226}), which was +% (understandably) classified as ``long term, no promises''. +% +% +% The attempt was the following (currently ``gobbled'' from the package): % % \begin{macrocode} \AddToHook { package/biblatex/after } @@ -2052,11 +2089,6 @@ { \@@_biblatex_endrefcontext_local: \@@_biblatex_citereset_local: -% \end{macrocode} -% Let \pkg{biblatex} know we are in a ``notes'' context. See -% \url{https://tex.stackexchange.com/a/304464}, including comments. -% \begin{macrocode} - \toggletrue { blx@footnote } } % \end{macrocode} % Restore \pkg{biblatex} variables for each note. @@ -2077,19 +2109,6 @@ \blx@edef@refcontext { \l_@@_restore_tmp_tl } } % \end{macrocode} -% Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very -% likely desired in most cases, but may occasionally not be, so we add it to -% an individually labeled hook, which can be disabled with -% \texttt{\textbackslash{}RemoveFromHook\{begindocument/before\}[postnotes/mkbibendnote]} -% in the preamble. -% \begin{macrocode} - \AddToHook { begindocument/before } [ postnotes/mkbibendnote ] - { - \cs_set_nopar:Npn \blx@theendnote { \postnote } - \cs_set_nopar:Npn \blx@theendnotetext - { \blx@err@endnote \footnotetext } - } -% \end{macrocode} % Auxiliary functions. % % \begin{macro}{\@@_biblatex_endrefcontext_local:} @@ -2176,9 +2195,7 @@ % corresponding citation data written to the \file{.bcf} file. And the way % \cs{refsection} is implemented presumes each section is only ever begun once % (fair\dots{}), thus making it difficult to ``reopen'' it, or append new -% citations to it later on, when the notes are printed. Given the complexity -% of this machinery, it would be madness not to use \pkg{biblatex}'s -% infrastructure directly, and try to ``emulate'' it. The start of a +% citations to it later on, when the notes are printed. The start of a % \texttt{refsection} must be registered on the \file{.bcf} file, and this is % done by \cs{refsection} (and its auxiliary functions). However, a number of % its characteristics make things particularly difficult for the purpose at @@ -2187,14 +2204,13 @@ % environment (which receives the \meta{resources}) is used to set a local % assignment to \cs{blx@bibfiles}, based on which the relevant information is % written to the \file{.bcf} file, and when the group closes the information -% is gone. My best attempt is below (excluded from the package) but it is not -% good. It feels a wrong approach to ``go around'' the intended use of -% \cs{refsection} so much, and it can't handle at all its optional argument, -% for the reasons above. It's also incomplete, since it does not handle -% restoring \cs{l_@@_biblatex_orig_refsection_tl}. +% is gone. My best attempt is below but it is not good. It feels a wrong +% approach to ``go around'' the intended use of \cs{refsection} so much, and +% it can't handle at all its optional argument, for the reasons above. It's +% also incomplete, since it does not handle restoring +% \cs{l_@@_biblatex_orig_refsection_tl}. % % \begin{macrocode} -%<*gobble> \AddToHook { package/biblatex/after } { \tl_new:N \l_@@_biblatex_orig_refsection_tl @@ -2227,6 +2243,9 @@ } } } +% \end{macrocode} +% +% \begin{macrocode} % % \end{macrocode} % diff --git a/macros/latex/contrib/postnotes/postnotes.pdf b/macros/latex/contrib/postnotes/postnotes.pdf index 4d11b82c55..758ad81528 100644 Binary files a/macros/latex/contrib/postnotes/postnotes.pdf and b/macros/latex/contrib/postnotes/postnotes.pdf differ diff --git a/macros/latex/contrib/postnotes/postnotes.tex b/macros/latex/contrib/postnotes/postnotes.tex index e9fa40b215..1ab3172592 100644 --- a/macros/latex/contrib/postnotes/postnotes.tex +++ b/macros/latex/contrib/postnotes/postnotes.tex @@ -66,10 +66,10 @@ \usepackage{zref-clever} \zcsetup{ cap, - check, - titleref, countertype = { pnexample = example } , } +\usepackage{zref-titleref} +\usepackage{zref-check} \usepackage{listings} \lstdefinestyle{code}{ @@ -156,17 +156,13 @@ \makeatother \ExplSyntaxOff +\setlength{\marginparsep}{2\labelsep} + \NewDocumentCommand\opt{m}{\texttt{#1}} % Temporary workaround for 'l3doc' bug. % https://github.com/latex3/latex3/issues/1111 % FIXME Remove when fixed upstream. -\NewDocElement[ - macrolike = false , - printtype = \textit{opt.} , -]{Option}{optiondesc} -\NewDocElement[ - macrolike = true , -]{UserMacro}{usermacro} +\NewDocElement[macrolike=false]{Option}{option} \begin{document} @@ -331,7 +327,7 @@ receives options and values in \texttt{key=value} fashion. \bigskip{} \DescribeOption{heading} % -\DescribeUserMacro{\pnheading} % +\DescribeMacro{\pnheading} % The \opt{heading} option sets the heading for the printed notes or, more generally put, that which is printed at the beginning of \cs{printpostnotes}. Its default value depends on the document class in use. If \cs{chapter} is @@ -374,7 +370,7 @@ different than the defaults. \DescribeOption{makemark} % \DescribeOption{maketextmark} % -\DescribeUserMacro{\pnthepage} % +\DescribeMacro{\pnthepage} % The \opt{makemark} and \opt{maketextmark} options control how the mark is to be typeset, at the point \cs{postnote} is called and at the point the note's text is printed at \cs{printpostnotes}, respectively. They both can receive @@ -530,10 +526,10 @@ case, but be able to override it manually for an occasional unnumbered one. For this reason, a more semantic name was chosen for it, instead of the generic ``add to''. -\DescribeUserMacro{\pnthechapter} % -\DescribeUserMacro{\pnthesection} % -\DescribeUserMacro{\pnthechapternextnote} % -\DescribeUserMacro{\pnthesectionnextnote} % +\DescribeMacro{\pnthechapter} % +\DescribeMacro{\pnthesection} % +\DescribeMacro{\pnthechapternextnote} % +\DescribeMacro{\pnthesectionnextnote} % Just like with \cs{postnote}, the contents of \cs{postnotesection} are not expanded in place, but rather stored with ``no manipulation'' to be typeset later at \cs{printpostnotes}. For this reason, some contextual information is @@ -689,14 +685,14 @@ part of the definition: \ExplSyntaxOff \end{pnsnippet} -\DescribeUserMacro{\pnhdpagefirst} % -\DescribeUserMacro{\pnhdpagelast} % -\DescribeUserMacro{\pnhdchapfirst} % -\DescribeUserMacro{\pnhdchaplast} % -\DescribeUserMacro{\pnhdsectfirst} % -\DescribeUserMacro{\pnhdsectlast} % -\DescribeUserMacro{\pnhdnamefirst} % -\DescribeUserMacro{\pnhdnamelast} % +\DescribeMacro{\pnhdpagefirst} % +\DescribeMacro{\pnhdpagelast} % +\DescribeMacro{\pnhdchapfirst} % +\DescribeMacro{\pnhdchaplast} % +\DescribeMacro{\pnhdsectfirst} % +\DescribeMacro{\pnhdsectlast} % +\DescribeMacro{\pnhdnamefirst} % +\DescribeMacro{\pnhdnamelast} % \cs{pnhdpagefirst} and \cs{pnhdpagelast} store the value of \cs{thepage} for the first and the last notes (where these notes were originally placed) of the current page (at the point they are being printed). These variables are @@ -820,10 +816,10 @@ places, etc. \section{Localization} \zlabel{sec:localization} -\DescribeUserMacro{\pntitle} % -\DescribeUserMacro{\pnhdnotes} % -\DescribeUserMacro{\pnhdtopage} % -\DescribeUserMacro{\pnhdtopages} % +\DescribeMacro{\pntitle} % +\DescribeMacro{\pnhdnotes} % +\DescribeMacro{\pnhdtopage} % +\DescribeMacro{\pnhdtopages} % \pkg{postnotes} uses a few localized strings, stored in the variables \cs{pntitle}, \cs{pnhdnotes}, \cs{pnhdtopage}, and \cs{pnhdtopages}. The first one is used in the default value of the \opt{heading} option and diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf index 1ca04525cd..c78ed2b3b4 100644 Binary files a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf and b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf differ diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty index 65eb19125d..f027170b16 100644 --- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty +++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty @@ -1,8 +1,12 @@ % Author : Christophe Poulain % licence : Released under the LaTeX Project Public License v1.3c % or later, see http://www.latex-project.org/lppl.txtf -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfCollege}[2022/07/15 v0.99-s Aide pour utiliser LaTeX au college] +\NeedsTeXFormat{LaTeX2e}% +\def\filedate{2022/08/01}% +\let\PfCfiledate\filedate% +\def\fileversion{0.99-t}% +\let\PfCfileversion\fileversion% +\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college] \RequirePackage{verbatim} @@ -75,13 +79,12 @@ \fi \RequirePackage{xintexpr} -\RequirePackage{listofitems}%pour définir simplement la liste des données. +\RequirePackage{listofitems} \RequirePackage{datatool} \RequirePackage{multido} -\RequirePackage{xlop}%Pour effectuer les calculs nécessaires. - -\RequirePackage{xfp}%Pour les calculs trigonométriques +\RequirePackage{xlop} +\RequirePackage{xfp} \RequirePackage[most]{tcolorbox} @@ -94,14 +97,14 @@ \RequirePackage{multicol} -\RequirePackage{hhline}% Pour la cohabitation de cline avec les couleurs +\RequirePackage{hhline} \RequirePackage{stackengine} \RequirePackage[thicklines]{cancel} \RequirePackage{fontawesome5}%Pour l'environnement Twitter \RequirePackage{pifont}%Pour la commande \Autonomie -\RequirePackage{nicematrix}%pour le tableur +\RequirePackage{nicematrix}% \let\myoldmulticolumn\multicolumn \AtBeginEnvironment{tabular}{\let\multicolumn\myoldmulticolumn} @@ -147,7 +150,7 @@ \catcode`\@=12 %%% -%% Commandes "utiles" +% Commandes "utiles" %%% %encadrer avec des "sommets arrondis" \newsavebox{\logobox} @@ -174,21 +177,20 @@ }% \makeatletter% -\def\Dotfill{% +\NewDocumentCommand\Dotfill{}{% \leavevmode% -\cleaders \hb@xt@ .44em{\hss\xleaders\hrule width0.33em\hss}\hfill% +\cleaders\hb@xt@.44em{\hss\xleaders\hrule width0.33em\hss}\hfill% \kern\z@}% + +\NewDocumentCommand\PfCdotover{}{\leavevmode\cleaders\hb@xt@ .22em{\hss $\cdot$\hss}\hfill\kern\z@} + \makeatother% -\newcommand\pointilles[1][]{% - \ifx\bla#1\bla% - \Dotfill% - \else% - \hbox to#1{\Dotfill}% - \fi% +\NewDocumentCommand\pointilles{o}{% + \IfNoValueTF{#1}{\Dotfill}{\makebox[#1]{\Dotfill}}% }% -\newcommand\Lignespointilles[1]{% +\NewDocumentCommand\Lignespointilles{m}{% \xintifboolexpr{#1>1}{% \xintFor* ##1 in {\xintSeq {1}{#1}}\do{% \pointilles\par% @@ -196,6 +198,12 @@ }{}% }% +%https://tex.stackexchange.com/questions/128991/frac-or-inference-rule-with-dotted-line +\newcommand\PfCfrac[2]{% +\ooalign{$\genfrac{}{}{0pt}{0}{#1}{#2}$\cr\PfCdotover\cr} +}% +\makeatother + \newcommand\MultiCol[2]{% \setsepchar[*]{/}% \readlist*\ListeNombreCol{#1}% @@ -337,6 +345,425 @@ \day=\the\PfCrappeljour\relax% } +%%% +% Puissances 4 +%%% +\setKVdefault[ClesPQuatre]{Couleur=Gray,Largeur=2cm,Multiplication,Entier,Nombre,Exposant=false}% +\defKV[ClesPQuatre]{Addition=\setKV[ClesPQuatre]{Multiplication=false}}% +\defKV[ClesPQuatre]{Relatif=\setKV[ClesPQuatre]{Entier=false}}% +\defKV[ClesPQuatre]{Puissance=\setKV[ClesPQuatre]{Exposant}}% +\defKV[ClesPQuatre]{Autre=\setKV[ClesPQuatre]{Nombre=false}}% + +\newtoks\toklistePQuatreh% +\newtoks\toklistePQuatrev% +\def\UpdatetoksPQuatreh#1\nil{\addtotok\toklistePQuatreh{"#1",}}% +\def\UpdatetoksPQuatrev#1\nil{\addtotok\toklistePQuatrev{"#1",}}% + +\NewDocumentCommand\PQuatre{o +m}{% + \useKVdefault[ClesPQuatre]% + \toklistePQuatreh{}% + \toklistePQuatrev{}% + \setKV[ClesPQuatre]{#1}% + \ifboolKV[ClesPQuatre]{Nombre}{% + \ifboolKV[ClesPQuatre]{Exposant}{% + \def\PQuatreListe{$10^{-10}$,$10^{-9}$,$10^{-8}$,$10^{-7}$,$10^{-6}$,$10^{-5}$,$10^{-4}$,$10^{-3}$,$10^{-2}$,$10^{2}$,$10^{3}$,$10^{4}$,$10^{5}$,$10^{6}$,$10^{7}$,$10^{8}$,$10^{9}$,$10^{10}$}% + \MelangeListe{\PQuatreListe}{7}% + \readlist*\PQuatreListeH{\faa}% + \MelangeListe{\PQuatreListe}{7}% + \readlist*\PQuatreListeV{\faa}% + \foreachitem\compteur\in\PQuatreListeH{\expandafter\UpdatetoksPQuatreh\compteur\nil}% + \foreachitem\compteur\in\PQuatreListeV{\expandafter\UpdatetoksPQuatrev\compteur\nil}% + }{% + \ifboolKV[ClesPQuatre]{Entier}{% + % On choisit aléatoirement les listes de nombres de 2 à 10 en faisant deux listes : horizontale et verticale + \def\PQuatreListe{2,3,4,5,6,7,8,9,10}% + \MelangeListe{\PQuatreListe}{7}% + \readlist*\PQuatreListeH{\faa}% + \MelangeListe{\PQuatreListe}{7}% + \readlist*\PQuatreListeV{\faa}% + \foreachitem\compteur\in\PQuatreListeH{\expandafter\UpdatetoksPQuatreh\compteur\nil}% + \foreachitem\compteur\in\PQuatreListeV{\expandafter\UpdatetoksPQuatrev\compteur\nil}% + }{% + % On choisit aléatoirement les listes de nombres de -10 à -2 union 2 à 10 en faisant deux listes : horizontale et verticale + \def\PQuatreListe{$-10$,$-9$,$-8$,$-7$,$-6$,$-5$,$-4$,$-3$,$-2$,2,3,4,5,6,7,8,9,10}% + \MelangeListe{\PQuatreListe}{7}% + \readlist*\PQuatreListeH{\faa}% + \MelangeListe{\PQuatreListe}{7}% + \readlist*\PQuatreListeV{\faa}% + \foreachitem\compteur\in\PQuatreListeH{\expandafter\UpdatetoksPQuatreh\compteur\nil}% + \foreachitem\compteur\in\PQuatreListeV{\expandafter\UpdatetoksPQuatrev\compteur\nil}% + }% + }% + }{% + % on lit la liste des données fournies par l'utilisateur + \setsepchar[*]{,*/}% + \readlist\PQuatreListes{#2}% + \setsepchar{,}% + \foreachitem\compteur\in\PQuatreListes[1]{\expandafter\UpdatetoksPQuatrev\compteur\nil}% + \foreachitem\compteur\in\PQuatreListes[2]{\expandafter\UpdatetoksPQuatreh\compteur\nil}% + }% + % Une fois les listes construites, on dessine et on place les listes. + \PQuatreGrille{\the\toklistePQuatrev}{\the\toklistePQuatreh}% +}% + +\NewDocumentCommand\PQuatreGrille{m m}{% + \ifluatex% + \mplibforcehmode% + \begin{mplibcode} + Largeur=\useKV[ClesPQuatre]{Largeur}; + color fond; + fond=\useKV[ClesPQuatre]{Couleur}; + boolean Multiplication,Addition; + Multiplication=\useKV[ClesPQuatre]{Multiplication}; + pair A,B,C,D,H[],V[],M[][]; + A=(0,0); + B-A=Largeur*(7,0); + C=rotation(A,B,-90); + D-C=A-B; + fill polygone(A,B,C,D) withcolor fond; + trace polygone(A,B,C,D); + for k=0 upto 6: + for l=0 upto 6: + M[k][l]=A+0.5*(Largeur,Largeur)+k*(Largeur,0)+l*(0,Largeur); + fill cercles(M[k][l],0.4*Largeur) withcolor blanc; + trace cercles(M[k][l],0.4*Largeur); + endfor; + endfor; + labeloffset:=labeloffset*2; + if Multiplication: + label.llft(btex $\times$ etex scaled 2,A); + else: + label.llft(btex $+$ etex scaled 2,A); + fi; + labeloffset:=labeloffset/2; + vardef Vertical(text t)= + n:=0; + for p_=t: +% if n<7: + label.lft(TEX(p_) scaled 2,A+(0,n*Largeur+Largeur/2)); + n:=n+1; +% fi; + endfor; + enddef; + vardef Horizontal(text t)= + n:=0; + for p_=t: +% if n<7: + label.bot(TEX(p_) scaled 2,A+(n*Largeur+Largeur/2,0)); + n:=n+1; +% fi; + endfor; + enddef; + labeloffset:=labeloffset*4; + Vertical(#1); + Horizontal(#2); + \end{mplibcode} + \else% + \begin{mpost}[mpsettings={Largeur=\useKV[ClesPQuatre]{Largeur};color fond;fond=\useKV[ClesPQuatre]{Couleur};boolean Multiplication;Multiplication=\useKV[ClesPQuatre]{Multiplication};}] + pair A,B,C,D,H[],V[],M[][]; + A=(0,0); + B-A=Largeur*(7,0); + C=rotation(A,B,-90); + D-C=A-B; + fill polygone(A,B,C,D) withcolor fond; + for k=0 upto 7: + for l=0 upto 7: + M[k][l]=A+0.5*(Largeur,Largeur)+k*(Largeur,0)+l*(0,Largeur); + fill cercles(M[k][l],0.4*Largeur) withcolor blanc; + endfor; + endfor; + labeloffset:=labeloffset*2; + if Multiplication: + label.llft(btex $\times$ etex scaled 2,A); + else: + label.llft(btex $+$ etex scaled 2,A); + fi; + labeloffset:=labeloffset/2; + vardef Vertical(text t)= + n:=0; + for p_=t: + if n<7: + label.lft(LATEX(p_) scaled 2,A+(0,n*Largeur+Largeur/2)); + n:=n+1; + fi; + endfor; + enddef; + vardef Horizontal(text t)= + n:=0; + for p_=t: + if n<7: + label.bot(LATEX(p_) scaled 2,A+(n*Largeur+Largeur/2,0)); + n:=n+1; + fi; + endfor; + enddef; + labeloffset:=labeloffset*4; + Vertical(#1); + Horizontal(#2); + \end{mpost} + \fi% +}% + +%%% +% Billiard +%%% +\setKVdefault[ClesBilliard]{Longueur=8cm,Largeur=5cm,Solution=false,Angle=70,Depart=0.5,Vrai=false} + +\NewDocumentCommand\Billiard{o m}{% + \useKVdefault[ClesBilliard]% + \setKV[ClesBilliard]{#1}% + \ifboolKV[ClesBilliard]{Solution}{% + \MPBilliardSolution{#2}{\useKV[ClesBilliard]{Depart}}{\useKV[ClesBilliard]{Angle}}% + }{% + \MPBilliard{#2}{\useKV[ClesBilliard]{Depart}}{\useKV[ClesBilliard]{Angle}}% + }% +}% + +\def\MPBilliard#1#2#3{% + \mplibcodeinherit{disable}% + \begin{Geometrie}[CoinHD={(\useKV[ClesBilliard]{Longueur}+2cm,\useKV[ClesBilliard]{Largeur}+3cm)}] + boolean Vrai; + Vrai:=\useKV[ClesBilliard]{Vrai}; + % On définit la liste des 25 lettres alphabétiques dans laquelle on choisit autant de lettres que la longueur du mot + % On a retiré la lettre Q pour des questions d'alignements esthétiques. + vardef ChoixLettre= + save Lettre,choixalea; + string Lettre; + choixalea=floor(uniformdeviate(26)+1); + if choixalea=1: + Lettre="A"; + elseif choixalea=2: + Lettre="B"; + elseif choixalea=3: + Lettre="C"; + elseif choixalea=4: + Lettre="D"; + elseif choixalea=5: + Lettre="E"; + elseif choixalea=6: + Lettre="F"; + elseif choixalea=7: + Lettre="G"; + elseif choixalea=8: + Lettre="H"; + elseif choixalea=9: + Lettre="I"; + elseif choixalea=10: + Lettre="J"; + elseif choixalea=11: + Lettre="K"; + elseif choixalea=12: + Lettre="L"; + elseif choixalea=13: + Lettre="M"; + elseif choixalea=14: + Lettre="N"; + elseif choixalea=15: + Lettre="O"; + elseif choixalea=16: + Lettre="P"; + elseif choixalea=17: + Lettre="O"; + elseif choixalea=18: + Lettre="R"; + elseif choixalea=19: + Lettre="S"; + elseif choixalea=20: + Lettre="T"; + elseif choixalea=21: + Lettre="U"; + elseif choixalea=22: + Lettre="V"; + elseif choixalea=23: + Lettre="W"; + elseif choixalea=24: + Lettre="X"; + elseif choixalea=25: + Lettre="Y"; + elseif choixalea=26: + Lettre="Z"; + fi; + Lettre + enddef; + % On crée un Quick Sort + def QS(expr ndeb,nfin)= + begingroup + save v,m,x; + if ndeb3: + angledepart=90+angleref; + Pt[2]=demidroite(Pt[1],rotation(M1,Pt1,angledepart)) intersectionpoint (subpath(0,3) of rec); + dotlabel.lft(TEX(substring(0,1) of #1),Pt[1]); + elseif l1>2: + angledepart=180+angleref; + Pt[2]=demidroite(Pt[1],rotation(M4,Pt1,angledepart)) intersectionpoint ((subpath(3,4) of rec)--(subpath(0,2) of rec)); + dotlabel.top(TEX(substring(0,1) of #1),Pt[1]); + elseif l1>1: + angledepart=angleref-90; + Pt[2]=demidroite(Pt[1],rotation(M3,Pt1,angledepart)) intersectionpoint ((subpath(2,4) of rec)--(subpath(0,1) of rec)); + dotlabel.rt(TEX(substring(0,1) of #1),Pt[1]); + else: + angledepart=angleref; + Pt[2]=demidroite(Pt[1],rotation(M2,Pt1,angledepart)) intersectionpoint (subpath(1,4) of rec); + dotlabel.bot(TEX(substring(0,1) of #1),Pt[1]); + fi; + tourne=90; + numeric Blong; + BLong:=length #1; + % Détermination des points. + if Vrai: + for k=3 upto BLong: + Intermed:=symetrie(Pt[k-2],Pt[k-1],Pt[k-1]+M2-M3); + if (demidroite(1/1000[Pt[k-1],Intermed],Intermed) intersectiontimes rec)<>(-1,-1): + Pt[k]:=demidroite(1/1000[Pt[k-1],Intermed],Intermed) intersectionpoint rec; + else: + Intermed:=symetrie(Pt[k-2],Pt[k-1],Pt[k-1]+M1-M2); + Pt[k]:=demidroite(1/1000[Pt[k-1],Intermed],Intermed) intersectionpoint rec; + fi; + endfor; + else: + for k=3 upto BLong: + Intermed:=rotation(Pt[k-2],Pt[k-1],tourne); + if (demidroite(1/1000[Pt[k-1],Intermed],Intermed) intersectiontimes rec)<>(-1,-1): + Pt[k]:=demidroite(1/1000[Pt[k-1],Intermed],Intermed) intersectionpoint rec; + else: + Intermed:=rotation(Pt[k-2],Pt[k-1],-tourne); + Pt[k]:=demidroite(1/1000[Pt[k-1],Intermed],Intermed) intersectionpoint rec; + fi; + endfor; + fi; + % Ajout des faux points + path SPath[]; + cpt[1]:=1; + cpt[BLong+1]:=BLong+1; + l[BLong+1]:=4; + for k=2 upto BLong: + SPath[k]=rec cutafter demidroite(Co,Pt[k]); + l[k]=arclength SPath[k]; + l[k]:=arctime l[k] of rec; + cpt[k]:=k; + endfor; + QS(1,BLong+1); + for k=2 upto BLong+1: + if l[cpt[k]]-l[cpt[k-1]]>0.3: + nbfaux:=nbfaux+1; + FauxPt[nbfaux]=point(l[cpt[k-1]]+0.1) of rec; + nbfaux:=nbfaux+1; + FauxPt[nbfaux]=point(l[cpt[k]]-0.1) of rec; + fi; + endfor; + drawoptions(); + % Tracés + drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25; + % Labelisation + for k=2 upto BLong: + if (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[1])<>(-1,-1): + dotlabel.bot(TEX(substring(k-1,k) of #1),Pt[k]); + elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[2])<>(-1,-1): + dotlabel.rt(TEX(substring(k-1,k) of #1),Pt[k]); + elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[3])<>(-1,-1): + dotlabel.top(TEX(substring(k-1,k) of #1),Pt[k]); + elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[4])<>(-1,-1): + dotlabel.lft(TEX(substring(k-1,k) of #1),Pt[k]); + fi; + endfor; + for k=1 upto nbfaux: + if (demidroite(Co,FauxPt[k]) intersectiontimes cote[1])<>(-1,-1): + dotlabel.bot(TEX(ChoixLettre),FauxPt[k]); + elseif (demidroite(Co,FauxPt[k]) intersectiontimes cote[2])<>(-1,-1): + dotlabel.rt(TEX(ChoixLettre),FauxPt[k]); + elseif (demidroite(Co,FauxPt[k]) intersectiontimes cote[3])<>(-1,-1): + dotlabel.top(TEX(ChoixLettre),FauxPt[k]); + elseif (demidroite(Co,FauxPt[k]) intersectiontimes cote[4])<>(-1,-1): + dotlabel.lft(TEX(ChoixLettre),FauxPt[k]); + fi; + endfor; + picture Reponse; + Reponse=image( + trace segment((0,0),(7*BLong*mm-2mm,0)) dashed dashpattern(on5mm off2mm); + ); + trace Reponse shifted((xpart(Co),5mm)-center Reponse); + \end{Geometrie}% +}% + +\def\MPBilliardSolution#1#2#3{% + \mplibcodeinherit{enable}% + \begin{mplibcode}% + Figure(0,0,\useKV[ClesBilliard]{Longueur}+2cm,\useKV[ClesBilliard]{Largeur}+3cm); + trace rec; + % Tracés + drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25; + for k=1 upto BLong-1: + trace segment(Pt[k],Pt[k+1]); + endfor; + if Vrai=false: + for k=2 upto BLong-1: + trace codeperp(Pt[k-1],Pt[k],Pt[k+1],5); + endfor; + fi; + % Labelisation + if l1>3: + dotlabel.lft(TEX(substring(0,1) of #1),Pt[1]); + elseif l1>2: + dotlabel.top(TEX(substring(0,1) of #1),Pt[1]); + elseif l1>1: + dotlabel.rt(TEX(substring(0,1) of #1),Pt[1]); + else: + dotlabel.bot(TEX(substring(0,1) of #1),Pt[1]); + fi; + for k=2 upto BLong: + if (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[1])<>(-1,-1): + dotlabel.bot(TEX(substring(k-1,k) of #1),Pt[k]); + elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[2])<>(-1,-1): + dotlabel.rt(TEX(substring(k-1,k) of #1),Pt[k]); + elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[3])<>(-1,-1): + dotlabel.top(TEX(substring(k-1,k) of #1),Pt[k]); + elseif (demidroite(1/1000[Pt[k-1],Pt[k]],Pt[k]) intersectiontimes cote[4])<>(-1,-1): + dotlabel.lft(TEX(substring(k-1,k) of #1),Pt[k]); + fi; + endfor; + trace Reponse shifted((xpart(Co),5mm)-center Reponse); + % On affiche les lettres de la réponse. + for k=1 upto BLong: + label.top(TEX(substring(k-1,k) of #1),((xpart(Co),5mm)-center Reponse)+(k-1)*(7mm,0)+(2.5mm,0)); + endfor; + \end{mplibcode}% + \mplibcodeinherit{disable}% +}% + %%% % Représenter un entier %%% @@ -420,9 +847,6 @@ for k=0 upto 10: trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]); endfor; - %if Compact: - %trace chemin(B,B+(0,0,-0.2)) dashed evenly withpen pencircle scaled 1.25; - %fi; ); color A,B,C,D,E,F,G,H; TypePave1=image( @@ -436,9 +860,6 @@ for k=0 upto 10: trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]); endfor; - %if Compact: - %trace chemin(B,B+(0,0,-0.2)) dashed evenly withpen pencircle scaled 1.25; - %fi; ); color A,B,C,D,E,F,G,H; TypePave2=image( @@ -451,9 +872,6 @@ for k=0 upto 10: trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]); endfor; - %if Compact: - %trace chemin(B,B+(0,0,-0.2)) dashed evenly withpen pencircle scaled 1.25; - %fi; ); color A,B,C,D,E,F,G,H; TypePave3=image( @@ -553,13 +971,17 @@ RAZ=false,%Pour remettre à zéro le compteur des questions Ordre=false,%Pour mettre toutes les questions dans l'ordre des numéros Exercice=false,%Pour utiliser l'aléatoire des questions mais sans habillage particulier, autre que des \item - Perso=false,%Pour que utiliser un choix personnel des questions + Perso=false,%Pour utiliser un choix personnel des questions Lecture=false,%Pour différencier avec une lecture automatisée sur les numéros de fichiers Maitre=false,%Pour indiquer qu'on prend en compte ou pas les sous-dossiers Nom=false,%Pour afficher le nom des fichiers utilisés. - Theme=false,%Pour afficher le theme travaillé dans les fichiers utilisés. + Theme=false,%Pour afficher le theme travaillé dans les fichiers utilisés (à retravailler). AMC=false,% - Multi=false% + Multi=false,% + CAN=false,%Pour compléter la case réponse. + CoefQ=0.4,%Coefficient multiplication de \linewidth pour la colonne question + CoefR=0.35,%Coefficient multiplication de \linewidth pour la colonne réponse + CoefJ=0.15,%Coefficient multiplication de \linewidth pour la colonne jury }% \defKV[ClesCN]{Liste=\setKV[ClesCN]{Perso=true}\setKV[ClesCN]{Lecture}}% \defKV[ClesCN]{Dossier=\setKV[ClesCN]{Lecture}}% @@ -568,11 +990,11 @@ \readlist*\ListeMotsCAN{La moitié de /2,Le double de /1,Le triple de /1, Le tiers de /3,Le nombre dix fois plus grand que /1,Le nombre cent fois plus grand que /1,Le nombre mille fois plus grand que /1,Le nombre dix fois plus petit que /10,Le nombre cent fois plus petit que /100,Le nombre mille fois plus petit que /1000}% \readlist*\ListeMulAstucieuxCAN{50/2,25/4,20/5}% \readlist*\ListeLieuxObjetsCAN{boulangerie/pains au chocolat/un pain au chocolat,boulangerie/cookies/un cookie,boulangerie/brioches/une brioche,piscine/entrées/une entrée,boucherie/saucisses/une saucisse,boucherie/cuisses de poulet/une cuisse de poulet}% -\readlist*\ListeNomsCAN{Aude/Elle,Bernard/Il,Céline/Elle,Daniel/Il,Elise/Elle,Fabien/Il,Gérard/Il,Hélène/Elle,Ilies/Il,Jasmine/Elle,Kylian/Il,Laurent/Il,Mathilde/Elle,Nina/Elle,Octave/Il,Philippe/Il,Joachim/Il,Thérèse/Elle,Nawel/Elle,Alexandre/Il,Maxence/Il,Sophie/Elle,Christophe/Il,Myriam/Elle}% +\readlist*\ListeNomsCAN{Aude/Elle/d'Aude,Bernard/Il/de Bernard,Céline/Elle/de Céline,Daniel/Il/de Daniel,\'Elise/Elle/d'\'Elise,Fabien/Il/de Fabien,Gérard/Il/de Gérard,Hélène/Elle/d'Hélène,Ilies/Il/d'Ilies,Jasmine/Elle/de Jasmine,Kylian/Il/de Kylian,Laurent/Il/de Laurent,Mathilde/Elle/de Mathilde,Nina/Elle/de Nina,Octave/Il/d'Octave,Philippe/Il/de Philippe,Joachim/Il/de Joachim,Thérèse/Elle/de Thérèse,Nawel/Elle/de Nawel,Alexandre/Il/d'Alexandre,Maxence/Il/de Maxence,Sophie/Elle/de Sophie,Christophe/Il/de Christophe,Myriam/Elle/de Myriam,Nathalie/Elle/de Nathalie}% \readlist*\ListeComposantStatCAN{voitures/un garage/Cross-over/Utilitaires/Berlines,fruits/une corbeille/Pommes/Oranges/Bananes,vêtements/une armoire/Pulls/T-shirts/Chemises,couverts/un tiroir/Fourchettes/Couteaux/Cuillères}% \readlist*\ListeObjetsSymbolesCAN{fleurs/96,ciseaux/36,crayons/47,enveloppes/41}%uniquement avec pifont \setsepchar{,}% -\readlist*\ListeObjetsCAN{bonbons,billes,jouets,fruits,biscuits,gâteaux,pommes,poires} +\readlist*\ListeObjetsCAN{bonbons,billes,jouets,fruits,biscuits,gâteaux,pommes,poires,pains au chocolat,cookies,croissants,muffins,brioches,saucisses,cuisses de poulet}% \readlist*\ListePetitsObjetsCAN{bonbons,billes,biscuits,gommes,clous,vis} \readlist*\ListeFruitsCAN{pommes,poires,abricots,cerises,fraises,framboises,noix,pêches,nectarines,myrtilles} \readlist*\ListeSommetsCAN{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} @@ -586,6 +1008,15 @@ \readlist*\PetitsObjetsMelanges{\faa}% }% +\newcommand\ExtraitObjets[1]{% + \xdef\CANSGFoo{}% + \foreachitem\compteur\in\ListeObjetsCAN{% + \xdef\CANSGFoo{\CANSGFoo \ListeObjetsCAN[\compteurcnt],}% + }% + \MelangeListe{\CANSGFoo}{#1}% + \readlist*\ObjetsMelanges{\faa}% +}% + \newcommand\ExtraitSymboles[1]{% \xdef\CANSGFoo{}% \foreachitem\compteur\in\ListeObjetsSymbolesCAN{% @@ -726,9 +1157,13 @@ \makeatother \newcommand\CNTheme[1]{}% +\newcommand\CNReponse{}% + +\newlength{\PfCLargeurQuestion}% +\newlength{\PfCLargeurReponse}% +\newlength{\PfCLargeurJury}% \NewDocumentCommand\CourseNombre{o m}{% - \setKV[ClesMathAlea]{NbQ=1}% \useKVdefault[ClesCN]% \setKV[ClesCN]{#1}% \ifboolKV[ClesCN]{Theme}{\renewcommand\CNTheme[1]{{\ttfamily Thème : ##1}\par}}{}% @@ -768,6 +1203,9 @@ \xdef\CNfooListe{\CNfooListe ##1,}% }% % % \par OK -> normalement, on a la liste du nombre de questions : \CNfooListe + % On règle maintenant les dimensions nécessaires. + % \ifboolKV[ClesCN]{CAN}{ + \setlength{\PfCLargeurQuestion}{\useKV[ClesCN]{CoefQ}\linewidth}\setlength{\PfCLargeurReponse}{\useKV[ClesCN]{CoefR}\linewidth}\setlength{\PfCLargeurJury}{\useKV[ClesCN]{CoefJ}\linewidth}% % % On affiche les questions : \ifboolKV[ClesCN]{Ordre}{% % % soit dans un exercice @@ -778,13 +1216,13 @@ }% }{% Soit toutes les questions au format course \renewcommand{\arraystretch}{\useKV[ClesCN]{Stretch}}% - \begin{longtable}{|c|p{0.7\linewidth}|p{0.1\linewidth}|p{0.05\linewidth}|}% + \begin{longtable}{|c|p{\PfCLargeurQuestion}|>{\centering\arraybackslash}p{\PfCLargeurReponse}|p{\PfCLargeurJury}|}% \hhline{~---}% \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\'Enoncé&\cellcolor{gray!15}\centering Réponse&\cellcolor{gray!15}\centering\arraybackslash Jury\\% \hline% \endhead% \xintFor* ##1 in {\xintSeq{1}{\ListeFichierslen}}\do{% - \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\input{\ListeFichiers[##1]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&&\\% + \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\xdef\CNReponse{}\input{\ListeFichiers[##1]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&\ifboolKV[ClesCN]{CAN}{\CNReponse}{}&\\% \hline% }% \end{longtable}% @@ -793,7 +1231,7 @@ }{% % On prévient l'utilisateur si le nb de questions est inférieur à NbQ \xintifboolexpr{\ListeFichierslen<\useKV[ClesCN]{NbQ}}{% - \faExclamationCircle~Le nombre maximal de questions est inférieur au nombre de questions à afficher. Modifier la clé {\ttfamily NbQ} ou ajouter des questions dans le(s) répertoire(s).% + \faExclamationCircle~Le nombre maximal de questions disponibles est inférieur au nombre de questions à afficher. Modifier la clé {\ttfamily NbQ} ou ajouter des questions dans le(s) répertoire(s).% }{%%On choisit NbQ questions parmi la liste de fichiers \MelangeListe{\CNfooListe}{\useKV[ClesCN]{NbQ}}% \setsepchar{,}\ignoreemptyitems% @@ -804,13 +1242,13 @@ }% }{% On les affiche \renewcommand{\arraystretch}{\useKV[ClesCN]{Stretch}}% - \begin{longtable}{|c|p{0.7\linewidth}|p{0.1\linewidth}|p{0.05\linewidth}|}% + \begin{longtable}{|c|p{\PfCLargeurQuestion}|>{\centering\arraybackslash}p{\PfCLargeurReponse}|p{\PfCLargeurJury}|}% \hhline{~---}% \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\'Enoncé&\cellcolor{gray!15}\centering Réponse&\cellcolor{gray!15}\centering\arraybackslash Jury\\% \hline% \endhead% \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesCN]{NbQ}}}\do{% - \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\xdef\Numerodelaquestionaposer{\ListeCNQuestions[##1]}\input{\ListeFichiers[\Numerodelaquestionaposer]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&&\\ + \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\xdef\CNReponse{}\xdef\Numerodelaquestionaposer{\ListeCNQuestions[##1]}\input{\ListeFichiers[\Numerodelaquestionaposer]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&\ifboolKV[ClesCN]{CAN}{\CNReponse}{}&\\ \hline }% \end{longtable}% @@ -1122,8 +1560,7 @@ %%% % Smiley -%%% -%%https://tex.stackexchange.com/questions/3695/smileys-in-latex/227226 +%%% https://tex.stackexchange.com/questions/3695/smileys-in-latex/227226 \tikzset{face/.style={shape=circle,minimum size=4ex,shading=radial,outer sep=0pt, inner color=white!50!yellow,outer color= yellow!70!orange}} \newcommand\emoticon[2][]{% @@ -2380,7 +2817,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \end{center} } -\newcommand\BonSortie[5][]{% +\NewDocumentCommand\BonSortie{o m m m m}{% \clearpage% \useKVdefault[ClesSortie]% \setKV[ClesSortie]{#1}% @@ -2545,22 +2982,138 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, %%% % Pyramide de calculs %%% +\newcommand\DessinePyramideNombreMul[1]{% + \ifluatex + \mplibforcehmode + \begin{mplibcode} + pair A[],B[],O; + cote:=\useKV[ClesPyramide]{Cote}; + boolean Aide,Produit,Solution,Vide; + Aide:=\useKV[ClesPyramide]{Aide}; + Vide:=\useKV[ClesPyramide]{Vide}; + Produit:=\useKV[ClesPyramide]{Produit}; + Solution:=\useKV[ClesPyramide]{Solution}; + A1=u*(1,1); + A2-A1=cote*(1,0); + A3=rotation(A2,A1,60); + A4=A1; + B1=iso(A1,A2); + B2=iso(A2,A3); + B3=iso(A3,A1); + O=iso(A1,A2,A3); + path BoiteRec; + BoiteRec=((-0.4,-0.5)--(0.4,-0.5){dir0}..{dir90}(0.5,-0.4)--(0.5,0.4){dir90}..{dir180}(0.4,0.5)--(-0.4,0.5){dir180}..{dir-90}(-0.5,0.4)--(-0.5,-0.4){dir-90}..cycle) scaled 1u; + % On trace et on affiche...éventuellement :) + trace polygone(A1,A2,A3); + for k=1 upto 3: + trace segment(O,B[k]) dashed withdots scaled 0.25; + draw BoiteRec shifted (1.75[O,B[k]]-center BoiteRec) dashed evenly scaled 0.5; + endfor; + if Vide: + else: + % On récupère les valeurs pour déterminer les produits + k=0; + for p_=#1: + k:=k+1; + Facteur[k]=p_; + endfor; + Produit[1]=Facteur[1] * Facteur[2]; + Produit[2]=Facteur[2] * Facteur[3]; + Produit[3]=Facteur[3] * Facteur[1]; + for k=1 upto 3: + if Produit or Solution: + label(TEX("\num{"&decimal(Produit[k])&"}"),(1.75[O,B[k]]-center BoiteRec)); + fi; + if Produit: + else: + label(TEX("\num{"&decimal(Facteur[k])&"}"),(0.5[O,A[k]]-center BoiteRec)); + fi; + endfor; + fi; + if Aide: + for k=1 upto 3: + drawarrow (0.5[O,A[k]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (1.75[O,B[k]]-center BoiteRec) dashed evenly scaled 0.5; + drawarrow (0.5[O,A[k+1]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (1.75[O,B[k]]-center BoiteRec) dashed evenly scaled 0.5; + endfor; + fi; + \end{mplibcode} + \else + \begin{mpost}[mpsettings={cote:=\useKV[ClesPyramide]{Cote}; + boolean Aide,Produit,Solution,Vide; + Aide:=\useKV[ClesPyramide]{Aide}; + Vide:=\useKV[ClesPyramide]{Vide}; + Produit:=\useKV[ClesPyramide]{Produit}; + Solution:=\useKV[ClesPyramide]{Solution};}] + pair A[],B[],O; + A1=u*(1,1); + A2-A1=cote*(1,0); + A3=rotation(A2,A1,60); + A4=A1; + B1=iso(A1,A2); + B2=iso(A2,A3); + B3=iso(A3,A1); + O=iso(A1,A2,A3); + path BoiteRec; + BoiteRec=((-0.4,-0.5)--(0.4,-0.5){dir0}..{dir90}(0.5,-0.4)--(0.5,0.4){dir90}..{dir180}(0.4,0.5)--(-0.4,0.5){dir180}..{dir-90}(-0.5,0.4)--(-0.5,-0.4){dir-90}..cycle) scaled 1u; + % On trace et on affiche...éventuellement :) + trace polygone(A1,A2,A3); + for k=1 upto 3: + trace segment(O,B[k]) dashed withdots scaled 0.25; + draw BoiteRec shifted (1.75[O,B[k]]-center BoiteRec) dashed evenly scaled 0.5; + endfor; + if Vide: + else: + % On récupère les valeurs pour déterminer les produits + k=0; + for p_=#1: + k:=k+1; + Facteur[k]=p_; + endfor; + Produit[1]=Facteur[1] * Facteur[2]; + Produit[2]=Facteur[2] * Facteur[3]; + Produit[3]=Facteur[3] * Facteur[1]; + for k=1 upto 3: + if Produit or Solution: + label(TEX("\num{"&decimal(Produit[k])&"}"),(1.75[O,B[k]]-center BoiteRec)); + fi; + if Produit: + else: + label(TEX("\num{"&decimal(Facteur[k])&"}"),(0.5[O,A[k]]-center BoiteRec)); + fi; + endfor; + fi; + if Aide: + for k=1 upto 3: + drawarrow (0.5[O,A[k]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (1.75[O,B[k]]-center BoiteRec) dashed evenly scaled 0.5; + drawarrow (0.5[O,A[k+1]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (1.75[O,B[k]]-center BoiteRec) dashed evenly scaled 0.5; + endfor; + fi; + \end{mpost} + \fi +} + \newcommand\DessinePyramideNombre[1]{% \ifluatex \mplibforcehmode \begin{mplibcode} pair A[][],B[]; + path Case[]; + color CaseCouleur; nbetages:=\useKV[ClesPyramide]{Etages}; largeur:=\useKV[ClesPyramide]{Largeur}; hauteur:=\useKV[ClesPyramide]{Hauteur}; + CaseCouleur:=\useKV[ClesPyramide]{Couleur}; + boolean Double; + Double=\useKV[ClesPyramide]{Double}; Nbeb:=0;%Pour associer les textes avec les points. Plus facile :) - if \useKV[ClesPyramide]{Double}: + if Double: for k=nbetages downto 1: for l=0 upto (k-1): Nbeb:=Nbeb+1; A[k][l]=(0,0)+(nbetages-k)*(largeur/2,0)+(l*largeur,(nbetages-k)*hauteur); B[Nbeb]=A[k][l]; - trace ((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5*(largeur,hauteur)); + Case[Nbeb]=((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5*(largeur,hauteur)); + trace Case[Nbeb]; endfor; endfor; for k=nbetages-1 downto 1: @@ -2568,7 +3121,8 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, Nbeb:=Nbeb+1; A[-k][l]=(0,0)+(nbetages-k)*(largeur/2,0)+(l*largeur,-(nbetages-k)*hauteur); B[Nbeb]=A[-k][l]; - trace ((unitsquare xscaled largeur) yscaled hauteur) shifted (A[-k][l]-0.5*(largeur,hauteur)); + Case[Nbeb]=((unitsquare xscaled largeur) yscaled hauteur) shifted (A[-k][l]-0.5*(largeur,hauteur)); + trace Case[Nbeb]; endfor; endfor; else: @@ -2582,7 +3136,8 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, Nbeb:=Nbeb+1; A[k][l]=(0,0)+(nbetages-k)*(largeur/2,0)+(l*largeur,change*(nbetages-k)*hauteur); B[Nbeb]=A[k][l]; - trace ((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5*(largeur,hauteur)); + Case[Nbeb]=((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5*(largeur,hauteur)); + trace Case[Nbeb]; endfor; endfor; fi; @@ -2591,15 +3146,41 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, Nbeb:=0; for p_=#1: Nbeb:=Nbeb+1; - label(TEX(""&p_&""),B[Nbeb]); - endfor; + if (substring(0,1) of p_)="*": + fill Case[Nbeb] withcolor CaseCouleur; + trace Case[Nbeb]; + label(TEX(substring(1,length p_) of p_),B[Nbeb]); + else: + label(TEX(p_),B[Nbeb]); fi; + endfor; \end{mplibcode} \else - \begin{mpost}[mpsettings={nbetages:=\useKV[ClesPyramide]{Etages};largeur:=\useKV[ClesPyramide]{Largeur};hauteur:=\useKV[ClesPyramide]{Hauteur};boolean Vide;Vide=\useKV[ClesPyramide]{Vide};boolean Inverse;Inverse=\useKV[ClesPyramide]{Inverse};}] + \begin{mpost}[mpsettings={nbetages:=\useKV[ClesPyramide]{Etages};largeur:=\useKV[ClesPyramide]{Largeur};hauteur:=\useKV[ClesPyramide]{Hauteur};boolean Vide;Vide=\useKV[ClesPyramide]{Vide};boolean Inverse;Inverse=\useKV[ClesPyramide]{Inverse};color CaseCouleur; CaseCouleur:=\useKV[ClesPyramide]{Couleur};boolean Double;Double=\useKV[ClesPyramide]{Double};}] pair A[][],B[]; + path Case[]; Nbeb:=0; - if Inverse: + if Double: + for k=nbetages downto 1: + for l=0 upto (k-1): + Nbeb:=Nbeb+1; + A[k][l]=(0,0)+(nbetages-k)*(largeur/2,0)+(l*largeur,(nbetages-k)*hauteur); + B[Nbeb]=A[k][l]; + Case[Nbeb]=((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5*(largeur,hauteur)); + trace Case[Nbeb]; + endfor; + endfor; + for k=nbetages-1 downto 1: + for l=0 upto (k-1): + Nbeb:=Nbeb+1; + A[-k][l]=(0,0)+(nbetages-k)*(largeur/2,0)+(l*largeur,-(nbetages-k)*hauteur); + B[Nbeb]=A[-k][l]; + Case[Nbeb]=((unitsquare xscaled largeur) yscaled hauteur) shifted (A[-k][l]-0.5*(largeur,hauteur)); + trace Case[Nbeb]; + endfor; + endfor; + else: + if \useKV[ClesPyramide]{Inverse}: change:=-1; else: change=1; @@ -2609,46 +3190,65 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, Nbeb:=Nbeb+1; A[k][l]=(0,0)+(nbetages-k)*(largeur/2,0)+(l*largeur,change*(nbetages-k)*hauteur); B[Nbeb]=A[k][l]; - trace ((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5(largeur,hauteur)); + Case[Nbeb]=((unitsquare xscaled largeur) yscaled hauteur) shifted (A[k][l]-0.5*(largeur,hauteur)); + trace Case[Nbeb]; endfor; endfor; - Nbeb:=0; - if Vide: + fi; + if \useKV[ClesPyramide]{Vide}: else: + Nbeb:=0; for p_=#1: Nbeb:=Nbeb+1; - label(LATEX(""&p_&""),B[Nbeb]); - endfor; + if (substring(0,1) of p_)="*": + fill Case[Nbeb] withcolor CaseCouleur; + trace Case[Nbeb]; + label(LATEX(substring(1,length p_) of p_),B[Nbeb]); + else: + label(LATEX(p_),B[Nbeb]); fi; + endfor; \end{mpost} \fi } -\setKVdefault[ClesPyramide]{Etages=5,Largeur=2cm,Hauteur=1cm,Vide=false,Inverse=false,Double=false}% +\setKVdefault[ClesPyramide]{Etages=5,Largeur=2cm,Hauteur=1cm,Vide=false,Inverse=false,Double=false,Couleur=Crimson,Multiplication=false,Produit=false,Solution=false,Aide=false,Cote=4cm}% \newtoks\toklistecaseP% \def\UpdatetoksPyramide#1\nil{\addtotok\toklistecaseP{"#1",}}% +\def\UpdatetoksPyramideMul#1\nil{\addtotok\toklistecaseP{#1,}}% -\newcommand\PyramideNombre[2][]{% +\DeclareDocumentCommand\PyramideNombre{o m}{% \useKVdefault[ClesPyramide]% \setKV[ClesPyramide]{#1}% - \ifx\bla#2\bla% - \setKV[ClesPyramide]{Vide=true}% - \DessinePyramideNombre{\the\toklistecaseP}% - \else% - \setsepchar{,}% - \readlist*\ListePyramide{#2}% - \ifboolKV[ClesPyramide]{Double}{% - \def\CalculNombreComposants{\fpeval{\useKV[ClesPyramide]{Etages}*\useKV[ClesPyramide]{Etages}}}% + \ifboolKV[ClesPyramide]{Multiplication}{% + \ifx\bla#2\bla% + \setKV[ClesPyramide]{Vide=true}% + \DessinePyramideNombreMul{\the\toklistecaseP}% + \else + \setsepchar{,}% + \readlist*\ListePyramide{#2}% + \DessinePyramideNombreMul{\ListePyramide[1],\ListePyramide[2],\ListePyramide[3]}% + \fi }{% - \def\CalculNombreComposants{\fpeval{\useKV[ClesPyramide]{Etages}*(\useKV[ClesPyramide]{Etages}+1)/2}}% - }% - \xintifboolexpr{\ListePyramidelen==\CalculNombreComposants}{% - \toklistecaseP{}% - \foreachitem\compteur\in\ListePyramide{\expandafter\UpdatetoksPyramide\compteur\nil}% + \ifx\bla#2\bla% + \setKV[ClesPyramide]{Vide=true}% \DessinePyramideNombre{\the\toklistecaseP}% - }{Le nombre d'éléments dans la liste des propositions n'est pas compatible avec le nombre d'étages choisi.}% - \fi% + \else% + \setsepchar{,}% + \readlist*\ListePyramide{#2}% + \ifboolKV[ClesPyramide]{Double}{% + \def\CalculNombreComposants{\fpeval{\useKV[ClesPyramide]{Etages}*\useKV[ClesPyramide]{Etages}}}% + }{% + \def\CalculNombreComposants{\fpeval{\useKV[ClesPyramide]{Etages}*(\useKV[ClesPyramide]{Etages}+1)/2}}% + }% + \xintifboolexpr{\ListePyramidelen==\CalculNombreComposants}{% + \toklistecaseP{}% + \foreachitem\compteur\in\ListePyramide{\expandafter\UpdatetoksPyramide\compteur\nil}% + \DessinePyramideNombre{\the\toklistecaseP}% + }{Le nombre d'éléments dans la liste des propositions n'est pas compatible avec le nombre d'étages choisi.}% + \fi% + }% }% %%% @@ -3475,7 +4075,6 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \newcommand\TraceLabyNombre[6]{% \mplibforcehmode% - \mplibcodeinherit{enable}%\xintifboolexpr{#6==false}{\mplibcodeinherit{enable}}{} \begin{mplibcode} input PfCLabyNombre; @@ -3558,6 +4157,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \newcommand\TraceSolution[6]{% \mplibforcehmode% + \mplibcodeinherit{enable}%\xintifboolexpr{#6==false}{\mplibcodeinherit{enable}}{} \begin{mplibcode} picture CorpsSolution; CorpsSolution=image( @@ -6430,7 +7030,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \MPFractionTriangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Parts}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}% }{% \MPFractionTriangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Parts}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}% - } + }% }{% \ifboolKV[ClesFraction]{Regulier}{% \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}% @@ -6438,7 +7038,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \MPFractionRegulierH{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}% }{% \MPFractionRegulier{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}% - } + }% }{% \ifboolKV[ClesFraction]{Segment}{% \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}% @@ -6446,15 +7046,15 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \MPFractionSegmentH{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}% }{% \MPFractionSegment{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}% - } - }{ + }% + }{% \ifboolKV[ClesFraction]{Rectangle}{%rectangle \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}% \ifboolKV[ClesFraction]{Hachures}{% \MPFractionRectangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}{\useKV[ClesFraction]{Epaisseur}}% }{% \MPFractionRectangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}% - } + }% }{%disque \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}% \ifboolKV[ClesFraction]{Hachures}{% @@ -6534,139 +7134,143 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \newlength{\LargeurQCM}% \newcounter{QuestionQCM}% \newcounter{TitreQCM}% -\newcommand\QCM[2][]{% - \useKVdefault[ClesQCM]% - \setKV[ClesQCM]{#1}% - \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}% - \setcounter{TitreQCM}{0} - \setsepchar[*]{,*&}\ignoreemptyitems% - \readlist*\ListeQCM{#2}% - \ifboolKV[ClesQCM]{Multiple}{% - \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% - \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% - \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% - \xdef\ListeNom{\useKV[ClesQCM]{Noms}}% - \setsepchar[*]{/}% - \readlist*\ListeNomsMul{\ListeNom}% - \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% - \cline{2-\NBcases}% - \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ListeNomsMul[##2]}% - \\ - \hline% - \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% - \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}% - }\\ - }% - \hline% - \end{tabular}% - }{% - \ifboolKV[ClesQCM]{VF}{% - \setKV[ClesQCM]{Reponses=2} +\ifdef{\QCM}{% + \PackageWarning{ProfCollege}{La commande \noexpand\QCM étant définie par la classe du document, ProfCollege modifie sa commande \noexpand\QCM en \noexpand\QCMPfC.}% + \newcommand\QCMPfC[2][]{% + \useKVdefault[ClesQCM]% + \setKV[ClesQCM]{#1}% + \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}% + \setcounter{TitreQCM}{0} + \setsepchar[*]{§*&}\ignoreemptyitems% + \readlist*\ListeQCM{#2}% + \ifboolKV[ClesQCM]{Multiple}{% \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% + \xdef\ListeNom{\useKV[ClesQCM]{Noms}}% + \setsepchar[*]{/}% + \readlist*\ListeNomsMul{\ListeNom}% \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% \cline{2-\NBcases}% - \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\ - \hline% - \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% - \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}% - }\\ - }% - \hline% - \end{tabular} - }{% - \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% - \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% - \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% - \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% - \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}% \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}% + &\ListeNomsMul[##2]}% \\ - }{} \hline% \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2==\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]% + &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}% }\\ }% \hline% \end{tabular}% + }{% + \ifboolKV[ClesQCM]{VF}{% + \setKV[ClesQCM]{Reponses=2} + \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% + \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% + \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% + \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% + \cline{2-\NBcases}% + \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\ + \hline% + \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% + \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% + &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}% + }\\ + }% + \hline% + \end{tabular} + }{% + \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% + \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% + \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% + \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% + \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}% + \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% + &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}% + \\ + }{} + \hline% + \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% + \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% + &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2==\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]% + }\\ + }% + \hline% + \end{tabular}% + }% }% + \renewcommand{\arraystretch}{1}% }% -} - -\newcommand\QCMPfC[2][]{% - \useKVdefault[ClesQCM]% - \setKV[ClesQCM]{#1}% - \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}% - \setcounter{TitreQCM}{0} - \setsepchar[*]{§*&}\ignoreemptyitems% - \readlist*\ListeQCM{#2}% - \ifboolKV[ClesQCM]{Multiple}{% - \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% - \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% - \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% - \xdef\ListeNom{\useKV[ClesQCM]{Noms}}% - \setsepchar[*]{/}% - \readlist*\ListeNomsMul{\ListeNom}% - \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% - \cline{2-\NBcases}% - \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ListeNomsMul[##2]}% - \\ - \hline% - \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% - \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}% - }\\ - }% - \hline% - \end{tabular}% - }{% - \ifboolKV[ClesQCM]{VF}{% - \setKV[ClesQCM]{Reponses=2} +}{% + \newcommand\QCM[2][]{% + \useKVdefault[ClesQCM]% + \setKV[ClesQCM]{#1}% + \setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}% + \setcounter{TitreQCM}{0} + \setsepchar[*]{,*&}\ignoreemptyitems% + \readlist*\ListeQCM{#2}% + \ifboolKV[ClesQCM]{Multiple}{% \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% + \xdef\ListeNom{\useKV[ClesQCM]{Noms}}% + \setsepchar[*]{/}% + \readlist*\ListeNomsMul{\ListeNom}% \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% \cline{2-\NBcases}% - \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\ - \hline% - \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% - \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}% - }\\ - }% - \hline% - \end{tabular} - }{% - \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% - \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% - \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% - \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% - \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}% \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}% + &\ListeNomsMul[##2]}% \\ - }{} \hline% \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% - &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2==\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]% + &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]==1}{$\boxtimes$}{$\square$}}{$\square$}% }\\ }% \hline% \end{tabular}% + }{% + \ifboolKV[ClesQCM]{VF}{% + \setKV[ClesQCM]{Reponses=2} + \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% + \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% + \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% + \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% + \cline{2-\NBcases}% + \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\ + \hline% + \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% + \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% + &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2==\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}% + }\\ + }% + \hline% + \end{tabular} + }{% + \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}% + \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}% + \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}% + \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}% + \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}% + \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% + &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}% + \\ + }{} + \hline% + \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{% + \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{% + &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2==\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]% + }\\ + }% + \hline% + \end{tabular}% + }% }% }% - \renewcommand{\arraystretch}{1}% } + %%% % Somme des angles %%% @@ -11317,7 +11921,7 @@ Tableau=false,Stretch=1,Frequence=false,EffectifTotal=false,% Etendue=false,Moyenne=false,SET=false,ValeurExacte=false,Mediane=false,QuartileUn=false,QuartileTrois=false,Total=false,Concret=false,% Unite={},Largeur=1cm,Precision=2,PrecisionF=0,Donnee=Valeurs,Effectif=Effectif,Grille=false,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,TableauVide=false,ECC=false,Coupure=10,CouleurTab=gray!15,Graphique=false,Batons=true,% % Pour les diags batons -EpaisseurBatons=1,ListeCouleursB={black},Lecture=false,LectureFine=false,AideLecture=false,Reponses=false,DonneesSup=false,AbscisseRotation=false,Tiret=false,AngleRotationAbscisse=0,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,% +EpaisseurBatons=1,ListeCouleursB={black},Lecture=false,LectureFine=false,AideLecture=false,Reponses=false,DonneesSup=false,AbscisseRotation=false,Tiret=false,AngleRotationAbscisse=0,Pasx=1,Pasy=1,Unitex=0.5,Unitey=0.5,Depart=0,% % Pour les diags circulaires Rayon=3cm,AffichageAngle=false,AffichageDonnee=false,ListeCouleurs={white},Hachures=false,LectureInverse=false,EcartHachures=0.25,EpaisseurHachures=1,Legende,LegendeVide=false,% %Pour les représentations @@ -11772,7 +12376,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \fi% }% -% la construction du graphique en bâtons pour quantitatif +% Construction du graphique en bâtons \newcommand\MPStatNew[2]{% \ifluatex \mplibforcehmode @@ -11800,6 +12404,8 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis Qualitatif=\useKV[ClesStat]{Qualitatif}; boolean Tiret; Tiret=\useKV[ClesStat]{Tiret}; + %% ajout + Depart=\useKV[ClesStat]{Depart}; % on r\'ecup\`ere les couleurs color Col[]; n:=0; @@ -11830,6 +12436,23 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis fi; endfor; enddef; + vardef tutu(text t)=%points qualitatif + n:=0; + for p_=t: + if numeric p_: + P[n]=((n)*unitex,unitey*(p_-Depart)); + B[n]=(0,unitey*(p_-Depart)); + if p_>maxy: + maxy:=p_; + fi; + else: + n:=n+1; + A[n]=unitex*(n,0); + fi; + endfor; + maxy:=maxy-Depart; + maxx:=n; + enddef; vardef tata(text t)=%affichage quantitatif l=0; for p_=t: @@ -11854,22 +12477,6 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis fi; endfor; enddef; - vardef tutu(text t)=%points qualitatif - n:=0; - for p_=t: - if numeric p_: - P[n]=((n)*unitex,unitey*p_); - B[n]=(0,unitey*p_); - if p_>maxy: - maxy:=p_; - fi; - else: - n:=n+1; - A[n]=unitex*(n,0); - fi; - endfor; - maxx:=n; - enddef; vardef titi(text t)=%affichage qualitatif l:=0; for p_=t: @@ -11908,7 +12515,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis boolean Grille; Grille:=\useKV[ClesStat]{Grille}; Pasx:=\useKV[ClesStat]{Pasx}; - Pasy:=\useKV[ClesStat]{Pasy}; + Pasy:=\useKV[ClesStat]{Pasy}; if Grille: drawoptions(withcolor 0.75white); for k=0 step Pasx until ((maxx+1)): @@ -11929,9 +12536,9 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis for k=0 step Pasy until ((maxy+1*Pasy)): if Tiret: trace (1pt,k*unitey)--(-1pt,k*unitey); - label.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + label.lft(TEX("\num{"&decimal(k+Depart)&"}"),(0,k*unitey)); else: - dotlabel.lft(TEX("\num{"&decimal(k)&"}"),(0,k*unitey)); + dotlabel.lft(TEX("\num{"&decimal(k+Depart)&"}"),(0,k*unitey)); fi; endfor; fi; @@ -12519,7 +13126,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \DTLgnewdb{mtdbEE}% \DTLgnewdb{mtdbEEqual}% -% +% \newcommand\Stat[2][]{% \useKVdefault[ClesStat]% \setKV[ClesStat]{#1}% @@ -12543,437 +13150,456 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \setKV[ClesStat]{Qualitatif}% }{% \ifboolKV[ClesStat]{Sondage}{% - \setsepchar{,}\ignoreemptyitems% - \readlist*\Liste{#2}% - % "liste vide" - \newtoks\tabtoksEEa% - \tabtoksEEa{}% - % - % "liste vide" - \newtoks\tabtoksEEb% - \tabtoksEEb{}% - % - \readlist*\ListeSansDoublonsEE{999}% %% Pour ne pas avoir une liste vide - % - \newcount\cmptEE% - \newcount\PasNumEE% %% Permettra de savoir si ce sondage est qualitatif ou quantitatif - \PasNumEE=0\relax% - \DTLcleardb{mtdbEE}% - % on range les resultats du sondage par ordre croissant. - \foreachitem\x\in\Liste{% - \DTLnewrow{mtdbEE}% - \DTLnewdbentry{mtdbEE}{Numeric}{\x}% + \setsepchar{,}\ignoreemptyitems% + \readlist*\Liste{#2}% + % "liste vide" + \newtoks\tabtoksEEa% + \tabtoksEEa{}% + % + % "liste vide" + \newtoks\tabtoksEEb% + \tabtoksEEb{}% + % + \readlist*\ListeSansDoublonsEE{999}% %% Pour ne pas avoir une liste vide + % + \newcount\cmptEE% + \newcount\PasNumEE% %% Permettra de savoir si ce sondage est qualitatif ou quantitatif + \PasNumEE=0\relax% + \DTLcleardb{mtdbEE}% + % on range les resultats du sondage par ordre croissant. + \foreachitem\x\in\Liste{% + \DTLnewrow{mtdbEE}% + \DTLnewdbentry{mtdbEE}{Numeric}{\x}% + }% + \dtlsort{Numeric}{mtdbEE}{\dtlicompare}% + \DTLforeach{mtdbEE}{\nba=Numeric}{% + \IfDecimal{\nba}{}{\PasNumEE=\numexpr\PasNumEE+1\relax}% + \cmptEE=0\relax% + \foreachitem\nbb\in\ListeSansDoublonsEE{% + \ifthenelse{\equal{\nba}{\nbb}}{\cmptEE=\numexpr\cmptEE+1\relax}{}% + }% + \ifthenelse{\equal{\the\cmptEE}{0}}{% + \expandafter\AjoutListEEb\nba\nil% + \xdef\listEEa{\the\tabtoksEEb}% + \ignoreemptyitems% + \setsepchar{,}% + \readlist*\ListeSansDoublonsEE\listEEa% %%% Enl\`eve tous les \'elements + %%% identiques de Liste + }{}% + }% + \foreachitem\nba\in\ListeSansDoublonsEE{% + \cmptEE=0\relax% + \DTLforeach{mtdbEE}{\nbb=Numeric}{% + \ifthenelse{\equal{\nba}{\nbb}}{\cmptEE=\numexpr\cmptEE+1\relax}{}% + }% + \expandafter\AjoutListEEab\nba\nil% + \expandafter\AjoutListEEaa\the\cmptEE\nil% %%% Compte tous les \'elements + %%% identiques de Liste + }% + \xdef\listEEb{\the\tabtoksEEa} + \ignoreemptyitems% + \setsepchar[*]{,*/}% + \readlist*\ListeComplete\listEEb% + % + \ifthenelse{\equal{\the\PasNumEE}{0}}{\setKV[ClesStat]{Quantitatif}}{\setKV[ClesStat]{Qualitatif}}% + }{% + \ifboolKV[ClesStat]{Qualitatif}{% + % % on lit la liste \'ecrite sous la forme valeur/effectif + \setsepchar[*]{,*/}\ignoreemptyitems% + \readlist*\ListeInitiale{#2}% + % "liste vide" + \newtoks\tabtoksEE% + \tabtoksEE{}% + \DTLcleardb{mtdbEEqual}% + \foreachitem\x\in\ListeInitiale{% + \DTLnewrow{mtdbEEqual}% + \itemtomacro\ListeInitiale[\xcnt,1]\x% + \DTLnewdbentry{mtdbEEqual}{Val}{\x}% + \itemtomacro\ListeInitiale[\xcnt,2]\y% + \DTLnewdbentry{mtdbEEqual}{Eff}{\y}% + }% + \DTLforeach{mtdbEEqual}{\Val=Val,\Eff=Eff}{% + \expandafter\AjoutListEEy\Val\nil% + \expandafter\AjoutListEEx\Eff\nil% + }% + \xdef\listEE{\the\tabtoksEE} + \ignoreemptyitems% + \setsepchar[*]{,*/}% + \readlist*\ListeComplete\listEE% + }{% Dans le qualitatif, on trie d'abord les valeurs. + \setsepchar[*]{,*/}\ignoreemptyitems% + \readlist*\ListeInitiale{#2}% + % "liste vide" + \newtoks\tabtoksEE% + \tabtoksEE{}% + \DTLcleardb{mtdbEEqual}% + \foreachitem\x\in\ListeInitiale{% + \DTLnewrow{mtdbEEqual}% + \itemtomacro\ListeInitiale[\xcnt,1]\x% + \DTLnewdbentry{mtdbEEqual}{Val}{\x}% + \itemtomacro\ListeInitiale[\xcnt,2]\y% + \DTLnewdbentry{mtdbEEqual}{Eff}{\y}% + }% + \dtlsort{Val}{mtdbEEqual}{\dtlicompare}% + \DTLforeach{mtdbEEqual}{\Val=Val,\Eff=Eff}{% + \expandafter\AjoutListEEy\Val\nil% + \expandafter\AjoutListEEx\Eff\nil% + }% + \xdef\listEE{\the\tabtoksEE} + \ignoreemptyitems% + \setsepchar[*]{,*/}% + \readlist*\ListeComplete\listEE% + }}}% + % on cr\'ee la base de donn\'ees des valeurs dans le cas qualitatif + \DTLcleardb{mtdb}% + % on les trie pour la m\'ediane dans le cas qualitatif % Touhami / Texnique.fr + \foreachitem\x\in\ListeComplete{% + \DTLnewrow{mtdb}% + \itemtomacro\ListeComplete[\xcnt,2]\y% + \DTLnewdbentry{mtdb}{Numeric}{\y}% + }% + \dtlsort{Numeric}{mtdb}{\dtlicompare}% + % % on r\'einitialise les valeurs des crit\`eres de position et de + % dispersion + \renewcommand\NbDonnees{}% + \renewcommand\SommeDonnees{}% + \renewcommand\EffectifTotal{}% + \renewcommand\Moyenne{}% + \renewcommand\Etendue{}% + \renewcommand\Mediane{}% + \renewcommand\DonneeMax{0}% + \renewcommand\EffectifMax{0}% + \renewcommand\DonneeMin{999999999}% + \ifboolKV[ClesStat]{Qualitatif}{%D\'ebut qualitatif + % Calculs + % %% celui de la somme des donn\'ees + \foreachitem\don\in\ListeComplete{\xdef\SommeDonnees{\fpeval{\SommeDonnees+\ListeComplete[\doncnt,2]}}}% + % %% celui de l'effectif total + \ifboolKV[ClesStat]{EffectifTotal}{% + \ifboolKV[ClesStat]{Liste}{L'effectif total de la s\'erie est + \num{\ListeCompletelen}.\par}{% + \foreachitem\don\in\ListeComplete{\xdef\EffectifTotal{\fpeval{\EffectifTotal+\ListeComplete[\doncnt,2]}}}% + L'effectif total de la s\'erie est : \[\ListeComplete[1,2]\xintFor* ##1 in + {\xintSeq {2}{\ListeCompletelen}}\do{% + +\ListeComplete[##1,2]}=\num{\EffectifTotal}\]} + }{}% + \ifboolKV[ClesStat]{Liste}{\xdef\EffectifTotal{\ListeCompletelen}}{\xdef\EffectifTotal{\SommeDonnees}}% + % %% celui de la moyenne + \xdef\Moyenne{\fpeval{\SommeDonnees/\ListeCompletelen}}% + \ifboolKV[ClesStat]{Moyenne}{% + \ifboolKV[ClesStat]{Liste}{% + La somme des donn\'ees de la s\'erie est :% + \xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{% + \[ + \num{\ListeComplete[1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% + +\num{\ListeComplete[##1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% + \]}{% + \[ + \num{\ListeComplete[1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{3}}\do{% + +\num{\ListeComplete[##1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}+\dots\xintFor* ##1 in {\xintSeq {\ListeCompletelen-1}{\ListeCompletelen}}\do{% + +\num{\ListeComplete[##1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% + \]% + }% + \ifboolKV[ClesStat]{SET}{}{Le nombre de donn\'ees de la s\'erie est \num{\ListeCompletelen}.\\}% + Donc la moyenne de la s\'erie est \'egale \`a :% + \[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\ListeCompletelen}}%\IfInteger{\fpeval{round(\fpeval{\SommeDonnees/\ListeCompletelen},\useKV[ClesStat]{Precision})}}{=}{\approx} + \ifboolKV[ClesStat]{ValeurExacte}{}{% + \opdiv*{\SommeDonnees}{\ListeCompletelen}{resultatmoy}{restemoy}% + \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% + \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% + \num{\fpeval{round(\SommeDonnees/\ListeCompletelen,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% + }% + \]% + }{Pas de moyenne possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{}% + % % %% celui de l'\'etendue + \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% + \xintifboolexpr{\ListeComplete[##1,2]>\DonneeMax}{% + \xdef\DonneeMax{\ListeComplete[##1,2]}% + }{}% + \xintifboolexpr{\ListeComplete[##1,2]<\DonneeMin}{% + \xdef\DonneeMin{\ListeComplete[##1,2]}% + }{}% + }% + \xdef\EffectifMax{\DonneeMax}% + \xdef\Etendue{\fpeval{\DonneeMax-\DonneeMin}}% + \ifboolKV[ClesStat]{Etendue}{% + \ifboolKV[ClesStat]{Liste}{% + L'\'etendue de la s\'erie est \'egale \`a $\num{\DonneeMax}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\DonneeMin}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% + }{Pas d'\'etendue possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{}% + % celui de la mediane + %%% Recuperation de la mediane %%%%%%%%%%%%%%%%%%%%% + \newcount\Recapmed% + \newcount\Recapmeda% + \ifodd\number\ListeCompletelen%odd impair + \Recapmed=\fpeval{(\ListeCompletelen+1)/2}\relax% + \else% + \Recapmed=\fpeval{\ListeCompletelen/2}\relax% + \Recapmeda=\numexpr\Recapmed+1\relax% + \fi% + \newcount\Recapk% + \Recapk=0% + \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\Recapk=\numexpr\Recapk+1\relax% + \ifnum\Recapk=\Recapmed% + \ifodd\number\ListeCompletelen% + \xdef\Mediane{\numeroDonnee}% + \else% + \xdef\Mediane{\numeroDonnee}% + \fi% + \fi% + \ifnum\Recapk=\Recapmeda% + \xdef\Mediane{\fpeval{(\Mediane+\numeroDonnee)/2}}% + \fi% + }% + %%% + \ifboolKV[ClesStat]{Mediane}{% + \ifboolKV[ClesStat]{Liste}{% + On range les donn\'ees par ordre croissant :% + \nbdonnees=0% + \xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{% + \[\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{;}}\]% + }{% + \medskip% + \begin{center} + \begin{minipage}{0.9\linewidth} + \DTLforeach*{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{; + }\nbdonnees=\fpeval{\nbdonnees+1}\modulo{\nbdonnees}{\useKV[ClesStat]{Coupure}}\xintifboolexpr{\remainder==0}{\\}{}} + \end{minipage} + \end{center}% + \medskip% + }% + \newcount\med% + \newcount\meda% + \ifodd\number\ListeCompletelen%odd impair + \med=\fpeval{(\ListeCompletelen+1)/2}\relax% + L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$.\\ + \else% pair + \med=\fpeval{\ListeCompletelen/2}\relax% + \meda=\numexpr\med+1\relax% + L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\the\med}+\num{\the\med}$.\\ + \fi% + \newcount\k% + \k=0% + \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\k=\numexpr\k+1\relax% + \ifnum\k=\med %La m\'ediane vaut \numeroDonnee\fi + \ifodd\number\ListeCompletelen% + La m\'ediane de la s\'erie est la \the\med\ieme{} donn\'ee.\\Donc la m\'ediane de la s\'erie est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% + \xdef\Mediane{\numeroDonnee}% + \else% + La \the\med\ieme{} donn\'ee est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}. }{. }\xdef\Mediane{\numeroDonnee}% + \fi% + \fi% + \ifnum\k=\meda + La \the\meda\ieme{} donn\'ee est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.} Donc la m\'ediane de la s\'erie est \xdef\Mediane{\fpeval{(\Mediane+\numeroDonnee)/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% + \fi% + }% + %%%%%%% + }{Pas de m\'ediane possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{} + %%% Quartile un + \newcount\PfCQuartileUn% + \modulo{\ListeCompletelen}{4}\relax% + \ifnum\remainder=0% + \PfCQuartileUn=\fpeval{\ListeCompletelen/4}% + \else% + \PfCQuartileUn=\fpeval{ceil(\ListeCompletelen/4)+1}% + \fi% + \newcount\PfCQunk% + \PfCQunk=0% + \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\PfCQunk=\numexpr\PfCQunk+1\relax% + \ifnum\PfCQunk=\PfCQuartileUn% + \xdef\QuartileUn{\numeroDonnee}% + \fi% }% - \dtlsort{Numeric}{mtdbEE}{\dtlicompare}% - \DTLforeach{mtdbEE}{\nba=Numeric}{% - \IfDecimal{\nba}{}{\PasNumEE=\numexpr\PasNumEE+1\relax}% - \cmptEE=0\relax% - \foreachitem\nbb\in\ListeSansDoublonsEE{% - \ifthenelse{\equal{\nba}{\nbb}}{\cmptEE=\numexpr\cmptEE+1\relax}{}% - }% - \ifthenelse{\equal{\the\cmptEE}{0}}{% - \expandafter\AjoutListEEb\nba\nil% - \xdef\listEEa{\the\tabtoksEEb}% - \ignoreemptyitems% - \setsepchar{,}% - \readlist*\ListeSansDoublonsEE\listEEa% %%% Enl\`eve tous les \'elements - %%% identiques de Liste - }{}% - }% - \foreachitem\nba\in\ListeSansDoublonsEE{% - \cmptEE=0\relax% - \DTLforeach{mtdbEE}{\nbb=Numeric}{% - \ifthenelse{\equal{\nba}{\nbb}}{\cmptEE=\numexpr\cmptEE+1\relax}{}% - }% - \expandafter\AjoutListEEab\nba\nil% - \expandafter\AjoutListEEaa\the\cmptEE\nil% %%% Compte tous les \'elements - %%% identiques de Liste + %%% Quartile trois + \newcount\PfCQuartileTrois% + \modulo{\ListeCompletelen}{4}\relax% + \ifnum\remainder=0% + \PfCQuartileTrois=\fpeval{3*\ListeCompletelen/4}% + \else% + \PfCQuartileTrois=\fpeval{ceil(3*\ListeCompletelen/4)+1}% + \fi% + \newcount\PfCQtroisk% + \PfCQtroisk=0% + \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\PfCQtroisk=\numexpr\PfCQtroisk+1\relax% + \ifnum\PfCQtroisk=\PfCQuartileTrois%La m\'ediane vaut \numeroDonnee\fi + \xdef\QuartileTrois{\numeroDonnee}% + \fi% }% - \xdef\listEEb{\the\tabtoksEEa} - \ignoreemptyitems% - \setsepchar[*]{,*/}% - \readlist*\ListeComplete\listEEb% - % - \ifthenelse{\equal{\the\PasNumEE}{0}}{\setKV[ClesStat]{Quantitatif}}{\setKV[ClesStat]{Qualitatif}}% - }{% - \ifboolKV[ClesStat]{Qualitatif}{% - % % on lit la liste \'ecrite sous la forme valeur/effectif - \setsepchar[*]{,*/}\ignoreemptyitems% - \readlist*\ListeComplete{#2}% - }{% Dans le qualitatif, on trie d'abord les valeurs. - \setsepchar[*]{,*/}\ignoreemptyitems% - \readlist*\ListeInitiale{#2}% - % "liste vide" - \newtoks\tabtoksEE% - \tabtoksEE{}% - \DTLcleardb{mtdbEEqual}% - \foreachitem\x\in\ListeInitiale{% - \DTLnewrow{mtdbEEqual}% - \itemtomacro\ListeInitiale[\xcnt,1]\x% - \DTLnewdbentry{mtdbEEqual}{Val}{\x}% - \itemtomacro\ListeInitiale[\xcnt,2]\y% - \DTLnewdbentry{mtdbEEqual}{Eff}{\y}% - }% - \dtlsort{Val}{mtdbEEqual}{\dtlicompare}% - \DTLforeach{mtdbEEqual}{\Val=Val,\Eff=Eff}{% - \expandafter\AjoutListEEy\Val\nil% - \expandafter\AjoutListEEx\Eff\nil% - }% - \xdef\listEE{\the\tabtoksEE} - \ignoreemptyitems% - \setsepchar[*]{,*/}% - \readlist*\ListeComplete\listEE% - }}}% - % on cr\'ee la base de donn\'ees des valeurs dans le cas qualitatif - \DTLcleardb{mtdb}% - % on les trie pour la m\'ediane dans le cas qualitatif % Touhami / Texnique.fr - \foreachitem\x\in\ListeComplete{% - \DTLnewrow{mtdb}% - \itemtomacro\ListeComplete[\xcnt,2]\y% - \DTLnewdbentry{mtdb}{Numeric}{\y}% - }% - \dtlsort{Numeric}{mtdb}{\dtlicompare}% - % % on r\'einitialise les valeurs des crit\`eres de position et de - % dispersion - \renewcommand\NbDonnees{}% - \renewcommand\SommeDonnees{}% - \renewcommand\EffectifTotal{}% - \renewcommand\Moyenne{}% - \renewcommand\Etendue{}% - \renewcommand\Mediane{}% - \renewcommand\DonneeMax{0}% - \renewcommand\EffectifMax{0}% - \renewcommand\DonneeMin{999999999}% - \ifboolKV[ClesStat]{Qualitatif}{%D\'ebut qualitatif - % Calculs - % %% celui de la somme des donn\'ees - \foreachitem\don\in\ListeComplete{\xdef\SommeDonnees{\fpeval{\SommeDonnees+\ListeComplete[\doncnt,2]}}}% - % %% celui de l'effectif total - \ifboolKV[ClesStat]{EffectifTotal}{% - \ifboolKV[ClesStat]{Liste}{L'effectif total de la s\'erie est - \num{\ListeCompletelen}.\par}{% - \foreachitem\don\in\ListeComplete{\xdef\EffectifTotal{\fpeval{\EffectifTotal+\ListeComplete[\doncnt,2]}}}% + % Construction du tableau + \ifboolKV[ClesStat]{Tableau}{% + \ifboolKV[ClesStat]{Liste}{Pas de tableau possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un tableau avec cette liste.}{\BuildtabStat}}{}% + % Construction du graphique + \ifboolKV[ClesStat]{Graphique}{% + \ifboolKV[ClesStat]{Liste}{Pas de graphique possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un graphique avec cette liste.}{% + \ifboolKV[ClesStat]{Barre}{% + \buildgraphbarhor% + }{\ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraphq[#1]}}}% + }}{}% + }{%%%%%%%%%%%%%%%%%%%%%D\'ebut quantitatif + % % on effectue les calculs + % %% celui de la somme des donn\'ees + \foreachitem\don\in\ListeComplete{\xdef\SommeDonnees{\fpeval{\SommeDonnees+\ListeComplete[\doncnt,1]*\ListeComplete[\doncnt,2]}}}% + % %% celui de l'effectif total + \foreachitem\don\in\ListeComplete{\xdef\EffectifTotal{\fpeval{\EffectifTotal+\ListeComplete[\doncnt,2]}}}% + % %% celui de l'\'etendue + \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% + \xintifboolexpr{\ListeComplete[##1,1]>\DonneeMax}{% + \xdef\DonneeMax{\ListeComplete[##1,1]}% + }{}% + \xintifboolexpr{\ListeComplete[##1,1]<\DonneeMin}{% + \xdef\DonneeMin{\ListeComplete[##1,1]}% + }{}% + }% + % \xdef\EffectifMax{\DonneeMax}% + \xdef\Etendue{\fpeval{\DonneeMax-\DonneeMin}}%% + % %% celui de la moyenne + \xdef\Moyenne{\fpeval{\SommeDonnees/\EffectifTotal}}% + \ifboolKV[ClesStat]{EffectifTotal}{% L'effectif total de la s\'erie est : \[\ListeComplete[1,2]\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% - +\ListeComplete[##1,2]}=\num{\EffectifTotal}\]} - }{}% - \ifboolKV[ClesStat]{Liste}{\xdef\EffectifTotal{\ListeCompletelen}}{\xdef\EffectifTotal{\SommeDonnees}}% - % %% celui de la moyenne - \xdef\Moyenne{\fpeval{\SommeDonnees/\ListeCompletelen}}% - \ifboolKV[ClesStat]{Moyenne}{% - \ifboolKV[ClesStat]{Liste}{% + +\ListeComplete[##1,2]}=\num{\EffectifTotal}\] + }{}% + \ifboolKV[ClesStat]{Moyenne}{% La somme des donn\'ees de la s\'erie est :% \xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{% \[ - \num{\ListeComplete[1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% - +\num{\ListeComplete[##1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% - \]}{% + \ifnum\ListeComplete[1,2]=1\else\num{\ListeComplete[1,2]}\times\fi\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% + +\ifnum\ListeComplete[##1,2]=1\else\num{\ListeComplete[##1,2]}\times\fi\num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + \] + }{% \[ - \num{\ListeComplete[1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{3}}\do{% - +\num{\ListeComplete[##1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}+\dots\xintFor* ##1 in {\xintSeq {\ListeCompletelen-1}{\ListeCompletelen}}\do{% - +\num{\ListeComplete[##1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% - \]% + \ifnum\ListeComplete[1,2]=1\else\num{\ListeComplete[1,2]}\times\fi\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{2}}\do{% + +\ifnum\ListeComplete[##1,2]=1\else\num{\ListeComplete[##1,2]}\times\fi\num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + }+\dots\xintFor* ##1 in {\xintSeq {\ListeCompletelen-1}{\ListeCompletelen}}\do{% + +\ifnum\ListeComplete[##1,2]=1\else\num{\ListeComplete[##1,2]}\times\fi\num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} + \] + }% + \ifboolKV[ClesStat]{SET}{}{L'effectif total de la s\'erie est :% + \ifboolKV[ClesStat]{Liste}{ \num{\EffectifTotal}\\}{% + \[\num{\ListeComplete[1,2]}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% + +\num{\ListeComplete[##1,2]} + }=\num{\EffectifTotal} + \]% + }% }% - \ifboolKV[ClesStat]{SET}{}{Le nombre de donn\'ees de la s\'erie est \num{\ListeCompletelen}.\\}% Donc la moyenne de la s\'erie est \'egale \`a :% - \[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\ListeCompletelen}}%\IfInteger{\fpeval{round(\fpeval{\SommeDonnees/\ListeCompletelen},\useKV[ClesStat]{Precision})}}{=}{\approx} + \[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\EffectifTotal}}% \ifboolKV[ClesStat]{ValeurExacte}{}{% - \opdiv*{\SommeDonnees}{\ListeCompletelen}{resultatmoy}{restemoy}% + \opdiv*{\SommeDonnees}{\EffectifTotal}{resultatmoy}{restemoy}% \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% - \num{\fpeval{round(\SommeDonnees/\ListeCompletelen,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% + \num{\fpeval{round(\SommeDonnees/\EffectifTotal,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% }% \]% - }{Pas de moyenne possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{}% - % % %% celui de l'\'etendue - \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% - \xintifboolexpr{\ListeComplete[##1,2]>\DonneeMax}{% - \xdef\DonneeMax{\ListeComplete[##1,2]}% - }{}% - \xintifboolexpr{\ListeComplete[##1,2]<\DonneeMin}{% - \xdef\DonneeMin{\ListeComplete[##1,2]}% }{}% - }% - \xdef\EffectifMax{\DonneeMax}% - \xdef\Etendue{\fpeval{\DonneeMax-\DonneeMin}}% - \ifboolKV[ClesStat]{Etendue}{% - \ifboolKV[ClesStat]{Liste}{% - L'\'etendue de la s\'erie est \'egale \`a $\num{\DonneeMax}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\DonneeMin}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% - }{Pas d'\'etendue possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{}% - % celui de la mediane - %%% Recuperation de la mediane %%%%%%%%%%%%%%%%%%%%% - \newcount\Recapmed% - \newcount\Recapmeda% - \ifodd\number\ListeCompletelen%odd impair - \Recapmed=\fpeval{(\ListeCompletelen+1)/2}\relax% - \else% - \Recapmed=\fpeval{\ListeCompletelen/2}\relax% - \Recapmeda=\numexpr\Recapmed+1\relax% - \fi% - \newcount\Recapk% - \Recapk=0% - \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\Recapk=\numexpr\Recapk+1\relax% - \ifnum\Recapk=\Recapmed% - \ifodd\number\ListeCompletelen% - \xdef\Mediane{\numeroDonnee}% - \else% - \xdef\Mediane{\numeroDonnee}% + % % Affichage des r\'eponses. + % %% pour l'\'etendue + \ifboolKV[ClesStat]{Etendue}{L'\'etendue de la s\'erie est \'egale \`a $\num{\ListeComplete[\ListeCompletelen,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}}{}% + % pour la m\'ediane + %%% Recuperation Mediane + \newcount\Recupmed% + \newcount\Recupmeda% + \ifodd\number\EffectifTotal%odd impair + \Recupmed=\fpeval{(\EffectifTotal+1)/2}\relax% + \else% pair + \Recupmed=\fpeval{\EffectifTotal/2}\relax% + \Recupmeda=\numexpr\Recupmed+1\relax% \fi% - \fi% - \ifnum\Recapk=\Recapmeda% - \xdef\Mediane{\fpeval{(\Mediane+\numeroDonnee)/2}}% - \fi% - }% - %%% - \ifboolKV[ClesStat]{Mediane}{% - \ifboolKV[ClesStat]{Liste}{% - On range les donn\'ees par ordre croissant :% - \nbdonnees=0% - \xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{% - \[\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{;}}\]% - }{% - \medskip% - \begin{center} - \begin{minipage}{0.9\linewidth} - \DTLforeach*{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\DTLiflastrow{.}{; - }\nbdonnees=\fpeval{\nbdonnees+1}\modulo{\nbdonnees}{\useKV[ClesStat]{Coupure}}\xintifboolexpr{\remainder==0}{\\}{}} - \end{minipage} - \end{center}% - \medskip% + \newcount\Recupk% + \Recupk=0% + \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% + \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% + \Recupk=\numexpr\Recupk+1\relax% + \ifnum\Recupk=\Recupmed% + \ifodd\number\EffectifTotal% + \xdef\Mediane{\ListeComplete[##1,1]}% + \else% + \xdef\Mediane{\ListeComplete[##1,1]}% + \fi% + \fi% + \ifnum\Recupk=\Recupmeda% + \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}% + \fi% }% + }% + %%% + \ifboolKV[ClesStat]{Mediane}{% + \newcount\med% \newcount\meda% - \ifodd\number\ListeCompletelen%odd impair - \med=\fpeval{(\ListeCompletelen+1)/2}\relax% - L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$.\\ + \ifodd\number\EffectifTotal%odd impair + \med=\fpeval{(\EffectifTotal+1)/2}\relax% + L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$. % \else% pair - \med=\fpeval{\ListeCompletelen/2}\relax% + \med=\fpeval{\EffectifTotal/2}\relax% \meda=\numexpr\med+1\relax% - L'effectif total de la s\'erie est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\the\med}+\num{\the\med}$.\\ + L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med}}+\num{\fpeval{\med}}$. % \fi% \newcount\k% \k=0% - \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\k=\numexpr\k+1\relax% - \ifnum\k=\med %La m\'ediane vaut \numeroDonnee\fi - \ifodd\number\ListeCompletelen% - La m\'ediane de la s\'erie est la \the\med\ieme{} donn\'ee.\\Donc la m\'ediane de la s\'erie est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% - \xdef\Mediane{\numeroDonnee}% - \else% - La \the\med\ieme{} donn\'ee est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}. }{. }\xdef\Mediane{\numeroDonnee}% - \fi% - \fi% - \ifnum\k=\meda - La \the\meda\ieme{} donn\'ee est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.} Donc la m\'ediane de la s\'erie est \xdef\Mediane{\fpeval{(\Mediane+\numeroDonnee)/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% - \fi% + \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% + \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% + \k=\numexpr\k+1\relax% + \ifnum\k=\med% + \ifodd\number\EffectifTotal% + La m\'ediane de la s\'erie est la \the\med\ieme{} donn\'ee. Donc la m\'ediane de la s\'erie est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% + \else% + La \the\med\ieme{} donn\'ee est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}. }{. }\xdef\Mediane{\ListeComplete[##1,1]}% + \fi% + \fi% + \ifnum\k=\meda% + La \the\meda\ieme{} donn\'ee est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\\Donc la m\'ediane de la s\'erie est \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% + \fi% + }% }% - %%%%%%% - }{Pas de m\'ediane possible pour une s\'erie de donn\'ees \`a caract\`ere qualitatif.}}{} - %%% Quartile un - \newcount\PfCQuartileUn% - \modulo{\ListeCompletelen}{4}\relax% - \ifnum\remainder=0% - \PfCQuartileUn=\fpeval{\ListeCompletelen/4}% - \else% - \PfCQuartileUn=\fpeval{ceil(\ListeCompletelen/4)+1}% - \fi% - \newcount\PfCQunk% - \PfCQunk=0% - \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\PfCQunk=\numexpr\PfCQunk+1\relax% - \ifnum\PfCQunk=\PfCQuartileUn% - \xdef\QuartileUn{\numeroDonnee}% - \fi% - }% - %%% Quartile trois - \newcount\PfCQuartileTrois% - \modulo{\ListeCompletelen}{4}\relax% - \ifnum\remainder=0% - \PfCQuartileTrois=\fpeval{3*\ListeCompletelen/4}% - \else% - \PfCQuartileTrois=\fpeval{ceil(3*\ListeCompletelen/4)+1}% - \fi% - \newcount\PfCQtroisk% - \PfCQtroisk=0% - \DTLforeach{mtdb}{\numeroDonnee=Numeric}{\PfCQtroisk=\numexpr\PfCQtroisk+1\relax% - \ifnum\PfCQtroisk=\PfCQuartileTrois%La m\'ediane vaut \numeroDonnee\fi - \xdef\QuartileTrois{\numeroDonnee}% + }{}% + %%% Quartile un + \newcount\PfCQuartileUn% + \modulo{\EffectifTotal}{4}\relax% + \ifnum\remainder=0% + \PfCQuartileUn=\fpeval{\EffectifTotal/4}% + \else% + \PfCQuartileUn=\fpeval{ceil(\EffectifTotal/4)+1}% \fi% - }% - % Construction du tableau - \ifboolKV[ClesStat]{Tableau}{% - \ifboolKV[ClesStat]{Liste}{Pas de tableau possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un tableau avec cette liste.}{\BuildtabStat}}{}% - % Construction du graphique - \ifboolKV[ClesStat]{Graphique}{% - \ifboolKV[ClesStat]{Liste}{Pas de graphique possible avec la cl\'e Liste.\\Utilisez plut\^ot la cl\'e Sondage si vous voulez un graphique avec cette liste.}{% - \ifboolKV[ClesStat]{Barre}{% - \buildgraphbarhor% - }{\ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraphq[#1]}}}% - }}{}% -}{%%%%%%%%%%%%%%%%%%%%%D\'ebut quantitatif - % % on effectue les calculs - % %% celui de la somme des donn\'ees - \foreachitem\don\in\ListeComplete{\xdef\SommeDonnees{\fpeval{\SommeDonnees+\ListeComplete[\doncnt,1]*\ListeComplete[\doncnt,2]}}}% - % %% celui de l'effectif total - \foreachitem\don\in\ListeComplete{\xdef\EffectifTotal{\fpeval{\EffectifTotal+\ListeComplete[\doncnt,2]}}}% - % %% celui de l'\'etendue - \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% - \xintifboolexpr{\ListeComplete[##1,1]>\DonneeMax}{% - \xdef\DonneeMax{\ListeComplete[##1,1]}% - }{}% - \xintifboolexpr{\ListeComplete[##1,1]<\DonneeMin}{% - \xdef\DonneeMin{\ListeComplete[##1,1]}% - }{}% - }% - % \xdef\EffectifMax{\DonneeMax}% - \xdef\Etendue{\fpeval{\DonneeMax-\DonneeMin}}%% - % %% celui de la moyenne - \xdef\Moyenne{\fpeval{\SommeDonnees/\EffectifTotal}}% - \ifboolKV[ClesStat]{EffectifTotal}{% - L'effectif total de la s\'erie est : \[\ListeComplete[1,2]\xintFor* ##1 in - {\xintSeq {2}{\ListeCompletelen}}\do{% - +\ListeComplete[##1,2]}=\num{\EffectifTotal}\] - }{}% - \ifboolKV[ClesStat]{Moyenne}{% - La somme des donn\'ees de la s\'erie est :% - \xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{% - \[ - \ifnum\ListeComplete[1,2]=1\else\num{\ListeComplete[1,2]}\times\fi\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% - +\ifnum\ListeComplete[##1,2]=1\else\num{\ListeComplete[##1,2]}\times\fi\num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - \] - }{% - \[ - \ifnum\ListeComplete[1,2]=1\else\num{\ListeComplete[1,2]}\times\fi\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{2}}\do{% - +\ifnum\ListeComplete[##1,2]=1\else\num{\ListeComplete[##1,2]}\times\fi\num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - }+\dots\xintFor* ##1 in {\xintSeq {\ListeCompletelen-1}{\ListeCompletelen}}\do{% - +\ifnum\ListeComplete[##1,2]=1\else\num{\ListeComplete[##1,2]}\times\fi\num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - }=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{} - \] - }% - \ifboolKV[ClesStat]{SET}{}{L'effectif total de la s\'erie est :% - \ifboolKV[ClesStat]{Liste}{ \num{\EffectifTotal}\\}{% - \[\num{\ListeComplete[1,2]}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{% - +\num{\ListeComplete[##1,2]} - }=\num{\EffectifTotal} - \]% - }% - }% - Donc la moyenne de la s\'erie est \'egale \`a :% - \[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\EffectifTotal}}% - \ifboolKV[ClesStat]{ValeurExacte}{}{% - \opdiv*{\SommeDonnees}{\EffectifTotal}{resultatmoy}{restemoy}% - \opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}% - \opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi% - \num{\fpeval{round(\SommeDonnees/\EffectifTotal,\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}% - }% - \]% - }{}% - % % Affichage des r\'eponses. - % %% pour l'\'etendue - \ifboolKV[ClesStat]{Etendue}{L'\'etendue de la s\'erie est \'egale \`a $\num{\ListeComplete[\ListeCompletelen,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}}{}% - % pour la m\'ediane - %%% Recuperation Mediane - \newcount\Recupmed% - \newcount\Recupmeda% - \ifodd\number\EffectifTotal%odd impair - \Recupmed=\fpeval{(\EffectifTotal+1)/2}\relax% - \else% pair - \Recupmed=\fpeval{\EffectifTotal/2}\relax% - \Recupmeda=\numexpr\Recupmed+1\relax% - \fi% - \newcount\Recupk% - \Recupk=0% - \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% - \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% - \Recupk=\numexpr\Recupk+1\relax% - \ifnum\Recupk=\Recupmed% - \ifodd\number\EffectifTotal% - \xdef\Mediane{\ListeComplete[##1,1]}% - \else% - \xdef\Mediane{\ListeComplete[##1,1]}% - \fi% - \fi% - \ifnum\Recupk=\Recupmeda% - \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}% - \fi% - }% - }% - %%% - \ifboolKV[ClesStat]{Mediane}{% - - \newcount\med% - \newcount\meda% - \ifodd\number\EffectifTotal%odd impair - \med=\fpeval{(\EffectifTotal+1)/2}\relax% - L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$. % - \else% pair - \med=\fpeval{\EffectifTotal/2}\relax% - \meda=\numexpr\med+1\relax% - L'effectif total de la s\'erie est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med}}+\num{\fpeval{\med}}$. % - \fi% - \newcount\k% - \k=0% - \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% - \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% - \k=\numexpr\k+1\relax% - \ifnum\k=\med% - \ifodd\number\EffectifTotal% - La m\'ediane de la s\'erie est la \the\med\ieme{} donn\'ee. Donc la m\'ediane de la s\'erie est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% - \else% - La \the\med\ieme{} donn\'ee est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}. }{. }\xdef\Mediane{\ListeComplete[##1,1]}% - \fi% - \fi% - \ifnum\k=\meda% - La \the\meda\ieme{} donn\'ee est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\\Donc la m\'ediane de la s\'erie est \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}% - \fi% + \newcount\PfCQunk% + \PfCQunk=0% + \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% + \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% + \PfCQunk=\numexpr\PfCQunk+1\relax% + \ifnum\PfCQunk=\PfCQuartileUn% + \xdef\QuartileUn{\ListeComplete[##1,1]}% + \fi% + }% }% - }% - }{}% - %%% Quartile un - \newcount\PfCQuartileUn% - \modulo{\EffectifTotal}{4}\relax% - \ifnum\remainder=0% - \PfCQuartileUn=\fpeval{\EffectifTotal/4}% - \else% - \PfCQuartileUn=\fpeval{ceil(\EffectifTotal/4)+1}% - \fi% - \newcount\PfCQunk% - \PfCQunk=0% - \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% - \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% - \PfCQunk=\numexpr\PfCQunk+1\relax% - \ifnum\PfCQunk=\PfCQuartileUn% - \xdef\QuartileUn{\ListeComplete[##1,1]}% - \fi% - }% - }% - %%% Quartile trois - \newcount\PfCQuartileTrois% - \modulo{\EffectifTotal}{4}\relax% - \ifnum\remainder=0% - \PfCQuartileTrois=\fpeval{3*\EffectifTotal/4}% - \else% - \PfCQuartileTrois=\fpeval{ceil(3*\EffectifTotal/4)+1}% - \fi% - \newcount\PfCQtroisk% - \PfCQtroisk=0% - \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% - \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% - \PfCQtroisk=\numexpr\PfCQtroisk+1\relax% - \ifnum\PfCQtroisk=\PfCQuartileTrois% - \xdef\QuartileTrois{\ListeComplete[##1,1]}% + %%% Quartile trois + \newcount\PfCQuartileTrois% + \modulo{\EffectifTotal}{4}\relax% + \ifnum\remainder=0% + \PfCQuartileTrois=\fpeval{3*\EffectifTotal/4}% + \else% + \PfCQuartileTrois=\fpeval{ceil(3*\EffectifTotal/4)+1}% \fi% + \newcount\PfCQtroisk% + \PfCQtroisk=0% + \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% + \xintFor* ##2 in {\xintSeq {1}{\ListeComplete[##1,2]}}\do{% + \PfCQtroisk=\numexpr\PfCQtroisk+1\relax% + \ifnum\PfCQtroisk=\PfCQuartileTrois% + \xdef\QuartileTrois{\ListeComplete[##1,1]}% + \fi% + }% + }% + % Construction de tableau + \ifboolKV[ClesStat]{Tableau}{\BuildtabStat}{}% + % Construction du graphique ?? + \ifboolKV[ClesStat]{Graphique}{% + \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraph[#1]}} + }{}% }% }% - % Construction de tableau - \ifboolKV[ClesStat]{Tableau}{\BuildtabStat}{}% - % Construction du graphique ?? - \ifboolKV[ClesStat]{Graphique}{% - \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraph[#1]}} - }{}% -}% -}% }% %%% @@ -12991,7 +13617,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \newcommand\MPRadar[6]{% \ifluatex - \mplibforcehmode + \mplibforcehmode \begin{mplibcode} pair O; O=(0,0); @@ -13120,18 +13746,18 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \useKVdefault[ClesRadar]% \setKV[ClesRadar]{#1}% \ignoreemptyitems% - \setsepchar[*]{,}% + \setsepchar[*]{,}% \readlist*\ListeRadar{#2}% \toklisteradara{}% \foreachitem\compteur\in\ListeRadar{\expandafter\UpdateRadara\compteur\nil}% \ifboolKV[ClesRadar]{Disciplines}{}{% \toklisteradarb{}% \foreachitem\compteur\in\ListeRadar{\expandafter\UpdateRadarb\compteur\nil}% - } + }% \ifboolKV[ClesRadar]{MoyenneClasse}{}{% \toklisteradarc{}% \foreachitem\compteur\in\ListeRadar{\expandafter\UpdateRadarc\compteur\nil}% - } + }% \MPRadar{\useKV[ClesRadar]{Rayon}}{\the\toklisteradarb}{\useKV[ClesRadar]{Pas}}{\useKV[ClesRadar]{Reference}}{\the\toklisteradara}{\the\toklisteradarc}% } @@ -13147,8 +13773,8 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \useKVdefault[ClesBarre]% \setKV[ClesBarre]{#1}% \xdef\NomComp{\useKV[ClesBarre]{Nom}}% - \xdef\TexteOrigine{\useKV[ClesBarre]{Origine}} - \xdef\TexteReference{\useKV[ClesBarre]{Reference}} + \xdef\TexteOrigine{\useKV[ClesBarre]{Origine}}% + \xdef\TexteReference{\useKV[ClesBarre]{Reference}}% \xdef\CouleurFond{\useKV[ClesBarre]{CouleurFond}}% \xdef\CouleurGrad{\useKV[ClesBarre]{CouleurGraduation}}% \xdef\CouleurBarre{\useKV[ClesBarre]{CouleurBarre}}% @@ -13166,15 +13792,15 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }{\xintifboolexpr{#2<\useKV[ClesBarre]{LimiteS}}{% \fill [\CouleurS] (0,0) rectangle (#2/100*\barrewidth, 0.15); }{\fill [\CouleurM] (0,0) rectangle (#2/100*\barrewidth, 0.15);} - } - } + }% + }% \node[anchor=south west] at (0,0.5em) {\NomComp};% \node[anchor=north] at (0,-0.25em) {\TexteOrigine}; \node[anchor=north] at (\barrewidth,-0.25em) {\TexteReference}; \ifboolKV[ClesBarre]{Graduation}{% \foreach \s in {1,...,\fpeval{\useKV[ClesBarre]{Pas}-1}}% { - \draw[\CouleurGrad] (\s/\useKV[ClesBarre]{Pas}*\barrewidth,0)--(\s/\useKV[ClesBarre]{Pas}*\barrewidth,0.15); + \draw[\CouleurGrad] (\s/\useKV[ClesBarre]{Pas}*\barrewidth,0)--(\s/\useKV[ClesBarre]{Pas}*\barrewidth,0.15); } }{} \foreach \s in {\useKV[ClesBarre]{LimiteI},\useKV[ClesBarre]{LimiteF},\useKV[ClesBarre]{LimiteS}}% @@ -13192,7 +13818,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifboolKV[ClesBarre]{Graduation}{% \foreach \s in {1,...,\fpeval{\useKV[ClesBarre]{Pas}-1}}% { - \draw[\CouleurGrad] (\s/\useKV[ClesBarre]{Pas}*\barrewidth,0)--(\s/\useKV[ClesBarre]{Pas}*\barrewidth,0.15); + \draw[\CouleurGrad] (\s/\useKV[ClesBarre]{Pas}*\barrewidth,0)--(\s/\useKV[ClesBarre]{Pas}*\barrewidth,0.15); }}{}% \end{tikzpicture}% } @@ -13203,46 +13829,46 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis %%% \setKVdefault[ClesEquation]{Ecart=0.5,Fleches=false,FlecheDiv=false,Laurent=false,Decomposition=false,Terme=false,Composition=false,Symbole=false,Decimal=false,Entier=false,Lettre=x,Solution=false,LettreSol=true,Bloc=false,Simplification=false,CouleurTerme=black,CouleurCompo=black,CouleurSous=red,CouleurSymbole=orange,Verification=false,Nombre=0,Egalite=false,Produit=false,Facteurs=false,Carre=false,Exact=false,Pose=false,Equivalence=false} -\newcommand\rightcomment[4]% - {\begin{tikzpicture}[remember picture,overlay] - \draw[Cfleches,-stealth] - ($({pic cs:#3}|-{pic cs:#1})+(\useKV[ClesEquation]{Ecart},0)$) - .. controls +(0.2,-0.05) and +(0.2,0.1) .. - node[right,align=left]{#4} - ($({pic cs:#3}|-{pic cs:#2})+(\useKV[ClesEquation]{Ecart},0.1)$); - \end{tikzpicture}% - } +\newcommand\rightcomment[4]{% + \begin{tikzpicture}[remember picture,overlay] + \draw[Cfleches,-stealth] + ($({pic cs:#3}|-{pic cs:#1})+(\useKV[ClesEquation]{Ecart},0)$) + .. controls +(0.2,-0.05) and +(0.2,0.1) .. + node[right,align=left]{#4} + ($({pic cs:#3}|-{pic cs:#2})+(\useKV[ClesEquation]{Ecart},0.1)$); + \end{tikzpicture}% +}% - \newcommand\leftcomment[4]% - {\begin{tikzpicture}[remember picture,overlay] - \draw[Cfleches,-stealth] - ($({pic cs:#3}|-{pic cs:#1})-(\useKV[ClesEquation]{Ecart},0)$) - .. controls +(-0.2,-0.05) and +(-0.2,0.1) .. - node[left,align=right]{#4} - ($({pic cs:#3}|-{pic cs:#2})-(\useKV[ClesEquation]{Ecart},-0.1)$); - \end{tikzpicture}% - } +\newcommand\leftcomment[4]{% + \begin{tikzpicture}[remember picture,overlay] + \draw[Cfleches,-stealth] + ($({pic cs:#3}|-{pic cs:#1})-(\useKV[ClesEquation]{Ecart},0)$) + .. controls +(-0.2,-0.05) and +(-0.2,0.1) .. + node[left,align=right]{#4} + ($({pic cs:#3}|-{pic cs:#2})-(\useKV[ClesEquation]{Ecart},-0.1)$); + \end{tikzpicture}% +}% - \newcommand\Rightcomment[4]% - {\begin{tikzpicture}[remember picture,overlay] - \draw[Cfleches,-stealth] - ($({pic cs:#3}|-{pic cs:#1})+(\useKV[ClesEquation]{Ecart},0)$) - .. controls +(0.2,-0.05) and +(0.2,0.1) .. - node[right,align=left]{#4} - ($({pic cs:#3}|-{pic cs:#2})+(\useKV[ClesEquation]{Ecart},0.1)$); - \end{tikzpicture}% - } - \newcommand\Leftcomment[4]% - {\begin{tikzpicture}[remember picture,overlay] - \draw[Cfleches,-stealth] - ($({pic cs:#3}|-{pic cs:#1})-(\useKV[ClesEquation]{Ecart},0)$) - .. controls +(-0.2,-0.05) and +(-0.2,0.1) .. - node[left,align=right]{#4} - ($({pic cs:#3}|-{pic cs:#2})-(\useKV[ClesEquation]{Ecart},-0.1)$); - \end{tikzpicture}% - } +\newcommand\Rightcomment[4]{% + \begin{tikzpicture}[remember picture,overlay] + \draw[Cfleches,-stealth] + ($({pic cs:#3}|-{pic cs:#1})+(\useKV[ClesEquation]{Ecart},0)$) + .. controls +(0.2,-0.05) and +(0.2,0.1) .. + node[right,align=left]{#4} + ($({pic cs:#3}|-{pic cs:#2})+(\useKV[ClesEquation]{Ecart},0.1)$); + \end{tikzpicture}% +}% +\newcommand\Leftcomment[4]{% + \begin{tikzpicture}[remember picture,overlay] + \draw[Cfleches,-stealth] + ($({pic cs:#3}|-{pic cs:#1})-(\useKV[ClesEquation]{Ecart},0)$) + .. controls +(-0.2,-0.05) and +(-0.2,0.1) .. + node[left,align=right]{#4} + ($({pic cs:#3}|-{pic cs:#2})-(\useKV[ClesEquation]{Ecart},-0.1)$); + \end{tikzpicture}% +}% - % Pour "oublier" les tikzmarks. En cas de plusieurs utilisations de la macro \ResolEquation +% Pour "oublier" les tikzmarks. En cas de plusieurs utilisations de la macro \ResolEquation \newcounter{Nbequa} \setcounter{Nbequa}{0} @@ -16991,7 +17617,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis %%% % Reperage %%% -\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AnglePhi=30,CouleurLa=white,CouleurLon=Tomato,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black,Thermometre=false,Mercure=false} +\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AnglePhi=30,CouleurLa=white,CouleurLon=Tomato,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black,Thermometre=false,Mercure=false,ValeurMin=-4000,ValeurMax=4000,Etages=4} % ValeurOrigine permet de faire des morceaux de demi-droite gradu\'ee en passant par droite :) \def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}} @@ -18458,6 +19084,12 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis if minx>(-pasx-1): minx:=-2*pasx-1; fi; + if minx<\useKV[ClesReperage]{ValeurMin}: + minx:=\useKV[ClesReperage]{ValeurMin}; + fi; + if maxx>\useKV[ClesReperage]{ValeurMax}: + maxx:=\useKV[ClesReperage]{ValeurMax}; + fi; % ----- pair A,B,C; A=(0,0); @@ -18977,6 +19609,130 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \fi } +\def\MPNewDROITEGradueeMulti#1#2{% + % #1 : liste des points \`a placer en pas. pour g\'erer le cas des rep\'erages fractionnaires + % #2 : liste des noms des points + \ifluatex + \mplibforcehmode + \begin{mplibcode} + maxx:=0; + minx:=4000; + unitex:=\useKV[ClesReperage]{Unitex}*cm; + pasx:=\useKV[ClesReperage]{Pasx}; + unitp:=unitex/pasx;%unit\'e de d\'eplacement + ValeurUnitex:=\useKV[ClesReperage]{ValeurUnitex}; + ValeurOrigine:=\useKV[ClesReperage]{ValeurOrigine}; + AffichageGrad:=\AffichageGrad; + AffichageCoord:=\useKV[ClesReperage]{AffichageAbs}; + AffichageNom:=\AffichageNom; + numeric valeur[]; + vardef titi(text t)= + n:=0; + for p_=t: + n:=n+1; + valeur[n]=p_; + endfor; + enddef; + titi(#1); + % Détermination des abscisses maximale et minimale + for k=1 upto n: + if valeur[k]>maxx: + maxx:=valeur[k]; + fi; + if valeur[k](-pasx-1): + minx:=-2*pasx-1; + fi; + if minx<\useKV[ClesReperage]{ValeurMin}: + minx:=\useKV[ClesReperage]{ValeurMin}; + fi; + if maxx>\useKV[ClesReperage]{ValeurMax}: + maxx:=\useKV[ClesReperage]{ValeurMax}; + fi; +% % ----- + pair A[],B[],C[]; + for l=0 upto (\useKV[ClesReperage]{Etages}-1): + A[l]=(0,-l*cm); + B[l]=unitp*(maxx,0)+(0,-l*cm); + C[l]=unitp*(minx,0)+(0,-l*cm); + % On trace la demi-droite + drawarrow (C[l]+unitp*(-0.75,0))--(B[l]+unitp*(0.75,0)); + % marquage secondaire + marque_s:=marque_s/3; + if ((maxx-minx) mod 2)=0: + for k=(minx+1) step 2 until (maxx-1): + draw marquedemidroite(C[l],B[l]); + draw marquesegment((k/maxx)[A[l],B[l]],((k+1)/maxx)[A[l],B[l]]); + endfor; + else: + for k=(minx) step 2 until (maxx-1): + draw marquesegment((k/maxx)[A[l],B[l]],((k+1)/maxx)[A[l],B[l]]); + endfor; + fi; + % marquage primaire + marque_s:=marque_s*3; + for k=0 step pasx until (maxx-pasx): + draw marquesegment((k/maxx)[A[l],B[l]],((k+pasx)/maxx)[A[l],B[l]]); + endfor; + for k=0 step -pasx until (minx+pasx): + draw marquesegment((k/maxx)[A[l],B[l]],((k-pasx)/maxx)[A[l],B[l]]); + endfor; + endfor; + % On trace les zoom + for k=0 upto (\useKV[ClesReperage]{Etages}-2): + lp:=floor(1+uniformdeviate(8)); + draw (lp/10)[A[k],B[k]]--A[k+1] dashed evenly scaled 0.5 withcolor 0.5white; + draw ((lp+1)/10)[A[k],B[k]]--B[k+1] dashed evenly scaled 0.5 withcolor 0.5white; + endfor; + % Labelisation + m_c:=m_c*3; + marque_p:="croix"; + labeloffset:=labeloffset*2; + label.top(TEX("\footnotesize\num{"&decimal(ValeurUnitex)&"}"),unitex*(1,0)); + label.top(TEX("\footnotesize\num{"&decimal(ValeurOrigine)&"}"),A[0]); + if AffichageGrad>0: + for k=((minx+(minx mod pasx)) div pasx) upto (maxx div pasx): + if (k<0) or (k>1): + label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}"),unitex*(k,0));%%% + fi; + endfor; + fi; + labeloffset:=labeloffset/2; + vardef tata(text t)=%on place les points + if AffichageNom>0: + n:=0; + for p_=t: + n:=n+1; + label.top(TEX(p_),unitp*(valeur[n],0)+(0,(-\useKV[ClesReperage]{Etages}+1)*cm)); + pointe(unitp*(valeur[n],0)); + endfor; + fi; + if AffichageCoord=3: + n:=0; + for p_=t: + n:=n+1; + if p_<>"": + drawarrow (unitp*(valeur[n],-1)+(0,(-\useKV[ClesReperage]{Etages}+1)*cm))--(unitp*(valeur[n],-0.3)+(0,(-\useKV[ClesReperage]{Etages}+1)*cm)); + label.bot(btex \hbox to4em{\dotfill} etex,(unitp*(valeur[n],-1))+(0,(-\useKV[ClesReperage]{Etages}+0.5)*cm)); + %pointe(unitp*(valeur[n],0)); + fi; + endfor; + fi; + enddef; + %%% + tata(#2); + \end{mplibcode} + \fi +} + % Pour construire les droite/demi-droite gradu\'ee \def\builddemidroitenew{% \toklistepointdroite{}% @@ -19007,7 +19763,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }% }% -\newcommand\Reperage[2][]{% +\NewDocumentCommand\Reperage{o m}{% \useKVdefault[ClesReperage]% \setKV[ClesReperage]{#1}% \ifboolKV[ClesReperage]{Espace}{% @@ -19029,6 +19785,23 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }% }% +\NewDocumentCommand\ReperageMulti{o m}{% + \useKVdefault[ClesReperage]% + \setKV[ClesReperage]{#1}% + \setsepchar[*]{,*/}\ignoreemptyitems% + \readlist*\ListePointDroite{#2}% + \toklistepointdroite{}% + \toklistenompointdemidroite{}% + \xdef\AffichageNom{0}\ifboolKV[ClesReperage]{AffichageNom}{\xdef\AffichageNom{1}}{} + \xdef\AffichageCoord{\useKV[ClesReperage]{AffichageAbs}} + \xdef\AffichageGrad{0}\ifboolKV[ClesReperage]{AffichageGrad}{\xdef\AffichageGrad{1}}{} + \foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdemidroite\compteur\nil}% + \xdef\Listedesvaleursaplacersurlademidroite{}% + \foreachitem\compteur\in\ListePointDroite{\xdef\Listedesvaleursaplacersurlademidroite{\Listedesvaleursaplacersurlademidroite,\ListePointDroite[\compteurcnt,1]}}% + \MPNewDROITEGradueeMulti{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}% + \setsepchar{,}% +}% + %%% % Puissances %%% @@ -19143,7 +19916,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }% }% -\newcommand\Lg[2][]{% +\NewDocumentCommand\Lg{o m}{% \useKVdefault[Unites]% \setKV[Unites]{#1}% \ifboolKV[Unites]{nm}{% @@ -19173,7 +19946,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }% }% -\newcommand\Masse[2][]{% +\NewDocumentCommand\Masse{o m}{% \useKVdefault[Unites]% \setKV[Unites]{#1}% \ifboolKV[Unites]{ng}{% @@ -19323,7 +20096,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis %%% % Tableaux d'unit\'es %%% -\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false} +\setKVdefault[ClesTableaux]{Virgule=true,Incline=false,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Couleurd=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,Taille=5,Largeur=4.75em} \newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}} % Top and Bottom strut \newcommand\PfCTstrut{\rule{0pt}{3.8ex}} % Top strut @@ -19592,6 +20365,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis % \ifboolKV[ClesTableaux]{Entiers}{% \xdef\DecalageLigne{0}% + \xdef\TailleFonte{\useKV[ClesTableaux]{Taille}}% \setlength{\tabcolsep}{0.01\tabcolsep}% \begin{center}% % @@ -19602,7 +20376,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifboolKV[ClesTableaux]{Milliards}{12}{% \ifboolKV[ClesTableaux]{Millions}{9}{6}% }% - }{m{4.75em}}}% + }{m{\useKV[ClesTableaux]{Largeur}}}}% \ifboolKV[ClesTableaux]{Classes}{% \hline \xdef\DecalageLigne{\fpeval{\DecalageLigne+1}}\ifboolKV[ClesTableaux]{Milliards}{\Block[draw,fill={\useKV[ClesTableaux]{CouleurG}}]{1-3}{Classe des milliards}&&&\Block[draw,fill={\useKV[ClesTableaux]{CouleurM}}]{1-3}{Classe des millions}&&&}{} @@ -19623,7 +20397,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }% \hline \ifboolKV[ClesTableaux]{Milliards}{% - \Block[draw]{}{\fontsize{5}{5}\selectfont centaines de milliards}% + \Block[draw]{}{\fontsize{\TailleFonte}{\TailleFonte}\selectfont centaines de milliards}% &\Block[draw]{}{\fontsize{5}{5}\selectfont dizaines de milliards}% &\Block[draw]{}{\fontsize{5}{5}\selectfont unit\'es de milliards}% &\Block[draw]{}{\fontsize{5}{5}\selectfont centaines de millions}% @@ -19926,12 +20700,12 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \ifboolKV[ClesTableaux]{Millions}{% &&&}{}% &&&&&&,&&&\\}% - \CodeAfter%% + \CodeAfter% % on trace les lignes verticales \xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCDerniereColonne+1}}}\do{% \tikz\draw (\fpeval{\DecalageLigne+2}-|##1)--(\fpeval{\DecalageLigne+2+\useKV[ClesTableaux]{NbLignes}}-|##1);% }% - %% On place le nombre éventuel + % On place le nombre éventuel \ifx\bla#2\bla% \else% \ifboolKV[ClesTableaux]{Milliards}{\xdef\PfCDerniereColonneEntiere{13}}{\ifboolKV[ClesTableaux]{Millions}{\xdef\PfCDerniereColonneEntiere{10}}{\xdef\PfCDerniereColonneEntiere{7}}}% @@ -19962,14 +20736,14 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis \xdef\DecalageLigne{0}% \setlength{\tabcolsep}{0.01\tabcolsep}% \begin{center}% - % + % %%% Definition du tableau - % + % \ifboolKV[ClesTableaux]{Milliards}{\xdef\PfCDerniereColonne{17}}{\ifboolKV[ClesTableaux]{Millions}{\xdef\PfCDerniereColonne{14}}{\xdef\PfCDerniereColonne{11}}}% \begin{NiceTabular}{*{\ifboolKV[ClesTableaux]{Milliards}{12}{% \ifboolKV[ClesTableaux]{Millions}{9}{6}% }}{m{1cm}}*{5}{m{1cm}}}% - % + % \CodeBefore% \ifboolKV[ClesTableaux]{Milliards}{% \tikz\draw[draw=black,fill={\useKV[ClesTableaux]{CouleurG}}] (1|-5)--(2|-1)--(3|-1)--(2|-5)--cycle; @@ -21029,13 +21803,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis % \setsepchar[*]{,* }% \ignoreemptyitems% \readlist*\ListeTotale{#2}% - \xdef\foo{\ListeTotale[1]}% - \xdef\faa{\ListeTotale[2]}% + \xdef\PfCPCfoo{\ListeTotale[1]}% + \xdef\PfCPCfaa{\ListeTotale[2]}% %% \setsepchar{,}% \ignoreemptyitems% - \readlist*\ListeEtapes{\foo}% + \readlist*\ListeEtapes{\PfCPCfoo}% \setsepchar[*]{,* }\ignoreemptyitems% - \readlist*\ListeProg{\faa}% + \readlist*\ListeProg{\PfCPCfaa}% \begin{tcolorbox}[% ProgCalcul,% ] @@ -21047,15 +21821,15 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis }% \ifboolKV[ClesProg]{SansCalcul}{% \begin{enumerate} - \item Choisir un nombre~\pointilles[]~$\ListeProg[1]$% + \item Choisir un nombre~\pointilles~$\ListeProg[1]$% \foreachitem\etape\in\ListeEtapes{% - \item \etape~\pointilles[]~$\ListeProg[3,\etapecnt]$ + \item \etape~\pointilles~$\ListeProg[3,\etapecnt]$ }% \end{enumerate} }{\begin{enumerate} - \item Choisir un nombre~\pointilles[]~\xdef\NbDepart{\ListeProg[1]}\num{\NbDepart} + \item Choisir un nombre~\pointilles~\xdef\NbDepart{\ListeProg[1]}\num{\NbDepart} \foreachitem\etape\in\ListeEtapes{% - \item \etape~\pointilles[]~\edef\Test{\ListeProg[2,\etapecnt]}% + \item \etape~\pointilles~\edef\Test{\ListeProg[2,\etapecnt]}% \expandarg% \StrSubstitute{\Test}{^}{\empty\dots{}^}[\tempa]% \StrSubstitute{\tempa}{**}{^}[\tempab]% diff --git a/macros/latex/contrib/profcollege/metapost/PfCPseudo.mp b/macros/latex/contrib/profcollege/metapost/PfCPseudo.mp index e53e8f87f0..7b98805397 100644 --- a/macros/latex/contrib/profcollege/metapost/PfCPseudo.mp +++ b/macros/latex/contrib/profcollege/metapost/PfCPseudo.mp @@ -1455,6 +1455,11 @@ enddef; vardef FinBlocRepeterI=FinBlocRepeter enddef; +vardef BlocUserFinRepeter(expr col)= + colControle:=col; + FinBlocRepeter +enddef; + vardef Si(expr xa)= LONG:=0; save $; @@ -1951,8 +1956,9 @@ vardef BlocGrisMulti(text argris)= $ enddef; -boolean BlocE; +boolean BlocE,BlocR; BlocE:=false; +BlocR:=false; vardef BlocUser(expr colblocuser)(text textbloc)= LONG:=0; @@ -1964,7 +1970,17 @@ vardef BlocUser(expr colblocuser)(text textbloc)= texto=image( draw BUTB; ); - $=Affichage(texto); + ColBloc:=colblocuser; + if BlocE: + $=AffichageED(texto); + elseif BlocR: + LONG:=0; + numblocrep:=numblocrep+1; + LongRep[numblocrep]:=abs(llcorner texto-lrcorner texto);%afin de conserver la longueur du"répéter..." + $=AffichageControle(texto); + else: + $=Affichage(texto); + fi; $ enddef; diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp index 2f1b2ffa49..2f2db0ee74 100644 --- a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp +++ b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp @@ -1712,6 +1712,11 @@ enddef; vardef FinBlocRepeterI=FinBlocRepeter enddef; +vardef BlocUserFinRepeter(expr col)= + colControle:=col; + FinBlocRepeter +enddef; + vardef Si(expr xa)= LONG:=0; save $; @@ -2510,8 +2515,9 @@ vardef BlocGrisMulti(text argris)= $ enddef; -boolean BlocE; +boolean BlocE,BlocR; BlocE:=false; +BlocR:=false; vardef BlocUser(expr colblocuser)(text textbloc)= LONG:=0; @@ -2524,10 +2530,15 @@ vardef BlocUser(expr colblocuser)(text textbloc)= draw BUTB; ); ColBloc:=colblocuser; - if BlocE=false: - $=Affichage(texto); - else: + if BlocE: $=AffichageED(texto); + elseif BlocR: + LONG:=0; + numblocrep:=numblocrep+1; + LongRep[numblocrep]:=abs(llcorner texto-lrcorner texto);%afin de conserver la longueur du"répéter..." + $=AffichageControle(texto); + else: + $=Affichage(texto); fi; $ enddef; diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp index 87a59ce750..f96556d032 100644 --- a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp +++ b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp @@ -1744,6 +1744,11 @@ enddef; vardef FinBlocRepeterI=FinBlocRepeter enddef; +vardef BlocUserFinRepeter(expr col)= + colControle:=col; + FinBlocRepeter +enddef; + vardef Si(expr xa)= LONG:=0; save $; @@ -2542,8 +2547,9 @@ vardef BlocGrisMulti(text argris)= $ enddef; -boolean BlocE; +boolean BlocE,BlocR; BlocE:=false; +BlocR:=false; vardef BlocUser(expr colblocuser)(text textbloc)= LONG:=0; @@ -2556,10 +2562,15 @@ vardef BlocUser(expr colblocuser)(text textbloc)= draw BUTB; ); ColBloc:=colblocuser; - if BlocE=false: - $=Affichage(texto); - else: + if BlocE: $=AffichageED(texto); + elseif BlocR: + LONG:=0; + numblocrep:=numblocrep+1; + LongRep[numblocrep]:=abs(llcorner texto-lrcorner texto);%afin de conserver la longueur du"répéter..." + $=AffichageControle(texto); + else: + $=Affichage(texto); fi; $ enddef; diff --git a/macros/latex/contrib/sillypage/README.md b/macros/latex/contrib/sillypage/README.md index 4c00f7756b..e5cfbf3b0a 100644 --- a/macros/latex/contrib/sillypage/README.md +++ b/macros/latex/contrib/sillypage/README.md @@ -7,13 +7,13 @@ routine as page numbering style. Simply add `\usepackage{sillypage}` to your document. Then: -- Write `\pagenumbering{silly}` in you document to use the page numbering +- Write `\pagenumbering{silly}` in your document to use the page numbering style defined by this package. - Use the macro `\silly` on a LaTeX counter to typeset the corresponding image for the value of that counter. - Use the macro `\sillystep` to print the step number `n` from the sequence of steps. -- Write `\pagenumbering{sillynumeral}` in you document to use a silly +- Write `\pagenumbering{sillynumeral}` in your document to use a silly numeral system. - Use the macro `\sillynumeral` to get the silly numeral system representation from the provided `n` value. @@ -57,7 +57,3 @@ Blame these individuals: The `sillypage` package may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. - -Images used in this package are created from scratch and released under -the [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) -license. diff --git a/macros/latex/contrib/sillypage/sillypage-example.pdf b/macros/latex/contrib/sillypage/sillypage-example.pdf index bc4284ede8..faee1580b7 100644 Binary files a/macros/latex/contrib/sillypage/sillypage-example.pdf and b/macros/latex/contrib/sillypage/sillypage-example.pdf differ diff --git a/macros/latex/contrib/sillypage/sillypage.dtx b/macros/latex/contrib/sillypage/sillypage.dtx index 18e31a3589..6a3b7dbcd3 100644 --- a/macros/latex/contrib/sillypage/sillypage.dtx +++ b/macros/latex/contrib/sillypage/sillypage.dtx @@ -19,8 +19,8 @@ % by Phelype Oleinik, Paulo Cereda, samcarter and Ulrike Fischer. % %<*package> -\def\sillypageDate{2022-02-02} -\def\sillypageVersion{1.4} +\def\sillypageDate{2022-08-02} +\def\sillypageVersion{1.5} % %<*driver> \documentclass[a4paper,full]{l3doc} @@ -116,7 +116,7 @@ % \begin{syntax} % \cs{pagenumbering}\{silly\} % \end{syntax} -% Write \cs{pagenumbering}|{silly}| in you document to use the page +% Write \cs{pagenumbering}|{silly}| in your document to use the page % numbering style defined by this package. According to Wikipedia, % the typical silly walk gait consists of twelve specific steps to % be performed, so page numbering will cycle through these steps, @@ -147,7 +147,7 @@ % \begin{syntax} % \cs{pagenumbering}\{sillynumeral\} % \end{syntax} -% Write \cs{pagenumbering}|{sillynumeral}| in you document to use a +% Write \cs{pagenumbering}|{sillynumeral}| in your document to use a % silly numeral system, in which each page will be converted to a unique % composition of silly steps. Note that this macro differs from its % \cs{silly} counterpart, as the former is a proper base 12 numeral @@ -191,11 +191,13 @@ % \section{The silly walk routine} % % This is the complete silly walk routine as described by Jazeen Hollings in the -% \href{https://bit.ly/3fc9x46}{corresponding Wikipedia article}. Please note that the -% images used in this package are created by samcarter and released under -% the \href{https://creativecommons.org/licenses/by-sa/4.0/}{CC BY-SA 4.0} license. +% \href{https://bit.ly/3fc9x46}{corresponding Wikipedia article}. +% Please note that the +% images used in this package are created by samcarter and released under +% the \href{https://creativecommons.org/licenses/by-sa/4.0/}{CC BY-SA 4.0} license and the +% \href{http://www.latex-project.org/lppl.txt}{LaTeX Project Public License} 1.3c or later. % Image sources (vector format) are available in the -% \href{https://github.com/cereda/sillypage}{package repository} +% \href{https://github.com/cereda/sillypage}{package repository}. % % \bigskip % @@ -209,7 +211,7 @@ % % \bigskip % -% We also recommend Pilates. +% We also recommend Pilates, or any other physical fitness system. % % \end{documentation} % diff --git a/macros/latex/contrib/sillypage/sillypage.pdf b/macros/latex/contrib/sillypage/sillypage.pdf index 6f3533869b..3b1dcfa8fe 100644 Binary files a/macros/latex/contrib/sillypage/sillypage.pdf and b/macros/latex/contrib/sillypage/sillypage.pdf differ -- cgit v1.2.3