From 809279687ad6a85c7a45c9a469725248da509220 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Tue, 2 May 2023 03:04:36 +0000
Subject: CTAN sync 202305020304

---
 .../profcollege/latex/PfCRappelsFormules.tex       | 56 ++++++++++------------
 1 file changed, 25 insertions(+), 31 deletions(-)

(limited to 'macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex')

diff --git a/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex b/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex
index 2c22e2b45a..c2a4d95954 100644
--- a/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex
+++ b/macros/latex/contrib/profcollege/latex/PfCRappelsFormules.tex
@@ -3,43 +3,37 @@
 %%%
 \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\MPFigureCarreCode{%
+  u:=\useKV[ClesFormule]{Echelle};
+  vardef FigCarre=
+  drawoptions(dashed dashpattern(on1cm));
+  pair A,B,C,D;
+  A=u*(1,1);
+  B-A=u*(2,0);
+  C=rotation(A,B,-90);
+  D-C=A-B;
+  draw polygone(A,B,C,D);
+  draw codeperp(A,B,C,5);
+  draw codeperp(B,C,D,5);
+  draw codeperp(C,D,A,5);
+  draw codeperp(D,A,B,5);
+  marque_s:=marque_s/3;
+  draw Codelongueur(A,B,B,C,C,D,D,A,2);
+  marque_s:=marque_s*3;
+  draw appelation(A,B,-3mm,btex $c$ etex);
+  enddef;
+}%
+
 \def\MPFigureCarre{%
   \ifluatex
   \mplibforcehmode
   \begin{mplibcode}
-    u:=\useKV[ClesFormule]{Echelle};
-    drawoptions( dashed dashpattern(on1cm));
-    pair A,B,C,D;
-    A=u*(1,1);
-    B-A=u*(2,0);
-    C=rotation(A,B,-90);
-    D-C=A-B;
-    draw polygone(A,B,C,D);
-    draw codeperp(A,B,C,5);
-    draw codeperp(B,C,D,5);
-    draw codeperp(C,D,A,5);
-    draw codeperp(D,A,B,5);
-    marque_s:=marque_s/3;
-    draw Codelongueur(A,B,B,C,C,D,D,A,2);
-    marque_s:=marque_s*3;
-    draw appelation(A,B,-3mm,btex $c$ etex);
+    \MPFigureCarreCode
+    FigCarre;
   \end{mplibcode}
   \else
-  \begin{mpost}[mpsettings={u:=\useKV[ClesFormule]{Echelle};}]
-    pair A,B,C,D;
-    A=u*(1,1);
-    B-A=u*(2,0);
-    C=rotation(A,B,-90);
-    D-C=A-B;
-    draw polygone(A,B,C,D);
-    draw codeperp(A,B,C,5);
-    draw codeperp(B,C,D,5);
-    draw codeperp(C,D,A,5);
-    draw codeperp(D,A,B,5);
-    marque_s:=marque_s/3;
-    draw Codelongueur(A,B,B,C,C,D,D,A,2);
-    marque_s:=marque_s*3;
-    draw appelation(A,B,-3mm,btex $c$ etex);
+  \begin{mpost}[mpsettings={\MPFigureCarreCode}]
+    FigCarre;
   \end{mpost}
   \fi
 }
-- 
cgit v1.2.3

