diff options
author | Norbert Preining <norbert@preining.info> | 2023-04-05 03:02:06 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-04-05 03:02:06 +0000 |
commit | 085271aaf9917d7116be9774c6cd0a117aa4111e (patch) | |
tree | f222fa9f21aed2a069c8d380429558a802964b66 /macros/latex | |
parent | e9f267fd4c8414d6146c5fee0dbe459613dd0f3b (diff) |
CTAN sync 202304050302
Diffstat (limited to 'macros/latex')
24 files changed, 650 insertions, 114 deletions
diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf Binary files differindex 962b919ad3..f44e4ef13a 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex index a1d113a5fe..51bd79b3e7 100644 --- a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.tex @@ -5,8 +5,8 @@ % arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') \documentclass[a4paper,french,11pt]{article} -\def\PLversion{2.5.6} -\def\PLdate{31 Mars 2023} +\def\PLversion{2.5.7} +\def\PLdate{4 Avril 2023} \usepackage{ProfLycee} \useproflyclib{piton,minted,pythontex} %\usepackage{lualatex-math} @@ -568,6 +568,7 @@ Elles sont présentées de manière \textit{succincte}, mais elles sont présent \begin{CodePythonLst}(*)[largeur]{commandes tcbox}...\end{CodePythonLst} %:=librairie piton \begin{CodePiton}[options]...\end{CodePiton} +\begin{PitonConsole}[options Piton]<Clés>{paramètres tcbox}...\end{PitonConsole} %:=librairie pythontex \begin{CodePythontex}[options]...\end{CodePythontex} \begin{ConsolePythontex}[options]...\end{ConsolePythontex} @@ -2327,14 +2328,17 @@ def trace_parabole_tableaux(): \begin{codeinfo} \cmaj{2.5.0} Cette section nécessite de charger la \textsf{librairie} \clib{piton} dans le préambule. + +\cmaj{2.5.7} Une console Python est disponible, elle nécessite le package \ctex{pyluatex}, qui n'est pas chargé par \ctex{ProfLycee}, du fait de l'obligation de spécifier le \textit{chemin} pour l'exécutable Python ! \end{codeinfo} \begin{codetex}[listing only] +\usepackage[executable=...]{pyluatex} %si utilisation de la console REPL \useproflyclib{piton} \end{codetex} \begin{codeinfo} -\cmaj{2.0.0} La \textsf{librairie} \clib{piton} (qui charge \ctex{piton}, est compatible uniquement avec \hologo{LuaLaTeX} !) permet d'insérer du code Python avec une coloration syntaxique en utilisant la bibliothèque \textsf{Lua LPEG}. +La \textsf{librairie} \clib{piton} (qui charge \ctex{piton}, est compatible uniquement avec \hologo{LuaLaTeX} !) permet d'insérer du code Python avec une coloration syntaxique en utilisant la bibliothèque \textsf{Lua LPEG}. \smallskip @@ -2342,17 +2346,23 @@ En \textit{partenariat} avec \ctex{tcolorbox}, on peut avoir une présentation d \smallskip -\cmaj{2.0.2} Depuis la version \ctex{0.95} de \ctex{piton}, \Cle{left-margin=auto} est disponible et activée dans \ctex{ProfLycee}. +Depuis la version \ctex{0.95} de \ctex{piton}, \Cle{left-margin=auto} est disponible et activée dans \ctex{ProfLycee}. -\cmaj{2.1.2} Depuis la version \ctex{0.99} de \ctex{piton}, \Cle{break-lines} est disponible et activée dans \ctex{ProfLycee}. +Depuis la version \ctex{0.99} de \ctex{piton}, \Cle{break-lines} est disponible et activée dans \ctex{ProfLycee}. -\cmaj{2.1.3} Depuis la version \ctex{1.0} de \ctex{piton}, \Cle{tabs-auto-gobble} est disponible et activée dans \ctex{ProfLycee}. +Depuis la version \ctex{1.0} de \ctex{piton}, \Cle{tabs-auto-gobble} est disponible et activée dans \ctex{ProfLycee}. \end{codeinfo} \begin{codeattention} Le package \ctex{piton} nécessite donc obligatoirement l’emploi de \hologo{LuaLaTeX} ! -\cmaj{2.0.1} Ce package n'est chargé que si la compilation détectée est en \hologo{LuaLaTeX} ! +Ce package n'est chargé que si la compilation détectée est en \hologo{LuaLaTeX} ! + +\smallskip + +\cmaj{2.5.7} L'utilisation de la console \textbf{REPL} nécessite une compilation en \ctex{--shell-escape} ou \ctex{-write18} ! + +\cmaj{2.5.7} Les packages \ctex{pyluatex} et \ctex{pythontex} utilisent des commandes de même nom, donc la présente documentation n'utilisera pas le package \ctex{pyluatex}. Une documentation annexe spécifique est disponible. \end{codeattention} \subsection{Présentation de code Python} @@ -2363,25 +2373,29 @@ Le package \ctex{piton} nécessite donc obligatoirement l’emploi de \hologo{Lu \end{CodePiton} \end{codetex} -%\begin{codeattention} -%Les environnements créés par \ctex{piton} et \ctex{tcolorbox} ne sont -- a priori -- pas compatibles avec les options de type \Cle{gobble} (pour supprimer les tabulations d'environnement), donc il faut bien penser à \og aligner \fg{} le code à gauche, pour éviter des tabulations non esthétiques ! -%\end{codeattention} - \begin{codecles} Plusieurs \Cle{clés} sont disponibles : \begin{itemize} \item la clé booléenne \Cle{Lignes} pour afficher ou non les numéros de lignes ; \hfill{}défaut \Cle{true} - \item \cmaj{2.1.3} la clé booléenne \Cle{Gobble} pour activer les options liées au \textsf{gobble} ; \hfill{}défaut \Cle{true} + \item la clé booléenne \Cle{Gobble} pour activer les options liées au \textsf{gobble} ; \hfill{}défaut \Cle{true} \item la clé \Cle{Largeur} qui correspond à la largeur de la \ctex{tcbox} ; \hfill{}défaut \Cle{\textbackslash linewidth} \item la clé \Cle{TaillePolice} pour la taille des caractères ; \hfill{}défaut \Cle{\textbackslash footnotesize} - \item la clé \Cle{Alignement} qui paramètre l'alignement de la \ctex{tcbox}. \hfill{}défaut \Cle{center} + \item la clé \Cle{Alignement} qui paramètre l'alignement de la \ctex{tcbox} ; \hfill{}défaut \Cle{center} + \item \cmaj{2.5.7} la clé \Cle{Style} (parmi \Cle{Moderne / Classique}) pour changer le style ; \hfill{}défaut \Cle{Moderne} + \item \cmaj{2.5.7} le boolén \Cle{Filigrane} pour afficher, le logo {\small \faPython} en filigrane ; \hfill{}défaut \Cle{false} + \item \cmaj{2.5.7} le boolén \Cle{BarreTitre} (si \Cle{Style=Moderne}) pour afficher le titre ; \hfill{}défaut \Cle{true} + \item \cmaj{2.5.7} le boolén \Cle{Cadre} (si \Cle{Style=Moderne}) pour afficher le cadre. \hfill{}défaut \Cle{true} \end{itemize} \end{codecles} +\begin{codeinfo} +Du fait du paramétrage des boîtes \ctex{tcolorbox}, il se peut que le rendu soit non conforme si elle doit être insérée dans une autre \ctex{tcolorbox}\ldots{} ! +\end{codeinfo} + \begin{codetex}[listing only] \begin{CodePiton} -#environnement piton avec numéros de ligne, pleine largeur +#environnement piton avec numéros de ligne, pleine largeur, style moderne def arctan(x,n=10): if x < 0: return -arctan(-x) #> (appel récursif) @@ -2392,9 +2406,32 @@ def arctan(x,n=10): \end{CodePiton} \end{codetex} -\begin{codesortie} \begin{CodePiton} -#environnement piton avec numéros de ligne, pleine largeur +#environnement piton avec numéros de ligne, pleine largeur, style moderne +def arctan(x,n=10): + if x < 0: + return -arctan(-x) #> (appel récursif) + elif x > 1: + return pi/2 - arctan(1/x) #> (autre appel récursif) + else: + return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) ) +\end{CodePiton} + +\begin{codetex}[listing only] +\begin{CodePiton}[Style=Classique] +#environnement piton avec numéros de ligne, pleine largeur, style classique +def arctan(x,n=10): + if x < 0: + return -arctan(-x) #> (appel récursif) + elif x > 1: + return pi/2 - arctan(1/x) #> (autre appel récursif) + else: + return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) ) +\end{CodePiton} +\end{codetex} + +\begin{CodePiton}[Style=Classique] +#environnement piton avec numéros de ligne, pleine largeur, style classique def arctan(x,n=10): if x < 0: return -arctan(-x) #> (appel récursif) @@ -2403,7 +2440,6 @@ def arctan(x,n=10): else: return sum( (-1)**k/(2*k+1)*x**(2*k+1) for k in range(n) ) \end{CodePiton} -\end{codesortie} \begin{codetex}[listing only] \begin{CodePiton}[Alignement=flush right,Largeur=13cm] @@ -2418,15 +2454,21 @@ def f(x) : \begin{itemize} %Avec des indentations d'environnement : \item On essaye avec un \texttt{itemize} : - - \begin{CodePiton}[Largeur=9cm] + % + \begin{CodePiton}[Largeur=12cm,Style=Classique,Cadre=false] + def f(x) : + return x**2 + \end{CodePiton} + \item Et avec un autre \texttt{itemize} : + % + \begin{CodePiton}[Largeur=12cm,Style=Classique,Cadre=false,BarreTitre=false] + #avec numéros, de largeur 12cm, centré, classique, sans cadre/titre def f(x) : return x**2 \end{CodePiton} \end{itemize} \end{codetex} -\begin{codesortie} \begin{CodePiton}[Alignement=flush right,Largeur=13cm] #avec numéros, de largeur 13cm, aligné à droite def f(x) : @@ -2441,14 +2483,26 @@ def f(x) : \begin{itemize} \item On essaye avec un \texttt{itemize} : - - \begin{CodePiton}[Largeur=9cm] - #avec numéros, de largeur 9cm, centré + % + \begin{CodePiton}[Largeur=12cm,Style=Classique,Cadre=false] + #avec numéros, de largeur 12cm, centré, classique, sans cadre + def f(x) : + return x**2 + \end{CodePiton} + \item Et avec un autre \texttt{itemize} : + % + \begin{CodePiton}[Largeur=12cm,Style=Classique,BarreTitre=false,Cadre=false] + #avec numéros, de largeur 12cm, centré, classique, sans cadre/titre def f(x) : return x**2 \end{CodePiton} \end{itemize} -\end{codesortie} + +\subsection{Console en partenariat avec Pyluatex} + +\begin{codeinfo} +\cmaj{2.5.7} Une console d'exécution (type REPL) est disponible, et la documentation associée est en marge de la présente documentation. +\end{codeinfo} \pagebreak @@ -6276,6 +6330,8 @@ La grille, créée en \TikZ, est portée par le rectangle de \og coins \fg{} $(0 \part{Historique} +{\small \bverb|v 2.5.7|~:~~~~Ajout de clés pour les codes \textsf{Piton} + Console via \textsf{Pyluatex} (page \pageref{pythonpiton}) + {\small \bverb|v 2.5.6|~:~~~~Ajout d'une clé \Cle{Trigo} pour l'axe $(Ox)$ (page \pageref{reperagetikz}) {\small \bverb|v 2.5.5|~:~~~~Externalisation de la fenêtre XCas (dans la package \textsf{FentreCas}) diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf Binary files differnew file mode 100644 index 0000000000..6f6dc42f2e --- /dev/null +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.pdf diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex new file mode 100644 index 0000000000..4831d61a84 --- /dev/null +++ b/macros/latex/contrib/proflycee/doc/ProfLycee-exemples-pyluatex.tex @@ -0,0 +1,263 @@ +% !TeX document-id = {fc3853a9-0c9c-4d02-b763-6dc6c85d34db} +% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape] + +\documentclass[french,a4paper,10pt]{article} +\def\PLver{2.5.7} +\usepackage[margin=1.5cm]{geometry} +\usepackage{ProfLycee} +\useproflyclib{piton} +\usepackage[executable=python.exe]{pyluatex} +\usepackage{babel} +\sisetup{locale=FR,output-decimal-marker={,},group-minimum-digits=4} +\usepackage{codehigh} +%\usepackage[most]{tcolorbox} +%\newtcblisting{ShowCodeTeX}[1][]{colback=white,colframe=red!75!black,listing options={style=tcblatex},#1} + +\begin{document} + +\part*{ProfLycee (\PLver), Piton et Pyluatex} + +\section{Code \og Piton \fg{}, indépendant de Pyluatex} + +\subsection{Préambule basique} + +{\small \begin{codehigh} +\documentclass[french,a4paper,10pt]{article} +\usepackage{ProfLycee} +\useproflyclib{piton} % lua +\end{codehigh}} + +\subsection{Exemples} + +{\small \begin{codehigh} +%Sortie par défaut +\begin{CodePiton} +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} +\end{codehigh}} + +\begin{CodePiton} +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} + +{\small \begin{codehigh} +%Sortie avec Style=Classique, Largeur=10cm +\begin{CodePiton}[Style=Classique,Largeur=10cm] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} +\end{codehigh}} + +\begin{CodePiton}[Style=Classique,Largeur=10cm] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} + +\pagebreak + +{\small \begin{codehigh} +%Sortie avec Style=Classique, Sans Titre, Largeur=10cm, centré +\begin{CodePiton}[Style=Classique,Largeur=10cm,BarreTitre=false,Alignement=center] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} +\end{codehigh}} + +\begin{CodePiton}[Style=Classique,Largeur=10cm,BarreTitre=false,Alignement=center] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} + +{\small \begin{codehigh} +%Sortie avec Style=Classique, Largeur=0.5\linewidth, aligné à droite, sans Cadre, avec Filigrane +\begin{CodePiton}% + [Style=Classique,Largeur=0.5\linewidth,Cadre=false,Alignement=flush right,Filigrane,Titre={Script}] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} +\end{codehigh}} + +\begin{CodePiton}[Style=Classique,Largeur=0.5\linewidth,Cadre=false,Alignement=flush right,Filigrane,Titre={Script}] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} + +{\small \begin{codehigh} +%Sortie Moderne, Largeur=11cm, avec Filigrane, aligné à gauche +\begin{CodePiton}[Largeur=11cm,Filigrane,Alignement=flush left] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} +\end{codehigh}} + +\begin{CodePiton}[Largeur=11cm,Filigrane,Alignement=flush left] +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{CodePiton} + +\pagebreak + +\section{Console \og Piton \fg{}, dépendant de Pyluatex} + +\subsection{Préambule, avec le package pyluatex} + +{\small \begin{codehigh} +\documentclass[french,a4paper,10pt]{article} +\usepackage{ProfLycee} +\useproflyclib{piton} +\usepackage[executable=python.exe]{pyluatex} % lua + shell-escape +\end{codehigh}} + +\subsection{Commande} + +{\small \begin{codehigh} +\begin{ConsolePiton}[Options piton]<Clés>{Options tcbox} +... +... +\end{ConsolePiton} +\end{codehigh}} + +\medskip + +Les clés, à placer entre \texttt{<...>}, sont : + +\begin{itemize} + \item \textbf{\textsf{$\langle$Logo$\rangle$}} pour afficher un petit logo dans les \textit{titres} de la console REPL ; \hfill{}défaut : \textbf{\textsf{$\langle$true$\rangle$}} + \item \textbf{\textsf{$\langle$Largeur$\rangle$}} pour spécifier la largeur de la console REPL ; \hfill{}défaut : \textbf{\textsf{$\langle$\textbackslash{}linewidth$\rangle$}} + \item \textbf{\textsf{$\langle$Alignement$\rangle$}} pour spécifier l'alignement de la console REPL.\hfill{}défaut : \textbf{\textsf{$\langle$flush left$\rangle$}} +\end{itemize} + +\subsection{Exemples} + +{\small \begin{codehigh} +%Déclaration d'une fonction python + librairie random pour utilisation ultérieure +\begin{python} +from random import randint + +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{python} +\end{codehigh}} + +\begin{python} +from random import randint + +def valeur_absolue(x): + "Renvoie la valeur absolue de x" + #le petit test qui va bien + if x > 0: + return x + else: + return -x +\end{python} + +{\small \begin{codehigh} +\begin{ConsolePiton}{} +1+1 +2**10 +valeur_absolue(-3) +valeur_absolue(0) +valeur_absolue(5) +print(f"La valeur absolue de 5 est {valeur_absolue(5)}") +print(f"La valeur absolue de -4 est {valeur_absolue(-4)}") +\end{ConsolePiton} +\end{codehigh}} + +\begin{ConsolePiton}{} +1+1 +2**10 +valeur_absolue(-3) +valeur_absolue(0) +valeur_absolue(5) +print(f"La valeur absolue de 5 est {valeur_absolue(5)}") +print(f"La valeur absolue de -4 est {valeur_absolue(-4)}") +\end{ConsolePiton} + +\pagebreak + +{\small \begin{codehigh} +\begin{ConsolePiton}<Largeur=11cm,Alignement=center,Logo=false>{} +1+1 +2**10 +valeur_absolue(-3) +valeur_absolue(0) +valeur_absolue(5) +print(f"La valeur absolue de 5 est {valeur_absolue(5)}") +print(f"La valeur absolue de -4 est {valeur_absolue(-4)}") +liste = [randint(1,20) for i in range(10)] +print(liste) +print(max(liste), min(liste), sum(liste)) +\end{ConsolePiton} +\end{codehigh}} + +\begin{ConsolePiton}<Largeur=11cm,Alignement=center,Logo=false>{} +1+1 +2**10 +valeur_absolue(-3) +valeur_absolue(0) +valeur_absolue(5) +print(f"La valeur absolue de 5 est {valeur_absolue(5)}") +print(f"La valeur absolue de -4 est {valeur_absolue(-4)}") +liste = [randint(1,20) for i in range(10)] +print(liste) +print(max(liste), min(liste), sum(liste)) +\end{ConsolePiton} + +\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index 7726d26e15..b91ab7816d 100644 --- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty +++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty @@ -3,7 +3,9 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2023/03/31 2.5.6 Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2023/04/04 2.5.7 Aide pour l'utilisation de LaTeX en lycee] +% 2.5.7 Ajout d'un style classique pour le code python (Piton + ...) + console piton/pyluatex +% Refonte des commandes tcbset pour les codes % 2.5.6 Ajout d'une clé [Trigo] pour \AxexTikz (avec graduations libres) % "Suppression" de la fenêtre XCas de la documentation % 2.5.5 Correction d'un bug avec la fenetre XCas @@ -398,24 +400,24 @@ %%------PYTHONLISTINGS \tcbset{stylepythonlst/.style={% - enhanced,boxrule=1.25pt,% - leftupper=10pt, - sharp corners=downhill,arc=12pt, - before skip=12pt,after skip=12pt,% - top=10pt,bottom=1mm,rightupper=4pt,%leftupper=25pt, - attach boxed title to top right={yshift=-\tcboxedtitleheight}, - boxed title style={ - size=small,colback=ForestGreen!25,boxrule=1.25pt, - colframe=Green,boxsep=1.25pt, - sharp corners=downhill, - arc=12pt, - top=2pt,bottom=1pt,left=6pt,right=6pt + enhanced,boxrule=1.25pt,% + leftupper=10pt, + sharp corners=downhill,arc=12pt, + before skip=12pt,after skip=12pt,% + top=10pt,bottom=1mm,rightupper=4pt,%leftupper=25pt, + attach boxed title to top right={yshift=-\tcboxedtitleheight}, + boxed title style={ + size=small,colback=ForestGreen!25,boxrule=1.25pt, + colframe=Green,boxsep=1.25pt, + sharp corners=downhill, + arc=12pt, + top=2pt,bottom=1pt,left=6pt,right=6pt }, - colframe=Green,colback=ForestGreen!5,% - fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize, - title={\scriptsize\faPython}\:Code Python\vphantom{p}, - watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50, - listing only,listing engine=listings,% + colframe=Green,colback=ForestGreen!5,% + fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize, + title={\scriptsize\faPython}\:Code Python\vphantom{p}, + watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50, + listing only,listing engine=listings,% } } diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex index 5ba77401bf..1a30544565 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-minted.tex @@ -10,16 +10,16 @@ %%------PYTHONMINTED \tcbset{pytmintedno/.style={% - listing engine=minted,minted style=colorful, - minted language=python,listing only, - minted options={tabsize=4,fontsize=\footnotesize,autogobble}, + listing engine=minted,minted style=colorful, + minted language=python,listing only, + minted options={tabsize=4,fontsize=\footnotesize,autogobble}, } } \tcbset{pytminted/.style={% - listing engine=minted,minted style=colorful, - minted language=python,listing only, - minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt}, + listing engine=minted,minted style=colorful, + minted language=python,listing only, + minted options={tabsize=4,fontsize=\footnotesize,autogobble,xleftmargin=16pt,linenos,numbersep=10pt}, } } diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex index 2bb7dadcc8..7503f17894 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-piton.tex @@ -10,11 +10,15 @@ \RequirePackage{iftex} -%%------PYTHONPITON +%%=============PYTHONPITON + +%==Clés globales \defKV[envpiton]{% Largeur=\def\CODPITlargeur{#1},% Alignement=\def\CODPITalign{#1},% - TaillePolice=\def\CODPITfonte{#1} + TaillePolice=\def\CODPITfonte{#1},% + Style=\def\CODPITstyle{#1},% + Titre=\def\CODPITtitre{#1} } \setKVdefault[envpiton]{% @@ -22,14 +26,20 @@ Alignement=center,% Lignes=true,% Gobble=true,% - TaillePolice=\footnotesize + TaillePolice=\footnotesize,% + Filigrane=false,% + Style=Moderne,% + Cadre=true,% + BarreTitre=true,% + Titre={{\scriptsize\faCode} Code Python} } +%==Style Moderne \tcbset{stylepiton/.style={% enhanced,boxrule=1.25pt,% sharp corners=downhill,arc=12pt, - before skip=12pt,after skip=12pt,% - top=10pt,bottom=1mm,rightupper=4pt,%leftupper=25pt, + before skip=\baselineskip,after skip=\baselineskip,% + top=\baselineskip,bottom=0mm,left=0.6em,right=5mm,% attach boxed title to top right={yshift=-\tcboxedtitleheight}, boxed title style={ size=small,colback=ForestGreen!25,boxrule=1.25pt, @@ -37,31 +47,149 @@ sharp corners=downhill, arc=12pt, top=2pt,bottom=1pt,left=6pt,right=6pt - }, + }, fonttitle=\color{ForestGreen}\itshape\ttfamily\footnotesize, - title={\scriptsize\faPython}\:Code Python\vphantom{p}, - watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50 + title={{\scriptsize\faPython}\:Code Python} + } +} + +%==Style Classique +\tcbset{thonnystyle/.style={% + enhanced,boxrule=0.75pt,colframe=DarkGray!25!Black,% + sharp corners,top=0mm,bottom=0mm,left=0.4em,right=5mm,% + before skip=\baselineskip,after skip=\baselineskip,% + colback=white + } +} + +\tcbset{thonnystylelineos/.style={% + thonnystyle,% + underlay={% + \begin{tcbclipinterior} + \filldraw[lightgray!15] (interior.south west) rectangle ([xshift=1.3em]interior.north west) ; + \end{tcbclipinterior}% + } } } +%==Création de la boîte \ifluatex \RequirePackage{piton} \NewPitonEnvironment{CodePiton}{ O{} }% {% + \tcbset{reset} \useKVdefault[envpiton]% \setKV[envpiton]{#1}% on paramètres les nouvelles clés et on les simplifie + %------les styles piton \ifboolKV[envpiton]{Lignes}%si lignes=true - {\PitonOptions{left-margin=auto,all-line-numbers}}% + {\PitonOptions{left-margin=0.75em,all-line-numbers}}%left-margin=auto, {}% \ifboolKV[envpiton]{Gobble}%si gobble=true {\PitonOptions{tabs-auto-gobble}}% {}% - \PitonOptions{break-lines,indent-broken-lines}% - \begin{tcolorbox}[stylepiton,leftupper=8pt,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign] + \PitonOptions{break-lines,indent-broken-lines}%,numbers-sep=0.65em} + %------les styles tcbox + \IfEq{\CODPITstyle}{Moderne}%style Moderne (défaut) + {% + \tcbset{stylepiton,colframe=Green,colback=ForestGreen!5,width=\CODPITlargeur,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign} + \ifboolKV[envpiton]{Filigrane}%si filigrane + {\tcbset{watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50}}% + {}% + } + {}% + \IfEq{\CODPITstyle}{Classique}%style Classique + {% + \ifboolKV[envpiton]{Lignes}%si lignes=true + {\tcbset{thonnystylelineos,leftupper=0.4em}}% + {\tcbset{thonnystyle,leftupper=0.4em}}% + \tcbset{width=\CODPITlargeur,colframe=darkgray,fontupper=\CODPITfonte,fontlower=\CODPITfonte,\CODPITalign} + \ifboolKV[envpiton]{Filigrane}%si filigrane + {\tcbset{watermark text={\faPython},watermark opacity=0.175,watermark zoom=0.50}}% + {}% + \ifboolKV[envpiton]{BarreTitre}% + {% + \ifboolKV[envpiton]{Cadre} + {} + {\tcbset{boxrule=0pt,frame hidden}} + \tcbset{lefttitle=0.4em,title={\CODPITtitre},fonttitle=\bfseries\footnotesize\sffamily,colbacktitle=DarkGray!25!Black} + }% + {% + \tcbset{notitle} + \ifboolKV[envpiton]{Cadre} + {} + {\tcbset{boxrule=0pt,frame hidden}} + } + } + {}% + %on crée la boîte + \begin{tcolorbox} }% {% \end{tcolorbox}% } \fi + +%======CONSOLE PYLUATEX (package à charger manuellement !!) +\tcbset{consolepylua/.style={%base de la boîte + enhanced,colback=white,colframe=ForestGreen,sharp corners,boxrule=1pt,% + top=1.5mm,bottom=1.5mm,left=2mm,right=2mm,fontupper=\small,% + before skip=\baselineskip,after skip=\baselineskip,% + } +} + +\tcbset{consolepyluatexlogo/.style={%avec logo python + consolepylua,% + overlay={% + \draw ([yshift=0.5pt]frame.south) node[ForestGreen!50!black,fill=white,font=\scriptsize\ttfamily] {\scalebox{0.8}[0.8]{\faPython} Fin de la Console Python \scalebox{0.8}[0.8]{\faPython}} ; + \draw ([yshift=-0.5pt]frame.north) node[ForestGreen!50!black,fill=white,font=\scriptsize\ttfamily] {\scalebox{0.8}[0.8]{\faPython} Début de la Console Python \scalebox{0.8}[0.8]{\faPython}} ; + } + } +} + +\tcbset{consolepyluatex/.style={%sans logo python + consolepylua,% + overlay={% + \draw ([yshift=0.5pt]frame.south) node[ForestGreen!50!black,fill=white,font=\scriptsize\ttfamily] {Fin de la Console Python} ; + \draw ([yshift=-0.5pt]frame.north) node[ForestGreen!50!black,fill=white,font=\scriptsize\ttfamily] {Début de la Console Python} ; + } + } +} + +\defKV[consolepyluatex]{% + Largeur=\def\ConsPyluaLarg{#1},% + Alignement=\def\ConsPyluaAlign{#1} +} +\setKVdefault[consolepyluatex]{% + Logo=true,% + Largeur=\linewidth,% + Alignement=flush left +} + +\NewDocumentEnvironment{ConsolePiton}{ O{} D<>{} m }% +%1=options piton +%2=clés +%3=options tcbox +{ + \restoreKV[consolepyluatex]% revenir au valeurs par défaut + \setKV[consolepyluatex]{#2}% lit les arguments optionnels + \PitonOptions{#1} + \PyLTVerbatimEnv + \ifboolKV[consolepyluatex]{Logo} + {\tcbset{consolepyluatexlogo,width=\ConsPyluaLarg,\ConsPyluaAlign,#3}} + {\tcbset{consolepyluatex,width=\ConsPyluaLarg,\ConsPyluaAlign,#3}} + \begin{tcolorbox} + \begin{pythonrepl} +} +{ + \directlua{ + tex.print("\\begin{Piton}") + tex.print(pyluatex.get_last_output()) + tex.print("\\end{Piton}") + tex.print("") +} + \end{pythonrepl} +\end{tcolorbox} +} + \endinput
\ No newline at end of file diff --git a/macros/latex/contrib/ragged2e/README.md b/macros/latex/contrib/ragged2e/README.md index c60c60c531..ceeb824e7f 100644 --- a/macros/latex/contrib/ragged2e/README.md +++ b/macros/latex/contrib/ragged2e/README.md @@ -2,7 +2,7 @@ Copyright (C) Martin Schröder, 1996–2019, Marei Peischl (peiTeX) <marei@peitex.de>, 2021–2023 - ragged2e 2023/02/25 v3.4 + ragged2e 2023/04/04 v3.5 *************************************************************************** @@ -42,5 +42,6 @@ or want to report a suggestion for improvement, please visit * 3.2 Fix bug adding a parskip when using `\newline` within the raggged2e alignments (Thanks to Maurice Hansen for reporting) * 3.3 Only modify the alignment when one of the ragged2e commands is active * 3.4 Bugfix: Remove spurious spaces (Thanks to Enrico Gregorio for reporting) + * 3.5 Bugfix: Resolving performance issues created in v3.3 diff --git a/macros/latex/contrib/ragged2e/ragged2e.dtx b/macros/latex/contrib/ragged2e/ragged2e.dtx index 6ca9b7fc3d..00fdf28be9 100644 --- a/macros/latex/contrib/ragged2e/ragged2e.dtx +++ b/macros/latex/contrib/ragged2e/ragged2e.dtx @@ -31,7 +31,7 @@ % \iffalse \NeedsTeXFormat{LaTeX2e}[2021/06/01] %<package>\ProvidesPackage{ragged2e} -%<package> [2023/02/25 v3.4 ragged2e Package] +%<package> [2023/04/04 v3.5 ragged2e Package] % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -81,7 +81,7 @@ \end{document} %</driver> % \fi -% \CheckSum{518} +% \CheckSum{527} % %% \CharacterTable %% {Upper-case \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 @@ -1085,8 +1085,9 @@ % \cs{RaggedSpaceskip} and % \cs{RaggedXSpaceskip}} % \changes{v2.01}{2003/02/20}{Removed the setting of \cs{xspaceskip}} +% \changes{v3.5}{2023/04/04}{Add mechanism to deactivate \cs{\@raggedtwoe@everyselectfont}} % \begin{macrocode} -\newcommand{\@raggedtwoe@everyselectfont}{% +\newcommand{\@raggedtwoe@everyselectfont@active}{% \if@raggedtwoe@spaceskip % \end{macrocode} % If no command defined by \package{ragged2e} is in use, we do @@ -1127,10 +1128,13 @@ {\@raggedtwoe@localhooktrue} {\EverySelectfont{\@raggedtwoe@everyselectfont}} % \end{macrocode} -% We define a command to only add the local hook with the ragged2e commands. -% This will keep the impact local. +% The hook is added globally but will be inactive when none of the ragged2e comands is used. +% \changes{v3.5}{2023/04/04}{Globally add inactive hook} % \begin{macrocode} -\newcommand*{\@raggedtwoe@addlocalhook}{} +\let\@raggedtwoe@everyselectfont\relax +\if@raggedtwoe@localhook + \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont}% +\fi % \end{macrocode} % \end{macro} % @@ -1214,6 +1218,7 @@ % \end{Quote} % Finally we signal the code inserted into \cs{selectfont} that % we are active and call that code directly. +% \changes{v3.5}{2023/04/04}{Bugfix: Only activate the global hook} % \changes{v3.4}{2023/02/25}{Bugfix: remove spurious space} % \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active} % \changes{v3.1}{2021/12/15}{Robustify the user macros (Thanks to Markus Kohm for the hint)} @@ -1222,7 +1227,7 @@ % \begin{macrocode} \DeclareRobustCommand{\Centering}{% \if@raggedtwoe@localhook - \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont}% + \let\@raggedtwoe@everyselectfont\@raggedtwoe@everyselectfont@active% \fi \ifx\\\@raggedtwoe@savedcr \let\\\@raggedtwoe@centercrNoindent @@ -1242,15 +1247,16 @@ % \begin{macro}{\RaggedLeft} % \cs{RaggedLeft} is like \cs{Centering}; it only uses other % parameters. +% \changes{v3.5}{2023/04/04}{Bugfix: Only activate the global hook} % \changes{v3.4}{2023/02/25}{Bugfix: remove spurious space} -% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active.} -% \changes{v3.1}{2021/12/15}{Robustify the user macros} +% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active} +% \changes{v3.1}{2021/12/15}{Robustify the user macros (Thanks to Markus Kohm for the hint)} % \changes{v2.00}{2003/01/04}{Call \cs{@raggedtwoe@everyselectfont} % and switch \cs{@gnewline}} % \begin{macrocode} \DeclareRobustCommand{\RaggedLeft}{% \if@raggedtwoe@localhook - \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont}% + \let\@raggedtwoe@everyselectfont\@raggedtwoe@everyselectfont@active% \fi \ifx\\\@raggedtwoe@savedcr \let\\\@raggedtwoe@centercrNoindent @@ -1270,15 +1276,16 @@ % \begin{macro}{\RaggedRight} % \cs{RaggedRight} is like \cs{Centering}; it only uses other % parameters. +% \changes{v3.5}{2023/04/04}{Bugfix: Only activate the global hook} % \changes{v3.4}{2023/02/25}{Bugfix: remove spurious space} -% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active.} +% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active} % \changes{v3.1}{2021/12/15}{Robustify the user macros (Thanks to Markus Kohm for the hint)} % \changes{v2.00}{2003/01/04}{Call \cs{@raggedtwoe@everyselectfont} % and switch \cs{@gnewline}} % \begin{macrocode} \DeclareRobustCommand{\RaggedRight}{% \if@raggedtwoe@localhook - \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont}% + \let\@raggedtwoe@everyselectfont\@raggedtwoe@everyselectfont@active% \fi \ifx\\\@raggedtwoe@savedcr \let\\\@raggedtwoe@centercrNoindent @@ -1298,14 +1305,15 @@ % \begin{macro}{\justifying} % \cs{justifying} switches back to the defaults used by \LaTeX{} for % typesetting justyfied text. +% \changes{v3.5}{2023/04/04}{Bugfix: Only activate the global hook} % \changes{v3.4}{2023/02/25}{Bugfix: remove spurious space} -% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active.} +% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active} % \changes{v3.1}{2021/12/15}{Robustify the user macros (Thanks to Markus Kohm for the hint)} % \changes{v2.00}{2003/01/04}{New macro} % \begin{macrocode} \DeclareRobustCommand{\justifying}{% \if@raggedtwoe@localhook - \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont}% + \let\@raggedtwoe@everyselectfont\@raggedtwoe@everyselectfont@active% \fi \let\\\@raggedtwoe@savedcr \let\@gnewline\@raggedtwoe@saved@gnewline diff --git a/macros/latex/contrib/ragged2e/ragged2e.pdf b/macros/latex/contrib/ragged2e/ragged2e.pdf Binary files differindex b104f464d3..eb9b619346 100644 --- a/macros/latex/contrib/ragged2e/ragged2e.pdf +++ b/macros/latex/contrib/ragged2e/ragged2e.pdf diff --git a/macros/latex/contrib/realhats/README.md b/macros/latex/contrib/realhats/README.md index b30d25a9cb..bd3e69b5d7 100644 --- a/macros/latex/contrib/realhats/README.md +++ b/macros/latex/contrib/realhats/README.md @@ -13,6 +13,8 @@ Regretfully brought into the world by [Matthew Scroggs](https://github.com/mscro ![Letters with hats on](readme_images/hats.png) ## Changelog +### Version 7.0 (2023-04-04) +* Added aperiodic tile hat ### Version 6.0 (2022-06-13) * Added Scottish hat * Added police hat diff --git a/macros/latex/contrib/realhats/hats/realhats-tile-blue.pdf b/macros/latex/contrib/realhats/hats/realhats-tile-blue.pdf Binary files differnew file mode 100644 index 0000000000..06f84d16ba --- /dev/null +++ b/macros/latex/contrib/realhats/hats/realhats-tile-blue.pdf diff --git a/macros/latex/contrib/realhats/hats/realhats-tile-gray.pdf b/macros/latex/contrib/realhats/hats/realhats-tile-gray.pdf Binary files differnew file mode 100644 index 0000000000..c8aba8b8dd --- /dev/null +++ b/macros/latex/contrib/realhats/hats/realhats-tile-gray.pdf diff --git a/macros/latex/contrib/realhats/hats/realhats-tile-light-blue.pdf b/macros/latex/contrib/realhats/hats/realhats-tile-light-blue.pdf Binary files differnew file mode 100644 index 0000000000..76e02e51da --- /dev/null +++ b/macros/latex/contrib/realhats/hats/realhats-tile-light-blue.pdf diff --git a/macros/latex/contrib/realhats/hats/realhats-tile-white.pdf b/macros/latex/contrib/realhats/hats/realhats-tile-white.pdf Binary files differnew file mode 100644 index 0000000000..1cfaf2076a --- /dev/null +++ b/macros/latex/contrib/realhats/hats/realhats-tile-white.pdf diff --git a/macros/latex/contrib/realhats/readme_images/hats.png b/macros/latex/contrib/realhats/readme_images/hats.png Binary files differindex e3eeb1422c..16226b9a13 100644 --- a/macros/latex/contrib/realhats/readme_images/hats.png +++ b/macros/latex/contrib/realhats/readme_images/hats.png diff --git a/macros/latex/contrib/realhats/realhats.dtx b/macros/latex/contrib/realhats/realhats.dtx index 4a2ef49058..973da1e068 100644 --- a/macros/latex/contrib/realhats/realhats.dtx +++ b/macros/latex/contrib/realhats/realhats.dtx @@ -19,7 +19,6 @@ %OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE %SOFTWARE. %\fi - %\lstinline{realhats} is a package for \LaTeX{} that makes the \lstinline{\hat} command %put real hats on symbols. %For example, the input \lstinline@\hat{a}=\hat{b}@ will produce the output: @@ -27,7 +26,7 @@ %To make a vector with a hat, the input \lstinline@\hat{\mathbf{a}}@ produces: %\[\hat{\mathbf{a}}\] % -%The command \lstinline{\hat} will choose a hat randomly from thirteen hats: +%The command \lstinline{\hat} will choose a hat randomly from eighteen hats: %\begin{center} %\begin{tabular}{cp{4cm}cl} %\(\hatn{a}{beret}\) & beret & @@ -43,7 +42,11 @@ %\(\hatn{a}{policeman}\) & policeman's hat \qquad& %\(\hatn{a}{scottish}\) & Scottish hat \\ %\(\hatn{a}{birthday}\) & birthday hat & -%\(\hatn{a}{mortarboard}\) & mortarboard +%\(\hatn{a}{mortarboard}\) & mortarboard \\ +%\(\hatn{a}{tile-white}\) & aperiodic tile (white) & +%\(\hatn{a}{tile-gray}\) & aperiodic tile (gray)\\ +%\(\hatn{a}{tile-light-blue}\) & aperiodic tile (light blue) & +%\(\hatn{a}{tile-blue}\) & aperiodic tile (blue) %\end{tabular} %\end{center} % @@ -64,7 +67,11 @@ % \lstinline@\hat[policeman]{a}@ & \(\hat[policeman]{a}\) & % \lstinline@\hat[scottish]{a}@ & \(\hat[scottish]{a}\) \\ % \lstinline@\hat[birthday]{a}@ & \(\hat[birthday]{a}\) & -% \lstinline@\hat[mortarboard]{a}@ & \(\hat[mortarboard]{a}\) +% \lstinline@\hat[mortarboard]{a}@ & \(\hat[mortarboard]{a}\) \\ +% \lstinline@\hat[tile-white]{a}@ & \(\hat[tile-white]{a}\) & +% \lstinline@\hat[tile-gray]{a}@ & \(\hat[tile-gray]{a}\) \\ +% \lstinline@\hat[tile-light-blue]{a}@ & \(\hat[tile-light-blue]{a}\) & +% \lstinline@\hat[tile-blue]{a}@ & \(\hat[tile-blue]{a}\) %\end{tabular} %\end{center} % @@ -96,7 +103,7 @@ \RequirePackage{amsmath} \RequirePackage{graphicx} \RequirePackage{ifthen} -\RequirePackage[first=0, last=11, counter=hat]{lcg} +\RequirePackage[first=0, last=14, counter=hat]{lcg} \RequirePackage{calc} \RequirePackage{stackengine} @@ -120,6 +127,10 @@ \DeclareOption{scottish}{\global\def\hatused{scottish}} \DeclareOption{birthday}{\global\def\hatused{birthday}} \DeclareOption{mortarboard}{\global\def\hatused{mortarboard}} +\DeclareOption{tile-white}{\global\def\hatused{tile-white}} +\DeclareOption{tile-gray}{\global\def\hatused{tile-gray}} +\DeclareOption{tile-light-blue}{\global\def\hatused{tile-light-blue}} +\DeclareOption{tile-blue}{\global\def\hatused{tile-blue}} \ProcessOptions\relax \newcommand{\gethat}{% @@ -137,6 +148,10 @@ \or scottish% \or birthday% \or mortarboard% + \or tile-white% + \or tile-gray% + \or tile-light-blue% + \or tile-blue% \fi } @@ -160,6 +175,10 @@ \ifthenelse{\equal{#1}{scottish}}{\hatn{#2}{scottish}}{}% \ifthenelse{\equal{#1}{birthday}}{\hatn{#2}{birthday}}{}% \ifthenelse{\equal{#1}{mortarboard}}{\hatn{#2}{mortarboard}}{}% + \ifthenelse{\equal{#1}{tile-white}}{\hatn{#2}{tile-white}}{}% + \ifthenelse{\equal{#1}{tile-gray}}{\hatn{#2}{tile-gray}}{}% + \ifthenelse{\equal{#1}{tile-light-blue}}{\hatn{#2}{tile-light-blue}}{}% + \ifthenelse{\equal{#1}{tile-blue}}{\hatn{#2}{tile-blue}}{}% }% } @@ -182,6 +201,11 @@ \ifthenelse{\equal{#2}{scottish}}{\renewcommand\myhat{hats/realhats-scottish}\setlength{\vshif}{-0.6ex} \setlength{\hshif}{0.5ex} }{}% \ifthenelse{\equal{#2}{birthday}}{\renewcommand\myhat{hats/realhats-birthday}\setlength{\vshif}{-0.2ex} \setlength{\hshif}{-0.1ex} }{}% \ifthenelse{\equal{#2}{mortarboard}}{\renewcommand\myhat{hats/realhats-mortarboard}\setlength{\vshif}{-0.15ex} \setlength{\hshif}{0ex} }{}% +\ifthenelse{\equal{#2}{tile-white}}{\renewcommand\myhat{hats/realhats-tile-white}\setlength{\vshif}{-0.3ex} \setlength{\hshif}{0ex} }{}% +\ifthenelse{\equal{#2}{tile-gray}}{\renewcommand\myhat{hats/realhats-tile-gray}\setlength{\vshif}{-0.3ex} \setlength{\hshif}{0ex} }{}% +\ifthenelse{\equal{#2}{tile-light-blue}}{\renewcommand\myhat{hats/realhats-tile-light-blue}\setlength{\vshif}{-0.3ex} \setlength{\hshif}{0ex} }{}% +\ifthenelse{\equal{#2}{tile-blue}}{\renewcommand\myhat{hats/realhats-tile-blue}\setlength{\vshif}{-0.3ex} \setlength{\hshif}{0ex} }{}% +\ifthenelse{\equal{#2}{,1}}{\renewcommand\myhat{hats/realhats-,1}\setlength{\vshif}{-0.15ex} \setlength{\hshif}{0ex} }{}% \addtolength{\hshif}{#3}% \addtolength{\vshif}{#4}% \stackMath % diff --git a/macros/latex/contrib/realhats/realhats.pdf b/macros/latex/contrib/realhats/realhats.pdf Binary files differindex 086bce845f..2680bf90cf 100644 --- a/macros/latex/contrib/realhats/realhats.pdf +++ b/macros/latex/contrib/realhats/realhats.pdf diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md index 9d37819ad8..49a16c2766 100644 --- a/macros/latex/contrib/siunitx/CHANGELOG.md +++ b/macros/latex/contrib/siunitx/CHANGELOG.md @@ -7,6 +7,12 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ## [Unreleased] +## [v3.2.4] - 2023-04-04 + + +### Fixed +- Parsing of 'full' uncertainty parts with leading zeros (see issues + [\#652](https://github.com/josephwright/siunitx/issues/652)) ## [v3.2.3] - 2023-03-14 ### Fixed @@ -1882,7 +1888,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### Added - First public testing release (as `si`) -[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.2.3...HEAD +[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.2.4...HEAD +[v3.2.4]: https://github.com/josephwright/siunitx/compare/v3.2.3...v3.2.4 [v3.2.3]: https://github.com/josephwright/siunitx/compare/v3.2.2...v3.2.3 [v3.2.2]: https://github.com/josephwright/siunitx/compare/v3.2.1...v3.2.2 [v3.2.1]: https://github.com/josephwright/siunitx/compare/v3.2.0...v3.2.1 diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf Binary files differindex 447e005499..3fa73c2087 100644 --- a/macros/latex/contrib/siunitx/siunitx-code.pdf +++ b/macros/latex/contrib/siunitx/siunitx-code.pdf diff --git a/macros/latex/contrib/siunitx/siunitx-locale.dtx b/macros/latex/contrib/siunitx/siunitx-locale.dtx index 6a0aa3ffea..43f432733a 100644 --- a/macros/latex/contrib/siunitx/siunitx-locale.dtx +++ b/macros/latex/contrib/siunitx/siunitx-locale.dtx @@ -102,18 +102,18 @@ inter-unit-product = \, , output-decimal-marker = { , } } , - locale / PL .meta:n = - { - exponent-product = \cdot , - inter-unit-product = \cdot , - output-decimal-marker = { , } - } , locale / FR .meta:n = { exponent-product = \times , inter-unit-product = \, , output-decimal-marker = { , } } , + locale / PL .meta:n = + { + exponent-product = \cdot , + inter-unit-product = \cdot , + output-decimal-marker = { , } + } , locale / SI .meta:n = { exponent-product = \times , @@ -150,17 +150,17 @@ { \RequirePackage { translations } \DeclareTranslation { Catalan } { and } { i } - \DeclareTranslation { Slovene } { and } { in } \DeclareTranslation { Portuguese } { and } { e } + \DeclareTranslation { Slovene } { and } { in } + \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } \DeclareTranslation { Catalan } { to~(numerical~range) } { a } \DeclareTranslation { English } { to~(numerical~range) } { to } \DeclareTranslation { French } { to~(numerical~range) } { à } \DeclareTranslation { German } { to~(numerical~range) } { bis } \DeclareTranslation { Polish } { to~(numerical~range) } { do } + \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \DeclareTranslation { Slovene } { to~(numerical~range) } { do } \DeclareTranslation { Spanish } { to~(numerical~range) } { a } - \DeclareTranslation { Brazilian } { to~(numerical~range) } { a } - \DeclareTranslation { Portuguese } { to~(numerical~range) } { a } \keys_set:nn { siunitx } { list-final-separator = diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx index 8df5670c25..0b51a9cd1c 100644 --- a/macros/latex/contrib/siunitx/siunitx-number.dtx +++ b/macros/latex/contrib/siunitx/siunitx-number.dtx @@ -683,6 +683,7 @@ \cs_generate_variant:Nn \tl_if_blank:nTF { f } \cs_generate_variant:Nn \tl_if_blank_p:n { f } \cs_generate_variant:Nn \tl_if_in:NnTF { NV } +\cs_generate_variant:Nn \tl_if_in:nnTF { nV } \cs_generate_variant:Nn \tl_remove_all:Nn { NV } \cs_generate_variant:Nn \tl_replace_all:Nnn { NnV } % \end{macrocode} @@ -1695,9 +1696,14 @@ % \begin{macro}{\@@_parse_uncert:N} % \begin{macro}{\@@_parse_uncert:NNN} % \begin{macro}{\@@_parse_uncert_auxi:N, \@@_parse_uncert_auxii:N} -% \begin{macro} {\@@_parse_uncert_auxii:, \@@_parse_uncert_marker:} -% \begin{macro}{\@@_parse_uncert_extend:nnn} -% \begin{macro}{\@@_parse_uncert_after:N} +% \begin{macro}{\@@_parse_uncert_auxii:} +% \begin{macro}{\@@_parse_uncert_marker:} +% \begin{macro}{\@@_parse_uncert_marker:nnn} +% \begin{macro}{\@@_parse_uncert_marker:nnnw} +% \begin{macro}{\@@_parse_uncert_marker:Nnnn} +% \begin{macro}{\@@_parse_uncert_marker:w} +% \begin{macro}{\@@_parse_uncert_marker:nnnnN} +% \begin{macro}{\@@_parse_uncert_after:N} % Parsing a combined uncertainty has a very restricted range of allowed % tokens. A closing uncertainty token in the first place is an error, % so we filter that out explicitly. After that, we check for digits, @@ -1778,9 +1784,11 @@ % not too long, and extend the decimal if it is. % Both of these require data from the collected partial number, % so we extract that first. Checking the decimal part needs the length of the -% not-yet-collected uncertainty. Handily, we know that it should be a set of -% digits then a closing marker. So we can use that as a length: if it's -% too long we can stop. +% not-yet-collected uncertainty. There may be one or more parts to that, so +% we have to grab p to the \emph{first} closing token to count the length: +% just grabbing everything only works if there is only a single uncertainty. +% We take protective steps against an entirely-missing closing token so that +% there is not an uncontrolled error. % \begin{macrocode} \cs_new_protected:Npn \@@_parse_uncert_marker: { @@ -1792,29 +1800,61 @@ \int_compare:nNnTF { \tl_count:N \l_@@_partial_tl } > { \tl_count:n {#2} } { \@@_parse_loop_break:w } - { \@@_parse_uncert_marker:nw {#3} } + { \@@_parse_uncert_marker:nnnw {#1} {#2} {#3} } } -\cs_new_protected:Npn \@@_parse_uncert_marker:nw - #1#2 \q_recursion_tail \q_recursion_stop +\cs_new_protected:Npn \@@_parse_uncert_marker:nnnw + #1#2#3#4 \q_recursion_tail \q_recursion_stop { - \int_compare:nNnTF - { \tl_count:n {#2} - 1 } = { \tl_count:n {#1} } - { - \str_if_eq:eeTF - { \exp_not:V \l_@@_uncert_tl } - { \prg_replicate:nn { \tl_count:N \l_@@_partial_tl } { 0 } } - { \@@_parse_uncert:NNN \c_false_bool } - { \@@_parse_uncert:NNN \c_true_bool } - \@@_parse_uncert_auxii:N + \tl_if_in:nVTF {#4} \l_@@_input_uncert_close_tl + { + \exp_after:wN \@@_parse_uncert_marker:Nnnn + \l_@@_input_uncert_close_tl + {#1} {#2} {#3} } - { \exp_after:wN \@@_parse_uncert_extend:nnn \l_@@_parsed_tl } - #2 \q_recursion_tail \q_recursion_stop + { \@@_parse_loop_break:w } + #4 \q_recursion_tail \q_recursion_stop + } +\cs_new_protected:Npn \@@_parse_uncert_marker:Nnnn + #1#2#3#4 + { + \cs_set_protected:Npn \@@_parse_uncert_marker:w ##1 #1 + { \@@_parse_uncert_marker:nnnnN {#2} {#3} {#4} {##1} #1 } + \@@_parse_uncert_marker:w } -\cs_new_protected:Npn \@@_parse_uncert_extend:nnn #1#2#3 +\cs_new_protected:Npn \@@_parse_uncert_marker:w { } +% \end{macrocode} +% With the separated out main part and the current uncertainty part +% available, we can pad the main part if required then restart the +% collection of the uncertainty having thrown away the decimal marker +% and with the lengths lined up. +% \begin{macrocode} +\cs_new_protected:Npn \@@_parse_uncert_marker:nnnnN #1#2#3#4#5 { - \tl_set:Nn \l_@@_parsed_tl { {#1} {#2} { #3 0 } } - \@@_parse_uncert:NNN \c_true_bool - \@@_parse_uncert_auxii:N + \tl_set:Nx \l_@@_parsed_tl + { + {#1} + {#2} + { + #3 + \prg_replicate:nn + { + \int_max:nn + { 0 } + { \tl_count:n {#4} - \tl_count:n {#3} } + } + { 0 } + } + } + \tl_if_empty:NTF \l_@@_partial_tl + { + \@@_parse_uncert:NNN \c_false_bool + \@@_parse_uncert_auxii:N + } + { + \@@_parse_uncert:NNN \c_true_bool + \@@_parse_uncert_auxii:N + } + #4#5 } % \end{macrocode} % At the end of collection, we can either start another one or be done: @@ -1860,6 +1900,11 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % \subsection{Processing numbers} % diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx index 3242c28007..78b5ffa776 100644 --- a/macros/latex/contrib/siunitx/siunitx.dtx +++ b/macros/latex/contrib/siunitx/siunitx.dtx @@ -122,7 +122,7 @@ % % Identify the package and give the over all version information. % \begin{macrocode} -\ProvidesExplPackage {siunitx} {2023-03-14} {3.2.3} +\ProvidesExplPackage {siunitx} {2023-04-04} {3.2.4} {A comprehensive (SI) units package} % \end{macrocode} % diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf Binary files differindex b896144622..bdff52cf3b 100644 --- a/macros/latex/contrib/siunitx/siunitx.pdf +++ b/macros/latex/contrib/siunitx/siunitx.pdf |