summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-10-15 03:01:29 +0000
committerNorbert Preining <norbert@preining.info>2023-10-15 03:01:29 +0000
commit967ed7c471b7ea6d818e72b7ec41c6c491e6930a (patch)
treecc3ff5710fc75cf92f86e363a04cefb640deb65b /macros/latex
parent315010c30c0dab68a71ca741364438a7a0b1261f (diff)
CTAN sync 202310150301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/indextools/indextools.dtx15
-rw-r--r--macros/latex/contrib/indextools/indextools.pdfbin577176 -> 577058 bytes
-rw-r--r--macros/latex/contrib/jourrr/README.md6
-rw-r--r--macros/latex/contrib/jourrr/jourrr.cls23
-rw-r--r--macros/latex/contrib/jourrr/jourrr.pdfbin82561 -> 84352 bytes
-rw-r--r--macros/latex/contrib/jourrr/jourrr.tex48
-rw-r--r--macros/latex/contrib/lastpage/README2
-rw-r--r--macros/latex/contrib/lastpage/lastpage-example.pdfbin130402 -> 130736 bytes
-rw-r--r--macros/latex/contrib/lastpage/lastpage.dtx65
-rw-r--r--macros/latex/contrib/lastpage/lastpage.pdfbin447012 -> 448061 bytes
-rw-r--r--macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdfbin9462857 -> 9664421 bytes
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex1
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex37
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCJeton.tex40
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCKakuro.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCLego.tex143
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex10
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex198
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty6
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCLego.mp336
21 files changed, 854 insertions, 90 deletions
diff --git a/macros/latex/contrib/indextools/indextools.dtx b/macros/latex/contrib/indextools/indextools.dtx
index 3cc0260b0c..35d1747a42 100644
--- a/macros/latex/contrib/indextools/indextools.dtx
+++ b/macros/latex/contrib/indextools/indextools.dtx
@@ -45,7 +45,7 @@ and the derived files indextools.sty and indextools.pdf.
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{indextools}%
%<*package>
- [2023/10/10 v1.6.0 Package for typesetting indices in a synchronous mode]
+ [2023/10/14 v1.7.0 Package for typesetting indices in a synchronous mode]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -80,7 +80,7 @@ and the derived files indextools.sty and indextools.pdf.
\end{document}
%</driver>
% \fi
-% \CheckSum{897}
+% \CheckSum{903}
%
% \changes{v1.0}{2010/07/10}{First public version}
% \changes{v1.0a}{2010/07/12}{Small bug correction}
@@ -101,6 +101,7 @@ and the derived files indextools.sty and indextools.pdf.
% \changes{v1.5}{2015/11/15}{New option `notenumber'}
% \changes{v1.5.1}{2015/11/22}{Fix bug with options `notenumber' and `innote' when using \cs{index} without optional argument}
% \changes{v1.6.0}{2023/10/10}{Add compatibility with upmendex sorting engine}
+% \changes{v1.7.0}{2023/10/04}{Add compatibility with xindex sorting engine}
%
% \begin{abstract}
% This package is a fork of the \pack{imakeidx} package. The original authors
@@ -208,7 +209,7 @@ and the derived files indextools.sty and indextools.pdf.
% \begin{description}\def\Item[#1]{\item[\normalfont\ttfamily#1]}
% \Item[makeindex] in order to use the \prog{makeindex} sorting and
% formatting engine; this option is the default and is mutually
-% exclusive with the two next options.
+% exclusive with the three next options.
% \Item[xindy] in order to use the \prog{xindy} sorting and formatting
% engine; \texttt{texindy} is an alias for \texttt{xindy} and actually
% it's the script \prog{texindy} which is called by this package.
@@ -218,6 +219,7 @@ and the derived files indextools.sty and indextools.pdf.
% option \texttt{truexindy}; the user is then responsible to set up
% the \prog{xindy} engine with the suitable command line options.
% \Item[upmendex] in order tu use the \prog{upmendex} sorting and formatting engine.
+% \Item[xindex] in order tu use the \prog{xindex} sorting and formatting engine.
% \Item[noautomatic] disables the automatic splitting of the raw
% index files and running of the system programs; this option might
% be used to save time when one knows for sure that the index files
@@ -305,7 +307,7 @@ and the derived files indextools.sty and indextools.pdf.
% used.\\* Example: \texttt{title=Index of names}.
% \Item[program] is the name of the system program that is used to
% sort and format an index; valid choices are \prog{makeindex} ;
-% \prog{xindy}, or \prog{texindy}, plus \prog{truexindy} ; \prog{upmendex}. If not
+% \prog{xindy}, or \prog{texindy}, plus \prog{truexindy} ; \prog{upmendex} ; \prog{xindex}. If not
% specified the program specified among the package options is used.
% If no option is specified, \prog{makeindex} is used. In order to
% use \prog{xindy}, it's necessary to call \prog{pdflatex} with
@@ -1010,6 +1012,7 @@ and the derived files indextools.sty and indextools.pdf.
\DeclareOption{truexindy}{\def\indtl@progdefault{truexindy}}
\DeclareOption{makeindex}{\def\indtl@progdefault{makeindex}}
\DeclareOption{upmendex}{\def\indtl@progdefault{upmendex}}
+\DeclareOption{xindex}{\def\indtl@progdefault{xindex}}
\newif\ifindtl@disableautomatic
\DeclareOption{noautomatic}{\indtl@disableautomatictrue}
\newif\ifindtl@nonewpage
@@ -1146,7 +1149,7 @@ and the derived files indextools.sty and indextools.pdf.
\define@key{indtl}{name}{\def\indtl@name{#1}}
\define@key{indtl}{title}{\def\indtl@title{#1}}
\define@choicekey{indtl}{program}[\indtl@val\indtl@nr]
- {makeindex,xindy,texindy,truexindy,upmendex}{%
+ {makeindex,xindy,texindy,truexindy,upmendex,xindex}{%
\ifcase\indtl@nr\relax
\def\indtl@program{makeindex}%
\or
@@ -1157,6 +1160,8 @@ and the derived files indextools.sty and indextools.pdf.
\def\indtl@program{xindy}%
\or
\def\indtl@program{upmendex}%
+ \or
+ \def\indtl@program{xindex}%
\fi}
\define@key{indtl}{options}{\def\indtl@options{ #1 }}
\define@boolkey{indtl}{noautomatic}[true]{}
diff --git a/macros/latex/contrib/indextools/indextools.pdf b/macros/latex/contrib/indextools/indextools.pdf
index 4aed55b511..86301848ef 100644
--- a/macros/latex/contrib/indextools/indextools.pdf
+++ b/macros/latex/contrib/indextools/indextools.pdf
Binary files differ
diff --git a/macros/latex/contrib/jourrr/README.md b/macros/latex/contrib/jourrr/README.md
index bfa7620553..3a4e1f9e62 100644
--- a/macros/latex/contrib/jourrr/README.md
+++ b/macros/latex/contrib/jourrr/README.md
@@ -1,7 +1,8 @@
# A LaTeX template for a journal rebuttal letter (response to editors/reviewers)
-<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
+[![CTAN](https://img.shields.io/ctan/v/jourrr.svg)](https://ctan.org/pkg/jourrr)
+![GitHub repo size](https://img.shields.io/github/repo-size/firefly-cpp/latex-response-reviewers?style=flat-square)
+[![GitHub license](https://img.shields.io/github/license/firefly-cpp/latex-response-reviewers.svg)](https://github.com/firefly-cpp/latex-response-reviewers/blob/master/LICENSE)
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
-<!-- ALL-CONTRIBUTORS-BADGE:END -->
## About
@@ -23,6 +24,7 @@ The repository hosts a template for writing responses to editors'/reviewers' com
## Download/Install
+Please install the `jourrr` package through the package manager of your TeX distribution or download it directly from: [CTAN](https://www.ctan.org/pkg/jourrr).
## Related templates
diff --git a/macros/latex/contrib/jourrr/jourrr.cls b/macros/latex/contrib/jourrr/jourrr.cls
index 42420539c7..f72d7077fc 100644
--- a/macros/latex/contrib/jourrr/jourrr.cls
+++ b/macros/latex/contrib/jourrr/jourrr.cls
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{jourrr}[2023/06/04 Response to reviewers template]
+\ProvidesClass{jourrr}[2023/10/14 A LaTeX template for a journal rebuttal letter]
% load class
\LoadClass[11pt,a4paper]{article} % Font size and paper type
@@ -163,22 +163,27 @@
\setcounter{aecommentcounter}{1}
\newcommand{\referee}[0]{\underline{\large The authors’ reply to the Reviewer \therefereecounter:} \phantomsection \addcontentsline{toc}{section}{Author's reply to reviewer \therefereecounter} \\ \newline
-\textbf{\Large Referee \therefereecounter:} \addtocounter{refereecounter}{1}\\\setcounter{commentcounter}{1}}
+\textbf{\Large Reviewer \therefereecounter:} \addtocounter{refereecounter}{1}\\\setcounter{commentcounter}{1}}
+
+\newcommand{\missingreferee}[0]{\addtocounter{refereecounter}{1}}
\newcommand{\response}[3]{%
-\hspace{-0.3cm}
- \begin{tabular}{p{14cm} w{c}{3cm}}
- \textbf{Response:} {\color{#2} #3} & {\Huge \completed{#1}} \\ % Set font of checkbox here
- \end{tabular} %
+ \noindent
+ \begin{minipage}[t]{0.955\linewidth}
+ \textbf{Response:} \color{#2}#3
+ \end{minipage}%
+ \hfill
+ \begin{minipage}[t]{0.15\linewidth}
+ {\Huge \completed{#1}}
+ \end{minipage}
+ \vspace{1em} % adding some space after the command for separation
}
-
\newcommand{\comment}[1]{\textbf{Comment \thecommentcounter:} #1 \addtocounter{commentcounter}{1}}
-
% macros for responding editor/associate editor
\newcommand{\editorcomment}[1]{\textbf{Editor's Comment \theeiccommentcounter: } #1\addtocounter{eiccommentcounter}{1}}
-\newcommand{\editorresponse}[0]{\underline{\large The authors’ reply to the Editor-in-Chief} \phantomsection \addcontentsline{toc}{section}{Editor in Chief}}
+\newcommand{\editorresponse}[0]{\underline{\large The authors’ reply to the Editor-in-Chief} \phantomsection \addcontentsline{toc}{section}{Editor-in-Chief}}
\newcommand{\associateeditorcomment}[1]{\textbf{Associate Editor's Comment \theaecommentcounter: } #1\addtocounter{aecommentcounter}{1}}
\newcommand{\associateeditorresponse}[0]{\underline{\large The authors’ reply to the Associate Editor} \phantomsection \addcontentsline{toc}{section}{Associate Editor}}
diff --git a/macros/latex/contrib/jourrr/jourrr.pdf b/macros/latex/contrib/jourrr/jourrr.pdf
index 118ed72e8e..c6460e913e 100644
--- a/macros/latex/contrib/jourrr/jourrr.pdf
+++ b/macros/latex/contrib/jourrr/jourrr.pdf
Binary files differ
diff --git a/macros/latex/contrib/jourrr/jourrr.tex b/macros/latex/contrib/jourrr/jourrr.tex
index 6998b73061..5a309f2956 100644
--- a/macros/latex/contrib/jourrr/jourrr.tex
+++ b/macros/latex/contrib/jourrr/jourrr.tex
@@ -2,14 +2,14 @@
% Path to your signature (if you have one).
\signaturePath{imgs/jourrr-signature.png}
-%----------------------------------------------------------------------
-% Your Data
-%----------------------------------------------------------------------
+%---------------------------------------------------------------------%
+% Your Data %
+%---------------------------------------------------------------------%
% change according to your data
\NameSurname{Name Surname}
-%----------------------------------------------------------------------
-% Article data
-%----------------------------------------------------------------------
+%---------------------------------------------------------------------%
+% Article data %
+%---------------------------------------------------------------------%
% journal name
\JournalName{JournalName}
% title of your paper
@@ -25,9 +25,9 @@
\AssociateEditor{Prof. Name Surname}
-%----------------------------------------------------------------------
-% Response letter main part
-%----------------------------------------------------------------------
+%---------------------------------------------------------------------%
+% Response letter main part %
+%---------------------------------------------------------------------%
% No need to change the following part - here for customization
% Line spacing
\renewcommand{\baselinestretch}{1.3}
@@ -44,7 +44,7 @@
\signature{\pNameSurname (On behalf of all Authors)\newline \break
University of City}
-%----------------------------------------------------------------------
+%---------------------------------------------------------------------%
\Introduction{We would like to Thank you very much for your help, kindness, and your willingness by giving us a chance to submit our manuscript to the review process of your journal. We have studied each comment carefully and had acted upon every point raised by the reviewers. \newline \break
We also revised our manuscript as suggested by reviewers. We made changes which enhance the written quality and flow of the paper. \newline \break
@@ -52,12 +52,12 @@ Below, we have highlighted responses to each comment from the reviewers and indi
Looking forward to hearing from you soon.}
\ReviewerThank{Authors would like to sincerely thank the both Reviewers for the time spent on reading and commenting the manuscript. The given remarks are very thorough and extremely helpful to overcome the shortcomings and ambiguities in the manuscript. The Reviewer's effort is highly appreciated. In what follows, a point-by-point reply to the Reviewer’s remarks, comments and suggestions is given.}
-%----------------------------------------------------------------------
+%---------------------------------------------------------------------%
% Possible colors for reviewers are:
% red, green, blue, cyan, magenta, yellow, black, gray, white, darkgray,
% lightgray, brown, lime, olive, orange, pink, purple, teal, violet
% Refer to the xcolor package for more information
-%----------------------------------------------------------------------
+%---------------------------------------------------------------------%
\begin{document}
\loadgeometry{title}
@@ -99,7 +99,7 @@ Responses to Reviewers Comments on\\
\end{titlepage}
%----------------------------------------------------------------------%
-% Table of contents %
+% Table of contents %
%----------------------------------------------------------------------%
\tableofcontents
@@ -142,6 +142,8 @@ General comment of reviewer to the author.
\response{false}{blue}{This is the response}
+\clearpage
+
\referee{}\newline
Comments to the Author.
@@ -151,11 +153,27 @@ General comment of reviewer to the author.
\comment{This is the comment}
-\response{false}{blue}{This is the response}
+\response{false}{blue}{Authors thanks the Reviewer 1 for his/her positive mention about our work. Authors thanks the Reviewer 1 for his/her positive mention about our work. Authors thanks the Reviewer 1 for his/her positive mention about our work.}
\comment{This is the comment}
-\response{false}{blue}{This is the response}
+\response{true}{red}{
+ \begin{center}
+ \begin{tabular}{|c|c|c|}
+ \hline
+ A & B & C \\
+ \hline
+ D & E & F \\
+ \hline
+ G & H & I \\
+ \hline
+ \end{tabular}
+ \end{center}
+}
+\response{true}{blue}{Authors thanks the Reviewer 1 for his/her positive mention about our work.}
+
+% Missing reviewer, skip a number
+\missingreferee
\referee{}\newline
...
diff --git a/macros/latex/contrib/lastpage/README b/macros/latex/contrib/lastpage/README
index db1183b2e4..50b80f6b3a 100644
--- a/macros/latex/contrib/lastpage/README
+++ b/macros/latex/contrib/lastpage/README
@@ -1,4 +1,4 @@
-README for lastpage package, 2023-10-06, v2.0d
+README for lastpage package, 2023-10-14, v2.0e
TABLE OF CONTENTS
diff --git a/macros/latex/contrib/lastpage/lastpage-example.pdf b/macros/latex/contrib/lastpage/lastpage-example.pdf
index fa09069a0a..1062a3273e 100644
--- a/macros/latex/contrib/lastpage/lastpage-example.pdf
+++ b/macros/latex/contrib/lastpage/lastpage-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/lastpage/lastpage.dtx b/macros/latex/contrib/lastpage/lastpage.dtx
index f5352a3dbe..ed088fea50 100644
--- a/macros/latex/contrib/lastpage/lastpage.dtx
+++ b/macros/latex/contrib/lastpage/lastpage.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
%
% File: lastpage.dtx
-% Version: 2023-10-06 v2.0d
+% Version: 2023-10-14 v2.0e
% Info: Refers to last page's name
%
% Copyright © 2010 - 2023 by
@@ -66,7 +66,7 @@
\input docstrip.tex
\Msg{**********************************************************************}
\Msg{* Installation *}
-\Msg{* Package: lastpage 2023-10-06 v2.0d Refers to last page's name (HMM)*}
+\Msg{* Package: lastpage 2023-10-14 v2.0e Refers to last page's name (HMM)*}
\Msg{**********************************************************************}
\keepsilent
@@ -78,7 +78,7 @@
This is a generated file.
Project: lastpage
-Version: 2023-10-06 v2.0d
+Version: 2023-10-14 v2.0e
Info: Refers to last page's name
Copyright (C) 2010 - 2023 by
@@ -186,7 +186,7 @@ In memoriam
%<*driver>
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
\ProvidesFile{lastpage.drv}%
- [2023-10-06 v2.0d Refers to last page's name (HMM)]
+ [2023-10-14 v2.0e Refers to last page's name (HMM)]
\documentclass{ltxdoc}[2023/03/28]% v2.1j Standard LaTeX documentation class
\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
@@ -244,14 +244,14 @@ In memoriam
% \DoNotIndex{\lastpageclassic.sty,\lastpagemodern.sty,\LaTeX,\LaTeX-kernel,\listfiles}
% \DoNotIndex{\makeatletter,\makeatother,\markboth,\mbox,\message,\MessageBreak}
% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newcounter,\newline,\newpage,\nobreak}
-% \DoNotIndex{\noindent,\normalsize,\numexpr,\origenddocument,\PackageError}
-% \DoNotIndex{\PackageWarning,\pagenumbering,\pageref,\pdfstringdef,\protect,\ProvidesPackage}
+% \DoNotIndex{\noindent,\normalsize,\numexpr,\origenddocument,\PackageError,\PackageWarning}
+% \DoNotIndex{\PackageWarningNoLine,\pagenumbering,\pageref,\pdfstringdef,\protect,\ProvidesPackage}
% \DoNotIndex{\qquad,\RequirePackage,\section,\ShowHook,\slshape,\smallskip,\space,\test,\textbf}
% \DoNotIndex{\textit,\textquotedblleft,\textquotedblright,\textsf,\texttt,\the,\thepage}
% \DoNotIndex{\today,\upshape,\url,\usepackage,\value,\verb,\wd,\write}
%
% \title{The \xpackage{lastpage} package}
-% \date{2023-10-06 v2.0d}
+% \date{2023-10-14 v2.0e}
% \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}\\
% invented by Jeffrey P. Goldberg\\\xemail{jeffrey+news at goldmark.org}}
%
@@ -756,7 +756,7 @@ In memoriam
pdfpagelayout=SinglePage%
}
\@ifpackageloaded{hyperref}{}{\usepackage{url}[2013/09/16]}% v3.4
-\usepackage{lastpage}[2023-10-06]% v2.0d
+\usepackage{lastpage}[2023-10-14]% v2.0e
\renewcommand{\@evenfoot}{%
\normalsize\slshape \today\hfil \upshape %
page \thepage{} of \pageref{LastPage}}
@@ -768,7 +768,7 @@ In memoriam
\section*{Example for lastpage}
\markboth{Example for lastpage}{Example for lastpage}
This example demonstrates the use of package\newline
-\textsf{lastpage}, v2.0d as of 2023-10-06 (HMM; JPG).\newline
+\textsf{lastpage}, v2.0e as of 2023-10-14 (HMM; JPG).\newline
The package takes no options.\newline
For more details please see the documentation!\newline
@@ -904,7 +904,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \DescribeMacro{lastpage.sty}
% We first need to determine whether we are on \TeX~2.09 or \LaTeX2e.\newline
% (That line, which is too long for the documentation, reads:\newline
-% |\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/06 v2.0d lastpage:|\linebreak
+% |\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/14 v2.0e lastpage:|\linebreak
% | 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}|.)
%
% \begin{macrocode}
@@ -912,7 +912,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%% Part of the "lastpage" package
%% loads either lastpage2.09.sty for TeX 2.09 or lastpage2e.sty for LaTeX 2e
%% with code from https://groups.google.com/g/comp.text.tex/c/-Qmhj1ZI4xM
-\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/06 v2.0d lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
+\def\loadlastpage{\ProvidesPackage{lastpage}[2023/10/14 v2.0e lastpage: 2.09 or 2e? (HMM)]\relax\RequirePackage{lastpage2e}}
\begingroup \expandafter \ifx \csname documentclass\endcsname\relax
\endgroup \expandafter \input{lastpage209.sty}
\else \endgroup \expandafter \loadlastpage
@@ -952,7 +952,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpage2e>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpage2e}[2023/10/06 v2.0d %
+\ProvidesPackage{lastpage2e}[2023/10/14 v2.0e %
Decide which 2e lastpage version to use (HMM)]
\@ifl@t@r\fmtversion{2022/11/01}{\RequirePackage{lastpagemodern}}{%
\RequirePackage{lastpageclassic}}
@@ -967,7 +967,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpageclassic>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{lastpageclassic}[2023/10/06 v2.0d %
+\ProvidesPackage{lastpageclassic}[2023/10/14 v2.0e %
Refers to last page's name (HMM; JPG)]
%% allows for things like "Page \thepage{} of \pageref{LastPage}"
%% to get "Page 7 of 9"
@@ -1130,16 +1130,20 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{macro}{\lastpage@putlabelhyper}%
% \indent When \xpackage{hyperref} has been loaded, the label is set with the
% |\lastpage@putlabelhyper| command. If the \xpackage{hyperref} package is used,
-% but page-anchors are disabled, the hyperlinking will not work.
+% but page-anchors are disabled, the hyperlinking will not work. (The warning will
+% also be shown, when only |\pageref*{LastPage}| is used (or neither one),
+% but without messing with |\pageref| we cannot detect this.)
%
% \begin{macrocode}
\newcommand{\lastpage@putlabelhyper}{%
\ifHy@pageanchor%
\else%
- \PackageError{lastpage}{hyperref option pageanchor disabled}{%
- The \string\pageref{LastPage} link doesn't work\MessageBreak%
+ \PackageWarningNoLine{lastpage}{%
+ The \string\pageref{LastPage} link does not work\MessageBreak%
using hyperref with disabled option `pageanchor'.\MessageBreak%
- }%
+ Better enable `pageanchor' or use\MessageBreak%
+ \string\pageref*{LastPage} (not generating a link)%
+ }%
\fi%
% \end{macrocode}
%
@@ -1381,7 +1385,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
%<*lastpagemodern>
%% Part of the "lastpage" package
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
-\ProvidesPackage{lastpagemodern}[2023-10-06 v2.0d %
+\ProvidesPackage{lastpagemodern}[2023-10-14 v2.0e %
Refers to last page's name (HMM; JPG)]
%% allows for things like "Page \thepage{} of \pageref{LastPage}"
%% to get "Page 7 of 9" or "Page VII of IX";
@@ -1544,14 +1548,18 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \noindent Otherwise the label is set:\newpage
%
% \noindent If the \xpackage{hyperref} package is used, but page-anchors are disabled,
-% the hyperlinking will not work.
+% the hyperlinking will not work. (The warning will also be shown, when only
+% |\pageref*{LastPage}| is used (or neither one), but without messing with |\pageref|
+% we cannot detect this.)
%
% \begin{macrocode}
\IfPackageLoadedTF{hyperref}{\ifHy@pageanchor\else%
- \PackageError{lastpage}{hyperref option pageanchor disabled}{%
+ \PackageWarningNoLine{lastpage}{%
The \string\pageref{LastPage} link does not work\MessageBreak%
using hyperref with disabled option `pageanchor'.\MessageBreak%
- }\fi}{}%
+ Better enable `pageanchor' or use\MessageBreak%
+ \string\pageref*{LastPage} (not generating a link)%
+ }\fi}{}%
\begingroup%
% \end{macrocode}
%
@@ -1781,7 +1789,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX, \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
+% \item[-] package \xpackage{lastpage}, 2023-10-14, v2.0e,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
%
@@ -1791,7 +1799,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \begin{description}
% \item[-] \TeX-format \LaTeX{}, v2.09
%
-% \item[-] package \xpackage{lastpage209}, 2023-10-06, v2.0d,
+% \item[-] package \xpackage{lastpage209}, 2023-10-14, v2.0e,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and does not work with \xpackage{hyperref}, which needs \LaTeX2e{}.
@@ -1803,7 +1811,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} 1994/12/01 or newer,
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
+% \item[-] package \xpackage{lastpage}, 2023-10-14, v2.0e,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
%
@@ -1814,7 +1822,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} between 1994/12/01 and 2022/11/01,\newline
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
+% \item[-] package \xpackage{lastpage}, 2023-10-14, v2.0e,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and can use
@@ -1830,7 +1838,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% \item[-] \TeX-format \LaTeXe{} 2022-11-01, better yet 2023-06-01 or newer,\newline
% \url{https://www.CTAN.org}
%
-% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
+% \item[-] package \xpackage{lastpage}, 2023-10-14, v2.0e,
% \url{https://ctan.org/pkg/lastpage}
% \end{description}
% and can use
@@ -1843,7 +1851,7 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% The |lastpage-example.tex| requires the same file as all
% documents using the \xpackage{lastpage} package, i.\,e.
% \begin{description}
-% \item[-] package \xpackage{lastpage}, 2023-10-06, v2.0d,
+% \item[-] package \xpackage{lastpage}, 2023-10-14, v2.0e,
% \url{https://ctan.org/pkg/lastpage}\newline
% (Well, it is the example file for this package, and because you are reading the
% documentation for the \xpackage{lastpage} package, it can be assumed that you already
@@ -2314,6 +2322,9 @@ To see the content of the \texttt{enddocument/afterlastpage}-hook
% in a plain format in the label in the \xfile{aux} file, so that it can be extracted
% to perform calculations with it.
% \end{Version}
+% \begin{Version}{2023-10-14 v2.0e}
+% \item Replaced a |\PackageError| by |\PackageWarningNoLine| as suggested by \textsc{Ulrike Fischer}.
+% \end{Version}
% \end{History}
% \bigskip
%
diff --git a/macros/latex/contrib/lastpage/lastpage.pdf b/macros/latex/contrib/lastpage/lastpage.pdf
index 5b6d002822..bd129a18b2 100644
--- a/macros/latex/contrib/lastpage/lastpage.pdf
+++ b/macros/latex/contrib/lastpage/lastpage.pdf
Binary files differ
diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
index 1f3ab4aafb..de905b070a 100644
--- a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
+++ b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
index 289cfeb33b..b11a0c5289 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
@@ -623,6 +623,7 @@
\end{MyboxTrivial}%
}{}%
}%
+ \setlength{\tabcolsep}{4\tabcolsep}%
}%
\NewDocumentCommand\CartesTrivialPersoold{}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex b/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
index 253f12533d..41039e7ab6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDecomposerNombrePremier.tex
@@ -704,6 +704,43 @@
}
}
+\NewDocumentCommand\PfCSommeChiffres{m}{%
+ \xdef\PfCSMSomme{0}%
+ \ensuremath{
+ \StrLen{#1}[\PfCSMLongueur]
+ \xintFor* ##1 in{\xintSeq{1}{\PfCSMLongueur}}\do{
+ \StrChar{#1}{##1}[\PfCSMChiffre]
+ \xdef\PfCSMSomme{\fpeval{\PfCSMSomme+\PfCSMChiffre}}
+ \num{\PfCSMChiffre}\xintifForLast{=}{+}
+ }
+ \num{\fpeval{\PfCSMSomme}}
+ }%
+}%
+
+\newcommand\ListeTousFacteursPremier[1]{%
+ %#1 : le nombre entier \`a tester
+ \ensuremath{%
+ \newcount\anpl\newcount\bnpl\newcount\cnpl%
+ \newcount\pilebl%
+ \anpl=#1\relax%
+ \bnpl=2\relax%
+ \pilebl=2\relax%
+ \xdef\PfCPileFacteurs{}%
+ \whiledo{\the\anpl > 1}{%
+ \modulo{\the\anpl}{\the\bnpl}
+ \ifnum\remainder=0\relax
+ \cnpl=\numexpr\anpl/\bnpl\relax
+ \xdef\PfCPileFacteurs{\PfCPileFacteurs\the\bnpl}%
+% \num{\the\bnpl}\ifnum\anpl>\bnpl\times\fi%
+ \anpl=\cnpl\relax
+ \else%
+ \bnpl=\numexpr\bnpl+1\relax%
+ \pilebl=\bnpl\relax%
+ \fi%
+ }%
+ }%
+}%
+
\newcommand\ListeDiviseur[1]{%#1 : le nombre entier \`a tester
\newcount\anp\newcount\bnp%
\anp=#1%
diff --git a/macros/latex/contrib/profcollege/latex/PfCJeton.tex b/macros/latex/contrib/profcollege/latex/PfCJeton.tex
new file mode 100644
index 0000000000..e3012070f2
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCJeton.tex
@@ -0,0 +1,40 @@
+%%%
+% Jeton
+%%%
+\setKVdefault[Jeton]{Diametre=5mm,Impression=false}%
+
+\NewDocumentCommand\Jeton{om}{%
+ \useKVdefault[Jeton]%
+ \setKV[Jeton]{#1}%
+ \ifluatex%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\PfCListeJeton{#2}%
+ \foreachitem\compteur\in\PfCListeJeton{\BuildJeton{\PfCListeJeton[\compteurcnt]}}%
+ \reademptyitems%
+ \fi%
+}%
+
+\NewDocumentCommand\BuildJeton{m}{%
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}
+ input fiziko;
+
+ boolean Impression;
+ Impression=\useKV[Jeton]{Impression};
+ numeric Diametre;
+ Diametre=\useKV[Jeton]{Diametre};
+ color Fond;
+ Fond= if Impression:white else:BurlyWood fi;
+
+ path p;
+ p:=fullcircle scaled Diametre;
+ fill p withcolor Fond;
+ JetonAngle:=45+uniformdeviate(30);
+ Intensite:=0.3+uniformdeviate(2)/10;
+ draw woodenThing(p,JetonAngle) withcolor Intensite*Fond;
+ draw p;
+ label(TEX("\bfseries "&decimal(#1)),(0,0));
+ \end{mplibcode}
+ \fi%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCKakuro.tex b/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
index 9f2d7bf47a..1f8d7f3f49 100644
--- a/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCKakuro.tex
@@ -22,15 +22,15 @@
\readlist*\ListeKakuroNombres{\ListeAvantNombres}%
\savecomparemode%
\comparestrict%
- \begin{NiceTabular}{*{\useKV[Kakuro]{TLargeur}}{m{\useKV[Kakuro]{Largeur}}}}[hvlines]
+ \begin{NiceTabular}{*{\useKV[Kakuro]{TLargeur}}{m{\useKV[Kakuro]{Largeur}}}}[hvlines]%
\xintFor* ##1 in {\xintSeq{0}{\fpeval{\useKV[Kakuro]{THauteur}-1}}}\do{%
\xintFor* ##2 in {\xintSeq{1}{\useKV[Kakuro]{TLargeur}}}\do{%
\rule{0pt}{\PfCKakuro}%
- \StrCompare{\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2},1]}{*}[\PfCTestBlack]
+ \StrCompare{\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2},1]}{*}[\PfCTestBlack]%
\xintifboolexpr{\PfCTestBlack==0}{%
\Block[fill=black]{1-1}{}%
}{%
- \xintifboolexpr{\listlen\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2}]==2}{
+ \xintifboolexpr{\listlen\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2}]==2}{%
\Block[fill=\useKV[Kakuro]{CouleurCase}]{1-1}{\diagbox{\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2},1]}{\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2},2]}}%
}{%
\Block{1-1}{\ifboolKV[Kakuro]{Solution}{\Large\color{\useKV[Kakuro]{CouleurSolution}}\num{\ListeCasesKK[\fpeval{\useKV[Kakuro]{TLargeur}*##1+##2},1]}}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCLego.tex b/macros/latex/contrib/profcollege/latex/PfCLego.tex
new file mode 100644
index 0000000000..fb18636d62
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCLego.tex
@@ -0,0 +1,143 @@
+%%%
+% Lego
+%%%
+\setKVdefault[Lego]{Couleur=LightSteelBlue,Unite=8,Diviseur=2,Perso=false,Plaque=false}%
+\defKV[Lego]{ListePerso=\setKV[Lego]{Perso}\xdef\PfCFooLegoListePerso{#1}}%
+
+\NewDocumentCommand\ChoixCouleur{m}{%
+ \xdef\ListeCouleurs{Maroon,PeachPuff,Yellow,red,Gray,Crimson,Cornsilk,Purple,Cornsilk,Salmon}%
+ \readlist*\PfCListeCouleurs{\ListeCouleurs}%
+ \xintifboolexpr{\fpeval{#1+1}>\PfCListeCouleurslen}{\textbf{! Vous demandez trop de couleurs !}}{%
+ \MelangeListe{1,2,3,4,5,6,7,8,9,10}{\fpeval{#1+1}}%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRotation{\faa}%
+ \xintFor* ##2 in{\xintSeq{1}{#1}}\do{%
+ \xdef\RetiensCouleur{\ListeRotation[##2]}%
+ \xintifForFirst{\xdef\FooCouleur{\PfCListeCouleurs[\RetiensCouleur]}}{\xdef\FooCouleur{\FooCouleur,\PfCListeCouleurs[\RetiensCouleur]}}%
+ }%
+ }%
+}%
+
+\NewDocumentCommand\Lego{o}{%
+ \useKVdefault[Lego]%
+ \setKV[Lego]{#1}%
+ \xdef\PfCNbCouleurs{\fpeval{floor(\useKV[Lego]{Unite}/\useKV[Lego]{Diviseur})}}%
+ \ChoixCouleur{\PfCNbCouleurs}%
+ \ifboolKV[Lego]{Perso}{%
+ \BuildBarreLego{\FooCouleur}{\PfCFooLegoListePerso}%
+ }{%
+ \BuildBarreLego{\FooCouleur}{}%
+ }%
+}%
+
+\NewDocumentCommand\BuildBarreLego{mm}{%
+ \ifluatex%
+ \mplibforcehmode%
+ \begin{mplibcode}
+ boolean Plaque;
+ Plaque=\useKV[Lego]{Plaque};
+
+ input PfCLego;
+ %
+ vardef ChoixCouleur(text t)=
+ color Brique[];
+ nbc:=0;
+ for p_=t:
+ Brique[nbc]=p_;
+ nbc:=nbc+1;
+ endfor;
+ enddef;
+ %
+ vardef ListePerso(text t)=
+ nbperso=0;
+ for p_=t:
+ Diviseurs[nbperso]=p_;
+ nbperso:=nbperso+1;
+ endfor;
+ enddef;
+ %
+ ChoixCouleur(#1);
+ %
+ Longueur=\useKV[Lego]{Unite};
+ Largeur=2;
+ Diviseur=\useKV[Lego]{Diviseur};
+ color BriqueUnite;
+ BriqueUnite=\useKV[Lego]{Couleur};
+ boolean Perso;
+ Perso=\useKV[Lego]{Perso};
+ %
+ euler(-45,0,0);
+ if Plaque:
+ lego_height_old:=lego_height;
+ lego_height:=lego_thickness;
+ TR:=(0,1,0);
+ Lego_box(2*Longueur,4*Largeur,Gold);
+ TR:=(0,0,0);
+ lego_height:=lego_height_old;
+ fi;
+ Lego_box(Longueur,Largeur,BriqueUnite);
+ if Perso:
+ Somme=0;
+ ListePerso(#2);
+ for k=0 upto (nbperso-1):
+ TR:=(0.5*(Longueur-Diviseurs[k]-Somme),2,0);
+ Lego_box(Diviseurs[k],2,Brique[k]);
+ Somme:=Somme+2*Diviseurs[k];
+ endfor;
+ else:
+ for k=0 upto ((Longueur div Diviseur)-1):
+ TR:=(0.5*(Longueur-Diviseur)-k*Diviseur,2,0);
+ Lego_box(Diviseur,2,Brique[k]);
+ endfor;
+ fi;
+ \end{mplibcode}
+ \else
+ \begin{mpost}
+ input PfCLego;
+ %
+ vardef ChoixCouleur(text t)=
+ color Brique[];
+ nbc:=0;
+ for p_=t:
+ Brique[nbc]=p_;
+ nbc:=nbc+1;
+ endfor;
+ enddef;
+ %
+ vardef ListePerso(text t)=
+ nbperso=0;
+ for p_=t:
+ Diviseurs[nbperso]=p_;
+ nbperso:=nbperso+1;
+ endfor;
+ enddef;
+ %
+ ChoixCouleur(#1);
+ %
+ Longueur=\useKV[Lego]{Unite};
+ Largeur=2;
+ Diviseur=\useKV[Lego]{Diviseur};
+ color BriqueUnite;
+ BriqueUnite=\useKV[Lego]{Couleur};
+ boolean Perso;
+ Perso=\useKV[Lego]{Perso};
+ %
+ euler(-45,0,0);
+ Lego_box(Longueur,Largeur,BriqueUnite);
+ if Perso:
+ Somme=0;
+ ListePerso(#2);
+ for k=0 upto (nbperso-1):
+ TR:=(0.5*(Longueur-Diviseurs[k]-Somme),2,0);
+ Lego_box(Diviseurs[k],2,Brique[k]);
+ Somme:=Somme+2*Diviseurs[k];
+ endfor;
+ else:
+ for k=0 upto ((Longueur div Diviseur)-1):
+ TR:=(0.5*(Longueur-Diviseur)-k*Diviseur,2,0);
+ Lego_box(Diviseur,2,Brique[k]);
+ endfor;
+ fi;
+ \end{mpost}
+ \fi%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex b/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex
index 634baa969e..1c42d433a6 100644
--- a/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCMotsEmpiles.tex
@@ -5,7 +5,7 @@
\newcounter{CompteurMotEmpile}
-\newcommand\MotsEmpiles[2][]{%
+\NewDocumentCommand\MotsEmpiles{om}{%
\useKVdefault[ClesMotEmpile]%
\setKV[ClesMotEmpile]{#1}%
\setcounter{CompteurMotEmpile}{0}%
@@ -18,17 +18,17 @@
\xintifboolexpr{\ListeMotsEmpilesMax<\fpeval{\ListeMotsEmpiles[\compteurcnt,1]+\LongueurMot}}{\xdef\ListeMotsEmpilesMax{\fpeval{\ListeMotsEmpiles[\compteurcnt,1]+\LongueurMot}}}{}%
}%
\begin{NiceTabular}{c|*{\fpeval{\ListeMotsEmpilesMax}}{m{10pt}}}%
- \Block{1-\fpeval{\useKV[ClesMotEmpile]{Colonne}+2}}{}\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesMotEmpile]{Colonne}}}}\do{&}&$\downarrow$\xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeMotsEmpilesMax-\useKV[ClesMotEmpile]{Colonne}-1}}}\do{&}\\
+ \Block{1-\fpeval{\useKV[ClesMotEmpile]{Colonne}+2}}{}\xintFor* ##1 in {\xintSeq {1}{\fpeval{\useKV[ClesMotEmpile]{Colonne}}}}\do{&}&\Block{}{$\downarrow$}\xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeMotsEmpilesMax-\useKV[ClesMotEmpile]{Colonne}-1}}}\do{&}\\
\xintFor* ##1 in {\xintSeq {1}{\fpeval{\ListeMotsEmpileslen}}}\do{%
\rule[-1.2ex]{0pt}{3.8ex}\stepcounter{CompteurMotEmpile}\Alph{CompteurMotEmpile}&\Block{1-\fpeval{\ListeMotsEmpiles[##1,1]}}{}\xintFor* ##2 in {\xintSeq {1}{\fpeval{\ListeMotsEmpiles[##1,1]}}}\do{%
&
}%
\StrLen{\ListeMotsEmpiles[##1,2]}[\LongueurMot]%
\xintFor* ##3 in {\xintSeq {1}{\fpeval{\LongueurMot}}}\do{%
- \xintifForFirst{}{&}\Block[draw=black]{1-1}{\ifboolKV[ClesMotEmpile]{Solution}{\centering\arraybackslash\StrMid{\ListeMotsEmpiles[##1,2]}{##3}{##3}}{}}%%
+ \xintifForFirst{}{&}\Block[draw=black,b]{1-1}{\ifboolKV[ClesMotEmpile]{Solution}{\StrMid{\ListeMotsEmpiles[##1,2]}{##3}{##3}}{}}%
}%
\\
}%
- \CodeAfter\tikz\draw[line width=1.5pt,MotEmpileCouleur](row-2-|col-\fpeval{\useKV[ClesMotEmpile]{Colonne}+2}) rectangle (row-\fpeval{\ListeMotsEmpileslen+2}-|col-\fpeval{\useKV[ClesMotEmpile]{Colonne}+3});
+ \CodeAfter\tikz\draw[line width=1.5pt,MotEmpileCouleur](row-2-|col-\fpeval{\useKV[ClesMotEmpile]{Colonne}+2}) rectangle (row-\fpeval{\ListeMotsEmpileslen+2}-|col-\fpeval{\useKV[ClesMotEmpile]{Colonne}+3});%
\end{NiceTabular}%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
index fd505aa3e0..22ea023935 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterTableur.tex
@@ -28,7 +28,7 @@
\newlength\PfCTableurLargeurUn%
\newlength\PfCTableurLargeur%
-\RequirePackage{printlen}
+%\RequirePackage{printlen}
\newenvironment{Tableur}[1][]{%
\useKVdefault[Tableur]%
@@ -36,8 +36,8 @@
\setlength{\PfCTableurLargeurUn}{\fpeval{\useKV[Tableur]{LargeurUn}}pt}%
\setlength{\PfCTableurLargeur}{\fpeval{\useKV[Tableur]{Largeur}}pt}%
\ttfamily%
- \newcolumntype{Y}{>{\centering\arraybackslash}m{\PfCTableurLargeurUn}}%
- \newcolumntype{X}{>{\centering\arraybackslash}m{\PfCTableurLargeur}}%
+ \newcolumntype{A}{>{\centering\arraybackslash}m{\PfCTableurLargeurUn}}%
+ \newcolumntype{B}{>{\centering\arraybackslash}m{\PfCTableurLargeur}}%
\setlength{\PfCLongInter}{-40pt+\fpeval{\useKV[Tableur]{LargeurUn}}pt+\fpeval{(\useKV[Tableur]{Colonnes}-2)*\useKV[Tableur]{Largeur}}pt+\fpeval{2*\useKV[Tableur]{Colonnes}-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}+2}\arrayrulewidth}%
\ifboolKV[Tableur]{Bandeau}{%
\begin{NiceTabular}{p{\PfCTableurLargeur}p{10pt}p{50pt}p{\PfCLongInter}}
@@ -56,7 +56,7 @@
\ifboolKV[Tableur]{Selection}{%
\xintifboolexpr{\cntlin>\useKV[Tableur]{Ligne} && \cntlin<\fpeval{\useKV[Tableur]{Ligne}+\useKV[Tableur]{PasL}+1}}{\textcolor{white}{\number\numexpr\cntlin-1\relax}}{\number\numexpr\cntlin-1\relax}%
}{\number\numexpr\cntlin-1\relax}\fi}%
- wc{20pt}Y*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{X}}[hvlines]%
+ wc{20pt}A*{\fpeval{\useKV[Tableur]{Colonnes}-1}}{B}}[hvlines]%
\CodeBefore
% on colorie en gris toute la première ligne
\tikz\fill[gray!15](row-1-|col-1) rectangle (row-2-|last);%
@@ -101,4 +101,4 @@
\repeat%
\addtot@b{\\&}%
\collectcp@body}{\the\t@b}%
-\makeatother \ No newline at end of file
+\makeatother
diff --git a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
index 0c870c5207..84d64c3f09 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
@@ -1,7 +1,7 @@
%%%
% 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,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep,Exterieur=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,CarreA=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false,Escalier=false,CubeA=false,Taille=5,Largeur=4.75em,Nom=PfCTableau,CodeAfter={},PuissancesSeules=false,Colonne=-1,Octet=false,CouleurGN=white,CadreGN=black,Tabcolsep=0.275\tabcolsep,Exterieur=false}%
\defKV[ClesTableaux]{ColonnesSup=\setKV[ClesTableaux]{Exterieur}}%
%
\newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}}% Top and Bottom strut
@@ -9,23 +9,23 @@
\newcommand\PfCBstrut{\rule[-1.2ex]{0pt}{0ex}}% Bottom strut
\newlength\PfCTableauPuissances%
-\newlength\PfCCubeTabColSep
+\newlength\PfCCubeTabColSep%
-\def\PfCCG{centaines de milliards}
-\def\PfCDG{dizaines de milliards}
-\def\PfCUG{unit\'es de milliards}
-\def\PfCCM{centaines de millions}
-\def\PfCDM{dizaines de millions}
-\def\PfCUM{unit\'es de millions}
-\def\PfCCm{centaines de milliers}
-\def\PfCDm{dizaines de milliers}
-\def\PfCUm{unit\'es de milliers}
-\def\PfCC{centaines}
-\def\PfCD{dizaines}
-\def\PfCU{unit\'es}
-\def\PfCd{dixi\`emes}
-\def\PfCc{centi\'emes}
-\def\PfCm{milli\`emes}
+\def\PfCCG{centaines de milliards}%
+\def\PfCDG{dizaines de milliards}%
+\def\PfCUG{unit\'es de milliards}%
+\def\PfCCM{centaines de millions}%
+\def\PfCDM{dizaines de millions}%
+\def\PfCUM{unit\'es de millions}%
+\def\PfCCm{centaines de milliers}%
+\def\PfCDm{dizaines de milliers}%
+\def\PfCUm{unit\'es de milliers}%
+\def\PfCC{centaines}%
+\def\PfCD{dizaines}%
+\def\PfCU{unit\'es}%
+\def\PfCd{dixi\`emes}%
+\def\PfCc{centi\'emes}%
+\def\PfCm{milli\`emes}%
\newcommand\Tableau[2][]{%
\useKVdefault[ClesTableaux]%
@@ -43,6 +43,10 @@
\xdef\PfCTableauUnite{\cubic\meter}%
\xdef\PfCCoefConversion{1000}%
}{}%
+ \ifboolKV[ClesTableaux]{CubeA}{%
+ \xdef\PfCTableauUnite{\cubic\meter}%
+ \xdef\PfCCoefConversion{1000}%
+ }{}%
\ifboolKV[ClesTableaux]{Gramme}{%
\xdef\PfCTableauUnite{\gram}%
\xdef\PfCCoefConversion{10}%
@@ -1219,6 +1223,87 @@
\]%
}{}%
%
+ % Carré Eve
+ %
+ \ifboolKV[ClesTableaux]{CarreA}{%
+ \[\renewcommand{\arraystretch}{1.15}%
+ \begin{NiceTabular}{*{7}{wc{20pt}wc{20pt}}}%
+ \Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}\\
+ \Block[borders={left,top}]{1-1}{}&\Block[borders=top]{1-1}{km$^2$\PfCTBstrut}&
+ \Block[borders={left,top}]{1-1}{}&\Block[borders=top]{1-1}{hm$^2$\PfCTBstrut}&
+ \Block[borders={left,top}]{1-1}{}&\Block[borders=top]{1-1}{dam$^2$\PfCTBstrut}&
+ \Block[borders={left,top}]{1-1}{}&\Block[borders=top]{1-1}{m$^2$\PfCTBstrut}&
+ \Block[borders={left,top}]{1-1}{}&\Block[borders=top]{1-1}{dm$^2$\PfCTBstrut}&
+ \Block[borders={left,top}]{1-1}{}&\Block[borders=top]{1-1}{cm$^2$\PfCTBstrut}&
+ \Block[borders={left,top}]{1-1}{}&\Block[borders={top,right}]{1-1}{mm$^2$\PfCTBstrut}\\
+ \ifboolKV[ClesTableaux]{Are}{%
+ \Block[borders={left,right,bottom}]{1-2}{}&&\Block[draw=gray!50,borders={left,top,bottom}]{}{~}&\Block[borders={top,right,bottom}]{}{\scriptsize ha}&\Block[draw=gray!50,borders={left,top,bottom}]{}{~}&\Block[borders={top,right,bottom}]{}{\scriptsize a}&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&&\Block[borders={left,right,bottom}]{1-2}{}&\\
+ }{\hline}%
+ \xintFor* ##1 in {\xintSeq {1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ &&&&&&&&&&&&&\\
+ }%
+ \Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}%
+ &&\Block[]{1-2}{}\\
+ \CodeAfter
+ % on trace les lignes verticales
+ \xintifboolexpr{\useKV[ClesTableaux]{Are}}{%
+ \xintFor* ##1 in {\xintSeq{1}{8}}\do{%
+ \tikz\draw (4-|\fpeval{2*(##1-1)+1})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+1});
+ }%
+ \xintFor* ##1 in {\xintSeq{1}{7}}\do{%
+ \tikz\draw[gray!50] (4-|\fpeval{2*(##1-1)+2})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+2});
+ }%
+ }{%
+ \xintFor* ##1 in {\xintSeq{1}{8}}\do{%
+ \tikz\draw (3-|\fpeval{2*(##1-1)+1})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+1});
+ }%
+ \xintifboolexpr{\useKV[ClesTableaux]{Colonnes}}{%
+ \xintFor* ##1 in {\xintSeq{1}{7}}\do{%
+ \tikz\draw[gray!50] (3-|\fpeval{2*(##1-1)+2})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{2*(##1-1)+2});
+ }%
+ }{}%
+ }%
+ % On place le nombre éventuel
+ \ifx\bla#2\bla%
+ \else%
+ \setsepchar[*]{,*/}
+ \readlist*\ListeNombreAPlacer{#2}%
+ \xintFor* ##2 in{\xintSeq {1}{\ListeNombreAPlacerlen}}\do{
+ \StrLen{\ListeNombreAPlacer[##2,1]}[\TabLongueurNombre]%
+ \xintFor* ##1 in{\xintSeq {1}{\TabLongueurNombre}}\do{%
+ \tikz\node at (\fpeval{##2+\ifboolKV[ClesTableaux]{Are}{3.5}{2.5}}-|\fpeval{\ListeNombreAPlacer[##2,2]-0.5+##1}) {\PfCTBstrut\StrMid{\ListeNombreAPlacer[##2,1]}{##1}{##1}};
+ }%
+ }
+ \fi%
+ % on trace les flèches
+ \ifboolKV[ClesTableaux]{Fleches}{\setKV[ClesTableaux]{FlechesH,FlechesB}}{}%
+ \ifboolKV[ClesTableaux]{Are}{\xdef\PfCTableauDepart{4}}{\xdef\PfCTableauDepart{3}}%
+ \ifboolKV[ClesTableaux]{FlechesH}{%
+ \xintFor* ##1 in {\xintSeq{1}{6}}\do{%
+ \tikz\draw[gray,->,>=latex,out=30,in=150] (1.5-|\fpeval{2*##1+0.5}) to node[above, midway]{\small$\times\num{100}$}(1.5-|\fpeval{2*(##1+1)+0.5});%
+ }%
+ }{}%
+ \ifboolKV[ClesTableaux]{FlechesB}{%
+ \xintFor* ##1 in {\xintSeq{1}{6}}\do{%
+ \tikz\draw[gray,->,>=latex,out=-150,in=-30] (\fpeval{\PfCTableauDepart+\useKV[ClesTableaux]{NbLignes}+0.5}-|\fpeval{2*(##1+1)+0.5}) to node[below,midway]{\small$\div\num{100}$}(\fpeval{\PfCTableauDepart+\useKV[ClesTableaux]{NbLignes}+0.5}-|\fpeval{2*##1+0.5});%
+ }%
+ }{}%
+ \useKV[ClesTableaux]{CodeAfter}%
+ \end{NiceTabular}
+ \]%
+ }{}%
+ %
%%% Prise en compte de la cl\'e Cube
%
\ifboolKV[ClesTableaux]{Cube}{%
@@ -1299,6 +1384,85 @@
\end{NiceTabular}
\]%
}{}%
+ %
+ %%% Prise en compte de la cl\'e CubeA (Idée d'Eve Chambon)
+ %
+ \ifboolKV[ClesTableaux]{CubeA}{%
+ \setlength{\PfCCubeTabColSep}{\useKV[ClesTableaux]{Tabcolsep}}
+ \[\renewcommand{\arraystretch}{1.15}%
+ \setlength{\tabcolsep}{\PfCCubeTabColSep}%
+ \begin{NiceTabular}{*{7}{wc{25pt}wc{25pt}wc{25pt}}}
+ \Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}\\
+ \Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{km$^3$\PfCTBstrut}&\Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{hm$^3$\PfCTBstrut}&\Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{dam$^3$\PfCTBstrut}&\Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{m$^3$\PfCTBstrut}&\Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{dm$^3$\PfCTBstrut}&\Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{cm$^3$\PfCTBstrut}&\Block[borders={left,top}]{1-1}{}&\Block[borders={top}]{1-1}{}&\Block[borders={top,right}]{1-1}{mm$^3$\PfCTBstrut}\\
+ \ifboolKV[ClesTableaux]{Capacite}{%
+ \Block[borders={left,right,bottom}]{1-3}{}&&&\Block[borders={right,bottom}]{1-3}{}&&&\Block[borders={right,bottom}]{1-3}{}&&&\Block[borders={right,bottom}]{1-3}{}&&&\Block[draw=gray!50,borders={top,left,bottom}]{}{\scriptsize hL}&\Block[draw=gray!50,borders={top,bottom}]{}{\scriptsize daL}&\Block[draw=gray!50,borders={top,right,bottom}]{}{\scriptsize L}&\Block[draw=gray!50,borders={top,left,bottom}]{}{\scriptsize dL}&\Block[draw=gray!50,borders={top,bottom}]{}{\scriptsize cL}&\Block[draw=gray!50,borders={top,right,bottom}]{}{\scriptsize mL}&\Block[borders={right,bottom}]{1-3}{}&&\\
+ }{\hline}%
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ &&&&&&&&&&&&&&&&&&&&\\
+ }%
+ \Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}%
+ &&&\Block[]{1-3}{}\\
+ \CodeAfter
+ % on trace les lignes verticales
+ \xintifboolexpr{\useKV[ClesTableaux]{Capacite}}{%
+ \xintFor* ##1 in {\xintSeq{1}{8}}\do{%
+ \tikz\draw (4-|\fpeval{3*(##1-1)+1})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{3*(##1-1)+1});
+ }%
+ \xintFor* ##1 in {\xintSeq{1}{7}}\do{%
+ \tikz\draw[gray!50] (4-|\fpeval{3*(##1-1)+2})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{3*(##1-1)+2});
+ \tikz\draw[gray!50] (4-|\fpeval{3*##1})--(\fpeval{4+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{3*##1});
+ }%
+ }{%
+ \xintFor* ##1 in {\xintSeq{1}{8}}\do{%
+ \tikz\draw (3-|\fpeval{3*(##1-1)+1})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{3*(##1-1)+1});
+ }%
+ \xintifboolexpr{\useKV[ClesTableaux]{Colonnes}}{%
+ \xintFor* ##1 in {\xintSeq{1}{7}}\do{%
+ \tikz\draw[gray!50] (3-|\fpeval{3*(##1-1)+2})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{3*(##1-1)+2});
+ \tikz\draw[gray!50] (3-|\fpeval{3*##1})--(\fpeval{3+\useKV[ClesTableaux]{NbLignes}}-|\fpeval{3*##1});
+ }%
+ }{}%
+ }%
+ % On place le nombre éventuel
+ \ifx\bla#2\bla%
+ \else%
+ \setsepchar[*]{,*/}
+ \readlist*\ListeNombreAPlacer{#2}%
+ \xintFor* ##2 in{\xintSeq {1}{\ListeNombreAPlacerlen}}\do{
+ \StrLen{\ListeNombreAPlacer[##2,1]}[\TabLongueurNombre]%
+ \xintFor* ##1 in{\xintSeq {1}{\TabLongueurNombre}}\do{%
+ \tikz\node at (\fpeval{##2+\ifboolKV[ClesTableaux]{Capacite}{3.5}{2.5}}-|\fpeval{\ListeNombreAPlacer[##2,2]-0.5+##1}) {\PfCTBstrut\StrMid{\ListeNombreAPlacer[##2,1]}{##1}{##1}};
+ }%
+ }%
+ \fi%
+ % on trace les flèches
+ \ifboolKV[ClesTableaux]{Fleches}{\setKV[ClesTableaux]{FlechesH,FlechesB}}{}%
+ \ifboolKV[ClesTableaux]{Capacite}{\xdef\PfCTableauDepart{4}}{\xdef\PfCTableauDepart{3}}%
+ \ifboolKV[ClesTableaux]{FlechesH}{%
+ \xintFor* ##1 in {\xintSeq{1}{6}}\do{%
+ \tikz\draw[gray,->,>=latex,out=30,in=150] (1.5-|\fpeval{3.5+3*(##1-1)}) to node[above, midway]{\small$\times\num{1000}$}(1.5-|\fpeval{3.5+3*##1});%
+ }%
+ }{}%
+ \ifboolKV[ClesTableaux]{FlechesB}{%
+ \xintFor* ##1 in {\xintSeq{1}{6}}\do{%
+ \tikz\draw[gray,->,>=latex,out=-150,in=-30] (\fpeval{\PfCTableauDepart+\useKV[ClesTableaux]{NbLignes}+0.5}-|\fpeval{3.5+3*##1}) to node[below,midway]{\small$\div\num{1000}$}(\fpeval{\PfCTableauDepart+\useKV[ClesTableaux]{NbLignes}+0.5}-|\fpeval{3.5+3*(##1-1)});%
+ }%
+ }{}%
+ \useKV[ClesTableaux]{CodeAfter}%
+ \end{NiceTabular}
+ \]%
+ }{}%
%
%%% Prise en compte de la cl\'e Litre
%
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index cee8d5c58b..9cf41f3817 100644
--- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty
+++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
@@ -2,9 +2,9 @@
% licence : Released under the LaTeX Project Public License v1.3c
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}%
-\def\filedate{2023/10/08}%
+\def\filedate{2023/10/15}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-u}%
+\def\fileversion{0.99-z-v}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -599,6 +599,8 @@
}%\emoticon
}%\raisebox
}%
+\input{PfCLego}
+\input{PfCJeton}
\input{PfCDessinAlgo}
\input{PfCBonbon}
\input{PfCPattern}
diff --git a/macros/latex/contrib/profcollege/metapost/PfCLego.mp b/macros/latex/contrib/profcollege/metapost/PfCLego.mp
new file mode 100644
index 0000000000..1b5c8fc7ae
--- /dev/null
+++ b/macros/latex/contrib/profcollege/metapost/PfCLego.mp
@@ -0,0 +1,336 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Lego boxes by Anthony Phan.
+% file: lego.mp
+% last modification: January 29, 2001.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Licence? Feel-free-to-send-me-a-postcard
+%
+% Anthony Phan,
+%
+% D\'epartement de Math\'ematiques,
+% SP2MI, T\'el\'eport 2,
+% Boulevard Marie et Pierre Curie,
+% BP 30179,
+% F-86962 Futuroscope-Chasseneuil cedex.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+magnification=1;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Les figures d\'efinies par ce programme
+% repr\'esente une tentative de programmation
+% tridimensionnelle avec MetaPost. Les trucs
+% essentiels sont l'usage d'un rep\`ere par
+% lequel s'effectue la projection sur le plan,
+% et l'affichage des faces dans le plan dont
+% le contour est orient\'e positivement qui
+% corespondent alors \`a des faces visibles.
+%
+% Le niveau math\'ematique correspondant
+% \`a ce programme devrait \^etre le niveau
+% premier cycle en sciences.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Param\`etres de projection
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% Rep\`ere initial
+
+pair e_x,e_y,e_z,e_xi,e_yi,e_zi;
+e_xi=sqrt 0.5*dir 210;
+e_yi=sqrt 0.5*dir -30;
+e_zi=sqrt 0.5*dir 90;
+
+% trois coordonn\'ees du vecteur de profondeur,
+% il v\'erifie depth_xi*e_xi+depth_yi*e_yi+depth_zi*e_zi=(0,0);
+
+depth_xi:=-1; depth_yi:=-1; depth_zi:=-1;
+
+% Param\`etres d'\'eclairement
+
+% vecteur unitaire de l'origine \`a la source lumineuse
+
+light_xi=0; light_yi=0; light_zi=1;
+
+% r\'eglage du contraste
+
+light_min=0.25; light_max=1;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Param\`etres, unit\'es et mesures essentielles
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+color currentcolor; currentcolor=red;
+
+lego_unit :=magnification*0.8cm; % official
+lego_height :=1.2lego_unit; % official
+lego_plate_height:=0.4lego_unit; % official
+lego_thickness :=1/6lego_unit;
+lego_eps :=1/20lego_unit;
+lego_overshoot :=lego_plate_height-lego_thickness;%0.2133lego_unit;
+lego_diam :=lego_unit-2lego_thickness;
+lego_Diam :=(sqrt 2)*lego_unit-lego_diam;
+cyl_steps :=60;
+
+path upper_path, lower_path, temp_path;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Rotation du rep\`ere initial
+% selon des pr\'etendus angles d'Euler.
+% avec d\'etermination des facteurs d'ensoleillement.
+% et des facteurs de profondeur...
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+vardef euler(expr theta,phi,psi)=
+ save ctheta,stheta,cphi,sphi,cpsi,spsi;
+ ctheta=cosd theta; stheta=sind theta;
+ cphi=cosd phi; sphi=sind phi;
+ cpsi=cosd psi; spsi=sind psi;
+ %
+ e_x:= cphi*ctheta*e_xi + cphi*stheta*e_yi + sphi*e_zi;
+ e_y:=-(cpsi*stheta+spsi*sphi*ctheta)*e_xi
+ + (cpsi*ctheta-spsi*sphi*stheta)*e_yi
+ + spsi*cphi*e_zi;
+ e_z:=(spsi*stheta-cpsi*sphi*ctheta)*e_xi
+ - (spsi*ctheta+cpsi*sphi*stheta)*e_yi
+ + cpsi*cphi*e_zi;
+ %
+ light_x:= cphi*ctheta*light_xi + cphi*stheta*light_yi + sphi*light_zi;
+ light_y:=-(cpsi*stheta+spsi*sphi*ctheta)*light_xi
+ + (cpsi*ctheta-spsi*sphi*stheta)*light_yi
+ + spsi*cphi*light_zi;
+ light_z:=(spsi*stheta-cpsi*sphi*ctheta)*light_xi
+ - (spsi*ctheta+cpsi*sphi*stheta)*light_yi
+ + cpsi*cphi*light_zi;
+ %
+ depth_x:= cphi*ctheta*depth_xi + cphi*stheta*depth_yi + sphi*depth_zi;
+ depth_y:=-(cpsi*stheta+spsi*sphi*ctheta)*depth_xi
+ + (cpsi*ctheta-spsi*sphi*stheta)*depth_yi
+ + spsi*cphi*depth_zi;
+ depth_z:=(spsi*stheta-cpsi*sphi*ctheta)*depth_xi
+ - (spsi*ctheta+cpsi*sphi*stheta)*depth_yi
+ + cpsi*cphi*depth_zi;
+enddef;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Nous ne remplissons une face que
+% si elle est orient\'ee positivement.
+% L'argument ``factor'' correspond \`a
+% l'\'eclairement.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+def fill_special(expr p,factor)=
+ if turningnumber p>=0:
+ fill p withcolor mycolor factor
+ fi
+enddef;
+
+vardef mycolor expr factor=
+ ((0.5*(1+factor))[light_min,light_max])*currentcolor
+enddef;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% D\'etermination de l'ordre d'affichage (cylindres)
+% sur une ligne, sur un rectangle...
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+def ordered_row(expr e_n,e_m,depth_n,n)=
+ if depth_n<0:
+ for $=1 step 1 until n: row_command(e_n,e_m,$); endfor
+ else:
+ for $=n step -1 until 1: row_command(e_n,e_m,$); endfor
+ fi
+enddef;
+
+def ordered_rows(expr depth_n,depth_m,n,m)=
+ if depth_n<0:
+ if depth_m<0:
+ if depth_n<depth_m:
+ for $$=1 step 1 until m: for $=1 step 1 until n:
+ row_command($,$$); endfor endfor
+ else:
+ for $=1 step 1 until n: for $$=1 step 1 until m:
+ row_command($,$$); endfor endfor
+ fi
+ else:
+ if depth_n<depth_m:
+ for $$=m step -1 until 1: for $=1 step 1 until n:
+ row_command($,$$); endfor endfor
+ else:
+ for $=1 step 1 until n: for $$=m step -1 until 1:
+ row_command($,$$); endfor endfor
+ fi
+ fi
+ else:
+ if depth_m<0:
+ if depth_n<depth_m:
+ for $$=1 step 1 until m: for $=n step -1 until 1:
+ row_command($,$$); endfor endfor
+ else:
+ for $=n step -1 until 1: for $$=1 step 1 until m:
+ row_command($,$$); endfor endfor
+ fi
+ else:
+ if depth_n<depth_m:
+ for $$=m step -1 until 1: for $=n step -1 until 1:
+ row_command($,$$); endfor endfor
+ else:
+ for $=n step -1 until 1: for $$=m step -1 until 1:
+ row_command($,$$); endfor endfor
+ fi
+ fi
+ fi
+enddef;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Cylindres divers
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+def z_cylinder(expr basepoint,radius,height,external)=
+ lower_path:=(for i=0 upto cyl_steps:
+ basepoint+radius*cosd(i*360/cyl_steps)*e_x
+ +radius*sind(i*360/cyl_steps)*e_y --
+ endfor basepoint+radius*e_x);
+ upper_path:=lower_path shifted (height*e_z);
+ for i=0 upto cyl_steps:
+ fill_special(if external:
+ point i of lower_path--point (i+1) of lower_path
+ --point (i+1) of upper_path--point i of upper_path--cycle
+ else:
+ point i of upper_path--point (i+1) of upper_path
+ --point (i+1) of lower_path--point i of lower_path--cycle
+ fi,
+ if external: else: - fi
+ (cosd((i+0.5)*360/cyl_steps)*light_x
+ +sind((i+0.5)*360/cyl_steps)*light_y));
+ endfor
+enddef;
+
+def teton_command(expr $,$$)=
+ z_cylinder(M1+($-0.5)*lego_unit*e_x+($$-0.5)*lego_unit*e_y,
+ 0.5lego_diam-lego_eps,lego_overshoot,true);
+ fill_special(upper_path--cycle,light_z);
+enddef;
+
+def stick_command(expr e_n,e_m,$)=
+ z_cylinder(M1'+$*lego_unit*e_n+0.5lego_unit*e_m,
+ lego_thickness,lego_height-lego_thickness,true);
+ fill reverse lower_path--cycle withcolor mycolor -light_z;
+enddef;
+
+def cyl_command(expr $,$$)=
+ z_cylinder(M1'+$*lego_unit*e_x+$$*lego_unit*e_y,
+ 0.5lego_diam,lego_height-lego_thickness,false);
+ temp_path:=lower_path;
+ z_cylinder(M1'+$*lego_unit*e_x+$$*lego_unit*e_y,
+ 0.5lego_Diam,lego_height-lego_thickness,true);
+ fill (reverse lower_path)--temp_path--cycle
+ withcolor mycolor -light_z;
+enddef;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Le plat principal : Adaptation à plusieurs legos sur une même figure par CP
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+pair M[],M[]',M[]'',M[]''';
+
+numeric currentnumber;
+currentnumber=0;
+
+color TR;
+TR=(0,0,0);
+
+vardef Lego_box(expr n,m,lego_color)=
+ currentcolor:=lego_color;
+ currentnumber:=currentnumber+1;
+ %
+ % Points clefs de la brique
+ %
+ if currentnumber=1:
+ M1=0.5(-n*lego_unit*e_x-m*lego_unit*e_y+lego_height*e_z)+(lego_unit*redpart(TR)*e_x+lego_unit*greenpart(TR)*e_y+lego_height*bluepart(TR)*e_z);
+ M1'-M1=-lego_height*e_z;
+ M2-M1=M2'-M1'=n*lego_unit*e_x;
+ M3-M1=M3'-M1'=n*lego_unit*e_x+m*lego_unit*e_y;
+ M4-M1=M4'-M1'=m*lego_unit*e_y;
+ M1'''-M1+lego_thickness*e_z=M1''-M1'=lego_thickness*(e_x+e_y);
+ M2'''-M2+lego_thickness*e_z=M2''-M2'=lego_thickness*(-e_x+e_y);
+ M3'''-M3+lego_thickness*e_z=M3''-M3'=lego_thickness*(-e_x-e_y);
+ M4'''-M4+lego_thickness*e_z=M4''-M4'=lego_thickness*(e_x-e_y);
+ else:
+ M1:=0.5(-n*lego_unit*e_x-m*lego_unit*e_y+lego_height*e_z)+(lego_unit*redpart(TR)*e_x+lego_unit*greenpart(TR)*e_y+lego_height*bluepart(TR)*e_z);
+ M1':=M1-lego_height*e_z;
+ M2:=M1+n*lego_unit*e_x;
+ M2':=M1'+n*lego_unit*e_x;
+ M3:=M1+n*lego_unit*e_x+m*lego_unit*e_y;
+ M3':=M1'+n*lego_unit*e_x+m*lego_unit*e_y;
+ M4:=M1+m*lego_unit*e_y;
+ M4':=M1'+m*lego_unit*e_y;
+ M1''':=M1-lego_thickness*e_z+lego_thickness*(e_x+e_y);
+ M1'':=M1'+lego_thickness*(e_x+e_y);
+ M2''':=M2-lego_thickness*e_z+lego_thickness*(-e_x+e_y);
+ M2'':=M2'+lego_thickness*(-e_x+e_y);
+ M3''':=M3-lego_thickness*e_z+lego_thickness*(-e_x-e_y);
+ M3'':=M3'+lego_thickness*(-e_x-e_y);
+ M4''':=M4-lego_thickness*e_z+lego_thickness*(e_x-e_y);
+ M4'':=M4'+lego_thickness*(e_x-e_y);
+ fi;
+ %%
+ %% (face du dessus et t\'etons)
+ %% ou
+ %% (t\'etons, faces lat\'erales internes
+ %% et faces du dessous)
+ %%
+ if turningnumber(M1--M2--M3--M4--cycle)>0:
+ fill_special(M1--M2--M3--M4--cycle,light_z);
+ let row_command=teton_command;
+ ordered_rows(depth_x,depth_y,n,m);
+ else:
+ let row_command=teton_command;
+ ordered_rows(depth_x,depth_y,n,m);
+ fill_special(M4'''--M3'''--M2'''--M1'''--cycle,-light_z);
+ fill_special(M1''--M1'''--M2'''--M2''--cycle,light_y);
+ fill_special(M3''--M3'''--M4'''--M4''--cycle,-light_y);
+ fill_special(M1''--M4''--M4'''--M1'''--cycle,light_x);
+ fill_special(M2''--M2'''--M3'''--M3''--cycle,-light_x);
+ if (n>1) and (m>1):
+ let row_command=cyl_command;
+ ordered_rows(depth_x,depth_y,n-1,m-1);
+ else: if (n>1) and (m=1):
+ let row_command=stick_command;
+ ordered_row(e_x,e_y,depth_x,n-1); fi
+ if (n=1) and (m>1):
+ let row_command=stick_command;
+ ordered_row(e_y,e_x,depth_y,m-1); fi
+ fi
+ fill_special(M4'--M3'--M2'--M1'--M4'--M4''--M1''--M2''
+ --M3''--M4''--cycle,-light_z);
+ fi;
+ % %
+ % % faces lat\'erales externes
+ % %
+ fill_special(M1--M1'--M2'--M2--cycle,-light_y);
+ fill_special(M3--M3'--M4'--M4--cycle,light_y);
+ fill_special(M1--M4--M4'--M1'--cycle,-light_x);
+ fill_special(M2--M2'--M3'--M3--cycle,light_x);
+enddef;
+
+endinput