texlive[71379] Master/texmf-dist: customenvs (28may24)

commits+karl at tug.org commits+karl at tug.org
Tue May 28 21:27:55 CEST 2024


Revision: 71379
          https://tug.org/svn/texlive?view=revision&revision=71379
Author:   karl
Date:     2024-05-28 21:27:55 +0200 (Tue, 28 May 2024)
Log Message:
-----------
customenvs (28may24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.pdf
    trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex
    trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.pdf
    trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex
    trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty

Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex	2024-05-28 19:27:46 UTC (rev 71378)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex	2024-05-28 19:27:55 UTC (rev 71379)
@@ -34,8 +34,8 @@
 \usepackage[margin=1.5cm]{geometry}
 \setlength{\parindent}{0pt}
 
-\def\TPversion{0.1.5}
-\def\TPdate{17/05/2024}
+\def\TPversion{0.1.6}
+\def\TPdate{28/05/2024}
 \usepackage{tcolorbox}
 \sethlcolor{lightgray!25}
 \NewDocumentCommand\MontreCode{ m }{%
@@ -111,6 +111,8 @@
 
 \section{History}
 
+\verb|v0.1.6|~:~~~~Small patchs for \textsf{displayskip} + \textsf{pas-tableur} (see \texttt{[fr]} documentation)
+
 \verb|v0.1.5|~:~~~~New macros for boxes with \textsf{tcolorbox} (see \texttt{[fr]} documentation)
 
 \verb|v0.1.4|~:~~~~Create a SMS conversation

Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex	2024-05-28 19:27:46 UTC (rev 71378)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex	2024-05-28 19:27:55 UTC (rev 71379)
@@ -13,7 +13,7 @@
 \RequirePackage[scaled=0.925]{cabin} % sf
 %\usepackage{DejaVuSerif}
 %\usepackage[scale=1.1]{inconsolata}
-\usepackage{customenvs}
+\usepackage[pastableur]{customenvs}
 \usepackage{tabularx}
 \usepackage{soul}
 %\usepackage{codehigh}
@@ -39,8 +39,8 @@
 \usepackage[margin=1.5cm]{geometry}
 \setlength{\parindent}{0pt}
 
-\def\TPversion{0.1.5}
-\def\TPdate{17 mai 2024}
+\def\TPversion{0.1.6}
+\def\TPdate{28 mai 2024}
 \usepackage{tcolorbox}
 \tcbuselibrary{listingsutf8}
 \newtcblisting{DemoCode}[1]{%
@@ -66,10 +66,10 @@
 		keywordstyle={\color{violet}},%
 		classoffset=2,%
 		alsoletter={-},%
-		morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences,\StyleEnvtExo,\StyleEnvtExoDefaut,\TitreExo,\ipsum,EnvSMS,\SMSrec,\SMSenv,BoiteSimple,\SujetTitreExo,\CircledNumber,\AffVignette,\BoiteArrondie},%
+		morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences,\StyleEnvtExo,\StyleEnvtExoDefaut,\TitreExo,\ipsum,EnvSMS,\SMSrec,\SMSenv,BoiteSimple,\SujetTitreExo,\CircledNumber,\AffVignette,\BoiteArrondie,\ChangerDisplaySkip,\celcouleur,\celfusion,\lignetxt,\colonnetxt,\celnumbreak,\celtxt},%
 		keywordstyle={\color{green!50!black}},%
 		classoffset=3,%
-		morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,PoliceLabels,EspaceLabels,Swap,Type,CoeffEspVert,EpTrait,Alea,LargeurNivs,Niveaux,NoticeNiveaux,Titre,PolTitre,PolNotice,PolComp,LigneSep,CouleurNotice,CouleurNiveaux,CouleurFond,Note,Notice,PoliceCateg,PoliceBloc,Couleurs,LargeurBloc,Echelle,NoirBlanc,Libelle,EpTrait,Police,Type,ComplementTitre,Titre,CodeDebut,Couleur,EchelleImage,Decoration,Trait,Avatar,AffAvatar,NoirBlanc,CouleurE,CouleurR,CouleurFond,Hauteur,Largeur,PoliceTxt,CouleurTitre,AlignH,bg,txt,bthick,bcol,raise,Type,EspH,Fond,Texte,Style},%
+		morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,PoliceLabels,EspaceLabels,Swap,Type,CoeffEspVert,EpTrait,Alea,LargeurNivs,Niveaux,NoticeNiveaux,Titre,PolTitre,PolNotice,PolComp,LigneSep,CouleurNotice,CouleurNiveaux,CouleurFond,Note,Notice,PoliceCateg,PoliceBloc,Couleurs,LargeurBloc,Echelle,NoirBlanc,Libelle,EpTrait,Police,Type,ComplementTitre,Titre,CodeDebut,Couleur,EchelleImage,Decoration,Trait,Avatar,AffAvatar,NoirBlanc,CouleurE,CouleurR,CouleurFond,Hauteur,Largeur,PoliceTxt,CouleurTitre,AlignH,bg,txt,bthick,bcol,raise,Type,EspH,Fond,Texte,Style,Dense,Avant,AvantS,Apres,ApresS,Global,align,width},%
 		keywordstyle={\color{orange}}
 	},%
 	#1
