diff options
author | Norbert Preining <norbert@preining.info> | 2022-07-07 03:01:45 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-07-07 03:01:45 +0000 |
commit | c925207bc17a56bf94a6e3d156db27042965136d (patch) | |
tree | b5dc80f7f6791eba6121e1a44c1c2b9a4b46dbb2 /macros/latex | |
parent | 9f9a07ef2eb0c1f25ce9afc7bb94928956c036ea (diff) |
CTAN sync 202207070301
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/inlinelabel/README.md | 19 | ||||
-rw-r--r-- | macros/latex/contrib/inlinelabel/inlinelabel-en.md | 55 | ||||
-rw-r--r-- | macros/latex/contrib/inlinelabel/inlinelabel-ja.md | 55 | ||||
-rw-r--r-- | macros/latex/contrib/inlinelabel/inlinelabel.pdf | bin | 0 -> 158341 bytes | |||
-rw-r--r-- | macros/latex/contrib/inlinelabel/inlinelabel.sty | 46 | ||||
-rw-r--r-- | macros/latex/contrib/inlinelabel/inlinelabel_example.tex | 11 | ||||
-rw-r--r-- | macros/latex/contrib/postnotes/CHANGELOG.md | 7 | ||||
-rw-r--r-- | macros/latex/contrib/postnotes/postnotes-code.pdf | bin | 809579 -> 813102 bytes | |||
-rw-r--r-- | macros/latex/contrib/postnotes/postnotes.dtx | 64 | ||||
-rw-r--r-- | macros/latex/contrib/postnotes/postnotes.pdf | bin | 177238 -> 178034 bytes | |||
-rw-r--r-- | macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf | bin | 8450619 -> 8577548 bytes | |||
-rw-r--r-- | macros/latex/contrib/profcollege/latex/ProfCollege.sty | 1079 | ||||
-rw-r--r-- | macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp | 236 | ||||
-rw-r--r-- | macros/latex/contrib/profcollege/metapost/PfCScratch.mp | 2 |
14 files changed, 1295 insertions, 279 deletions
diff --git a/macros/latex/contrib/inlinelabel/README.md b/macros/latex/contrib/inlinelabel/README.md index e7acb7ca7e..14e2879a9f 100644 --- a/macros/latex/contrib/inlinelabel/README.md +++ b/macros/latex/contrib/inlinelabel/README.md @@ -1,27 +1,26 @@ -# Inlinelabel Package +# inlinelabel This package can assign equation numbers to inline equations. When Japanese is supported, you can switch to circled equation numbers. -## System Requirements +## Documents -+ TeX format: LaTeX -+ Prerequisite package: amsmath and refcount -+ Prerequisite package with [circled] option: japanese-otf - - -## Installation - -Move inlinelabel.sty file to $TEXMF/tex/latex/hideanswer. +Documents for this pacakge are available in English and Japanese. ## License This package released under [the MIT license](https://ctan.org/license/mit). +(C) 2022 Yukoh KUSAKABE + ## Revision History ++ Version 1.1 2022-07-07 + + Rewrite README. + + Add the document (inlinelabel.pdf). + + Add the [luacircled] option. + Version 1.0 2022-06-28 + The first public version. diff --git a/macros/latex/contrib/inlinelabel/inlinelabel-en.md b/macros/latex/contrib/inlinelabel/inlinelabel-en.md deleted file mode 100644 index dd726d5533..0000000000 --- a/macros/latex/contrib/inlinelabel/inlinelabel-en.md +++ /dev/null @@ -1,55 +0,0 @@ -# Inlinelabel Package - -This package can assign equation numbers to inline equations. When Japanese is supported, you can switch to circled equation numbers. - - -## System Requirements - -+ TeX format: LaTeX -+ Prerequisite package: amsmath and refcount -+ Prerequisite package with [circled] option: japanese-otf - - -## Installation - -Move inlinelabel.sty file to $TEXMF/tex/latex/hideanswer. - - -## Usage - -### \inlinelabel{<label>} - -Put the inline equation number. Place it outside of the equation (outside of the $--$). Take the name of the label as an argument. Take a small margin before and after the text to make it look natural. If you don't want margins, use \inlinelabel*{<label>}. - - -### Option [circled] - -Assuming you are using a Japanese environment. Switch to circled equation numbers. All equation numbers are rewritten, not just the inline equation numbers. - - -### \circledref{<label>} - -Only valid when [circled] option is loaded. -Refer to the circled equation number. - - -### \equationref{<label>} - -Only valid when [circled] option is loaded. -This macro is the same as \circledref{<label>}. - - -## License - -This package released under [the MIT license](https://ctan.org/license/mit). - - -## Revision History - -+ Version 1.0 2022-06-28 - + The first public version. - - ---- - -[Yukoh KUSAKABE](https://twitter.com/metaphysicainfo) (screen-name) at [metaphysica.info](https://www.metaphysica.info/)
\ No newline at end of file diff --git a/macros/latex/contrib/inlinelabel/inlinelabel-ja.md b/macros/latex/contrib/inlinelabel/inlinelabel-ja.md deleted file mode 100644 index a0e14fe403..0000000000 --- a/macros/latex/contrib/inlinelabel/inlinelabel-ja.md +++ /dev/null @@ -1,55 +0,0 @@ -# Inlinelabel パッケージ - -このパッケージは,インライン数式に数式番号を振ることができます。また,日本語を扱えるときには,丸で囲まれた数式番号に切り替えることができます。 - - -## 前提条件 - -+ TeX format: LaTeX -+ Prerequisite package: amsmath and refcount -+ Prerequisite package with [circled] option: japanese-otf - - -## インストール - -inlinelabel.sty を $TEXMF/tex/latex/hideanswer (TeXが見つけられる場所)に置いてください。 - - -## 使用方法 - -### \inlinelabel{<label>} - -インラインの数式番号を置きます。数式の外($--$の外)に置いてください。引数にラベルの名前を取ります。文章を自然に見せるために,前後に少しの余白を取ります。余白がいらないときは,\inlinelabel*{<label>} を使ってください。 - - -### Option [circled] - -あなたが日本語の環境を使用していることを前提とします。丸で囲まれた数式番号に切り替えます。インラインの数式番号だけでなく,すべての数式番号が書き換えられます。 - - -### \circledref{<label>} - -[circled] オプションを読み込んでいるときにのみ有効です。 -丸で囲まれた数式番号を参照します。 - - -### \equationref{<label>} - -[circled] オプションを読み込んでいるときにのみ有効です。 -\circledref{<label>} と同じです。 - - -## ライセンス - -このパッケージは[MITライセンス](https://ctan.org/license/mit)のもとで配布しています。 - - -## 更新履歴 - -+ Version 1.0 2022-06-28 - + The first public version. - - ---- - -[Yukoh KUSAKABE](https://twitter.com/metaphysicainfo) (screen-name) at [metaphysica.info](https://www.metaphysica.info/)
\ No newline at end of file diff --git a/macros/latex/contrib/inlinelabel/inlinelabel.pdf b/macros/latex/contrib/inlinelabel/inlinelabel.pdf Binary files differnew file mode 100644 index 0000000000..67544ad66c --- /dev/null +++ b/macros/latex/contrib/inlinelabel/inlinelabel.pdf diff --git a/macros/latex/contrib/inlinelabel/inlinelabel.sty b/macros/latex/contrib/inlinelabel/inlinelabel.sty index 93c4822c83..54f35259ff 100644 --- a/macros/latex/contrib/inlinelabel/inlinelabel.sty +++ b/macros/latex/contrib/inlinelabel/inlinelabel.sty @@ -10,11 +10,18 @@ %% % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{inlinelabel}[2022/06/28 v1.0] +\ProvidesPackage{inlinelabel}[2022/07/07 v1.1] % % When you meet ''Package pxufont Error: You must load this package % after 'otf'.'', move \usepackage{otf} to a forward row. % +%% \if@inlinelabel@nospace +\newif\if@inlinelabel@nospace +\@inlinelabel@nospacefalse +% +%% [nospace] +\DeclareOption{nospace}{\@inlinelabel@nospacetrue} +% %% \if@inlinelabel@circled \newif\if@inlinelabel@circled \@inlinelabel@circledfalse @@ -22,6 +29,14 @@ %% [circled] \DeclareOption{circled}{\@inlinelabel@circledtrue} % +%% \if@inlinelabel@luacircled +\newif\if@inlinelabel@luacircled +\@inlinelabel@luacircledfalse +% +%% [luacircled] +\DeclareOption{luacircled}{\@inlinelabel@luacircledtrue} +% +% \ExecuteOptions{} \ProcessOptions\relax % @@ -47,9 +62,38 @@ \fi %% % +%% When [luacircled] +\if@inlinelabel@luacircled +% +% for \ajMaru +\RequirePackage{luatexja-otf} +% for \getrefnumber +\RequirePackage{refcount} +% +% renew tagform +\def\tagform@#1{\maketag@@@{$\ldots\hspace*{-0.075em}$\ignorespaces\ajMaru{#1}\unskip\@@italiccorr}}% +% +%% \circledref{<label>} +%% \equationref{<label>} +\DeclareRobustCommand{\circledref}[1]{\mbox{\ajMaru{\getrefnumber{#1}}}} +\DeclareRobustCommand{\equationref}[1]{\mbox{\ajMaru{\getrefnumber{#1}}}} +% +\fi +% +\if@inlinelabel@nospace +% +%% [nospace]\inlinelabel{<label>} +\DeclareRobustCommand{\inlinelabel}{\@ifstar{\@inlinelabelstar}{\@inlinelabelnostar}} +\DeclareRobustCommand{\@inlinelabelnostar}[1]{\refstepcounter{equation}\tagform@\theequation\expandafter\label{#1}} +\DeclareRobustCommand{\@inlinelabelstar}[1]{\hspace{0.5em}\refstepcounter{equation}\tagform@\theequation\expandafter\label{#1}\hspace{0.5em}} +% +\else +% %% \inlinelabel{<label>} \DeclareRobustCommand{\inlinelabel}{\@ifstar{\@inlinelabelstar}{\@inlinelabelnostar}} \DeclareRobustCommand{\@inlinelabelstar}[1]{\refstepcounter{equation}\tagform@\theequation\expandafter\label{#1}} \DeclareRobustCommand{\@inlinelabelnostar}[1]{\hspace{0.5em}\refstepcounter{equation}\tagform@\theequation\expandafter\label{#1}\hspace{0.5em}} % +\fi +% %% EOF
\ No newline at end of file diff --git a/macros/latex/contrib/inlinelabel/inlinelabel_example.tex b/macros/latex/contrib/inlinelabel/inlinelabel_example.tex deleted file mode 100644 index bf70bcaf82..0000000000 --- a/macros/latex/contrib/inlinelabel/inlinelabel_example.tex +++ /dev/null @@ -1,11 +0,0 @@ -\documentclass[uplatex]{article} -\usepackage{inlinelabel} -\begin{document} -$1=2$\inlinelabel{a} - -$1=2$\inlinelabel*{b} - -\ref{a} - -\ref{b} -\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/postnotes/CHANGELOG.md b/macros/latex/contrib/postnotes/CHANGELOG.md index 384af1bb2e..42e0f5f7f7 100644 --- a/macros/latex/contrib/postnotes/CHANGELOG.md +++ b/macros/latex/contrib/postnotes/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog -## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.3...HEAD) +## [Unreleased](https://github.com/gusbrs/postnotes/compare/v0.1.4...HEAD) + +## [v0.1.4](https://github.com/gusbrs/postnotes/compare/v0.1.3...v0.1.4) (2022-07-06) + +### Added +- `zref-check` support. ## [v0.1.3](https://github.com/gusbrs/postnotes/compare/v0.1.2...v0.1.3) (2022-05-28) diff --git a/macros/latex/contrib/postnotes/postnotes-code.pdf b/macros/latex/contrib/postnotes/postnotes-code.pdf Binary files differindex b1af0cc1e0..c364f3c9b7 100644 --- a/macros/latex/contrib/postnotes/postnotes-code.pdf +++ b/macros/latex/contrib/postnotes/postnotes-code.pdf diff --git a/macros/latex/contrib/postnotes/postnotes.dtx b/macros/latex/contrib/postnotes/postnotes.dtx index 7124ed7d70..489c40bf5d 100644 --- a/macros/latex/contrib/postnotes/postnotes.dtx +++ b/macros/latex/contrib/postnotes/postnotes.dtx @@ -147,7 +147,7 @@ % % % \begin{macrocode} -\ProvidesExplPackage {postnotes} {2022-05-28} {0.1.3} +\ProvidesExplPackage {postnotes} {2022-07-06} {0.1.4} {Endnotes for LaTeX} % \end{macrocode} % @@ -1338,7 +1338,7 @@ { content } \l_@@_print_content_tl \cs_set:Npn \@currentcounter { postnotetext } \int_set:Nn \c@postnotetext - { \int_eval:n { \l_@@_print_counter_tl } } + { \l_@@_print_counter_tl } \cs_set:Npx \@currentlabel { \p@postnote \l_@@_print_mark_tl } \@@_hyperref_make_currentHref:n @@ -1940,6 +1940,12 @@ % % \section{Compatibility} % +% A dedicated temp variable for restoring data. +% +% \begin{macrocode} +\tl_new:N \l_@@_restore_tmp_tl +% \end{macrocode} +% % \subsection*{\cs{caption}} % % For \cs{caption}'s possible two passes. This catches more than just @@ -2055,21 +2061,20 @@ % \end{macrocode} % Restore \pkg{biblatex} variables for each note. % \begin{macrocode} - \tl_new:N \l_@@_biblatex_restore_tl \AddToHook { postnotes/print/eachnote } [ postnotes ] { \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refsection } \l_@@_biblatex_restore_tl - \int_set:Nn \c@refsection { \l_@@_biblatex_restore_tl } + { biblatex@refsection } \l_@@_restore_tmp_tl + \int_set:Nn \c@refsection { \l_@@_restore_tmp_tl } \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refsegment } \l_@@_biblatex_restore_tl - \int_set:Nn \c@refsegment { \l_@@_biblatex_restore_tl } + { biblatex@refsegment } \l_@@_restore_tmp_tl + \int_set:Nn \c@refsegment { \l_@@_restore_tmp_tl } \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refcontextbool } \l_@@_biblatex_restore_tl - \use:c { toggle \l_@@_biblatex_restore_tl } { blx@refcontext } + { biblatex@refcontextbool } \l_@@_restore_tmp_tl + \use:c { toggle \l_@@_restore_tmp_tl } { blx@refcontext } \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refcontext } \l_@@_biblatex_restore_tl - \blx@edef@refcontext { \l_@@_biblatex_restore_tl } + { biblatex@refcontext } \l_@@_restore_tmp_tl + \blx@edef@refcontext { \l_@@_restore_tmp_tl } } % \end{macrocode} % Make \pkg{biblatex}'s \cs{mkbibendnote} use \cs{postnote}. This is very @@ -2204,15 +2209,15 @@ \AddToHook { postnotes/print/eachnote } [ postnotes ] { \@@_prop_get:nnN { \l_@@_print_note_id_tl } - { biblatex@refsection } \l_@@_biblatex_restore_tl + { biblatex@refsection } \l_@@_restore_tmp_tl \tl_if_eq:NNF - \l_@@_biblatex_restore_tl + \l_@@_restore_tmp_tl \g_@@_biblatex_prev_refsection_tl { \int_set:Nn \c@blx@maxsection - { \l_@@_biblatex_restore_tl - 1 } + { \l_@@_restore_tmp_tl - 1 } \tl_gset_eq:NN \g_@@_biblatex_prev_refsection_tl - \l_@@_biblatex_restore_tl + \l_@@_restore_tmp_tl \group_begin: \cs_set_eq:NN \label \use_none:n \cs_set_eq:NN \blx@info \use_none:n @@ -2308,6 +2313,35 @@ % \end{macrocode} % % +% \subsection*{\pkg{zref-check}} +% +% \begin{macrocode} +\AddToHook { package/zref-check/after } + { + \IfPackageAtLeastTF { zref-check } { 2022-07-05 } + { + \AddToHook { postnotes/store/note } [ postnotes ] + { + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { zref-check@abschap } { \int_use:N \c@zc@abschap } + \prop_gput:cnx { \@@_data_name:e { \l_@@_note_id_tl } } + { zref-check@abssec } { \int_use:N \c@zc@abssec } + } + \AddToHook { postnotes/print/eachnote } [ postnotes ] + { + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { zref-check@abschap } \l_@@_restore_tmp_tl + \int_set:Nn \c@zc@abschap { \l_@@_restore_tmp_tl } + \@@_prop_get:nnN { \l_@@_print_note_id_tl } + { zref-check@abssec } \l_@@_restore_tmp_tl + \int_set:Nn \c@zc@abssec { \l_@@_restore_tmp_tl } + } + } + { } + } +% \end{macrocode} +% +% % \subsection*{\pkg{amsmath}} % % \begin{macrocode} diff --git a/macros/latex/contrib/postnotes/postnotes.pdf b/macros/latex/contrib/postnotes/postnotes.pdf Binary files differindex af17232cc1..6059ea2438 100644 --- a/macros/latex/contrib/postnotes/postnotes.pdf +++ b/macros/latex/contrib/postnotes/postnotes.pdf diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf Binary files differindex 75069775ec..f2aa966d0e 100644 --- a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf +++ b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty index 45e407cf36..5221eebaa9 100644 --- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty +++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty @@ -1,9 +1,8 @@ % Author : Christophe Poulain % licence : Released under the LaTeX Project Public License v1.3c % or later, see http://www.latex-project.org/lppl.txtf - \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfCollege}[2022/06/01 v0.99-p Aide pour l'utilisation de LaTeX au college] +\ProvidesPackage{ProfCollege}[2022/07/01 v0.99-r Aide pour utiliser LaTeX au college] \RequirePackage{verbatim} @@ -190,9 +189,11 @@ }% \newcommand\Lignespointilles[1]{% - \xintFor* ##1 in {\xintSeq {1}{#1}}\do{% - \pointilles\par% - }% + \xintifboolexpr{#1>1}{% + \xintFor* ##1 in {\xintSeq {1}{#1}}\do{% + \pointilles\par% + }% + }{}% }% \newcommand\MultiCol[2]{% @@ -337,6 +338,717 @@ } %%% +% Représenter un entier +%%% +\setKVdefault[ClesREntier]{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}; + Initialisation(5,30,15,50*Echelle); + color A,B,C,D,E,F,G,H; + pointilles:="non"; + trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,0.1); + \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,} + } + \setsepchar{,}\ignoreemptyitems + \readlist*\ListeDesChiffres{\FooListeEntier}% + \xdef\ListeAvantCouleurs{\useKV[ClesREntier]{ListeCouleurs}}% + \readlist*\ListeCouleurEntier{\ListeAvantCouleurs}% + \xintifboolexpr{\LongueurNombreEntier==4}{% + \xdef\NombreMilliers{\ListeDesChiffres[1]}% + \xdef\NombreCentaines{\ListeDesChiffres[2]}% + \xdef\NombreDizaines{\ListeDesChiffres[3]}% + \xdef\NombreUnites{\ListeDesChiffres[4]}% + }{% + \xintifboolexpr{\LongueurNombreEntier==3}{% + \xdef\NombreMilliers{0}% + \xdef\NombreCentaines{\ListeDesChiffres[1]}% + \xdef\NombreDizaines{\ListeDesChiffres[2]}% + \xdef\NombreUnites{\ListeDesChiffres[3]}% + }{% + \xintifboolexpr{\LongueurNombreEntier==2}{% + \xdef\NombreMilliers{0}% + \xdef\NombreCentaines{0}% + \xdef\NombreDizaines{\ListeDesChiffres[1]}% + \xdef\NombreUnites{\ListeDesChiffres[2]}% + }{% + \xdef\NombreMilliers{0}% + \xdef\NombreCentaines{0}% + \xdef\NombreDizaines{0}% + \xdef\NombreUnites{\ListeDesChiffres[1]}% + }% + }% + }% + \begin{Geometrie}[TypeTrace="Espace",CoinBG={u*(-10,-10)},CoinHD={u*(20,20)}] + Echelle=\useKV[ClesREntier]{Echelle}; + NM=\NombreMilliers; + NC=\NombreCentaines; + ND=\NombreDizaines; + NU=\NombreUnites; + 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); + 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]); + endfor; + for k=0 upto 10: + trace chemin((k/10)[B,C],(k/10)[G,H],(k/10)[F,E]); + endfor; + for k=0 upto 10: + trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]); + endfor; + %if Compact: + %trace chemin(B,B+(0,0,-0.2)) dashed evenly withpen pencircle scaled 1.25; + %fi; + ); + color A,B,C,D,E,F,G,H; + TypePave1=image( + trace Pave(A,B,C,D,E,F,G,H)(0.1,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]); + endfor; + for k=0 upto 10: + trace chemin((k/10)[A,F],(k/10)[B,G],(k/10)[C,H]); + endfor; + %if Compact: + %trace chemin(B,B+(0,0,-0.2)) dashed evenly withpen pencircle scaled 1.25; + %fi; + ); + color A,B,C,D,E,F,G,H; + TypePave2=image( + trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,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]); + endfor; + %if Compact: + %trace chemin(B,B+(0,0,-0.2)) dashed evenly withpen pencircle scaled 1.25; + %fi; + ); + color A,B,C,D,E,F,G,H; + TypePave3=image( + trace Pave(A,B,C,D,E,F,G,H)(0.1,0.1,0.1); + currentpicture:=nullpicture; + remplis polygone(A,B,C,H,E,F) withcolor if Print : blanc else: ColorEntier4 fi; + trace chemin(C,H,E); + trace chemin(A,F,E); + trace chemin(A,B,C); + trace chemin(F,G,H); + trace chemin(B,G); + ); + if Compact: + for k=0 upto (\NombreMilliers-1): + trace TypePave0 shifted ((Projette((k,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)))); + endfor; + for k=0 upto (\NombreDizaines-1): + trace TypePave2 shifted ((Projette((0.1*k,3,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)))); + endfor; + else: + for k=0 upto (\NombreMilliers-1): + trace TypePave0 shifted ((Projette((0,1.1*(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)))); + 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)))); + 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)))); + endfor; + fi; + \end{Geometrie} + } +} + +% Gestion de l'aléatoire (pour la CAN) +\newcommand\ChoixAlea[4][]{% + \ifx\bla#1\bla% + \xdef#4{\fpeval{randint(#2,#3)}}% + \else% + \xdef#4{\fpeval{round(randint(#2,#3)+rand(),#1)}}% + \fi% +}% + +\def\VariableAlea#1#2{% + \xdef#1{\fpeval{#2}}% +}% + +% On bloque la graine de fabrication des nombres aléatoires. +\ExplSyntaxOn +\cs_new_eq:NN \PfCGraineAlea \sys_gset_rand_seed:n +\ExplSyntaxOff + +%%% +% Course aux nombres +%%% +\RequirePackage{longtable} +% https://tex.stackexchange.com/questions/642775/when-displaying-a-datatool-database-with-dtldisplaylongdb-how-to-obtain-a-hor +% Patch éventuel à ajouter +%\makeatletter +%\expandafter\patchcmd\expandafter{\csname\string\DTLdisplaylongdb\endcsname}% +% {\@dtl@resetdoamp\dtldisplaystarttab}% +% {\dtldisplaystarttab\@dtl@resetdoamp}% +% {\message{Patching succeeded.}}% +% {\message{Patching failed.}}% +%\makeatother + +\setKVdefault[ClesMathAlea]{NbQ=5,ChoixTables=2-9,ValeurMax=20,Classique,Trou=false,Melange=false,Multiple=2,Theme=false}% +\defKV[ClesMathAlea]{Trous=\setKV[ClesMathAlea]{Classique=false}\setKV[ClesMathAlea]{Trou}}% +\defKV[ClesMathAlea]{Melanges=\setKV[ClesMathAlea]{Classique=false}\setKV[ClesMathAlea]{Melange}}% + +\newcommand\MathAlea[2][]{% + \useKVdefault[ClesMathAlea]% + \setKV[ClesMathAlea]{#1}% + \input{#2}% +}% + +\newcommand\CourseNombreTotalQuestions[1]{% + \setKV[ClesCN]{TotalQ=#1}% + \xdef\CNfoo{}% + \xintFor* ##1 in{\xintSeq{1}{#1}}\do{% + \xdef\CNfoo{\CNfoo ##1,}% + }% +}% + +\setKVdefault[ClesCN]{% + Stretch=2.5,%Elasticité du tableau + NbQ=5,%Nb de questions à poser + RAZ=false,%Pour remettre à zéro le compteur des questions + Ordre=false,%Pour mettre toutes les questions dans l'ordre des numéros + Exercice=false,%Pour utiliser l'aléatoire des questions mais sans habillage particulier, autre que des \item + Perso=false,%Pour que utiliser un choix personnel des questions + Lecture=false,%Pour différencier avec une lecture automatisée sur les numéros de fichiers + Maitre=false,%Pour indiquer qu'on prend en compte ou pas les sous-dossiers + Nom=false,%Pour afficher le nom des fichiers utilisés. + Theme=false,%Pour afficher le theme travaillé dans les fichiers utilisés. + AMC=false,% + Multi=false% +}% +\defKV[ClesCN]{Liste=\setKV[ClesCN]{Perso=true}\setKV[ClesCN]{Lecture}}% +\defKV[ClesCN]{Dossier=\setKV[ClesCN]{Lecture}}% +\defKV[ClesCN]{Debut=\setKV[ClesCN]{RAZ}}% +\setsepchar[*]{,*/}% +\readlist*\ListeMotsCAN{La moitié de /2,Le double de /1,Le triple de /1, Le tiers de /3,Le nombre dix fois plus grand que /1,Le nombre cent fois plus grand que /1,Le nombre mille fois plus grand que /1,Le nombre dix fois plus petit que /10,Le nombre cent fois plus petit que /100,Le nombre mille fois plus petit que /1000}% +\readlist*\ListeMulAstucieuxCAN{50/2,25/4,20/5}% +\readlist*\ListeLieuxObjetsCAN{boulangerie/pains au chocolat/un pain au chocolat,boulangerie/cookies/un cookie,boulangerie/brioches/une brioche,piscine/entrées/une entrée,boucherie/saucisses/une saucisse,boucherie/cuisses de poulet/une cuisse de poulet}% +\readlist*\ListeNomsCAN{Aude/Elle,Bernard/Il,Céline/Elle,Daniel/Il,Elise/Elle,Fabien/Il,Gérard/Il,Hélène/Elle,Ilies/Il,Jasmine/Elle,Kylian/Il,Laurent/Il,Mathilde/Elle,Nina/Elle,Octave/Il,Philippe/Il,Joachim/Il,Thérèse/Elle,Nawel/Elle,Alexandre/Il,Maxence/Il,Sophie/Elle,Christophe/Il,Myriam/Elle}% +\readlist*\ListeComposantStatCAN{voitures/un garage/Cross-over/Utilitaires/Berlines,fruits/une corbeille/Pommes/Oranges/Bananes,vêtements/une armoire/Pulls/T-shirts/Chemises,couverts/un tiroir/Fourchettes/Couteaux/Cuillères}% +\readlist*\ListeObjetsSymbolesCAN{fleurs/96,ciseaux/36,crayons/47,enveloppes/41}%uniquement avec pifont +\setsepchar{,}% +\readlist*\ListeObjetsCAN{bonbons,billes,jouets,fruits,biscuits,gâteaux,pommes,poires} +\readlist*\ListeFruitsCAN{pommes,poires,abricots,cerises,fraises,framboises,noix,pêches,nectarines,myrtilles} +\readlist*\ListeSommetsCAN{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z} + +\newcommand\ExtraitSymboles[1]{% + \xdef\CANSGFoo{}% + \foreachitem\compteur\in\ListeObjetsSymbolesCAN{% + \xdef\CANSGFoo{\CANSGFoo \ListeObjetsSymbolesCAN[\compteurcnt],}% + }% + \MelangeListe{\CANSGFoo}{#1}% + \setsepchar[*]{,*/}% + \readlist*\SymbolesMelanges{\faa}% + \setsepchar{,}% +}% + +\newcommand\ExtraitSommet[1]{% + \xdef\CANSGFoo{}% + \foreachitem\compteur\in\ListeSommetsCAN{% + \xdef\CANSGFoo{\CANSGFoo \ListeSommetsCAN[\compteurcnt],}% + }% + \MelangeListe{\CANSGFoo}{#1}% + \readlist*\SommetsMelanges{\faa}% +}% + +\newcommand\ExtraitFruit[1]{% + \xdef\CANSGFoo{}% + \foreachitem\compteur\in\ListeFruitsCAN{% + \xdef\CANSGFoo{\CANSGFoo \ListeFruitsCAN[\compteurcnt],}% + }% + \MelangeListe{\CANSGFoo}{#1}% + \readlist*\FruitsMelanges{\faa}% +}% + +\newcommand\ExtraitNom[1]{% + \xdef\CANSGFoo{}% + \foreachitem\compteur\in\ListeNomsCAN{% + \xdef\CANSGFoo{\CANSGFoo \ListeNomsCAN[\compteurcnt],}% + }% + \MelangeListe{\CANSGFoo}{#1}% + \setsepchar[*]{,*/}% + \readlist*\NomsMelanges{\faa}% + \setsepchar{,}% +}% + +\newcommand\ExtraitElements[1]{% + \xdef\CANSGFoo{}% + \foreachitem\compteur\in\ListeComposantStatCAN{% + \xdef\CANSGFoo{\CANSGFoo \ListeComposantStatCAN[\compteurcnt],}% + }% + \MelangeListe{\CANSGFoo}{#1}% + \setsepchar[*]{,*/}% + \readlist*\ElementsMelanges{\faa}% + \setsepchar{,}% +}% + +\newcounter{CNNumQ}% +\setcounter{CNNumQ}{1}% + +\newcommand\CANNew{% + \textcolor{Crimson}{\faCopy}% +}% + +\newread\RecupNbFichiers +\newread\RecupSSDossiers +\newread\zzz +\def\zzpar{\par}% + +\makeatletter +\def\app@exe{\write18} +% Recuperer les sous-dossiers +\def\RecupererSousDossiers#1{%#1 est le dossier contenant les fichiers can classés en sous-dossier + \app@exe{rm -f RecapSSDossier.tmp ; ls -1 -I "*.tex" #1 > RecapSSDossier.tmp}% + \immediate\openin\zzz=RecapSSDossier.tmp + \loop% + \read\zzz to \tmp% + \ifx\tmp\zzpar\else% + \xdef\CNFOOSSDossiers{\CNFOOSSDossiers \expandafter\detokenize\expandafter{\tmp},}% + \fi% + \ifeof\zzz\else% + \repeat% + \setsepchar{,}\ignoreemptyitems + \readlist*\ListeSSDossiers{\CNFOOSSDossiers} +} + +\def\RecupererFichierTeXSSDossier#1#2{% + \openin\zzz="|ls #1/#2/*.tex"% + \loop% + \read\zzz to \tmp% + \ifx\tmp\zzpar\else% + \xdef\CNFOO{\CNFOO \expandafter\detokenize\expandafter{\tmp},}% + \fi% + \ifeof\zzz\else% + \repeat% +} + +\def\RecupererFichierTeXDossier#1{% + \xdef\CNFOO{}% + \openin\zzz="|ls #1/*.tex" + \loop% + \read\zzz to \tmp% + \ifx\tmp\zzpar\else% + \xdef\CNFOO{\CNFOO \expandafter\detokenize\expandafter{\tmp},}% + \fi% + \ifeof\zzz\else% + \repeat% +} + +\def\DefinirListeFichiers{% + \setsepchar{,}\ignoreemptyitems% + \readlist*\ListeFichiers{\CNFOO}% +} + +\def\RecupererFichierTeXAllSSDossier#1{% + \RecupererSousDossiers{#1}% + \foreachitem\compteur\in\ListeSSDossiers{\RecupererFichierTeXSSDossier{#1}{\ListeSSDossiers[\compteurcnt]}}% + \DefinirListeFichiers% +} + +\def\RecupererFichierTeXAllDossier#1{% + \RecupererFichierTeXDossier{#1}% + \DefinirListeFichiers% +} + +\def\RecupererFichierTeXComplet#1{% + \RecupererFichierTeXDossier{#1}% + \RecupererSousDossiers{#1}% + \foreachitem\compteur\in\ListeSSDossiers{\RecupererFichierTeXSSDossier{#1}{\ListeSSDossiers[\compteurcnt]}}% + \DefinirListeFichiers% +} + +\def\RecupererFichierTeXSSDossierPerso#1{% + \openin\zzz="|ls #1/*.tex" + \loop% + \read\zzz to \tmp% + \ifx\tmp\zzpar\else% + \xdef\CNFOO{\CNFOO \expandafter\detokenize\expandafter{\tmp},}% + \fi% + \ifeof\zzz\else% + \repeat% +} + +\makeatother + +\newcommand\CNTheme[1]{}% + +\NewDocumentCommand\CourseNombre{o m}{% + \setKV[ClesMathAlea]{NbQ=1}% + \useKVdefault[ClesCN]% + \setKV[ClesCN]{#1}% + \ifboolKV[ClesCN]{Theme}{\renewcommand\CNTheme[1]{{\ttfamily Thème : ##1}\par}}{}% + \ifboolKV[ClesCN]{RAZ}{%\setcounter{CNNumQ}{1}}{}% + \setcounter{CNNumQ}{\useKV[ClesCN]{Debut}}% + }{}% + \setKV[ClesMathAlea]{NbQ=1}% + \xdef\CNFOOSSDossiers{}% + \xdef\CNFOO{}% + \ifboolKV[ClesCN]{Lecture}{% + \ifboolKV[ClesCN]{Perso}{% + % % Ici \useKV[ClesCN]{Liste} + \xdef\CNFOOListePerso{\useKV[ClesCN]{Liste}}% + % % OK -> Là, normalement, c'est la liste des dossiers choisis par l'utilisateur : \CNFOOListePerso + \setsepchar{,}% + \readlist*\ListeDesSSDossiersPerso{\CNFOOListePerso}% + % % \par OK -> Là, normalement, c'est la liste des dossiers perso sous forme de liste : \showitems\ListeDesSSDossiersPerso[]% + \foreachitem\compteur\in\ListeDesSSDossiersPerso{\RecupererFichierTeXSSDossierPerso{\ListeDesSSDossiersPerso[\compteurcnt]}}% + \DefinirListeFichiers% + % % \par OK -> Là, enfin, normalement, c'est la liste des fichiers contenus dans les dossiers perso : + % % \showitems\ListeFichiers[] + }{% + \ifboolKV[ClesCN]{Maitre}{% + % % On récupère tous les fichiers can dans les sous-dossiers + % % et on construit une liste \ListeFichiers contenant les chemins des fichiers considérés. + \RecupererFichierTeXComplet{\useKV[ClesCN]{Dossier}}% + }{% + % % Là + % % On récupère seulement les fichiers can de ce dossier + % % et on consruit une liste \ListeFichiers contenant les chemins des fichiers considérés. + \RecupererFichierTeXAllDossier{\useKV[ClesCN]{Dossier}}% + }% + }% + % % On crée la liste du nombre total de questions + \xdef\CNfooListe{}% + \xintFor* ##1 in{\xintSeq{1}{\ListeFichierslen}}\do{% + \xdef\CNfooListe{\CNfooListe ##1,}% + }% + % % \par OK -> normalement, on a la liste du nombre de questions : \CNfooListe + % % On affiche les questions : + \ifboolKV[ClesCN]{Ordre}{% + % % soit dans un exercice + \ifboolKV[ClesCN]{Exercice}{% + % % Attention le style de l'environnement est à choisir par l'utilisateur + \xintFor* ##1 in {\xintSeq{1}{\ListeFichierslen}}\do{% + \item\input{\ListeFichiers[##1]}% + }% + }{% Soit toutes les questions au format course + \renewcommand{\arraystretch}{\useKV[ClesCN]{Stretch}}% + \begin{longtable}{|c|p{0.7\linewidth}|p{0.1\linewidth}|p{0.05\linewidth}|}% + \hhline{~---}% + \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\'Enoncé&\cellcolor{gray!15}\centering Réponse&\cellcolor{gray!15}\centering\arraybackslash Jury\\% + \hline% + \endhead% + \xintFor* ##1 in {\xintSeq{1}{\ListeFichierslen}}\do{% + \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\input{\ListeFichiers[##1]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&&\\% + \hline% + }% + \end{longtable}% + \renewcommand{\arraystretch}{1}% + }% + }{% + % On prévient l'utilisateur si le nb de questions est inférieur à NbQ + \xintifboolexpr{\ListeFichierslen<\useKV[ClesCN]{NbQ}}{% + \faExclamationCircle~Le nombre maximal de questions est inférieur au nombre de questions à afficher. Modifier la clé {\ttfamily NbQ} ou ajouter des questions dans le(s) répertoire(s).% + }{%%On choisit NbQ questions parmi la liste de fichiers + \MelangeListe{\CNfooListe}{\useKV[ClesCN]{NbQ}}% + \setsepchar{,}\ignoreemptyitems% + \readlist*\ListeCNQuestions{\faa} + \ifboolKV[ClesCN]{Exercice}{% + \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesCN]{NbQ}}}\do{% + \item\xdef\Numerodelaquestionaposer{\ListeCNQuestions[##1]}\input{\ListeFichiers[\Numerodelaquestionaposer]}% + }% + }{% On les affiche + \renewcommand{\arraystretch}{\useKV[ClesCN]{Stretch}}% + \begin{longtable}{|c|p{0.7\linewidth}|p{0.1\linewidth}|p{0.05\linewidth}|}% + \hhline{~---}% + \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\'Enoncé&\cellcolor{gray!15}\centering Réponse&\cellcolor{gray!15}\centering\arraybackslash Jury\\% + \hline% + \endhead% + \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesCN]{NbQ}}}\do{% + \ttfamily{\theCNNumQ}\stepcounter{CNNumQ}&\xdef\Numerodelaquestionaposer{\ListeCNQuestions[##1]}\input{\ListeFichiers[\Numerodelaquestionaposer]}\ifboolKV[ClesCN]{Nom}{\par\hfill\footnotesize\ttfamily\ListeFichiers[##1]}{}&&\\ + \hline + }% + \end{longtable}% + \renewcommand{\arraystretch}{1}% + }% + }% + }% + }{% + \input{#2} + }% +}% +% fin course aux nombres + +%%% +% Frise temporelle +%%% +\setKVdefault[ClesFrise]{Longueur=8cm,Fleches=false,Ecart=5mm,Sup=false}% + +\newtoks\toklistefrise% +\def\UpdatetoksFrise#1/#2/#3\nil{\addtotok\toklistefrise{"#1","#2","#3",}}% + +\newcommand\Frise[2][]{% + \useKVdefault[ClesFrise]% + \setKV[ClesFrise]{#1}% + \setsepchar[*]{,*/}\ignoreemptyitems% + \readlist*\ListeTempo{#2}% + \toklistefrise{}% + \foreachitem\compteur\in\ListeTempo{\expandafter\UpdatetoksFrise\compteur\nil} + \MPDessineFrise{\the\toklistefrise}% +} + +\newcommand\MPDessineFrise[1]{% + \ifluatex + \mplibforcehmode + \begin{mplibcode} + Longueur:=\useKV[ClesFrise]{Longueur}; + Ecart:=\useKV[ClesFrise]{Ecart}; + boolean Fleches; + Fleches=\useKV[ClesFrise]{Fleches}; + boolean Sup; + Sup=\useKV[ClesFrise]{Sup}; + pair A[],B; + A0=(0,0); + B-A0=(Longueur,0); + n=0; + for p_=#1: + n:=n+1; + endfor; + for k=1 upto ((n div 3)-2): + A[k]=(k/((n div 3)-1))[A0,B]; + endfor; + A[(n div 3)-1]=B; + if Sup: + for k=0 upto ((n div 3)-1): + trace (u*(0,-0.1)--u*(0,0.1)) shifted A[k]; + endfor; + % on définit les points milieu des fleches + path Fleche[]; + pair C[]; + for k=0 upto ((n div 3)-3): + Fleche[k]=(A[k]{dir-30}..{dir30}A[k+1]) shifted((0,-Ecart)); + C[k]=point (0.5*length Fleche[k]) of Fleche[k]; + endfor; + Fleche[(n div 3)-2]=%(A[(n div 3)-3]{dir-30}..{dir30}A[(n div 3)-1]) shifted((0,-Ecart)); + chemin(A[(n div 3)-3]+(0,-Ecart),A[(n div 3)-3]+(0,-4*Ecart),A[(n div 3)-1]+(0,-4*Ecart),A[(n div 3)-1]+(0,-Ecart)); + C[(n div 3)-1]=point (0.5*length Fleche[(n div 3)-2]) of Fleche[(n div 3)-2]; + Fleche[(n div 3)-1]=(A[(n div 3)-1]{dir-150}..{dir150}A[(n div 3)-2]) shifted((0,-Ecart)); + C[(n div 3)-2]=point (0.5*length Fleche[(n div 3)-1]) of Fleche[(n div 3)-1]; + % + maxx:=n; + trace segment(A0,A[(n div 3)-2]); + trace segment(A[(n div 3)-2],A[(n div 3)-1]) dashed evenly; + n:=0; + labeloffset:=labeloffset*2; + for p_=#1: + n:=n+1; + if n<maxx+1: + if (n mod 3)=1: + label.top(TEX(""&p_&""),A[n div 3]); + elseif (n mod 3)=2: + label.top(TEX(""&p_&""),C[n div 3]);% + elseif (n mod 3)=0: + label.bot(TEX(""&p_&""),C[(n div 3)-1]); + fi; + fi; + endfor; + drawoptions(); + labeloffset:=labeloffset/2; + if Fleches: + for k=0 upto ((n div 3)-4): + drawarrow Fleche[k]; + endfor; + drawarrow Fleche[(n div 3)-1]; + drawarrow Fleche[(n div 3)-2]; + drawarrow (A[(n div 3)-1]{dir-150}..{dir150}A[(n div 3)-2]) shifted((0,-Ecart)); + for k=0 upto ((n div 3)-2): + draw segment(A[k],A[k]+(0,-Ecart)) dashed evenly; + endfor; + draw segment(A[(n div 3)-1],A[(n div 3)-1]+(0,-Ecart)) dashed evenly; + fi; + %fin Sup + else: + for k=0 upto ((n div 3)-1): + trace (u*(0,-0.1)--u*(0,0.1)) shifted A[k]; + endfor; + % on définit les points milieu des fleches + path Fleche[]; + pair C[]; + for k=0 upto ((n div 3)-2): + Fleche[k]=(A[k]{dir-30}..{dir30}A[k+1]) shifted((0,-Ecart)); + C[k]=point (0.5*length Fleche[k]) of Fleche[k]; + endfor; + maxx:=n; + trace segment(A0,A[(n div 3)-1]); + n:=0; + labeloffset:=labeloffset*2; + for p_=#1: + n:=n+1; + if n<maxx: + if (n mod 3)=1: + label.top(TEX(""&p_&""),A[n div 3]); + elseif (n mod 3)=2: + if (n div 3)<((maxx div 3)-1):label.top(TEX(""&p_&""),C[n div 3]);fi; + elseif (n mod 3)=0: + label.bot(TEX(""&p_&""),C[(n div 3)-1]); + fi; + fi; + endfor; + labeloffset:=labeloffset/2; + if Fleches: + for k=0 upto ((n div 3)-2): + draw segment(A[k],A[k]+(0,-Ecart)) dashed evenly; + drawarrow Fleche[k]; + endfor; + draw segment(A[(n div 3)-1],A[(n div 3)-1]+(0,-Ecart)) dashed evenly; + fi; + fi; + \end{mplibcode} + \else + \begin{mpost}[mpsettings={% + Longueur:=\useKV[ClesFrise]{Longueur}; + Ecart:=\useKV[ClesFrise]{Ecart}; + boolean Fleches; + Fleches=\useKV[ClesFrise]{Fleches}; + boolean Sup; + Sup=\useKV[ClesFrise]{Sup}; + }] + pair A[],B; + A0=(0,0); + B-A0=(Longueur,0); + n=0; + for p_=#1: + n:=n+1; + endfor; + for k=1 upto ((n div 3)-2): + A[k]=(k/((n div 3)-1))[A0,B]; + endfor; + A[(n div 3)-1]=B; + if Sup: + for k=0 upto ((n div 3)-1): + trace (u*(0,-0.1)--u*(0,0.1)) shifted A[k]; + endfor; + % on définit les points milieu des fleches + path Fleche[]; + pair C[]; + for k=0 upto ((n div 3)-3): + Fleche[k]=(A[k]{dir-30}..{dir30}A[k+1]) shifted((0,-Ecart)); + C[k]=point (0.5*length Fleche[k]) of Fleche[k]; + endfor; + Fleche[(n div 3)-2]=%(A[(n div 3)-3]{dir-30}..{dir30}A[(n div 3)-1]) shifted((0,-Ecart)); + chemin(A[(n div 3)-3]+(0,-Ecart),A[(n div 3)-3]+(0,-4*Ecart),A[(n div 3)-1]+(0,-4*Ecart),A[(n div 3)-1]+(0,-Ecart)); + C[(n div 3)-1]=point (0.5*length Fleche[(n div 3)-2]) of Fleche[(n div 3)-2]; + Fleche[(n div 3)-1]=(A[(n div 3)-1]{dir-150}..{dir150}A[(n div 3)-2]) shifted((0,-Ecart)); + C[(n div 3)-2]=point (0.5*length Fleche[(n div 3)-1]) of Fleche[(n div 3)-1]; + % + maxx:=n; + trace segment(A0,A[(n div 3)-2]); + trace segment(A[(n div 3)-2],A[(n div 3)-1]) dashed evenly; + n:=0; + labeloffset:=labeloffset*2; + for p_=#1: + n:=n+1; + if n<maxx+1: + if (n mod 3)=1: + label.top(LATEX(""&p_&""),A[n div 3]); + elseif (n mod 3)=2: + label.top(LATEX(""&p_&""),C[n div 3]);% + elseif (n mod 3)=0: + label.bot(LATEX(""&p_&""),C[(n div 3)-1]); + fi; + fi; + endfor; + drawoptions(); + labeloffset:=labeloffset/2; + if Fleches: + for k=0 upto ((n div 3)-4): + drawarrow Fleche[k]; + endfor; + drawarrow Fleche[(n div 3)-1]; + drawarrow Fleche[(n div 3)-2]; + drawarrow (A[(n div 3)-1]{dir-150}..{dir150}A[(n div 3)-2]) shifted((0,-Ecart)); + for k=0 upto ((n div 3)-2): + draw segment(A[k],A[k]+(0,-Ecart)) dashed evenly; + endfor; + draw segment(A[(n div 3)-1],A[(n div 3)-1]+(0,-Ecart)) dashed evenly; + fi; + %fin Sup + else: + for k=0 upto ((n div 3)-1): + trace (u*(0,-0.1)--u*(0,0.1)) shifted A[k]; + endfor; + % on définit les points milieu des fleches + path Fleche[]; + pair C[]; + for k=0 upto ((n div 3)-2): + Fleche[k]=(A[k]{dir-30}..{dir30}A[k+1]) shifted((0,-Ecart)); + C[k]=point (0.5*length Fleche[k]) of Fleche[k]; + endfor; + maxx:=n; + trace segment(A0,A[(n div 3)-1]); + n:=0; + labeloffset:=labeloffset*2; + for p_=#1: + n:=n+1; + if n<maxx: + if (n mod 3)=1: + label.top(LATEX(""&p_&""),A[n div 3]); + elseif (n mod 3)=2: + if (n div 3)<((maxx div 3)-1):label.top(LATEX(""&p_&""),C[n div 3]);fi; + elseif (n mod 3)=0: + label.bot(LATEX(""&p_&""),C[(n div 3)-1]); + fi; + fi; + endfor; + labeloffset:=labeloffset/2; + if Fleches: + for k=0 upto ((n div 3)-2): + draw segment(A[k],A[k]+(0,-Ecart)) dashed evenly; + drawarrow Fleche[k]; + endfor; + draw segment(A[(n div 3)-1],A[(n div 3)-1]+(0,-Ecart)) dashed evenly; + fi; + fi; + \end{mpost} + \fi +} + +%%% % Geometrie %%% \setKVdefault[Geometrie]{CoinBG={(0,0)},CoinHD={(10u,10u)},TypeTrace="Instruments"}% @@ -404,7 +1116,7 @@ %%https://tex.stackexchange.com/questions/3695/smileys-in-latex/227226 \tikzset{face/.style={shape=circle,minimum size=4ex,shading=radial,outer sep=0pt, inner color=white!50!yellow,outer color= yellow!70!orange}} -\newcommand{\emoticon}[2][]{% +\newcommand\emoticon[2][]{% \scalebox{.5}{\begin{tikzpicture} \node[face,#1,draw,thick] (emoticon) {}; %% The eyes are fixed. @@ -413,7 +1125,7 @@ \end{tikzpicture}}% } -\newcommand{\pupils}{ +\newcommand\pupils{ %% standard pupils \fill[shift={(0.5ex,0.5ex)},rotate=80] (0,0) ellipse (0.3ex and 0.15ex); \fill[shift={(-0.5ex,0.5ex)},rotate=100] (0,0) ellipse (0.3ex and 0.15ex);} @@ -614,8 +1326,8 @@ \newcommand\MelangeListe[2]{% % #1 Liste à mélanger % #2 Nombre d'éléments à conserver - \setsepchar{,}\ignoreemptyitems - \readlist*\ListeInter{#1} + \setsepchar{,}\ignoreemptyitems% + \readlist*\ListeInter{#1}% \xdef\faa{}% Liste construite \xdef\fii{}% Liste détruite % on crée les #2 premieres solutions. @@ -1112,7 +1824,7 @@ \xdef\CountcolDeux{0}% \useKVdefault[ClesFicheMemo]% \setKV[ClesFicheMemo]{#1}% - \setsepchar[*]{§*/}% + \setsepchar[*]{§*/}\reademptyitems% \readlist*\ListeQuestionColonneUn{#2}% \readlist*\ListeQuestionColonneDeux{#3}% \renewcommand{\arraystretch}{1.35}% @@ -1123,35 +1835,36 @@ \tikz\draw[dashed,gray!50](2-|4.5) to (last-|4.5);% \Body% \Block{1-1}{\bfseries\useKV[ClesFicheMemo]{TexteReponses}}&&&\Block{1-1}{\bfseries\useKV[ClesFicheMemo]{TexteReponses}}\\ - \xintFor* ##4 in {\xintSeq {1}{\ListeQuestionColonneUnlen}}\do{% - \xintifboolexpr{\listlen\ListeQuestionColonneUn[##4]==2}{% + \xintFor* ##1 in {\xintSeq {1}{\ListeQuestionColonneUnlen}}\do{% + \xintifboolexpr{\listlen\ListeQuestionColonneUn[##1]==2}{% \uppercase{&}}{% - \Block[l]{\fpeval{\ListeQuestionColonneUn[##4,1]}-1}{\ifboolKV[ClesFicheMemo]{Solution}{\ListeQuestionColonneUn[##4,3]}{}}\uppercase{&}\xdef\CountcolUn{\fpeval{\CountcolUn+1}}\Block[l]{\fpeval{\ListeQuestionColonneUn[##4,1]}-1}{\ListeQuestionColonneUn[##4,2]}% + \Block[l]{\fpeval{\ListeQuestionColonneUn[##1,1]}-1}{\ifboolKV[ClesFicheMemo]{Solution}{\ListeQuestionColonneUn[##1,3]}{}}% + \uppercase{&}\xdef\CountcolUn{\fpeval{\CountcolUn+1}}\Block[l]{\fpeval{\ListeQuestionColonneUn[##1,1]}-1}{\ListeQuestionColonneUn[##1,2]}% }% &% - \xintifboolexpr{\listlen\ListeQuestionColonneDeux[##4]==2}{% + \xintifboolexpr{\listlen\ListeQuestionColonneDeux[##1]==2}{% \uppercase{&}% }{% - \xdef\CountcolDeux{\fpeval{\CountcolDeux+1}}\Block[l]{\fpeval{\ListeQuestionColonneDeux[##4,1]}-1}{\ListeQuestionColonneDeux[##4,2]}\uppercase{&}\Block[l]{\fpeval{\ListeQuestionColonneDeux[##4,1]}-1}{\ifboolKV[ClesFicheMemo]{Solution}{\ListeQuestionColonneDeux[##4,3]}{}}% + \xdef\CountcolDeux{\fpeval{\CountcolDeux+1}}\Block[l]{\fpeval{\ListeQuestionColonneDeux[##1,1]}-1}{\ListeQuestionColonneDeux[##1,2]}\uppercase{&}\Block[l]{\fpeval{\ListeQuestionColonneDeux[##1,1]}-1}{\ifboolKV[ClesFicheMemo]{Solution}{\ListeQuestionColonneDeux[##1,3]}{}}% }% \\% }% \CodeAfter% \tikz\node[xshift=0.5em] at (2-|1) {\scriptsize\faCut};% \xdef\PfCCountCutUn{2}% - \xintFor* ##4 in {\xintSeq {1}{\ListeQuestionColonneUnlen}}\do{% - \xintifboolexpr{\listlen\ListeQuestionColonneUn[##4]==2}{% + \xintFor* ##1 in {\xintSeq {1}{\ListeQuestionColonneUnlen}}\do{% + \xintifboolexpr{\listlen\ListeQuestionColonneUn[##1]==2}{% }{% - \xdef\PfCCountCutUn{\fpeval{\PfCCountCutUn+\ListeQuestionColonneUn[##4,1]}}% + \xdef\PfCCountCutUn{\fpeval{\PfCCountCutUn+\ListeQuestionColonneUn[##1,1]}}% \tikz\node[xshift=0.5em] at (\fpeval{\PfCCountCutUn}-|1) {\scriptsize\faCut};% }% }% \tikz\node[xshift=-0.5em] at (2-|last) {\scriptsize\rotatebox{180}{\faCut}};% \xdef\PfCCountCutDeux{2}% - \xintFor* ##4 in {\xintSeq {1}{\ListeQuestionColonneDeuxlen}}\do{% - \xintifboolexpr{\listlen\ListeQuestionColonneDeux[##4]==2}{% + \xintFor* ##1 in {\xintSeq {1}{\ListeQuestionColonneDeuxlen}}\do{% + \xintifboolexpr{\listlen\ListeQuestionColonneDeux[##1]==2}{% }{% - \xdef\PfCCountCutDeux{\fpeval{\PfCCountCutDeux+\ListeQuestionColonneDeux[##4,1]}}% + \xdef\PfCCountCutDeux{\fpeval{\PfCCountCutDeux+\ListeQuestionColonneDeux[##1,1]}}% \tikz\node[xshift=-0.5em] at (\fpeval{\PfCCountCutDeux}-|last) {\scriptsize\rotatebox{180}{\faCut}};% }% }% @@ -1163,6 +1876,7 @@ \tikz\node at (1.5-|3.5) {\bfseries\useKV[ClesFicheMemo]{TexteQuestions} \num{\fpeval{\CountcolUn+1}} à \num{\fpeval{\CountcolUn+\CountcolDeux}}};% \end{NiceTabular}% \renewcommand{\arraystretch}{1}% + \setsepchar{,}% }% %%% @@ -1170,9 +1884,9 @@ %%% %% D'après https://tex.stackexchange.com/questions/277246/drawing-a-circle-around-the-numbers-in-xlop-package -\newcommand{\PfCchiffre}[2]{\tikz[remember picture] \node[inner sep=0pt](#1){#2};} +\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, +\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)]{} ;} \newcounter{divxlop}% @@ -2097,6 +2811,7 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, \dtlexpandnewvalue% \DTLgnewdb{mtnumedb}% +\DTLgnewdb{mtRGTdb}% Pb de doublon avec mtdb de Mediane \newcommand\Rangement[2][]{% \useKVdefault[ClesRgt]% @@ -2111,48 +2826,48 @@ transform canvas={xshift=0em,yshift=0em}},rectangle,rounded corners,ultra thick, }% % On cr\'ee la liste des rangements. \DTLcleardb{mtnumedb}% - % on les trie pour les ranger par ordre croissant +% % on les trie pour les ranger par ordre croissant \foreachitem\x\in\ListeRgt{% \DTLnewrow{mtnumedb}% \xdef\toto{\fpeval{\ListeRgt[\xcnt,1]*\the\ppcm/\ListeRgt[\xcnt,2]}}% \DTLnewdbentry{mtnumedb}{numeric}{\toto}% }% - % On trie +% % On trie \ifboolKV[ClesRgt]{Decroissant}{% - % On trie la liste +% % On trie la liste \dtlsort{numeric=descending}{mtnumedb}{\dtlicompare}% \ifboolKV[ClesRgt]{Details}{\ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=numeric}{\frac{\num{\numeroDonnee}}{\num{\the\ppcm}}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}}{% \ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=numeric}{\Simplification{\numeroDonnee}{\ppcm}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}% } }{% - % On trie la liste +% % On trie la liste \dtlsort{numeric}{mtnumedb}{\dtlicompare}% \ifboolKV[ClesRgt]{Details}{% \ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=numeric}{\frac{\num{\numeroDonnee}}{\num{\the\ppcm}}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}% }{% \ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=numeric}{\Simplification{\numeroDonnee}{\ppcm}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}% - } + }% }% }{% \setsepchar{,}\ignoreemptyitems% \readlist*\ListeRgt{#2}% % on cr\'ee la base de donn\'ees des valeurs - \DTLcleardb{mtdb}% - % on les trie pour les ranger par ordre croissant + \DTLcleardb{mtRGTdb}% +% % on les trie pour les ranger par ordre croissant \foreachitem\x\in\ListeRgt{% - \DTLnewrow{mtdb}% + \DTLnewrow{mtRGTdb}% \itemtomacro\ListeRgt[\xcnt]\y% - \DTLnewdbentry{mtdb}{numeric}{\y}% + \DTLnewdbentry{mtRGTdb}{numeric}{\y}% }% - % +% % \ifboolKV[ClesRgt]{Decroissant}{% % On trie la liste - \dtlsort{numeric=descending}{mtdb}{\dtlicompare}% - \ensuremath{\DTLforeach{mtdb}{\numeroDonnee=numeric}{\num{\numeroDonnee}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}% + \dtlsort{numeric=descending}{mtRGTdb}{\dtlicompare}% + \ensuremath{\DTLforeach{mtRGTdb}{\numeroDonnee=numeric}{\num{\numeroDonnee}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}% }{% - % On trie la liste - \dtlsort{numeric}{mtdb}{\dtlicompare}% - \ensuremath{\DTLforeach{mtdb}{\numeroDonnee=numeric}{\num{\numeroDonnee}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}% +% % On trie la liste + \dtlsort{numeric}{mtRGTdb}{\dtlicompare}% + \ensuremath{\DTLforeach{mtRGTdb}{\numeroDonnee=numeric}{\num{\numeroDonnee}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}% }% }% }% @@ -3771,7 +4486,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \foreach \i in {1,...,3}{% \coordinate[xshift=\i*0.25*\paperwidth] (A\i) at (current page.north west);% \coordinate[xshift=\i*0.25*\paperwidth] (B\i) at (current page.south west);% - } + }% \foreach \i in{1,...,4}{% \coordinate[yshift=-\i*0.25*\paperheight] (C\i) at (current page.north west);% \coordinate[yshift=-\i*0.25*\paperheight] (F\i) at (current page.north east);% @@ -3894,10 +4609,10 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V3)!0.5!(V4)$) {\ListeAutoEn[2,1]};% \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V5)!0.5!(V6)$) {\ListeAutoEn[3,1]};% \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(V7)!0.5!(V8)$) {\ListeAutoEn[4,1]};% - \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R1)!0.5!(R2)$) {\ListeAutoQ[1,2]};% - \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R3)!0.5!(R4)$) {\ListeAutoQ[2,2]};% - \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R5)!0.5!(R6)$) {\ListeAutoQ[3,2]};% - \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R7)!0.5!(R8)$) {\ListeAutoQ[4,2]};% + \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R1)!0.5!(R2)$) {\ListeAutoQ[1,2]};%% + \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R3)!0.5!(R4)$) {\ListeAutoQ[2,2]};%% + \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R5)!0.5!(R6)$) {\ListeAutoQ[3,2]};%% + \node[align=justify,anchor=center,text width=0.9*0.25\textwidth] at ($(R7)!0.5!(R8)$) {\ListeAutoQ[4,2]};%% }{% \foreach \i in {1,...,8}{% \node[text width=0.9*0.25\paperwidth] at (V\i) {\ListeAutoQ[\i,2]};% @@ -5982,7 +6697,16 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. cc=fullcircle scaled 1u; % on marque les angles picture MAngle; - MAngle=image( + MAngle=image(% + if #6=0:%Pour l'isocèle + path cd; pair M[]; + cd=B--(A+B+C)/3; + M1=cd intersectionpoint (cc shifted B); + trace 9/10[B,M1]--11/10[B,M1]; + cd:=C--(A+B+C)/3; + M1:=cd intersectionpoint (cc shifted C); + trace 9/10[C,M1]--11/10[C,M1]; + fi; draw (cc shifted A); draw (cc shifted B); draw (cc shifted C); @@ -6490,9 +7214,11 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \xintifboolexpr{#3<#4 || #3==#4}{ \xdef\PetitCote{#3}% \xdef\MoyenCote{#4}% + \xdef\GrandCote{}% }{% \xdef\GrandCote{#3}% \xdef\MoyenCote{#4}% + \xdef\PetitCote{}% Pour la personnalisation } % On retient les noms des sommets \StrMid{#2}{1}{1}[\NomA]% @@ -6613,13 +7339,13 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. % Distributivit\'e %%% % https://tex.stackexchange.com/questions/168972/draw-arrows-to-show-multiplication-pattern-distributive-property/169278?noredirect=1 -\newcommand{\Tikzmark}[1]{% +\newcommand\Tikzmark[1]{% \tikz[remember picture,baseline,inner sep=0pt]{% \node[name=Distri-\theNbDistri,anchor=base] {${#1}$};}% \stepcounter{NbDistri}% }% -\newcommand{\DrawArrow}{% +\newcommand\DrawArrow{% \begin{tikzpicture}[overlay,remember picture] \draw[-stealth,out=50,in=140,DCFlechesh,transform canvas={yshift=2pt}] (Distri-0.north) to (Distri-2.north); \draw[-stealth,out=50,in=140,DCFlechesh!50,transform canvas={yshift=2pt}] (Distri-0.north) to (Distri-3.north); @@ -7016,7 +7742,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \xdef\SommeB{0}% \xdef\SommeC{0}% -\newcommand{\Distri}[5][]{% +\newcommand\Distri[5][]{% \useKVdefault[ClesDistributivite]%obligatoire car la macro n'est pas dans un groupe. \setKV[ClesDistributivite]{#1}%On lit les arguments optionnels \ifboolKV[ClesDistributivite]{RAZ}{\xdef\SommeA{0}\xdef\SommeB{0}\xdef\SommeC{0}% @@ -7292,7 +8018,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. }% }% -\newcommand{\DistriEchange}[5][]{% +\newcommand\DistriEchange[5][]{% \ensuremath{% \useKVdefault[ClesDistributivite]%obligatoire car la macro n'est pas dans un groupe. \setKV[ClesDistributivite]{#1}%On lit les arguments optionnels @@ -8529,7 +9255,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. } -\newcommand{\SSimpli}[2]{% +\newcommand\SSimpli[2]{% % D\'ecomposition d'une simplification de #1/#2 \newcount\numerateur\newcount\denominateur\newcount\valabsnum\newcount\valabsdeno% \numerateur=\number#1 @@ -9092,7 +9818,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. \newcommand\EcritureQuotients{}% %%% -\newcommand{\TTThales}[6][]{% +\newcommand\TTThales[6][]{% \useKVdefault[ClesThales]% \setKV[ClesThales]{#1}% \ifboolKV[ClesThales]{Perso}{\RedactionThales}{% @@ -9121,7 +9847,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. }% }% -\newcommand{\TThalesCalculsD}[8][]{% +\newcommand\TThalesCalculsD[8][]{% \setKV[ClesThales]{#1}% \newcount\zzz\newcount\yyy\newcount\xxx%Pour se rappeller des calculs \`a faire et combien en faire% \def\Nomx{}% @@ -9359,7 +10085,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. }{} } -\newcommand{\TThalesCalculsE}[8][]{% +\newcommand\TThalesCalculsE[8][]{% \setKV[ClesThales]{#1}% \newcount\zzz\newcount\yyy\newcount\xxx%Pour se rappeller des calculs \`a faire et combien en faire% \newcount\valx\newcount\Valx% @@ -9682,7 +10408,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. }{}% } -\newcommand{\TThales}[8][]{% +\newcommand\TThales[8][]{% \setKV[ClesThales]{#1}% \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]% \ifboolKV[ClesThales]{FigureSeule}{% @@ -9733,7 +10459,7 @@ couleur indiquée, le nombre de cases donné par le résultat du calcul. } } -\newcommand{\ReciThalesCalculs}[8][]{% +\newcommand\ReciThalesCalculs[8][]{% \StrMid{#2}{1}{1}[\NomA]% \StrMid{#2}{2}{2}[\NomB]% \StrMid{#2}{3}{3}[\NomC]% @@ -10587,7 +11313,7 @@ Rayon=3cm,AffichageAngle=false,AffichageDonnee=false,ListeCouleurs={white},Hachu %Pour les représentations Representation=false,% %Pour les barres horizontales -Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% +Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dispo } %compl\'ements \defKV[ClesStat]{AngleRotationAbscisse=\setKV[ClesStat]{AbscisseRotation}}% @@ -10705,8 +11431,8 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% \xdef\PfCfooStat{\PfCfooStat \ListeComplete[##1,2],}% }% \xdef\DivMax{\fpeval{max(\PfCfooStat)}}% - \xdef\DivMax{\fpeval{round(ln(\DivMax)/ln(10))}}% - \xdef\DivMax{\fpeval{10**\DivMax}}% + \xdef\ExposantDivMax{\fpeval{round(ln(\DivMax)/ln(10))}}% + \xdef\DivMax{\fpeval{10**\ExposantDivMax}}% \xdef\PfCfooStat{}% \xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{% \xdef\PfCfooStat{\PfCfooStat \ListeComplete[##1,1]/\ListeComplete[##1,2]/\fpeval{\ListeComplete[##1,2]/\DivMax},}% @@ -10799,17 +11525,25 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% % #2 Liste des valeurs associées % #3 Liste des valeurs à afficher (si pb calcul MP) % #4 Liste des couleurs - \ifluatex + \ifluatex% \mplibforcehmode% \begin{mplibcode}% Longueur:=\useKV[ClesStat]{Longueur}; Hauteur:=\useKV[ClesStat]{Hauteur}; + Ecart:=\useKV[ClesStat]{EcartBarre}; + ExposantDivMax:=\ExposantDivMax; ecarthachures=\useKV[ClesStat]{EcartHachures}; epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures}; boolean Hachures; Hachures=\useKV[ClesStat]{Hachures}; boolean Bicolore; Bicolore=\useKV[ClesStat]{Bicolore}; + boolean Grille; + Grille=\useKV[ClesStat]{Grille}; + boolean AffichageDonnee; + AffichageDonnee=\useKV[ClesStat]{AffichageDonnee}; + boolean LegendeVide; + LegendeVide=\useKV[ClesStat]{LegendeVide}; vardef CalculNombreDonneesEtDonneeMax(text t)= nbdon:=0;%nombre de données DonneeMax:=0;%donnée DonneeMaximale @@ -10836,10 +11570,40 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% endfor; enddef; vardef TraceDiag= + if Grille: + pair Zz[];%Pour déterminer "le dernier point" + Zz0=(0,-(nbdon-1)*(Hauteur+Ecart)-Ecart); + Zz2=(0,(Hauteur+Ecart)); + Zz1=((1/DonneeMax)*Longueur,-(nbdon-1)*(Hauteur+Ecart)-Ecart); + Zz3=if ExposantDivMax=0 : (DonneeMax+1)[Zz0,Zz1] else: ((floor(DonneeMax*10+2))/10)[Zz0,Zz1];fi; + if ExposantDivMax=0: + for k=1 upto DonneeMax+1: + trace (Zz0--Zz2) shifted (k*(Zz1-Zz0)) dashed evenly withcolor 0.5white; + endfor; + else: + for k=1 upto (floor(DonneeMax*10+2)): + trace (Zz0--Zz2) shifted ((k/10)*(Zz1-Zz0)) dashed evenly withcolor 0.5white; + endfor; + fi; + if ExposantDivMax=0: + for k=1 upto (DonneeMax+1): + label.bot(TEX("\num{"&decimal(k)&"}"),Zz0+k*(Zz1-Zz0)); + endfor; + else: + if ExposantDivMax<5: + for k=1 upto (floor(DonneeMax*10+2)): + label.bot(TEX("\num{\fpeval{"&decimal(k)&"*(10**"&decimal(ExposantDivMax-1)&")}}"),Zz0+(k/10)*(Zz1-Zz0)); + endfor; + else: + dotlabel.bot(TEX("\num{\fpeval{10**"&decimal(ExposantDivMax)&"}}"),Zz1); + fi; + fi; + fi; for k=0 upto nbdon-1: path RectangleDonnee; - RectangleDonnee=(unitsquare xscaled ((Donnees[k+1]/DonneeMax)*Longueur) yscaled Hauteur) shifted(0,-k*Hauteur); + RectangleDonnee=(unitsquare xscaled ((Donnees[k+1]/DonneeMax)*Longueur) yscaled Hauteur) shifted(0,-k*(Hauteur+Ecart)); if Hachures: + fill RectangleDonnee withcolor white; trace Hachurage(RectangleDonnee,60 if (k mod 2)=0: +90 fi,ecarthachures,if (k mod 2)=0 : 0 else: 1 fi) withpen pencircle scaled epaisseurhachures; @@ -10848,18 +11612,22 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% fi; trace RectangleDonnee; endfor; + if Grille: + drawarrow (0,-(nbdon-1)*(Hauteur+Ecart)-Ecart)--(0,(Hauteur+Ecart)) withpen pencircle scaled 1.5; + drawarrow (0,-(nbdon-1)*(Hauteur+Ecart)-Ecart)--(Zz3+u*(0.25,0)) withpen pencircle scaled 1.5; + fi; enddef; vardef AffichageNom(text t)= k:=0; for p_=t: - label.lft(TEX(p_),0.5[(0,0),(0,Hauteur)] shifted (0,-k*Hauteur)); + label.lft(TEX(p_),0.5[(0,0),(0,Hauteur)] shifted (0,-k*(Hauteur+Ecart))); k:=k+1; endfor; enddef; vardef AffichageDonnees(text t)= k:=0; for p_=t: - label.rt(TEX("\num{"&p_&"}"),0.5[(0,0),(0,Hauteur)] shifted (((Donnees[k+1]/DonneeMax)*Longueur),-k*Hauteur)); + label.rt(TEX("\num{"&p_&"}"),0.5[(0,0),(0,Hauteur)] shifted (((Donnees[k+1]/DonneeMax)*Longueur),-k*(Hauteur+Ecart))); k:=k+1; endfor; enddef; @@ -10867,21 +11635,33 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% ListeDonnees(#2); RecuperationCouleurs(#4); TraceDiag; + if LegendeVide=false: AffichageNom(#1); + fi; + if AffichageDonnee: AffichageDonnees(#3); + fi; \end{mplibcode} - \else + \else% \begin{mpost}[mpsettings={% - Longueur:=\useKV[ClesStat]{Longueur}; - Hauteur:=\useKV[ClesStat]{Hauteur}; - ecarthachures=\useKV[ClesStat]{EcartHachures}; - epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures}; - boolean Hachures; - Hachures=\useKV[ClesStat]{Hachures}; - boolean Bicolore; - Bicolore=\useKV[ClesStat]{Bicolore}; - }] - vardef CalculNombreDonneesEtDonneeMax(text t)= + Longueur:=\useKV[ClesStat]{Longueur}; + Hauteur:=\useKV[ClesStat]{Hauteur}; + Ecart:=\useKV[ClesStat]{EcartBarre}; + ExposantDivMax:=\ExposantDivMax; + ecarthachures=\useKV[ClesStat]{EcartHachures}; + epaisseurhachures=\useKV[ClesStat]{EpaisseurHachures}; + boolean Hachures; + Hachures=\useKV[ClesStat]{Hachures}; + boolean Bicolore; + Bicolore=\useKV[ClesStat]{Bicolore}; + boolean Grille; + Grille=\useKV[ClesStat]{Grille}; + boolean AffichageDonnee; + AffichageDonnee=\useKV[ClesStat]{AffichageDonnee}; + boolean LegendeVide; + LegendeVide=\useKV[ClesStat]{LegendeVide}; + }] + vardef CalculNombreDonneesEtDonneeMax(text t)= nbdon:=0;%nombre de données DonneeMax:=0;%donnée DonneeMaximale for p_=t: @@ -10907,10 +11687,40 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% endfor; enddef; vardef TraceDiag= + if Grille: + pair Zz[];%Pour déterminer "le dernier point" + Zz0=(0,-(nbdon-1)*(Hauteur+Ecart)-Ecart); + Zz2=(0,(Hauteur+Ecart)); + Zz1=((1/DonneeMax)*Longueur,-(nbdon-1)*(Hauteur+Ecart)-Ecart); + Zz3=if ExposantDivMax=0 : (DonneeMax+1)[Zz0,Zz1] else: ((floor(DonneeMax*10+2))/10)[Zz0,Zz1];fi; + if ExposantDivMax=0: + for k=1 upto DonneeMax+1: + trace (Zz0--Zz2) shifted (k*(Zz1-Zz0)) dashed evenly withcolor 0.5white; + endfor; + else: + for k=1 upto (floor(DonneeMax*10+2)): + trace (Zz0--Zz2) shifted ((k/10)*(Zz1-Zz0)) dashed evenly withcolor 0.5white; + endfor; + fi; + if ExposantDivMax=0: + for k=1 upto (DonneeMax+1): + label.bot(TEX("\num{"&decimal(k)&"}"),Zz0+k*(Zz1-Zz0)); + endfor; + else: + if ExposantDivMax<5: + for k=1 upto (floor(DonneeMax*10+2)): + label.bot(TEX("\num{\noexpand\fpeval{"&decimal(k)&"*(10**"&decimal(ExposantDivMax-1)&")}}"),Zz0+(k/10)*(Zz1-Zz0)); + endfor; + else: + dotlabel.bot(TEX("\num{\noexpand\fpeval{10**"&decimal(ExposantDivMax)&"}}"),Zz1); + fi; + fi; + fi; for k=0 upto nbdon-1: path RectangleDonnee; - RectangleDonnee=(unitsquare xscaled ((Donnees[k+1]/DonneeMax)*Longueur) yscaled Hauteur) shifted(0,-k*Hauteur); + RectangleDonnee=(unitsquare xscaled ((Donnees[k+1]/DonneeMax)*Longueur) yscaled Hauteur) shifted(0,-k*(Hauteur+Ecart)); if Hachures: + fill RectangleDonnee withcolor white; trace Hachurage(RectangleDonnee,60 if (k mod 2)=0: +90 fi,ecarthachures,if (k mod 2)=0 : 0 else: 1 fi) withpen pencircle scaled epaisseurhachures; @@ -10919,18 +11729,22 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% fi; trace RectangleDonnee; endfor; + if Grille: + drawarrow (0,-(nbdon-1)*(Hauteur+Ecart)-Ecart)--(0,(Hauteur+Ecart)) withpen pencircle scaled 1.5; + drawarrow (0,-(nbdon-1)*(Hauteur+Ecart)-Ecart)--(Zz3+u*(0.25,0)) withpen pencircle scaled 1.5; + fi; enddef; vardef AffichageNom(text t)= k:=0; for p_=t: - label.lft(LATEX(p_),0.5[(0,0),(0,Hauteur)] shifted (0,-k*Hauteur)); + label.lft(TEX(p_),0.5[(0,0),(0,Hauteur)] shifted (0,-k*(Hauteur+Ecart))); k:=k+1; endfor; enddef; vardef AffichageDonnees(text t)= k:=0; for p_=t: - label.rt(LATEX("\num{"&p_&"}"),0.5[(0,0),(0,Hauteur)] shifted (((Donnees[k+1]/DonneeMax)*Longueur),-k*Hauteur)); + label.rt(TEX("\num{"&p_&"}"),0.5[(0,0),(0,Hauteur)] shifted (((Donnees[k+1]/DonneeMax)*Longueur),-k*(Hauteur+Ecart))); k:=k+1; endfor; enddef; @@ -10938,10 +11752,14 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% ListeDonnees(#2); RecuperationCouleurs(#4); TraceDiag; + if LegendeVide=false: AffichageNom(#1); + fi; + if AffichageDonnee: AffichageDonnees(#3); + fi; \end{mpost} - \fi + \fi% }% % la construction du graphique en bâtons pour quantitatif @@ -12446,7 +13264,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% %Une simplification de a/b est possible ou non ? \newboolean{Simplification} -\newcommand{\SSimpliTest}[2]{% +\newcommand\SSimpliTest[2]{% % Test d'une simplification possible ou pas de #1/#2 \newcount\numerateur\newcount\denominateur\newcount\valabsnum\newcount\valabsdeno% \numerateur=\number#1 @@ -13258,13 +14076,13 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% \end{tabular}% }% -\newcommand{\TikzRH}{% +\newcommand\TikzRH{% \tikz[remember picture,overlay]{% \coordinate[name=ProporH-\theNbPropor,yshift=\getstrut\ht*\arraystretch];}% \stepcounter{NbPropor}% }% - \newcommand{\TikzRB}{% + \newcommand\TikzRB{% \tikz[remember picture, overlay]{% \coordinate[name=ProporB-\theNbPropor,yshift=-\getstrut\dp*\arraystretch];}% \stepcounter{NbPropor}% @@ -13490,7 +14308,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% \def\MPFigureDroite#1#2{% \ifluatex - \mplibcodeinherit{enable} + %\mplibcodeinherit{enable} \mplibforcehmode \begin{mplibcode} pair A,B,C,D,E,F,G,H,I,J,K; @@ -13574,7 +14392,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% reste:=reste rotatedabout(u*(3,3),-90+uniformdeviate(180)); draw reste; \end{mplibcode} - \mplibcodeinherit{disable} + %\mplibcodeinherit{disable} \else \begin{mpost} pair A,B,C,D,E,F,G,H,I,J,K; @@ -17687,7 +18505,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% 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)); + pointe(unitp*(valeur[n],0)); fi; endfor; elseif AffichageCoord=2: @@ -17700,7 +18518,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% else: label.bot(TEX("\footnotesize\num{\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: @@ -18218,58 +19036,59 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false% %D'apres https://tex.stackexchange.com/questions/38905/time-of-the-day-or-time-period-using-the-package-siunitx \ExplSyntaxOn \NewDocumentCommand \Temps { o > { \SplitArgument { 5 } { ; } } m } -{ - \group_begin: - \IfNoValueF {#1} +{% + \group_begin:% + \IfNoValueF{#1} { \keys_set:nn { siunitx } {#1} } \siunitx_hms_output:nnn #2 \group_end: } \cs_new_protected:Npn \siunitx_hms_output:nnn #1#2#3#4#5#6 -{ - \IfNoValueF {#1} - { - \tl_if_blank:nF {#1} - { - \SI {#1} { \annee\xintifboolexpr{#1>1}{s}{} } - \IfNoValueF {#2} { ~ } - } - } - \IfNoValueF {#2} - { - \tl_if_blank:nF {#2} - { - \SI {#2} { \mois } - \IfNoValueF {#3} { ~ } - } - } - \IfNoValueF {#3} - { - \tl_if_blank:nF {#3} - { - \SI {#3} { \jour } - \IfNoValueF {#4} { ~ } - } - } - \IfNoValueF {#4} - { - \tl_if_blank:nF {#4} - { - \SI {#4} { \hour } - \IfNoValueF {#5} { ~ } - } - } - \IfNoValueF {#5} - { - \tl_if_blank:nF {#5} - { - \SI {#5} { \minute } - \IfNoValueF {#6} { ~ } - } - } - \IfNoValueF {#6} - { \tl_if_blank:nF {#6} { \SI {#6} { \second } } } -} +{% + \IfNoValueF {#1}% + {% + \tl_if_blank:nF {#1}% + {% + \SI{#1}{\annee\xintifboolexpr{#1>1}{s}{}}% + \IfNoValueF {#2}{~}% + }% + }% + \IfNoValueF {#2}% + {% + \tl_if_blank:nF {#2}% + {% + \SI{#2}{\mois}% + \IfNoValueF{#3}{~}% + }% + }% + \IfNoValueF {#3}% + {% + \tl_if_blank:nF {#3}% + {% + \SI{#3}{\jour}% + \IfNoValueF{#4}{~}% + }% + }% + \IfNoValueF {#4}% + {% + \tl_if_blank:nF {#4}% + {% + \SI{#4}{\hour}% + \IfNoValueF{#5}{~}% + }% + }% + \IfNoValueF {#5}% + {% + \tl_if_blank:nF {#5}% + {% + \SI[minimum-integer-digits=2]{#5}{\minute}% + \IfNoValueF{#6}{~}% + }% + }% + \IfNoValueF {#6}% + {% + \tl_if_blank:nF {#6} {\SI{#6}{\second}}}% +}% \ExplSyntaxOff \newcommand\Temp[2][]{% diff --git a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp index 3386a78680..02a3f66ce2 100644 --- a/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp +++ b/macros/latex/contrib/profcollege/metapost/PfCGeometrie.mp @@ -1276,4 +1276,240 @@ vardef Tetraedrer(text t)= tetrar enddef; +%Outils +numeric echelleequerre; +echelleequerre=2; +vardef equerre(expr dte,drte,perpe,sens)= + save picequerre; + picture picequerre; + pair ww,t[]; + path intermede; + pair perpen,ptt,pttt; + perpen:=projection(perpe,dte,drte); + %if sens=1 : + ptt:=longueurequerre*(drte-dte) rotated 90 shifted perpen; + %else : +% ptt:=longueurequerre*(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))]); + pttt=intermede intersectionpoint (10[dte,drte]--10[drte,dte]); + picequerre=image( + draw perpen--ptt--pttt--cycle; + draw codeperp(ptt,perpen,pttt,5); + ); + picequerre +enddef; + + vardef regle(expr depart,arrivee,rr)= + save picregle; + picture picregle,grad[],gradu[],final; + pair t[]; + path reduit; + t1000=depart shifted (5*unitvector(depart-arrivee)); + t1003=arrivee shifted (20*unitvector(arrivee-depart)); + t1004=(unitvector(arrivee-depart) rotated (-90)) shifted t1000; + t1001=t1000 shifted (50*(t1004-t1000)); + t1002=t1001 shifted (t1003-t1000); + reduit=t1000--t1001--t1002..(t1002 shifted(5*unitvector(t1001-t1002)+1/4(t1003-t1002)))..(t1002 shifted(5*unitvector(t1002-t1001)+2/4(t1003-t1002)))..(t1002 shifted(5*unitvector(t1001-t1002)+3/4(t1003-t1002)))..t1003--cycle; + gradu1=image( + for k=0 upto 59: + for j=1 upto 4: + t[5*k+j]=depart shifted (1mm*(5*k+j)*unitvector(arrivee-depart)); + t[400+5*k+j]=t[5*k+j] shifted (2*(t1004-t1000)); + draw t[5*k+j]--t[400+5*k+j]; + endfor; + endfor + ); + gradu2=image( + for k=0 upto 29: + t[5*(2*k+1)]=depart shifted (1mm*5*(2*k+1)*unitvector(arrivee-depart)); + t[400+5*(2*k+1)]=t[5*(2*k+1)] shifted (5*(t1004-t1000)); + draw t[5*(2*k+1)]--t[400+5*(2*k+1)]; + endfor + ); + gradu3=image( + for k=0 upto 30: + t[10*k]=depart shifted(1mm*10*k*unitvector(arrivee-depart)); + t[400+10*k]=t[10*k] shifted (10*(t1004-t1000)); + draw t[10*k]--t[400+10*k]; + endfor + ); + for j=0 upto 30: + grad[j]=image( + label.bot(TEX(""&decimal(j)&""),t[400+10*j]); + %affixe[j](t[400+10*j])s; + currentpicture:=currentpicture rotatedabout(t[400+10*j],90+angle(t[400+10*j]-t[10*j])); + ); + endfor + final=image( + for k=0 upto 30: + draw grad[k]; + endfor + for k=1 upto 3: + draw gradu[k]; + endfor + clip currentpicture to reduit; + draw reduit; + ); + if rr=-1: + picregle=image( + draw final rotatedabout(1/2[depart,arrivee],180); + ); + else: + picregle=image( + draw final; + ); + fi + picregle +enddef; + +vardef crayon(expr depart,arrive,ptplace,nbechelle)= + save piccray; + picture piccray,crayolat; + pair w[]; + w0=(0,0); + w1=(1,2)*u/2; + w2=(-1,2)*u/2; + w3=(0,2)*u/2; + w4=(0,7)*u/2; + path ccc,ccd; + ccc=cercles(w0,abs(w3-w2)); + ccd=ccc yscaled 0.25 shifted w3; + crayolat=image( + draw subpath((length ccd)/2,length ccd) of ccd; + draw ccd shifted (w4-w3); + draw w2--w0--w1; + draw w1--((1,7)*u/2); + draw w2--((-1,7)*u/2); + ); + crayolat:=crayolat scaled nbechelle; + piccray=(crayolat rotated(angle(arrive-depart)-30)) shifted ptplace; + piccray +enddef; + +boolean Simple; +Simple=false; + +vardef rapporteur(expr centre,segment,rr)= + save raps; + picture raps; + raps=image( + Simple:=true; + trace rapporteurdouble(centre,segment,rr); + Simple:=false; + ); + raps +enddef; + +vardef rapporteurdouble(expr centre,segment,rr)= + save rap,cc,cd,v,w,t,ww,vv; + picture rap; + path cc,cd; + pair a[],b[],v,w,t,ww,vv,rap[],rapp[]; + cc=cercle(centre,0.75*abs(centre-segment)); + t=cc intersectionpoint (centre--segment); + w=t-2*unitvector(segment-centre);v=symetrie(w,t); + ww=t-5*unitvector(segment-centre);vv=symetrie(ww,t); + a0=(ww-centre) shifted centre; + b0=(vv-centre) shifted centre; + for i=0 upto 35 : + for j=1 upto 4 : + a[5*i+j]=(w-centre) rotated (rr*(5*i+j)) shifted centre; + b[5*i+j]=(v-centre) rotated (rr*(5*i+j)) shifted centre; + endfor; + a[5*(i+1)]=(ww-centre) rotated (rr*(5*(i+1))) shifted centre; + b[5*(i+1)]=(vv-centre) rotated (rr*(5*(i+1))) shifted centre; + endfor + picture nomb[],nombre[]; + if rr=1: + for j=0 upto 18: + nombre[10*j]=image( + label.bot(TEX("\fontsize{4}{4}\selectfont"&decimal(10*j)&""),a[10*j]); + currentpicture:=currentpicture rotatedabout(a[10*j],angle(a[10*j]-centre)-90); + ); + endfor + for j=0 upto 18: + nombre[10*j+1]=image( + % affixe.[180-10*j](b[10*j])n; + label.top(TEX("\fontsize{4}{4}\selectfont"&decimal(180-10*j)&""),b[10*j]); + currentpicture:=currentpicture rotatedabout(b[10*j],angle(b[10*j]-centre)-90); + ); + endfor + else: + for j=0 upto 18: + nombre[10*j]=image( + label.bot(TEX("\fontsize{4}{4}\selectfont"&decimal(180-10*j)&""),a[10*j]); + currentpicture:=currentpicture rotatedabout(a[10*j],angle(a[10*j]-centre)-90); + ); + endfor + for j=18 downto 0: + nombre[10*j+1]=image( + % affixe.[10*j](b[10*j])n; + label.top(TEX("\fontsize{4}{4}\selectfont"&decimal(10*j)&""),b[10*j]); + currentpicture:=currentpicture rotatedabout(b[10*j],angle(b[10*j]-centre)-90); + ); + endfor + fi + rap=image( + for i=0 upto 18 : + draw nombre[10*i+1]; + if Simple=false: + draw nombre[10*i]; + fi; + endfor; + path cerc; + cerc=subpath((angle(segment-centre)*(length cc))/360,((length cc)/2)+(angle(segment-centre)*(length cc))/360) of cc; + if rr=-1: + draw cerc reflectedabout(segment,centre); + else: + draw cerc; + fi + draw a0--b0 withpen pencircle scaled 1.25bp; + for i=0 upto 35 : + for j=1 upto 4 : + draw a[5*i+j]--b[5*i+j]; + endfor; + endfor; + for i=1 step 2 until 35: + draw a[5*i]--b[5*i]; + endfor; + for i=1 upto 18: + draw a[10*i]--b[10i] withpen pencircle scaled 1.25; + endfor; + draw a0--a180; + path cent; + cent=cercle(centre,0.05*u); + fill cent withcolor if unknown fillrap: 0.9white else: fillrap fi; + ); + rap +enddef; + +vardef compas(expr centre,extre,n)= + save piccompas; + picture piccompas; + pair r,s,t,a,b,c,d,e,f; + if (abs(centre-extre)<10*u): + r=((extre-1/2[centre,extre]) rotated (n*90)) shifted (1/2[centre,extre]); + else: + r=0.25[1/2[centre,extre],((extre-1/2[centre,extre]) rotated (n*90)) shifted (1/2[centre,extre])]; + fi + s=(1+50/abs(centre-extre))[1/2[centre,extre],r]; + t=10*unitvector(extre-centre) rotated (n*90); + a=centre shifted t; + b=s shifted (5*unitvector(centre-extre)+10*unitvector(s-r)); + c=b shifted (30*unitvector(s-r)); + d=c reflectedabout(r,s); + e=b reflectedabout(r,s); + f=a reflectedabout(r,s); + path comp; + comp=a--b--c--d--e--f--s--a--cycle; + piccompas=image( + fill comp withcolor black; + draw centre--a withpen pencircle scaled 1.5bp; + draw f--extre withpen pencircle scaled 1.5bp withcolor 0.25[red,blue]; + ); + piccompas +enddef; + endinput; diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp index c3a41e3eb4..d8b2a0a851 100644 --- a/macros/latex/contrib/profcollege/metapost/PfCScratch.mp +++ b/macros/latex/contrib/profcollege/metapost/PfCScratch.mp @@ -122,7 +122,7 @@ vardef OvalVar(expr ar)= save Ovar; picture Ovar; save TAvar; path TAvar; string TTv; - TTv=ar&"\barre"; + TTv="\barre\bfseries "&ar;% TAvar=OvalBox(TTv); Ovar=image( fill TAvar if print=false : withcolor OrangeTrois else : withcolor white fi; |