summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md9
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty173
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdfbin0 -> 184434 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex244
-rw-r--r--macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdfbin8817716 -> 8745003 bytes
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty474
6 files changed, 796 insertions, 104 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
new file mode 100644
index 0000000000..b4d801af92
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
@@ -0,0 +1,9 @@
+# TikZbricks
+
+A beamer inner theme which reproduces standard beamer blocks using tcolorboxes
+
+Current version: 2022/08/26 version v0.1
+
+This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
+
+The project repository, including a bug tracker, can be found at https://github.com/samcarter/beamertheme-tcolorbox/issues
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
new file mode 100644
index 0000000000..32393e5965
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
@@ -0,0 +1,173 @@
+% !TeX root = test.tex
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The tcolorbox inner theme
+% A beamer inner theme which reproduces standard beamer blocks using tcolorboxes
+% Maintained by samcarter
+%
+% Project repository and bug tracker:
+% https://github.com/samcarter/beamertheme-tcolorbox
+%
+% Released under the LaTeX Project Public License v1.3c or later
+% See http://www.latex-project.org/lppl.txt
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ProvidesPackage{beamerinnerthemetcolorbox}[2022/08/26 version v0.1 Beamer blocks with tcolorboxes]
+
+\RequirePackage[skins]{tcolorbox}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Theme Options
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newif\ifbeamer@tcb@rounded
+\newif\ifbeamer@tcb@shadow
+\def\beamer@tcb@true{true}
+
+\DeclareOptionBeamer{shadow}[true]{\csname beamer@tcb@shadow#1\endcsname}
+\DeclareOptionBeamer{rounded}[true]{\csname beamer@tcb@rounded#1\endcsname}
+
+\ExecuteOptionsBeamer{shadow=false}
+\ExecuteOptionsBeamer{rounded=false}
+
+% check options from other themes
+\ifdefined\beamer@themerounded@shadow
+ \beamer@tcb@roundedtrue
+ \ifx\beamer@themerounded@shadow\beamer@tcb@true
+ \beamer@tcb@shadowtrue
+ \fi
+\fi
+
+\ProcessOptionsBeamer
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% General Settings
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\tcbset{
+ oversize=0mm,
+ left=0.05cm,
+ right=0.05cm,
+ enhanced,
+ boxrule=0cm,
+ frame hidden,
+ top=1.5mm,
+ bottom=0.5mm
+}
+
+% optional settings
+\ifbeamer@tcb@rounded
+ \tcbset{
+ arc=1.3mm,
+ top=0.8mm,
+ toptitle=0.2mm,
+ bottom=0mm,
+ }
+\else
+ \tcbset{sharpish corners}
+\fi
+
+\ifbeamer@tcb@shadow
+ \tcbset{drop fuzzy shadow=black!90}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Defining blocks
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\mode<presentation>
+
+% normal block
+\setbeamertemplate{block begin}{%
+ \usebeamercolor[bg]{block body}
+ \usebeamercolor[bg]{block title}
+ \colorlet{beamer@tcb@topshade}{block title.bg}
+ \colorlet{beamer@tcb@bottomshade}{block body.bg}
+ \ifbeamer@tcb@rounded\else
+ \tcbset{title={\insertblocktitle}}
+ \fi
+ \ifx\insertblocktitle\@empty\else
+ \tcbset{title={\insertblocktitle}}
+ \ifbeamer@tcb@rounded
+ \tcbset{
+ overlay={
+ \begin{scope}
+ \shade[top color=beamer@tcb@topshade,bottom color=beamer@tcb@bottomshade] (title.south west) rectangle ([yshift=-0.5mm]title.south east);
+ \end{scope}
+ }
+ }
+ \fi
+ \fi
+ \begin{tcolorbox}[
+ colbacktitle=block title.bg,
+ colback=block body.bg,
+ before title={\usebeamercolor[fg]{block title}\usebeamerfont{block title}},
+ before upper={\usebeamercolor[fg]{block body}\usebeamerfont{block body}},
+ ]
+}
+\setbeamertemplate{block end}{\end{tcolorbox}}
+
+% alert block
+\setbeamertemplate{block alerted begin}{%
+ \usebeamercolor[bg]{block body alerted}
+ \usebeamercolor[bg]{block title alerted}
+ \colorlet{beamer@tcb@topshade}{block title alerted.bg}
+ \colorlet{beamer@tcb@bottomshade}{block body alerted.bg}
+ \ifbeamer@tcb@rounded\else
+ \tcbset{title={\insertblocktitle}}
+ \fi
+ \ifx\insertblocktitle\@empty\else
+ \tcbset{title={\insertblocktitle}}
+ \ifbeamer@tcb@rounded
+ \tcbset{
+ overlay={
+ \begin{scope}
+ \shade[top color=beamer@tcb@topshade,bottom color=beamer@tcb@bottomshade] (title.south west) rectangle ([yshift=-0.5mm]title.south east);
+ \end{scope}
+ }
+ }
+ \fi
+ \fi
+ \begin{tcolorbox}[
+ colbacktitle=block title alerted.bg,
+ colback=block body alerted.bg,
+ before title={\usebeamercolor[fg]{block title alerted}\usebeamerfont{block title alerted}},
+ before upper={\usebeamercolor[fg]{block body alerted}\usebeamerfont{block body alerted}},
+ ]
+}
+\setbeamertemplate{block alerted end}{\end{tcolorbox}}
+
+% example block
+\setbeamertemplate{block example begin}{%
+ \usebeamercolor[bg]{block body example}
+ \usebeamercolor[bg]{block title example}
+ \colorlet{beamer@tcb@topshade}{block title example.bg}
+ \colorlet{beamer@tcb@bottomshade}{block body example.bg}
+ \ifbeamer@tcb@rounded\else
+ \tcbset{title={\insertblocktitle}}
+ \fi
+ \ifx\insertblocktitle\@empty\else
+ \tcbset{title={\insertblocktitle}}
+ \ifbeamer@tcb@rounded
+ \tcbset{
+ overlay={
+ \begin{scope}
+ \shade[top color=beamer@tcb@topshade,bottom color=beamer@tcb@bottomshade] (title.south west) rectangle ([yshift=-0.5mm]title.south east);
+ \end{scope}
+ }
+ }
+ \fi
+ \fi
+ \begin{tcolorbox}[
+ colbacktitle=block title example.bg,
+ colback=block body example.bg,
+ before title={\usebeamercolor[fg]{block title example}\usebeamerfont{block title example}},
+ before upper={\usebeamercolor[fg]{block body example}\usebeamerfont{block body example}},
+ ]
+}
+\setbeamertemplate{block example end}{\end{tcolorbox}}
+
+\mode<all>
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
new file mode 100644
index 0000000000..a7f1c3da6c
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
new file mode 100644
index 0000000000..1178483de9
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
@@ -0,0 +1,244 @@
+% !TeX document-id = {ba2bf522-7c7a-4e0b-b68d-dc54a96e4f4a}
+% !TeX TS-program = latexmk -time -pdf -pdflatex="pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %%O %%S" % | txs:///view-log | txs:///view-pdf
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Documentation for the tcolorbox inner theme
+% A beamer inner theme which reproduces standard beamer blocks using tcolorboxes
+% Maintained by samcarter
+%
+% Project repository and bug tracker:
+% https://github.com/samcarter/beamertheme-tcolorbox
+%
+% Released under the LaTeX Project Public License v1.3c or later
+% See http://www.latex-project.org/lppl.txt
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\documentclass[parskip=half]{scrartcl}
+
+% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[english]{babel}
+\usepackage[bitstream-charter]{mathdesign}
+%\usepackage{duckuments}
+\usepackage{tikz}
+\usetikzlibrary{matrix}
+\usepackage[most]{tcolorbox}
+\usepackage[paper=a4paper,margin=2.9cm]{geometry}
+\usepackage{url}
+\usepackage{xspace}
+\usepackage{scrlayer-scrpage}
+\usepackage[hang,flushmargin,bottom]{footmisc}
+\usepackage[colorlinks=true,breaklinks=true,urlcolor=blendedblue,linkcolor=blendedblue,citecolor=blendedblue,filecolor=blendedblue]{hyperref}
+
+% macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand{\CTAN}{\textsc{CTAN}\xspace}
+\newcommand{\TikZ}{Ti\emph{k}Z\xspace}
+\newcommand{\miktex}{MiK\TeX\xspace}
+\newcommand{\texlive}{\TeX{}Live\xspace}
+
+% customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\definecolor{blendedblue}{rgb}{0.2,0.2,0.7}
+\definecolor{marmotred}{RGB}{140,20,40}
+\addtokomafont{sectioning}{\color{blendedblue}}
+\addtokomafont{date}{\normalsize}
+\addtokomafont{author}{\normalsize}
+\setlength{\footnotemargin}{0.7em}
+
+% from https://tex.stackexchange.com/a/147848
+\def\beginlstdelim#1#2#3%
+{%
+ \def\endlstdelim{#2\egroup}%
+ \ttfamily#1\bgroup\color{#3}\aftergroup\endlstdelim%
+}
+
+\lstdefinestyle{beamertheme-tcolorboxstyle}{%
+ language={[latex]TeX},
+ tabsize=2,
+ breaklines,
+ basicstyle=\footnotesize\ttfamily,
+ commentstyle={\color{teal}\slshape},
+ columns=fullflexible,
+ texcsstyle=*\color{blendedblue}\bfseries,
+ keywordstyle=\color{red!60!black}\bfseries,
+ morekeywords={tikzpicture,scope},
+ moretexcs={path,node,draw,clip,pic,includegraphics,color,piece,tile,beamertheme-tcolorbox},
+ delim ={[s][\ttfamily\color{green!50!black}]{$}{$}},
+ moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|},
+ moredelim={[s][\color{gray}]{<}{>}},
+% moredelim = **[is][\beginlstdelim{\{}{\}}{orange!70!black}]{\{}{\}},
+% moredelim = **[is][\beginlstdelim{[}{]}{orange!70!black}]{[}{]},
+}
+
+\tcbset{%
+ colframe=blendedblue,
+ arc=2mm,
+ fonttitle=\bfseries,
+ sidebyside,
+ listing options={style=beamertheme-tcolorboxstyle},
+% center lower,
+% righthand width=6cm,
+ bottom=0pt,
+ top=0pt,
+% sidebyside gap=10pt,
+ lower separated=false,
+}
+
+\lstset{style=beamertheme-tcolorboxstyle}
+
+% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\title{The tcolorbox beamer inner theme}
+\subtitle{A beamer inner theme to reproduce standard beamer blocks using tcolorboxes}
+\author{%
+ \texorpdfstring{
+ \texttt{samcarter}\\
+ \url{https://github.com/samcarter/beamertheme-tcolorbox}\\
+% \url{https://www.ctan.org/pkg/beamertheme-tcolorbox}
+ }{samcarter}}
+\date{Version v0.1 \textendash{} 2022/08/26}
+
+\begin{document}
+\maketitle
+
+\section{Introduction}
+\label{intro}
+
+Over the last decade of answering beamer problems and more recently also being one of the maintainers of the beamer class, I saw countless of requests about beamer blocks. There were users who were looking for sometimes smaller, sometimes larger tweaks to the blocks in their document, for example "How to use the rectangular blocks with sharp corners, but with the shadows from the rounded beamer blocks". Other users encountered various tiny or something bigger problems with the default beamer blocks, like issues with some pdf viewers in which the seams of the underlying colorboxes would become visible.
+
+For all these cases, there is now an alternative to the default beamer blocks: The tcolorbox inner beamer theme will replace the usual beamer mechanism to draw blocks with tcolorboxes. The tcolorboxes will automatically adopt the look and feel (round vs.\ sharp corners and shadows) as well as the colours of the normal beamer blocks.
+
+%The package is included in both \texlive and \miktex and available from \CTAN (\url{https://ctan.org/pkg/beamertheme-tcolorbox}).
+The development version of this package is located at \url{github.com/samcarter/beamertheme-tcolorbox}. If you have any problems, ideas or other feedback, please make constructive use of the issue tracker.
+
+Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \texttt{samcarter}. Permission is granted to copy, distribute and\slash or modify this software under the terms of the LaTeX project public licence, version 1.3c or later \url{http://www.latex-project.org/lppl.txt}.
+
+\section{Usage}
+
+The basic usage is fairly simple. One just needs to load the theme via
+\begin{tcolorbox}
+\begin{lstlisting}
+\useinnertheme{tcolorbox}
+\end{lstlisting}
+\end{tcolorbox}
+and after that, one can use the normal beamer \lstinline|block| environment as usual.
+
+Behind the scenes, this will replace the default mechanism of puzzling together the block from two separate \lstinline|beamercolorboxes|, with one tcolorbox.
+
+In this simple configuration, the look and feel of the new blocks will be taken from other themes loaded in the presentation. For example if the Madrid theme is loaded, the resulting tcolorbox will have the usual colours, rounded corners and a shadow:
+
+\begin{tcblisting}{
+ listing and comment,
+ pdf comment,
+ freeze pdf,
+ compilable listing,
+ run pdflatex,
+% righthand width=8cm
+}
+\documentclass{beamer}
+\usetheme{Madrid}
+\useinnertheme{tcolorbox}
+\begin{document}
+\begin{frame}
+\begin{block}{Title}
+ Body
+\end{block}
+\begin{alertblock}{Title}
+ Body
+\end{alertblock}
+\begin{exampleblock}{Title}
+ Body
+\end{exampleblock}
+\end{frame}
+\end{document}
+\end{tcblisting}
+
+\section{Options}
+
+In addition to automatically adopting settings from the other themes, one can also influence the look and feel via the two options \lstinline|rounded| and \lstinline|shadow|, which can be set to \lstinline|true| or \lstinline|false| (calling either option without explicit \lstinline|true| or \lstinline|false| will set it to \lstinline|true|).
+
+\begin{tcolorbox}
+\begin{lstlisting}
+\useinnertheme[
+ rounded
+ shadow=false
+]{tcolorbox}
+\end{lstlisting}
+\end{tcolorbox}
+
+If one for example likes the Antibes theme, but prefers the blocks to have shadows, they can now easily be added:
+
+\begin{tcblisting}{
+ listing and comment,
+ pdf comment,
+ freeze pdf,
+ compilable listing,
+ run pdflatex,
+% righthand width=8cm
+}
+\documentclass{beamer}
+\usetheme{Antibes}
+\useinnertheme[
+ shadow
+]{tcolorbox}
+\begin{document}
+\begin{frame}
+\begin{block}{Title}
+ Body
+\end{block}
+\begin{alertblock}{Title}
+ Body
+\end{alertblock}
+\begin{exampleblock}{Title}
+ Body
+\end{exampleblock}
+\end{frame}
+\end{document}
+\end{tcblisting}
+
+Beyond these two options, the users also has the myriads of options of the tcolobox package to their disposal, e.g.\ via \lstinline|\tcbset{...}|:
+
+\begin{tcblisting}{
+ listing and comment,
+ pdf comment,
+ freeze pdf,
+ compilable listing,
+ run pdflatex,
+% righthand width=8cm
+}
+\documentclass{beamer}
+\usetheme{Ilmenau}
+\useinnertheme{tcolorbox}
+
+\tcbset{
+ boxrule=3pt,
+ borderline={1pt}{0pt}{pink,dashed},
+}
+
+\begin{document}
+\begin{frame}
+\begin{block}{Title}
+ Body
+\end{block}
+\begin{alertblock}{Title}
+ Body
+\end{alertblock}
+\begin{exampleblock}{Title}
+ Body
+\end{exampleblock}
+\end{frame}
+\end{document}
+\end{tcblisting}
+
+\section{Caveats and known issues}
+
+\begin{itemize}
+\item the tcolorbox inner theme is not yet optimised for the \lstinline|inmargin| inner theme, which is e.g.\ used by the Bergen theme
+\item for themes which don't set the \lstinline|block body| colour, e.g.\ the default theme, the block body will be shown in the same colour as the title and instead of the normal text colour.
+\end{itemize}
+
+
+
+
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
index c58be2a099..c7be00aa75 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/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index 3cdb5e4ccf..7277b9fc58 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{2022/08/17}%
+\def\filedate{2022/08/25}%
\let\PfCfiledate\filedate%
-\def\fileversion{0.99-v}%
+\def\fileversion{0.99-w}%
\let\PfCfileversion\fileversion%
\ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]
@@ -347,6 +347,140 @@
}
%%%
+% Kakuro
+%%%
+\setKVdefault[Kakuro]{CouleurCase=LightGray,Taille=5,Solution=false,Largeur=2em,Aide=false,CouleurSolution=Black}
+\defKV[Kakuro]{ListeNombres=\setKV[Kakuro]{Aide}}%
+
+\newlength\PfCKakuro%
+
+\NewDocumentCommand\Kakuro{o m}{%
+ \useKVdefault[Kakuro]%
+ \setKV[Kakuro]{#1}%
+ \setlength{\PfCKakuro}{\useKV[Kakuro]{Largeur}+\tabcolsep}%
+ \setsepchar[*]{,*/}%
+ \readlist*\ListeCasesKK{#2}%
+ \setsepchar{,}%
+ \xdef\ListeAvantNombres{\useKV[Kakuro]{ListeNombres}}%
+ \readlist*\ListeKakuroNombres{\ListeAvantNombres}%
+ \savecomparemode%
+ \comparestrict%
+ \begin{NiceTabular}{*{\useKV[Kakuro]{Taille}}{m{\useKV[Kakuro]{Largeur}}}}[hvlines]
+ \xintFor* ##1 in {\xintSeq{0}{\fpeval{\useKV[Kakuro]{Taille}-1}}}\do{%
+ \xintFor* ##2 in {\xintSeq{1}{\useKV[Kakuro]{Taille}}}\do{%
+ \rule{0pt}{\PfCKakuro}%
+ \StrCompare{\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2},1]}{*}[\PfCTestBlack]
+ \xintifboolexpr{\PfCTestBlack==0}{%
+ \Block[fill=black]{1-1}{}%
+ }{%
+ \xintifboolexpr{\listlen\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2}]==2}{
+ \Block[fill=\useKV[Kakuro]{CouleurCase}]{1-1}{\diagbox{\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2},1]}{\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2},2]}}%
+ }{%
+ \Block{1-1}{\ifboolKV[Kakuro]{Solution}{\Large\color{\useKV[Kakuro]{CouleurSolution}}\num{\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2},1]}}{%
+ \ifboolKV[Kakuro]{Aide}{%
+ \xintFor* ##3 in{\xintSeq{1}{\ListeKakuroNombreslen}}\do{%
+ \Block{1-1}{\xintifboolexpr{\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2},1]==\ListeKakuroNombres[##3]}{\Large\color{\useKV[Kakuro]{CouleurSolution}}\num{\ListeCasesKK[\fpeval{\useKV[Kakuro]{Taille}*##1+##2},1]}}{}}%
+ }%
+ }{}%
+ }%
+ }%
+ }%
+ }%
+ \xintifForLast{\\}{&}%
+ }%
+ }%
+ \end{NiceTabular}
+ \restorecomparemode%
+}%
+
+%%%
+% KenKen
+%%%
+\setKVdefault[ClesKK]{Solution=false,Taille=3,Largeur=2em,Aide=false}%
+\defKV[ClesKK]{Nombre=\setKV[ClesKK]{Aide}}%
+
+\newlength\PfCKenKen
+
+\NewDocumentCommand\KenKen{o m}{%
+ \useKVdefault[ClesKK]%
+ \setKV[ClesKK]{#1}%
+ \setlength{\PfCKenKen}{\useKV[ClesKK]{Largeur}+\tabcolsep}%
+ \setsepchar[*]{,*/}%
+ \readlist*\ListeCasesKK{#2}%
+ \savecomparemode%
+ \comparestrict%
+ \begin{NiceTabular}{*{\useKV[ClesKK]{Taille}}{m{\useKV[ClesKK]{Largeur}}}}%
+ \CodeBefore
+ \xintFor* ##1 in {\xintSeq{2}{\fpeval{\useKV[ClesKK]{Taille}}}}\do{%
+ \tikz\draw[gray] (##1-|1) -- (##1-|last);%
+ \tikz\draw[gray] (1-|##1) -- (last-|##1);%
+ }%
+ \Body
+ \xintFor* ##1 in {\xintSeq{0}{\fpeval{\useKV[ClesKK]{Taille}-1}}}\do{%
+ \xintFor* ##2 in {\xintSeq{1}{\useKV[ClesKK]{Taille}}}\do{%
+ \rule{0pt}{\PfCKenKen}%
+ \StrCompare{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},1]}{b}[\PfCTestb]%\PfCTestb
+ \StrCompare{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},1]}{l}[\PfCTestl]%\PfCTestr
+ \StrCompare{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},1]}{lb}[\PfCTestlb]%\PfCTestbr
+ \xintifboolexpr{\PfCTestb==0}{%
+ \Block[borders={bottom},line-width=2pt]{1-1}{%
+ \ifboolKV[ClesKK]{Solution}{%
+ \Large\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]%
+ }{%
+ \ifboolKV[ClesKK]{Aide}{%
+ \xintifboolexpr{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]==\useKV[ClesKK]{Nombre}}{%
+ \cellcolor{LightGray}\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]%
+ }{}%
+ }{}%
+ }%
+ }%
+ }{%
+ \xintifboolexpr{\PfCTestl==0}{%
+ \Block[borders={left},line-width=2pt]{1-1}{\ifboolKV[ClesKK]{Solution}{\Large\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]}{%
+ \ifboolKV[ClesKK]{Aide}{%
+ \xintifboolexpr{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]==\useKV[ClesKK]{Nombre}}{%
+ \cellcolor{LightGray}\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]%
+ }{}%
+ }{}%
+ }%
+ }%
+ }{%
+ \xintifboolexpr{\PfCTestlb==0}{%
+ \Block[borders={bottom,left},line-width=2pt]{1-1}{\ifboolKV[ClesKK]{Solution}{\Large\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]}{%
+ \ifboolKV[ClesKK]{Aide}{%
+ \xintifboolexpr{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]==\useKV[ClesKK]{Nombre}}{%
+ \cellcolor{LightGray}\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]%
+ }{}%
+ }{}%
+ }%
+ }%
+ }{%
+ \Block{1-1}{\ifboolKV[ClesKK]{Solution}{\Large\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]}{%
+ \ifboolKV[ClesKK]{Aide}{%
+ \xintifboolexpr{\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]==\useKV[ClesKK]{Nombre}}{%
+ \cellcolor{LightGray}\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*##1+##2},3]%
+ }{}%
+ }{}%
+ }%
+ }%
+ }%
+ }%
+ }%
+ \xintifForLast{\\}{&}%
+ }%
+ }%
+ \CodeAfter%
+ \tikz\draw[line width=2pt] (1-|1) rectangle (last-|last);%
+ \xintFor* ##1 in {\xintSeq{1}{\fpeval{\useKV[ClesKK]{Taille}}}}\do{%
+ \xintFor* ##2 in {\xintSeq{1}{\useKV[ClesKK]{Taille}}}\do{%
+ \tikz\node[anchor=west,inner sep=0pt,xshift=1mm,yshift=-0.2\PfCKenKen] at (##1 -|##2) {\scriptsize$\ListeCasesKK[\fpeval{\useKV[ClesKK]{Taille}*(##1-1)+##2},2]$};%
+ }%
+ }%
+ \end{NiceTabular}
+ \restorecomparemode%
+}%
+
+%%%
% PixelArt
%%%
\newtoks\toklistePANombre%
@@ -517,11 +651,11 @@
}%
%
\ifboolKV[Yohaku]{Perso}{%
- \setsepchar[*]{,*/}%
+ \setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\PfCYHKListe{#2}%
\setsepchar{,}%
\xdef\PfCYHKListeFoo{}%
- \foreachitem\compteur\in\PfCYHKListe[1]{
+ \foreachitem\compteur\in\PfCYHKListe[1]{%
\xdef\PfCYHKListeFoo{\PfCYHKListeFoo \PfCYHKListe[1,\compteurcnt],}%
}%
\ignoreemptyitems\readlist*\PfCYHKListeNA{\PfCYHKListeFoo}%
@@ -546,7 +680,7 @@
}%
% \xintifboolexpr{\useKV[Yohaku]{Taille}==2}{\MelangeListe{\PfCYHKListe}{4}}{\MelangeListe{\PfCYHKListe}{9}}%
\MelangeListe{\PfCYHKListe}{\fpeval{\useKV[Yohaku]{Taille}**2}}%
- \readlist*\PfCYHKListeNA{\faa}%
+ \ignoreemptyitems\readlist*\PfCYHKListeNA{\faa}%
%Sommes/Produits
\xdef\PfCYHKListeProduit{}
%verticaux
@@ -561,7 +695,7 @@
\xintFor* ##1 in {\xintSeq{0}{\fpeval{\useKV[Yohaku]{Taille}-1}}}\do{%
\xdef\PfCYHKTampon{\fpeval{\PfCYHKTampon+\PfCYHKListeNA[\fpeval{##2+##1*\useKV[Yohaku]{Taille}}]}}
}%
- }
+ }%
\xdef\PfCYHKListeProduit{\PfCYHKListeProduit,\PfCYHKTampon}%
}%
% horizontaux
@@ -2300,17 +2434,20 @@
\newcommand\ListePersonnages[1]{%
\setsepchar{§}%
- \readlist*\RetiensListePersonnages{#1}
+ \readlist*\RetiensListePersonnages{#1}%
+ \setsepchar{,}%
}
\newcommand\ListeObjets[1]{%
\setsepchar{§}%
- \readlist*\RetiensListeObjets{#1}
+ \readlist*\RetiensListeObjets{#1}%
+ \setsepchar{,}%
}
\newcommand\ListeLieux[1]{%
\setsepchar{§}%
- \readlist*\RetiensListeLieux{#1}
+ \readlist*\RetiensListeLieux{#1}%
+ \setsepchar{,}%
}
\newcommand\MelangeListe[2]{%
@@ -2337,6 +2474,7 @@
}%
\readlist*\ListeInter{\fii}%
}%
+ \reademptyitems%
}%
\newcommand\ListeQuestions[1]{%
@@ -2379,7 +2517,8 @@
\ignoreemptyitems\setsepchar{,}%
\MelangeListe{\fuu}{\fpeval{\RetiensListePersonnageslen+\RetiensListeObjetslen+\RetiensListeLieuxlen-3}}%
\readlist*\ListeMelangeeQuestions{\faa}%
-}
+ \reademptyitems%
+}%
\newcommand\AffichageQuestions{%
\begin{enumerate}
@@ -3693,13 +3832,17 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
fill Case[Nbeb] withcolor CaseCouleur;
trace Case[Nbeb];
label(TEX(substring(1,length p_) of p_),B[Nbeb]);
+ elseif (substring(0,1) of p_)="!":
+ drawoptions(withcolor \useKV[ClesPyramide]{CouleurNombre});
+ label(TEX(substring(1,length p_) of p_),B[Nbeb]);
+ drawoptions();
else:
label(TEX(p_),B[Nbeb]);
fi;
endfor;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={nbetages:=\useKV[ClesPyramide]{Etages};largeur:=\useKV[ClesPyramide]{Largeur};hauteur:=\useKV[ClesPyramide]{Hauteur};boolean Vide;Vide=\useKV[ClesPyramide]{Vide};boolean Inverse;Inverse=\useKV[ClesPyramide]{Inverse};color CaseCouleur; CaseCouleur:=\useKV[ClesPyramide]{Couleur};boolean Double;Double=\useKV[ClesPyramide]{Double};}]
+ \begin{mpost}[mpsettings={nbetages:=\useKV[ClesPyramide]{Etages};largeur:=\useKV[ClesPyramide]{Largeur};hauteur:=\useKV[ClesPyramide]{Hauteur};boolean Vide;Vide=\useKV[ClesPyramide]{Vide};boolean Inverse;Inverse=\useKV[ClesPyramide]{Inverse};color CaseCouleur; CaseCouleur:=\useKV[ClesPyramide]{Couleur};boolean Double;Double=\useKV[ClesPyramide]{Double}; color CouleurNombre;CouleurNombre=\useKV[ClesPyramide]{CouleurNombre};}]
pair A[][],B[];
path Case[];
Nbeb:=0;
@@ -3747,21 +3890,25 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
fill Case[Nbeb] withcolor CaseCouleur;
trace Case[Nbeb];
label(LATEX(substring(1,length p_) of p_),B[Nbeb]);
+ elseif (substring(0,1) of p_)="!":
+ drawoptions(withcolor CouleurNombre);
+ label(LATEX(substring(1,length p_) of p_),B[Nbeb]);
+ drawoptions();
else:
label(LATEX(p_),B[Nbeb]);
fi;
endfor;
\end{mpost}
\fi
-}
+}%
-\setKVdefault[ClesPyramide]{Etages=5,Largeur=2cm,Hauteur=1cm,Vide=false,Inverse=false,Double=false,Couleur=Crimson,Multiplication=false,Produit=false,Solution=false,Aide=false,Cote=4cm}%
+\setKVdefault[ClesPyramide]{Etages=5,Largeur=2cm,Hauteur=1cm,Vide=false,Inverse=false,Double=false,Couleur=Crimson,Multiplication=false,CouleurNombre=blue,Produit=false,Solution=false,Aide=false,Cote=4cm}%
\newtoks\toklistecaseP%
\def\UpdatetoksPyramide#1\nil{\addtotok\toklistecaseP{"#1",}}%
\def\UpdatetoksPyramideMul#1\nil{\addtotok\toklistecaseP{#1,}}%
-\DeclareDocumentCommand\PyramideNombre{o m}{%
+\NewDocumentCommand\PyramideNombre{o m}{%
\useKVdefault[ClesPyramide]%
\setKV[ClesPyramide]{#1}%
\ifboolKV[ClesPyramide]{Multiplication}{%
@@ -4604,26 +4751,26 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
%%%
% Labyrinthe Nombre
%%%
-\setKVdefault[ClesLabyNombre]{Multiple=5,XDepart=0,YDepart=0,Longueur=7,Largeur=4,XArrivee=6,YArrivee=3,Solution=false,Echelle=1,Angle=0,Couleur=red,Murs=false,Nom=Ex1}
+\setKVdefault[ClesLabyNb]{Multiple=5,XDepart=0,YDepart=0,Longueur=7,Largeur=4,XArrivee=6,YArrivee=3,Solution=false,Echelle=1,Angle=0,Couleur=red,Murs=false,Nom=Ex1,CouleurChemin=blue}
\newcommand\LabyNombre[1][]{%
- \useKVdefault[ClesLabyNombre]%
- \setKV[ClesLabyNombre]{#1}%
- \ifboolKV[ClesLabyNombre]{Solution}{%
- \TraceSolution{\useKV[ClesLabyNombre]{Multiple}}{\useKV[ClesLabyNombre]{Longueur}}{\useKV[ClesLabyNombre]{Largeur}}{(\useKV[ClesLabyNombre]{YDepart},\useKV[ClesLabyNombre]{XDepart})}{(\useKV[ClesLabyNombre]{YArrivee},\useKV[ClesLabyNombre]{XArrivee})}{\useKV[ClesLabyNombre]{Solution}}
+ \useKVdefault[ClesLabyNb]%
+ \setKV[ClesLabyNb]{#1}%
+ \ifboolKV[ClesLabyNb]{Solution}{%
+ \TraceSolution{\useKV[ClesLabyNb]{Multiple}}{\useKV[ClesLabyNb]{Longueur}}{\useKV[ClesLabyNb]{Largeur}}{(\useKV[ClesLabyNb]{YDepart},\useKV[ClesLabyNb]{XDepart})}{(\useKV[ClesLabyNb]{YArrivee},\useKV[ClesLabyNb]{XArrivee})}{\useKV[ClesLabyNb]{Solution}}
}{%
- \TraceLabyNombre{\useKV[ClesLabyNombre]{Multiple}}{\useKV[ClesLabyNombre]{Longueur}}{\useKV[ClesLabyNombre]{Largeur}}{(\useKV[ClesLabyNombre]{YDepart},\useKV[ClesLabyNombre]{XDepart})}{(\useKV[ClesLabyNombre]{YArrivee},\useKV[ClesLabyNombre]{XArrivee})}{\useKV[ClesLabyNombre]{Solution}}
+ \TraceLabyNombre{\useKV[ClesLabyNb]{Multiple}}{\useKV[ClesLabyNb]{Longueur}}{\useKV[ClesLabyNb]{Largeur}}{(\useKV[ClesLabyNb]{YDepart},\useKV[ClesLabyNb]{XDepart})}{(\useKV[ClesLabyNb]{YArrivee},\useKV[ClesLabyNb]{XArrivee})}{\useKV[ClesLabyNb]{Solution}}
}%
}
\newcommand\TraceLabyNombre[6]{%
\mplibforcehmode%
- \xdef\PfCNomLabyrinthe{\useKV[ClesLabyNombre]{Nom}}%
+ \xdef\PfCNomLabyrinthe{\useKV[ClesLabyNb]{Nom}}%
\begin{mplibcode}[\PfCNomLabyrinthe]
input PfCLabyNombre;
boolean Murs;
- Murs=\useKV[ClesLabyNombre]{Murs};
+ Murs=\useKV[ClesLabyNb]{Murs};
numeric Multiple;
Multiple=#1;
@@ -4686,23 +4833,22 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
label(TEX("\num{"&decimal(NbAffiche[nbaffiche])&"}"),M[k][l]);
endfor;
endfor;
- remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNombre]{Couleur};
- remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNombre]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNb]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNb]{Couleur};
for k=2 upto indiceChemin-1:
remplis ((unitsquare scaled 10mm) shifted N[xpart(PileChemin[k])][ypart(PileChemin[k])]) withcolor white;
label(TEX("\num{"&decimal(NbSol[k])&"}"),M[xpart(PileChemin[k])][ypart(PileChemin[k])]);
endfor;
trace TraceLabyrinthe;
);
- Corps:=(Corps scaled \useKV[ClesLabyNombre]{Echelle}) rotated \useKV[ClesLabyNombre]{Angle};
+ Corps:=(Corps scaled \useKV[ClesLabyNb]{Echelle}) rotated \useKV[ClesLabyNb]{Angle};
trace Corps;
\end{mplibcode}
}
\newcommand\TraceSolution[6]{%
\mplibforcehmode%
- % \mplibcodeinherit{enable}
- \xdef\PfCNomLabyrinthe{\useKV[ClesLabyNombre]{Nom}}%
+ \xdef\PfCNomLabyrinthe{\useKV[ClesLabyNb]{Nom}}%
\begin{mplibcode}[\PfCNomLabyrinthe]
picture CorpsSolution;
CorpsSolution=image(
@@ -4713,18 +4859,17 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
label(TEX("\num{"&decimal(NbAffiche[nbaffiche])&"}"),M[k][l]);
endfor;
endfor;
- remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNombre]{Couleur};
- remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNombre]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNb]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNb]{Couleur};
for k=2 upto indiceChemin-1:
- remplis ((unitsquare scaled 10mm) shifted N[xpart(PileChemin[k])][ypart(PileChemin[k])]) withcolor 0.5white;
+ remplis ((unitsquare scaled 10mm) shifted N[xpart(PileChemin[k])][ypart(PileChemin[k])]) withcolor \useKV[ClesLabyNb]{CouleurChemin};
label(TEX("\num{"&decimal(NbSol[k])&"}"),M[xpart(PileChemin[k])][ypart(PileChemin[k])]);
endfor;
trace TraceLabyrinthe;
);
- CorpsSolution:=(CorpsSolution scaled \useKV[ClesLabyNombre]{Echelle}) rotated \useKV[ClesLabyNombre]{Angle};
+ CorpsSolution:=(CorpsSolution scaled \useKV[ClesLabyNb]{Echelle}) rotated \useKV[ClesLabyNb]{Angle};
trace CorpsSolution;
\end{mplibcode}
- %\mplibcodeinherit{disable}
}%
\newcommand\TraceLabyNombreold[6]{%
@@ -4733,7 +4878,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
input PfCLabyNombre;
boolean Murs;
- Murs=\useKV[ClesLabyNombre]{Murs};
+ Murs=\useKV[ClesLabyNb]{Murs};
numeric Multiple;
Multiple=#1;
@@ -4796,15 +4941,15 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
label(TEX("\num{"&decimal(NbAffiche[nbaffiche])&"}"),M[k][l]);
endfor;
endfor;
- remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNombre]{Couleur};
- remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNombre]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNb]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNb]{Couleur};
for k=2 upto indiceChemin-1:
remplis ((unitsquare scaled 10mm) shifted N[xpart(PileChemin[k])][ypart(PileChemin[k])]) withcolor white;
label(TEX("\num{"&decimal(NbSol[k])&"}"),M[xpart(PileChemin[k])][ypart(PileChemin[k])]);
endfor;
trace TraceLabyrinthe;
);
- Corps:=(Corps scaled \useKV[ClesLabyNombre]{Echelle}) rotated \useKV[ClesLabyNombre]{Angle};
+ Corps:=(Corps scaled \useKV[ClesLabyNb]{Echelle}) rotated \useKV[ClesLabyNb]{Angle};
trace Corps;
\end{mplibcode}
}
@@ -4822,15 +4967,15 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick,
label(TEX("\num{"&decimal(NbAffiche[nbaffiche])&"}"),M[k][l]);
endfor;
endfor;
- remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNombre]{Couleur};
- remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNombre]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted N[choixligneD][choixcolonneD]) withcolor \useKV[ClesLabyNb]{Couleur};
+ remplis ((unitsquare scaled 10mm) shifted Arrivee) withcolor \useKV[ClesLabyNb]{Couleur};
for k=2 upto indiceChemin-1:
remplis ((unitsquare scaled 10mm) shifted N[xpart(PileChemin[k])][ypart(PileChemin[k])]) withcolor 0.5white;
label(TEX("\num{"&decimal(NbSol[k])&"}"),M[xpart(PileChemin[k])][ypart(PileChemin[k])]);
endfor;
trace TraceLabyrinthe;
);
- CorpsSolution:=(CorpsSolution scaled \useKV[ClesLabyNombre]{Echelle}) rotated \useKV[ClesLabyNombre]{Angle};
+ CorpsSolution:=(CorpsSolution scaled \useKV[ClesLabyNb]{Echelle}) rotated \useKV[ClesLabyNb]{Angle};
trace CorpsSolution;
\end{mplibcode}
\mplibcodeinherit{disable}
@@ -9112,7 +9257,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\xintifboolexpr{#2==0}{%
}{\xintifboolexpr{#3==0}{}{(}}\xintifboolexpr{#2==0}{\Tikzmark{}}{\Tikzmark{a}}
\ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}%
- \xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{b}%
+ \xintifboolexpr{#3==0}{\Tikzmark{}}{\xintifboolexpr{#3>0}{\xintifboolexpr{#2==0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{b}}%
\ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}%
\xintifboolexpr{#2==0}{}{\xintifboolexpr{#3==0}{}{)}}%
%
@@ -10670,7 +10815,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
\ppcm=\numexpr#1*#2/\pgcd\relax%
}%
-\setKVdefault[ClesThales]{Calcul=true,Droites=false,Propor=false,Segment=false,Figure=false,FigureSeule=false,Figurecroisee=false,FigurecroiseeSeule=false,Angle=0,Precision=2,Entier=false,Unite=cm,Reciproque=false,Produit=false,ChoixCalcul=0,Simplification,Redaction=false,Remediation=false,Echelle=1cm,Perso=false,CalculsPerso=false}
+\setKVdefault[ClesThales]{Calcul=true,Droites=false,Propor=false,Segment=false,Figure=false,FigureSeule=false,Figurecroisee=false,FigurecroiseeSeule=false,Angle=0,Precision=2,Entier=false,Unite=cm,Reciproque=false,Produit=false,ChoixCalcul=0,Simplification,Redaction=false,Remediation=false,Echelle=1cm,Perso=false,CalculsPerso=false,IntroCalculs}
\DeclareSIUnit{\PfCThalesUnit}{\useKV[ClesThales]{Unite}}%
@@ -11242,12 +11387,12 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul.
}}{}
}%
%%
-\StrMid{\the\zzz}{1}{1}[\cmza]%
-\StrMid{\the\yyy}{1}{1}[\cmya]%
-\StrMid{\the\xxx}{1}{1}[\cmxa]%
-\ifboolKV[ClesThales]{Calcul}{%
+ \StrMid{\the\zzz}{1}{1}[\cmza]%
+ \StrMid{\the\yyy}{1}{1}[\cmya]%
+ \StrMid{\the\xxx}{1}{1}[\cmxa]%
+ \ifboolKV[ClesThales]{Calcul}{%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
- On remplace par les longueurs connues :%
+ \ifboolKV[ClesThales]{IntroCalculs}{On remplace par les longueurs connues :}{}%
\ifboolKV[ClesThales]{CalculsPerso}{%
\EcritureQuotients%
}{%
@@ -16578,7 +16723,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
%%%
% Diff\'erentes représentations graphiques
%%%
-\setKVdefault[TraceG]{Grille=false,Graduations=false,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={},LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Relie=false,RelieSegment=false}
+\setKVdefault[TraceG]{Grille=false,Graduations=false,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={},LabelC=0.5,NomCourbe={},Origine={(5.5,5.5)},Fonction=false,Points=false,Invisible=false,CouleurPoint=red,CouleurTrace=black,Relie=false,RelieSegment=false,Marque=dot}
\newcommand\TraceGraphique[2][]{%
\useKVdefault[TraceG]%
@@ -16611,6 +16756,9 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
grilley=\useKV[TraceG]{PasGrilleY};
pos=\useKV[TraceG]{LabelC};
+ marque_p:=str \useKV[TraceG]{Marque};
+ m_c:=m_c*2;
+
color colorpoint,colortrace;
colorpoint=\useKV[TraceG]{CouleurPoint};
colortrace=\useKV[TraceG]{CouleurTrace};
@@ -16687,7 +16835,11 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
if Invisible=false:
drawoptions(withcolor colorpoint);
for p_=#2:
+ if marque_p="dot":
dotlabel("",(x.u*(xpart(p_)-xmin),y.u*(ypart(p_)-ymin)));
+ elseif marque_p="croix":
+ pointe((x.u*(xpart(p_)-xmin),y.u*(ypart(p_)-ymin)));
+ fi;
endfor;
drawoptions();
fi;
@@ -16989,12 +17141,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
%%%
% Formules
%%%
-\setKVdefault[ClesFormule]{Perimetre=false,Aire=false,Volume=false,Surface=carr\'e,Solide=pav\'e,Angle=0,Ancre={(0,0)},Largeur=5cm,Couleur=white,EchelleEspace=70}
+\setKVdefault[ClesFormule]{Perimetre=false,Aire=false,Volume=false,Surface=carr\'e,Solide=pav\'e,Angle=0,Ancre={(0,0)},Largeur=5cm,Couleur=white,EchelleEspace=70,Echelle=1cm}
\def\MPFigureCarre{%
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
+ u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
pair A,B,C,D;
A=u*(1,1);
@@ -17012,7 +17165,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(A,B,-3mm,btex $c$ etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
pair A,B,C,D;
A=u*(1,1);
B-A=u*(2,0);
@@ -17033,8 +17186,9 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\def\MPFigurePolygone{%
\ifluatex
- \mplibforcehmode
+ \mplibforcehmode
\begin{mplibcode}
+ u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
pair A,B,C,D,E,F;
A=u*(1,1);
@@ -17046,7 +17200,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw polygone(A,B,C,D,E,F);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
pair A,B,C,D,E,F;
A=u*(1,1);
B-A=u*(2,0);
@@ -17061,9 +17215,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\def\MPFigureParallelogramme{%
\ifluatex
- \mplibforcehmode
- \begin{mplibcode}
- vardef marque_para(expr dd,ee,pa)=
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=\useKV[ClesFormule]{Echelle};
+ vardef marque_para(expr dd,ee,pa)=
save im;
picture im;
pair kk,ll,mn,mo;
@@ -17097,7 +17252,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
drawoptions();
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
vardef marque_para(expr dd,ee,pa)=
save im;
picture im;
@@ -17137,6 +17292,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
Figure(-5u,-5u,10u,5u);
pair A,B,C,D,I,J;
@@ -17161,7 +17317,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw codeperp(B,J,A,5);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,10u,5u);
pair A,B,C,D,I,J;
A=u*(1,1);
@@ -17212,10 +17368,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
marque_p:="non";
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
typetrace:="3D";
Figure(-10u,-10u,10u,10u);
- Initialisation(5,0,10,500);
+ Initialisation(5,0,10,v);
color O,A,B,C;
O=(0,0,0);
A-O=(0,1/2,0);
@@ -17254,7 +17410,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(A,F,2mm,btex $h$ etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
typetrace:="3D";
typerepre:="persp";
Figure(-10u,-10u,10u,10u);
@@ -17319,7 +17475,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(A,E,3mm,btex hauteur etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
typetrace:="3D";
typerepre:="persp";
Figure(-10u,-10u,10u,10u);
@@ -17399,7 +17555,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
marque_p:="non";
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
typetrace:="3D";
typerepre:="persp";
Figure(-10u,-10u,10u,10u);
@@ -17459,7 +17615,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
marque_p:="non";
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
typetrace:="3D";
typerepre:="persp";
Figure(-10u,-10u,10u,10u);
@@ -17512,7 +17668,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw codeperp(z7,z6,z5,8);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
Figure(-10u,-10u,10u,10u);
u:=0.5cm;
z0=(-0.5,0)*u;
@@ -17553,7 +17709,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(E,H,2mm,btex $a$ etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={v:=\useKV[ClesFormule]{EchelleEspace};}]
typetrace:="3D";
typerepre:="persp";
Figure(-10u,-10u,10u,10u);
@@ -17570,6 +17726,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+ u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
Figure(-5u,-5u,5u,5u);
pair A,B,C,D;
@@ -17584,7 +17741,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(A,B,-3mm,btex $c$ etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,5u,5u);
pair A,B,C,D;
A=u*(1,1);
@@ -17604,6 +17761,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
Figure(-5u,-5u,5u,5u);
pair A,B,C,D;
@@ -17619,7 +17777,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
marque_s:=marque_s*3;
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,5u,5u);
pair A,B,C,D;
A=u*(1,1);
@@ -17640,6 +17798,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
pair A,B,C,D;
A=u*(1,1);
@@ -17659,7 +17818,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
label.lft(btex $\ell$ etex,iso(A,D));
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
pair A,B,C,D;
A=u*(1,1);
B-A=u*(3,0);
@@ -17684,6 +17843,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
Figure(-5u,-5u,5u,5u);
pair A,B,C;
@@ -17693,7 +17853,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw polygone(A,B,C);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,5u,5u);
pair A,B,C;
A=u*(1,1);
@@ -17708,6 +17868,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
Figure(-5u,-5u,5u,5u);
pair A,B,C;
@@ -17723,7 +17884,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(B,C,3mm,btex diam\`etre etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,5u,5u);
pair A,B,C;
A=u*(2.5,2.5);
@@ -17744,6 +17905,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\ifluatex
\mplibforcehmode
\begin{mplibcode}
+u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
Figure(-5u,-5u,5u,5u);
pair A,B,C;
@@ -17759,7 +17921,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw appelation(A,C,3mm,btex rayon $r$ etex);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,5u,5u);
pair A,B,C;
A=u*(2.5,2.5);
@@ -17777,9 +17939,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
}
\def\MPFigureTriangleAire{%
- \ifluatex
+ \ifluatex
\mplibforcehmode
\begin{mplibcode}
+u:=\useKV[ClesFormule]{Echelle};
drawoptions( dashed dashpattern(on1cm));
pair A,B,C,H,I,J;
A=u*(0.5,1);
@@ -17817,7 +17980,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
drawoptions();
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfCGeometrie;}]
+ \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
Figure(-5u,-5u,5u,5u);
pair A,B,C,H,I,J;
A=u*(0.5,1);
@@ -17855,7 +18018,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
drawoptions();
\end{mpost}
\fi
-}
+}%
\newcommand\Formule[1][]{%
\useKVdefault[ClesFormule]%
@@ -18297,7 +18460,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
%%%
% Reperage
%%%
-\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AnglePhi=30,CouleurLa=white,CouleurLon=Tomato,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black,Thermometre=false,Mercure=false,CouleurMercure=black,ValeurMin=-4000,ValeurMax=4000,Etages=4}
+\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AnglePhi=30,CouleurLa=white,CouleurLon=Tomato,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black,Thermometre=false,Mercure=false,CouleurMercure=black,Celsius,Kelvin=false,Farenheit=false,ValeurMin=-4000,ValeurMax=4000,Etages=4}
% ValeurOrigine permet de faire des morceaux de demi-droite gradu\'ee en passant par droite :)
\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}
@@ -19816,24 +19979,46 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
n:=0;
for p_=t:
n:=n+1;
+ if substring(1,2) of p_="*":
+ label.top(TEX(substring(2,length p_) of p_),unitp*(valeur[n],0));
+ else:
label.top(TEX(p_),unitp*(valeur[n],0));
+ fi;
+ if p_<>"":
pointe(unitp*(valeur[n],0));
+ fi;
endfor;
fi;
- if AffichageCoord=3:
+ % On ajoute une paramétrisation possible à chaque point.
+ if AffichageCoord>0:
n:=0;
for p_=t:
n:=n+1;
- if p_<>"":
+ if substring(1,2) of p_="*":
+ ACoord:=scantokens(substring(0,1) of p_);
+ if ACoord=3:
drawarrow (unitp*(valeur[n],-1))--(unitp*(valeur[n],-0.3));
label.bot(btex \hbox to2em{\dotfill} etex,(unitp*(valeur[n],-1)));
+ pointe(unitp*(valeur[n]-ValeurOrigine,0));
+ elseif ACoord=2:
+ if ((ValeurUnitex*valeur[n]) mod pasx)<>0:
+ label.bot(TEX("\footnotesize$\frac{\num{\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"}}}{\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
+ else:
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ fi;
+ pointe(unitp*(valeur[n],0));
+ elseif ACoord=1:
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
pointe(unitp*(valeur[n],0));
fi;
- endfor;
+ else:
+ if AffichageCoord=3:
+ if p_<>"":
+ drawarrow (unitp*(valeur[n],-1))--(unitp*(valeur[n],-0.3));
+ label.bot(btex \hbox to2em{\dotfill} etex,(unitp*(valeur[n],-1)));
+ pointe(unitp*(valeur[n]-ValeurOrigine,0));
+ fi;
elseif AffichageCoord=2:
- n:=0;
- for p_=t:
- n:=n+1;
if p_<>"":
if ((ValeurUnitex*valeur[n]) mod pasx)<>0:
label.bot(TEX("\footnotesize$\frac{\num{\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"}}}{\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
@@ -19842,15 +20027,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
fi;
pointe(unitp*(valeur[n],0));
fi;
- endfor;
elseif AffichageCoord=1:
- n:=0;
- for p_=t:
- n:=n+1;
if p_<>"":
label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
pointe(unitp*(valeur[n],0));
fi;
+ fi;
+ fi;
endfor;
fi;
enddef;
@@ -19858,7 +20041,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
tata(#2);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={unitex:=\useKV[ClesReperage]{Unitex}*cm; pasx:=\useKV[ClesReperage]{Pasx}; unitp:=unitex/pasx; ValeurUnitex:=\useKV[ClesReperage]{ValeurUnitex}; ValeurOrigine:=\useKV[ClesReperage]{ValeurOrigine}; AffichageGrad:=\AffichageGrad; AffichageCoord:=\useKV[ClesReperage]{AffichageAbs}; AffichageNom:=\AffichageNom;}]
+ \begin{mpost}[mpsettings={unitex:=\useKV[ClesReperage]{Unitex}*cm; pasx:=\useKV[ClesReperage]{Pasx}; unitp:=unitex/pasx; ValeurUnitex:=\useKV[ClesReperage]{ValeurUnitex}; ValeurOrigine:=\useKV[ClesReperage]{ValeurOrigine}; AffichageGrad:=\AffichageGrad; AffichageCoord:=\useKV[ClesReperage]{AffichageAbs}; AffichageNom:=\AffichageNom; ValeurMin=\useKV[ClesReperage]{ValeurMin}; ValeurMax=\useKV[ClesReperage]{ValeurMax};}]
maxx:=0;
minx:=4000;
numeric valeur[];
@@ -19875,7 +20058,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
if valeur[k]>maxx:
maxx:=valeur[k];
fi;
- if valeur[k]<maxx:
+ if valeur[k]<minx:
minx:=valeur[k];
fi;
endfor;
@@ -19887,6 +20070,12 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
if minx>(-pasx-1):
minx:=-2*pasx-1;
fi;
+ if minx<ValeurMin:
+ minx:=ValeurMin;
+ fi;
+ if maxx>ValeurMax:
+ maxx:=ValeurMax;
+ fi;
% -----
pair A,B,C;
A=(0,0);
@@ -19933,43 +20122,62 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
n:=0;
for p_=t:
n:=n+1;
+ if substring(1,2) of p_="*":
+ label.top(LATEX(substring(2,length p_) of p_),unitp*(valeur[n],0));
+ else:
label.top(LATEX(p_),unitp*(valeur[n],0));
+ fi;
+ if p_<>"":
pointe(unitp*(valeur[n],0));
+ fi;
endfor;
fi;
- if AffichageCoord=3:
+ if AffichageCoord>0:
n:=0;
for p_=t:
n:=n+1;
+ if substring(1,2) of p_="*":
+ ACoord:=scantokens(substring(0,1) of p_);
+ if 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));
+ elseif ACoord=2:
+ if ((ValeurUnitex*valeur[n]) mod pasx)<>0:
+ label.bot(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"}}}{\noexpand\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
+ else:
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ fi;
+ pointe(unitp*(valeur[n],0));
+ elseif ACoord=1:
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
+ pointe(unitp*(valeur[n],0));
+ fi;
+ else:
+ if AffichageCoord=3:
if p_<>"":
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));
fi;
- endfor;
elseif AffichageCoord=2:
- n:=0;
- for p_=t:
- n:=n+1;
if p_<>"":
if ((ValeurUnitex*valeur[n]) mod pasx)<>0:
label.bot(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"}}}{\noexpand\num{"&decimal(pasx)&"}}$"),unitp*(valeur[n],0));
else:
label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurUnitex)&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
fi;
- pointe(unitp*(valeur[n]-ValeurOrigine,0));
+ pointe(unitp*(valeur[n],0));
fi;
- endfor;
elseif AffichageCoord=1:
- n:=0;
- for p_=t:
- n:=n+1;
if p_<>"":
label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),unitp*(valeur[n],0));
pointe(unitp*(valeur[n],0));
fi;
- endfor;
fi;
+ fi;
+ endfor;
+ fi;
enddef;
%%%
tata(#2);
@@ -19993,6 +20201,9 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
AffichageGrad:=\AffichageGrad;
AffichageCoord:=\useKV[ClesReperage]{AffichageAbs};
AffichageNom:=\AffichageNom;
+ boolean Kelvin,Farenheit;
+ Kelvin=\useKV[ClesReperage]{Kelvin};
+ Farenheit=\useKV[ClesReperage]{Farenheit};
color ColMercure;
ColMercure:=\useKV[ClesReperage]{CouleurMercure};
boolean Mercure;
@@ -20023,15 +20234,19 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
if minx>(-pasx-1):
minx:=-2*pasx-1;
fi;
+ if Kelvin:
+ minx:=0;
+ fi;
% -----
pair A,B,C;
A=(0,0);
B=unitp*(0,maxx);
C=unitp*(0,minx);
% On trace la demi-droite
- draw (C+unitp*(0,-0.75))--(B+unitp*(0,0.75));
+ draw ((C+unitp*(0,-0.75))--(B+unitp*(0,0.75)));
% marquage secondaire
marque_s:=marque_s/3;
+ if pasx<11:
labeloffset:=labeloffset*2;
if ((maxx-minx) mod 2)=0:
for k=(minx+1) step 2 until (maxx-1):
@@ -20043,6 +20258,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
endfor;
fi;
+ fi;
% marquage primaire
marque_s:=marque_s*3;
for k=0 step pasx until (maxx-pasx):
@@ -20055,13 +20271,27 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
m_c:=m_c*3;
marque_p:="croix";
labeloffset:=labeloffset*2;
+ if Kelvin:
+ label.lft(TEX("\footnotesize\Temp[K]{"&decimal(ValeurUnitex)&"}"),unitex*(0,1));
+ label.lft(TEX("\footnotesize\Temp[K]{"&decimal(ValeurOrigine)&"}"),A);
+ elseif Farenheit:
+ label.lft(TEX("\footnotesize\Temp[F]{"&decimal(ValeurUnitex)&"}"),unitex*(0,1));
+ label.lft(TEX("\footnotesize\Temp[F]{"&decimal(ValeurOrigine)&"}"),A);
+ else:
label.lft(TEX("\footnotesize\Temp{"&decimal(ValeurUnitex)&"}"),unitex*(0,1));
label.lft(TEX("\footnotesize\Temp{"&decimal(ValeurOrigine)&"}"),A);
+ fi;
if AffichageGrad>0:
for k=((minx+(minx mod pasx)) div pasx) upto (maxx div pasx):
if (k<0) or (k>1):
+ if Kelvin:
+ label.lft(TEX("\footnotesize\Temp[K]{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}"),unitex*(0,k));%%%
+ elseif Farenheit:
+ label.lft(TEX("\footnotesize\Temp[F]{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}"),unitex*(0,k));%%%
+ else:
label.lft(TEX("\footnotesize\Temp{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}"),unitex*(0,k));%%%
fi;
+ fi;
endfor;
fi;
@@ -20127,7 +20357,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
for p_=t:
n:=n+1;
if p_<>"":
+ if Kelvin:
+ label.rt(TEX("\footnotesize\Temp[K]{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),(5mm,unitp*valeur[n]));
+ elseif Farenheit:
+ label.rt(TEX("\footnotesize\Temp[F]{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),(5mm,unitp*valeur[n]));
+ else:
label.rt(TEX("\footnotesize\Temp{\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}"),(5mm,unitp*valeur[n]));
+ fi;
pointe(unitp*(0,valeur[n]));
draw (unitp*(0,valeur[n]))--(7.5mm,unitp*valeur[n]) dashed evenly;
fi;
@@ -20146,6 +20382,9 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
AffichageGrad:=\AffichageGrad;
AffichageCoord:=\useKV[ClesReperage]{AffichageAbs};
AffichageNom:=\AffichageNom;
+ boolean Kelvin,Farenheit;
+ Kelvin=\useKV[ClesReperage]{Kelvin};
+ Farenheit=\useKV[ClesReperage]{Farenheit};
color ColMercure;
ColMercure:=\useKV[ClesReperage]{CouleurMercure};
boolean Mercure;
@@ -20178,6 +20417,9 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
if minx>(-pasx-1):
minx:=-2*pasx-1;
fi;
+ if Kelvin:
+ minx:=0;
+ fi;
% -----
pair A,B,C;
A=(0,0);
@@ -20187,6 +20429,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
draw (C+unitp*(0,-0.75))--(B+unitp*(0,0.75));
% marquage secondaire
marque_s:=marque_s/3;
+ if pasx<11:
labeloffset:=labeloffset*2;
if ((maxx-minx) mod 2)=0:
for k=(minx+1) step 2 until (maxx-1):
@@ -20197,7 +20440,8 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
for k=(minx) step 2 until (maxx-1):
draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
endfor;
- fi;
+ fi;
+ fi;
% marquage primaire
marque_s:=marque_s*3;
for k=0 step pasx until (maxx-pasx):
@@ -20210,12 +20454,26 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
m_c:=m_c*3;
marque_p:="croix";
labeloffset:=labeloffset*2;
+ if Kelvin:
+ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{"&decimal(ValeurUnitex)&"}{\kelvin}"),unitex*(0,1));
+ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{"&decimal(ValeurOrigine)&"}{\kelvin}"),A);
+ elseif Farenheit:
+ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{"&decimal(ValeurUnitex)&"}{\farenheit}"),unitex*(0,1));
+ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{"&decimal(ValeurOrigine)&"}{\farenheit}"),A);
+ else:
label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{"&decimal(ValeurUnitex)&"}{\celsius}"),unitex*(0,1));
label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{"&decimal(ValeurOrigine)&"}{\celsius}"),A);
+ fi;
if AffichageGrad>0:
for k=((minx+(minx mod pasx)) div pasx) upto (maxx div pasx):
if (k<0) or (k>1):
- label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}{\celsius}"),unitex*(0,k));%%%
+ if Kelvin:
+ label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}{\kelvin}"),unitex*(0,k));%%%
+ elseif Farenheit:
+label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}{\farenheit}"),unitex*(0,k));%%%
+ else:
+label.lft(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-ValeurOrigine)&"*"&decimal(k)&"}}{\celsius}"),unitex*(0,k));%%%
+ fi;
fi;
endfor;
fi;
@@ -20282,7 +20540,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
for p_=t:
n:=n+1;
if p_<>"":
+ if Kelvin:
+ label.rt(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}{\kelvin}"),(5mm,unitp*valeur[n]));
+ elseif Farenheit:
+ label.rt(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}{\farenheit}"),(5mm,unitp*valeur[n]));
+ else:
label.rt(LATEX("\noexpand\footnotesize\noexpand\SI{\noexpand\fpeval{"&decimal(ValeurOrigine)&"+"&decimal(ValeurUnitex-(ValeurOrigine))&"*"&decimal(valeur[n])&"/"&decimal(pasx)&"}}{\celsius}"),(5mm,unitp*valeur[n]));
+ fi;
pointe(unitp*(0,valeur[n]));
draw (unitp*(0,valeur[n]))--(7.5mm,unitp*valeur[n]) dashed evenly;
fi;
@@ -20437,13 +20701,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\xdef\Listedesvaleursaplacersurlademidroite{}%
\foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdemidroite\compteur\nil}%
\foreachitem\compteur\in\ListePointDroite{\xdef\Listedesvaleursaplacersurlademidroite{\Listedesvaleursaplacersurlademidroite,\ListePointDroite[\compteurcnt,1]}}%
- % \Listedesvaleursaplacersurlademidroite%
+ %\Listedesvaleursaplacersurlademidroite%
\MPNewDEMIGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}%
}{%
\foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdemidroite\compteur\nil}%
\xdef\Listedesvaleursaplacersurlademidroite{}%
\foreachitem\compteur\in\ListePointDroite{\xdef\Listedesvaleursaplacersurlademidroite{\Listedesvaleursaplacersurlademidroite,\ListePointDroite[\compteurcnt,1]}}%
- % \Listedesvaleursaplacersurlademidroite%
+ %\Listedesvaleursaplacersurlademidroite%
\MPNewDROITEGraduee{\Listedesvaleursaplacersurlademidroite}{\the\toklistenompointdemidroite}%
}%
}%
@@ -22124,7 +22388,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
}%
\setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de
- Pythagore,ThemeSol=Solution,Trame=false,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true}%
+ Pythagore,ThemeSol=Solution,Trame=false,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false}%
\newcommand\Cartes[2][]{%
\useKVdefault[Cards]%
@@ -22231,9 +22495,11 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis
\clearpage%
}{}%
}{%
+ \ifboolKV[Cards]{SolutionSeule}{}{%
\begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
\ListeCards[1,1]%
\end{MyboxSimpleAv}%
+ }%
\ifboolKV[Cards]{AffichageSolution}{%
\begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
\ListeCards[1,2]%