@@ -149,6 +149,10 @@
 
 \section{Historique}
 
+\verb|v0.1.6|~:~~~~Patch \textsf{displayskip} + Patches \textsf{pas-tableur}
+
+\verb|v0.1.5|~:~~~~La librairie \texttt{babel} de \TikZ\ n'est plus chargée
+
 \verb|v0.1.5|~:~~~~Vignettes + Numéros encerclés + Création de boîtes 'simples'
 
 \verb|v0.1.4|~:~~~~Commande pour du texte dans une boîte arrondie, de hauteur 'figée' + 'Chat' SMS
@@ -203,7 +207,8 @@
 	\item \MontreCode{multicol} ;
 	\item \MontreCode{tabularray} ;
 	\item \MontreCode{xcolor} ;
-	\item \MontreCode{fontawesome5}.
+	\item \MontreCode{fontawesome5} ;
+	\item \MontreCode{tikz} avec les librairies \MontreCode{decorations.pathmorphing,positioning,shapes.misc,calc}.
 \end{itemize}
 
 À noter que, pour des raisons de compatibilité (ou d'incompatibilité), les packages \MontreCode{enumitem}/\MontreCode{multicol}/\MontreCode{tabularray}/\MontreCode{xcolor}/\MontreCode{fontawesome5} peuvent ne pas être chargés par \MontreCode{customenvs} (auxquels cas l'utilisateur devra les avoir chargés pour faire fonctionner certains environnements) via les options :
@@ -1235,4 +1240,93 @@
 On lance le logiciel \BoiteArrondie[Fond=cyan!33,Texte=violet,EspH=2mm,Style=rect]{situé sur le bureau} en cliquant \BoiteArrondie[Fond=lightgray!25,Texte=darkgray]{droit}.
 \end{DemoCode}
 
