texlive[76198] Master/texmf-dist: customenvs (31aug25)
commits+karl at tug.org
commits+karl at tug.org
Sun Aug 31 21:22:00 CEST 2025
Revision: 76198
https://tug.org/svn/texlive?view=revision&revision=76198
Author: karl
Date: 2025-08-31 21:22:00 +0200 (Sun, 31 Aug 2025)
Log Message:
-----------
customenvs (31aug25)
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/doc/latex/customenvs/customenvs-exams-doc.pdf
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-exams-doc.tex
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-tikzpictos-doc.pdf
trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-tikzpictos-doc.tex
trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-exams.sty
trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-tikzpictos.sty
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 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-en.tex 2025-08-31 19:22:00 UTC (rev 76198)
@@ -34,8 +34,8 @@
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.41b}
-\def\TPdate{04/08/2025}
+\def\TPversion{0.41c}
+\def\TPdate{30/08/2025}
\usepackage{tcolorbox}
\sethlcolor{lightgray!25}
\NewDocumentCommand\MontreCode{ m }{%
@@ -114,6 +114,8 @@
\section{History}
+\verb|v0.41c|~:~~~Enhancements with subpackages
+
\verb|v0.41b|~:~~~Bugfix + pre-compatibility with \textsf{fa5/fa6/fa7} + new pictograms
\verb|v0.41a|~:~~~Option \textsf{noinlinegraphicx} for compatibility with \textsf{MikTeX} + Bugfix
@@ -240,7 +242,7 @@
\pagebreak
-\subsection{Subpackage customenvs-tikzpictos (v0.1.5)}
+\subsection{Subpackage customenvs-tikzpictos (v0.1.7)}
The package \MontreCode{customenvs-tikzpictos}, loaded within \MontreCode{customenvs} (but can be loaded independently), proposes small pictograms.
@@ -1146,4 +1148,90 @@
\fittexttobox{CONGRATULATIONS}{14cm}{1.25cm}
\end{demohigh}
+\section{Small decorated boxes}
+
+\subsection{Ornements box}
+
+\begin{codehigh}[language=latex/latex2]
+\begin{tcboxornaments}[keys]{options tcbox}
+%inhalt
+\end{tcboxornaments}
+
+%---Available keys:
+%v size deco = height of deco
+%h size deco = width od deco
+%linewidth deco = thickness of deco
+%color deco = color of dedo
+%alt deco = boolean for inner deco
+%h stretch deco = coeff v -> h
+%inner size deco = corner size
+\end{codehigh}
+
+\begin{demohigh}[language=latex/latex2,style/main=teal!25,style/code=teal!25]
+\begin{tcboxornaments}{}
+\lipsum[1][1-5]
+\end{tcboxornaments}
+\end{demohigh}
+
+\begin{demohigh}[language=latex/latex2,style/main=teal!25,style/code=teal!25]
+\begin{tcboxornaments}
+ [color deco=red!50!black,h size deco=3cm]
+ {center,width=12cm,fontupper=\LARGE\sffamily,colupper=red!50!black}
+CHAPTER 01: Logic
+\end{tcboxornaments}
+\end{demohigh}
+
+\pagebreak
+
+\subsection{Post 'forum' box}
+
+\begin{codehigh}[language=latex/latex2]
+\begin{tcforumpost}[keys]{options tcbox}
+%inhalt
+\end{tcforumpost}
+
+%---Available keys:
+%height-pseudo = height of pseudo/alt-pseudo box
+%deco-length = width of triangular deco
+%left-margin
+%pseudo
+%alt-pseudo
+%fill-color
+%rule-color
+%avatar = code avatar (emoji, graphics, txt...)
+\end{codehigh}
+
+\begin{demohigh}[language=latex/latex2,style/main=teal!25,style/code=teal!25]
+\begin{tcforumpost}{}
+\lipsum[1][1-5]
+\end{tcforumpost}
+\end{demohigh}
+
+\begin{codehigh}[language=latex/latex3]
+%txt pseudo styles (within l3e 'syntax')
+\ExplSyntaxOn
+\tikzset{
+forum~style~post~font~pseudo/.style={%
+ inner~sep=0pt,font=\ttfamily\bfseries,text=white},
+forum~style~post~font~altpseudo/.style={%
+ inner~sep=0pt,font=\ttfamily,text=\g_tcbox_forum_post_rule_color},
+}
+\ExplSyntaxOff
+\end{codehigh}
+
+\ExplSyntaxOn
+\tikzset{
+ forum~style~post~font~pseudo/.style={%
+ inner~sep=0pt,font=\ttfamily\bfseries,text=white},
+ forum~style~post~font~altpseudo/.style={%
+ inner~sep=0pt,font=\ttfamily,text=\g_tcbox_forum_post_rule_color},
+}
+\ExplSyntaxOff
+
+\begin{demohigh}[language=latex/latex2,style/main=teal!25,style/code=teal!25]
+\begin{tcforumpost}[fill-color=pink!10,rule-color=magenta]{width=12cm}
+\lipsum[1][1-5]
+\end{tcforumpost}
+\end{demohigh}
+
\end{document}
\ No newline at end of file
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 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-doc-fr.tex 2025-08-31 19:22:00 UTC (rev 76198)
@@ -39,8 +39,8 @@
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.41b}
-\def\TPdate{4 août 2025}
+\def\TPversion{0.41c}
+\def\TPdate{30 août 2025}
\usepackage{tcolorbox}
\tcbuselibrary{listingsutf8}
%\usepackage{eurosym}
@@ -148,6 +148,8 @@
\section{Historique}
+\verb|v0.41c|~:~~~Améliorations dans les sous-packages
+
\verb|v0.41b|~:~~~Bugfix + pre-compatibilité \textsf{fa5/6/7} + nouveaux pictogrammes
\verb|v0.41a|~:~~~Option \textsf{noninlinegraphicx} pour garder la compatibilité avec \textsf{MikTeX} + Bugfix
@@ -294,7 +296,7 @@
\usepackage[option(s)]{customenvs}
\end{DemoCode}
-\subsection{Sous-package customenvs-tikzpictos (v0.1.5)}
+\subsection{Sous-package customenvs-tikzpictos (v0.1.7)}
\MontreCode{customenvs} charge, pour \textit{ses} petits pictogrammes, le package \MontreCode{customenvs-tikzpictos}, qui est fourni avec.
@@ -330,7 +332,7 @@
\end{tblr}\hfill\null
\end{DemoCode}
-\subsection{Sous-package customenvs-exams (v0.1.1)}
+\subsection{Sous-package customenvs-exams (v0.1.4)}
\MontreCode{customenvs} charge, pour quelques environnements ou commandes type \textit{examens}, le package \MontreCode{customenvs-exams}, qui est fourni avec.
@@ -2090,6 +2092,81 @@
\pagebreak
+\subsection{Boîte avec ornements}
+
+\begin{DemoCode}{listing only}
+\begin{tcboxornaments}[clés]{options tcbox}
+%contenu
+\end{tcboxornaments}
+
+%---Les clés disponibles sont :
+%v size deco = hauteur de la déco
+%h size deco = largeur de la déco
+%linewidth deco = épaisseur de la déco
+%color deco = couleur de la décoration
+%alt deco = booléen décoration 'intérieure'
+%h stretch deco = coeff v -> h
+%inner size deco = taille du coin
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\begin{tcboxornaments}{}
+\lipsum[1][1-5]
+\end{tcboxornaments}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\begin{tcboxornaments}
+ [color deco=red!50!black,h size deco=3cm]
+ {center,width=12cm,fontupper=\LARGE\sffamily,colupper=red!50!black}
+CHAPITRE 01 : Éléments de logique
+\end{tcboxornaments}
+\end{DemoCode}
+
+\pagebreak
+
+\subsection{Boîte type message de forum}
+
+\begin{DemoCode}{listing only}
+\begin{tcforumpost}[clés]{options tcbox}
+%contenu
+\end{tcforumpost}
+
+%---Les clés disponibles sont :
+%height-pseudo = hauteur pseudo/alt pseudo
+%deco-length = largeur de la déco (triangle)
+%left-margin = marge gauche (pour la boîte avatar/pseudo...)
+%pseudo = pseudo affiché
+%alt-pseudo = pseudo alternatif affiché
+%fill-color = couleur de fond
+%rule-color = couleur du bord
+%avatar = code avatar (emoji, graphics, texte...)
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\begin{tcforumpost}{}
+\lipsum[1][1-5]
+\end{tcforumpost}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+%style des labels (en l3e)
+\ExplSyntaxOn
+\tikzset{
+ forum~style~post~font~pseudo/.style={%
+ inner~sep=0pt,font=\ttfamily\bfseries,text=white},
+ forum~style~post~font~altpseudo/.style={%
+ inner~sep=0pt,font=\ttfamily,text=\g_tcbox_forum_post_rule_color},
+}
+\ExplSyntaxOff
+
+\begin{tcforumpost}[fill-color=pink!10,rule-color=magenta]{width=12cm}
+\lipsum[1][1-5]
+\end{tcforumpost}
+\end{DemoCode}
+
+\pagebreak
+
\section{Patchs divers}
\subsection{Gérer l'espacement vertical du mode hors-ligne}
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-exams-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-exams-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-exams-doc.tex 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-exams-doc.tex 2025-08-31 19:22:00 UTC (rev 76198)
@@ -37,8 +37,8 @@
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.1}
-\def\TPdate{01/08/2025}
+\def\TPversion{0.1.4}
+\def\TPdate{20/08/2025}
\usepackage{tcolorbox}
\sethlcolor{lightgray!25}
@@ -385,6 +385,12 @@
\section{Historique}
+\verb|v0.1.4|~:~Améliorations avec \textsf{pictostars}
+
+\verb|v0.1.3|~:~Couleur globale pour \textsf{BlocExo}
+
+\verb|v0.1.2|~:~Améliorations
+
\verb|v0.1.1|~:~Correction dans les espacements
\verb|v0.1.0|~:~Version initiale
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-tikzpictos-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-tikzpictos-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-tikzpictos-doc.tex 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/doc/latex/customenvs/customenvs-tikzpictos-doc.tex 2025-08-31 19:22:00 UTC (rev 76198)
@@ -1,3 +1,4 @@
+% !TeX document-id = {eabafbe3-3736-4a31-8c7b-909e7171acc5}
% !TeX TXS-program:compile = txs:///arara
% arara: lualatex: {shell: no, synctex: no, interaction: batchmode}
% arara: lualatex: {shell: no, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
@@ -42,8 +43,8 @@
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.5}
-\def\TPdate{04/08/2025}
+\def\TPversion{0.1.7}
+\def\TPdate{30/08/2025}
\usepackage{tcolorbox}
\sethlcolor{lightgray!25}
@@ -167,7 +168,7 @@
If \MontreCode{customenvs} is loaded, it load itself \MontreCode{customenvs-tikzpictos}
-The only loaded packages are \MontreCode{simplekv}, \MontreCode{calc}, \MontreCode{simplekv}, \MontreCode{listofitems}, \MontreCode{xstring}, \MontreCode{xintexpr} and \MontreCode{tikz} (with \MontreCode{shapes.geometric / bbox} libraries).
+The only loaded packages are \MontreCode{simplekv}, \MontreCode{calc}, \MontreCode{simplekv}, \MontreCode{listofitems}, \MontreCode{xstring}, \MontreCode{xintexpr} and \MontreCode{tikz} (with \MontreCode{shapes.geometric / bbox / 3d} libraries).
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
\usepackage{customenvs-tikzpictos}
@@ -716,18 +717,65 @@
\pagebreak
+\section{Alt pictos}
+
+\subsection{Rings}
+
+\begin{codehigh}[language=latex/latex2]
+\tkzRings%
+ [keys]
+ {tikz options}
+
+%available keys:
+%height=...
+%strut=...
+%dstrut=...
+%clip bb=...
+%color=boolean
+\end{codehigh}
+
+\begin{demohigh}[language=latex/latex2]
+{\LARGE q\tkzRings{}B}
+\end{demohigh}
+
+\subsection{Colored cube}
+
+\begin{codehigh}[language=latex/latex2]
+\tkzPuzzleCube%
+ [keys]
+
+%available keys:
+%height=...
+%width=...
+%strut=...
+%empty color=...,
+%rescale=...
+\end{codehigh}
+
+\begin{demohigh}[language=latex/latex2]
+{\LARGE q\tkzPuzzleCube{}B}
+\end{demohigh}
+
+\vfill
+
\section{History}
-\verb|v0.1.5| :~Inline badge (inspired by \textsf{tikz-shields}) + simple stamp
+\verb|v0.1.7|:~Alt pictos (rings + cube)
-\verb|v0.1.4| :~(d)strut option for height/depth + bdall + difficulty levels + stamp
+\verb|v0.1.6|:~Bugfix with pictostars (raisebox...)
-\verb|v0.1.3| :~Clippy
+\verb|v0.1.5|:~Inline badge (inspired by \textsf{tikz-shields}) + simple stamp
-\verb|v0.1.2| :~Mini calendar
+\verb|v0.1.4|:~(d)strut option for height/depth + bdall + difficulty levels + stamp
-\verb|v0.1.1| :~Traffic Light
+\verb|v0.1.3|:~Clippy
-\verb|v0.1.0| :~Initial version
+\verb|v0.1.2|:~Mini calendar
+\verb|v0.1.1|:~Traffic Light
+
+\verb|v0.1.0|:~Initial version
+
+\vspace*{1cm}\null
+
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-exams.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-exams.sty 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-exams.sty 2025-08-31 19:22:00 UTC (rev 76198)
@@ -2,9 +2,12 @@
% licence.........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{customenvs-exams}[2025/08/04 0.1.1 customenvs for exam documents]
+\ProvidesPackage{customenvs-exams}[2025/08/20 0.1.4 customenvs for exam documents]
%====HISTORY
+% v 0.1.4 Enhancements with pictostars
+% v 0.1.3 Global color for BlocExo
+% v 0.1.2 Enhancements with breakable and BlocExo :-)
% v 0.1.1 Bugfix + BlocExo
% v 0.1.0 Initial version subpackage (exam) of customenvs
@@ -474,10 +477,12 @@
%====BLOC EXO NEW V3
\newcounter{numeroblocexo}
\setcounter{numeroblocexo}{0}
+\newlength{\hauteurnumerocercle}
\newlength{\eptraitblocexo}
\setlength{\eptraitblocexo}{1.1pt}
\newlength{\eptraitblocexospace}
\setlength{\eptraitblocexospace}{1.5\eptraitblocexo}
+\def\raisetraitblocexo{0.5ex}
\colorlet{macouleurblocexo}{black}
\colorlet{macouleurblocexodeco}{black}
@@ -500,7 +505,7 @@
colback=white,%
colbacktitle=white,%
coltitle=macouleurblocexo,%
- colframe=macouleurblocexo,%
+ colframe=macouleurborduresblocexo,%
left=1.5mm,%
right=1.5mm,%
top=1mm,%
@@ -509,27 +514,33 @@
}%
}
-\tikzset{ligne bloc exo/.style={line width=0.3mm,macouleurblocexo}}
+\tikzset{ligne bloc exo/.style={line width=0.25mm,macouleurborduresblocexo}}
-\defKV[StyleBlocExo]{%
+\defKV[StyleGlobalBlocExo]{%
Libelle=\renewcommand\tmplabelblocexo{#1},%
+ CouleurGlobale=\def\tmpcoulglobblocexo{#1},%
Couleur=\colorlet{macouleurblocexo}{#1},%
+ CouleurBordures=\colorlet{macouleurborduresblocexo}{#1},%
CouleurDeco=\colorlet{macouleurblocexodeco}{#1},%
CouleurFondDeco=\colorlet{macouleurblocexodecofond}{#1},%
Police=\renewcommand\tmpstyleblocexo{#1},%
- EpTrait=\setlength{\eptraitblocexo}{#1}
+ EpTrait=\setlength{\eptraitblocexo}{#1},%
+ OffsetTrait=\def\raisetraitblocexo{#1}
}
-\setKVdefault[StyleBlocExo]{%
+\setKVdefault[StyleGlobalBlocExo]{%
Libelle={Exercice\space},%
+ CouleurGlobale={},%
Couleur={black},%
+ CouleurBordures=darkgray,%
CouleurDeco=black,
CouleurFondDeco={black!33},%
- Police={\bfseries\sffamily\large},%
- EpTrait={1.1pt}
+ Police={\bfseries\sffamily},%
+ EpTrait={0.25mm},%
+ OffsetTrait=0.0ex
}
-\defKV[BlocExo]{%
+\defKV[StyleLocalBlocExo]{%
Type=\def\EnvtExoAltType{#1},%
ComplementTitre=\def\EnvtExoAltCpltTitre{#1},%
CodeDebut=\def\EnvtExoAltCodeAvant{#1},%
@@ -538,7 +549,7 @@
Bordures=\def\EnvtExoAltBordures{#1},%
Strut=\def\blocexostrut{#1}
}
-\setKVdefault[BlocExo]{
+\setKVdefault[StyleLocalBlocExo]{
Type=Classique,%
ComplementTitre={},%
CodeDebut={},%
@@ -551,16 +562,27 @@
}
\tcbuselibrary{breakable}%à voir...
+\usetikzlibrary{calc}
\NewDocumentEnvironment{BlocExo}{ O{} m }%
{%
- \useKVdefault[BlocExo]%
- \setKV[BlocExo]{#1}%
+ \useKVdefault[StyleLocalBlocExo]%
+ \setKV[StyleLocalBlocExo]{#1}%
+ %test couleur globale ??
+ \IfStrEq{\tmpcoulglobblocexo}{}%
+ {}%
+ {%
+ \colorlet{macouleurblocexo}{\tmpcoulglobblocexo}%
+ \colorlet{macouleurborduresblocexo}{\tmpcoulglobblocexo}%
+ \colorlet{macouleurblocexodeco}{\tmpcoulglobblocexo}%
+ \colorlet{macouleurblocexodecofond}{\tmpcoulglobblocexo!33}%
+ }%
+ %fin test
\addtocounter{numeroblocexo}{1}%
- \ifboolKV[BlocExo]{Compteur}{}{\addtocounter{numeroblocexo}{-1}}%
+ \ifboolKV[StyleLocalBlocExo]{Compteur}{}{\addtocounter{numeroblocexo}{-1}}%
%styles
\tcbset{reset}%
- \ifboolKV[BlocExo]{Breakable}%
+ \ifboolKV[StyleLocalBlocExo]{Breakable}%
{%
\tcbset{monstyleblocexobreakable/.style={breakable}}%
}%
@@ -567,11 +589,66 @@
{%
\tcbset{monstyleblocexobreakable/.style={}}%
}%
+ \IfStrEq{\EnvtExoAltBordures}{simple}%
+ {%
+ \settototalheight\hauteurnumerocercle{\hbox{\tmpstyleblocexo 0123456789}}%
+ }%
+ {}%
\IfStrEqCase{\EnvtExoAltBordures}{%
- {normal}{\tcbset{monstylebloexobordures/.style={}}}%
+ {normal}{\tcbset{monstylebloexobordures/.style={sharp corners,rounded corners=northwest,opacityfill=1,righttitle=0mm}}}%
+ {simple}{\tcbset{monstylebloexobordures/.style={frame empty,left=\dimexpr1.5\hauteurnumerocercle+1mm\relax,right=0mm,top=0mm,bottom=2mm,boxsep=0mm,%
+ finish unbroken={%
+ \filldraw[macouleurborduresblocexo] ([xshift={0.75\hauteurnumerocercle},yshift={-0.75\hauteurnumerocercle}]frame.north west) circle[radius={0.75\hauteurnumerocercle}];%
+ \draw[ligne bloc exo,macouleurborduresblocexo,rounded corners=2mm] ([xshift={0.75\hauteurnumerocercle},yshift={-0.75\hauteurnumerocercle}]frame.north west) |- ([xshift=1cm]frame.south west) ;%
+ %\draw[ligne bloc exo,macouleurblocexo,densely dashed] ([xshift=1cm]frame.south west) --++(1cm,0) ;%
+ \draw ([xshift={0.75\hauteurnumerocercle},yshift={-0.75\hauteurnumerocercle}]frame.north west) node[text=white,font=\tmpstyleblocexo,scale=0.95] {\ifnum\thenumeroblocexo<10\relax\thenumeroblocexo\else\scalebox{0.667}[1]{\thenumeroblocexo}\fi} ;%
+ },%
+ finish first={%
+ \filldraw[macouleurborduresblocexo] ([xshift={0.75\hauteurnumerocercle},yshift={-0.75\hauteurnumerocercle}]frame.north west) circle[radius={0.75\hauteurnumerocercle}];%
+ \draw[ligne bloc exo,macouleurborduresblocexo] ([xshift={0.75\hauteurnumerocercle},yshift={-0.75\hauteurnumerocercle}]frame.north west) -- ([xshift={0.75\hauteurnumerocercle},yshift={5mm}]frame.south west) ;%
+ \draw[ligne bloc exo,macouleurborduresblocexo,densely dashed] ([xshift={0.75\hauteurnumerocercle},yshift={5mm}]frame.south west) --++ (0,-5mm) ;%
+ \draw ([xshift={0.75\hauteurnumerocercle},yshift={-0.75\hauteurnumerocercle}]frame.north west) node[text=white,font=\tmpstyleblocexo,scale=0.95] {\ifnum\thenumeroblocexo<10\relax\thenumeroblocexo\else\scalebox{0.667}[1]{\thenumeroblocexo}\fi} ;%
+ },%
+ finish last={%
+ \draw[ligne bloc exo,macouleurborduresblocexo,densely dashed] ([xshift={0.75\hauteurnumerocercle},yshift=-5mm]frame.north west) --++ (0,5mm) ;%
+ \draw[ligne bloc exo,macouleurborduresblocexo,rounded corners=2mm] ([xshift={0.75\hauteurnumerocercle},yshift={-5mm}]frame.north west) |- ([xshift=1cm]frame.south west) ;%
+ }%
+ }%
+ }%
+ }%
{aucune}{\tcbset{monstylebloexobordures/.style={frame empty,left=0mm,right=0mm,boxsep=0mm,boxrule=0mm,top=2mm,before upper={\EnvtExoAltCodeAvant}}}}%
- {alt}{\tcbset{monstylebloexobordures/.style={frame empty,top=0mm,finish={\draw[ligne bloc exo,|-|] ([xshift=0.5em-0.1mm]title.west) --++ (-0.5em-0.1mm,0) {[rounded corners=2mm]|- (frame.south east)} |- ([xshift=-0.5em+0.1mm]title.east) ;}}}}%
- {fleche}{\tcbset{monstylebloexobordures/.style={frame empty,top=0mm,righttitle=0mm,finish={\draw[ligne bloc exo,->,>=latex] ([xshift=0.5em-0.1mm]title.west) --++ (-0.5em-0.1mm,0) {[rounded corners=2mm]|- (frame.south east)} -- ($(frame.south east)!0.5!(frame.north east)$) ;}}}}%
+ {alt}{\tcbset{monstylebloexobordures/.style={frame empty,top=0mm,%
+ finish unbroken={\draw[ligne bloc exo,|-|] ([xshift=0.5em-0.1mm]title.west) --++ (-0.5em-0.1mm,0) {[rounded corners=2mm]|- (frame.south east)} |- ([xshift=-0.5em+0.1mm]title.east) ;},%
+ finish first={%
+ \draw[ligne bloc exo,|-] ([xshift=0.5em-0.1mm]title.west) --++ (-0.5em-0.1mm,0) -- ([yshift=5mm]frame.south west) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=5mm]frame.south west) -- (frame.south west) ;%
+ \draw[ligne bloc exo,-|] ([yshift=5mm]frame.south east) |- ([xshift=-0.5em+0.1mm]title.east) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=5mm]frame.south east) -- (frame.south east) ;%
+ },%
+ finish last={%
+ \draw[ligne bloc exo] ([yshift=-5mm]frame.north west) {[rounded corners=2mm]|- (frame.south east)} -- ([yshift=-5mm]frame.north east) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=-5mm]frame.north west) -- (frame.north west) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=-5mm]frame.north east) -- (frame.north east) ;%
+ }%
+ }%
+ }%
+ }%
+ {fleche}{\tcbset{monstylebloexobordures/.style={frame empty,top=0mm,righttitle=0mm,%
+ finish unbroken={\draw[ligne bloc exo,->,>=latex] ([xshift=0.5em-0.1mm]title.west) --++ (-0.5em-0.1mm,0) {[rounded corners=2mm]|- (frame.south east)} -- ($(frame.south east)!0.5!(frame.north east)$) ;},%
+ finish first={%
+ \draw[ligne bloc exo] ([xshift=0.5em-0.1mm]title.west) --++ (-0.5em-0.1mm,0) -- ([yshift=5mm]frame.south west) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=5mm]frame.south west) -- (frame.south west) ;%
+ \draw[ligne bloc exo,->,>=latex] ([yshift=5mm]frame.south east) -- ($(frame.south east)!0.5!(frame.north east)$) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=5mm]frame.south east) -- (frame.south east) ;%
+ },%
+ finish last={%
+ \draw[ligne bloc exo] ([yshift=-5mm]frame.north west) {[rounded corners=2mm]|- (frame.south east)} -- ([yshift=-5mm]frame.north east) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=-5mm]frame.north west) -- (frame.north west) ;%
+ \draw[ligne bloc exo,densely dashed] ([yshift=-5mm]frame.north east) -- (frame.north east) ;%
+ }%
+ }%
+ }%
+ }%
}%
\tcbset{monstyleblocexotitre/.style={
title={%
@@ -584,7 +661,7 @@
\StrBehind{\EnvtExoAltType}{/}[\EnvtExoLabel]%
\EnvtExoLabel%
}%
- \ifboolKV[BlocExo]{Compteur}{\thenumeroblocexo}{}\EnvtExoAltCpltTitre%
+ \ifboolKV[StyleLocalBlocExo]{Compteur}{\thenumeroblocexo}{}\EnvtExoAltCpltTitre%
\IfStrEq{\EnvtExoAltEtoiles}{}{}%les étoiles au début...
{%
\space(%
@@ -591,14 +668,15 @@
\IfSubStr{\EnvtExoAltEtoiles}{§}%
{%
\StrCut{\EnvtExoAltEtoiles}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}%
- \pictostars[colors=macouleurblocexodeco/macouleurblocexodecofond,dstrut=()]{\EnvtExoStarNb/\EnvtExoStarTot}%
+ {\pictostars[colors=macouleurblocexodeco/macouleurblocexodecofond,dstrut=()]{\EnvtExoStarNb/\EnvtExoStarTot}}%
}%
{%
- \pictostars[colors=macouleurblocexodeco/macouleurblocexodecofond,dstrut=()]{\EnvtExoStarNb}%
+ {\pictostars[colors=macouleurblocexodeco/macouleurblocexodecofond,dstrut=()]{\EnvtExoStarNb}}%
}%
)%
}%
%trait éventuel
+ \textcolor{macouleurborduresblocexo}{%
\IfStrEqCase{\EnvtExoAltTrait}{%
{plein}%
{%
@@ -607,16 +685,38 @@
\def\hrulefill{\leavevmode\leaders\hrule height 0.4pt\hfill\kern\z@}%
}%
{pointilles}{\,\dotfill\null}%
- {dashilles}{\,\hdashrule{\fill}{\eptraitblocexo}{\eptraitblocexospace}\null}%
+ {dashilles}{\,\hdashrule[\raisetraitblocexo]{\fill}{\eptraitblocexo}{\eptraitblocexospace}\null}%
{non}{\hfill\null}%
{aucun}{}%
}%
+ }%
%la décoration, manuelle
- {#2}
- }
- }
+ {\tmpstyleblocexo\textcolor{macouleurblocexodeco}{#2}}%
+ }%
+ }%
}%
- \noindent\tcolorbox[monstyleblocexo,monstyleblocexotitre,monstyleblocexobreakable,monstylebloexobordures]
+ \IfStrEq{\EnvtExoAltBordures}{simple}%
+ {%
+ \noindent\tcolorbox[monstyleblocexo,monstyleblocexobreakable,monstylebloexobordures,notitle]
+ {\tmpstyleblocexo\EnvtExoAltCpltTitre%
+ \IfStrEq{\EnvtExoAltEtoiles}{}{}%les étoiles au début...
+ {%
+ \space(%
+ \IfSubStr{\EnvtExoAltEtoiles}{§}%
+ {%
+ \StrCut{\EnvtExoAltEtoiles}{§}{\EnvtExoStarNb}{\EnvtExoStarTot}%
+ {\pictostars[colors=macouleurblocexodeco/macouleurblocexodecofond]{\EnvtExoStarNb/\EnvtExoStarTot}}%
+ }%
+ {%
+ {\pictostars[colors=macouleurblocexodeco/macouleurblocexodecofond]{\EnvtExoStarNb}}%
+ }%
+ )%
+ }%
+ }%
+ }%
+ {%
+ \noindent\tcolorbox[monstyleblocexo,monstyleblocexotitre,monstyleblocexobreakable,monstylebloexobordures]
+ }%
}%
{%
\endtcolorbox%
Modified: trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-tikzpictos.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-tikzpictos.sty 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/tex/latex/customenvs/customenvs-tikzpictos.sty 2025-08-31 19:22:00 UTC (rev 76198)
@@ -2,9 +2,11 @@
% licence.........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{customenvs-tikzpictos}[2025/08/04 0.1.5 Small pictograms, made with tikz]
+\ProvidesPackage{customenvs-tikzpictos}[2025/08/30 0.1.7 Small pictograms, made with tikz]
%====HISTORY
+% v 0.1.7 Rings + Rubik's Cube
+% v 0.1.6 Bugfix with pictostars (raisebox...)
% v 0.1.5 Inline badge (inspired by tikz-shields) + small stamp
% v 0.1.4 Strut option for sample characters + difficultylevels + dballs + stamp
% v 0.1.3 Clippy
@@ -20,7 +22,7 @@
\RequirePackage{ifthen}
\RequirePackage{calc}
\RequirePackage{tikz}
-\usetikzlibrary{shapes.geometric,bbox}
+\usetikzlibrary{shapes.geometric,bbox,calc}
\RequirePackage{tcolorbox}
\tcbuselibrary{skins}
@@ -51,6 +53,13 @@
dstrut={\sampledstrutletters}
}
+\newcommand\intpictostars{%
+ \foreach \X in {1,...,\tkzLevelStarsMaxLevel}{%
+ \xdef\tmpxfill{\xintfloateval{min(1,max(1+(\pictotmpnbetoiles)-\X,0))}}%
+ \path ({\X*(\pictotmphauteuretoiles+\pictotmpoffsetetoiles)},0) node[star,draw,star point height={0.25\pictotmphauteuretoiles},minimum size={\pictotmphauteuretoiles},inner sep=0pt,path picture={\fill (path picture bounding box.south west) rectangle ([xshift=\tmpxfill*0.9515*\pictotmphauteuretoiles]path picture bounding box.north west);}]{};
+ }%
+}
+
\NewDocumentCommand{\pictostars}{O{}D<>{}m}{%(OK) modif avec hauteur
%#1=clés
%#2=options tikz
@@ -84,6 +93,8 @@
\setlength{\pictotmphauteuretoiles}{0.975\pictotmphauteuretoiles}%
%classic tikzpicture
\begin{tikzpicture}[bezier bounding box,fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\pictotmphauteuretoiles},line width={0.05\pictotmphauteuretoiles},#2]
+ \intpictostars
+ \end{tikzpicture}%
}{}%
\IfStrEq{\pictotmpheightetetoiles}{dauto}%
{%
@@ -91,19 +102,22 @@
\setlength{\pictotmphauteuretoiles}{0.975\pictotmphauteuretoiles}%
\settodepth{\pictotmpprofondeuretoiles}{\hbox{\pictotmpdstrutetetoiles}}%
%raised tikzpicture
- \begin{tikzpicture}[bezier bounding box,baseline={-\pictotmpprofondeuretoiles},fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\pictotmphauteuretoiles},line width={0.05\pictotmphauteuretoiles},#2]
- }{}%
+ %\begin{tikzpicture}[bezier bounding box,baseline={-1.25\pictotmpprofondeuretoiles},fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\pictotmphauteuretoiles},line width={0.05\pictotmphauteuretoiles},#2]
+ \raisebox{\dimexpr-\pictotmpprofondeuretoiles+0.025\pictotmphauteuretoiles\relax}{%
+ \begin{tikzpicture}[bezier bounding box,fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\pictotmphauteuretoiles},line width={0.05\pictotmphauteuretoiles},#2]
+ \intpictostars
+ \end{tikzpicture}%
+ }%
+ }%
+ {}%
}%
{%
\setlength\pictotmphauteuretoiles{\pictotmpheightetetoiles}%
%classic tikzpicture
\begin{tikzpicture}[bezier bounding box,fill=\tkzLevelStarsColorBg,draw=\tkzLevelStarsColor,rounded corners={0.05\pictotmphauteuretoiles},line width={0.05\pictotmphauteuretoiles},#2]
+ \intpictostars
+ \end{tikzpicture}%
}%
- \foreach \X in {1,...,\tkzLevelStarsMaxLevel}{%
- \xdef\tmpxfill{\xintfloateval{min(1,max(1+(\pictotmpnbetoiles)-\X,0))}}%
- \path ({\X*(\pictotmphauteuretoiles+\pictotmpoffsetetoiles)},0) node[star,draw,star point height={0.25\pictotmphauteuretoiles},minimum size={\pictotmphauteuretoiles},inner sep=0pt,path picture={\fill (path picture bounding box.south west) rectangle ([xshift=\tmpxfill*0.9515*\pictotmphauteuretoiles]path picture bounding box.north west);}]{};
- }
- \end{tikzpicture}%
}
%====PICTO SPEEDO
@@ -1820,5 +1834,237 @@
\end{tikzpicture}%
}
+%====RINGS inspiration https://tex.stackexchange.com/posts/323693/timeline (3.0)
+\newlength\tkzRingsHeight
+\newlength\tkzRingsDepth
+\newlength\tkzRingsFullHeight
+
+\defKV[tkzRings]{height=\def\tkzRingsTypeHeight{#1},strut=\def\tkzRingsTypeStrut{#1},dstrut=\def\tkzRingsTypeDstrut{#1},clip bb=\def\tkzRingsClipBB{#1}}
+\setKVdefault[tkzRings]{height=dauto,strut=H,dstrut=qH,clip bb=0pt,color=true}
+
+\definecolor{tkzRings at color@blue}{RGB}{0,120,208} % A blue
+\definecolor{tkzRings at color@yellow}{RGB}{255,177,20} % B yellow
+\definecolor{tkzRings at color@black}{RGB}{0,0,0} % C black
+\definecolor{tkzRings at color@green}{RGB}{0,166,81} % D green
+\definecolor{tkzRings at color@red}{RGB}{240,40,45} % E red
+
+\def\tkzRingsGap(#1,#2)(#3:#4){%
+ ($(#1,#2) + (#3:\tkzRingsOuterWhiteRadius)$)
+ arc(#3:#4:\tkzRingsOuterWhiteRadius) --
+ ($(#1,#2) + (#4:\tkzRingsInnerWhiteRadius)$)
+ arc(#4:#3:\tkzRingsInnerWhiteRadius) --
+ cycle
+}
+
+%constants
+\def\tkzRingsxShift{169.5538bp}%
+\def\tkzRingsyShift{-71.7013bp}%
+\def\tkzRingsRadius{71.6821bp}%
+\def\tkzRingsWhiteLineWidth{3.762bp}%
+\def\tkzRingsColorLineWidth{12.9041bp}%
+%radius
+\pgfmathsetlengthmacro{\tkzRingsInnerColorRadius}{\tkzRingsRadius - \tkzRingsColorLineWidth/2}%
+\pgfmathsetlengthmacro{\tkzRingsOuterColorRadius}{\tkzRingsRadius + \tkzRingsColorLineWidth/2}%
+\pgfmathsetlengthmacro{\tkzRingsInnerWhiteRadius}{\tkzRingsInnerColorRadius - \tkzRingsWhiteLineWidth}%
+\pgfmathsetlengthmacro{\tkzRingsOuterWhiteRadius}{\tkzRingsOuterColorRadius + \tkzRingsWhiteLineWidth}%
+%centers
+\def\tkzRingsxA{0pt}%
+\def\tkzRingsyA{0pt}%
+\pgfmathsetlengthmacro{\tkzRingsxC}{\tkzRingsxA + \tkzRingsxShift}%
+\let\tkzRingsyC\tkzRingsyA%
+\pgfmathsetlengthmacro{\tkzRingsxE}{\tkzRingsxC + \tkzRingsxShift}%
+\let\tkzRingsyE\tkzRingsyC%
+\pgfmathsetlengthmacro{\tkzRingsxB}{(\tkzRingsxA + \tkzRingsxC)/2}%
+\pgfmathsetlengthmacro{\tkzRingsyB}{\tkzRingsxA + \tkzRingsyShift}%
+\pgfmathsetlengthmacro{\tkzRingsxD}{(\tkzRingsxC + \tkzRingsxE)/2}%
+\let\tkzRingsyD\tkzRingsyB%
+%bbox
+\pgfmathsetlengthmacro\tkzRingsllxBB{\tkzRingsxA - \tkzRingsOuterColorRadius}%
+\pgfmathsetlengthmacro\tkzRingsllyBB{\tkzRingsyB - \tkzRingsOuterColorRadius}%
+\pgfmathsetlengthmacro\tkzRingsurxBB{\tkzRingsxE + \tkzRingsOuterColorRadius}%
+\pgfmathsetlengthmacro\tkzRingsuryBB{\tkzRingsyE + \tkzRingsOuterColorRadius}%
+%cliiping bbox
+\pgfmathsetlengthmacro\tkzRingsllxClip{\tkzRingsllxBB - \tkzRingsClipBB}%
+\pgfmathsetlengthmacro\tkzRingsllyClip{\tkzRingsllyBB - \tkzRingsClipBB}%
+\pgfmathsetlengthmacro\tkzRingsurxClip{\tkzRingsurxBB + \tkzRingsClipBB}%
+\pgfmathsetlengthmacro\tkzRingsuryClip{\tkzRingsuryBB + \tkzRingsClipBB}%
+\def\tkzRingsClipBoxArea{(\tkzRingsllxClip, \tkzRingsllyClip) rectangle (\tkzRingsurxClip, \tkzRingsuryClip)}
+
+\newcommand\intTkzRings{%
+ % upper
+ \begin{scope}[even odd rule]
+ \clip \tkzRingsClipBoxArea
+ % yellow ring in blue ring
+ \tkzRingsGap(\tkzRingsxB,\tkzRingsyB)(225:135)
+ % yellow ring in black ring
+ \tkzRingsGap(\tkzRingsxB, \tkzRingsyB)(90:45)
+ % green ring in black ring
+ \tkzRingsGap(\tkzRingsxD, \tkzRingsyD)(225:135)
+ % green ring in red ring
+ \tkzRingsGap(\tkzRingsxD, \tkzRingsyD)(90:45) ;
+ \ifboolKV[tkzRings]{color}%
+ {%
+ \draw[tkzRings at color@blue] (\tkzRingsxA, \tkzRingsyA) circle;
+ \draw[tkzRings at color@black] (\tkzRingsxC, \tkzRingsyC) circle;
+ \draw[tkzRings at color@red] (\tkzRingsxE, \tkzRingsyE) circle;
+ }%
+ {%
+ \draw (\tkzRingsxA, \tkzRingsyA) circle;
+ \draw (\tkzRingsxC, \tkzRingsyC) circle;
+ \draw (\tkzRingsxE, \tkzRingsyE) circle;
+ }%
+ \end{scope}
+ % lower
+ \begin{scope}[even odd rule]
+ \clip \tkzRingsClipBoxArea
+ % blue ring in yellow ring
+ \tkzRingsGap(\tkzRingsxA, \tkzRingsyA)(45:-45)
+ % black ring in yellow ring
+ \tkzRingsGap(\tkzRingsxC, \tkzRingsyC)(225:270)
+ % black ring in green ring
+ \tkzRingsGap(\tkzRingsxC, \tkzRingsyC)(45:-45)
+ % red ring in green ring
+ \tkzRingsGap(\tkzRingsxE, \tkzRingsyE)(225:270) ;
+ \ifboolKV[tkzRings]{color}%
+ {%
+ \draw[tkzRings at color@yellow] (\tkzRingsxB, \tkzRingsyB) circle;
+ \draw[tkzRings at color@green] (\tkzRingsxD, \tkzRingsyD) circle;
+ }%
+ {%
+ \draw (\tkzRingsxB, \tkzRingsyB) circle;
+ \draw (\tkzRingsxD, \tkzRingsyD) circle;
+ }%
+ \end{scope}
+ \useasboundingbox (\tkzRingsllxBB, \tkzRingsllyBB) rectangle (\tkzRingsurxBB, \tkzRingsuryBB);
+}
+\NewDocumentCommand\tkzRings{O{}m}{%
+ \restoreKV[tkzRings]%
+ \setKV[tkzRings]{#1}%
+ %scale
+ \IfSubStr{\tkzRingsTypeHeight}{auto}%
+ {%
+ \IfSubStr{\tkzRingsTypeHeight}{d}%
+ {%
+ \settototalheight\tkzRingsHeight{\hbox{\tkzRingsTypeDstrut}}%
+ \settodepth\tkzRingsDepth{\hbox{\tkzRingsTypeDstrut}}%
+ \pgfmathsetlengthmacro{\tkzRingsFullHeight}{(\tkzRingsyA+\tkzRingsRadius)-(\tkzRingsyB-\tkzRingsRadius)}%
+ \xdef\tkzRingsScale{\fpeval{\tkzRingsHeight/(\tkzRingsFullHeight+\tkzRingsColorLineWidth)}}%
+ \settodepth\tkzRingsDepth{\hbox{\tkzRingsTypeDstrut}}%
+ \raisebox{-\tkzRingsDepth}{%
+ \begin{tikzpicture}[scale=\tkzRingsScale,line width=\fpeval{\tkzRingsScale*\tkzRingsColorLineWidth},radius=\tkzRingsRadius,#2]
+ \intTkzRings
+ \end{tikzpicture}%
+ }%
+ }%
+ {%
+ \settototalheight\tkzRingsHeight{\hbox{\tkzRingsTypeStrut}}%
+ \pgfmathsetlengthmacro{\tkzRingsFullHeight}{(\tkzRingsyA+\tkzRingsRadius)-(\tkzRingsyB-\tkzRingsRadius)}%
+ \xdef\tkzRingsScale{\fpeval{\tkzRingsHeight/(\tkzRingsFullHeight+\tkzRingsColorLineWidth)}}%
+ \begin{tikzpicture}[scale=\tkzRingsScale,line width=\fpeval{\tkzRingsScale*\tkzRingsColorLineWidth},radius=\tkzRingsRadius,#2]
+ \intTkzRings
+ \end{tikzpicture}%
+ }%
+ }%
+ {%
+ %scale
+ \setlength\tkzRingsHeight{\tkzRingsTypeHeight}%
+ \pgfmathsetlengthmacro{\tkzRingsFullHeight}{(\tkzRingsyA+\tkzRingsRadius)-(\tkzRingsyB-\tkzRingsRadius)}%
+ \xdef\tkzRingsScale{\fpeval{\tkzRingsHeight/(\tkzRingsFullHeight+\tkzRingsColorLineWidth)}}%
+ %tikzpicture
+ \begin{tikzpicture}[scale=\tkzRingsScale,line width=\fpeval{\tkzRingsScale*\tkzRingsColorLineWidth},radius=\tkzRingsRadius,#2]
+ \intTkzRings
+ \end{tikzpicture}%
+ }%
+}
+
+%====RUBIK's CUBE
+\RequirePackage{tikz-3dplot}
+\usetikzlibrary{3d}
+
+\setKVdefault[tikzrubik]{height=auto,width=auto,radius=0.1,strut={qM},empty color={},rescale=1}
+\defKV[tikzrubik]{height=\def\tikzrubikmyheight{#1},width=\def\tikzrubikmywidth{#1},radius=\pgfmathsetmacro\tikzrubikradius{#1},strut=\def\tikzrubikstrut{#1},empty color=\def\tikzrubikfillempty{#1},rescale=\def\tikzrubikmycustomscale{#1}}
+
+%====colors
+\definecolor{rcB}{HTML}{0000FF}
+\definecolor{rcW}{HTML}{FFFFFF}
+\definecolor{rcY}{HTML}{FFFF00}
+\definecolor{rcG}{HTML}{008000}
+\definecolor{rcO}{HTML}{FFA500}
+\definecolor{rcR}{HTML}{FF0000}
+%list of colors (array)
+\def\myrubcolors{{"rcW","rcY","rcY","rcR","rcW","rcB","rcW","rcO","rcB","rcG","rcR","rcG","rcR","rcO","rcG","rcY","rcG","rcW","rcB","rcO","rcB","rcG","rcG","rcW","rcO","rcW","rcR"}}
+%====dim
+\newlength\tikrcfixedheight
+\newlength\tikrcfixedwidth
+\setlength\tikrcfixedheight{4.46cm}
+\setlength\tikrcfixedwidth{4.15cm}
+\newlength\tikrcusedheight
+\newlength\tikrcusedwidth
+\newlength\tikrcuseddepth
+
+\newcommand\inttkzrubic{%
+ \begin{tikzpicture}[scale=\tikrcscale,line width=\fpeval{\tikrcscale*0.4}mm,transform shape]
+% \draw[lightgray,xstep=0.1,ystep=0.1] (-2.2,-2.3) grid (2.2,2.3) ;
+% \draw[gray] (-2.2,-2.3) grid (2.2,2.3) ;
+ %\tdplotsetmaincoords{55}{150}%
+ \tdplotsetmaincoords{65}{120}%
+ \begin{scope}[tdplot_main_coords,line join=round,fill=\tikzrubikfillempty]
+ \foreach \X in {-1.5,-0.5,0.5}{
+ \foreach \Y in {-1.5,-0.5,0.5}{
+ %faces1/2/3 (hidden)
+ \draw [canvas is yz plane at x=-1.5,shift={(\X,\Y)}] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
+ \draw [canvas is xz plane at y=-1.5,shift={(\X,\Y)}] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
+ \draw [canvas is yx plane at z=-1.5,shift={(\X,\Y)}] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
+ }
+ }
+ \end{scope}
+ \begin{scope}[tdplot_main_coords,line join=round]
+ \foreach \X [count=\nX starting from 0] in {-1.5,-0.5,0.5}{
+ \foreach \Y [count=\nY starting from 0] in {-1.5,-0.5,0.5}{
+ %faces4/5/6 (view)
+ \pgfmathtruncatemacro{\numposcol}{\nX+3*(2-\nY)}
+ \pgfmathsetmacro{\myrccolor}{\myrubcolors[\numposcol]}
+ \draw [canvas is yz plane at x=1.5,shift={(\X,\Y)},fill=\myrccolor] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
+ \pgfmathtruncatemacro{\numposcol}{2-\nX+3*(2-\nY)+9}
+ \pgfmathsetmacro{\myrccolor}{\myrubcolors[\numposcol]}
+ \draw [canvas is xz plane at y=1.5,shift={(\X,\Y)},fill=\myrccolor] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
+ \pgfmathtruncatemacro{\numposcol}{2-\nY+3*\nX+18}
+ \pgfmathsetmacro{\myrccolor}{\myrubcolors[\numposcol]}
+ \draw [canvas is yx plane at z=1.5,shift={(\X,\Y)},fill=\myrccolor] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
+ }
+ }
+ \end{scope}
+ \end{tikzpicture}%
+}
+
+\NewDocumentCommand\tkzPuzzleCube{ !O{} }{%
+ \restoreKV[tikzrubik]%
+ \setKV[tikzrubik]{#1}%
+ \ifthenelse{\equal{\tikzrubikmyheight}{auto}}%
+ {%
+ \ifthenelse{\equal{\tikzrubikmywidth}{auto}}%
+ {%full auto (inline ?)
+ \settototalheight\tikrcusedheight{\hbox{\tikzrubikstrut}}%
+ \settodepth\tikrcuseddepth{\hbox{\tikzrubikstrut}}%
+ \xdef\tikrcscale{\fpeval{\tikzrubikmycustomscale*\tikrcusedheight/\tikrcfixedheight}}%
+ \raisebox{\dimexpr-\tikrcuseddepth+0.5\tikrcusedheight-\fpeval{0.5*\tikzrubikmycustomscale}\tikrcusedheight\relax}{\inttkzrubic}%
+ }%
+ {%width given
+ \setlength\tikrcusedwidth{\tikzrubikmywidth}%
+ \xdef\tikrcscale{\fpeval{\tikrcusedwidth/\tikrcfixedwidth}}%
+ \inttkzrubic
+ }%
+ }%
+ {%
+ \ifthenelse{\equal{\tikzrubikmywidth}{auto}}%
+ {%height given
+ \setlength\tikrcusedheight{\tikzrubikmyheight}%
+ \xdef\tikrcscale{\fpeval{\tikrcusedheight/\tikrcfixedheight}}%
+ \inttkzrubic
+ }%
+ {}%
+ }%
+}
+
\endinput
\ 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 2025-08-31 19:21:47 UTC (rev 76197)
+++ trunk/Master/texmf-dist/tex/latex/customenvs/customenvs.sty 2025-08-31 19:22:00 UTC (rev 76198)
@@ -3,9 +3,10 @@
% 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}[2025/08/04 0.41b Custom classic environments]
+\ProvidesPackage{customenvs}[2025/08/30 0.41c Custom classic environments]
%====HISTORIQUE
+% v 0.41c Enhancements with subpackages + boîte avec ornaments/postforum (l3e)
% v 0.41b New BlocExo (workinprogress) + precompat fa(567) + new pictos
% v 0.41a Bugfix with inlinegraphicx and MiKTeX...
% v 0.40f WhatsApp like Chat
@@ -4657,4 +4658,227 @@
fontupper=\ProjectWaFonte,boxsep=0mm,boxrule=0pt,colframe=white]{\scalebox{0.4}[0.4]{#1}}%
}
+%====TCBOX ORNEMENTS
+\ExplSyntaxOn
+
+\fp_new:N \l_tikz_ornaments_hstretch_fp
+\dim_new:N \l_tikz_ornaments_linewidth_dim
+\dim_new:N \l_tikz_ornaments_vsize_dim
+\dim_new:N \l_tikz_ornaments_hsize_dim
+\dim_new:N \l_tikz_ornaments_border_dim
+\tl_new:N \l_tikz_ornaments_color_tl
+\bool_new:N \l_tikz_ornaments_altdeco_bool
+
+\cs_new_protected:Npn \inttikzorncorner:nn #1#2
+{
+ \begin{scope}[
+ line~width={\dim_use:N \l_tikz_ornaments_linewidth_dim},
+ shift={(#1)},
+ #2,
+ color={\tl_use:N \l_tikz_ornaments_color_tl},
+ transform~shape
+ ]
+ % Décoration principale
+ \draw (0,{\dim_use:N \l_tikz_ornaments_vsize_dim}) -- (0, {\dim_eval:n { 0.4 \l_tikz_ornaments_border_dim }}) -- (\dim_eval:n { 0.8 \l_tikz_ornaments_border_dim}, \dim_eval:n {0.4 \l_tikz_ornaments_border_dim}) |-++ (\dim_eval:n { -0.4 \l_tikz_ornaments_border_dim }, \dim_eval:n { 0.4 \l_tikz_ornaments_border_dim }) |- (\dim_use:N \l_tikz_ornaments_hsize_dim, 0);
+ % Carré
+ \draw (\dim_eval:n { 0.2 \l_tikz_ornaments_border_dim }, \dim_eval:n { 0.2 \l_tikz_ornaments_border_dim }) rectangle (\dim_use:N \l_tikz_ornaments_border_dim, \dim_use:N \l_tikz_ornaments_border_dim);
+ % Décoration secondaire verticale
+ \draw (\dim_eval:n { 0.2 \l_tikz_ornaments_border_dim }, {\dim_use:N \l_tikz_ornaments_border_dim + 1.25mm}) -- (\dim_eval:n { 0.2 \l_tikz_ornaments_border_dim }, {\dim_use:N \l_tikz_ornaments_vsize_dim - 1.25mm});
+ % Décoration secondaire horizontale
+ \draw (\dim_use:N \l_tikz_ornaments_border_dim + 1.25mm, \dim_eval:n { 0.2 \l_tikz_ornaments_border_dim }) -- ({\dim_use:N \l_tikz_ornaments_hsize_dim - 1.25mm}, \dim_eval:n { 0.2 \l_tikz_ornaments_border_dim });
+ \end{scope}
+}
+
+\tcbset{
+ tikz~bordures~ornaments/.style={
+ enhanced,
+ frame~empty,
+ boxsep=0pt,
+ top=0.15mm+\dim_use:N \l_tikz_ornaments_border_dim,
+ left=0.15mm+\dim_use:N \l_tikz_ornaments_border_dim,
+ right=0.15mm+\dim_use:N \l_tikz_ornaments_border_dim,
+ bottom=0.15mm+\dim_use:N \l_tikz_ornaments_border_dim,
+ opacityfill=0,
+ finish~unbroken={
+ \bool_if:NT \l_tikz_ornaments_altdeco_bool
+ {
+ \draw[line~width=\dim_use:N \l_tikz_ornaments_linewidth_dim, \tl_use:N \l_tikz_ornaments_color_tl!25, opacity=0.5] ([shift={(\dim_use:N \l_tikz_ornaments_border_dim, \dim_use:N \l_tikz_ornaments_border_dim)}]frame.south~west) rectangle ([shift={(-\dim_use:N \l_tikz_ornaments_border_dim, -\dim_use:N \l_tikz_ornaments_border_dim)}]frame.north~east);
+ }
+ \begin{scope}%south west
+ \clip ([xshift={\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }}, yshift={\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }}]frame.south~west) -- ([xshift={\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }}]frame.west) -- ([yshift={\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }}]frame.south) -- cycle;
+ \inttikzorncorner:nn {frame.south~west} {}
+ \end{scope}
+ \begin{scope}%north west
+ \clip ([xshift=\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }, yshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }]frame.north~west) -- ([xshift=\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }]frame.west) -- ([yshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }]frame.north) -- cycle;
+ \inttikzorncorner:nn {frame.north~west} {yscale=-1}
+ \end{scope}
+ \begin{scope}%north east
+ \clip ([xshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }, yshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }]frame.north~east) -- ([xshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }]frame.east) -- ([yshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }]frame.north) -- cycle;
+ \inttikzorncorner:nn {frame.north~east} {scale=-1}
+ \end{scope}
+ \begin{scope}%south east
+ \clip ([xshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }, yshift=\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }]frame.south~east) -- ([xshift=\dim_eval:n { 0.5 \l_tikz_ornaments_linewidth_dim }]frame.east) -- ([yshift=\dim_eval:n { -0.5 \l_tikz_ornaments_linewidth_dim }]frame.south) -- cycle;
+ \inttikzorncorner:nn {frame.south~east} {xscale=-1}
+ \end{scope}
+ }
+ }
+}
+
+\keys_define:nn { tcboxornaments }
+{
+ v~size~deco .dim_set:N = \l_tikz_ornaments_vsize_dim,
+ h~size~deco .dim_set:N = \l_tikz_ornaments_hsize_dim,
+ linewidth~deco .dim_set:N = \l_tikz_ornaments_linewidth_dim,
+ color~deco .tl_set:N = \l_tikz_ornaments_color_tl,
+ alt~deco .bool_set:N = \l_tikz_ornaments_altdeco_bool,
+ h~stretch~deco .fp_set:N = \l_tikz_ornaments_hstretch_fp,
+ inner~size~deco .dim_set:N = \l_tikz_ornaments_border_dim,
+ v~size~deco .initial:n = {1.5cm},
+ h~size~deco .initial:n = {0pt},
+ linewidth~deco .initial:n = {0.2mm},
+ color~deco .initial:n = {black},
+ alt~deco .initial:n = {false},
+ h~stretch~deco .initial:n = {1},
+ inner~size~deco .initial:n = {3.6mm}
+}
+
+\NewDocumentEnvironment{tcboxornaments}{ O{} m }
+{%
+ \keys_set:nn { tcboxornaments } {#1}%
+ \dim_compare:nNnT { \l_tikz_ornaments_hsize_dim } = { 0pt }
+ {%
+ % auto calc
+ \dim_set:Nn \l_tikz_ornaments_hsize_dim { \fp_eval:n {\l_tikz_ornaments_hstretch_fp * \l_tikz_ornaments_vsize_dim}pt }%
+ }%
+ \tcolorbox[tikz~bordures~ornaments, #2]%
+}%
+{%
+ \endtcolorbox%
+}%
+\ExplSyntaxOff
+
+%====tcboxforumpost
+\ExplSyntaxOn
+
+\dim_new:N \g_tcbox_forum_post_offset_dim
+\dim_new:N \g_tcbox_forum_post_heightpseudo_dim
+\dim_new:N \g_tcbox_forum_post_left_margin
+\dim_new:N \g_tcbox_forum_post_width_avatar_dim
+%\dim_new:N \g_tcbox_forum_post_width_dim
+\dim_new:N \g_tcbox_forum_post_trideco_dim
+\tl_new:N \g_tcbox_forum_post_pseudo_tl
+\tl_new:N \g_tcbox_forum_post_alt_pseudo_tl
+\tl_new:N \g_tcbox_forum_post_bg_color
+\tl_new:N \g_tcbox_forum_post_rule_color
+\tl_new:N \g_tcbox_forum_post_avatar_tl
+
+\keys_define:nn { tcforumpost }
+{
+% width .dim_set:N = \g_tcbox_forum_post_width_dim,
+ height-pseudo .dim_set:N = \g_tcbox_forum_post_heightpseudo_dim,
+ deco-length .dim_set:N = \g_tcbox_forum_post_trideco_dim,
+ left-margin .dim_set:N = \g_tcbox_forum_post_left_margin,
+ pseudo .tl_set:N = \g_tcbox_forum_post_pseudo_tl,
+ alt-pseudo .tl_set:N = \g_tcbox_forum_post_alt_pseudo_tl,
+ fill-color .tl_set:N = \g_tcbox_forum_post_bg_color,
+ rule-color .tl_set:N = \g_tcbox_forum_post_rule_color,
+ avatar .tl_set:N = \g_tcbox_forum_post_avatar_tl
+}
+
+\keys_set:nn { tcforumpost }
+{
+% width = {\textwidth},
+ deco-length = 3mm,
+ height-pseudo = 3mm,
+ pseudo = \LaTeX,
+ left-margin = 1.5cm,
+ alt-pseudo = beginner,
+ fill-color = teal!10,
+ rule-color = blue!50!black,
+ avatar = {\includegraphics[height={\fp_eval:n {0.75 * \g_tcbox_forum_post_width_avatar_dim}pt}]{vectorlogo-ctanlion}},
+}
+
+\tikzset{
+ forum~style~post~font~pseudo/.style={inner~sep=0pt,font=\sffamily\bfseries,text=white},
+ forum~style~post~font~altpseudo/.style={inner~sep=0pt,font=\sffamily,text=\g_tcbox_forum_post_rule_color},
+}
+
+\tcbset{
+ forum~style~post/.style={
+ enhanced,
+ frame~empty,
+ boxsep=0pt,
+ %width=\dim_use:N \g_tcbox_forum_post_width_dim,
+ left~skip=\dim_use:N \g_tcbox_forum_post_left_margin,
+ top=2mm,
+ left=2mm,
+ right=2mm,
+ bottom=2mm,
+ opacityfill=0,
+ underlay~unbroken={
+ \coordinate (AVATAR-SOUTH-WEST) at
+ ([xshift={-\g_tcbox_forum_post_offset_dim-\g_tcbox_forum_post_width_avatar_dim},yshift=-\g_tcbox_forum_post_width_avatar_dim]frame.north~west);
+ \coordinate (PSEUDO-SOUTH-WEST) at
+ ([xshift={-\g_tcbox_forum_post_offset_dim-\g_tcbox_forum_post_width_avatar_dim},yshift={-\g_tcbox_forum_post_width_avatar_dim-\g_tcbox_forum_post_heightpseudo_dim}]frame.north~west);
+ \coordinate (PSEUDO) at
+ ([xshift={0.5\g_tcbox_forum_post_width_avatar_dim},yshift={-0.5\g_tcbox_forum_post_heightpseudo_dim}]AVATAR-SOUTH-WEST);
+ \coordinate (PSEUDO-ALT) at
+ ([xshift={0.5\g_tcbox_forum_post_width_avatar_dim},yshift={-0.5\g_tcbox_forum_post_heightpseudo_dim}]PSEUDO-SOUTH-WEST);
+ % Boîte de gauche
+ \fill[\g_tcbox_forum_post_bg_color]
+ ([xshift=-\g_tcbox_forum_post_offset_dim]frame.north~west)
+ rectangle++ (-\g_tcbox_forum_post_width_avatar_dim,-\g_tcbox_forum_post_width_avatar_dim-2\g_tcbox_forum_post_heightpseudo_dim);
+ % Avatar
+ \begin{scope}
+ \clip ([xshift=-\g_tcbox_forum_post_offset_dim]frame.north~west)
+ rectangle++ (-\g_tcbox_forum_post_width_avatar_dim,-\g_tcbox_forum_post_width_avatar_dim);
+ \node at
+ ([xshift={-0.5\g_tcbox_forum_post_width_avatar_dim-\g_tcbox_forum_post_offset_dim},yshift={-0.5\g_tcbox_forum_post_width_avatar_dim}]frame.north~west)
+ {\g_tcbox_forum_post_avatar_tl};
+ \end{scope}
+ % Pseudo
+ \begin{scope}
+ \filldraw[\g_tcbox_forum_post_rule_color,line~width=0.2mm]
+ (AVATAR-SOUTH-WEST) rectangle++ (\g_tcbox_forum_post_width_avatar_dim,-\g_tcbox_forum_post_heightpseudo_dim);
+ \clip (AVATAR-SOUTH-WEST) rectangle++ (\g_tcbox_forum_post_width_avatar_dim,-\g_tcbox_forum_post_heightpseudo_dim);
+ \node at (PSEUDO)
+ [forum~style~post~font~pseudo]
+ {\resizebox*{!}{0.75\g_tcbox_forum_post_heightpseudo_dim}{\vphantom{(qM)}\g_tcbox_forum_post_pseudo_tl}};
+ \end{scope}
+ % Pseudo alternatif
+ \begin{scope}
+ \clip (PSEUDO-SOUTH-WEST) rectangle++ (\g_tcbox_forum_post_width_avatar_dim,-\g_tcbox_forum_post_heightpseudo_dim);
+ \node at (PSEUDO-ALT)
+ [forum~style~post~font~altpseudo]
+ {\resizebox*{!}{0.667\g_tcbox_forum_post_heightpseudo_dim}{\vphantom{(qM)}\g_tcbox_forum_post_alt_pseudo_tl}};
+ \end{scope}
+ % Bordure de la boîte de gauche
+ \draw[\g_tcbox_forum_post_rule_color,line~width=0.2mm]
+ ([xshift=-\g_tcbox_forum_post_offset_dim]frame.north~west)
+ rectangle++ (-\g_tcbox_forum_post_width_avatar_dim,-\g_tcbox_forum_post_width_avatar_dim-2\g_tcbox_forum_post_heightpseudo_dim);
+ % Bulle
+ \draw[\g_tcbox_forum_post_rule_color,fill={\g_tcbox_forum_post_bg_color},line~width=0.2mm,line~join=round,rounded~corners=0.3mm]
+ (frame.north~west) -- (frame.north~east) -- (frame.south~east) -- (frame.south~west) -- ([yshift=\dim_eval:n { -1.75 \g_tcbox_forum_post_trideco_dim}]frame.north~west) --++ ({-\g_tcbox_forum_post_offset_dim},0.5\g_tcbox_forum_post_offset_dim) -++ ({\g_tcbox_forum_post_offset_dim},0.5\g_tcbox_forum_post_offset_dim) -- cycle;
+ },
+ }
+}
+
+\NewDocumentEnvironment{tcforumpost}{ O{} m }
+{
+ \keys_set:nn { tcforumpost } { #1 }
+ %dim
+ \dim_gset:Nn \g_tcbox_forum_post_offset_dim
+ {
+ \fp_eval:n { sqrt(3)/2 * \dim_to_fp:n { \g_tcbox_forum_post_trideco_dim } } pt
+ }
+ \dim_gset:Nn \g_tcbox_forum_post_width_avatar_dim
+ { \g_tcbox_forum_post_left_margin - \g_tcbox_forum_post_offset_dim }
+ \tcolorbox[forum~style~post,#2]
+}
+{
+ \endtcolorbox
+}
+
+\ExplSyntaxOff
+
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.