summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-09-08 03:02:30 +0000
committerNorbert Preining <norbert@preining.info>2023-09-08 03:02:30 +0000
commit608e422a8e775ac4d1c23c80b4170776701680d5 (patch)
treed1e69057c0dc339fb0f890882f5fef9fe3b3a66f /macros/latex
parent96f1d7a9e9fe6e682cbd19d1bf2b7797891160b6 (diff)
CTAN sync 202309080302
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/l3build/CHANGELOG.md9
-rw-r--r--macros/latex/contrib/l3build/README.md2
-rw-r--r--macros/latex/contrib/l3build/l3build-check.lua3
-rw-r--r--macros/latex/contrib/l3build/l3build.12
-rw-r--r--macros/latex/contrib/l3build/l3build.dtx3
-rwxr-xr-xmacros/latex/contrib/l3build/l3build.lua25
-rw-r--r--macros/latex/contrib/l3build/l3build.pdfbin744734 -> 744608 bytes
-rw-r--r--macros/latex/contrib/marginnote/LICENSE.md19
-rw-r--r--macros/latex/contrib/marginnote/README.md93
-rw-r--r--macros/latex/contrib/marginnote/README.txt18
-rw-r--r--macros/latex/contrib/marginnote/marginnote.dtx400
-rw-r--r--macros/latex/contrib/marginnote/marginnote.pdfbin317456 -> 483315 bytes
-rw-r--r--macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdfbin9219878 -> 9288098 bytes
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCBillard.tex51
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex23
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex395
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex270
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex110
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDecDeci.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCDefiTables.tex25
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex28
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex111
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCEratosthene.tex80
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFactorisation.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCFubuki.tex70
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCGeometrie.tex4
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex18
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCMulJap.tex232
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex10
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex138
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex19
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPixelArt.tex8
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPropor.tex38
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCPythagore.tex38
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCReperage.tex44
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex2
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex118
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCRose.tex106
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex62
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCStatistiques.tex34
-rw-r--r--macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex6
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty40
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCCalculatrice.mp7
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp111
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratch.mp30
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp30
-rw-r--r--macros/latex/contrib/suftesi/suftesi.dtx29
-rw-r--r--macros/latex/contrib/suftesi/suftesi.pdfbin848184 -> 848623 bytes
49 files changed, 2197 insertions, 670 deletions
diff --git a/macros/latex/contrib/l3build/CHANGELOG.md b/macros/latex/contrib/l3build/CHANGELOG.md
index e23a7764f9..7c6c7f83c4 100644
--- a/macros/latex/contrib/l3build/CHANGELOG.md
+++ b/macros/latex/contrib/l3build/CHANGELOG.md
@@ -7,6 +7,12 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2023-09-07]
+
+### Changed
+- Refine `-utc` support
+- Apply `checkopts` in addition to engine-specific options
+
## [2023-09-05]
### Changed
@@ -691,7 +697,8 @@ this project uses date-based 'snapshot' version identifiers.
- Rationalise short option names: removed `-d`, `-E`, `-r`
- Target `cmdcheck`: specific to LaTeX kernel work
-[Unreleased]: https://github.com/latex3/l3build/compare/2023-09-05...HEAD
+[Unreleased]: https://github.com/latex3/l3build/compare/2023-09-07...HEAD
+[2023-09-07]: https://github.com/latex3/l3build/compare/2023-09-05...2023-09-07
[2023-09-05]: https://github.com/latex3/l3build/compare/2023-07-20...2023-09-05
[2023-07-20]: https://github.com/latex3/l3build/compare/2023-07-17...2023-07-20
[2023-07-17]: https://github.com/latex3/l3build/compare/2023-03-27...2023-07-17
diff --git a/macros/latex/contrib/l3build/README.md b/macros/latex/contrib/l3build/README.md
index 779c91cad9..825c32f55b 100644
--- a/macros/latex/contrib/l3build/README.md
+++ b/macros/latex/contrib/l3build/README.md
@@ -1,7 +1,7 @@
l3build: a testing and building system for LaTeX
=================================================
-Release 2023-09-05
+Release 2023-09-07
Overview
--------
diff --git a/macros/latex/contrib/l3build/l3build-check.lua b/macros/latex/contrib/l3build/l3build-check.lua
index 3f1f5d5542..3e26de429b 100644
--- a/macros/latex/contrib/l3build/l3build-check.lua
+++ b/macros/latex/contrib/l3build/l3build-check.lua
@@ -753,7 +753,8 @@ function runtest(name, engine, hide, ext, test_type, breakout)
if engine_info then
binary = engine_info.binary or binary
format = engine_info.format or format
- checkopts = engine_info.options or checkopts
+ checkopts = (engine_info.options
+ and (checkopts .. " " .. engine_info.options)) or checkopts
tokens = engine_info.tokens and (' "' .. engine_info.tokens .. '" ')
or tokens
end
diff --git a/macros/latex/contrib/l3build/l3build.1 b/macros/latex/contrib/l3build/l3build.1
index 941958d57f..87dbac2ce3 100644
--- a/macros/latex/contrib/l3build/l3build.1
+++ b/macros/latex/contrib/l3build/l3build.1
@@ -1,4 +1,4 @@
-.TH l3build 1 "2023-09-05"
+.TH l3build 1 "2023-09-07"
.SH NAME
l3build \- Checking and building packages
.SH SYNOPSIS
diff --git a/macros/latex/contrib/l3build/l3build.dtx b/macros/latex/contrib/l3build/l3build.dtx
index 0ca5366d81..d8778fcce7 100644
--- a/macros/latex/contrib/l3build/l3build.dtx
+++ b/macros/latex/contrib/l3build/l3build.dtx
@@ -251,7 +251,7 @@
% }^^A
% }
%
-% \date{Released 2023-09-05}
+% \date{Released 2023-09-07}
%
% \maketitle
% \tableofcontents
@@ -437,6 +437,7 @@
% To perform the check, the engine typesets each test up to \var{checkruns} times.
% More detail on this in the documentation on |save|.
% Options passed to the binary are defined in the variable \var{checkopts}.
+% These are applied in addition to any
%
% By default, |texmf| trees are searched for input files when checking. This can be disabled by setting \var{checksearch} to |false|: isolation provides confidence that the tests cannot accidentally be running with incorrect files installed in the main distribution or |hometexmf|.
%
diff --git a/macros/latex/contrib/l3build/l3build.lua b/macros/latex/contrib/l3build/l3build.lua
index 66f50e9641..1ac608c971 100755
--- a/macros/latex/contrib/l3build/l3build.lua
+++ b/macros/latex/contrib/l3build/l3build.lua
@@ -25,7 +25,7 @@ for those people who are interested.
--]]
-- Version information
-release_date = "2023-09-05"
+release_date = "2023-09-07"
-- File operations are aided by the LuaFileSystem module
local lfs = require("lfs")
@@ -118,15 +118,22 @@ if options["epoch"] then
end
epoch = normalise_epoch(epoch)
-- LuaTeX needs the `-utc` option
-if next(specialformats) and next(specialformats.latex)
- and next (specialformats.latex.luatex) then
- local options = specialformats.latex.luatex.options
- specialformats.latex.luatex.options = (options and (options .. " ") or "") .. "-utc"
+if forcecheckepoch then
+ if next(specialformats) and next(specialformats.latex)
+ and next (specialformats.latex.luatex) then
+ local options = specialformats.latex.luatex.options
+ specialformats.latex.luatex.options = (options and (options .. " ") or "") .. "-utc"
+ end
+ if next(specialformats) and next(specialformats["latex-dev"])
+ and next (specialformats["latex-dev"].luatex) then
+ local options = specialformats["latex-dev"].luatex.options
+ specialformats["latex-dev"].luatex.options = (options and (options .. " ") or "") .. "-utc"
+ end
end
-if next(specialformats) and next(specialformats["latex-dev"])
- and next (specialformats["latex-dev"].luatex) then
- local options = specialformats["latex-dev"].luatex.options
- specialformats["latex-dev"].luatex.options = (options and (options .. " ") or "") .. "-utc"
+if forcedocepoch then
+ if match(typesetexe,"luatex") or match(typesetexe,"lualatex") then
+ typesetopts = typsetopts .. " -utc"
+ end
end
--
diff --git a/macros/latex/contrib/l3build/l3build.pdf b/macros/latex/contrib/l3build/l3build.pdf
index ac44c0e0ce..e713477fca 100644
--- a/macros/latex/contrib/l3build/l3build.pdf
+++ b/macros/latex/contrib/l3build/l3build.pdf
Binary files differ
diff --git a/macros/latex/contrib/marginnote/LICENSE.md b/macros/latex/contrib/marginnote/LICENSE.md
new file mode 100644
index 0000000000..fbcdcdbb6c
--- /dev/null
+++ b/macros/latex/contrib/marginnote/LICENSE.md
@@ -0,0 +1,19 @@
+----------------------------------------------------------------------------
+
+This work may be distributed and/or modified under the conditions of the
+LaTeX Project Public License, version 1.3c of the license. The latest
+version of this license is in http://www.latex-project.org/lppl.txt and
+version 1.3c or later is part of all distributions of LaTeX 2005/12/01
+or later. This work has the LPPL maintenance status “unmaintained”.
+The author of this work is Markus Kohm.
+
+----------------------------------------------------------------------------
+
+Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz
+in der Version 1.3c, verteilt und/oder verändert werden. Die aktuelle
+Version dieser Lizenz ist http://www.latex-project.org/lppl.txt und
+Version 1.3c oder später ist Teil aller Verteilungen von LaTeX 2005/12/01
+oder später. Dieses Werk hat den LPPL-Verwaltungs-Status „unmaintained”
+Der Autor dieses Werks ist Markus Kohm.
+
+----------------------------------------------------------------------------
diff --git a/macros/latex/contrib/marginnote/README.md b/macros/latex/contrib/marginnote/README.md
new file mode 100644
index 0000000000..8e4f474efd
--- /dev/null
+++ b/macros/latex/contrib/marginnote/README.md
@@ -0,0 +1,93 @@
+# marginnote
+An experimental LaTeX package to add notes in the margin, even where `\marginpar` fails
+
+---
+
+LaTeX package `marginnote`
+
+Copyright (c) 2005—2023 Markus Kohm
+
+Documentation-Release: 2023/09/07 v1.4c
+
+Package-Release: 2018/08/09 v1.4b
+
+Licence: LPPL 1.3c (see LICENSE.md)
+
+CTAN Location: https://www.ctan.org/pkg/marginnote
+
+LPPL Maintainance Status: unmaintained
+
+---
+
+## Summary
+
+This package provides the command `\marginnote` that may be used instead of
+`\marginpar` at almost every place, where `\marginpar` cannot be used,
+e.g. inside floats, footnotes, frames made with framed package …
+
+---
+
+## Download and Installation
+
+[Releases of `marginnote` are available from
+CTAN](https://www.ctan.org/pkg/marginnote). You should install it using the
+package manager of your TeX distribution. Updates should also be installed
+using either MiKTeX upates or the TeX Live manager.
+
+---
+
+## Maintenance and Development
+
+A new maintainer and new developers would be welcome!
+
+---
+
+## Release History
+
+### v1.4c:
+* Correction of documentation.
+
+### v1.4b:
+* Fix for vertical position of margin notes, e.g., inside lists.
+* I do not longer maintain the package. If you want to become the new maintainer, see the title page or the issue section in the manual.
+
+### v1.4a:
+* Fix for consecutive odd pages or consecutive even pages in a double-ended document (e.g. with class option twoside) added. Note, however, using consecutive odd pages or consecutive even pages in a double-ended document is still not recommended, because printing with correct margins will still need at least an empty page between two odd or two even pages, because (La)TeX decides on the page counter, e.g., whether to use `\oddsidemargin` or `\evensidemargin` or whether to use `\@oddhead` and `\@oddfoot` or `\@evenhead` and `\@evenfoot`.
+
+### v1.4:
+* New options `parboxrestore` (new default to set `\parskip`, `\parindent`, `\par`, `\\` and several other commands an lengths at the beginning of every margin note) and `noparboxrestore` (to use the old default of marginnote before v1.4).
+
+### v1.3:
+* Support for two-column mode added.
+* Support for engines without `\pdfsavepos` and `\savepos` removed.
+
+### v1.2b:
+* Support for package bidi.
+
+### v1.2a:
+* Bugfix.
+
+### v1.2:
+* Support for LuaTeX since 0.95.
+
+### v1.1i:
+* `\ignorespaces` added and `\strut` moved to allow hyphenation of the first word (suggested by Ulrike Fischer)
+
+### v1.1g:
+* made it `\long` to allow paragraph breaks at the text arguments of `\marginnote`
+* also set `\linewidth`
+
+### v1.1f:
+* missing usage of `\marginnotevadjust` at left margins fixed
+
+### v1.1e:
+* new options `fulladjust`, `heightadjust`, `depthadjust`, and `noadjust` to change the general default of the vertical adjustment
+
+### v1.1d:
+* horizontal position fixed if `\hoffset` is not 0pt or `\pdfhorigin` is not 1in
+
+### v1.1c:
+* XeTeX also has `\pdfsavepos`
+
+### v1.0:
+* First release
diff --git a/macros/latex/contrib/marginnote/README.txt b/macros/latex/contrib/marginnote/README.txt
deleted file mode 100644
index f75b9dc614..0000000000
--- a/macros/latex/contrib/marginnote/README.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-LaTeX package marginnote
-Copyright (c) Markus Kohm, 2005-2018
--------------------------------------------------------------------
-Version:
- 2018/08/09 v1.4b
-Licence:
- This work may be distributed and/or modified under the conditions
- of the LaTeX Project Public License, version 1.3c of the license.
- The latest version of this license is in
- http://www.latex-project.org/lppl.txt
- and version 1.3c or later is part of all distributions of LaTeX
- version 2005/12/01 or later and of this work.
-Abstract:
- This package provides the command \marginnote that may be used
- instead of \marginpar at almost every place, where \marginpar
- cannot be used, e.g., inside floats, footnotes, frames made with
- framed package. See marginnote.pdf for more information.
--------------------------------------------------------------------
diff --git a/macros/latex/contrib/marginnote/marginnote.dtx b/macros/latex/contrib/marginnote/marginnote.dtx
index 9346c2a1db..0f1065c00b 100644
--- a/macros/latex/contrib/marginnote/marginnote.dtx
+++ b/macros/latex/contrib/marginnote/marginnote.dtx
@@ -1,8 +1,7 @@
-% \CheckSum{787}
-% \iffalse meta-comment
+%\iffalse meta-comment
% ======================================================================
% marginnote.dtx
-% Copyright (c) Markus Kohm, 2005-2018
+% Copyright (c) Markus Kohm, 2005-2023
%
% This file is part of the work marginnote.
%
@@ -16,12 +15,12 @@
% This work has the LPPL maintenance status "unmaintained".
% If you want to become the new maintainer please contact the author.
%
-% This work consists of the files marginnote.dtx and the
-% derived files README.txt and marginnote.sty.
+% This work consists of the files marginnote.dtx, README.md,
+% LICENSE.md, and optionally the unpacked files marginnote.pdf and
+% and marginnote.sty.
% ----------------------------------------------------------------------
% Note: This file is not only the source but also the docstrip batch
-% file. To unpack marginnote.sty and README.txt from the source,
-% run:
+% file. To unpack marginnote.sty from the source, run:
%
% tex marginnote.dtx
%
@@ -30,50 +29,15 @@
% manual marginnote.pdf.
% ======================================================================
%
-%<package>%%% From File: $Id: marginnote.dtx 27 2018-08-09 09:17:04Z mjk $
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
-\begingroup
- \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
- \filedate$Date: 2018-08-09 11:17:04 +0200 (Do, 09 Aug 2018) $
- \def\filerevision$#1: #2 ${\gdef\filerevision{#2}}
- \filerevision$Revision: 27 $
-\endgroup
-\ProvidesFile{marginnote.dtx}[\filedate\space\filerevision\space
+\ProvidesFile{marginnote.dtx}[2023/09/07 1.4c
%</dtx>
%<package>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-%<package>\ProvidesPackage{marginnote}[%
-%<README>LaTeX package marginnote
-%<README>Copyright (c) Markus Kohm, 2005-2018
-%<README>-------------------------------------------------------------------
-%<README>Version:
-% \fi^^A meta-comment
-% \newcommand*{\packagedateandversion}{%
-% \iffalse meta-comment
-%<*package|README>
-% \fi^^A meta-comment
- 2018/08/09 v1.4b
-% \iffalse meta-comment
-%</package|README>
-% \fi^^A meta-comment
-% }
-% \iffalse meta-comment
-%<README>Licence:
-%<README> This work may be distributed and/or modified under the conditions
-%<README> of the LaTeX Project Public License, version 1.3c of the license.
-%<README> The latest version of this license is in
-%<README> http://www.latex-project.org/lppl.txt
-%<README> and version 1.3c or later is part of all distributions of LaTeX
-%<README> version 2005/12/01 or later and of this work.
-%<README>Abstract:
-%<README> This package provides the command \marginnote that may be used
-%<README> instead of \marginpar at almost every place, where \marginpar
-%<README> cannot be used, e.g., inside floats, footnotes, frames made with
-%<README> framed package. See marginnote.pdf for more information.
-%<README>-------------------------------------------------------------------
-%<*dtx|package>
+%<package>\ProvidesPackage{marginnote}[2018/08/09 1.4b
+%<*package|dtx>
non floating margin notes for LaTeX]
-%</dtx|package>
+%</package|dtx>
%<*dtx>
\ifx\documentclass\undefined
\input docstrip.tex
@@ -84,8 +48,6 @@
\generate{%
\file{marginnote.sty}{\from{marginnote.dtx}{package}}%
- \nopreamble\nopostamble
- \file{README.txt}{\from{marginnote.dtx}{README}}%
}
\ifToplevel{%
@@ -96,13 +58,20 @@
\Msg{*}
\Msg{* To finish the installation run}
\Msg{* \space\space pdflatex marginnote.dtx}
+ \Msg{* \space\space mkindex marginnote}
+ \Msg{* \space\space pdflatex marginnote.dtx}
+ \Msg{* \space\space mkindex marginnote}
+ \Msg{* \space\space pdflatex marginnote.dtx}
\Msg{* After this copy}
\Msg{* \space\space marginnote.sty to .../tex/latex/marginnote/}
\Msg{* \space\space marginnote.pdf to .../doc/latex/marginnote/}
\Msg{* \space\space marginnote.dtx to .../source/latex/marginnote/}
- \Msg{* \space\space README
- \space\space\space\space\space\space\space\space to
- .../source/latex/marginnote/}
+ \Msg{* \space\space README.md
+ \space\space\space\space\space to
+ .../doc/latex/marginnote/}
+ \Msg{* \space\space LICENSE.md
+ \space\space\space\space to
+ .../doc/latex/marginnote/}
\Msg{* where .../ is your local TDS tree}
\Msg{*}
\Msg{*********************************************************************}
@@ -112,9 +81,8 @@
\fi
\endbatchfile
\documentclass{ltxdoc}
-\usepackage{graphicx}% needed for \reflectbox
-\providecommand*{\XeTeX}{%
- X\kern-.1em\lower.5ex\hbox{\reflectbox{E}}\kern-.15em\TeX}
+\usepackage{hvlogos}
+\usepackage{marginnote}
\CodelineIndex
\RecordChanges
\begin{document}
@@ -123,105 +91,112 @@
%</dtx>
%\fi
%
+% \GetFileInfo{marginnote.sty}
+% \let\pkgversion\fileversion
+% \let\pkgdate\filedate
% \GetFileInfo{marginnote.dtx}
%
-% \title{Non-Floating Margin Notes with \textsf{marginnote}\thanks{URL:
-% \texttt{https://komascript.de/marginnote}} Package\thanks{This file has
-% revision number \fileversion, last revised \filedate. Please note: Currently
-% this package is unmaintained. A new maintainer would be welcome!}}
-% \author{Markus Kohm\thanks{Email: \texttt{komascript@gmx.info}}}
-% \date{\packagedateandversion}
+% \title{Non-Floating Margin Notes with \textsf{marginnote}
+% Package\thanks{This file has version \fileversion, last revised
+% \filedate. \textsf{marginnote} is version \pkgversion, last revised
+% \pkgdate.}}
+% \author{Markus Kohm \textcolor{red}{(inactive)}\thanks{From version 1.4b the
+% package is unmaintained. But there is a public repository with issue
+% tracker at \url{https://github.com/komascript/marginnote}. So everybody
+% can contribute and reported issues will not be lost, if a new maintainer
+% will be found.}}
% \maketitle
%
% \begin{abstract}
-% In \LaTeX{} the command \cs{marginpar}\oarg{left}\marg{right} might be
-% used to create a note in the margin. But there is a problem with this
-% command: it creates a special kind of float. For this it cannot be used
-% e.g., at floats or footnotes. Package \textsl{marginnote} supports another
-% command \cs{marginnote} to create notes in the margin. This does not use a
-% kind of float and for this does not have the disadvantage of
-% \cs{marginpar}. But there might be other problems \dots
+% In \LaTeX{} the command \cs{marginpar}\oarg{left}\marg{right} can be used
+% to create a note in the margin. But there is a problem with this command:
+% It creates a special kind of float. So it cannot be used on floats or
+% footnotes. The \textsl{marginnote} package supports another command
+% \cs{marginnote} to create notes in the margin. This does not use any kind
+% of float and therefore does not have the disadvantage of
+% \cs{marginpar}. But there may be other problems \dots
% \end{abstract}
%
% \tableofcontents
%
% \changes{v1.0b}{2006/14/03}{spelling fixes}
% \changes{v1.2b}{2017/10/14}{spelling fixes (by Thomas Reuben)}
+% \changes{v1.4c}{2023/09/07}{some documentation corrections only}
%
% \section{How to Use \textsf{marginnote} Package}
%
-% First of all you have to load. You may use:
+% First of all you have to load the package. You can use:
% \begin{verbatim}
% \usepackage{marginnote}
% \end{verbatim}\vskip-\baselineskip
-% to do so. You may also use one of the following options for a global change
-% of the behaviour of \textsf{marginnote}:
+% to do so. You can also use one of the following options to globally change
+% the behaviour of \textsf{marginnote}:
% \begin{description}
-% \item[\texttt{fulladjust}] adjusts the margin note at the height and depth
-% of the current line. Note, that this may sometimes result in extra height
-% and depth of the current line, but results in the best vertical
-% alignment. This is the default.
-% \item[\texttt{heightadjust}] adjusts the margin note at the height of the
-% current line but not the depth. Note, that this may sometimes result in
-% extra height of the current line and in vertical misplacement.
-% \item[\texttt{depthadjust}] adjusts the margin note at the depth of the
-% current line but not height. Note, that this may sometimes result in extra
-% depth of the current line and very often in vertical misplacement.
-% \item[\texttt{noadjust}] does not adjust the margin note at the height or
-% depth of the current line. Note, that this often results in vertical
-% misplacement but seldom in vertical extra space before or after the
-% current line.
+% \item[\texttt{fulladjust}] adjusts the margin note to the height and depth
+% of the current line. Note that this may sometimes add an extra height and
+% depth to the current line, but gives the best vertical alignment. This is
+% the default.
+% \item[\texttt{heightadjust}] adjusts the margin note to the height of the
+% current line, but not the depth. Note that this can sometimes result in
+% extra height and vertical offset of the current line.
+% \item[\texttt{depthadjust}] adjusts the margin note to the depth of the
+% current line, but not the height. Note that this can sometimes result in
+% extra depth and vertical offset of the current line.
+% \item[\texttt{noadjust}] does not adjust the margin note to the height or
+% depth of the current line. line. Note that this often results in vertical
+% offsets, but rarely in vertical extra space before or after the current
+% line.
% \item[\texttt{parboxrestore}] uses a reduced \cs{@parboxrestore} to restore
-% the definition of \cs{par} and \cmd\\ and several other commands and sets
+% the definition of \cs{par} and \cmd\\ and some other commands, and sets
% \cs{parindent} to 0, \cs{parfillskip} to 0\,pt plus 1\,fil and
% \cs{lineskip} to \cs{normallineskip}, \cs{baselineskip} to
-% \cs{normalbaselineskip} and activates \cs{sloppy} for every margin
-% note. This is the default since release 1.4b of
+% \cs{normalbaselineskip} and enables \cs{sloppy} for every margin
+% note. This is the default since the 1.4b release of
% \textsf{marginnote}. Release 1.4 and 1.4a also set \cs{parskip} to 0, but
-% this resulted in a vertical placement issue, e.g., inside lists like
+% this caused a vertical placement problem, e.g., inside lists like
% \texttt{itemize}.
% \item[\texttt{noparboxrestore}] does not restore any definition for the
-% margin notes. This was the behaviour before release 1.4.
+% margin notes. This was the behaviour before the 1.4 release.
% \end{description}
%
% \DescribeMacro{\marginnote}
-% The command \cs{marginnote}\oarg{left}\marg{right}\oarg{voffset} may be used
-% to set a margin note using \textsf{marginnote}. The first optional argument
-% and the mandatory argument are same using \cs{marginpar} from the \LaTeX{}
-% kernel. Even \cs{reversemarginpar} will be considered. The note \meta{left}
-% or \meta{right} will be put at the current vertical position. Second
-% optional argument \meta{voffset} may be used to adjust the vertical position
-% of the margin note. Use a negative dimension to move it up or a positive
-% dimension to move it down.
+% The command \cs{marginnote}\oarg{left}\marg{right}\oarg{voffset} can be used
+% to set a margin note using the \textsf{marginnote} package. The first
+% optional argument and the mandatory argument are the same as for
+% \cs{marginpar} from the \LaTeX{} kernel. Even \cs{reversemarginpar} is taken
+% into account. The note \meta{left} or \meta{right} is set to the current
+% vertical position. The second optional argument \meta{voffset} can be used
+% to adjust the vertical position of the margin note. Use a negative dimension
+% to move it up or a positive dimension to move it down.
%
% \DescribeMacro{\marginnotetextwidth}
-% Package \textsl{marginnote} needs to know the real width of the type area to
-% find the right margin. While some environments (e.g., those of package
-% \textsl{framed}) change \cs{textwidth}, \textsl{marginnote} defines its own
-% text width macro. If you change type area after \cs{begin\{document\}} you
-% should add
+% The \textsl{marginnote} package needs to know the real width of the text
+% area to find the right margin. While some environments (e.g., of the
+% \textsl{framed} package) change \cs{textwidth}, \textsl{marginnote} defines
+% its own text width macro. If you change the text area after
+% \cs{begin\{document\}} you should add
% \begin{verbatim}
% \edef\marginnotetextwidth{\the\textwidth}
% \end{verbatim}\vskip-\baselineskip
-% after changing the type area. Maybe you should do this globally using
+% after changing the text area. You may want to do this globally using
% \verb|\xdef| instead of \verb|\edef|. Most users will never need to change
% \cs{marginnotetextwidth}.
%
% \DescribeMacro{\marginnotevadjust}
-% At some environments the vertical adjustment of the margin note will be
-% wrong, e.g., one base line to low. In this case you may use the additional
-% optional argument of \cs{marginnote} at every usage of \cs{marginnote} or
-% redefine \cs{marginnotevadjust} at the begin of the environment. The default
-% definition is \texttt{0pt}.
+% In some environments the vertical adjustment of the margin note is
+% incorrect, e.g., one baseline too low. In this case, you can use the
+% additional optional argument of \cs{marginnote} each time \cs{marginnote} is
+% used, or redefine \cs{marginnotevadjust} at the beginning of the
+% environment. The default definition is \texttt{0pt}.
%
% \DescribeMacro{\raggedleftmarginnote}
% \DescribeMacro{\raggedrightmarginnote}
-% These macros define how the margin note will be aligned. The defaults are:
+% These macros define how the margin note is aligned. The defaults are
% \begin{itemize}
% \item align margin notes at the left margin right to the margin,
% \item align margin notes at the right margin left to the margin.
% \end{itemize}
-% You may change this using \cs{renewcommand}, e.g., use^^A
+% You can change this using \cs{renewcommand}, e.g., use^^A
% \changes{v1.0a}{2006/02/06}{Example to macros \cs{raggedleftmarginnote} and
% \cs{raggedrightmarginnote} at documentation fixed [thanks to Susumu
% Tanimura].}
@@ -229,108 +204,111 @@
% \renewcommand*{\raggedleftmarginnote}{}
% \renewcommand*{\raggedrightmarginnote}{\centering}
% \end{verbatim}\vskip-\baselineskip
-% to get justified text at the left and centered text at the right margin.
+% to get justified text on the left and centered text on the right margin.
%
% \DescribeMacro{\marginfont}
-% This macro defines the font that will be used to set margin notes. The
-% default is \cs{normalcolor}. You may use \cs{renewcommand} to change this,
-% e.g. use
+% This macro sets the font to be used for margin notes. The
+% default is \cs{normalcolor}. You may can \cs{renewcommand} to change this,
+% e.g., use
% \begin{verbatim}
% \renewcommand*{\marginfont}{\color{red}\sffamily}
% \end{verbatim}\vskip-\baselineskip
-% to get red colored margin notes in sans serif font family. You need to load
-% e.g. package \textsf{color} to use \cs{color}.
-%
-%
-% \section{Known Issues Using \textsf{marginnote}}
-%
-% Currently the package lacks of a new maintainer. The author does not longer
-% maintain the package, because originally it was designed to be only a small
-% hack to be used on some cases. But over the years it has grown and became a
-% conglomerate of hacks that hack hacks that are used very widely. A break
-% with a complete revise of the design would be necessary. But nothing I can
-% or want to do currently. If you want to do it, please contact the author
-% (see the footnotes on the first page).
-%
-% You can not use paragraphs with \cs{par} or empty lines inside a margin
-% note. In my opinion this would note make sense. However, if you really need
-% paragraphs you can try to use \cs{endgraf} instead of \cs{par}.
-%
-% From version 1.4a there is a workaround for double-ended documents with
-% consecutive odd pages or consecutive even pages. However it is not
-% recommended to use double-ended documents with such page sequences, because
-% printing such documents could be a mess. \texttt{marginnote} shows a warning
-% message whenever it detects those page sequences.
-%
-% From version 1.3 \texttt{marginnote} does not longer support \TeX{} engines
-% without primitives \cs{pdfsavepos}/\cs{savepos} and
-% \cs{pdflastxpos}/\cs{lastxpos}. The former (manual adjustment) fallback has
-% been removed. You'll get an error message, if you try to use a \TeX{} engine
-% without these primitives. Also $\varepsilon$-\TeX{} primitves are
-% needed. However, with current free \TeX{} distributions like MiK\TeX{} or
-% \TeX Live this shouldn't be a problem.
-%
-% At double side layout (e.g. using class option \texttt{twoside})
-% \cs{marginnote} needs to know the number of the current page to decide
-% whether the page is odd or even and so whether to use left or right
-% margin. \LaTeX{} uses an asynchronous output. Because of this counter
-% \texttt{page} should not be used to get the number of the current page
-% unless you are at page head or foot. To solve the problem
-% \textsf{marginnote} uses a mechanism similar to labels. But this means, that
-% the correct margin won't be known at this \LaTeX{} run but only at the
-% next. So after adding or deleting a margin note or after each change of page
-% break you need two \LaTeX{} runs to get all margins right.
-%
-% The command \cs{marginnote} uses \cs{strut} and \cs{vadjust} to put the
-% margin note at the correct position. But under some circumstances this may
-% fail. You may adjust the vertical position of the margin note using the
-% second optional argument of \cs{marginnote}. Sometimes even the text outside
-% \cs{marginnote} will be moved because of using \cs{marginnote}. You may use
-% one of the package options \texttt{fulladjust}, \texttt{heightadjust},
-% \texttt{depthajust} or \texttt{noajust} to change the global adjustment or
-% a local redefinition of |\mn@strut| or |\mn@zbox|.
-%
-% Note: The margin note will be placed at the current vertical line. This
-% means, if you are using two \cs{marginnote} commands at the same line, they
-% will be put on the same place. This is not a bug but a feature!
+% to get red colored margin notes in the sans serif font family. Don't forget:
+% You need to load the \textsf{color} package or the \textsf{xcolor} package
+% to use \cs{color}.
%
-% Since release~1.1b \cs{marginnote} between paragraphs (in vertical mode)
-% will place the note between the paragaphs instead of the end of the previous
-% paragraph. You may use \cs{leavevmode} or the third optional argument of
-% \cs{marginnote} to place it different.
%
-% No page break may occur inside a margin note created with \cs{marginnote}.
-%
-% \cs{marginnote} is somewhat different from \cs{marginpar} if used immediate
-% after \cs{item}. This is not a bug, it's a feature!
-%
-% With math \cs{marginnote} may work or may not depending on the math
-% environment.
-%
-% If you are using \XeTeX{}, PDF\LaTeX{} since version~1.40 or PDF\LaTeX{}
-% before version~1.40 with PDF output and the horizontal position of
-% a margin note is wrong, do one more PDF\LaTeX{} run.
-%
-% Sometimes lines are stretched vertically using \cs{marginnote}, e.g.\ if
-% you're using \cs{marginnote} at a list \emph{and} upper case umlauts like
-% ``\"U'' or if \verb|\lineskiplimit>0pt|. In this case
-% \verb|\lineskiplimit=0pt| or \verb|\lineskiplimit=-\maxdimen|, or one of the
-% options may help.
-%
-% You should not use \cs{marginnote} at the optional argument of \cs{item}.
-%
-% If \cs{if@twocolumn} is \cs{iftrue}, e.g., because you are using option
-% |twocolumn| or command |\twocolumn|, \cs{marginnote} does decide whether the
-% note should be placed left of the column or right of the columns simply by
-% comaring the current horizontal possition with |\columnwidth+\columnsep|. So
-% if the current horizontal possition is somewhere in the left columns, the
-% note is placed in the left margin. If the current horizontal possition is
-% somewhere right of the left column, the note is placed in the right
-% margin. However, support for twocolumn mode is as problematic as support for
-% reverse margin notes. I do not like it. Maybe it will be changed in
-% future. The current support for twocolumn mode has been implemented only
-% because of a feature request by Florent Chervet.
+% \section{Issues Using \textsf{marginnote}}
%
+% Some known issues are listed below. For new issues, it is recommended to
+% either discuss them in a public \LaTeX{} forum or report them in
+% \hyperref{https://github.com/komascript/marginnote}{the project's} issue
+% tracker on github.
+% \begin{itemize}
+% \item Currently, the package lacks a new maintainer. The author no longer
+% maintains the package anymore, as it was originally intended to be used as
+% a small hack for for a few cases. But over the years it has grown and
+% become a conglomerate of of hacks that hack hacks that are very widely
+% used. A break with a complete overhaul of the design would be
+% necessary. But nothing I can or want to do at the moment. If you want to
+% do it, please \hyperref{email:komascript@gmx.info}{contact the
+% author}. But even without taking over maintenance, you can contribute,
+% e.g. by participating in the issue tracker of the package.
+% \item You cannot use paragraphs with \cs{par} or empty lines inside a margin
+% note. In my opinion this would note make sense. However, if you really
+% need paragraphs you can try using \cs{endgraf} instead of \cs{par}.
+% \item From version 1.4a, a workaround is available for double-sided
+% documents with consecutive odd or even pages. However, it is not advisable
+% to use double-sided documents with such page sequences as printing such
+% documents can be problematic. The \textsf{marginnote} package displays a
+% warning message whenever it detects those page sequences.
+% \item From version 1.3, the \texttt{marginnote} package no longer support
+% \TeX{} engines that lack primitives \cs{pdfsavepos} and \cs{pdflastxpos},
+% or \cs{savepos} and \cs{lastxpos}. The previous fallback option for manual
+% adjustment has been removed. You will receive an error message if you try
+% to use a \TeX{} engine without these primitives, and $\varepsilon$-\TeX{}
+% primitves are also required. Nonetheless, this should not be an issue with
+% current, free \TeX{} distributions like MiK\TeX{} or \TeX Live.
+% \item When using double-side layout, such as with using the \texttt{twoside}
+% class option, \cs{marginnote} requires page number information to
+% determine if a page is odd or even, and therefore wich margin to
+% use\,---\,left or right. \LaTeX{} operates using asynchronous
+% output. Because of this, the counter \texttt{page} should not be used to
+% obtain the current page number, unless at the header or footer of the
+% page. To resolve the issue, the \textsf{marginnote} package employs a
+% mechanism akin to labels. However, this implies that the accurate margin
+% will not be determined during this \LaTeX{} run, but in the
+% next. Therefore, after making any changes to the margin notes or page
+% breaks, two \LaTeX{} runs are necessary to ensure all margins are correct.
+% \item The \cs{marginnote} command utilizes \cs{strut} and \cs{vadjust} to
+% position the margin note accurately. However, it may fail under certain
+% circumstances. You may adjust the vertical position of the margin note
+% using the second optional argument of \cs{marginnote}. Sometimes, the use
+% of \cs{marginnote} command can cause the text outside to shift
+% unnecessarily. You can choose from the package options
+% \texttt{fulladjust}, \texttt{heightadjust}, \texttt{depthajust}, or
+% \texttt{noajust} to globally adjust, or locally redefine |\mn@strut| or
+% |\mn@zbox|.
+%
+% Note: The margin note always will be placed at the current vertical
+% line. This means, if you are using two \cs{marginnote} commands at the
+% same line, they will be put on the same place. This is not a bug but a
+% feature!
+% \item From version~1.1b, \cs{marginnote} commands inserted between
+% paragraphs (or in \TeX terms: \emph{in vertical mode}) will result in the
+% note being placed between the paragraphs instead of at the end of the
+% preceding paragraph. You may use \cs{leavevmode} or the third optional
+% argument of \cs{marginnote} to place it differently.
+% \item No page break can occur within a margin note created using the
+% \cs{marginnote} command.
+% \item The use of \cs{marginnote} immediately after \cs{item} results in a
+% different behavior compared to \cs{marginpar}. This is not a bug, but
+% rather a deliberate feature!
+% \item With math, using the \cs{marginnote} command may work or not work,
+% depending on the math environment.
+% \item If the horizontal position of the margin note is not correct, try
+% another \LaTeX{} run.
+% \item Sometimes lines may stretch vertically when using \cs{marginnote},
+% particularly if you use \cs{marginnote} within a list \emph{and} upper
+% case umlauts like ``\"U'', or if you have \verb|\lineskiplimit>0pt|. To
+% resolve this issue, you can set \verb|\lineskiplimit=0pt| or
+% \verb|\lineskiplimit=-\maxdimen| or use other available package options.
+% \item You should not use \cs{marginnote} within the optional argument of
+% \cs{item}.
+% \item If \cs{if@twocolumn} is \cs{iftrue}, e.g., because you are using the
+% |twocolumn| class option or the |\twocolumn| command, \cs{marginnote}
+% decides whether the note should be placed to the left or right the columns
+% by comparing the current horizontal position with
+% |\columnwidth+\columnsep|. If the current horizontal position is somewhere
+% on the left column, the note is placed in the left margin. If the current
+% horizontal position is somewhere right of the left column and therefore on
+% the right column, the note is placed in the right margin. However,
+% supporting twocolumn mode is as problematic as supporting reverse margin
+% notes. It is not preferred. It may be revised in the future. The current
+% support for twocolumn mode has only been implemented due to a feature
+% request from Florent Chervet.
+% \end{itemize}
+%
% \StopEventually{\PrintIndex\PrintChanges}
%
% \section{Implementation}
@@ -339,9 +317,9 @@
%<*package>
% \fi
%
-% \changes{v1.3}{2018/04/13}{$\varepsilon$-\TeX{} removed}^^A
+% \changes{v1.3}{2018/04/13}{$\varepsilon$-\TeX{} removed}
+% \changes{v1.3}{2018/04/13}{early \cs{pdfsavepos}/\cs{savepos} test}
%
-% \changes{v1.3}{2018/04/13}{early \cs{pdfsavepos}/\cs{savepos} test}^^A
% \begin{macro}{\mn@savepos}
% \changes{v1.3}{2018/04/13}{new internal command}
% \begin{macro}{\mn@lastxpos}
@@ -1046,9 +1024,7 @@
%
% end of `marginnote.dtx'
%
-% \iffalse
-%%% Local Variables:
-%%% mode: doc-tex
-%%% TeX-master: t
-%%% End:
-% \fi
+% Local Variables:
+% mode: doc-tex
+% TeX-master: t
+% End:
diff --git a/macros/latex/contrib/marginnote/marginnote.pdf b/macros/latex/contrib/marginnote/marginnote.pdf
index f5150c99c3..7962836855 100644
--- a/macros/latex/contrib/marginnote/marginnote.pdf
+++ b/macros/latex/contrib/marginnote/marginnote.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 93bd8786cf..c1a0ba2d78 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/PfCBillard.tex b/macros/latex/contrib/profcollege/latex/PfCBillard.tex
index 1dcde0e4c4..6faf803803 100644
--- a/macros/latex/contrib/profcollege/latex/PfCBillard.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCBillard.tex
@@ -1,21 +1,31 @@
%%%
% Billard
%%%
-\setKVdefault[ClesBillard]{Longueur=8cm,Largeur=5cm,Solution=false,Angle=70,Depart=0.5,Vrai=false}
+\newtoks\tokPfCMotBillard{}%
+
+\def\UpdateTokBillard#1\nil{\addtotok\tokPfCMotBillard{"#1"}}%
+
+\setKVdefault[ClesBillard]{Longueur=8cm,Largeur=5cm,Solution=false,Angle=70,Depart=0.5,Vrai=false,Nom=JeuA,Creation=false}
\NewDocumentCommand\Billard{o m}{%
\useKVdefault[ClesBillard]%
\setKV[ClesBillard]{#1}%
+ \tokPfCMotBillard{}%
+ \ifboolKV[ClesBillard]{Creation}{%
+ \expandafter\UpdateTokBillard#2\nil%
+ }{\tokPfCMotBillard{#2}}%
\ifboolKV[ClesBillard]{Solution}{%
- \MPBillardSolution{#2}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
- }{%
- \MPBillard{#2}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
- }%
+ \MPBillardSolution{\the\tokPfCMotBillard}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
+ }{%
+ \MPBillard{\the\tokPfCMotBillard}{\useKV[ClesBillard]{Depart}}{\useKV[ClesBillard]{Angle}}%
+ }%
}%
\def\MPBillard#1#2#3{%
- \mplibcodeinherit{disable}%
- \begin{Geometrie}[CoinHD={(\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm)}]
+ \xdef\PfCNomBillard{\useKV[ClesBillard]{Nom}}
+ \mplibforcehmode
+ \begin{mplibcode}[\PfCNomBillard]
+ _tfig:=20cm;
boolean Vrai;
Vrai:=\useKV[ClesBillard]{Vrai};
% On définit la liste des 25 lettres alphabétiques dans laquelle on choisit autant de lettres que la longueur du mot
@@ -113,6 +123,7 @@
cote4=segment(M4,M1);
trace rec;
pair Pt[],FauxPt[];
+ numeric nbfaux,l[],angleref,angledepart,tourne;
nbfaux=0;
l1=#2;
Pt[1]=point(l1) of rec;
@@ -123,21 +134,22 @@
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));
+ Pt[2]=demidroite(Pt[1],rotation(M3,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));
+ Pt[2]=demidroite(Pt[1],rotation(M2,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;
+ drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25;
tourne=90;
numeric Blong;
BLong:=length #1;
- % Détermination des points.
+ %% Détermination des points.
if Vrai:
for k=3 upto BLong:
Intermed:=symetrie(Pt[k-2],Pt[k-1],Pt[k-1]+M2-M3);
@@ -159,7 +171,7 @@
fi;
endfor;
fi;
- % Ajout des faux points
+ %% Ajout des faux points
path SPath[];
cpt[1]:=1;
cpt[BLong+1]:=BLong+1;
@@ -182,7 +194,7 @@
drawoptions();
% Tracés
drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25;
- % Labelisation
+ %% 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]);
@@ -209,14 +221,17 @@
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}%
+ trace Reponse shifted((xpart(Co),5mm)-center Reponse);
+ clip currentpicture to polygone((0,0),(\useKV[ClesBillard]{Longueur}+2cm,0),(\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm),(0,\useKV[ClesBillard]{Largeur}+3cm));
+ \end{mplibcode}%
}%
\def\MPBillardSolution#1#2#3{%
- \mplibcodeinherit{enable}%
- \begin{mplibcode}%
- Figure(0,0,\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm);
+ % \mplibcodeinherit{enable}%
+ \mplibforcehmode
+ \xdef\PfCNomBillard{\useKV[ClesBillard]{Nom}}
+ \begin{mplibcode}[\PfCNomBillard]
+% Figure(0,0,\useKV[ClesBillard]{Longueur}+2cm,\useKV[ClesBillard]{Largeur}+3cm);
trace rec;
% Tracés
drawarrow Pt[1]--(Pt[1]+1.5cm*unitvector(Pt[2]-Pt[1])) withpen pencircle scaled 1.25;
@@ -255,5 +270,5 @@
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}%
+% \mplibcodeinherit{disable}%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex b/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
index 2e6ff56149..06a02de387 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCalculsFractions.tex
@@ -1,5 +1,5 @@
-\setKVdefault[CalculsFractions]{Couleurs=false}
-\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}
+\setKVdefault[CalculsFractions]{Couleurs=false,Negatif=false}%
+\defKV[CalculsFractions]{Couleur=\setKV[CalculsFractions]{Couleurs}}%
\NewDocumentCommand\tofrac{m}{%
\IfDecimal{#1}{#1}{%
@@ -33,7 +33,7 @@
\xdef\PfCAddFoo{\PfCNumA/\PfCNumB,\PfCNumC/\PfCNumD}%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeFractions{\PfCAddFoo}%
- \reademptyitems
+ \reademptyitems%
\setsepchar{,}%
% Partie calculs
\PGCD{\ListeFractions[1,2]}{\ListeFractions[2,2]}%
@@ -50,7 +50,10 @@
\ensuremath{%
\IfValueTF{#3}{%
\ifnum#3=4\relax%
- \tofrac{\PfCAddSumSimp}%
+ %test
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCAddNumSimp/\PfCAddDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCAddNumSimp)}/\fpeval{abs(\PfCAddDenoSimp)}}}{\tofrac{\PfCAddSumSimp}}%
+ }{\tofrac{\PfCAddSumSimp}}%
\else%
\ifnum#3=3\relax%
\SSimpliTest{\fpeval{abs(\PfCAddNumFin)}}{\fpeval{abs(\PfCAddDenoFin)}}\ifthenelse{\boolean{Simplification}}{\tofrac{\PfCAddNumFin/\PfCAddDenoFin}}{\tofrac{\PfCAddSumSimp}}%
@@ -79,8 +82,8 @@
}%
}%
-\NewDocumentCommand\SousFraction{oomm}{%
- \AddFraction*[#1][#2]{#3}{#4}%
+\NewDocumentCommand\SousFraction{oommo}{%
+ \AddFraction*[#1][#2]{#3}{#4}[#5]%
}%
\NewDocumentCommand\MulFraction{oommo}{%
@@ -114,7 +117,9 @@
\ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=3\relax
- \tofrac{\PfCMulPdtSimp}%
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCMulNumSimp/\PfCMulDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCMulNumSimp)}/\fpeval{abs(\PfCMulDenoSimp)}}}{\tofrac{\PfCMulPdtSimp}}%
+ }{\tofrac{\PfCMulPdtSimp}}%
\else
\ifnum#2=2\relax%
\SSimpliTest{\PfCMulNumFin}{\PfCMulDenoFin}\ifthenelse{\boolean{Simplification}}{\frac{\ifnum\PfCMulNumFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulNumFin)}}}{\ifnum\PfCMulDenoFin<0\relax-\fi\Decomposition[Longue]{\fpeval{abs(\PfCMulDenoFin)}}}}{\tofrac{\PfCMulPdtSimp}}%
@@ -160,7 +165,9 @@
\ensuremath{%
\IfValueTF{#2}{%
\ifnum#2=4\relax
- \tofrac{\PfCDivPdtSimp}%
+ \ifboolKV[CalculsFractions]{Negatif}{%
+ \xintifboolexpr{\fpeval{\PfCDivNumSimp/\PfCDivDenoSimp}<0}{-\tofrac{\fpeval{abs(\PfCDivNumSimp)}/\fpeval{abs(\PfCDivDenoSimp)}}}{\tofrac{\PfCDivPdtSimp}}%
+ }{\tofrac{\PfCDivPdtSimp}}%
\else\ifnum#2=3\relax
\MulFraction[][\fpeval{#2-1}]{\ListeFractions[1,1]/\ListeFractions[1,2]}{\ListeFractions[2,2]/\ListeFractions[2,1]}%
\else
diff --git a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
index 2871666b40..79aa74ca7d 100644
--- a/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCCartesJeux.tex
@@ -1,13 +1,17 @@
%%%
% Cards
%%%
-\setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de
- Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,%
+\setKVdefault[Cards]{Formats=false,Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,CouleurAr=Cornsilk,Theme=Th\'eor\`eme\\de
+ Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,%ImageAv=4813762.jpg,ImageAr=4813762.jpg,
+ AffichageSolution=true,SolutionSeule=false,%
% Pour la boite
ANbCartes=false,ATypeJeu=false,ANiveau=false,ANumero=false,AThemeJeu=false,CouleurTheme=black,CouleurNiveau=black,CouleurType=black,CouleurNb=black,
% Pour le trivial
Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen}
}%
+% Pour le choix des images Av et Ar
+\defKV[Cards]{ImageAv=\setKV[Cards]{BackgroundAv}}%
+\defKV[Cards]{ImageAr=\setKV[Cards]{BackgroundAr}}%
% Pour moduler l'affichage de textes sur la boite.
\defKV[Cards]{NbCartes=\setKV[Cards]{ANbCartes}}%
\defKV[Cards]{TypeJeu=\setKV[Cards]{ATypeJeu}}%
@@ -17,6 +21,10 @@
%
\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}}%
%
+% Gestion des formats
+%
+\defKV[Cards]{Format=\setKV[Cards]{Formats}}%
+%
\newtcolorbox{Mybox}[3]{%
enhanced,%
nobeforeafter,%
@@ -25,6 +33,18 @@
width=\largeurcarte,%
height=\hauteurcarte,%
arc=\PfCRayonArc,%
+ underlay={%
+ \ifboolKV[Cards]{BackgroundAv}{%
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb@height,
+ width=\tcb@width,
+ ]{\useKV[Cards]{ImageAv}}};%
+ \end{tcbclipinterior}%
+ }{}%
+ },%
overlay unbroken and first={%
\coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);%
\coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);%
@@ -53,7 +73,28 @@
colback=white,%
colbacktitle=TrameCouleur,%
}%
-
+\newtcolorbox{MyboxAr}{%
+ enhanced,%
+ nobeforeafter,%
+ left=0pt,right=0pt,top=0pt,%
+ text fill,%
+ width=\largeurcarte,%
+ height=\hauteurcarte,%
+ arc=\PfCRayonArc,%
+ underlay={%
+ \ifboolKV[Cards]{BackgroundAr}{%
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb@height,
+ width=\tcb@width,
+ ]{\useKV[Cards]{ImageAr}}};%
+ \end{tcbclipinterior}%
+ }{}%
+ },%
+ colback=white
+}%
\newcommand\PfCTexteJai{J'ai}%
\newcommand\PfCTexteJesuis{Je suis\dots}%
\newcommand\PfCTexteQuia{Qui a ?}%
@@ -210,7 +251,7 @@
},%
overlay unbroken and first={%
\coordinate[yshift=-0.5\hauteurtitre] (A) at (frame.north);%
- \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T1) at (A){\begin{minipage}{\largeurcarte-6mm}%
+ \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleurAr] (T1) at (A){\begin{minipage}{\largeurcarte-6mm}%
\begin{center}%
#1%
\end{center}%
@@ -302,42 +343,312 @@
\end{tikzpicture}%
}{}%
-\NewDocumentCommand\Cartes{o +m}{%
+%% Trame pour huit cartes format "A7"
+\NewDocumentEnvironment{TrameASept}{+b}{%
+ \ifodd\thepage%
+ \setlength{\PfCCardsH}{\largeurcards}%
+ \setlength{\PfCCardsV}{\hauteurcards}%
+ \else%
+ \setlength{\PfCCardsH}{\largeurcards+\PfCCardsEcartH}%
+ \setlength{\PfCCardsV}{\hauteurcards+\PfCCardsEcartV}%
+ \fi%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);%
+ \coordinate[yshift=-\margev] (B) at (current page.north east);%
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);%
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);%
+ \coordinate[yshift=-\hauteurcards] (A2) at (A1);%
+ \coordinate[yshift=-\hauteurcards] (B2) at (B1);%
+ \coordinate[xshift=\margeh] (C) at (current page.north west);%
+ \coordinate[xshift=\margeh] (D) at (current page.south west);%
+ \coordinate[xshift=\largeurcards] (C1) at (C);%
+ \coordinate[xshift=\largeurcards] (D1) at (D);%
+ \coordinate[xshift=\largeurcards] (C2) at (C1);%
+ \coordinate[xshift=\largeurcards] (D2) at (D1);%
+ \coordinate[xshift=\largeurcards] (C3) at (C2);%
+ \coordinate[xshift=\largeurcards] (D3) at (D2);%
+ \draw (A) -- (B);%
+ \draw (A1) -- (B1);%
+ \draw (A2) -- (B2);%
+ \draw (C)--(D);%
+ \draw (C1)--(D1);%
+ \draw (C2)--(D2);%
+ \draw (C3)--(D3);%
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
+ \coordinate[xshift=2\largeurcards,yshift=0mm] (Carte3) at (Carte1);%
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte4) at (Carte1);%
+ \coordinate[xshift=\largeurcards,yshift=-\hauteurcards] (Carte5) at (Carte1);%
+ \coordinate[xshift=2\largeurcards,yshift=-\hauteurcards] (Carte6) at (Carte1);%
+ #1%
+ \end{tikzpicture}%
+}%
+
+\newcommand\CartesASept[2][]{%
\useKVdefault[Cards]%
\setKV[Cards]{#1}%
\setsepchar[*]{§*/}%
\readlist*\ListeCards{#2}%
\setsepchar{,}%
- \ifboolKV[Cards]{Landscape}{%
- \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
- \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
- \setlength{\largeurcards}{95mm}%
- \setlength{\hauteurcards}{65mm}%
- \setlength{\margeh}{(297mm-3\largeurcards)/2}%
- \setlength{\margev}{(210mm-3\hauteurcards)/2}%
- }{%
- \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
- \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
- \ifboolKV[Cards]{Jointes}{\setlength{\largeurcards}{\largeurcarte}}{\setlength{\largeurcards}{65mm}}%
- \ifboolKV[Cards]{Jointes}{\setlength{\hauteurcards}{\hauteurcarte}}{\setlength{\hauteurcards}{95mm}}%
- \setlength{\margeh}{(210mm-3\largeurcards)/2}%
- \setlength{\margev}{(297mm-3\hauteurcards)/2}
- }%
+ \setlength{\hauteurcarte}{\fpeval{100-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{95-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{95mm}%
+ \setlength{\hauteurcards}{100mm}%
+ \setlength{\margeh}{(297mm-287mm)/2}%
+ \setlength{\margev}{(210mm-200mm)/2}%
\setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
\setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
\colorlet{TexteCouleur}{black}%
\colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
- \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}%
- \ifboolKV[Cards]{Trivial}{%
- \CartesTrivial%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \begin{TrameASept}
+ %A
+ \multido{\i=1+1}{6}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{TrameASept}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{TrameASept}
+ \multido{\i=1+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{4-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \multido{\i=4+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{10-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{TrameASept}%
+ \clearpage%
+ }{}%
+% }%
+}%
+
+
+%% Trame pour quatre cartes format A6
+\NewDocumentEnvironment{TrameASix}{+b}{%
+ \ifodd\thepage%
+ \setlength{\PfCCardsH}{\largeurcards}%
+ \setlength{\PfCCardsV}{\hauteurcards}%
+ \else%
+ \setlength{\PfCCardsH}{\largeurcards+\PfCCardsEcartH}%
+ \setlength{\PfCCardsV}{\hauteurcards+\PfCCardsEcartV}%
+ \fi%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);%
+ \coordinate[yshift=-\margev] (B) at (current page.north east);%
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);%
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);%
+ \coordinate[yshift=-\hauteurcards] (A2) at (A1);%
+ \coordinate[yshift=-\hauteurcards] (B2) at (B1);%
+ \coordinate[xshift=\margeh] (C) at (current page.north west);%
+ \coordinate[xshift=\margeh] (D) at (current page.south west);%
+ \coordinate[xshift=\largeurcards] (C1) at (C);%
+ \coordinate[xshift=\largeurcards] (D1) at (D);%
+ \coordinate[xshift=\largeurcards] (C2) at (C1);%
+ \coordinate[xshift=\largeurcards] (D2) at (D1);%
+ \draw (A) -- (B);%
+ \draw (A1) -- (B1);%
+ \draw (A2) -- (B2);%
+ \draw (C)--(D);%
+ \draw (C1)--(D1);%
+ \draw (C2)--(D2);%
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte3) at (Carte1);%
+ \coordinate[xshift=\largeurcards,yshift=-\hauteurcards] (Carte4) at (Carte1);%
+ #1%
+ \end{tikzpicture}%
+}%
+
+\newcommand\CartesASix[2][]{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \setsepchar{,}%
+ \setlength{\hauteurcarte}{\fpeval{100-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{143.5-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{143.5mm}%
+ \setlength{\hauteurcards}{100mm}%
+ \setlength{\margeh}{(297mm-287mm)/2}%
+ \setlength{\margev}{(210mm-200mm)/2}%
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}%
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \begin{TrameASix}
+ %A
+ \multido{\i=1+1}{4}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{TrameASix}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{TrameASix}
+ \multido{\i=1+1}{2}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{3-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \multido{\i=3+1}{2}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{7-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{TrameASix}%
+ \clearpage%
+ }{}%
+% }%
+}%
+
+%% Trame pour deux cartes format A5
+\NewDocumentEnvironment{TrameACinq}{+b}{%
+ \ifodd\thepage%
+ \setlength{\PfCCardsH}{\largeurcards}%
+ \setlength{\PfCCardsV}{\hauteurcards}%
+ \else%
+ \setlength{\PfCCardsH}{\largeurcards+\PfCCardsEcartH}%
+ \setlength{\PfCCardsV}{\hauteurcards+\PfCCardsEcartV}%
+ \fi%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);%
+ \coordinate[yshift=-\margev] (B) at (current page.north east);%
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);%
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);%
+ \coordinate[xshift=\margeh] (C) at (current page.north west);%
+ \coordinate[xshift=\margeh] (D) at (current page.south west);%
+ \coordinate[xshift=\largeurcards] (C1) at (C);%
+ \coordinate[xshift=\largeurcards] (D1) at (D);%
+ \coordinate[xshift=\largeurcards] (C2) at (C1);%
+ \coordinate[xshift=\largeurcards] (D2) at (D1);%
+ \draw (A) -- (B);%
+ \draw (A1) -- (B1);%
+ \draw (C)--(D);%
+ \draw (C1)--(D1);%
+ \draw (C2)--(D2);%
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);%
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);%
+ #1%
+ \end{tikzpicture}%
+}%
+
+\newcommand\CartesACinq[2][]{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \setlength{\hauteurcarte}{\fpeval{200-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{143.5-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{143.5mm}%
+ \setlength{\hauteurcards}{200mm}%
+ \setlength{\margeh}{(297mm-287mm)/2}%
+ \setlength{\margev}{(210mm-190mm)/2}%
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}%
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \begin{TrameACinq}
+ %A
+ \multido{\i=1+1}{2}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{TrameACinq}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{TrameACinq}
+ \multido{\i=1+1}{2}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{3-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{TrameACinq}%
+ \clearpage%
+ }{}%
+}%
+
+\NewDocumentCommand\Cartes{o +m}{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \setsepchar{,}%
+ \ifboolKV[Cards]{Formats}{%
+ \comparestrict%
+ \IfEq{\useKV[Cards]{Format}}{A5p}{%
+ \CartesACinq[#1]{#2}%
+ }{}%
+ \IfEq{\useKV[Cards]{Format}}{A6p}{%
+ \CartesASix[#1]{#2}%
+ }{}%
+ \IfEq{\useKV[Cards]{Format}}{Huitp}{%
+ \CartesASept[#1]{#2}%
+ }{}%
}{%
- \ifboolKV[Cards]{JaiQuia}{%
- \CartesJaiQuia%
+ \ifboolKV[Cards]{Landscape}{%
+ \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{95mm}%
+ \setlength{\hauteurcards}{65mm}%
+ \setlength{\margeh}{(297mm-3\largeurcards)/2}%
+ \setlength{\margev}{(210mm-3\hauteurcards)/2}%
+ }{%
+ \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
+ \ifboolKV[Cards]{Jointes}{\setlength{\largeurcards}{\largeurcarte}}{\setlength{\largeurcards}{65mm}}%
+ \ifboolKV[Cards]{Jointes}{\setlength{\hauteurcards}{\hauteurcarte}}{\setlength{\hauteurcards}{95mm}}%
+ \setlength{\margeh}{(210mm-3\largeurcards)/2}%
+ \setlength{\margev}{(297mm-3\hauteurcards)/2}
+ }%
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}%
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}%
+ \colorlet{TrameCouleurAr}{\useKV[Cards]{CouleurAr}}%
+ \setlength{\PfCRayonArc}{\useKV[Cards]{RayonArc}}%
+ \ifboolKV[Cards]{Trivial}{%
+ \CartesTrivial%
}{%
- \ifboolKV[Cards]{Loop}{%
- \CartesLoop%
+ \ifboolKV[Cards]{JaiQuia}{%
+ \CartesJaiQuia%
}{%
- \CartesClassique%
+ \ifboolKV[Cards]{Loop}{%
+ \CartesLoop%
+ }{%
+ \CartesClassique%
+ }%
}%
}%
}%
@@ -412,10 +723,38 @@
}%
\end{Trame}%
\clearpage%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \thispagestyle{empty}%
+ \begin{Trame}
+ \multido{\i=1+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ };%
+ }%
+ \multido{\i=4+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ };%
+ }%
+ \multido{\i=7+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ };%
+ }%
+ \end{Trame}%
+ \clearpage%
+ }{}%
}{%
\begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}%
\ListeCards[1,3]%
\end{Mybox}%
+ \ifboolKV[Cards]{AffichageSolution}{%
+ \begin{MyboxAr}%
+ \end{MyboxAr}%
+ }{}%
}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex b/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex
new file mode 100644
index 0000000000..cb5191d25a
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCCibleQOp.tex
@@ -0,0 +1,270 @@
+\newcount\anpcqo\newcount\bnpcqo\newcount\cnpcqo%
+
+\NewDocumentCommand\PfCCQODiviseurs{m}{%#1 : le nombre entier \`a tester
+ \xdef\RetiensDiviseurs{}%
+ \xdef\RetiensNonDiviseurs{}%
+ \anpcqo=#1%
+ \bnpcqo=2%
+ \cnpcqo=1%
+ \whiledo{\bnpcqo<\anpcqo}{%
+ \modulo{\the\anpcqo}{\the\bnpcqo}{}%
+ \ifnum\remainder=0\relax
+ \ifnum\cnpcqo=1
+ \xdef\RetiensDiviseurs{\the\bnpcqo}%
+ \else%
+ \xdef\RetiensDiviseurs{\RetiensDiviseurs,\the\bnpcqo}%
+ \fi%
+ \cnpcqo=\numexpr\cnpcqo+1%
+ \else
+ \ifnum\bnpcqo<10
+ \xdef\RetiensNonDiviseurs{\RetiensNonDiviseurs,\the\bnpcqo}%
+ \fi
+ \fi%
+ \bnpcqo=\numexpr\bnpcqo+1%
+ }%
+}%
+
+\newtoks\toklistecibleA%
+\newtoks\toklistecibleab%
+\newtoks\toklisteciblestyle%
+
+\def\UpdatetoksCibleQO#1\nil{\addtotok\toklistecibleA{"#1",}}%
+\def\UpdatetoksCibleQOO#1\nil{\addtotok\toklistecibleab{"#1",}}
+\def\UpdatetoksCibleStyle#1\nil{\addtotok\toklisteciblestyle{"#1"}}%%
+
+\setKVdefault[CibleQO]{Couleur=Crimson,Rayon=2cm,ValeurMin=4,ValeurMax=10,Graines=false,Solution=false,Cibles=false,DivE=false,Style="<->"}%
+\defKV[CibleQO]{Graine=\setKV[CibleQO]{Graines}\PfCGraineAlea{#1}}%
+\defKV[CibleQO]{Cible=\setKV[CibleQO]{Cibles}}%
+\NewDocumentCommand\CibleQuatreOperations{o}{%
+ \useKVdefault[CibleQO]%
+ \setKV[CibleQO]{#1}%
+ \toklistecibleA{}%
+ \toklistecibleab{}%
+ \toklisteciblestyle{}%
+ \expandafter\UpdatetoksCibleStyle\useKV[CibleQO]{Style}\nil
+ %Le style vaut :\the\toklisteciblestyle
+ \colorlet{CouleurCibleQO}{\useKV[CibleQO]{Couleur}}%
+ % On définit le nombre cible aléatoirement ou fixement.
+ \ifboolKV[CibleQO]{Cibles}{%
+ \xdef\PfCCibleQO{\useKV[CibleQO]{Cible}}%
+ }{%
+ \ChoixAlea{\useKV[CibleQO]{ValeurMin}}{\useKV[CibleQO]{ValeurMax}}{\PfCCiblePremierFacteur}%
+ \ChoixAlea{\useKV[CibleQO]{ValeurMin}}{\useKV[CibleQO]{ValeurMax}}{\PfCCibleDeuxiemeFacteur}%
+ \xdef\PfCCibleQO{\fpeval{\PfCCiblePremierFacteur*\PfCCibleDeuxiemeFacteur}}%
+ }%
+ % On définit les opérations : deux additions, deux soustractions, deux "divisions" inversées, deux "divisions" avec éventuellement une division euclidienne.
+ \PfCCQODiviseurs{\PfCCibleQO}%
+ \setsepchar{,}%
+ \readlist*\PfCRetiensDiviseurs{\RetiensDiviseurs}%
+ \ifnum\PfCRetiensDiviseurslen=1\relax%
+ \setKV[CibleQO]{DivE}%
+ \fi
+ \ifboolKV[CibleQO]{DivE}{%
+ \xdef\PfCCQOListeOperations{+,+,-,-,*,*,/,d}%
+ }{%
+ \xdef\PfCCQOListeOperations{+,+,-,-,*,*,/,/}%
+ }%
+ \xdef\PfCCQOListeAdditionUn{2,3,4,5,6,7,8,9}%
+ \xdef\PfCCQOListeAdditionDeux{10,11,12,13,14,15,16,17,18,19}%
+ \xdef\PfCCQOListeMultiplication{2,3,5,9,10}%
+ \xdef\PfCFooQO{\useKV[CibleQO]{ListeOperations}}%
+ \xdef\PfCFooNombres{}%
+ \MelangeListe{\PfCCQOListeAdditionUn}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeAdditionDeux}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeAdditionUn}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeAdditionDeux}{1}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \MelangeListe{\PfCCQOListeMultiplication}{2}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \ifnum\PfCRetiensDiviseurslen=1\relax%carré parfait
+ \xdef\PfCFooNombres{\PfCFooNombres \RetiensDiviseurs,\PfCCibleQO}%
+ \else%
+ \ifnum\PfCRetiensDiviseurslen=2\relax%
+ \xdef\PfCFooNombres{\PfCFooNombres \RetiensDiviseurs}%
+ \else%
+ \MelangeListe{\RetiensDiviseurs}{2}%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \fi%
+ \fi%
+ \MelangeListe{\RetiensNonDiviseurs}{1}%
+ \ifnum\PfCRetiensDiviseurslen=1\relax%
+ \xdef\PfCFooNombres{\PfCFooNombres,\faa}%
+ \else%
+ \xdef\PfCFooNombres{\PfCFooNombres \faa}%
+ \fi%
+ %Les nombres choisis sont \PfCFooNombres\\
+ \setsepchar{,}\ignoreemptyitems%
+ \MelangeListe{1,2,3,4,5,6,7,8}{8}%
+ \readlist*\PfCOrdreOperations{\faa}%
+ \readlist*\PfCListeCibleNombres{\PfCFooNombres}%
+ \readlist*\PfCListeCibleOperations{\PfCCQOListeOperations}%
+ % On détermine les solutions
+ \xdef\PfCListeSolution{\fpeval{\PfCCibleQO-\PfCListeCibleNombres[1]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO-\PfCListeCibleNombres[2]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO+\PfCListeCibleNombres[3]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO+\PfCListeCibleNombres[4]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO*\PfCListeCibleNombres[5]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO*\PfCListeCibleNombres[6]}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO/\PfCListeCibleNombres[7]}}%
+ \ifboolKV[CibleQO]{DivE}{%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{floor(\PfCCibleQO/\PfCListeCibleNombres[9])}}%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO-\PfCListeCibleNombres[9]*floor(\PfCCibleQO/\PfCListeCibleNombres[9])}}%
+ }{%
+ \xdef\PfCListeSolution{\PfCListeSolution,\fpeval{\PfCCibleQO/\PfCListeCibleNombres[8]}}%
+ }%
+ \readlist*\PfCListeCibleSolutions{\PfCListeSolution}%
+ \xdef\PfCFooRetiensTout{}%
+ \xdef\PfCFooRetiensToutAvecSol{}%
+ \xintFor* ##1 in{\xintSeq{1}{8}}\do{%
+ \xdef\PfCCibleRang{\PfCOrdreOperations[##1]}%
+ \xdef\PfCCibleRang{\PfCCibleRang}%
+ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{*}[\PfCTestEtoile]%
+ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{/}[\PfCTestSlash]%
+ \StrCompare{\PfCListeCibleOperations[\PfCCibleRang]}{d}[\PfCTestDE]%
+ \xintifboolexpr{\PfCTestDE==0}{%
+ \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\times\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}%
+ \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[8]}}\times\num{\PfCListeCibleNombres[9]}+\num{\PfCListeCibleSolutions[9]}$}%
+ }{%
+ \xdef\PfCFooRetiensTout{\PfCFooRetiensTout,$\pointilles[5mm]\xintifboolexpr{\PfCTestEtoile==0}{\div}{\xintifboolexpr{\PfCTestSlash==0}{\times}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}%
+ \xdef\PfCFooRetiensToutAvecSol{\PfCFooRetiensToutAvecSol,$\mathcolor{CouleurCibleQO}{\num{\PfCListeCibleSolutions[\PfCCibleRang]}}\xintifboolexpr{\PfCTestEtoile==0}{\div}{\xintifboolexpr{\PfCTestSlash==0}{\times}{\PfCListeCibleOperations[\PfCCibleRang]}}\num{\PfCListeCibleNombres[\PfCCibleRang]}$}%
+ }%
+ }%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\PfCCibleQOListeEnonce{\PfCFooRetiensTout}%
+ \readlist*\PfCCibleQOListeSolution{\PfCFooRetiensToutAvecSol}%
+ \foreachitem\compteur\in\PfCCibleQOListeEnonce{\expandafter\UpdatetoksCibleQO\compteur\nil}%
+ \foreachitem\compteur\in\PfCCibleQOListeSolution{\expandafter\UpdatetoksCibleQOO\compteur\nil}%
+ \BuildCibleQuatreOperations{\PfCCibleQO}{\the\toklistecibleA}{\the\toklistecibleab}{\useKV[CibleQO]{Style}}%
+}%
+
+\def\BuildCibleQOCode{%
+ vardef LectureOperations(text t)=
+ nbop:=0;
+ for p_=t:
+ Op[nbop]=image(
+ label(TEX(p_),(0,0));
+ );
+ nbop:=nbop+1;
+ endfor;
+ enddef;
+ %
+ vardef LectureOperationsPDF(text t)=
+ nbop:=0;
+ for p_=t:
+ Op[nbop]=image(
+ label(LATEX(p_),(0,0));
+ );
+ nbop:=nbop+1;
+ endfor;
+ enddef;
+ %
+ vardef MelangeListe=
+ for k=0 upto 7:
+ x[k]=k;
+ endfor;
+ nbtest=7;
+ for k=0 upto 7:
+ ll:=floor(uniformdeviate(8-k));
+ y[k]=x[ll];
+ nb:=0;
+ for l=0 upto (7-k):
+ if l<>ll:
+ x[nb]:=x[l];
+ nb:=nb+1;
+ fi;
+ endfor;
+ endfor;
+ enddef;
+}%
+
+\NewDocumentCommand\BuildCibleQuatreOperations{mmmm}{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ \BuildCibleQOCode
+ string Style;
+ Style=#4;
+
+ Cible=#1;
+
+ picture Op[];
+
+ Rayon:=\useKV[CibleQO]{Rayon};
+ boolean Solution;
+ Solution=\useKV[CibleQO]{Solution};
+
+ if Solution:
+ LectureOperations(#3)
+ else:
+ LectureOperations(#2)
+ fi;
+
+ path cc;
+ pair O,A[];
+ O=(0,0);
+ picture CIBLE;
+ CIBLE=image(label(TEX("\Huge\bfseries"&decimal(Cible)),O));
+ draw CIBLE;
+ cc=cercles(O,Rayon);
+ path Fleche;
+ for k=0 upto 7:
+ A[k]=1.1[O,pointarc(cc,k*45)];
+ Fleche:=((0,0)--(center Op[k] shifted A[k])) cutbefore cercles(O,0.45*Rayon) cutafter (polygone(llcorner Op[k],lrcorner Op[k],urcorner Op[k],ulcorner Op[k]) shifted A[k]);
+ if Style="<->":
+ drawdblarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="<-":
+ drawarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="->":
+ drawarrow (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="-":
+ draw (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="--":
+ label(TEX("$=$") rotated (k*45) ,point(0.5*length Fleche) of Fleche);
+ fi;
+ trace Op[k] shifted A[k];
+ endfor;
+ \end{mplibcode}
+ \else
+ \begin{mpost}[mpsettings={\BuildCibleQOCode;Rayon:=\useKV[CibleQO]{Rayon};boolean Solution;Solution=\useKV[CibleQO]{Solution};}]
+ string Style;
+ Style=#4;
+ Cible=#1;
+
+ picture Op[];
+
+ if Solution:
+ LectureOperationsPDF(#3)
+ else:
+ LectureOperationsPDF(#2)
+ fi;
+
+ path cc;
+ pair O,A[];
+ O=(0,0);
+ picture CIBLE;
+ CIBLE=image(label(LATEX("\Huge\bfseries"&decimal(Cible)),O));
+ draw CIBLE;
+ cc=cercles(O,Rayon);
+ path Fleche;
+ for k=0 upto 7:
+ A[k]=1.1[O,pointarc(cc,k*45)];
+ Fleche:=((0,0)--(center Op[k] shifted A[k])) cutbefore cercles(O,0.45*Rayon) cutafter (polygone(llcorner Op[k],lrcorner Op[k],urcorner Op[k],ulcorner Op[k]) shifted A[k]);
+ if Style="<->":
+ drawdblarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="<-":
+ drawarrow (point(0.75*length Fleche) of Fleche)--(point(0) of Fleche);
+ elseif Style="->":
+ drawarrow (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="-":
+ draw (point(0) of Fleche)--(point(0.75*length Fleche) of Fleche);
+ elseif Style="--":
+ label(LATEX("$=$") rotated (k*45) ,point(0.5*length Fleche) of Fleche);
+ fi;
+ trace Op[k] shifted A[k];
+ endfor;
+ \end{mpost}
+ \fi%
+}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex b/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex
new file mode 100644
index 0000000000..bfa2e8c76a
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCCryptarithme.tex
@@ -0,0 +1,110 @@
+%%%
+% Cryptarithmes
+%%%
+\setKVdefault[Crypta]{Solution=false,ListeLettres={A,B,C,D,E,F,G,H,I,J},Tableau=false}%
+\defKV[Crypta]{Indices=\setKV[Crypta]{Tableau}}%
+
+\colorlet{PfCCouleurVirgule}{black}
+
+\NewDocumentCommand\PfCRemplaceLettre{m}{%
+ \IfStrEqCase{#1}{%
+ {0}{\PfCCryptaListe[1]}%
+ {1}{\PfCCryptaListe[2]}%
+ {2}{\PfCCryptaListe[3]}%
+ {3}{\PfCCryptaListe[4]}%
+ {4}{\PfCCryptaListe[5]}%
+ {5}{\PfCCryptaListe[6]}%
+ {6}{\PfCCryptaListe[7]}%
+ {7}{\PfCCryptaListe[8]}%
+ {8}{\PfCCryptaListe[9]}%
+ {9}{\PfCCryptaListe[10]}%
+ }%
+}%
+
+\NewDocumentCommand\PfCchiffrecrypta{m}{%
+ \ifboolKV[Crypta]{Solution}{#1}{\PfCRemplaceLettre{#1}}%
+}%
+
+\NewDocumentCommand\PfCCryptaTestIndice{m}{%
+ \xintFor* ##1 in{\xintSeq{1}{\PfCCryptaListeIndicelen}}\do{%
+ \xintifboolexpr{\PfCCryptaListeIndice[##1]==#1}{\PfCRemplaceLettre{#1}\xintBreakFor}{}%
+ }%
+}%
+
+\NewDocumentCommand\BuildCryptaTab{}{%
+ \xdef\PfCFooCryptaIndices{\useKV[Crypta]{Indices}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListeIndice{\PfCFooCryptaIndices}%
+ \begin{tabular}{|*{10}{c|}}
+ \hline
+ 0&1&2&3&4&5&6&7&8&9\\
+ \hline
+ \PfCCryptaTestIndice{0}&\PfCCryptaTestIndice{1}&\PfCCryptaTestIndice{2}&\PfCCryptaTestIndice{3}&\PfCCryptaTestIndice{4}&\PfCCryptaTestIndice{5}&\PfCCryptaTestIndice{6}&\PfCCryptaTestIndice{7}&\PfCCryptaTestIndice{8}&\PfCCryptaTestIndice{9}\\%
+ \hline
+ \end{tabular}
+}%
+
+\NewDocumentCommand\CryptarithmeAdd{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \ifboolKV[Crypta]{Solution}{\opset{carryadd}}{\opset{carryadd=false}}%
+ \begingroup
+ \setlength{\baselineskip}{1.75em}
+ \opset{lineheight=\baselineskip} % nécessaire
+ \opadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,operandstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \endgroup
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeMAdd{om}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \ifboolKV[Crypta]{Solution}{\opset{carryadd}}{\opset{carryadd=false}}%
+ \opmanyadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,vmanyoperator=bottom,operandstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,resultstyle.d=\color{PfCCouleurVirgule}]#2%
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeSous{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \ifboolKV[Crypta]{Solution}{\opset{carrysub}}{\opset{carrysub=false}}%
+ \begingroup
+ \setlength{\baselineskip}{1.75em}
+ \opset{lineheight=\baselineskip} % nécessaire
+ \opsub[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,operandstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \endgroup
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeMul{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \begingroup
+ \setlength{\baselineskip}{1.75em}
+ \opset{lineheight=\baselineskip} % nécessaire
+ \opmul[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,operandstyle=\PfCchiffrecrypta,intermediarystyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \endgroup
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}%
+
+\NewDocumentCommand\CryptarithmeDiv{omm}{%
+ \useKVdefault[Crypta]%
+ \setKV[Crypta]{#1}%
+ \xdef\PfCFooCryptaListe{\useKV[Crypta]{ListeLettres}}%
+ \setsepchar{,}%
+ \readlist*\PfCCryptaListe{\PfCFooCryptaListe}%
+ \opidiv[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,displayintermediary=all,operandstyle=\PfCchiffrecrypta,intermediarystyle=\PfCchiffrecrypta,remainderstyle=\PfCchiffrecrypta,resultstyle=\PfCchiffrecrypta,operandstyle.1.d=\color{PfCCouleurVirgule},operandstyle.2.d=\color{PfCCouleurVirgule},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \ifboolKV[Crypta]{Tableau}{\\\BuildCryptaTab}{}%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex b/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex
index 31daba08fc..b2db7fd38b 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDecDeci.tex
@@ -70,7 +70,7 @@
\xintFor* ##1 in {\xintSeq{1}{\fpeval{\PfCNombrePuisMax-\PfCRetiensPuis}}}\do{%
\StrChar{#2}{##1}[\PfCNombreChiffre]
\modulo{\fpeval{\PfCNombrePuisMax+\PfCDecDeciEcart--##1}}{3}%
- \colorlet{oldcolor}{.}
+ \colorlet{oldcolor}{black}
\xintifboolexpr{\remainder==0}{\color{\useKV[DecompDeci]{CouleurU}}}{%
\xintifboolexpr{\remainder==1}{\color{\useKV[DecompDeci]{CouleurC}}}{%
\color{\useKV[DecompDeci]{CouleurD}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
index 4505b47c48..c4c120c920 100644
--- a/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCDefiTables.tex
@@ -2,7 +2,7 @@
% Defi Table
%%%
-\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10}
+\setKVdefault[DefiTable]{Solution=false,Math=false,LargeurT=5mm,Graines=false,Creation=false,ValeurMin=1,ValeurMax=10,Restreint=false}
\defKV[DefiTable]{Graine=\setKV[DefiTable]{Graines}}%
\newcommand\MelangeListeNew[2]{%
@@ -130,8 +130,24 @@
\setKV[DefiTable]{#1}%
\ifboolKV[DefiTable]{Creation}{%
\ifboolKV[DefiTable]{Graines}{\PfCGraineAlea{\useKV[DefiTable]{Graine}}}{}%
- \DefiTableNombreLettreduCode{#2}%
- \begin{center}
+ \DefiTableNombreLettreduCode{#2}%
+ \ifboolKV[DefiTable]{Restreint}{%
+ \xdef\PfCNbColonnes{\fpeval{\useKV[DefiTable]{ValeurMax}-\useKV[DefiTable]{ValeurMin}+1}}%
+ \begin{tabular}{|>{\columncolor{gray!15}}c|*{\PfCNbColonnes}{c|}}
+ \hline
+ \rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{\PfCNbColonnes}}\do{%
+ \xintifForFirst{}{&}\fpeval{\useKV[DefiTable]{ValeurMin}+##1-1}%
+ }\\\hline%
+ \xintFor* ##1 in{\xintSeq{1}{10}}\do{%
+ ##1\xintFor* ##2 in{\xintSeq{\useKV[DefiTable]{ValeurMin}}{\useKV[DefiTable]{ValeurMax}}}\do{%
+ &\xintFor* ##3 in{\xintSeq{1}{\NombreDeProduitATester}}\do{%
+ \xintifboolexpr{\fpeval{##1*##2}==\ListeDesProduits[##3] 'and' any(\useKV[DefiTable]{ValeurMin}<=##2<=\useKV[DefiTable]{ValeurMax},\useKV[DefiTable]{ValeurMin}<=##1<=\useKV[DefiTable]{ValeurMax})}{\ListeFinaleDesCaracteres[##3]}{}%
+ }%
+ }\\\hline%
+ }%
+ \end{tabular}%
+ }{%
+% \begin{center}
\begin{tabular}{|>{\columncolor{gray!15}}c|*{10}{c|}}
\hline
\rowcolor{gray!15}$\times$&\xintFor* ##1 in {\xintSeq {1}{10}}\do{%
@@ -145,7 +161,8 @@
}\\\hline%
}%
\end{tabular}%
- \end{center}
+% \end{center}
+ }
}{%
\setsepchar[*]{§* }%
\readlist*\ListeDefiTableCode{#2}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex b/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
index 6233753795..dc5d541157 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEcrireunQCM.tex
@@ -1,7 +1,7 @@
%%%
% QCM
%%%
-\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=2cm,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche}}%
+\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=60pt,Couleur=gray!15,Titre=false,Nom=R\'eponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false,Parties={Yeux,Nez,Bouche}}%
\newlength{\LargeurQCM}%
\newlength{\PfCLargeurQCM}%
\newcounter{QuestionQCM}%
@@ -56,9 +56,7 @@
\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}}%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\useKV[ClesQCM]{Reponses}*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
\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{%
@@ -68,7 +66,7 @@
\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}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,##2+1]%
}\\
}%
\hline%
@@ -109,7 +107,6 @@
}{%
\ifboolKV[ClesQCM]{VF}{%
\setKV[ClesQCM]{Reponses=2}%
-% \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
\setlength{\PfCLargeurQCM}{\useKV[ClesQCM]{Largeur}}%
\setlength{\LargeurQCM}{\linewidth-6\tabcolsep-2\PfCLargeurQCM-4\arrayrulewidth}%
\xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
@@ -125,9 +122,8 @@
\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}}%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-2*\tabcolsep-\useKV[ClesQCM]{Reponses}*(2*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}%
\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{%
@@ -137,7 +133,7 @@
\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}{\PfCSolCellColor{##1}{##2}}{}\ListeQCM[##1,\fpeval{##2+1}]%
}\\
}%
\hline%
@@ -146,4 +142,14 @@
}%
\renewcommand{\arraystretch}{1}%
}%
-}% \ No newline at end of file
+}%
+
+\NewDocumentCommand\PfCSolCellColor{mm}{%
+ \xdef\PfCFooSolColor{\ListeQCM[#1,\NumeroReponse]}%
+ \setsepchar{-}%
+ \readlist*\PfCSolListeReponses{\PfCFooSolColor}%
+ \xintFor* ##3 in{\xintSeq{1}{\PfCSolListeReponseslen}}\do{%
+ \xintifboolexpr{#2==\PfCSolListeReponses[##3]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}%
+ }%
+}%
+ \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex b/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex
index ecb975ff3b..d146f5fd84 100644
--- a/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCEcritureUnites.tex
@@ -1,7 +1,7 @@
%%%
% Ecritures d'unit\'es
%%%
-\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false}%
+\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false,Precision=2}%
\defKV[Unites]{Dots=\setKV[Unites]{Nombre=false}}%
\newlength{\PfCLgUnites}
@@ -28,8 +28,8 @@
\SI{#1}{\annee\xintifboolexpr{#1>1}{s}{}}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\annee(s)}}%
- \IfNoValueF {#2}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\annee(s)}}%
+ \IfNoValueF {#2}{~}%
}%
}%
\IfNoValueF {#2}%
@@ -40,8 +40,8 @@
\SI{#2}{\mois}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\mois}}%
- \IfNoValueF{#3}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\mois}}%
+ \IfNoValueF{#3}{~}%
}%
}%
\IfNoValueF {#3}%
@@ -52,8 +52,8 @@
\SI{#3}{\jour}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\jour}}%
- \IfNoValueF{#4}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\jour}}%
+ \IfNoValueF{#4}{~}%
}%
}%
\IfNoValueF {#4}%
@@ -64,8 +64,8 @@
\SI{#4}{\hour}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\hour}}%
- \IfNoValueF{#5}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\hour}}%
+ \IfNoValueF{#5}{~}%
}%
}%
\IfNoValueF {#5}%
@@ -73,11 +73,11 @@
\tl_if_blank:nF {#5}%
{%
\ifboolKV[Unites]{Nombre}{%
- \SI[minimum-integer-digits=2]{#5}{\minute}%
+ \SI{#5}{\minute}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\minute}}%
- \IfNoValueF{#6}{\,}%
+ \pointilles[\PfCLgUnites]~\si{\minute}}%
+ \IfNoValueF{#6}{~}%
}%
}%
\IfNoValueF {#6}%
@@ -86,7 +86,54 @@
\ifboolKV[Unites]{Nombre}{%
\SI{#6}{\second}}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\second}}%
+ \pointilles[\PfCLgUnites]~\si{\second}}%
+ }%
+ }%
+}%
+
+\NewDocumentCommand \Horaire {o o > { \SplitArgument { 2 } { ; } } m }
+{%
+ \useKVdefault[Unites]%
+ \setKV[Unites]{#1}
+ \group_begin:%
+ \IfNoValueF{#2}
+ { \keys_set:nn { siunitx } {#2} }
+ \siunitx_horaire_output:nnn #3
+ \group_end:
+}
+\cs_new_protected:Npn \siunitx_horaire_output:nnn #1#2#3
+{%
+ \IfNoValueF {#1}%
+ {%
+ \tl_if_blank:nF {#1}%
+ {%
+ \ifboolKV[Unites]{Nombre}{%
+ \SI{#1}{\hour}%
+ }{%
+ \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+ \pointilles[\PfCLgUnites]~\si{\hour}}%
+ \IfNoValueF{#2}{~}%
+ }%
+ }%
+ \IfNoValueF {#2}%
+ {%
+ \tl_if_blank:nF {#2}%
+ {%
+ \ifboolKV[Unites]{Nombre}{%
+ \SI[minimum-integer-digits=2]{#2}{\minute}%
+ }{%
+ \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+ \pointilles[\PfCLgUnites]~\si{\minute}}%
+ \IfNoValueF{#3}{~}%
+ }%
+ }%
+ \IfNoValueF {#3}%
+ {%
+ \tl_if_blank:nF {#3} {%
+ \ifboolKV[Unites]{Nombre}{%
+ \SI{#3}{\second}}{%
+ \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
+ \pointilles[\PfCLgUnites]~\si{\second}}%
}%
}%
}%
@@ -108,7 +155,7 @@
\SI{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
@@ -119,7 +166,7 @@
\SI{#2}{\kWh}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\kWh}%
+ \pointilles[\PfCLgUnites]~\si{\kWh}%
}%
}%
@@ -135,7 +182,7 @@
% \SI[round-mode=places,round-precision=#2]{#3}{\EuRo}%
% }{%
% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}
-% \pointilles[\PfCLgUnites]\,\si{\EuRo}%
+% \pointilles[\PfCLgUnites]~\si{\EuRo}%
% }%
%}%
@@ -155,11 +202,11 @@
\IfInteger{#2}{%
\SI{#2}{\Tempo}%
}{%
- \SI[round-mode=places,round-precision=2]{#2}{\Tempo}%
+ \SI[round-mode=places,round-precision=\useKV[Unites]{Precision}]{#2}{\Tempo}%
}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
@@ -187,7 +234,7 @@
\SI{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
@@ -232,14 +279,14 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
}%
@@ -285,16 +332,16 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
+ }%
}%
- }
}%
\NewDocumentCommand\Capa{s o m}{%
@@ -325,14 +372,14 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
}%
@@ -386,14 +433,14 @@
\SI[parse-numbers=false]{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
\SI{#3}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\Tempo}%
}%
}%
}%
@@ -439,14 +486,14 @@
\SI[parse-numbers=false]{#3}{\cubic\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\cubic\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\cubic\Tempo}%
}%
}{%
\ifboolKV[Unites]{Nombre}{%
\SI{#3}{\cubic\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si{\cubic\Tempo}%
+ \pointilles[\PfCLgUnites]~\si{\cubic\Tempo}%
}%
}%
}%
@@ -475,7 +522,7 @@
\SI[per-mode=symbol]{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si[per-mode=symbol]{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si[per-mode=symbol]{\Tempo}%
}%
}%
@@ -491,6 +538,6 @@
\SI[per-mode=symbol]{#2}{\Tempo}%
}{%
\setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}%
- \pointilles[\PfCLgUnites]\,\si[per-mode=symbol]{\Tempo}%
+ \pointilles[\PfCLgUnites]~\si[per-mode=symbol]{\Tempo}%
}%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex b/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex
new file mode 100644
index 0000000000..bcaeaa7a6a
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCEratosthene.tex
@@ -0,0 +1,80 @@
+\setKVdefault[ClesEra]{Premier=false,Nombre=1,CouleurP=Cornsilk!50,CouleurNP=Crimson!15,Colonnes=10,Lignes=10,Hauteur=24pt}
+
+\NewDocumentCommand\TestPremier{m}{%
+ % #1 le nombre premier \`a tester
+ \newcount\anp\newcount\bnp\newcount\cnp%
+ \anp=#1\relax
+ \bnp=2\relax
+ \premier=-1\relax
+ % Pour d\'eterminer le nombre d'\'etapes
+ \whiledo{\anp > 1}{%
+ \modulo{\the\anp}{\the\bnp}
+ \ifnum\remainder=0\relax
+ \global\premier=\numexpr\premier+1\relax
+ \cnp=\numexpr\anp/\bnp\relax
+ \anp=\cnp\relax
+ \else%
+ \bnp=\numexpr\bnp+1\relax%
+ \fi%
+ }%
+ \ifnum\premier=0%
+ \setKV[ClesEra]{Premier=true}%
+ \else
+ \setKV[ClesEra]{Premier=false}%
+ \fi%
+}%
+
+\newlength{\PfCEraHauteur}
+
+\NewDocumentCommand\Eratosthene{o}{%
+ \useKVdefault[ClesEra]
+ \setKV[ClesEra]{#1}
+ \setlength{\PfCEraHauteur}{\useKV[ClesEra]{Hauteur}}%
+ \xdef\PfCEraMax{\fpeval{\useKV[ClesEra]{Lignes}*\useKV[ClesEra]{Colonnes}}}%
+ \colorlet{PfCCouleurPremier}{\useKV[ClesEra]{CouleurP}}
+ \colorlet{PfCCouleurPasPremier}{\useKV[ClesEra]{CouleurNP}}
+ \begin{NiceTabular}{*{\useKV[ClesEra]{Colonnes}}{m{\PfCEraHauteur-\tabcolsep}}}[hvlines]
+ \CodeBefore
+ \tikz\draw[fill,PfCCouleurPasPremier] (1-|1) rectangle (2-|2);
+ \xintifboolexpr{\useKV[ClesEra]{Nombre}>1}{%
+ \xintFor* ##3 in{\xintSeq{2}{\useKV[ClesEra]{Nombre}}}\do{%
+ \TestPremier{##3}
+ \ifboolKV[ClesEra]{Premier}{%
+ % on positionne le nombre premier
+ \xdef\PfCEraLigneA{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})+1}}%
+ \xdef\PfCEraLigneB{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})+2}}%
+ \xdef\PfCEraLigneC{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})}}%
+ \xdef\PfCEraColonneA{\fpeval{##3-\useKV[ClesEra]{Colonnes}*floor(##3/\useKV[ClesEra]{Colonnes})}}
+ \xdef\PfCEraColonneB{\fpeval{##3-\useKV[ClesEra]{Colonnes}*floor(##3/\useKV[ClesEra]{Colonnes})+1}}
+ \xintifboolexpr{\PfCEraColonneA==0}{%
+ \tikz\draw[fill,PfCCouleurPremier] (\PfCEraLigneC-|\useKV[ClesEra]{Colonnes}) rectangle (\PfCEraLigneA-|\fpeval{\useKV[ClesEra]{Colonnes}+1});
+ }{%
+ \tikz\draw[fill,PfCCouleurPremier] (\PfCEraLigneA-|\PfCEraColonneA) rectangle (\PfCEraLigneB-|\PfCEraColonneB);
+ }%
+ %On positionne ses multiples
+ \xintFor* ##4 in{\xintSeq{2}{\fpeval{floor(\PfCEraMax/##3)}}}\do{%
+ \xintifboolexpr{##3>\fpeval{floor(sqrt(\PfCEraMax))}}{\xintBreakFor}{%
+ \xdef\PfCEraLigneA{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})+1}}%
+ \xdef\PfCEraLigneB{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})+2}}%
+ \xdef\PfCEraLigneC{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})}}%
+ \xdef\PfCEraColonneA{\fpeval{##3*##4-\useKV[ClesEra]{Colonnes}*floor(##3*##4/\useKV[ClesEra]{Colonnes})}}
+ \xdef\PfCEraColonneB{\fpeval{##3*##4-\useKV[ClesEra]{Colonnes}*floor(##3*##4/\useKV[ClesEra]{Colonnes})+1}}
+ \xintifboolexpr{\PfCEraColonneA==0}{%
+ \tikz\draw[fill,PfCCouleurPasPremier] (\PfCEraLigneC-|\useKV[ClesEra]{Colonnes}) rectangle (\PfCEraLigneA-|\fpeval{\useKV[ClesEra]{Colonnes}+1});
+ }{%
+ \tikz\draw[fill,PfCCouleurPasPremier] (\PfCEraLigneA-|\PfCEraColonneA) rectangle (\PfCEraLigneB-|\PfCEraColonneB);
+ }%
+ }%
+ }%
+ }{%Le nombre choisi n'est pas un nombre premier, ses multiples ont déjà étaient criblés.
+ }%
+ }%
+ }%
+ \Body
+ \xintFor* ##1 in{\xintSeq{0}{\fpeval{\useKV[ClesEra]{Lignes}-1}}}\do{%
+ \xintFor* ##2 in{\xintSeq{1}{\useKV[ClesEra]{Colonnes}}}\do{%
+ \xintifForFirst{\rule{0pt}{\PfCEraHauteur}}{&}\Block{1-1}{\fpeval{##2+##1*\useKV[ClesEra]{Colonnes}}}
+ }\\
+ }%
+ \end{NiceTabular}
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex b/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex
index b56e4f4dfd..f5c2c573d7 100644
--- a/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCFactorisation.tex
@@ -29,7 +29,7 @@
}%
\NewDocumentCommand\Factorisation{sommm}{%
- \directlua{dofile('poly_render_fix.lua')}
+% \directlua{dofile('poly_render_fix.lua')}
\useKVdefault[Facto]%
\setKV[Facto]{#2}%
\colorlet{Csymbole}{\useKV[Facto]{Couleur}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCFubuki.tex b/macros/latex/contrib/profcollege/latex/PfCFubuki.tex
new file mode 100644
index 0000000000..0ce7af2ffa
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCFubuki.tex
@@ -0,0 +1,70 @@
+\setKVdefault[Fubuki]{Largeur=20pt,Solution=false,Indice=false,Sommes=false,Couleur=LightSteelBlue,Perso=false,Vierge=false}%
+\defKV[Fubuki]{Graine=\PfCGraineAlea{#1}}%
+\defKV[Fubuki]{Indices=\setKV[Fubuki]{Indice}\xdef\PfCFooListeIndices{#1}}%
+\defKV[Fubuki]{CouleurSolution=\setKV[Fubuki]{Solution}\colorlet{PfCFubukiCouleurSolution}{#1}}%
+\newlength\PfCFubuki%
+
+\NewDocumentCommand\PfCFubukiTestIndice{m}{%
+ \ifboolKV[Fubuki]{Indice}{%
+ \xdef\PfCRetiensIndice{0}%
+ \xintFor* ##1 in {\xintSeq{1}{\PfCFubukiListeIndiceslen}}\do{%
+ \xintifboolexpr{#1==\PfCFubukiListeIndices[##1]}{\xdef\PfCRetiensIndice{\fpeval{\PfCRetiensIndice+1}}}{}%
+ }%
+ \xintifboolexpr{\PfCRetiensIndice>0}{#1}{\ifboolKV[Fubuki]{Solution}{\color{PfCFubukiCouleurSolution}#1}{}}%
+ }{%
+ \ifboolKV[Fubuki]{Solution}{\color{PfCFubukiCouleurSolution}#1}{}%
+ }%
+}%
+
+\NewDocumentCommand\PfCFubukiAffichageNombre{m}{%
+ \ifboolKV[Fubuki]{Vierge}{}{\ifboolKV[Fubuki]{Sommes}{\PfCFubukiNombre[#1]}{\PfCFubukiTestIndice{\PfCFubukiNombre[#1]}}}%
+}%
+
+\NewDocumentCommand\PfCFubukiAffichageSommeH{m}{%
+ \ifboolKV[Fubuki]{Vierge}{}{%
+ \ifboolKV[Fubuki]{Sommes}{%
+ \ifboolKV[Fubuki]{Solution}{%
+ \color{PfCFubukiCouleurSolution}\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+1}]+\PfCFubukiNombre[\fpeval{#1+2}]}%
+ }{}%
+ }{\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+1}]+\PfCFubukiNombre[\fpeval{#1+2}]}}%
+ }%
+}%
+
+\NewDocumentCommand\PfCFubukiAffichageSommeV{m}{%
+ \ifboolKV[Fubuki]{Vierge}{}{%
+ \ifboolKV[Fubuki]{Sommes}{%
+ \ifboolKV[Fubuki]{Solution}{%
+ \color{PfCFubukiCouleurSolution}\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+3}]+\PfCFubukiNombre[\fpeval{#1+6}]}%
+ }{}%
+ }{\fpeval{\PfCFubukiNombre[#1]+\PfCFubukiNombre[\fpeval{#1+3}]+\PfCFubukiNombre[\fpeval{#1+6}]}}%
+ }%
+}%
+
+\NewDocumentCommand\Fubuki{om}{%
+ \useKVdefault[Fubuki]%
+ \setKV[Fubuki]{#1}%
+ \colorlet{PfCFubukiCouleur}{\useKV[Fubuki]{Couleur}}%
+ \ifboolKV[Fubuki]{Indice}{%
+ \setsepchar{,}%
+ \readlist*\PfCFubukiListeIndices{\PfCFooListeIndices}%
+% \showitems\PfCFubukiListeIndices[]
+ }{}%
+ \ifboolKV[Fubuki]{Perso}{%
+ \xdef\PfCFooListeNombres{#2}%
+ \setsepchar{,}%
+ \readlist*\PfCFubukiNombre{\PfCFooListeNombres}%
+ }{%
+ \xdef\PfCFooListeNombres{1,2,3,4,5,6,7,8,9}%
+ \MelangeListe{\PfCFooListeNombres}{9}%
+ \setsepchar{,}%
+ \readlist*\PfCFubukiNombre{\faa}%
+ }%
+% \showitems\PfCFubukiNombre[]%
+ \setlength{\PfCFubuki}{\useKV[Fubuki]{Largeur}+\tabcolsep}%
+ \begin{NiceTabular}{*{4}{m{\useKV[Fubuki]{Largeur}}}}[corners=SE,hvlines]
+ \rule{0pt}{\PfCFubuki}\Block{}{\PfCFubukiAffichageNombre{1}}&\Block{}{\PfCFubukiAffichageNombre{2}}&\Block{}{\PfCFubukiAffichageNombre{3}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeH{1}}\\
+ \rule{0pt}{\PfCFubuki}\Block{}{\PfCFubukiAffichageNombre{4}}&\Block{}{\PfCFubukiAffichageNombre{5}}&\Block{}{\PfCFubukiAffichageNombre{6}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeH{4}}\\
+ \rule{0pt}{\PfCFubuki}\Block{}{\PfCFubukiAffichageNombre{7}}&\Block{}{\PfCFubukiAffichageNombre{8}}&\Block{}{\PfCFubukiAffichageNombre{9}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeH{7}}\\
+ \rule{0pt}{\PfCFubuki}\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeV{1}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeV{2}}&\Block[fill=PfCFubukiCouleur]{}{\PfCFubukiAffichageSommeV{3}}\\
+ \end{NiceTabular}
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex b/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
index dc1fd8e993..f7829c73e7 100644
--- a/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCGeometrie.tex
@@ -7,7 +7,7 @@
\NewDocumentEnvironment{Geometrie}{o +b}{%
\useKVdefault[Geometrie]%
\setKV[Geometrie]{#1}%
- \mplibforcehmode
+ \mplibforcehmode%
\begin{mplibcode}
% input PfCMPFr;
pair Coinbg,Coinhd;
@@ -35,7 +35,7 @@
\NewDocumentEnvironment{Geometrie}{o +b}{%
\useKVdefault[Geometrie]%
\setKV[Geometrie]{#1}%
- \begin{mpost}[mpsettings={
+ \begin{mpost}[mpsettings={%
pair Coinbg,Coinhd;
Coinbg=\useKV[Geometrie]{CoinBG};
Coinhd=\useKV[Geometrie]{CoinHD};
diff --git a/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex b/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex
index a36720d06a..09b1dc7d68 100644
--- a/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCJeuRangement.tex
@@ -1,4 +1,4 @@
-\setKVdefault[JeuRgt]{Creation=false,Deno=12,Graines=false,Largeur=15pt,Hauteur=20pt,Negatif=false,Decimaux=false,Solution=false}
+\setKVdefault[JeuRgt]{Creation=false,Deno=12,Graines=false,Largeur=15pt,Hauteur=20pt,Negatif=false,Decimaux=false,Solution=false,ValeurMin=2,ValeurMax=50}
\defKV[JeuRgt]{Graine=\setKV[JeuRgt]{Graines}}%
\newlength{\PfCJeuRgtH}
@@ -23,14 +23,14 @@
\xdef\ListeDesChoix{}%
\ifboolKV[JeuRgt]{Negatif}{%
\xdef\ListeDesChoix{-1}%
- \xintFor* ##1 in{\xintSeq{2}{50}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[JeuRgt]{ValeurMin}}{\useKV[JeuRgt]{ValeurMax}}}\do{%
\xdef\ListeDesChoix{\ListeDesChoix,-##1}%
}%
- \xintFor* ##1 in{\xintSeq{2}{50}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[JeuRgt]{ValeurMin}}{\useKV[JeuRgt]{ValeurMax}}}\do{%
\xdef\ListeDesChoix{\ListeDesChoix,##1}%
}%
}{%
- \xintFor* ##1 in{\xintSeq{2}{100}}\do{%
+ \xintFor* ##1 in{\xintSeq{\useKV[JeuRgt]{ValeurMin}}{\useKV[JeuRgt]{ValeurMax}}}\do{%
\xdef\ListeDesChoix{\ListeDesChoix,##1}%
}%
}%
@@ -64,10 +64,10 @@
% \xdef\Compteur{\ListeCompteursMelanges[\Lettrecnt]}
% \ListeDesLettres[\Compteur] -- \ListeDesNombres[\Compteur]\\
% }%
- % \begin{center}
- \begin{NiceTabular}{*{\LongueurMot}{m{\useKV[JeuRgt]{Largeur}}}}[vlines]%
- \hline
- \rule{0pt}{\PfCJeuRgtH}\xintFor* ##1 in{\xintSeq{1}{\LongueurMot}}\do{%
+ \begin{center}
+ \begin{NiceTabular}{*{\LongueurMot}{m{\useKV[JeuRgt]{Largeur}}}}[vlines]%
+ \hline
+ \rule{0pt}{\PfCJeuRgtH}\xintFor* ##1 in{\xintSeq{1}{\LongueurMot}}\do{%
\xintifForFirst{}{&}\Block{}{\xdef\Compteur{\ListeCompteursMelanges[##1]}\ListeDesLettres[\Compteur]}%
}%
\\
@@ -101,5 +101,5 @@
}{}%
\hline
\end{NiceTabular}
- % \end{center}
+\end{center}
} \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex b/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex
index 509ca1d200..b610849ea5 100644
--- a/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCLabyrintheNombre.tex
@@ -6,7 +6,7 @@
\defKV[ClesLabyNb]{XArrivee=\setKV[ClesLabyNb]{XArrivees}\setKV[ClesLabyNb]{ArriveeX=#1}}
\defKV[ClesLabyNb]{YArrivee=\setKV[ClesLabyNb]{YArrivees}\setKV[ClesLabyNb]{ArriveeY=#1}}
-\newcommand\LabyNombre[1][]{%
+\NewDocumentCommand\LabyNombre{o}{%
\useKVdefault[ClesLabyNb]%
\setKV[ClesLabyNb]{#1}%
\ifboolKV[ClesLabyNb]{XArrivees}{}{\setKV[ClesLabyNb]{ArriveeX=\fpeval{\useKV[ClesLabyNb]{Longueur}-1}}}
diff --git a/macros/latex/contrib/profcollege/latex/PfCMulJap.tex b/macros/latex/contrib/profcollege/latex/PfCMulJap.tex
new file mode 100644
index 0000000000..3e615aa3e9
--- /dev/null
+++ b/macros/latex/contrib/profcollege/latex/PfCMulJap.tex
@@ -0,0 +1,232 @@
+%%%
+% Multiplication Japonaise
+%%%
+\setKVdefault[MulJap]{Couleur=Orange,Bloc=false,DessinSeul=false}
+\defKV[MulJap]{CouleurBloc=\setKV[MulJap]{Bloc}}
+
+\newtoks\toksmuljap%
+\def\UpdatetoksMulJap#1\nil{\addtotok\toksmuljap{"#1",#1,}}%
+
+\NewDocumentCommand\MulJaponaise{om}{%
+ \useKVdefault[MulJap]%
+ \setKV[MulJap]{#1}%
+ \setsepchar{x}\ignoreemptyitems%
+ \readlist*\PfCMulJap{#2}%
+ \toksmuljap{}%
+ \foreachitem\compteur\in\PfCMulJap{\expandafter\UpdatetoksMulJap\compteur\nil}%
+ \BuildMulJap{\the\toksmuljap}%
+}%
+
+\NewDocumentCommand\BuildMulJap{m}{%
+ \ifluatex
+ \mplibforcehmode
+ \mplibnumbersystem{double}
+ \begin{mplibcode}
+ boolean Bloc,DessinSeul;
+ Bloc=\useKV[MulJap]{Bloc};
+ if Bloc:
+ color CouleurBloc;
+ CouleurBloc=\useKV[MulJap]{CouleurBloc};
+ fi;
+ DessinSeul=\useKV[MulJap]{DessinSeul};
+ color CoulTraits;
+ CoulTraits=\useKV[MulJap]{Couleur};
+ % On lit les string et les nombres
+ string Sfacteur[];
+ numeric facteur[];
+ vardef LectureDonnees(text t)=
+ n=1;
+ for p_=t:
+ if (n mod 2)=1:
+ Sfacteur[(n+1) div 2]=p_;
+ else:
+ facteur[n div 2]=p_;
+ fi;
+ n:=n+1;
+ endfor;
+ enddef;
+ numeric chiffrea[],chiffreb[];
+ vardef ExtraireChiffre=
+ Reste=facteur[1];
+ for k=length(Sfacteur[1]) downto 1:
+ Diviseur:=1;
+ for l=1 upto k-1:
+ Diviseur:=Diviseur*10;
+ endfor;
+ chiffrea[length(Sfacteur[1])+1-k]=Reste div Diviseur;
+ Reste:=Reste mod Diviseur;
+ endfor;
+ Reste:=facteur[2];
+ for k=length(Sfacteur[2]) downto 1:
+ Diviseur:=1;
+ for l=1 upto k-1:
+ Diviseur:=Diviseur*10;
+ endfor;
+ chiffreb[length(Sfacteur[2])+1-k]=Reste div Diviseur;
+ Reste:=Reste mod Diviseur;
+ endfor;
+ enddef;
+ LectureDonnees(#1);
+ ExtraireChiffre;
+ pair ta,basei,basej;
+ ta=u*(1,5);
+ basei=u*(1,1);
+ basej=u*(1,-1);
+ ecart=2.5;
+ vardef TraitsI(expr nb, lieu)=
+ label.ulft(TEX(decimal(nb)),lieu shifted(-1*basej));
+ if (nb mod 2)=1:%le nombre de traits est impair
+ p:=(nb-1) div 2;
+ for k=-p upto p:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) shifted(k*0.1*basei) withcolor CoulTraits;
+ endfor;
+ else:%le nombre de traits est pair
+ p:=nb div 2;
+ if nb=0:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) withcolor red;
+ else:
+ for k=-p upto -1:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) shifted(k*0.1*basei+0.05*basei) withcolor CoulTraits;
+ endfor;
+ for k=1 upto p:
+ trace ((lieu shifted(-1*basej))--(lieu shifted ((length(Sfacteur[2])-0.5)*ecart*basej))) shifted(k*0.1*basei-0.05*basei) withcolor CoulTraits;
+ endfor;
+ fi;
+ fi;
+ enddef;
+ vardef TraitsJ(expr nb, lieu)=
+ label.urt(TEX(decimal(nb)),lieu shifted((length(Sfacteur[1])-0.5)*ecart*basei));
+ if (nb mod 2)=1:%le nombre de traits est impair
+ p:=(nb-1) div 2;
+ for k=-p upto p:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) shifted(k*0.1*basej) withcolor CoulTraits;
+ endfor;
+ else:%le nombre de traits est pair
+ p:=nb div 2;
+ if nb=0:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) withcolor red;
+ else:
+% label(TEX("ici"),lieu);
+ for k=-p upto -1:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) shifted(k*0.1*basej+0.05*basej) withcolor CoulTraits;
+ endfor;
+ for k=1 upto p:
+ trace ((lieu shifted(-1*basei))--(lieu shifted ((length(Sfacteur[1])-0.5)*ecart*basei))) shifted(k*0.1*basej-0.05*basej) withcolor CoulTraits;
+ endfor;
+ fi;
+ fi;
+ enddef;
+ % drawoptions(withpen pencircle scaled 1.25 withcolor Orange);
+ for k=1 upto length(Sfacteur[1]):
+ TraitsI(chiffrea[k],ta+ecart*(k-1)*basei);
+ endfor;
+% drawoptions(withcolor blue);
+ for k=1 upto length(Sfacteur[2]):
+ TraitsJ(chiffreb[k],ta+ecart*(k-1)*basej);
+ endfor;
+ % Les blocs ?
+ pair testi[],testj[];
+ numeric rt,st;
+ rt:=0;st:=0;
+ for k=0 upto (length(Sfacteur[1])-1):
+ rt:=rt+1;
+ testi[rt]=ta shifted(k*ecart*basei);
+ endfor;
+ for k=1 upto (length(Sfacteur[2])-1):
+ rt:=rt+1;
+ testi[rt]=testi[rt-1] shifted(ecart*basej);
+ endfor;
+ %
+ for k=0 upto (length(Sfacteur[2])-1):
+ st:=st+1;
+ testj[st]=ta shifted(k*ecart*basej);
+ endfor;
+ for k=1 upto (length(Sfacteur[1])-1):
+ st:=st+1;
+ testj[st]=testj[st-1] shifted(ecart*basei);
+ endfor;
+ if Bloc:
+ for k=1 upto rt:
+ draw polygone(testi[k]+u*0.5*ecart*(-cosd(45),sind(45)),testi[k]+u*0.5*ecart*(cosd(45),sind(45)),testj[k]+u*0.5*ecart*(cosd(45),-sind(45)),testj[k]+u*0.5*ecart*(-cosd(45),-sind(45)));
+ endfor;
+ fi;
+ % On détaille le calcul
+ for k=1 upto 50:
+ RetiensDecimal[k]=0;
+ endfor;
+ for k=1 upto length(Sfacteur[1]):
+ for l=1 upto length(Sfacteur[2]):
+ RetiensDecimal[k+l]:=RetiensDecimal[k+l]+chiffrea[k]*chiffreb[l];
+ endfor;
+ endfor;
+ %
+ miny=4000;
+ for k=1 upto st:
+ if ypart(testj[k])<miny:
+ miny:=ypart(testj[k]);
+ fi;
+ endfor;
+ pair PointBasea[],PointBaseb[],PointBasec[];
+ for k=1 upto rt:
+ PointBasea[k]=(xpart(testj[k]),miny-ecart*u);
+ PointBaseb[k]=PointBasea[k]+u*ecart*(0,-1);
+ PointBasec[k]=PointBasea[k]+(0,-7.5mm);
+ endfor;
+ numeric NouveauNombre[];
+ if DessinSeul=false:
+ for k=1 upto rt:
+ label(decimal(RetiensDecimal[k+1]),PointBasea[k]);
+ endfor;
+ % Affichage des retenues, des nombres, des unités...
+ Retenue[rt+1]:=0;
+ for k=rt downto 1:
+ NouveauNombre[k]=RetiensDecimal[k+1]+Retenue[k+1];
+ Retenue[k]:=NouveauNombre[k] div 10;
+ endfor;
+ %fleche haut -> bas
+ for k=rt downto 1:
+ drawarrow (PointBasea[k]--PointBaseb[k]) cutbefore cercles(PointBasea[k],if k=rt:5mm else: 10mm fi) cutafter cercles(PointBaseb[k],5mm);
+ endfor;
+ % fleche diag
+ for k=rt downto 2:
+ if Retenue[k]>0:
+ if k=rt:
+ drawarrow (PointBasea[k]--PointBasea[k-1]) cutbefore cercles(PointBasea[k],5mm) cutafter cercles(PointBasea[k-1],5mm);
+ else:
+ drawarrow (PointBasec[k]--PointBasea[k-1]) cutbefore cercles(PointBasec[k],5mm) cutafter cercles(PointBasea[k-1],5mm);
+ fi;
+ fi;
+ endfor;
+ for k=rt downto 1:
+ if k>1:
+ label(decimal(NouveauNombre[k] mod 10),PointBaseb[k]);
+ else:
+ label(decimal(NouveauNombre[k]),PointBaseb[k]);
+ fi;
+ if k>1:
+ if Retenue[k]>0:
+ if k=rt:
+ fill cercles(iso(PointBasea[k],PointBasea[k-1]),5mm) withcolor white;
+ label(TEX("$+"&decimal(Retenue[k])&"$"),iso(PointBasea[k],PointBasea[k-1]));
+ else:
+ fill cercles(iso(PointBasec[k],PointBasea[k-1]),5mm) withcolor white;
+ label(TEX("$+"&decimal(Retenue[k])&"$"),iso(PointBasec[k],PointBasea[k-1]));
+ fi;
+ draw pointarc(cercles(PointBasea[k-1],3mm),45)--pointarc(cercles(PointBasea[k-1],3mm),225);
+ fi;
+ if k<rt:
+ if Retenue[k+1]>0:
+ label(TEX("$"&decimal(NouveauNombre[k])&"$"),PointBasec[k]);
+ fi;
+ fi;
+ elseif k=1:
+ if Retenue[k]>0:
+ draw pointarc(cercles(PointBasea[k],3mm),45)--pointarc(cercles(PointBasea[k],3mm),225);
+ label(TEX("$"&decimal(NouveauNombre[k])&"$"),PointBasec[k]);
+ fi;
+ fi;
+ endfor;
+ fi;
+ \end{mplibcode}
+ \fi
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex b/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex
index f1142bcdcf..428cd8d37c 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNombreAstral.tex
@@ -1,7 +1,7 @@
%%%
% Nombre Astral
%%%
-\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1,Couleur=LightSteelBlue}
+\setKVdefault[NombreAstral]{Solution=false,Graines=false,Echelle=1,Couleur=LightSteelBlue,Horizontal=false}
\defKV[NombreAstral]{Graine=\setKV[NombreAstral]{Graines}}%
\newtoks\toklisteNANombres%
@@ -55,8 +55,9 @@
color MiseEnValeurSol;
MiseEnValeurSol=\useKV[NombreAstral]{Couleur};
- boolean Solution;
+ boolean Solution,Horizontal;
Solution=\useKV[NombreAstral]{Solution};
+ Horizontal=\useKV[NombreAstral]{Horizontal};
Echelle:=\useKV[NombreAstral]{Echelle};
@@ -128,8 +129,13 @@
k:=k+1;
fill ca[p_] withcolor if Solution=false: white else: MiseEnValeurSol fi;
trace ca[p_];
+ if Horizontal:
+ label(TEX("\Large"&Rappel[p_]),(xpart(C2)+1.5*(k-1)*u,ypart(C2)-7.5u));
+ trace cercles((xpart(C2)+1.5*(k-1)*u,ypart(C2)-7.5u),0.6u);
+ else:
label(TEX("\Large"&Rappel[p_]),u*(-7,5.6-1.5k));
trace cercles(u*(-7,5.6-1.5k),0.6u);
+ fi;
endfor;
enddef;
diff --git a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
index 0941c913ee..7723e8b1af 100644
--- a/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCNotionFonction.tex
@@ -7,6 +7,8 @@
\newtoks\toklistePtsFn%pour la discipline
\newtoks\tokPfCListeDesFonctions%
\newtoks\tokPfCListeDesNomsFonctions%
+\newtoks\tokPfCLabelX%
+\newtoks\tokPfCLabelY%
\def\UpdatePfCListeDesFonctions#1\nil{\addtotok\tokPfCListeDesFonctions{"#1",}}%
\def\UpdatePfCListeDesNomsFonctions#1\nil{\addtotok\tokPfCListeDesNomsFonctions{"#1",}}%
\def\UpdatePtsFn#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{#1,(#2,#3),#4,}}%
@@ -31,8 +33,10 @@
\else
\readlist*\ListeDesNomsFonctions{\PfCFooNomFn}
\foreachitem\compteur\in\ListeDesNomsFonctions{\expandafter\UpdatePfCListeDesNomsFonctions\compteur\nil}%
- \fi
- \TraceMultiGraphique{\the\tokPfCListeDesFonctions}{\the\tokPfCListeDesNomsFonctions}%
+ \fi
+ \addtotok\tokPfCLabelX{"\useKV[TraceG]{LabelX}"}%
+ \addtotok\tokPfCLabelY{"\useKV[TraceG]{LabelY}"}%
+ \TraceMultiGraphique{\the\tokPfCListeDesFonctions}{\the\tokPfCListeDesNomsFonctions}%
}{%
\ifboolKV[ClesFonction]{Points}{%
\toklistePtsFn{}%
@@ -591,6 +595,10 @@
grady=\useKV[TraceG]{PasGradY};
Epaisseur:=\useKV[TraceG]{Epaisseur};
%
+ string LabelX,LabelY;
+ LabelX=\the\tokPfCLabelX;
+ LabelY=\the\tokPfCLabelY;
+ %
color colortrace[];
vardef RetiensCouleur(text t)=
n:=0;
@@ -606,8 +614,10 @@
Origine=(xmin,ymin)+\useKV[TraceG]{Origine};
DecalageOrigine=\useKV[TraceG]{Origine};
%
- boolean Grille,Vide,Graduations,Code,LegendeX,LegendeY;
+ boolean Grille,Vide,Graduations,Code,LegendeX,LegendeY,Millimetre,Tiret;
Grille=\useKV[TraceG]{Grille};
+ Tiret=\useKV[TraceG]{Tiret};
+ Millimetre=\useKV[TraceG]{Millimetre};
Vide=\useKV[TraceG]{Vide};
Graduations=\useKV[TraceG]{Graduations};
Code=\useKV[TraceG]{Code};
@@ -692,10 +702,12 @@
%
vardef LegendeCourbe=
if LegendeX=true:
- label.ulft(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine)));
+ %label.ulft(btex \useKV[TraceG]{LabelX} etex,u*(xmax,ypart(Origine)));
+ label.ulft(TEX(LabelX),u*(xmax,ypart(Origine)));
fi;
if LegendeY=true:
- label.lrt(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax));
+ % label.lrt(btex \useKV[TraceG]{LabelY} etex,u*(xpart(Origine),ymax));
+ label.lrt(TEX(LabelY),u*(xpart(Origine),ymax));
fi;
enddef;
}%
@@ -704,9 +716,55 @@
% #1 paramètres
% #2 Liste fonctions
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
\PfCTraceMGCode
+ color PfCOrange;
+ PfCOrange=(.75,.5,.25);
+ if Millimetre:
+ drawoptions(withpen pencircle scaled 0.25 withcolor 0.7[PfCOrange,white]);
+ for k=xpart(Origine) step 0.1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -0.1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 0.1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -0.1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 0.675 withcolor 0.5[PfCOrange,white]);
+ for k=xpart(Origine) step 1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 1 withcolor 0.3[PfCOrange,white]);
+ for k=xpart(Origine) step 5 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -5 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 5 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -5 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ fi;
if Grille:
drawoptions(withcolor 0.75white);
for k=xpart(Origine) step grillex until (xmax+grillex):
@@ -725,16 +783,36 @@
fi;
if Graduations:
for k=gradx step gradx until (((xmax-xmin)-xpart(DecalageOrigine))*pasx):
+ if Tiret:
+ draw ((0,-0.5mm)--(0,0.5mm)) shifted placepoint(k,0);
+ label.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ else:
dotlabel.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ fi;
endfor;
for k=-gradx step -gradx until (xpart(-DecalageOrigine)*pasx):
+ if Tiret:
+ draw ((0,-0.5mm)--(0,0.5mm)) shifted placepoint(k,0);
+ label.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ else:
dotlabel.bot(TEX("\num{"&decimal(k)&"}"),Origine*cm+(k*xu,0));
+ fi;
endfor;
for k=grady step grady until (((ymax-ymin)-ypart(DecalageOrigine))*pasy):
+ if Tiret:
+ draw ((-0.5mm,0)--(0.5mm,0)) shifted placepoint(0,k);
+ label.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ else:
dotlabel.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ fi;
endfor;
for k=-grady step -grady until (ypart(-DecalageOrigine)*pasy):
+ if Tiret:
+ draw ((-0.5mm,0)--(0.5mm,0)) shifted placepoint(0,k);
+ label.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ else:
dotlabel.lft(TEX("\num{"&decimal(k)&"}"),Origine*cm+(0,k*yu));
+ fi;
endfor;
fi;
%
@@ -767,7 +845,53 @@
LegendeCourbe;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={\PfCTraceMGCode}]
+ \begin{mpost}[mpsettings={\PfCTraceMGCode}]
+ color PfCOrange;
+ PfCOrange=(.75,.5,.25);
+ if Millimetre:
+ drawoptions(withpen pencircle scaled 0.25 withcolor 0.7[PfCOrange,white]);
+ for k=xpart(Origine) step 0.1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -0.1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 0.1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -0.1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 0.675 withcolor 0.5[PfCOrange,white]);
+ for k=xpart(Origine) step 1 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -1 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 1 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -1 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ drawoptions(withpen pencircle scaled 1 withcolor 0.3[PfCOrange,white]);
+ for k=xpart(Origine) step 5 until (xmax+grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=xpart(Origine) step -5 until (xmin-grillex):
+ trace u*(k,ymin-grilley)--u*(k,ymax+grilley);
+ endfor;
+ for k=ypart(Origine) step 5 until (ymax+grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ for k=ypart(Origine) step -5 until (ymin-grilley):
+ trace u*(xmin-grillex,k)--u*(xmax+grillex,k);
+ endfor;
+ drawoptions();
+ fi;
if Grille:
drawoptions(withcolor 0.75white);
for k=xpart(Origine) step grillex until xmax:
diff --git a/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex b/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex
index 9567c563cd..f53f3e9944 100644
--- a/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCOperationsTrou.tex
@@ -6,7 +6,7 @@
\newcommand\PfCchiffre[2]{\tikz[remember picture] \node[inner sep=0pt](#1){#2};}
\newcommand\PfCentoure[2]{\tikz[remember picture,overlay] \node[preaction={draw={\useKV[ClesOperations]{CouleurCadre}},ultra thick,opacity=1,
-transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,inner sep=.55em,fit=(#1.center)(#2.center)]{} ;}
+transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,inner sep=.55em,fit=(#1.center)(#2.center)]{};}
\newcounter{divxlop}%
\newcounter{mulxlop}%
@@ -42,10 +42,19 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
\setKV[ClesOperations]{#1}%
\setcounter{mulxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opmul[decimalsepsymbol={,},lineheight=2em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \begingroup
+ \setlength{\baselineskip}{2em}
+ \StrLen{#3}[\PfCLongueurFacteurDeux]
+ \ifnum\PfCLongueurFacteurDeux=1\relax
+ \opset{lineheight=\baselineskip} % nécessaire
+ \else
+ \opset{lineheight=\baselineskip,displayintermediary=all,displayshiftintermediary=all} % nécessaire
+ \fi
+ \opmul[decimalsepsymbol={,},lineheight=2em,columnwidth=1.5em,voperator=bottom,intermediarystyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle=\stepcounter{mulxlop}\color{PfCSolOp}\PfCchiffre{A\themulxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
\foreach \i in {1,...,\themulxlop}{%
\PfCentoure{A\i}{A\i}%
}%
+ \endgroup
}%
\newcommand\Addition[3][]{%
@@ -53,7 +62,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
\setKV[ClesOperations]{#1}%
\setcounter{addxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\opset{carryadd,carrystyle=\color{PfCSolOp}\scriptsize}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\opset{carryadd=false}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}
+ \opadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}
\foreach \i in {1,...,\theaddxlop}{%
\PfCentoure{A\i}{A\i}%
}%
@@ -64,7 +73,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
\setKV[ClesOperations]{#1}%
\setcounter{subxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\opset{carrysub,carrystyle=\color{PfCSolOp}\scriptsize}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\opset{carrysub=false}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opsub[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,displayintermediary=all,voperator=bottom,intermediarystyle=\stepcounter{subxlop}\color{PfCSolOp}\PfCchiffre{A\thesubxlop},resultstyle=\stepcounter{subxlop}\color{PfCSolOp}\PfCchiffre{A\thesubxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
+ \opsub[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,voperator=bottom,resultstyle=\stepcounter{subxlop}\color{PfCSolOp}\PfCchiffre{A\thesubxlop},resultstyle.d=\color{PfCCouleurVirgule}]{#2}{#3}%
\foreach \i in {1,...,\thesubxlop}{%
\PfCentoure{A\i}{A\i}
}%
@@ -75,7 +84,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
\setKV[ClesOperations]{#1}%
\setcounter{addxlop}{0}%
\ifboolKV[ClesOperations]{Solution}{\opset{carryadd,carrystyle=\color{PfCSolOp}\scriptsize}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurSolution}}\colorlet{PfCCouleurVirgule}{PfCSolOp}}{\opset{carryadd=false}\colorlet{PfCSolOp}{\useKV[ClesOperations]{CouleurFond}}\colorlet{PfCCouleurVirgule}{\useKV[ClesOperations]{CouleurVirgule}}}%
- \opmanyadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,displayintermediary=all,vmanyoperator=bottom,intermediarystyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]#2
+ \opmanyadd[decimalsepsymbol={,},lineheight=1.75em,columnwidth=1.5em,vmanyoperator=bottom,resultstyle=\stepcounter{addxlop}\color{PfCSolOp}\PfCchiffre{A\theaddxlop},resultstyle.d=\color{PfCCouleurVirgule}]#2
\foreach \i in {1,...,\theaddxlop}{%
\PfCentoure{A\i}{A\i}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex b/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex
index 4fa0847d61..06d0cfe95a 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPixelArt.tex
@@ -31,7 +31,9 @@
Nombres:=\useKV[ClesPixelArt]{Nombres};
string BaseLettres;
BaseLettres=str #2;
-
+ numeric EchelleScale;
+ EchelleScale=Unite/5mm;
+
color ColorEntier[],ColFond;
n:=0;
for p_=#3:
@@ -60,11 +62,11 @@
if Nombres:
for m=0 upto (length BaseLettres-1):
if (substring(p,p+1) of p_)=substring(m,m+1) of BaseLettres:
- label(TEX(RetiensNombres[m+1]),((l-1)*Unite,(h-1)*Unite));
+ label(TEX(RetiensNombres[m+1]) scaled EchelleScale,((l-1)*Unite,(h-1)*Unite));
fi;
endfor;
else:
- label(TEX(substring(p,p+1) of p_),((l-1)*Unite,(h-1)*Unite));
+ label(TEX(substring(p,p+1) of p_) scaled EchelleScale,((l-1)*Unite,(h-1)*Unite));
fi;
if Solution:
for m=0 upto (length BaseLettres-1):
diff --git a/macros/latex/contrib/profcollege/latex/PfCPropor.tex b/macros/latex/contrib/profcollege/latex/PfCPropor.tex
index 4a7f3c6de3..6c4774ac60 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPropor.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPropor.tex
@@ -1,19 +1,19 @@
%%%
% Proportionnalit\'e
%%%
-\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15,Vertical=false,Simple=false}%
+\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15,Vertical=false,Simple=false,Condense=false}%
\tikzstyle{FlechePropor}=[-stealth]
\def\Updatetoksmath#1/#2\nil{\addtotok\tabtoksa{&#1}\addtotok\tabtoksb{&#2}}%
-\def\updatetokspropor#1/#2\nil{\addtotok\tabtoksa{&\num{#1}}\addtotok\tabtoksb{&\num{#2}}}
+\def\updatetokspropor#1/#2\nil{\addtotok\tabtoksa{&\num{#1}}\addtotok\tabtoksb{&\num{#2}}}%
\def\Buildtabpropor{%
\setcounter{NbProporG}{0}%
\setcounter{NbProporD}{0}%
\renewcommand{\arraystretch}{\useKV[ClesPropor]{Stretch}}%
\ifboolKV[ClesPropor]{Vertical}{%
\begin{tabular}{c|*{2}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}c}%
- \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPH}&\multicolumn{1}{c}{\TikzPH}&\\
+ \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPH}&\multicolumn{1}{c}{\TikzPH}&\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\hhline{~--~}%
&\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurA}&\cellcolor{\useKV[ClesPropor]{CouleurTab}}\useKV[ClesPropor]{GrandeurB}&\\
\hhline{~--~}%
@@ -21,7 +21,7 @@
\stepcounter{NbProporG}\TikzPG&\ifboolKV[ClesPropor]{Math}{\ListeValeur[##1,1]}{\num{\ListeValeur[##1,1]}}&\ifboolKV[ClesPropor]{Math}{\ListeValeur[##1,2]}{\num{\ListeValeur[##1,2]}}&\stepcounter{NbProporD}\TikzPD\\
\hhline{~--~}%
}%
- \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPB}&\multicolumn{1}{c}{\TikzPB}&\\
+ \multicolumn{1}{c}{}&\multicolumn{1}{c}{\setcounter{NbPropor}{1}\TikzPB}&\multicolumn{1}{c}{\TikzPB}&\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\end{tabular}%
}{%
\tabtoksa{}\tabtoksb{}%
@@ -36,23 +36,24 @@
\xdef\LongListe{\ListeValeurlen}%
\ifboolKV[ClesPropor]{Simple}{%
\begin{tabular}{r|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}l}%
- \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\\%
+ \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\hhline{~*{\number\numexpr\ListeValeurlen}{-}~}%
- \multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
+ \multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen}{-}~}%
\multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}\the\tabtoksb&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen}{-}~}%
- \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\\%
+ \multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\end{tabular}%
}{%
\begin{tabular}{rc|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}l}%
- \multicolumn{1}{c}{}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\\%
+ %
+ \multicolumn{1}{c}{}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}%
\multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}&\the\tabtoksa&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}%
\multicolumn{1}{c|}{\stepcounter{NbProporG}\TikzPG}&\the\tabtoksb&\multicolumn{1}{c}{\stepcounter{NbProporD}\TikzPD}\\%
\hhline{~*{\number\numexpr\ListeValeurlen+1}{-}~}%
- \multicolumn{1}{c}{\stepcounter{NbProporG}\TikzPG}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\\%
+ \multicolumn{1}{c}{\stepcounter{NbProporG}\TikzPG}&\multicolumn{1}{c}{}\setcounter{NbPropor}{1}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPB}}&\multicolumn{1}{c}{}\ifboolKV[ClesPropor]{Condense}{\\[-1em]}{\\}%
\end{tabular}%
}%
}%
@@ -151,10 +152,10 @@
\NewDocumentCommand\FlechePCH{mm}{%
\begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]%
- \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!0.33!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!0.33!(ProporB-#2)$) {};%
- \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!0.67!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!0.67!(ProporB-#2)$) {};%
+ \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!\PfCCoeffH!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!\PfCCoeffH!(ProporB-#2)$) {};%
+ \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!\PfCCoeffB!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!\PfCCoeffB!(ProporB-#2)$) {};%
\xintifboolexpr{#1<#2}{%
\coordinate[right of=MilieuH-#1] (aux1);%
\coordinate[left of=MilieuH-#2] (aux2);%
@@ -175,10 +176,10 @@
\NewDocumentCommand\FlechePCB{mm}{%
\begin{tikzpicture}[remember picture,overlay,node distance=\getstrut\ht]%
- \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!0.33!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!0.33!(ProporB-#2)$) {};%
- \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!0.67!(ProporB-#1)$) {};%
- \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!0.67!(ProporB-#2)$) {};%
+ \node[inner sep=0pt] (MilieuH-#1) at ($(ProporH-#1)!\PfCCoeffH!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuH-#2) at ($(ProporH-#2)!\PfCCoeffH!(ProporB-#2)$) {};%
+ \node[inner sep=0pt] (MilieuB-#1) at ($(ProporH-#1)!\PfCCoeffB!(ProporB-#1)$) {};%
+ \node[inner sep=0pt] (MilieuB-#2) at ($(ProporH-#2)!\PfCCoeffB!(ProporB-#2)$) {};%
\xintifboolexpr{#1<#2}{%
\coordinate[right of=MilieuH-#1] (aux1);%
\coordinate[left of=MilieuH-#2] (aux2);%
@@ -273,12 +274,15 @@
\newcommand\Propor[2][]{%
\useKVdefault[ClesPropor]%
\setKV[ClesPropor]{#1}%
+ \ifboolKV[ClesPropor]{Condense}{\xdef\PfCCoeffH{-0.1}}{\xdef\PfCCoeffH{0.33}}%
+ \ifboolKV[ClesPropor]{Condense}{\xdef\PfCCoeffB{0.5}}{\xdef\PfCCoeffB{0.67}}%
\xdef\colorfill{\useKV[ClesPropor]{ColorFill}}%
\xdef\EcartLargeur{\useKV[ClesPropor]{Largeur}}%
% % on lit la liste \'ecrite sous la forme valeur/effectif
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeValeur{#2}%
\Buildtabpropor%
+% \BuildTabPropor%
}%
\newcommand\FlecheCoef[2][\EcartLargeur]{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCPythagore.tex b/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
index 4af4528b81..0ebc259286 100644
--- a/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCPythagore.tex
@@ -1,10 +1,10 @@
%%%
% Le th\'eor\`eme de Pythagore
%%%
-\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,Perso=false,AllPerso=false,SansMots=false}
-\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}}
-\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}}
-\defKV[ClesPythagore]{ValeurC=\setKV[ClesPythagore]{EnchaineC}}
+\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,Perso=false,AllPerso=false,SansMots=false}%
+\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}}%
+\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}}%
+\defKV[ClesPythagore]{ValeurC=\setKV[ClesPythagore]{EnchaineC}}%
% On d\'efinit les figures \`a utiliser
\def\MPFigurePytha#1#2#3#4#5#6{%
% #1 Premier sommet
@@ -14,8 +14,8 @@
% #5 2eme longueur
% #6 angle de rotation de la figure
\ifluatex
- \mplibforcehmode
- \begin{mplibcode}
+ \mplibforcehmode%
+ \begin{mplibcode}
u:=\useKV[ClesPythagore]{Echelle};
pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit
O=u*(2.5,2.5);
@@ -107,7 +107,7 @@
label(btex #1 etex,1.2[O,C]);
\end{mpost}
\fi
-}
+}%
\def\MPFigureReciPytha#1#2#3#4#5#6#7{%
% #1 Premier sommet
@@ -182,7 +182,7 @@
label(btex #3 etex,1.2[O,C]);
\end{mpost}
\fi
-}
+}%
\def\MPFigurePythaSansMots#1#2#3#4#5#6{%
% #1 Premier sommet
@@ -264,7 +264,7 @@
label(btex #1 etex,1.2[O,C]);
\end{mplibcode}
\fi
-}
+}%
\newcommand\RedactionPythagore{}%
\newcommand\RedactionReciPythagore{}%
@@ -272,7 +272,7 @@
\newcommand\RedactionCalculsReciPythagore{}%
\newcommand\RedactionConclusionReciPythagore{}%
-\NewDocumentCommand\CalculsPythagore{o m m m m}{
+\NewDocumentCommand\CalculsPythagore{o m m m m}{%
\xintifboolexpr{#3<#4 || #3==#4}{%\ifnum#3<#4%
\xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
\begin{align*}
@@ -312,7 +312,7 @@
\end{align*}
}%
}%\fi%
-}
+}%
\NewDocumentCommand\PfCCalculsReciPythagore{ommmm}{%
\ifboolKV[ClesPythagore]{ReciColonnes}{%
@@ -430,8 +430,8 @@
\ifboolKV[ClesPythagore]{Perso}{%
\RedactionReciPythagore%
}{%
- Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.%
- }
+ Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.%
+ }%
\PfCCalculsReciPythagore[#1]{#2}{#3}{#4}{#5}%
\ifboolKV[ClesPythagore]{Egalite}{%
\xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{%
@@ -455,7 +455,7 @@
}{%
\ifboolKV[ClesPythagore]{Perso}{\RedactionReciPythagore}{%
Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.%
- }
+ }%
\PfCCalculsReciPythagore[#1]{#2}{#3}{#4}{#5}%
\ifboolKV[ClesPythagore]{Egalite}{%
\xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{%
@@ -477,7 +477,7 @@
\opcopy{#3}{A1}%
\opcopy{#4}{A2}%
\opcopy{\useKV[ClesPythagore]{Precision}}{pres}%
- \xintifboolexpr{#3<#4 || #3==#4}{
+ \xintifboolexpr{#3<#4 || #3==#4}{%
\xdef\PetitCote{#3}%
\xdef\MoyenCote{#4}%
\xdef\GrandCote{}%
@@ -485,7 +485,7 @@
\xdef\GrandCote{#3}%
\xdef\MoyenCote{#4}%
\xdef\PetitCote{}% Pour la personnalisation
- }
+ }%
% On retient les noms des sommets
\StrMid{#2}{1}{1}[\NomA]%
\StrMid{#2}{2}{2}[\NomB]%
@@ -501,7 +501,7 @@
}{%
\xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}%
}%
- \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}
+ \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}%
}{%
\ifboolKV[ClesPythagore]{Figure}{%
\begin{multicols}{2}%
@@ -518,7 +518,7 @@
}{%
\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
}%
- }
+ }%
\CalculsPythagore[#1]{#2}{#3}{#4}{}
}%
\end{multicols}
@@ -533,7 +533,7 @@
}{%
\ifboolKV[ClesPythagore]{Perso}{\RedactionPythagore}{\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
}}%
- \CalculsPythagore[#1]{#2}{#3}{#4}{}
+ \CalculsPythagore[#1]{#2}{#3}{#4}{}%
}%
}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCReperage.tex b/macros/latex/contrib/profcollege/latex/PfCReperage.tex
index 48d4942761..93bce3c393 100644
--- a/macros/latex/contrib/profcollege/latex/PfCReperage.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCReperage.tex
@@ -2,15 +2,15 @@
% 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,AffichageUnites=true,MarquePrimaire=true,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,CouleurMercure=black,Celsius,Kelvin=false,Farenheit=false,ValeurMin=-4000,ValeurMax=4000,Etages=4,Code=false,Globe=false,Rho=1500,Phi=22,Theta=10,CouleurE=orange,CouleurG=green,Axes=false,TypeProj="persp",Niveaux=false}
-\defKV[ClesReperage]{Traces=\setKV[ClesReperage]{Code}}
-\defKV[ClesReperage]{Niveau=\setKV[ClesReperage]{Etages=#1}\setKV[ClesReperage]{Niveaux}}
+\defKV[ClesReperage]{Traces=\setKV[ClesReperage]{Code}}%
+\defKV[ClesReperage]{Niveau=\setKV[ClesReperage]{Etages=#1}\setKV[ClesReperage]{Niveaux}}%
% ValeurOrigine permet de faire des morceaux de demi-droite gradu\'ee en passant par droite :)
-\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}
+\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}%
%\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}
-\def\Updatetoksdemidroite#1/#2\nil{\addtotok\toklistenompointdemidroite{"#2",}}
-\def\Updatetoksrepere#1/#2/#3\nil{\addtotok\toklistepointrepere{#1,#2,"#3",}}
-\def\Updatetoksespace#1/#2/#3/#4\nil{\addtotok\toklistepointespace{#1,#2,#3,"#4",}}
+\def\Updatetoksdemidroite#1/#2\nil{\addtotok\toklistenompointdemidroite{"#2",}}%
+\def\Updatetoksrepere#1/#2/#3\nil{\addtotok\toklistepointrepere{#1,#2,"#3",}}%
+\def\Updatetoksespace#1/#2/#3/#4\nil{\addtotok\toklistepointespace{#1,#2,#3,"#4",}}%
\newtoks\toklistepointrepere%
\newtoks\toklistepointdroite%
@@ -23,24 +23,24 @@
\toklistepointespace{}%
\ifboolKV[ClesReperage]{Globe}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksrepere\compteur\nil}%
- \[\MPGlobe{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}\]
+ \MPGlobe{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
\ifboolKV[ClesReperage]{Sphere}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksrepere\compteur\nil}%
- \[\MPEspaceSphere{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}\]
+ \MPEspaceSphere{\the\toklistepointrepere}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
\foreachitem\compteur\in\ListePointEspace{\expandafter\Updatetoksespace\compteur\nil}%
\ifboolKV[ClesReperage]{AffichageNom}{%
\ifboolKV[ClesReperage]{AffichageCoord}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{3}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{3}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{2}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{2}{\useKV[ClesReperage]{EchelleEspace}}%
}%
}{%
\ifboolKV[ClesReperage]{AffichageCoord}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{1}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{1}{\useKV[ClesReperage]{EchelleEspace}}%
}{%
- \[\MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{0}{\useKV[ClesReperage]{EchelleEspace}}\]%
+ \MPEspacePave{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\useKV[ClesReperage]{Unitez}}{\useKV[ClesReperage]{Pasz}}{\the\toklistepointespace}{0}{\useKV[ClesReperage]{EchelleEspace}}%
}%
}%
}%
@@ -49,8 +49,8 @@
\def\MPGlobe#1#2{%
\ifluatex
- \mplibnumbersystem{double}
- \mplibforcehmode
+ \mplibnumbersystem{double}%
+ \mplibforcehmode%
\begin{mplibcode}
input PfCSolid;
% Pour convertir les (Long,lat) données en degrés en (Long,lat) données en radians
@@ -233,6 +233,7 @@
\def\MPEspaceSphere#1#2{%
\ifluatex
+ \mplibforcehmode
\begin{mplibcode}
typetrace:="3D";
typerepre:="persp";
@@ -421,7 +422,8 @@
}
\def\MPEspacePave#1#2#3#4#5#6#7#8#9{%
- \ifluatex
+ \ifluatex%
+ \mplibforcehmode%
\begin{mplibcode}
typetrace:="3D";
typerepre:="persp";
@@ -1536,7 +1538,9 @@
n:=n+1;
if substring(1,2) of p_="*":
ACoord:=scantokens(substring(0,1) of p_);
- if ACoord=3:
+ if ACoord=4:
+ pointe(unitp*(valeur[n],0));
+ elseif ACoord=3:
drawarrow ((unitp*valeur[n],-7mm))--((unitp*valeur[n],-3mm));
label.bot(btex \hbox to2em{\dotfill} etex,((unitp*valeur[n],-8mm)));
pointe(unitp*(valeur[n],0));
@@ -1552,7 +1556,9 @@
pointe(unitp*(valeur[n],0));
fi;
else:
- if AffichageCoord=3:
+ if AffichageCoord=4:
+ pointe(unitp*(valeur[n],0));
+ elseif AffichageCoord=3:
if p_<>"":
drawarrow ((unitp*valeur[n],-7mm))--((unitp*valeur[n],-3mm));
label.bot(btex \hbox to2em{\dotfill} etex,((unitp*valeur[n],-8mm)));
@@ -1685,7 +1691,9 @@
n:=n+1;
if substring(1,2) of p_="*":
ACoord:=scantokens(substring(0,1) of p_);
- if ACoord=3:
+ if ACoord=4:
+ pointe(unitp*(valeur[n],0));
+ elseif ACoord=3:
drawarrow (unitp*(valeur[n],-1))--(unitp*(valeur[n],-0.3));
label.bot(btex \noexpand\hbox to2em{\noexpand\dotfill} etex,(unitp*(valeur[n],-1)));
pointe(unitp*(valeur[n]-ValeurOrigine,0));
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex b/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex
index fbbde59efc..390c1a9caa 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresentationGraphique.tex
@@ -1,7 +1,7 @@
%%%
% Diff\'erentes représentations graphiques
%%%
-\setKVdefault[TraceG]{Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LegendeX=false,LegendeY=false,LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100}%
+\setKVdefault[TraceG]{Millimetre=false,Grille=false,Graduations=false,PasGradX=1,PasGradY=1,PasGrilleX=1,PasGrilleY=1,Xmin=-5.5,Xmax=5.5,Xstep=1,Ymin=-5.5,Ymax=5.5,Ystep=1,Bornea=-5.5,Borneb=5.5,LabelX={},LabelY={},LegendeX=false,LegendeY=false,LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Epaisseur=1,Relie=false,RelieSegment=false,Marque=dot,Code=false,Vide=false,NbPointsCourbe=100,Tiret=false}%
\defKV[TraceG]{Traces=\setKV[TraceG]{Code}}%
\defKV[TraceG]{LabelX=\setKV[TraceG]{LegendeX}}%
\defKV[TraceG]{LabelY=\setKV[TraceG]{LegendeY}}%
diff --git a/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex b/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex
index 714405a534..9ab7b24341 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRepresenterEntier.tex
@@ -1,14 +1,15 @@
%%%
-% Représenter un entier
+% Représenter un entier dans une base
%%%
-\setKVdefault[ClesREntier]{Echelle=1,Unite=false,Compact=false,Impression=false,ListeCouleurs={Tomato,LightSteelBlue,LightGreen,Cornsilk}}%
+\setKVdefault[ClesRBase]{Base=10,Echelle=1,Unite=false,Compact=false,Impression=false,ListeCouleurs={Tomato,LightSteelBlue,LightGreen,Cornsilk}}%
\newcommand\RepresenterEntier[2][]{%
- \useKVdefault[ClesREntier]%
- \setKV[ClesREntier]{#1}%
- \ifboolKV[ClesREntier]{Unite}{%
- \begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)}]
- Echelle=\useKV[ClesREntier]{Echelle};
+ \useKVdefault[ClesRBase]%
+ \setKV[ClesRBase]{#1}%
+ \ifboolKV[ClesRBase]{Unite}{%
+ \begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)}]%,CoinHD={u*(30,10)}]
+ Base=\useKV[ClesRBase]{Base};
+ Echelle=\useKV[ClesRBase]{Echelle};
Initialisation(5,30,15,50*Echelle);
color A,B,C,D,E,F,G,H;
pointilles:="non";
@@ -16,15 +17,29 @@
\end{Geometrie}
}{%
% On décompose le nombre
- \StrLen{#2}[\LongueurNombreEntier]%
- \xdef\FooListeEntier{}
- \xintFor* ##1 in{\xintSeq{1}{\LongueurNombreEntier}}\do{%
- \StrChar{#2}{##1}[\ChiffreAAjouter]
- \xdef\FooListeEntier{\FooListeEntier \ChiffreAAjouter,}
- }
+ \xintifboolexpr{#2>\fpeval{\useKV[ClesRBase]{Base}**4-1}}{Le nombre est trop grand pour être représenté.}{%
+ \xdef\PfCRetiensDecomp{}%
+ \xdef\PfCResteConversion{#2}%
+% \#2 vaut #2 et $Base+1$ vaut \fpeval{\useKV[ClesRBase]{Base}-1}\\
+ \whiledo{\PfCResteConversion>\fpeval{\useKV[ClesRBase]{Base}-1}}{%
+ \quotient{\PfCResteConversion}{\useKV[ClesRBase]{Base}}
+% Le quotient de \PfCResteConversion{} par \useKV[ClesRBase]{Base} est \the\intquotient\\
+ \modulo{\PfCResteConversion}{\useKV[ClesRBase]{Base}}
+% Le reste de \PfCResteConversion{} par \useKV[ClesRBase]{Base} est \the\remainder\\
+ \xdef\PfCRetiensDecomp{\the\remainder,\PfCRetiensDecomp}
+% Je retiens le reste : \the\remainder\\
+ \xdef\PfCResteConversion{\the\intquotient}
+% Je recommence avec \PfCResteConversion\\
+ }%
+% Je retiens le dernier reste (ou quotient) :
+ \xdef\PfCRetiensDecomp{\PfCResteConversion,\PfCRetiensDecomp}%
+ }%
+% On obtient la décomposition de #2 sous la forme \PfCRetiensDecomp\\
+ % transformation en liste
\setsepchar{,}\ignoreemptyitems
- \readlist*\ListeDesChiffres{\FooListeEntier}%
- \xdef\ListeAvantCouleurs{\useKV[ClesREntier]{ListeCouleurs}}%
+ \readlist*\ListeDesChiffres{\PfCRetiensDecomp}%
+ \xdef\LongueurNombreEntier{\ListeDesChiffreslen}%
+ \xdef\ListeAvantCouleurs{\useKV[ClesRBase]{ListeCouleurs}}%
\readlist*\ListeCouleurEntier{\ListeAvantCouleurs}%
\xintifboolexpr{\LongueurNombreEntier==4}{%
\xdef\NombreMilliers{\ListeDesChiffres[1]}%
@@ -52,64 +67,65 @@
}%
}%
\begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)},CoinHD={u*(20,20)}]
- Echelle=\useKV[ClesREntier]{Echelle};
+ Echelle=\useKV[ClesRBase]{Echelle};
NM=\NombreMilliers;
NC=\NombreCentaines;
ND=\NombreDizaines;
NU=\NombreUnites;
+ Base=\useKV[ClesRBase]{Base};
color ColorEntier[];
ColorEntier1=\ListeCouleurEntier[1];
ColorEntier2=\ListeCouleurEntier[2];
ColorEntier3=\ListeCouleurEntier[3];
ColorEntier4=\ListeCouleurEntier[4];
boolean Compact,Print;
- Compact=\useKV[ClesREntier]{Compact};
- Print=\useKV[ClesREntier]{Impression};
- Initialisation(5,30,15,50*Echelle);
+ Compact=\useKV[ClesRBase]{Compact};
+ Print=\useKV[ClesRBase]{Impression};
+ Initialisation(5,30,20,50*Echelle);
color A,B,C,D,E,F,G,H;
picture TypePave[];
TypePave0=image(
trace Pave(A,B,C,D,E,F,G,H)(1,1,1);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier1 fi;
- for k=0 upto 10:
- trace chemin((k/10)[A,B],(k/10)[F,G],(k/10)[E,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,B],(k/Base)[F,G],(k/Base)[E,H]);
endfor;
- for k=0 upto 10:
- trace chemin((k/10)[B,C],(k/10)[G,H],(k/10)[F,E]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[B,C],(k/Base)[G,H],(k/Base)[F,E]);
endfor;
- for k=0 upto 10:
- trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,F],(k/Base)[B,G],(k/Base)[C,H]);
endfor;
);
color A,B,C,D,E,F,G,H;
TypePave1=image(
- trace Pave(A,B,C,D,E,F,G,H)(0.1,1,1);
+ trace Pave(A,B,C,D,E,F,G,H)(1/Base,1,1);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier2 fi;
trace chemin(C,H,E);
- for k=0 upto 10:
- trace chemin((k/10)[A,B],(k/10)[F,G],(k/10)[E,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,B],(k/Base)[F,G],(k/Base)[E,H]);
endfor;
- for k=0 upto 10:
- trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,F],(k/Base)[B,G],(k/Base)[C,H]);
endfor;
);
color A,B,C,D,E,F,G,H;
TypePave2=image(
- trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,1);
+ trace Pave(A,B,C,D,E,F,G,H)(1/Base,1/Base,1);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier3 fi;
trace chemin(C,H,E);
trace chemin(A,F,E);
trace chemin(B,G,F);
- for k=0 upto 10:
- trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]);
+ for k=0 upto Base:
+ trace chemin((k/Base)[A,F],(k/Base)[B,G],(k/Base)[C,H]);
endfor;
);
color A,B,C,D,E,F,G,H;
TypePave3=image(
- trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,0.1);
+ trace Pave(A,B,C,D,E,F,G,H)(1/Base,1/Base,1/Base);
currentpicture:=nullpicture;
remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier4 fi;
trace chemin(C,H,E);
@@ -119,32 +135,32 @@
trace chemin(B,G);
);
if Compact:
- for k=0 upto (\NombreMilliers-1):
- trace TypePave0 shifted ((Projette((k,0,0))-Projette((0,0,0))));
+ for k=0 upto (NM-1):
+ trace TypePave0 shifted ((Projette((k/Base,0,0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreCentaines-1):
- trace TypePave1 shifted ((Projette((0.1*k,1.5,0))-Projette((0,0,0))));
+ for k=0 upto (NC-1):
+ trace TypePave1 shifted ((Projette((k/Base,1+1/Base,0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreDizaines-1):
- trace TypePave2 shifted ((Projette((0.1*k,3,0))-Projette((0,0,0))));
+ for k=0 upto (ND-1):
+ trace TypePave2 shifted ((Projette((k/Base,2+2/Base,0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreUnites-1):
- trace TypePave3 shifted ((Projette((0,3.6,0.1*k))-Projette((0,0,0))));
+ for k=0 upto (NU-1):
+ trace TypePave3 shifted ((Projette((k/Base,2+4/Base,0))-Projette((0,0,0))));
endfor;
else:
- for k=0 upto (\NombreMilliers-1):
- trace TypePave0 shifted ((Projette((0,1.1*(k-1),0))-Projette((0,0,0))));
+ for k=0 upto (NM-1):
+ trace TypePave0 shifted ((Projette((0,(1+1/Base)*(k-1),0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreCentaines-1):
- trace TypePave1 shifted ((Projette((0,1.1*\NombreMilliers+1.1*(k-1),0))-Projette((0,0,0))));
+ for k=0 upto (NC-1):
+ trace TypePave1 shifted ((Projette((0,(1+1/Base)*NM+(1+1/Base)*(k-1),0))-Projette((0,0,0))));
endfor;
- for k=0 upto (\NombreDizaines-1):
- trace TypePave2 shifted ((Projette((0,1.1*\NombreMilliers+1.1*(\NombreCentaines-1)+0.2+0.2*(k-1),0))-Projette((0,0,0))));
+ for k=0 upto (ND-1):
+ trace TypePave2 shifted ((Projette((0,(1+1/Base)*NM+(1+1/Base)*(NC-1)+(2/Base)+(2/Base)*(k-1),0))-Projette((0,0,0))));
endfor;
for k=0 upto (\NombreUnites-1):
- trace TypePave3 shifted ((Projette((0,1.1*\NombreMilliers+1.1*(\NombreCentaines-1)+0.2+0.2*(\NombreDizaines-1),0.2*(k)))-Projette((0,0,0))));
+ trace TypePave3 shifted ((Projette((0,(1+1/Base)*NM+(1+1/Base)*(NC-1)+(2/Base)+(2/Base)*(ND-1),(2/Base)*(k)))-Projette((0,0,0))));
endfor;
fi;
\end{Geometrie}
- }
-} \ No newline at end of file
+ }%
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfCRose.tex b/macros/latex/contrib/profcollege/latex/PfCRose.tex
index e238d42390..98363a8a64 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRose.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRose.tex
@@ -1,7 +1,7 @@
%%%
% Rose
%%%
-\setKVdefault[ClesRose]{Vide=false,Couleur=white,Produits=false,Solution=false,Rayon=2cm,Petales=7,Aide=false,FacteurMin=2,FacteurMax=10,ProduitVide=false,CaseVide=false,Polygone=false,Nom=Rose1,Creation=false,Addition=false}%
+\setKVdefault[ClesRose]{Vide=false,Couleur=white,Produits=false,Solution=false,Rayon=2cm,Petales=7,Aide=false,FacteurMin=2,FacteurMax=10,ProduitVide=false,CaseVide=false,Polygone=false,Nom=Rose1,Creation=false,Addition=false,Melange=false}%
\defKV[ClesRose]{LesNombres=\setKV[ClesRose]{Creation}}%
\defKV[ClesRose]{LesProduits=\setKV[ClesRose]{Creation}}%
\defKV[ClesRose]{LesSommes=\setKV[ClesRose]{Addition}}%
@@ -176,6 +176,39 @@
nbpetales:=nbpetales+1;
endfor;
enddef;
+ %
+ vardef AffichagedelaListePDF(text t)=
+ nbpetales:=0;
+ for p_=t:
+ if nbpetales<Petales:
+ if p_="":
+ if Solution:
+ fill rotation(polygone(O,B[Petales-1],A[0],B[Petales]),O,nbpetales*(360/Petales)) withcolor Fond;
+ if unknown FacteurSol[nbpetales]:
+ else:
+ label(LATEX("\num{"&decimal(FacteurSol[nbpetales])&"}"),(0.5[O,A[nbpetales]]-center BoiteRec));
+ fi;
+ fi;
+ else:
+ label(LATEX("\num{"&p_&"}"),(0.5[O,A[nbpetales]]-center BoiteRec));
+ fi;
+ else:
+ if p_="":
+ if Solution:
+ fill (BoiteRec shifted (B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales]))) withcolor Fond;
+ if Addition:
+ label(LATEX("\num{\noexpand\fpeval{"&decimal(Facteur[nbpetales-Petales])&"+"&decimal(Facteur[nbpetales+1-Petales])&"}}"),(B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales])));
+ else:
+ label(LATEX("\num{\noexpand\fpeval{"&decimal(Facteur[nbpetales-Petales])&"*"&decimal(Facteur[nbpetales+1-Petales])&"}}"),(B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales])));
+ fi;
+ fi;
+ else:
+ label(LATEX("\num{"&p_&"}"),(B[nbpetales-Petales]+0.5*Rayon*unitvector(B[nbpetales-Petales])));
+ fi;
+ fi;
+ nbpetales:=nbpetales+1;
+ endfor;
+ enddef;
}
\NewDocumentCommand\DessineRoseMulPerso{mm}{%
@@ -231,7 +264,7 @@
}]
RecupListe(#2);
RechercheFacteurs;
- AffichagedelaListe(#1);
+ AffichagedelaListePDF(#1);
if Aide:
for k=0 upto Petales-1:
drawarrow (0.5[O,A[k]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
@@ -246,9 +279,9 @@
fill cercles(O,4mm) withcolor white;
draw cercles(O,4mm);
if Addition:
- label(TEX("\Huge$+$"),O);
+ label(LATEX("\Huge$+$"),O);
else:
- label(TEX("\Huge$\times$"),O);
+ label(LATEX("\Huge$\times$"),O);
fi;
\end{mpost}
\fi
@@ -270,40 +303,19 @@
if ProduitVide:Solution:=true fi;
if CaseVide:Solution:=true fi;
% on labelise
- if Vide=false:
- if Produits:
- else:
for k=0 upto Petales-1:
label(TEX("\num{"&decimal(Facteur[k])&"}"),(0.5[O,A[k]]-center BoiteRec));
endfor;
- fi;
- if Produits or Solution:
for k=0 upto Petales-1:
label(TEX("\num{"&decimal(Produit[k])&"}"),(B[k]+0.5*Rayon*unitvector(B[k])));
endfor;
- fi;
- fi;
- % On trace et on affiche...éventuellement :)
+ % On trace
if Aide:
for k=0 upto Petales-1:
drawarrow (0.5[O,A[k]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) 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 (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
endfor;
fi;
- if ProduitVide:
- %choix=floor(uniformdeviate(Petales-1));
- fill (BoiteRec shifted (1.75[O,B[choix]]-center BoiteRec)) withcolor Fond;
- fill rotation(polygone(O,B0,A1,B1),O,(choix-1)*(360/Petales)) withcolor Fond;
- fill rotation(polygone(O,B0,A1,B1),O,choix*(360/Petales)) withcolor Fond;
- fi;
- if CaseVide:
- %choix:=floor(uniformdeviate(Petales-1));
- for k=0 upto Petales-1:
- if k<>choix:
- fill rotation(polygone(O,B0,A1,B1),O,k*(360/Petales)) withcolor Fond;
- fi;
- endfor;
- fi;
trace A0 for k=1 upto Petales:--A[k] endfor --cycle;
for k=0 upto Petales-1:
trace segment(O,B[k]) dashed withdots scaled 0.25;
@@ -326,6 +338,7 @@
\begin{mplibcode}[\PfCNomRose]
vardef ExtraireListe(expr nbmin,nbmax,nbfacteurs)=
numeric ElementE[],ElementS[];
+ boolean VueE[];
%% éléments d'entrée
nbe:=1;
for k=nbmin upto nbmax:
@@ -335,6 +348,7 @@
totalE:=(nbmax-nbmin)+1;
numeric rec;
for k=1 upto nbfacteurs:
+ VueE[k-1]=true;
rec:=ceiling(uniformdeviate(totalE+1-k));
ElementS[k]=ElementE[rec];
numeric ElementI[];
@@ -345,6 +359,7 @@
ElementI[p]=ElementE[l];
fi;
endfor;
+ VueE[Petales]:=true;
numeric ElementE[];
for l=1 upto p:
ElementE[l]=ElementI[l];
@@ -353,7 +368,8 @@
enddef;
pair A[],B[],O;
Rayon:=\useKV[ClesRose]{Rayon};
- boolean Aide,Produits,Solution,Vide,ProduitVide,CaseVide,Polygone,Addition;
+ boolean Aide,Produits,Solution,Vide,ProduitVide,CaseVide,Polygone,Addition,Melange;
+ Melange:=\useKV[ClesRose]{Melange};
Addition=\useKV[ClesRose]{Addition};
Aide:=\useKV[ClesRose]{Aide};
Vide:=\useKV[ClesRose]{Vide};
@@ -418,6 +434,37 @@
drawarrow (0.5[O,A[k+1]]--1.75[O,B[k]]) cutbefore segment(A[k],A[k+1]) cutafter BoiteRec shifted (B[k]+0.5*Rayon*unitvector(B[k])) dashed evenly scaled 0.5;
endfor;
fi;
+ if Melange:
+ % on gère les "oublis"
+ nbvide:=0;
+ for k=0 step 2 until Petales-1:
+ if uniformdeviate(1)<0.5:
+ nbk:=k;
+ else:
+ nbk:=k+1
+ fi;
+ VueE[nbk]:=false;
+ endfor;
+ VueE[Petales]:=VueE[0];
+ for k=0 upto Petales-1:
+ fill rotation(polygone(O,B0,A1,B1),O,(k-1)*(360/Petales)) withcolor Fond;
+ if VueE[k]:
+ label(TEX("\num{"&decimal(Facteur[k])&"}"),(0.5[O,A[k]]-center BoiteRec));
+ fi;
+ endfor;
+ % on affiche les produits pour les effacer
+ for k=0 upto Petales-1:
+ if VueE[k]:
+ if VueE[k+1]=false:
+ label(TEX("\num{"&decimal(Produit[k])&"}"),(B[k]+0.5*Rayon*unitvector(B[k])));
+ fi;
+ else:
+ if VueE[k+1]=false:
+ label(TEX("\num{"&decimal(Produit[k])&"}"),(B[k]+0.5*Rayon*unitvector(B[k])));
+ fi;
+ fi;
+ endfor;
+ else:
if ProduitVide:
choix:=floor(uniformdeviate(Petales-1));
fill (BoiteRec shifted (1.75[O,B[choix]]-center BoiteRec)) withcolor Fond;
@@ -432,6 +479,7 @@
fi;
endfor;
fi;
+ fi;
trace A0 for k=1 upto Petales:--A[k] endfor --cycle;
for k=0 upto Petales-1:
trace segment(O,B[k]) dashed withdots scaled 0.25;
@@ -557,9 +605,9 @@
fill cercles(O,3mm) withcolor white;
draw cercles(O,3mm);
if Addition:
- label(TEX("\Large$+$"),O);
+ label(LATEX("\noexpand\Large$+$"),O);
else:
- label(TEX("\Large$\times$"),O);
+ label(LATEX("\noexpand\Large$\times$"),O);
fi;
\end{mpost}
\fi
diff --git a/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex b/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
index fa7363c750..4038ecd1b0 100644
--- a/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCSimplifierFraction.tex
@@ -123,7 +123,7 @@
}
\newcount\anpdc\newcount\bnpdc\newcount\cnpdc\newcount\dnpdc%
-\newcount\DivCom
+\newcount\PfCDivCom%
\newcommand\DiviseurCommun[2]{%
% #1 : le premier nombre entier
% #2 : le deuxi\`eme nombre entier
@@ -131,50 +131,50 @@
\cnpdc=#2%
\bnpdc=2\relax%
\dnpdc=\numexpr#1+1\relax%
- \DivCom=1\relax%
+ \PfCDivCom=1\relax%
\whiledo{\bnpdc<\dnpdc}{%
\modulo{\the\anpdc}{\the\bnpdc}\relax
\ifnum\remainder=0%
\modulo{\the\cnpdc}{\the\bnpdc}
\ifnum\remainder=0%
- \DivCom=\bnpdc%
+ \PfCDivCom=\bnpdc%
\bnpdc=\anpdc%
\else%
- \DivCom=1%
+ \PfCDivCom=1%
\fi
\else%
- \DivCom=1%
+ \PfCDivCom=1%
\fi
\bnpdc=\numexpr\bnpdc+1\relax%
}%
}
-\newcommand\LongueSimplification[2]{%
- \xdef\NumerateurDiv{#1}%
- \xdef\DenominateurDiv{#2}%
+\NewDocumentCommand\LongueSimplification{mm}{%
+ \xdef\PfCNumerateurDiv{#1}%
+ \xdef\PfCDenominateurDiv{#2}%
\ifboolKV[ClesSimplification]{Impose}{%
- \DivCom=\useKV[ClesSimplification]{Nombre}%
+ \PfCDivCom=\useKV[ClesSimplification]{Nombre}%
}{%
\DiviseurCommun{#1}{#2}%
}%
\ifboolKV[ClesSimplification]{Debut}{%
\ensuremath{%
- \whiledo{\DivCom>1}{%
- \frac{\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}\times\num{\fpeval{\NumerateurDiv/\the\DivCom}}}{\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}\times\num{\fpeval{\DenominateurDiv/\the\DivCom}}}=\frac{\num{\fpeval{\NumerateurDiv/\DivCom}}}{\num{\fpeval{\DenominateurDiv/\DivCom}}}%
- \xdef\NumerateurDiv{\fpeval{\NumerateurDiv/\DivCom}}%
- \xdef\DenominateurDiv{\fpeval{\DenominateurDiv/\DivCom}}%
- \DiviseurCommun{\NumerateurDiv}{\DenominateurDiv}%
- \xintifboolexpr{\DivCom>1}{=}{}%
+ \whiledo{\PfCDivCom>1}{%
+ \frac{\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}\times\num{\fpeval{\PfCNumerateurDiv/\the\PfCDivCom}}}{\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}\times\num{\fpeval{\PfCDenominateurDiv/\the\PfCDivCom}}}=\frac{\num{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}}{\num{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}}%
+ \xdef\PfCNumerateurDiv{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}%
+ \xdef\PfCDenominateurDiv{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}%
+ \DiviseurCommun{\PfCNumerateurDiv}{\PfCDenominateurDiv}%
+ \xintifboolexpr{\PfCDivCom>1}{=}{}%
}%
}%
}{%
\ensuremath{%
- \whiledo{\DivCom>1}{%
- \frac{\num{\fpeval{\NumerateurDiv/\the\DivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}}{\num{\fpeval{\DenominateurDiv/\the\DivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\DivCom}}}=\frac{\num{\fpeval{\NumerateurDiv/\DivCom}}}{\num{\fpeval{\DenominateurDiv/\DivCom}}}%
- \xdef\NumerateurDiv{\fpeval{\NumerateurDiv/\DivCom}}%
- \xdef\DenominateurDiv{\fpeval{\DenominateurDiv/\DivCom}}%
- \DiviseurCommun{\NumerateurDiv}{\DenominateurDiv}%
- \xintifboolexpr{\DivCom>1}{=}{}%
+ \whiledo{\PfCDivCom>1}{%
+ \frac{\num{\fpeval{\PfCNumerateurDiv/\the\PfCDivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}}{\num{\fpeval{\PfCDenominateurDiv/\the\PfCDivCom}}\times\mathcolor{PfCSimpliCol}{\num{\the\PfCDivCom}}}=\frac{\num{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}}{\num{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}}%
+ \xdef\PfCNumerateurDiv{\fpeval{\PfCNumerateurDiv/\PfCDivCom}}%
+ \xdef\PfCDenominateurDiv{\fpeval{\PfCDenominateurDiv/\PfCDivCom}}%
+ \DiviseurCommun{\PfCNumerateurDiv}{\PfCDenominateurDiv}%
+ \xintifboolexpr{\PfCDivCom>1}{=}{}%
}%
}%
}%
@@ -186,7 +186,7 @@
\newcounter{NbFrac}%
\setcounter{NbFrac}{0}%
-\newcommand\Simplification[3][]{%
+\NewDocumentCommand\Simplification{omm}{%
\stepcounter{NbFrac}%
\useKVdefault[ClesSimplification]%
\setKV[ClesSimplification]{#1}%
@@ -198,15 +198,15 @@
\setbox2=\hbox{\Listeb[1,1]}%
\setbox3=\hbox{\Listea[1,3]}%
\setbox4=\hbox{\Listeb[1,3]}%
- \ensuremath{%
- \frac{\tikzmarknode[anchor=north]{A-\theNbFrac}{\Listea[1,1]}{}}{\tikzmarknode[anchor=south]{B-\theNbFrac}{\Listeb[1,1]}{}}=\frac{\tikzmarknode[anchor=north]{C-\theNbFrac}{\Listea[1,3]}{}}{\tikzmarknode[anchor=south]{D-\theNbFrac}{\Listeb[1,3]}{}}%
- }%
- \begin{tikzpicture}[remember picture,overlay]%
- \draw[out=45,in=135,-stealth,transform canvas={yshift=0.25em}]
- let
- \p1=(pic cs:A-\theNbFrac),
- \p2=(pic cs:C-\theNbFrac)
- in (pic cs:A-\theNbFrac) to node[midway,above]{\Listea[1,2]}(\x2,\y1);
+ \ensuremath{%
+ \frac{\tikzmarknode[anchor=north]{A-\theNbFrac}{\Listea[1,1]}{}}{\tikzmarknode[anchor=south]{B-\theNbFrac}{\Listeb[1,1]}{}}=\frac{\tikzmarknode[anchor=north]{C-\theNbFrac}{\Listea[1,3]}{}}{\tikzmarknode[anchor=south]{D-\theNbFrac}{\Listeb[1,3]}{}}%
+ }%
+ \begin{tikzpicture}[remember picture,overlay]%
+ \draw[out=45,in=135,-stealth,transform canvas={yshift=0.25em}]
+ let
+ \p1=(pic cs:A-\theNbFrac),
+ \p2=(pic cs:C-\theNbFrac)
+ in (pic cs:A-\theNbFrac) to node[midway,above]{\Listea[1,2]}(\x2,\y1);
\draw[out=-45,in=-135,-stealth,transform canvas={yshift=-0.25em}] (pic cs:B-\theNbFrac) to node[midway,below]{\Listeb[1,2]}(pic cs:D-\theNbFrac);%
\end{tikzpicture}%
}{%
diff --git a/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex b/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
index 37952adfda..b5322f13e2 100644
--- a/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCStatistiques.tex
@@ -18,7 +18,7 @@ Tableau=false,Stretch=1,Frequence=false,EffectifTotal=false,%
Etendue=false,Moyenne=false,SET=false,ValeurExacte=false,MoyenneA,Somme,Mediane=false,DetailsMediane=false,UneMediane=false,QuartileUn=false,QuartileTrois=false,Total=false,Concret=false,%
Largeur=1cm,Precision=2,PrecisionF=0,Donnee=Valeurs,Effectif=Effectif,Grille=false,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,Classes=false,TableauVide=false,ECC=false,Coupure=10,CouleurTab=gray!15,Graphique=false,Batons=true,Centre=false,CentreVide=false,Crochets=false,%
% Pour les diags batons
-EpaisseurBatons=1,ListeCouleursB={a},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,CouleurDefaut=black,Date=false,GrandNombrey=false,GrandNombrex=false,%
+EpaisseurBatons=1,ListeCouleursB={a},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,CouleurDefaut=black,Date=false,GrandNombrey=false,GrandNombrex=false,PasGrillex=1,PasGrilley=1,%
% Pour les diags circulaires
Rayon=3cm,AffichageAngle=false,AffichageDonnee=false,ListeCouleurs={white},Hachures=false,ListeHachures={60},LectureInverse=false,EcartHachures=0.25,EpaisseurHachures=1,Legende,LegendeVide=false,ACompleter=false,DebutAngle=0,%
%Pour les représentations
@@ -464,7 +464,7 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
unitey:=\useKV[ClesStat]{Unitey}*cm;
xpartorigine:=\useKV[ClesStat]{Origine};
AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse};
- boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret,LegendeVide,Retour,GrandNombrex,GrandNombrey,Date;
+ boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret,LegendeVide,Retour,GrandNombrex,GrandNombrey,Date,Grille;
GrandNombrex=\useKV[ClesStat]{GrandNombrex};
GrandNombrey=\useKV[ClesStat]{GrandNombrey};
if GrandNombrex:
@@ -485,6 +485,11 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
Qualitatif=\useKV[ClesStat]{Qualitatif};
Tiret=\useKV[ClesStat]{Tiret};
Retour=false;
+ Grille:=\useKV[ClesStat]{Grille};
+ Pasx:=\useKV[ClesStat]{Pasx};
+ Pasy:=\useKV[ClesStat]{Pasy};
+ PasGrillex:=\useKV[ClesStat]{PasGrillex};
+ PasGrilley:=\useKV[ClesStat]{PasGrilley};
color CoulDefaut;
CoulDefaut=\useKV[ClesStat]{CouleurDefaut};
Depart=\useKV[ClesStat]{Depart};
@@ -635,16 +640,13 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
endfor;
enddef;
if Qualitatif: tutu(#1); else: toto(#1); fi;
- boolean Grille;
- Grille:=\useKV[ClesStat]{Grille};
- Pasx:=\useKV[ClesStat]{Pasx};
- Pasy:=\useKV[ClesStat]{Pasy};
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if Grille:
drawoptions(withcolor 0.75white);
- for k=0 step Pasx until ((maxx+1)):
- trace (k*unitex,0)--(k*unitex,unitey*(maxy+2*Pasy));
+ for k=0 step PasGrillex until ((maxx+1)):
+ trace (k*unitex,0)--(k*unitex,unitey*((floor(maxy/Pasy)+1)*Pasy));
endfor;
- for k=0 step Pasy until ((maxy+2*Pasy)):
+ for k=0 step PasGrilley until (floor(maxy/Pasy)+1)*Pasy:%((maxy+2*Pasy)):
trace (0,k*unitey)--(unitex*(maxx+1),k*unitey);
endfor;
drawoptions();
@@ -694,9 +696,9 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
endfor;
fi;
drawarrow (0,0)--unitex*(maxx+1,0);
- drawarrow (0,0)--unitey*(0,maxy+2*Pasy);
+ drawarrow (0,0)--unitey*(0,(floor(maxy/Pasy)+1)*Pasy);
label.lrt(btex \useKV[ClesStat]{Donnee} etex,unitex*(maxx+1,0));
- label.urt(btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+2*Pasy));
+ label.urt(btex \useKV[ClesStat]{Effectif} etex,unitey*(0,(floor(maxy/Pasy)+1)*Pasy));
if Qualitatif: titi(#1); else:tata(#1); fi;
\end{mplibcode}
\else
@@ -837,6 +839,7 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
LegendeVide=\useKV[ClesStat]{LegendeVide};
Retour=false;
ACompleter=\useKV[ClesStat]{ACompleter};
+ DebutAngle=\useKV[ClesStat]{DebutAngle};
%
pair A[],O,B[],C[],D[];
O=(0,0);
@@ -933,7 +936,7 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
\mplibforcehmode
\begin{mplibcode}
\NewMPStatCirculaireCodeQ
- DebutAngle=\useKV[ClesStat]{DebutAngle};
+% DebutAngle=\useKV[ClesStat]{DebutAngle};
if Inverse=false:
A[0]=point(0+DebutAngle) of cc;
else:
@@ -1072,7 +1075,12 @@ Histogramme=false,UniteAire=1,MemeAmpli,DepartHisto=1%
fi;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={\NewMPStatCirculaireCodeQ}]
+ \begin{mpost}[mpsettings={\NewMPStatCirculaireCodeQ}]
+ if Inverse=false:
+ A[0]=point(0+DebutAngle) of cc;
+ else:
+ A[0]=point(180+DebutAngle) of cc;
+ fi;
pair A[],O,B[],C[],D[];
O=(0,0);
n:=0;
diff --git a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
index 7cc556894d..8e75b05cdd 100644
--- a/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCTableauxUnites.tex
@@ -1,13 +1,14 @@
%%%
% 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}
+\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}
\newcommand\PfCTBstrut{\rule[-1.2ex]{0pt}{3.8ex}}% Top and Bottom strut
\newcommand\PfCTstrut{\rule{0pt}{3.8ex}}% Top strut
\newcommand\PfCBstrut{\rule[-1.2ex]{0pt}{0ex}}% Bottom strut
\newlength\PfCTableauPuissances%
+\newlength\PfCCubeTabColSep
\def\PfCCG{centaines de milliards}
\def\PfCDG{dizaines de milliards}
@@ -1179,10 +1180,11 @@
%%% Prise en compte de la cl\'e Cube
%
\ifboolKV[ClesTableaux]{Cube}{%
+ \setlength{\PfCCubeTabColSep}{\useKV[ClesTableaux]{Tabcolsep}}
\[\renewcommand{\arraystretch}{1.15}%
% \setlength{\tabcolsep}{0.625\tabcolsep}%
% \begin{NiceTabular}{*{7}{wc{3.5mm}wc{3.5mm}wc{3.5mm}}}
- \setlength{\tabcolsep}{0.275\tabcolsep}%
+ \setlength{\tabcolsep}{\PfCCubeTabColSep}%
\begin{NiceTabular}{*{7}{wc{15pt}wc{15pt}wc{15pt}}}
\Block[]{1-3}{}%
&&&\Block[]{1-3}{}%
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index a7af54cbf8..a179a3e281 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/08/16}%
+\def\filedate{2023/09/06}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-z-s}%
+\def\fileversion{0.99-z-t}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]%
@@ -31,7 +31,8 @@
reset-text-series = false, reset-text-shape = false,%
text-family-to-math = true, text-series-to-math = true,%
output-decimal-marker={,},%
- group-minimum-digits=4%
+ group-minimum-digits=4,%
+ quantity-product={~}%
}%
\DeclareSIUnit{\kmh}{\km\per\hour}%
\newcommand\speed[1]{\SI{#1}{\kmh}}%
@@ -360,6 +361,31 @@
\day=\the\PfCrappeljour\relax%
}
+\newcommand\MelangeLettres[2]{%
+ % #2 Nombre d'éléments à conserver
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeInter{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,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}%
+ \xdef\faa{}% Liste construite
+ \xdef\fii{}% Liste détruite
+ \xintFor* ##1 in {\xintSeq{1}{#1}}\do{%
+ \xintifboolexpr{\ListeInterlen>1}{%
+ \xdef\Alea{\fpeval{randint(\ListeInterlen)}}%
+ \xdef\faa{\faa\ListeInter[\Alea]}%
+ \xdef\fii{}%
+ \xintFor* ##2 in {\xintSeq{1}{\ListeInterlen}}\do{%
+ \xintifboolexpr{##2 == \Alea}{%
+ }{%
+ \xdef\fii{\fii \ListeInter[##2],}%
+ }%
+ }%
+ }{%
+ \xdef\faa{\faa\ListeInter[1]}%
+ }%
+ \readlist*\ListeInter{\fii}%
+ }%
+ \xdef#2{\faa}%
+}%
+
\newcommand\MelangeListe[2]{%
% #1 Liste à mélanger
% #2 Nombre d'éléments à conserver
@@ -573,6 +599,10 @@
}%\emoticon
}%\raisebox
}%
+\input{PfCCibleQOp}
+\input{PfCFubuki}
+\input{PfCMulJap}
+\input{PfCCryptarithme}
\input{PfCDefiCalc}
\input{PfCMulArt}
\input{PfCGrimuku}
@@ -583,7 +613,7 @@
\input{PfCAutomatismes}
\input{PfCNumberHive}
\input{PfCPatronPaves}
-\input{PfCErathostene}
+\input{PfCEratosthene}
\input{PfCDobble}
\input{PfCPavage}
\input{PfCNonogramme}
@@ -686,7 +716,7 @@
\ensuremath{%
\xintifboolexpr{#2==0}{1}{\xintifboolexpr{#2>0}{\xdef\TotalP{\fpeval{#2-1}}#1\multido{\i=1+1}{\TotalP}{\times#1}}{\xdef\TotalP{\fpeval{-#2-1}}\frac{1}{#1\multido{\i=1+1}{\TotalP}{\times#1}}}}%
}%
-}
+}%
\input{PfCEcritureUnites}
\input{PfCTableauxUnites}
diff --git a/macros/latex/contrib/profcollege/metapost/PfCCalculatrice.mp b/macros/latex/contrib/profcollege/metapost/PfCCalculatrice.mp
index daae0553f7..28252f90bf 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCCalculatrice.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCCalculatrice.mp
@@ -40,7 +40,7 @@ decahoriz:=0;
vardef Test(expr cptk)(text cptnt)=
pair Decalage;
- if nblignes mod 2=0:
+ if nblignes>1:
Decalage:=u*((LargeurEcran,-8*(nblignes-1))-6*(length(cptnt)-cptk,0));
else:
Decalage:=u*(decahoriz,-8*(nblignes-1));
@@ -186,12 +186,11 @@ vardef LCD(text nt)(text rep)(expr NB)=
endfor;
fi;
for k=1 upto NB:
- nblignes:=nblignes+1;
- Ecran:=(u*(0,-1)--u*(LargeurEcran,-1)--u*(LargeurEcran,7)--u*(0,7)--cycle) shifted(u*(0,-8*(nblignes-1)));
+ Ecran:=(u*(0,-1)--u*(LargeurEcran,-1)--u*(LargeurEcran,7)--u*(0,7)--cycle) shifted(u*(0,-8*(k+nblignes-1)));
fill Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
draw Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
endfor;
- nblignes:=nblignes+1;
+ nblignes:=nblignes+NB+1;
Ecran:=(u*(0,-1)--u*(LargeurEcran,-1)--u*(LargeurEcran,7)--u*(0,7)--cycle) shifted(u*(0,-8*(nblignes-1)));
fill Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
draw Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
index 95c18757f1..37f4809598 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp
@@ -1316,10 +1316,13 @@ enddef;
%Outils
numeric echelleequerre;
echelleequerre=0.5;
-vardef equerreold(expr dte,drte,perpe,sens)=
- save picequerre;
- picture picequerre;
+vardef Equerre(expr dte,drte,perpe,sens)=
+ save $;
+ picture $,fig;
+ fig=currentpicture;
pair ww,t[];
+ picture grad[],gradu[];
+ numeric long;
path intermede;
pair perpen,ptt,pttt;
perpen:=projection(perpe,dte,drte);
@@ -1329,86 +1332,23 @@ vardef equerreold(expr dte,drte,perpe,sens)=
ptt:=echelleequerre*(drte-dte) rotated (-90) shifted perpen;
fi;
ww=unitvector(drte-dte);
- intermede=ptt--(10[ptt,(perpen rotatedabout(ptt,if sens=1: 30 else:-30 fi))]);
+ intermede=ptt--(10[ptt,(perpen rotatedabout(ptt,30))]);
pttt=intermede intersectionpoint (10[dte,drte]--10[drte,dte]);
- picequerre=image(
+ long=floor(abs(perpen+7*unitvector(ptt-perpen)-ptt)*2.54/72);
+ pair CentreE;
+ CentreE=CentreCercleI(perpen,ptt,pttt);
+ $=image(
+ fill (perpen--ptt--pttt--cycle) withcolor 0.9*white;
draw perpen--ptt--pttt--cycle;
draw codeperp(ptt,perpen,pttt,5);
+ fill homothetie(polygone(perpen,ptt,pttt),CentreE,0.6) withcolor white;
+ draw homothetie(polygone(perpen,ptt,pttt),CentreE,0.6);
+ draw fig;
);
- picequerre
-enddef;
-
-vardef equerre(text gradua)(expr ea,eb,ec)=
- save picequerre;
- picture picequerre;
- pair EA,EB,EC,ED,EE,EF,EI;
- EA:=ea;
- EB:=eb;
- EC:=ec;
- ED=projection(EC,EA,EB);
- EE-ED=EB-EA;
- EF-ED=echelleequerre*abs(EE-ED)*(unitvector(EE-ED) rotated 90);
- EI=CentreCercleI(EE,ED,EF);
- picequerre=image(
- fill (EE--ED--EF--cycle) withcolor 0.7white;
- draw codeperp(EE,ED,EF,5);
- draw EE--ED--EF--cycle;
- fill ((((EE--ED--EF--cycle) shifted ((0,0)-EI)) scaled 0.5) shifted EI) withcolor white;
- trace (((EE--ED--EF--cycle) shifted ((0,0)-EI)) scaled 0.5) shifted EI;
- % if abs(EE-ED)>abs(EF-ED):
-% for k=10 upto 50:%
-% trace (ED+k*1mm*unitvector(EE-ED))--(ED+k*1mm*unitvector(EE-ED)+1mm*unitvector(EF-ED));
-% endfor;
-% else:
-% for k=10 upto 50:%
-% trace (ED+k*1mm*unitvector(EF-ED))--(ED+k*1mm*unitvector(EF-ED)+1mm*unitvector(EE-ED));
-% endfor;
-% fi;
- );
- picequerre
-enddef;
-
-
-% ww;
-% pair Intermede;
-% pair perpen,I,ptt;%,pttt
-% perpen:=projection(perpe,dte,drte);
-% Intermede:=echelleequerre[dte,drte];
-% ptt-perpen=abs(Intermede-perpen)*0.5*unitvector(perpe-perpen);
-% I:=CentreCercleI(perpen,ptt,Intermede);
-% ww=unitvector(drte-dte);
-% intermede=ptt--(10[ptt,(perpen rotatedabout(ptt,if sens=1: 30 else:-30 fi))]);
-% pttt=intermede intersectionpoint (10[dte,drte]--10[drte,dte]);
-% picequerre=image(
-%
-% draw codeperp(ptt,perpen,Intermede,5);
-% k=0;
-% pair Equa,Equb,Equc;
-% Equa:=perpen;
-% boolean Stop;
-% Stop=false;
-% forever:
-% label.top(TEX(decimal(angle(drte-perpen)-angle(perpe-perpen))),A);
-% for k=1 upto 100:
-% k:=k+1;
-% Equa:=perpen+k*1mm*unitvector(drte-perpen);
-% dotlabel("",Equa);
-% Equb:=Equa+1mm*unitvector(drte-perpen);
-% Equc:=rotation(Equb,Equa,-angle((drte-perpen)-(perpe-perpen)));
-% drawoptions(withcolor red);
-% dotlabel("",Equc);
-% drawoptions();
-% if abs(Equa-perpen)>9mm:%
-% trace Equa--Equc;
-% fi;
- % if abs(drte-Equa)<1cm:
-% Stop:=false;
-% fi;
-% exitif: Stop;
-% endfor;
-% );
-% picequerre
-%enddef;
+ $
+enddef;
+
+vardef equerre(expr dte,drte,perpe,sens)=Equerre(dte,drte,perpe,sens) enddef;
vardef regle(expr depart,arrivee,rr)=
save picregle;
@@ -1519,7 +1459,8 @@ vardef Rapporteur(text t)(expr rapcentre,pointsupport,rr,pasgrad)=
elseif p_="Tiret":
Tiret:=true;
fi;
- endfor;
+endfor;
+taillefonte=6;
% Le cercle
RA1=0.3[rapcentre,pointsupport];
RA2=0.375[rapcentre,pointsupport];
@@ -1550,7 +1491,7 @@ vardef Rapporteur(text t)(expr rapcentre,pointsupport,rr,pasgrad)=
fincompteur:=36;
fi;
if (pasgrad=10) or (pasgrad=5) or (pasgrad=1):
- for i=0 upto (fincompteur-1)/2:
+ for i=0 upto (fincompteur)/2:
draw grada[10*i]--gradb[10*i] withpen pencircle scaled 1.15;
endfor;
fi;
@@ -1580,26 +1521,26 @@ vardef Rapporteur(text t)(expr rapcentre,pointsupport,rr,pasgrad)=
if rr=1:
for j=0 upto 18:
nombre[10*j]=image(
- label.bot(TEX("\fontsize{4}{4}\selectfont"&decimal(10*j)&""),grada[10*j]);
+ label.bot(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(10*j)),grada[10*j]);
currentpicture:=currentpicture rotatedabout(grada[10*j],angle(grada[10*j]-rapcentre)-90);
);
endfor
for j=0 upto 18:
nombre[10*j+1]=image(
- label.top(TEX("\fontsize{4}{4}\selectfont"&decimal(180-10*j)&""),gradb[10*j]);
+ label.top(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(180-10*j)),gradb[10*j]);
currentpicture:=currentpicture rotatedabout(gradb[10*j],angle(gradb[10*j]-rapcentre)-90);
);
endfor
else:
for j=0 upto 18:
nombre[10*j]=image(
- label.bot(TEX("\fontsize{4}{4}\selectfont"&decimal(180-10*j)&""),grada[10*j]);
+ label.bot(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(180-10*j)),grada[10*j]);
currentpicture:=currentpicture rotatedabout(grada[10*j],angle(grada[10*j]-rapcentre)-90);
);
endfor
for j=18 downto 0:
nombre[10*j+1]=image(
- label.top(TEX("\fontsize{4}{4}\selectfont"&decimal(10*j)&""),gradb[10*j]);
+ label.top(TEX("\fontsize{"&decimal(taillefonte)&"}{"&decimal(taillefonte)&"}\selectfont"&decimal(10*j)),gradb[10*j]);
currentpicture:=currentpicture rotatedabout(gradb[10*j],angle(gradb[10*j]-rapcentre)-90);
);
endfor
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
index 18fe1c904a..d0dbad1a25 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp
@@ -2958,6 +2958,21 @@ vardef OpMul(expr pasun,pasdeux)=
Oop
enddef;
+vardef OpMulS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$*$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpDiv(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
@@ -2973,6 +2988,21 @@ vardef OpDiv(expr pasun,pasdeux)=
Oop
enddef;
+vardef OpDivS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$/$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpModulo(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
index f0ef36f1e0..9a3a650c38 100644
--- a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp
@@ -2967,6 +2967,21 @@ vardef OpMul(expr pasun,pasdeux)=
Oop
enddef;
+vardef OpMulS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$*$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpDiv(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
@@ -2982,6 +2997,21 @@ vardef OpDiv(expr pasun,pasdeux)=
Oop
enddef;
+vardef OpDivS(expr pasun,pasdeux)=
+ save Oop; picture Oop;
+ save TAao; path TAao;
+ save LOPop; picture LOPop;
+ LOPop=ColleBoxNew(if string pasun : OvalNb(pasun) else: pasun fi,"$/$",if string pasdeux : OvalNb(pasdeux) else: pasdeux fi);
+ TAao=OvalBox(LOPop);
+ Oop=image(
+ fill TAao if print=false : withcolor FondOvalOp else : withcolor coefprint*white fi;
+ draw LOPop;
+ draw TAao if print=false : withcolor coefprint*white fi;
+ );
+ Oop:=Oop shifted(-center Oop);
+ Oop
+enddef;
+
vardef OpModulo(expr pasun,pasdeux)=
save Oop; picture Oop;
save TAao; path TAao;
diff --git a/macros/latex/contrib/suftesi/suftesi.dtx b/macros/latex/contrib/suftesi/suftesi.dtx
index 3898fbeaba..a9a76bfce1 100644
--- a/macros/latex/contrib/suftesi/suftesi.dtx
+++ b/macros/latex/contrib/suftesi/suftesi.dtx
@@ -5,7 +5,7 @@
\preamble
The 'suftesi' document class
-Copyright (C) 2009-2021 Ivan Valbusa
+Copyright (C) 2009-2023 Ivan Valbusa
<ivan dot valbusa at gmail dot com>
All rights reserved.
@@ -56,7 +56,7 @@ This work has the LPPL maintenance status "author-maintained".
%<class>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<class>\ProvidesClass{suftesi}
%<*class>
- [2021/11/01 v3.2.0 A class for typesetting theses, books and articles]
+ [2023/09/07 v3.2.1 A class for typesetting theses, books and articles]
%</class>
%<*driver>
\documentclass[12pt]{ltxdoc}
@@ -127,8 +127,7 @@ This work has the LPPL maintenance status "author-maintained".
\DeclareBibliographyCategory{pkgs-loaded}
\addtocategory{pkgs-loaded}{appendix,caption,color,crop,enumitem,emptypage,
fancyhdr,fixltxhyph,fontsize,mathalpha,libertinust1math,newtx,geometry,
-iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,
-substitutefont,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,
+iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,
cochineal,mathpazo,bera,amsthm}
\usepackage{array}
\usepackage{booktabs}
@@ -356,8 +355,9 @@ cochineal,mathpazo,bera,amsthm}
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
+% \changes{v3.2.1}{2023/09/07}{Removed \sty{substitutefont} package (obsolete) and replaced \cmd{substitutefont} with \cmd{DeclareFontFamilySubstitution} provided by the \LaTeX\ kernel. Definitions of \texttt{sufred} and \texttt{sufgray} color moved \cmd{AtBeginDocument}.}
% \changes{v3.2.0}{2021/11/01}{Fixed a bug in \cmd{xfootnote} command.
-% Fixed a bug occurring when using the \cmd{geometry} command.}
+ % Fixed a bug occurring when using the \cmd{geometry} command.}
% \changes{v3.1.3}{2021/06/06}{Maintenance release.
% Moved commands for breaking titles after \opt{titletoc} settings.
% Corrected a bug in \cmd{maketitle} with the \opt{collection} structure.
@@ -463,7 +463,7 @@ cochineal,mathpazo,bera,amsthm}
% \DoNotIndex{\titlepage,\vss,\vtop,\xdef,\@gobbletwo,\color,\dimexpr}
% \DoNotIndex{\huge,\large,\makebox,\ProcessOptions,\renewcommand}
%
-%\nocite{appendix,caption,color,crop,enumitem,emptypage,fancyhdr,fixltxhyph,fontsize,mathalpha,libertinust1math,newtx,geometry,iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,substitutefont,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,cochineal,mathpazo,bera,amsthm,zref,etoolbox}
+%\nocite{appendix,caption,color,crop,enumitem,emptypage,fancyhdr,fixltxhyph,fontsize,mathalpha,libertinust1math,newtx,geometry,iftex,microtype,multicol,titlesec,titletoc,xkeyval,cclicenses,luatex85,lm,textcomp,newpx,biolinum,inconsolata,libertine,cochineal,mathpazo,bera,amsthm,zref,etoolbox}
%
% \thispagestyle{empty}
%
@@ -621,7 +621,7 @@ cochineal,mathpazo,bera,amsthm}
% microtype, multicol, titlesec, titletoc,
% xkeyval, cclicenses*, zref** \\
% \midrule
-% & \textrm{\hologo{pdfLaTeX} only} & fontenc, substitutefont \\
+% & \textrm{\hologo{pdfLaTeX} only} & fontenc \\
% \midrule
% & \textrm{\hologo{LuaLaTeX} only} & luatex85 \\
% \midrule
@@ -3789,8 +3789,10 @@ cochineal,mathpazo,bera,amsthm}
\RequirePackage{emptypage}
\RequirePackage{microtype}
\RequirePackage{color}
+\AtBeginDocument{
\definecolor{sufred}{rgb}{0.5,0,0}
\definecolor{sufgray}{rgb}{0.5,0.5,0.5}
+}
\RequirePackage{iftex}
\ifLuaTeX
\RequirePackage{luatex85}
@@ -3841,7 +3843,6 @@ cochineal,mathpazo,bera,amsthm}
************************************}}}
\else
\RequirePackage[LGR,T1]{fontenc}
-\RequirePackage{substitutefont}
\AtBeginDocument{\fontencoding{T1}\selectfont}
% \end{macrocode}
% Now we load the macros for the \sty{defaultfont} option.
@@ -4030,7 +4031,7 @@ cochineal,mathpazo,bera,amsthm}
%The following macro was created by Claudio Beccari. Some time later, Massimiliano Dominici suggested the use of \cmd{AtEndPreamble} instead of \cmd{AtBeginDocument}, to make the \env{otherlanguage} environment work.\label{page:atendpreamble}
% \begin{macrocode}
\AtEndPreamble{
- \substitutefont{LGR}{\rmdefault}{\SUF@greekfamily}
+ \DeclareFontFamilySubstitution{LGR}{\rmdefault}{\SUF@greekfamily}
\DeclareRobustCommand{\greektext}{%
\usefont{LGR}{\SUF@greekfamily}{\f@series}{\f@shape}
\def\encodingdefault{LGR}}
@@ -6522,16 +6523,6 @@ Janusz M.~Nowacki.
version = {1.627}
}
-@manual{substitutefont,
- title = {The \textsf{\MakeLowercase{Substitutefont}} package},
- subtitle = {Easy font substitution},
- author = {Milde, Günter},
- url = {http://www.ctan.org/pkg/substitutefont},
- urldate = {2020-05-24},
- date = {2013-11-04},
- version = {0.1.4}
-}
-
@manual{textcomp,
title = {The \textsf{\MakeLowercase{Textcomp}} package},
subtitle = {\LaTeX\ support for the Text Companion fonts},
diff --git a/macros/latex/contrib/suftesi/suftesi.pdf b/macros/latex/contrib/suftesi/suftesi.pdf
index 6fcd730d42..fc7ac9f929 100644
--- a/macros/latex/contrib/suftesi/suftesi.pdf
+++ b/macros/latex/contrib/suftesi/suftesi.pdf
Binary files differ