+\pagebreak
+
+\section{Patchs divers}
+
+\subsection{Gérer l'espacement vertical du mode hors-ligne}
+
+L'idée est de proposer une commande, à insérer dans le préambule, pour \textit{patcher} l'espacement vertical proposé par les environnements mathématiques hors-ligne.
+
+\begin{DemoCode}{listing only}
+...
+\ChangerDisplaySkip[clés]
+...
+\begin{document}
+\end{DemoCode}
+
+Les \MontreCode{clés} disponibles, à donner entre \MontreCode{[...]}, sont :
+
+\begin{itemize}
+	\item \MontreCode{Avant=...} : modification de l'espacement avant ;
+	\item \MontreCode{AvantS=...} : modification de l'espacement avant (version \textit{short}) ;
+	\item \MontreCode{Apres=...} : modification de l'espacement après ;
+	\item \MontreCode{ApresS=...} : modification de l'espacement après (version \textit{short}) ;
+	\item \MontreCode{Global=...} : modification globale de \textbf{tous} les espacements ;
+	\item \MontreCode{Dense} : booléen pour modification globale en \MontreCode{0.33\textbackslash baselineskip}.
+\end{itemize}
+
+\subsection{Quelques ajouts au package pas-tableur}
+
+L'idée est de proposer quelques commandes complémentaires pour le package \textsf{pas-tableur}, de Stéphane Pasquet (\url{https://ctan.org/pkg/pas-tableur}), en respectant autant que faire se peut la syntaxe du package (voir la documentation pour de plus amples informations).
+
+\smallskip
+
+Le package \textsf{pas-tableur} n'est pas chargé par défaut, mais il peut l'être grâce à l'option \MontreCode{[pastableur]}.
+
+\smallskip
+
+Les \textit{ajouts} disponibles sont :
+
+\begin{itemize}
+	\item colorer/griser une case, via \MontreCode{\textbackslash celcouleur} ;
+	\item fusionner des celules, via \MontreCode{\textbackslash celfusion} ;
+	\item \textit{casser la numérotation} avec des pointillés, via \MontreCode{\textbackslash celnumbreak} ;
+	\item remplir (partiellement ou non) une ligne,  via \MontreCode{\textbackslash lignetxt} ;
+	\item remplir (partiellement ou non) une colonne,  via \MontreCode{\textbackslash colonnetxt}.
+\end{itemize}
+
+\begin{DemoCode}{listing only}
+%chargement du package
+\usepackage[pastableur]{customenvs}
+
+%griser une cellule
+\celcouleur[couleur]{col-lig}
+
+%fusionner des cellules
+\celfusion[options pas-tableur]{col-lig}{col-lig}{label}
+
+%pointillés dans la numérotation
+\celnumbreak{num ligne pointillés}{début numéro suite}{fin numéro suite}
+
+%remplir ligne
+\lignetxt(*)[options pas-tableur]{num ligne}<col début>{liste des cellules}
+
+%remplir colonne
+\colonnetxt(*)[options pas-tableur]{num colonne}<lgn début>{liste des cellules}
+\end{DemoCode}
+
+\pagebreak
+
+L'exemple suivant illustre les différentes commandes proposées dans ce package.
+
+\begin{DemoCode}{}
+\begin{tikzpicture}{}
+	\tableur*[10]{A/2.5cm,B/2.5cm,C/2.5cm,D/2.5cm,E/2.5cm,F/2.5cm}
+	%ligne n°1
+	\celtxt*[align=center]{A}{1}{$n$}
+	\celfusion[align=center]{B-1}{C-1}{$M_n$}
+	\celfusion[align=center]{D-1}{E-1}{$S_n$}
+	\celtxt*[align=center]{F}{1}{$d_n$}
+	%		%Ligne2/3/4
+	\celcouleur{A-2}
+	\lignetxt*[align=center]{2}<2>{$x_n$,$y_n$,5,$n$,$n$} %à partir de la colonne n°2
+	\lignetxt*[align=center]{3}{0,0,0,5,0,5}
+	\lignetxt*[align=center]{4}{1,1,0,5,1,4.12310563}%
+	\celnumbreak{8}{27}{28}
+	%colonneA
+	\colonnetxt*[align=center]{A}<5>{2,3,4,\dots,24,25}   %à partir de la ligne n°5
+\end{tikzpicture}
+\end{DemoCode}
+
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty	2024-05-28 19:27:46 UTC (rev 71378)
+++ trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty	2024-05-28 19:27:55 UTC (rev 71379)
@@ -3,10 +3,11 @@
 % source pencil...: CC-BY-SA 4.0 https://tex.stackexchange.com/questions/504092/replicating-a-fancy-bordered-text-style-in-latex/504145#504145
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{customenvs}[2024/05/17 0.1.5 Custom classic environments]
+\ProvidesPackage{customenvs}[2024/05/28 0.1.6 Custom classic environments]
 
 %====HISTORIQUE
-% v 0.1.6	Boxes for exam title + circled numbers + Vignettes + Small simple boxes creation
+% v 0.1.6	DisplaySkip patch + Patchs pas-tableur
+% v 0.1.5	Boxes for exam title + circled numbers + Vignettes + Small simple boxes creation
 % v 0.1.4	Commande (en/fr) pour du texte dans une boîte arrondie, de hauteur 'figée' + 'Chat' SMS
 % v 0.1.3	Environnement/Commande pour présentation d'un exercice
 % v 0.1.2	Crayon de compétences
@@ -29,6 +30,8 @@
 \newif\if at fa\@fatrue%
 \DeclareOption{nonfa}{\@fafalse}%
 \DeclareOption{nofa}{\@fafalse}%
+\newif\if at pastableur\@pastableurfalse%
+\DeclareOption{pastableur}{\@pastableurtrue}%
 \DeclareOption*{}
 \ProcessOptions\relax
 
@@ -55,7 +58,8 @@
 \RequirePackage{listofitems}
 \RequirePackage{calc}
 \RequirePackage{tikz}
-\usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc,calc,babel}
+\usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc,calc}
+\usetikzlibrary{babel}
 \RequirePackage{tcolorbox}
 \RequirePackage{varwidth}
 \tcbuselibrary{skins}
@@ -1711,4 +1715,213 @@
 	}\relax%
 }
 
+%====DisplaySkip [en]
+\defKV[DisplaySkip]{%
+	aboveds=\def\ceabovedisplayskip{#1},%
+	abovedsshort=\def\ceabovedisplayskipshort{#1},%
+	belowdds=\def\cebelowdisplayskip{#1},%
+	belowdsshort=\def\cebelowdisplayskipshort{#1},%
+	global=\def\globaldisplayskip{#1}
+}
+
+\setKVdefault[DisplaySkip]{%
+	aboveds={12pt plus 3pt minus 9pt},%
+	abovedsshort={0pt plus 3pt},%
+	belowdds={12pt plus 3pt minus 9pt},%
+	belowdsshort={7pt plus 3pt minus 4pt},%
+	global={},%
+	shrink=false
+}
+\NewDocumentCommand\ChangeSpacingDisplaySkip{ O{} }{%
+	\restoreKV[DisplaySkip]%
+	\setKV[DisplaySkip]{#1}%
+	\ifboolKV[DisplaySkip]{shrink}%
+		{%
+			\AtBeginDocument{%
+				\abovedisplayskip=0.33\baselineskip
+				\abovedisplayshortskip=0.33\baselineskip
+				\belowdisplayskip=0.33\baselineskip
+				\belowdisplayshortskip=0.33\baselineskip
+			}
+		}%
+		{%
+			\IfStrEq{\globaldisplayskip}{}%
+				{%
+					\AtBeginDocument{%
+						\abovedisplayskip=\ceabovedisplayskip
+						\abovedisplayshortskip=\ceabovedisplayskipshort
+						\belowdisplayskip=\cebelowdisplayskip
+						\belowdisplayshortskip=\cebelowdisplayskipshort
+					}
+				}%
+				{%
+					\AtBeginDocument{%
+						\abovedisplayskip=\globaldisplayskip
+						\abovedisplayshortskip=\globaldisplayskip
+						\belowdisplayskip=\globaldisplayskip
+						\belowdisplayshortskip=\globaldisplayskip
+					}
+				}%
+		}%
+}
+
+%====DisplaySkip [fr]
+\defKV[DisplaySkipFr]{%
+	Avant=\def\ceabovedisplayskip{#1},%
+	AvantS=\def\ceabovedisplayskipshort{#1},%
+	Apres=\def\cebelowdisplayskip{#1},%
+	ApresS=\def\cebelowdisplayskipshort{#1},%
+	Global=\def\globaldisplayskip{#1}
+}
+
+\setKVdefault[DisplaySkipFr]{%
+	Avant={12pt plus 3pt minus 9pt},%
+	AvantS={0pt plus 3pt},%
+	Apres={12pt plus 3pt minus 9pt},%
+	ApresS={7pt plus 3pt minus 4pt},%
+	Global={},%
+	Dense=false
+}
+\NewDocumentCommand\ChangerDisplaySkip{ O{} }{%
+	\restoreKV[DisplaySkipFr]%
+	\setKV[DisplaySkipFr]{#1}%
+	\ifboolKV[DisplaySkipFr]{Dense}%
+		{%
+			\AtBeginDocument{%
+				\abovedisplayskip=0.33\baselineskip
+				\abovedisplayshortskip=0.33\baselineskip
+				\belowdisplayskip=0.33\baselineskip
+				\belowdisplayshortskip=0.33\baselineskip
+			}
+		}%
+		{%
+			\IfStrEq{\globaldisplayskip}{}%
+				{%
+					\AtBeginDocument{%
+						\abovedisplayskip=\ceabovedisplayskip
+						\abovedisplayshortskip=\ceabovedisplayskipshort
+						\belowdisplayskip=\cebelowdisplayskip
+						\belowdisplayshortskip=\cebelowdisplayskipshort
+					}
+				}%
+				{%
+					\AtBeginDocument{%
+						\abovedisplayskip=\globaldisplayskip
+						\abovedisplayshortskip=\globaldisplayskip
+						\belowdisplayskip=\globaldisplayskip
+						\belowdisplayshortskip=\globaldisplayskip
+					}
+				}%
+		}%
+}
+
+%====Patchs pas-tableur
+\if at pastableur
+
+\RequirePackage{pas-tableur}
+
+\renewcommand{\pastableur at grid}[4] % #1 : width, #2 : name, #3 : numline, #4 : coord.
+	{%
+		\node[celempty,below,minimum height=\line at height,minimum width=#1] (cell#2-#3) at (#4) {};%
+		\draw[graySepCell] ($(cell#2-#3.south west)+(0.2pt,0)$) -- (cell#2-#3.south east) -- ($(cell#2-#3.north east)+(0,-0.2pt)$);%
+	}
+	
+\renewcommand{\pastab at draw@cell}[5]
+% #1 : \first at width, #2 : \first at name, #3 : 0=colonne1 / 1=autres colonnes / 
+% 2 = ligne 1, #4 : coord., #5 : contenu
+{%
+	\ifnum#3=0%
+		\tikzstyle{cellstyle} = [celhead,minimum width={#1},minimum height=\line at height]%
+		\def\pastableur at coord{(0,0)}%
+	\else%
+		\ifnum#3=1%
+			\tikzstyle{cellstyle} = [celhead,right,minimum width={#1},minimum height=\line at height]%
+		\else
+			\ifnum#3=2%
+				\tikzstyle{cellstyle} = [below left,celhead,minimum width={#1},minimum height=\line at height]
+			\else%
+				\tikzstyle{cellstryle} = [below,celhead,minimum width={#1},minimum height=\line at height]
+			\fi%
+		\fi%
+		\def\pastableur at coord{(#4)}%
+	\fi%
+	\node[cellstyle] (#2) at \pastableur at coord {\helvbx#5};%
+	\fill[grayBottomCell] (#2.south west) rectangle (#2.north east) ;%
+	\fill[grayTopCell] (#2.north west) rectangle ($0.5*(#2.south east)+0.5*(#2.north east)$) ;%
+	\node[minimum width={#1},minimum height=\line at height,cellstyle] at \pastableur at coord {\helvbx#5};%
+}
+
+\NewDocumentCommand\celcouleur{ O{graySepCell!50} m }{%OK
+	\draw[draw=none,fill=#1] ($(cell#2.south west)+(0.2pt,0.2pt)$) rectangle ($(cell#2.north east) + (-0.2pt,-0.2pt)$) ;%
+}
+
+\defKV[celparam]{align=\def\pastableurfusalign{#1},width=\def\pastableurfuswidth{#1}}
+\setKVdefault[celparam]{align=left,width={\col at width}}
+
+\NewDocumentCommand\celfusion{ O{} m m m }{%OK
+	\restoreKV[celparam]%
+	\setKV[celparam]{#1}%
+	\IfStrEq{#4}{}%
+		{%
+			\draw[draw=none,fill=white] ($(cell#2.south west)+(0.2pt,0.2pt)$) rectangle ($(cell#3.north east) + (-0.2pt,-0.2pt)$);
+		}%
+		{%
+			\draw[draw=none,fill=white] ($(cell#2.south west)+(0.2pt,0.2pt)$) rectangle ($(cell#3.north east) + (-0.2pt,-0.2pt)$) node[midway,text width=\dimexpr\pastableurfuswidth-4pt,align=\pastableurfusalign] {#4};
+		}%
+}
+
+\NewDocumentCommand\celnumbreak{ m m m }{%
+	\def\numpointilles{#1}
+	\xdef\numavant{\inteval{\numpointilles-1}}%
+	\def\numdebut{#2}\def\numfin{#3}
+	\foreach \num at line [remember=\num at line as \lastnum (initially \numavant)] in {\numpointilles}
+		{%
+			\pastab at draw@cell{\numline at width}{numline\num at line}{3}{numline\lastnum.south east}{\dots}%
+		}%
+	\foreach \num at line [remember=\num at line as \lastnum (initially \numpointilles)] in {\numdebut,\numfin}
+		{%
+			\pastab at draw@cell{\numline at width}{numline\num at line}{3}{numline\lastnum.south east}{\num at line}%
+		}%
+}
+
+\NewDocumentCommand\lignetxt{ s O{} m D<>{1} m }{%3=num ligne,%5=liste
+	\IfBooleanTF{#1}%
+		{
+			\foreach \x [count=\i] in {#5}
+			{%
+				\xdef\j{\inteval{\i+(#4-1)}}%
+				\StrChar{ABCDEFGHIJKLMNOPQRSTUVWXYZ}{\j}[\iltr]%
+				\IfEq{\x}{}{}{\celtxt*[#2]{\iltr}{#3}{\x}}%
+			}%
+		}%
+		{%
+			\foreach \x [count=\i] in {#5}
+			{%
+				\xdef\j{\inteval{\i+(#4-1)}}%
+				\StrChar{ABCDEFGHIJKLMNOPQRSTUVWXYZ}{\j}[\iltr]%
+				\IfEq{\x}{}{}{\celtxt[#2]{\iltr}{#3}{\x}}%
+			}%
+		}%
+}
+
+\NewDocumentCommand\colonnetxt{ s O{} m D<>{1} m }{%3=lettre colonne,%5=liste
+	\IfBooleanTF{#1}%
+		{
+			\foreach \x [count=\i] in {#5}
+			{%
+				\xdef\j{\inteval{\i+(#4-1)}}
+				\IfStrEq{\x}{}{}{\celtxt*[#2]{#3}{\j}{\x}}%
+			}%
+		}%
+		{%
+			\foreach \x [count=\i] in {#5}
+			{%
+				\xdef\j{\inteval{\i+(#4-1)}}
+				\IfStrEq{\x}{}{}{\celtxt[#2]{#3}{\j}{\x}}%
+			}%
+		}%
+}
+
+\fi
+
 \endinput
\ No newline at end of file



More information about the tex-live-commits mailing list.