diff options
author | Norbert Preining <norbert@preining.info> | 2024-03-19 03:02:55 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-03-19 03:02:55 +0000 |
commit | 1b771c1e303b8274d871ee6bd4bdd5ba03bdd152 (patch) | |
tree | 812adf200ad09972163243b4e4341a3991852c14 /macros/latex/contrib | |
parent | 9c8677e09c2c9b0d9593f26ed226411d68160a4e (diff) |
CTAN sync 202403190302
Diffstat (limited to 'macros/latex/contrib')
30 files changed, 856 insertions, 297 deletions
diff --git a/macros/latex/contrib/babel-contrib/norsk/README.md b/macros/latex/contrib/babel-contrib/norsk/README.md index 230f986bc5..f5f0a37ba7 100644 --- a/macros/latex/contrib/babel-contrib/norsk/README.md +++ b/macros/latex/contrib/babel-contrib/norsk/README.md @@ -1,4 +1,4 @@ -Norwegian 2.0j +Norwegian 2.0k -------------- This is the babel style for Norwegian @@ -11,5 +11,10 @@ https://latex3.github.io/babel/contact.html .** Changes 2.0j ------------ -Allow norwegian as the language name, preferred to norsk. +Allow norwegian as the language name, preferred to norsk.ç +Changes 2.0k +------------ + +Bug fix: if language.dat does not set the languages an error +was raised. diff --git a/macros/latex/contrib/babel-contrib/norsk/norsk.dtx b/macros/latex/contrib/babel-contrib/norsk/norsk.dtx index ab541701b8..1e8e279aad 100644 --- a/macros/latex/contrib/babel-contrib/norsk/norsk.dtx +++ b/macros/latex/contrib/babel-contrib/norsk/norsk.dtx @@ -33,7 +33,7 @@ %<norsk>\ProvidesLanguage{norsk} %\fi %\ProvidesFile{norsk.dtx} - [2024/01/26 v2.0j Norwegian support from the babel system] + [2024/03/18 v2.0k Norwegian support from the babel system] %\iffalse %%File `norsk.dtx' %% Babel package for LaTeX version 2e @@ -79,6 +79,8 @@ % \changes{norsk-1.2h}{1996/10/10}{Moved the definition of % \cs{atcatcode} right to the beginning.} % \changes{norsk-2.0j}{2024/01/23}{Dual load norwegian/norsk} +% \changes{norsk-2.0k}{2024/03/18}{Fix bug with missing language in +% language.dat} % % % \section{The Norwegian language} @@ -158,15 +160,15 @@ % \changes{norsk-1.2d}{1994/06/26}{Now use \cs{@nopatterns} to produce % the warning} % \begin{macrocode} -\expandafter\ifx\csname l@\CurrentOption\endcsname\relax - \def\bbl@tempa#1{% - \ifx#1\@undefined\else +\def\bbl@tempa#1{% + \ifx#1\@undefined\else + \expandafter\ifx\csname l@\CurrentOption\endcsname\relax \expandafter\adddialect\csname l@\CurrentOption\endcsname#1% - \fi}% Last wins: - \bbl@tempa\l@nynorsk - \bbl@tempa\l@norsk - \bbl@tempa\l@norwegian -\fi + \fi + \fi}% First wins: +\bbl@tempa\l@norwegian +\bbl@tempa\l@norsk +\bbl@tempa\l@nynorsk \expandafter\ifx\csname l@\CurrentOption\endcsname\relax \@nopatterns{\CurrentOption} \expandafter\adddialect\csname l@\CurrentOption\endcsname\z@ diff --git a/macros/latex/contrib/babel-contrib/norsk/norsk.pdf b/macros/latex/contrib/babel-contrib/norsk/norsk.pdf Binary files differindex 7416dfc5bd..860a0c8f34 100644 --- a/macros/latex/contrib/babel-contrib/norsk/norsk.pdf +++ b/macros/latex/contrib/babel-contrib/norsk/norsk.pdf diff --git a/macros/latex/contrib/customenvs/README.md b/macros/latex/contrib/customenvs/README.md index 68ef414e62..761cc20555 100644 --- a/macros/latex/contrib/customenvs/README.md +++ b/macros/latex/contrib/customenvs/README.md @@ -2,6 +2,7 @@ customenvs is a package with some classics custom environments. ---------------------------------------------------------------------- customenvs est un package avec environnements classiques personnalisés. ---------------------------------------------------------------------- -Author : Cédric Pierquet -email : cpierquet@outlook.fr -Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\ No newline at end of file +Author....: Cédric Pierquet +email.....: cpierquet@outlook.fr +Licence...: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt +Source....: CC-BY-SA 4.0 https://tex.stackexchange.com/questions/504092/replicating-a-fancy-bordered-text-style-in-latex/504145#504145
\ No newline at end of file diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf Binary files differindex 820109987c..f8c88d906e 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.pdf diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex index da20b128bc..c4727a7422 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-en.tex @@ -34,8 +34,8 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{25/10/2023} +\def\TPversion{0.1.2} +\def\TPdate{17/03/2024} \usepackage{tcolorbox} \sethlcolor{lightgray!25} \NewDocumentCommand\MontreCode{ m }{% @@ -111,6 +111,8 @@ \section{History} +\verb|v0.1.1|~:~~~~Pencil of skills + \verb|v0.1.1|~:~~~~Skills table (only french for the moment...) \verb|v0.1.0|~:~~~~Initial version @@ -343,4 +345,77 @@ Controls are done : \ListItemsChoice[Type=item]{\mylistofitemsb}{ListItemsB}(7,2,1,5,3)<label=$--$> +\pagebreak + +\section{Pencil of skills} + +\subsection{Global use} + +The idea is to : + +\begin{itemize} + \item present of list of categories and skills ; + \item prensented like a pencil. +\end{itemize} + +The code (within CC-BY-SA 4.0 license) is adapted from : + +\hfill{\footnotesize \url{https://tex.stackexchange.com/questions/504092/replicating-a-fancy-bordered-text-style-in-latex/504145#504145}}\hfill~ + +\begin{codehigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +\PencilSkills[keys]<tikz options>{listofskills} +\end{codehigh} + +The style is globally fixed, but there's some customization available. + +\subsection{The macro} + +Available \MontreCode{keys} are : + +\begin{itemize} + \item \MontreCode{FontCateg} : font for the categories ; + \item \MontreCode{FontBlock} : font for the skills ; + \item \MontreCode{Colors} : list of category's colors + + \MontreCode{BgCateg1/FgCateg1,BgCateg1/FgCateg1,...} + + (if \MontreCode{FgCateg1} est missing, \MontreCode{black} is used) + \item \MontreCode{BlockWidth} : width of skill's block ; + \item \MontreCode{Scale} : global scale + \item \MontreCode{BlackWhite} : boolean for B\&W. +\end{itemize} + +The second argument, optional and between \MontreCode{<...>} gives specific options to \MontreCode{enumitem} environment. + +\smallskip + +The last argument, mandatory and between \MontreCode{(...)} give the list of categories/skills, within + +\MontreCode{Categ1/ListSkills1,Categ2/ListSkills2,...}. + +\subsection{Examples} + +\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +%default output +\PencilSkills{Search/Skill 1\\ Skill 2,Model/{Skill 1\\ Skill 2}} +\end{demohigh} + +\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +\PencilSkills[Scale=0.75]% + {Search/Skill 1\\Skill 2,Model/{Skill 1\\Skill 2},% + Represent/{Skill 1\\Skill 2},Calculate/{Skill 1\\Skill 2},% + Reason/{Skill 1\\Skill 2},Communicate/{Skill 1\\Skill 2}} +\end{demohigh} + +\begin{demohigh}[language=latex/latex3,style/main=teal!25,style/code=teal!25] +\PencilSkills[Scale=0.75,BlockWidth=3cm]<rotate=90>{ + Search/Skill 1\\Skill 2,Model/{Skill 1\\Skill 2}} +\hspace{1cm} +\PencilSkills[Scale=0.75,BlockWidth=3cm]<rotate=-90>{ + Search/Skill 1\\Skill 2,Model/{Skill 1\\Skill 2}} +\hspace{1cm} +\PencilSkills[Scale=0.75,BlockWidth=3cm,BlackWhite]<rotate=45>{ + Search/Skill 1\\Skill 2,Model/{Skill 1\\Skill 2}} +\end{demohigh} + \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf Binary files differindex 0b7ef6f8b4..2d894043ad 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.pdf diff --git a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex index 969dde4575..5f05be2485 100644 --- a/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex +++ b/macros/latex/contrib/customenvs/doc/customenvs-doc-fr.tex @@ -39,8 +39,8 @@ \usepackage[margin=1.5cm]{geometry} \setlength{\parindent}{0pt} -\def\TPversion{0.1.1} -\def\TPdate{25 octobre 2023} +\def\TPversion{0.1.2} +\def\TPdate{17 mars 2024} \usepackage[most]{tcolorbox} \tcbuselibrary{listingsutf8} \newtcblisting{DemoCode}[1]{% @@ -66,10 +66,10 @@ keywordstyle={\color{violet}},% classoffset=2,% alsoletter={-},% - morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences},% + morekeywords={\ReponsesQCM,MultiCols,\CreerListeItems,\ListeChoixItems,\TableauCompetences,\CrayonDeCompetences},% keywordstyle={\color{green!50!black}},% classoffset=3,% - morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,PoliceLabels,EspaceLabels,Swap,Type,CoeffEspVert,EpTrait,Alea,LargeurNivs,Niveaux,NoticeNiveaux,Titre,PolTitre,PolNotice,PolComp,LigneSep,CouleurNotice,CouleurNiveaux,CouleurFond,Note,Notice},% + morekeywords={Largeur,Filets,EspacesCL,NbCols,Labels,PoliceLabels,EspaceLabels,Swap,Type,CoeffEspVert,EpTrait,Alea,LargeurNivs,Niveaux,NoticeNiveaux,Titre,PolTitre,PolNotice,PolComp,LigneSep,CouleurNotice,CouleurNiveaux,CouleurFond,Note,Notice,PoliceCateg,PoliceBloc,Couleurs,LargeurBloc,Echelle,NoirBlanc},% keywordstyle={\color{orange}} },% #1 @@ -145,16 +145,16 @@ \hrule -\vfill +\pagebreak \section{Historique} +\verb|v0.1.2|~:~~~~Crayon de compétences + \verb|v0.1.1|~:~~~~Tableaux de compétences \verb|v0.1.0|~:~~~~Version initiale -\vspace*{5mm} - \pagebreak \section{Le package customenvs} @@ -697,4 +697,91 @@ L'argument, obligatoire et entre \MontreCode{\{...\}} est la liste des compéten {Utiliser la règle § Utiliser le compas § Utiliser l'équerre} \end{DemoCode} +\pagebreak + +\section{Crayon de compétences} + +\subsection{Principe et fonctionnement} + +L'idée est de proposer un environnement pour créer un \textit{crayon} de compétences, basé sur \MontreCode{TikZ}. + +Le code (en licence CC-BY-SA 4.0) est largement inspiré du fil : + +\hfill{\footnotesize \url{https://tex.stackexchange.com/questions/504092/replicating-a-fancy-bordered-text-style-in-latex/504145#504145}}\hfill~ + +\begin{DemoCode}{listing only} +\CrayonDeCompetences[clés]<options tikz>{listecompétences} +\end{DemoCode} + +\begin{DemoCode}{} +\CrayonDeCompetences{Chercher/Compétence 1\\Compétence 2,Modéliser/Compétence 1\\Compétence 2} +\end{DemoCode} + +La forme générale est fixée, et seuls quelques éléments de personnalisation(s) sont modifiables. + +\subsection{La commande} + +Les \MontreCode{clés} disponibles, à donner entre \MontreCode{[...]}, sont : + +\begin{itemize} + \item \MontreCode{PoliceCateg} : police des catégories ; \MontreCode{\textbackslash bfseries\textbackslash sffamily} par défaut + \item \MontreCode{PoliceBloc} : police des compétences ; \MontreCode{\textbackslash small\textbackslash ttfamily} par défaut + \item \MontreCode{Couleurs} : liste des couleurs de catégories, sous la forme + + \MontreCode{FondCatég1/PoliceCatég1,FondCatég2/PoliceCatég2,...} + + (Si \MontreCode{PolicCatég} est absent, \MontreCode{black} est utilisé par défaut) + \item \MontreCode{LargeurBloc} : largeur des blocs \textit{texte} ; \MontreCode{5cm} par défaut ; + \item \MontreCode{Echelle} : échelle globale du schéma ; \MontreCode{1} par défaut + \item \MontreCode{NoirBlanc} : booléen pour un affichage N\&B. \MontreCode{false} par défaut. +\end{itemize} + +L'argument optionnel, et entre \MontreCode{<...>}, permet de spécifier des options à la figure \MontreCode{TikZ} (comme une rotation, un alignement, etc) + +\smallskip + +L'argument, obligatoire et entre \MontreCode{\{...\}} est la liste des catégories/compétences, sous la forme + +\MontreCode{Catég1/ListeCompétences1,Catég2/ListeCompétences2,...}. + +\begin{DemoCode}{} +\CrayonDeCompetences[Largeur=3cm,Couleurs=teal/white]{% + DS01/Compétence 1\\Compétence 2 +} +\end{DemoCode} + +\subsection{Exemples} + +\begin{DemoCode}{} +%Sortie par défaut +\CrayonDeCompetences{% + Chercher/Compétence 1\\Compétence 2, + Modéliser/Compétence 1\\Compétence 2, + Représenter/Compétence 1, + Calculer/Compétence 1\\Compétence 2\\Compétence 3 +} +\end{DemoCode} + +\begin{DemoCode}{} +\CrayonDeCompetences[Echelle=0.75,LargeurBloc=3cm]% + {Chercher/Compétence 1\\Compétence 2, + Modéliser/{Compétence 1\\Compétence 2},Raisonner/{Compétence 1\\Compétence 2}} +\end{DemoCode} + +\begin{DemoCode}{} +\CrayonDeCompetences[Echelle=0.5]% + {Chercher/Compétence 1\\Compétence 2,Modéliser/{Compétence 1\\Compétence 2}} +\end{DemoCode} + +\begin{DemoCode}{} +\CrayonDeCompetences[Echelle=0.75,NoirBlanc]<rotate=90>% + {Chercher/Compétence 1\\Compétence 2,Modéliser/{Compétence 1\\Compétence 2}}% +\hspace{1cm} +\CrayonDeCompetences[Echelle=0.75,NoirBlanc]<rotate=-90>% + {Chercher/Compétence 1\\Compétence 2,Modéliser/{Compétence 1\\Compétence 2}} +\hspace{1cm} +\CrayonDeCompetences[Echelle=0.75,NoirBlanc,Largeur,LargeurBloc=3cm]<rotate=45>% + {Chercher/Compétence 1\\Compétence 2,Modéliser/{Compétence 1\\Compétence 2}} +\end{DemoCode} + \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/customenvs/tex/customenvs.sty b/macros/latex/contrib/customenvs/tex/customenvs.sty index b58ff0ca36..34b3c30803 100644 --- a/macros/latex/contrib/customenvs/tex/customenvs.sty +++ b/macros/latex/contrib/customenvs/tex/customenvs.sty @@ -1,10 +1,12 @@ -% Author : C. Pierquet -% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf +% Author..........: C. Pierquet +% licence.........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf +% 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}[2023/10/25 0.1.1 Custom classic environments] +\ProvidesPackage{customenvs}[2024/03/17 0.1.2 Custom classic environments] %====HISTORIQUE +% v 0.1.2 Crayon de compétences % v 0.1.1 Ajout de tableaux de compétences % v 0.1.0 Version initiale @@ -48,7 +50,8 @@ \RequirePackage{simplekv} \RequirePackage{xstring} \RequirePackage{listofitems} - +\RequirePackage{tikz} +\usetikzlibrary{decorations.pathmorphing,positioning,shapes.misc,calc} %%----COMMANDES FR @@ -581,6 +584,85 @@ {}% } +%====PENSKILLS +\defKV[tachescrayon]{% + PoliceCateg=\def\pentaksfontcateg{#1},% + PoliceBloc=\def\pentaksfontblock{#1},% + Couleurs=\def\pentakscolors{#1},% + LargeurBloc=\def\pentakswidth{#1}, + Echelle=\def\pentakscale{#1} +} +\setKVdefault[tachescrayon]{% + PoliceCateg=\bfseries\sffamily,% + PoliceBloc=\small\ttfamily,% + %Couleurs={"yellow/black","orange/black","magenta/black","cyan/black","teal/black","brown/black"},% + Couleurs={yellow/black,orange/black,magenta/black,cyan/black,teal/black,brown/black},% + LargeurBloc=5cm,% + Echelle=1,% + NoirBlanc=false +} + +\NewDocumentCommand\CrayonDeCompetences{ O{} D<>{} m }{% + \restoreKV[tachescrayon]% + \setKV[tachescrayon]{#1}% + %liste des couleurs, via listofitems ? + \readlist*\lstColors{\pentakscolors}% + %\edef\lstColors{\pentakscolors}% + \begin{tikzpicture}% + [line width=0.25\pgflinewidth,scale=\pentakscale,transform shape,#2,pics/fancy box/.style={code={% + \path (0,0) coordinate (C0); + \foreach \Item/\Text [count=\Count starting from 0] in {#3} + {% + \ifboolKV[tachescrayon]{NoirBlanc}% + {% + \def\mybackcolor{gray}\def\myfontcolor{black} + }% + {% + \itemtomacro\lstColors[\the\numexpr\Count+1\relax]\mycolor + \IfSubStr{\mycolor}{/}% + {% + \StrCut{\mycolor}{/}{\mybackcolor}{\myfontcolor}% + }% + {% + \def\mybackcolor{\mycolor}\def\myfontcolor{black}% + }% + }% + \node[rounded rectangle,rounded rectangle left arc=none,draw=\mybackcolor,fill=\mybackcolor,anchor=north west,font=\pentaksfontcateg,text=\myfontcolor,outer sep=0pt,inner sep=0.75ex] (RR\Count) at (C\Count) {\vphantom{pL}\Item}; + \node[line width={\pentakscale*3\pgflinewidth},anchor=north west,below right={\pentakscale*1ex} of RR\Count.south west,draw,text width=\pentakswidth,font=\pentaksfontblock,inner sep=0.75ex] (T\Count) {\Text}; + \coordinate[below left={\pentakscale*1ex} of T\Count.south west] (C\the\numexpr\Count+1\relax); + \filldraw[\mybackcolor] ([xshift=-1ex]C\Count) rectangle (C\the\numexpr\Count+1\relax); + \filldraw[\mybackcolor] ([xshift=-3ex]C\Count) rectangle ([xshift=-2ex]C\the\numexpr\Count+1\relax); + \filldraw[\mybackcolor!50!white] ([xshift=-2ex]C\Count) rectangle ([xshift=-1ex]C\the\numexpr\Count+1\relax); + \ifnum\Count=0 + \shade[ball color=\mybackcolor!75] ([shift={(-3ex-\pentakscale*0.5\pgflinewidth,\pentakscale*0.5\pgflinewidth)}]C\Count) to[out=90,in=90]++(3ex+\pentakscale*\pgflinewidth,0) ; + \fi + \xdef\myCount{\Count}%last index + } + \ifboolKV[tachescrayon]{NoirBlanc}% + {% + \def\mylastbackcolor{gray} + \filldraw[lightgray!15] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; + }% + {% + \itemtomacro\lstColors[\the\numexpr\myCount+1\relax]\mylastcolor + \IfSubStr{\mylastcolor}{/}% + {% + \StrBefore{\mylastcolor}{/}[\mylastbackcolor]% + }% + {% + \def\mylastbackcolor{\mylastcolor}% + }% + \filldraw[brown!10] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; + }% + \filldraw[\mylastbackcolor] ([shift={(-3ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; + \filldraw[\mylastbackcolor] ([shift={(-1ex+\pgflinewidth,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; + \filldraw[\mylastbackcolor!50!white] ([shift={(-2ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex,-0.5ex) to[out=0,in=-90]++ (0.5ex,0.5ex) -- cycle ; + \filldraw[line join=cap,gray,fill=gray] (aux1) -- (aux2) -- (aux3); + }}] + \pic{fancy box={#2}}; + \end{tikzpicture}% +} + %%----COMMANDES EN %====QCMs @@ -756,4 +838,85 @@ }% } +%====PENSKILLS +\defKV[pentasks]{% + FontCateg=\def\pentaksfontcateg{#1},% + FontBlock=\def\pentaksfontblock{#1},% + Colors=\def\pentakscolors{#1},% + BlockWidth=\def\pentakswidth{#1}, + Scale=\def\pentakscale{#1} +} +\setKVdefault[pentasks]{% + FontCateg=\bfseries\sffamily,% + FontBlock=\small\ttfamily,% + %Colors={"yellow/black","orange/black","magenta/black","cyan/black","teal/black","brown/black"},% + Colors={yellow/black,orange/black,magenta/black,cyan/black,teal/black,brown/black},% + BlockWidth=5cm,% + Scale=1,% + BlackWhite=false +} + +\NewDocumentCommand\PencilSkills{ O{} D<>{} m }{% + \restoreKV[pentasks]% + \setKV[pentasks]{#1}% + %\edef\lstColors{\pentakscolors}% + \readlist*\lstColors{\pentakscolors}% + \begin{tikzpicture}% + [line width=0.25\pgflinewidth,scale=\pentakscale,transform shape,#2,pics/fancy box/.style={code={% + \path (0,0) coordinate (C0); + \foreach \Item/\Text [count=\Count starting from 0] in {#3} + {% + \ifboolKV[pentasks]{BlackWhite}% + {% + \def\mybackcolor{gray}\def\myfontcolor{black} + }% + {% + %\pgfmathsetmacro{\mycolor}{{\lstColors}[\Count]} + \itemtomacro\lstColors[\the\numexpr\Count+1\relax]\mycolor + \IfSubStr{\mycolor}{/}% + {% + \StrCut{\mycolor}{/}{\mybackcolor}{\myfontcolor}% + }% + {% + \def\mybackcolor{\mycolor}\def\myfontcolor{\mycolor}% + }% + }% + \node[rounded rectangle,rounded rectangle left arc=none,draw=\mybackcolor,fill=\mybackcolor,anchor=north west,font=\pentaksfontcateg,text=\myfontcolor,outer sep=0pt,inner sep=0.75ex] (RR\Count) at (C\Count) {\vphantom{pL}\Item}; + \node[line width={\pentakscale*3\pgflinewidth},anchor=north west,below right={\pentakscale*1ex} of RR\Count.south west,draw,text width=\pentakswidth,font=\pentaksfontblock,inner sep=0.75ex] (T\Count) {\Text}; + \coordinate[below left={\pentakscale*1ex} of T\Count.south west] (C\the\numexpr\Count+1\relax); + \filldraw[\mybackcolor] ([xshift=-1ex]C\Count) rectangle (C\the\numexpr\Count+1\relax); + \filldraw[\mybackcolor] ([xshift=-3ex]C\Count) rectangle ([xshift=-2ex]C\the\numexpr\Count+1\relax); + \filldraw[\mybackcolor!50!white] ([xshift=-2ex]C\Count) rectangle ([xshift=-1ex]C\the\numexpr\Count+1\relax); + \ifnum\Count=0 + \shade[ball color=\mybackcolor!75] ([shift={(-3ex-\pentakscale*0.5\pgflinewidth,\pentakscale*0.5\pgflinewidth)}]C\Count) to[out=90,in=90]++(3ex+\pentakscale*\pgflinewidth,0) ; +% (C\Count); + \fi + \xdef\myCount{\Count}%last index + } + \ifboolKV[pentasks]{BlackWhite}% + {% + \def\mylastbackcolor{gray} + \filldraw[lightgray!15] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; + }% + {% + %\pgfmathsetmacro{\mylastcolor}{{\lstColors}[\myCount]} + \itemtomacro\lstColors[\the\numexpr\myCount+1\relax]\mylastcolor + \IfSubStr{\mylastcolor}{/}% + {% + \StrBefore{\mylastcolor}{/}[\mylastbackcolor]% + }% + {% + \def\mylastbackcolor{\mylastcolor}% + }% + \filldraw[brown!10] ([xshift=-3ex]C\the\numexpr\myCount+1\relax) --++ (0,-0.25ex) --++ (1.5ex,-4ex) coordinate[pos=0.8] (aux1) coordinate[pos=1] (aux2) -- ($(C\the\numexpr\myCount+1\relax)+(0,-0.25ex)$) coordinate[pos=0.2] (aux3) --++ (0,0.25ex) -- cycle ; + }% + \filldraw[\mylastbackcolor] ([shift={(-3ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; + \filldraw[\mylastbackcolor] ([shift={(-1ex+\pgflinewidth,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex-0.5\pgflinewidth,-0.5ex) to[out=0,in=-90]++ (0.5ex-0.5\pgflinewidth,0.5ex) -- cycle ; + \filldraw[\mylastbackcolor!50!white] ([shift={(-2ex,3\pgflinewidth)}]C\the\numexpr\myCount+1\relax) to[out=-90,in=180]++ (0.5ex,-0.5ex) to[out=0,in=-90]++ (0.5ex,0.5ex) -- cycle ; + \filldraw[line join=cap,gray,fill=gray] (aux1) -- (aux2) -- (aux3); + }}] + \pic{fancy box={#2}}; + \end{tikzpicture}% +} + \endinput
\ No newline at end of file diff --git a/macros/latex/contrib/dashrulex/dashrulex.pdf b/macros/latex/contrib/dashrulex/dashrulex.pdf Binary files differindex e38ec5a63d..5ed12594f6 100644 --- a/macros/latex/contrib/dashrulex/dashrulex.pdf +++ b/macros/latex/contrib/dashrulex/dashrulex.pdf diff --git a/macros/latex/contrib/dashrulex/dashrulex.sty b/macros/latex/contrib/dashrulex/dashrulex.sty index 4b476963e6..58c104c0e1 100644 --- a/macros/latex/contrib/dashrulex/dashrulex.sty +++ b/macros/latex/contrib/dashrulex/dashrulex.sty @@ -9,7 +9,7 @@ % https://creativecommons.org/licenses/by/4.0/legalcode \NeedsTeXFormat{LaTeX2e}[2012/02/12] \RequirePackage{xparse} -\ProvidesExplPackage{dashrulex}{2024/03/17}{1.00a} +\ProvidesExplPackage{dashrulex}{2024/03/18}{1.00b} {Draw dashed rules} \DeclareDocumentCommand{\hdashrule}{O{0pt}O{x}mmm} { @@ -33,8 +33,8 @@ \cs_set_protected:Npn \drx@parse@dash@inner #1#2#3#4 { \IfNoValueTF{#4} - {\rule[#1]{#3}{#2}\skip_horizontal:n {#3}} - {\rule[#1]{#3}{#2}\skip_horizontal:n {#4}} + {\vrulemod[#1]{#3}{#2}\skip_horizontal:n {#3}} + {\vrulemod[#1]{#3}{#2}\skip_horizontal:n {#4}} } \NewDocumentCommand{\hanyrule}{O{x}mm} { @@ -44,6 +44,49 @@ \skip_horizontal:n {#2} \mbox{} } + +\int_new:N \l__drx_vrule_counter_int +\int_set:Nn \l__drx_vrule_counter_int { 1 } +\dim_new:N \l__drx_vrule_height_dim +\tl_new:N \l__drx_tmpa_tl +\cs_new_protected:Npn \drx@step@counter@height #1 + { + \int_incr:N \l__drx_vrule_counter_int + \dim_add:Nn \l__drx_vrule_height_dim {#1} + } +\NewDocumentCommand{\vrulemod}{O{0pt}oomm} + { + \group_begin: + \IfValueTF{#2} + { + \tl_set:Nn \l__drx_tmpa_tl { [#2] } + \IfValueT{#3}{\tl_put_right:Nn \l__drx_tmpa_tl { [#3] }} + } + {\IfValueT{#3}{\tl_set:Nn \l__drx_tmpa_tl { [#3] }}} + \exp_last_unbraced:Nnf + \raisebox{#1}{\l__drx_tmpa_tl} + { + \clist_map_inline:nn {#5} + { + \int_compare:nNnTF { \l__drx_vrule_counter_int } > { 1 } + { + \int_if_even:nTF { \l__drx_vrule_counter_int } + { \drx@step@counter@height{##1} } + { + \kern -#4 + \exp_args:NV + \raisebox\l__drx_vrule_height_dim{\rule{#4}{##1}} + \drx@step@counter@height{##1} + } + } + { + \rule{#4}{##1} + \drx@step@counter@height{##1} + } + } + } + \group_end: + } \endinput % % End of file `dashrulex.sty'.
\ No newline at end of file diff --git a/macros/latex/contrib/dashrulex/dashrulex.tex b/macros/latex/contrib/dashrulex/dashrulex.tex index acf2025a28..fdb4fd69fc 100644 --- a/macros/latex/contrib/dashrulex/dashrulex.tex +++ b/macros/latex/contrib/dashrulex/dashrulex.tex @@ -6,8 +6,8 @@ { package = dashrulex, title = the dashrulex package, - version = v1.00a, - date = 2024/03/17, + version = v1.00b, + date = 2024/03/18, authors = Qu Yi, info = Draw dashed rules, email = toquyi@163.com, @@ -48,8 +48,8 @@ Sometimes it is necessary to draw dashed rules when writing documents, such as g \section{User commands} \begin{commands} - \command{hdashrule}[\oarg{raise}\oarg{leader}\marg{width}\marg{thickness}\marg{dash rules}] - The command to draw horizontal dashed rules, based on the \cs{rule} command, and the same as the \cs{rule} command when the \meta{dash rules} are empty. \meta{raise} is the vertical offset of the rule. \meta{leader} is the alignment of the dashed line fill, which can be empty, \code{c}, or \code{x} (the default), corresponding to the \cs{leaders}, \cs{cleaders}, and \cs{xleaders} commands, respectively. \meta{width} is the length of the dashed rule, which can be set to \cs{fill} to indicate an arbitrarily long distance when you need to fill the entire horizontal center of the plate. \meta{dash rules} is expressed as \splitmeta[\code{|}]{length 1}{length a}\code{,}\splitmeta[\code{|}]{length 2}{length b}\code{,...}, where \meta{length 1} represents the length of the solid line and \meta{length a} represents the length of the empty space, such as \code{5pt|2pt,3pt}, if the empty space is empty, then it is equal to the solid line length. + \command{hdashrule}[\oarg{raise}\oarg{leader}\marg{width}\marg{thickness list}\marg{dash rules}] + The command to draw horizontal dashed rules, based on the \cs{rule} command, and the same as the \cs{rule} command when the \meta{dash rules} are empty. \meta{raise} is the vertical offset of the rule. \meta{leader} is the alignment of the dashed line fill, which can be empty, \code{c}, or \code{x} (the default), corresponding to the \cs{leaders}, \cs{cleaders}, and \cs{xleaders} commands, respectively. \meta{width} is the length of the dotted line, which can be set to \cs{fill} when used to fill the remaining center of the current text line. \meta{thickness list} is a rule for the height of vertically oriented lines, separated by \textcolor{red}{commas} and written as \splitmeta{height 1}{height a}\code{,...}, where \meta{height 1} denotes the height of a solid line and \meta{height a} denotes the height of a blank space.\meta{dash rules} is expressed as \splitmeta[\code{|}]{length 1}{length a}\code{,}\splitmeta[\code{|}]{length 2}{length b}\code{,...}, where \meta{length 1} represents the length of the solid line and \meta{length a} represents the length of the blank space, such as \code{5pt|2pt,3pt}, if the blank space is empty, then it is equal to the solid line length. \begin{example} 1X\rule{2cm}{1pt}x \\ 2X\hdashrule{2cm}{1pt}{}x \\ @@ -59,8 +59,11 @@ Sometimes it is necessary to draw dashed rules when writing documents, such as g 6X\hdashrule[0.5ex]{4cm}{1pt}{3mm}x \\ 7X\hdashrule[0.5ex]{4cm}{1mm}{3mm}x \\ 8X\hdashrule[0.5ex]{4cm}{1mm}{3mm|3pt}x \\ - 9X\hdashrule[0.5ex]{4cm}{1mm}{3mm|3pt,1mm|2pt}x + 9X\hdashrule[0.5ex]{4cm}{1mm}{3mm|3pt,1mm|2pt}x \\ + 10X\hdashrule[0.5ex]{4cm}{2pt,1pt,1pt}{3mm|3pt,1mm|2pt}x \end{example} + \command{vrulemod}[\oarg{raise}\oarg{height}\oarg{depth}\marg{width}\marg{thickness list}] + The vertical component used to fill the dashed line. \meta{thickness list} is consistent with the \cs{hdashrule} command, \meta{width} represents the length of the component, and the three optional parameters are consistent with those of the \cs{raisebox} command. \command{hanyrule}[\oarg{leader}\marg{width}\marg{symbol list}] This command sets the length of the dotted rule and fills it with arbitrary symbols. \meta{symbol list} can be more than one symbol and they are separated by \textcolor{red}{commas}. Symbols are best packed in boxes of a certain length, as spacing between symbols is not provided. \begin{example} @@ -78,7 +81,8 @@ Sometimes it is necessary to draw dashed rules when writing documents, such as g 4X\hanyrule[c]{5cm}{\makebox[8pt]{$\cdot$}}x \\ 5X\hanyrule[x]{5cm}{\makebox[8pt]{$\cdot$}}x \\ 6X\hanyrule[x]{5cm}{\makebox[8pt]{$\cdot$},\makebox[8pt]{$\circ$}}x \\ - 7X\hanyrule[x]{5cm}{\makebox[5mm]{\dblelement}}x + 7X\hanyrule[x]{5cm}{\makebox[5mm]{\vrulemod{3mm}{2pt,1pt,1pt}}}x \\ + 8X\hanyrule[x]{5cm}{\makebox[5mm]{\dblelement}}x \end{example} \end{commands} diff --git a/macros/latex/contrib/hyperxmp/README b/macros/latex/contrib/hyperxmp/README index 22a0b26a9a..e7a901f976 100644 --- a/macros/latex/contrib/hyperxmp/README +++ b/macros/latex/contrib/hyperxmp/README @@ -47,7 +47,7 @@ Building hyperxmp.pdf is a little more involved: Copyright and license ===================== -Copyright (C) 2011-2023 Scott Pakin +Copyright (C) 2011-2024 Scott Pakin This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license diff --git a/macros/latex/contrib/hyperxmp/hyperxmp.dtx b/macros/latex/contrib/hyperxmp/hyperxmp.dtx index 9be837cf2a..10045102c1 100644 --- a/macros/latex/contrib/hyperxmp/hyperxmp.dtx +++ b/macros/latex/contrib/hyperxmp/hyperxmp.dtx @@ -22,7 +22,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{hyperxmp} %<*package> - [2023/09/10 v5.12 Store hyperref metadata in XMP format] + [2024/03/17 v5.13 Store hyperref metadata in XMP format] %</package> % %<*driver> @@ -131,7 +131,7 @@ %</driver> % \fi % -% \CheckSum{2848} +% \CheckSum{2859} % % \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 @@ -206,10 +206,6 @@ % \protect\cs{AtEndPreamble}, as is done by % \protect\pkgname{doclicense}~v2.2.0. Thanks to Tommaso Pecorella % for the bug report and help testing} -% \changes{v5.6}{2020/10/05}{Make conditional the loading of the -% \protect\pkgname{ifdraft} package. Thanks to Tobias Pape for -% reporting the incompatibility between \protect\pkgname{hyperxmp} and -% \protect\pkgname{ifdraft}} % % ^^A \GetFileInfo{hyperxmp.dtx} % @@ -2274,33 +2270,52 @@ sub mycmd { % \end{macro} % % \begin{macro}{\ifdraft} +% \changes{v5.2}{2020/04/18}{Define \protect\cs{ifdraft} only locally, at +% Niklas Beisert's request} +% \changes{v5.6}{2020/10/05}{Make conditional the loading of the +% \protect\pkgname{ifdraft} package. Thanks to Tobias Pape for +% reporting the incompatibility between \protect\pkgname{hyperxmp} and +% \protect\pkgname{ifdraft}} +% \changes{v5.13}{2024/03/17}{Rewrite \protect\pkgname{ifdraft} handling +% to avoid loading a package within a group, which \protect\LaTeX\ +% soon will stop supporting. Thanks to Ulrike Fischer and Boris Veytsman +% for bringing this to my attention} % \begin{macro}{\next} % Use the \pkgname{ifdraft} package to determine if this is a draft or % final document. The challenge here is that we want to use % \pkgname{ifdraft} if it's already loaded, load it if not, and not % break any incompatible, author-defined \cs{ifdraft} macros that may % occur either before or after the |\usepackage{hyperxmp}|. Our -% solution begins by defining a new group. Then, if \pkgname{ifdraft} -% is not yet loaded, we locally undefine \cs{ifdraft} and load the -% package. In this case, we later ``unload'' the package by setting -% \cs{ver@ifdraft.sty} to \cs{relax}. -% \changes{v5.2}{2020/04/18}{Define \protect\cs{ifdraft} only locally, at -% Niklas Beisert's request} +% solution works as follows: +% +% \begin{itemize} +% \item If \pkgname{ifdraft} is already loaded, \cs{next} is defined +% as a no-op. +% \item If \pkgname{ifdraft} is not (yet) loaded, the code backs up +% then undefines \cs{ifdraft}, which may be author-defined. It then +% loads \pkgname{ifdraft} and defines \cs{next} to ``unload'' the +% package by setting the package's author-visible commands to +% \cs{relax}. +% \item Below, after \cs{ifdraft} is used to define +% \cs{@pdfrendition}, \cs{next} is invoked to unload a +% \pkgname{hyperxmp}-loaded \pkgname{ifdraft}. Finally, \cs{ifdraft} +% is restored to its original definition. +% \end{itemize} % \begin{macrocode} -\begingroup - \@ifpackageloaded{ifdraft}{% - \let\next=\relax - }{% +\let\hyxmp@orig@ifdraft=\ifdraft +\@ifpackageloaded{ifdraft}{% + \let\next=\relax +}{% + \let\ifdraft=\relax + \RequirePackage{ifdraft}% + \def\next{% + \expandafter\let\csname ver@ifdraft.sty\endcsname=\relax \let\ifdraft=\relax - \RequirePackage{ifdraft}% - \def\next{% - \expandafter\global\expandafter\let\csname ver@ifdraft.sty\endcsname=\relax - }% + \let\ifoptiondraft=\relax + \let\ifoptionfinal=\relax }% +}% % \end{macrocode} -% \end{macro} -% \end{macro} -% % \begin{macro}{\@pdfrendition} % \changes{v5.0}{2020/02/27}{Added the \protect\optname{pdfrendition} % option} @@ -2310,16 +2325,18 @@ sub mycmd { % |\documentclass[draft]|, for which |\@pdfrendition| defaults to % |draft|. % \begin{macrocode} - \ifdraft{% - \gdef\@pdfrendition{draft}% - }{% - \gdef\@pdfrendition{default}% - } - \next -\endgroup +\ifdraft{% + \def\@pdfrendition{draft}% +}{% + \def\@pdfrendition{default}% +} +\next +\let\ifdraft=\hyxmp@orig@ifdraft \define@key{Hyp}{pdfrendition}{\hyxmp@pdfstringdef\@pdfrendition{#1}} % \end{macrocode} % \end{macro} +% \end{macro} +% \end{macro} % % \begin{macro}{\@pdfpublication} % Prepare to store the name of the publication in which the diff --git a/macros/latex/contrib/hyperxmp/hyperxmp.pdf b/macros/latex/contrib/hyperxmp/hyperxmp.pdf Binary files differindex 2664608ae6..e484b17e60 100644 --- a/macros/latex/contrib/hyperxmp/hyperxmp.pdf +++ b/macros/latex/contrib/hyperxmp/hyperxmp.pdf diff --git a/macros/latex/contrib/litebook/doc/cha/cha1.tex b/macros/latex/contrib/litebook/doc/cha/cha1.tex index 09ca12e996..89ab1c9f90 100644 --- a/macros/latex/contrib/litebook/doc/cha/cha1.tex +++ b/macros/latex/contrib/litebook/doc/cha/cha1.tex @@ -1,11 +1,13 @@ \chapter{The \pkg{LiteBook} Template} \section{The purpose of this package} + This template provides a fresh cover and chapter design for book. Welcome to feedback bugs or ideas via email \href{mailto:xiamyphys@gmail.com}{\ttfamily xiamyphys@gmail.com} or \href{https://github.com/xiamyphys/litebook}{GitHub}. -This template was originally used for the reformatting of the textbook \emph{General Relativity, R. Wald}, you can download it from \url{https://github.com/xiamyphys/LaTeX-General-Relativity-R.Wald}. +This template is used by me to reformat the textbook \href{https://github.com/xiamyphys/LaTeX-General-Relativity-R.Wald}{\emph{General Relativity, R. Wald}}, and I also use this template to typesetting my notes on \href{https://github.com/xiamyphys/Group-Theory-in-Physics}{\emph{Group Theory in Physics}}. You can download their codes on \href{https://github.com/xiamyphys}{GitHub}. \section{Installing \pkg{LiteBook} and loading it} + For portable version, simply download latest \verb|litebook.cls| file from \href{https://github.com/xiamyphys/LiteBook}{GitHub} or \href{https://ctan.org/pkg/litebook}{CTAN} and save it under your working directory. This way of installation is simple and convenient, but you have to manually update \verb|.cls| now and then. However, I strongly suggest that you should use terminal/cmd to implement the commands to update all the packages (and install this package) to the latest version or switch to portable version instead @@ -13,101 +15,72 @@ However, I strongly suggest that you should use terminal/cmd to implement the co sudo tlmgr update --self --all \end{verbatim} -If you are in some areas with awful Internet environment (such as a), you can choose proper mirror source or use other means\footnote{Please comply with local network regulations.}. To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \textsf{\TeX} distribution?} +If you are in some areas with awful Internet environment (such as GFW), you can choose a proper mirror source or use other means\footnote{Please comply with local network regulations.}. To learn more, please refer to \href{https://tex.stackexchange.com/questions/55437/how-do-i-update-my-tex-distribution}{How do I update my \hologo{TeX} distribution?} \section{Compatibility} -The test environments are macOS + Mac\TeX{} 2024 / Overleaf and they all work fine for \hologo{pdfLaTeX} and \hologo{XeLaTeX} compilers, Windows, Linux and Unix platforms compatibility unknown. + +The test environments are macOS + Mac\hologo{TeX} 2024 / Overleaf and they all work fine for \hologo{pdfLaTeX} and \hologo{XeLaTeX} compilers. Windows, Linux and Unix platforms' unknown. The compile time of current document via \hologo{pdfLaTeX} compiler is \verb|0.965±0.0019s| on \textsf{MacBook Air M2 8GB (macOS Sonoma 14.4)} when charging. \section{Cover Information Settings} -Just like the cover of this document, there are 5 lines of information on the cover and a cover image, the corresponding commands are + +There are several lines of information and a cover image on the cover of this document, the corresponding commands are the following + +\begin{verbatim} + \cover{\UPLOWFadingImage[trim={0 {.9\paperheight} 0 0},clip]{cover} + [trim={0 {.5\paperheight} 0 0},clip]{cover}} + \title{\scshape The \pkg{LiteBook} Template} + \subtitle{Version 0.2a \today} \author{Hsia Mingyu} + \bioinfo{Hangzhou Dianzi University} + \press{\scshape The University of Chicago Press} +\end{verbatim} + +The same as the \pkg{book} class, the command \cmd{title} could not be omitted, or it will return an error, and there will be a warning if the command \cmd{author} is omitted. The \cmd{cover} can assign the format of the image on the cover and you can adjust the format of the image with the \pkg{fadingimage} package. + +\section{Global options of this template} \begin{verbatim} - \title{The \pkg{LiteBook} Template} \subtitle{Version 0.1b \today} - \press{The University of Chicago Press} \author{Hsia Mingyu} - \bioinfo{Hangzhou Dianzi University} \cover{Beautiful-realities.jpeg} + \documentclass[<math>,<thmstyle>]{litebook} \end{verbatim} -Here, the same as the \pkg{book} class, the command \cmd{title} could not be omitted, or it will return an error, and there will be a warning if the command \cmd{author} is omitted. +\begin{itemize} + \item The \mode{math} option can set the math font to be \mode{newtx} (default) or \mode{mtpro2}. + \item The \mode{thmstyle} option can set the style of \pkg{amsthm} environments be the \pkg{mdframed} (default) or \pkg{amsthm}. +\end{itemize} \section{Preset packages and commands} -This package has been preset with the following packages: + +This template has been preset with the following packages: \begin{table}[!ht] \centering - \begin{tabular}{l l l l l l l} + \begin{tabular}{l l l l l l l l} \toprule - \pkg{amsmath} & \pkg{amssymb} & \pkg{mathrsfs} & \pkg{esvect} & \pkg{physics2} & \pkg{fixdif} & \pkg{bm}\\ + \pkg{amsthm} & \pkg{bm} & \pkg{cancel} & \pkg{derivative} & \pkg{esvect} & \pkg{extarrows} & \pkg{fixdif} & \pkg{nicefrac}\\ \midrule - \pkg{derivative} & \pkg{cancel} & \pkg{extarrows} & \pkg{siunitx} & \pkg{nicefrac} & \pkg{nicematrix} & \pkg{booktabs}\\ + \pkg{nicematrix} & \pkg{physics2} & \pkg{refstyle} & \pkg{siunitx} & \pkg{booktabs} & \pkg{diagbox} & \pkg{fontawesome5} & \pkg{geometry}\\ \midrule - \pkg{tabularx} & \pkg{diagbox} & \pkg{multicol} & \pkg{multirow} & \pkg{refstyle} & \pkg{tcolorbox} & \pkg{fontawesome5}\\ + \pkg{indentfirst} & \pkg{mdframed} & \pkg{multicol} & \pkg{multirow} & \pkg{setspace} & \pkg{tabularx} & \pkg{tcolorbox} & \pkg{tikz}\\ \bottomrule \end{tabular} \end{table} You can click on them to go to the homepage to view the documentation. -And commands \verb|\i|, \verb|\e|, \verb|\T| has been defined to input +And commands \verb|\i|, \verb|\e|, \verb|\T| have been defined to input $\i$, $\e$ in roman (non-italic) text and matrix transpose symbol $\T$, which can help you typeset math quickly. -The template has been preset the following reference command via \pkg{refstyle} package: \verb|\eqref{#1}|, \verb|\figref{#1}| and \verb|\tabref{#1}|, you can add other commands like these via \pkg{refstyle} package. - -\section{Preset Environments} -The following environments have been preset, you can add other environments via the \pkg{amsthm} package. - -\begin{multicols}{2} - -\begin{definition} - A definition environment. -\end{definition} - -\begin{theorem} - A theorem environment. -\end{theorem} - -\begin{lemma} - A lemma environment. -\end{lemma} - -\begin{corollary} - A corollary environment. -\end{corollary} - -\begin{postulate} - A postulate environment. -\end{postulate} - -\begin{axiom} - An axiom environment. -\end{axiom} - -\begin{proposition} - A proposition environment. -\end{proposition} - -\begin{example} - An example environment. -\end{example} - -\begin{problem} - A problem environment. -\end{problem} - -\begin{solution} - A solution environment. -\end{solution} - -\end{multicols} +The template has been preset the following reference command via \pkg{refstyle} package: \verb|\eqref{<label>}|, \verb|\figref{<label>}| and \verb|\tabref{<label>}|, you can add other ref commands via \pkg{refstyle} package. \section{Equation Test} + +The following is the Schr\"odinger Equation \begin{equation} - \ab(\frac1{c^2}\frac{\partial^2}{\partial t^2}-\nabla^2+\frac{mc^2}{\hbar^2})\psi(\mathbf x,t)=0 - \label{1.6.1} + \i\hbar\pdv{}t\Psi(x,t)=\ab[-\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2}+V(x,t)]\Psi(x,t) \end{equation} -The Klein-Gordon \eqref{1.6.1}. +The above equations are the integral formula of the Maxwell's Equations in Gaussian units. \section{Figure and Caption Side by Side Test} -\begin{figure}[!ht] +\begin{figure}[htbp] \begin{minipage}{.32\textwidth} \caption{A diagram showing the causal structure of spacetime in special relativity. The ``light cone'' of $p$ rather than a ``surface of simultaneity'' with $p$ now plays a fundamental role in determining the causal relationship of $p$ to other events.} \label{1.1} @@ -116,7 +89,7 @@ The Klein-Gordon \eqref{1.6.1}. \begin{minipage}{.64\textwidth} \centering \begin{tikzpicture} - \draw [line join=round,line cap=round] (-1,1) -- (1,-1) arc (-60:-120:2) -- (1,1) arc (-60:-120:2) arc (-60:-120:-2); + \draw (-1,1) -- (1,-1) arc (-60:-120:2) -- (1,1) arc (-60:-120:2) arc (-60:-120:-2); \shade [ball color=teal] (0,0) circle (.06) node [anchor=east,xshift=-1ex] {\sffamily\small p}; \node at (0,1.5) {\sffamily\small Future}; \path [->] (.6,1.5) edge [bend left] (.2,1); @@ -133,4 +106,54 @@ The Klein-Gordon \eqref{1.6.1}. \end{minipage} \end{figure} -\figref{1.1} shows the Light Cone.
\ No newline at end of file +Here, \figref{1.1} is a diagram showing the causal structure of spacetime in special relativity. + +\section{Preset Environments} + +\begin{verbatim} + \begin{<theoremname>} ... \end{<theoremname>} \begin{axiom} ... \end{axiom} +\end{verbatim} + +\begin{definition}[The Definition Environment]\leavevmode\newline + From WikipediA: A definition is used to give a precise meaning to a new term, by describing a condition which unambiguously qualifies what a mathematical term is and is not. +\end{definition} + +\begin{theorem}[The Theorem Environment]\leavevmode\newline + From WikipediA: A theorem is a statement that has been proved, or can be proved. +\end{theorem} + +\begin{lemma}[The Lemma Environment]\leavevmode\newline + From WikipediA: In mathematics, informal logic and argument mapping, a lemma (pl.: lemmas or lemmata) is a generally minor, proven proposition which is used as a stepping stone to a larger result. For that reason, it is also known as a ``helping theorem'' or an ``auxiliary theorem''. +\end{lemma} + +\begin{corollary}[The Corollary Environment]\leavevmode\newline + From WikipediA: A corollary is a theorem of less importance which can be readily deduced from a previous, more notable statement. +\end{corollary} + +\begin{proposition}[The Proposition Environment]\leavevmode\newline + From WikipediA: A proposition is a central concept in the philosophy of language, semantics, logic, and related fields, often characterized as the primary bearer of truth or falsity. +\end{proposition} + +\begin{postulate}[The Postulate Environment]\leavevmode\newline + From WikipediA: A postulate is a statement everyone agrees to be correct. +\end{postulate} + +\begin{axiom}[The Axiom Environment]\leavevmode\newline + From WikipediA: An axiom is a statement that is taken to be true, to serve as a premise or starting point for further reasoning and arguments. +\end{axiom} + +\begin{remark}[The Remark Environment]\leavevmode\newline + From Math StackExchange: The remark device is used for material that is is too long to be included in parentheses, while it deserves greater prominence than a footnote. +\end{remark} + +\begin{example} + From Cambridge Dictionary: The example is a way of helping someone to understand something by showing them how it is used. +\end{example} + +\begin{problem} + From Springer: A problem is generally considered to be a task, a situation, or person which is difficult to deal with or control due to complexity and intransparency. +\end{problem} + +\begin{solution} + The quick brown fox jumps over the lazy dog. +\end{solution} diff --git a/macros/latex/contrib/litebook/doc/cha/scha.tex b/macros/latex/contrib/litebook/doc/cha/scha.tex index 42101fe8d5..1d85aa31ce 100644 --- a/macros/latex/contrib/litebook/doc/cha/scha.tex +++ b/macros/latex/contrib/litebook/doc/cha/scha.tex @@ -1,3 +1,3 @@ -\chapter*{A Test of Unnumbered Chapter} +\chapter*{A Test to Unnumbered Chapter} \lipsum[1-6]
\ No newline at end of file diff --git a/macros/latex/contrib/litebook/doc/figures/Beautiful-realities.jpeg b/macros/latex/contrib/litebook/doc/figures/cover.jpeg Binary files differindex 2b6036083d..2b6036083d 100644 --- a/macros/latex/contrib/litebook/doc/figures/Beautiful-realities.jpeg +++ b/macros/latex/contrib/litebook/doc/figures/cover.jpeg diff --git a/macros/latex/contrib/litebook/doc/litebook.pdf b/macros/latex/contrib/litebook/doc/litebook.pdf Binary files differindex 9172a5c78f..4e74717211 100644 --- a/macros/latex/contrib/litebook/doc/litebook.pdf +++ b/macros/latex/contrib/litebook/doc/litebook.pdf diff --git a/macros/latex/contrib/litebook/doc/litebook.tex b/macros/latex/contrib/litebook/doc/litebook.tex index 39ce87706e..5a42f997a3 100644 --- a/macros/latex/contrib/litebook/doc/litebook.tex +++ b/macros/latex/contrib/litebook/doc/litebook.tex @@ -1,17 +1,19 @@ -% !TEX TS-program = pdflatex -\documentclass{litebook} +\documentclass[ + math = newtx, + thmstyle = mdframed +]{litebook} -\title{The \pkg{LiteBook} Template} -\subtitle{Version 0.1c \today} -\press{The University of Chicago Press} +\cover{\UPLOWFadingImage[trim={0 {.9\paperheight} 0 0},clip]{cover} + [trim={0 {.5\paperheight} 0 0},clip]{cover}} +\title{\scshape The \pkg{LiteBook} Template} +\subtitle{Version 0.2a \today} \author{Hsia Mingyu} \bioinfo{Hangzhou Dianzi University} -\cover{Beautiful-realities} +\press{\scshape\textcolor{teal}{\faIcon{telegram-plane}}Hangzhou in Late Spring 2024} \begin{document} -\maketitle -\frontmatter\tableofcontents\mainmatter +\maketitle\frontmatter\tableofcontents\mainmatter \input{cha/cha1.tex} \input{cha/scha.tex} diff --git a/macros/latex/contrib/litebook/tex/litebook.cls b/macros/latex/contrib/litebook/tex/litebook.cls index 92de10dd3e..ceeb43e163 100644 --- a/macros/latex/contrib/litebook/tex/litebook.cls +++ b/macros/latex/contrib/litebook/tex/litebook.cls @@ -19,45 +19,68 @@ %% **************************************************************************************************** % !Mode:: "TeX:UTF-8" \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{litebook}[2024/03/11 v0.1c LiteBook document class] +\ProvidesClass{litebook}[2024/03/18 v0.2a LiteBook document class] \RequirePackage{kvoptions} \RequirePackage{etoolbox} +\SetupKeyvalOptions{family=LITE, prefix=LITE@, setkeys=\kvsetkeys} +\def\ekv#1{\kvsetkeys{LITE}{#1}} + +\DeclareStringOption[newtx]{math} +\DeclareVoidOption{newtx}{\ekv{math=newtx}} +\DeclareVoidOption{mtpro2}{\ekv{math=mtpro2}} + +\DeclareStringOption[mdframed]{thmstyle} +\DeclareVoidOption{mdframed}{\ekv{thmstyle=mdframed}} +\DeclareVoidOption{amsthm}{\ekv{thmstyle=amsthm}} + \DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}} \ProcessKeyvalOptions*\relax \LoadClass[letterpaper,11pt,openany]{book} -\RequirePackage{geometry,enumitem,booktabs,tabularx,diagbox,multicol,multirow} -\geometry{rmargin=1.25 in,lmargin=.75 in,tmargin=1 in,bmargin=1 in} +\RequirePackage{geometry,indentfirst,setspace,enumitem,booktabs,tabularx,diagbox,multicol,multirow} +\geometry{lmargin = .8 in,rmargin = 1.2 in,tmargin= 1 in,bmargin= 1 in} +\setlength{\headheight}{13.6pt} + +\RequirePackage{lipsum,hologo} +\hologoFontSetup{general=\sffamily} +\RequirePackage{ifxetex} +\ifXeTeX + \RequirePackage[quiet]{xeCJK} + \RequirePackage[quiet,no-math]{fontspec} + \RequirePackage{zhlipsum} + \setlength{\parindent}{2em} +\else + \setlength{\parindent}{2ex} +\fi \RequirePackage{graphics,graphicx} \graphicspath{{./figure/}{./figures/}{./image/}{./images/}{./graphics/}{./graphic/}{./pictures/}{./picture/}} -\RequirePackage{indentfirst} -\setlength{\parindent}{2ex} - \RequirePackage[labelsep=period,labelfont={bf,sf},font=small]{caption} \RequirePackage[nokeyprefix]{refstyle} +\newref{eq}{refcmd=(\ref{#1}),name={\sffamily Eq.~}} \newref{fig}{name={\sffamily\bfseries Figure~}} \newref{tab}{name={\sffamily\bfseries Table~}} \RequirePackage{tocloft} -\setlength{\cftbeforetoctitleskip}{16\p@} +\setlength{\cftbeforetoctitleskip}{6\p@} \setlength{\cftaftertoctitleskip}{24\p@} -\renewcommand{\contentsname}{\sffamily Contents} +\setlength{\cftbeforesecskip}{3\p@} +\def\contentsname{\sffamily\scshape\hfill Contents\hfill} +\setcounter{tocdepth}{1} \def\@makechapterhead#1{% - \vspace*{\p@}% - { + \vspace*{\p@}{% \parindent \z@ \raggedright \normalfont \ifnum \c@secnumdepth >\m@ne \if@mainmatter - \parbox{25mm} - {\centering\HUGE\normalfont\bfseries\textcolor{darkgray}{\thechapter}\\[4mm]\normalsize\bfseries\textcolor{darkgray}{\bfseries\sffamily\scshape \@chapapp}}% - \tikz[baseline] - \draw[line width=3pt,dotted,dash pattern=on 0pt off 8pt, gray](0,-.85)--(0,1.35); + \parbox{1 in} + {\centering\HUGE\normalfont\bfseries\textcolor{darkgray}\thechapter\vskip10\p@\normalsize\bfseries\textcolor{darkgray}{\bfseries\sffamily\scshape \@chapapp}}% + \tikz[baseline,overlay] + \draw[line width=3pt,dotted,dash pattern=on 0pt off 8pt, gray](0,-.8)--(0,1.2); \fi \fi - \interlinepenalty\@M\hspace*{4ex} + \interlinepenalty\@M\hspace*{2em} \huge\bfseries\sffamily #1\par\nobreak \vskip 36\p@ }} @@ -72,29 +95,52 @@ \huge \bfseries \sffamily #1\par\nobreak \vskip 40\p@ }} -\setlength{\headheight}{13.6pt} + +\let\cleardoublepage=\clearpage +\makeatletter +\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else + \vspace*{\fill} + {\centering\itshape\Large This page was intentionally left blank.\par} + \vspace{\fill} +\thispagestyle{empty} +\newpage +\if@twocolumn\hbox{}\newpage\fi\fi\fi} \RequirePackage{fancyhdr} \pagestyle{fancy} - \let\headrule\relax - \fancyhead[OL]{\textsc{\sffamily\nouppercase\leftmark}} - \fancyhead[OR]{\sffamily\thepage} - \fancyhead[ER]{\textsc{\sffamily\nouppercase\rightmark}} - \fancyhead[EL]{\sffamily\thepage} - \lfoot{}\cfoot{}\rfoot{} - -\RequirePackage[most]{tcolorbox} -\RequirePackage{tikz,fontawesome5} + \fancyhead[OL]{\textsc{\sffamily\nouppercase\leftmark}} + \fancyhead[OR]{\sffamily\thepage} + \fancyhead[ER]{\textsc{\sffamily\nouppercase\rightmark}} + \fancyhead[EL]{\sffamily\thepage} + \lfoot{}\cfoot{}\rfoot{} + +\RequirePackage{tikz} \usetikzlibrary{arrows,tikzmark,patterns,calc} \RequirePackage{fadingimage} \tikzset{>=stealth', -every picture/.append style={ +every picture/.append style={% line join=round, line cap=round, thick } } +\RequirePackage[fixed]{fontawesome5} +\AddToHook{cmd/faIcon/before}{% + \begingroup\fontsize{\fpeval{\f@size*.9}}{0}\selectfont +} +\AddToHook{cmd/faIcon/after}{\endgroup} + +\RequirePackage[svgnames]{xcolor} +\definecolor{pkgcolor}{Hsb}{103,.8,.5} +\definecolor{moducolor}{Hsb}{290,.8,.5} +\definecolor{cmdcolor}{Hsb}{188,.8,.5} +\RequirePackage[colorlinks,linkcolor=cmdcolor,urlcolor=pkgcolor]{hyperref} +\def\pkg#1{\texorpdfstring{\textcolor{pkgcolor}{% + \href{https://ctan.org/pkg/#1}{\textsf{#1}}}}{“#1”}} +\def\mode#1{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}} +\def\cmd#1{\texorpdfstring{\textcolor{cmdcolor}{\textsf{#1}}}{“#1”}} + \RequirePackage{datetime}\yyyymmdddate \def\subtitle#1{\gdef\@subtitle{#1}} \def\cover#1{\gdef\@cover{#1}} @@ -104,77 +150,91 @@ every picture/.append style={ \def\HUGE{\@setfontsize\HUGE{40}{50}} \def\HUge{\@setfontsize\HUGE{35}{45}} -\renewcommand*\maketitle -{ +\renewcommand*\maketitle{% \begin{titlepage} - \newgeometry{margin = 0 in} + \newgeometry{margin = 0 in} \ifcsname @cover\endcsname - \UPFadingImage[trim={0 {.9\paperheight} 0 0},clip]{\@cover} - \LOWFadingImage[trim={0 {.5\paperheight} 0 0},clip]{\@cover} + \@cover\vskip75\p@ + \else + \vspace*{75\p@} \fi - \parindent=0pt\vskip75\p@ + \parindent=0pt \centering\sffamily\bfseries - \HUge\@title + \HUge\@title\normalfont \ifcsname @subtitle\endcsname - \vskip2ex\LARGE\@subtitle\fi + \vskip2ex\LARGE\sffamily\bfseries\@subtitle\normalfont\fi \ifcsname @author\endcsname - \vskip4ex\LARGE\@author\fi + \vskip4ex\LARGE\sffamily\bfseries\@author\normalfont\fi \ifcsname @bioinfo\endcsname - \vskip2ex\Large\@bioinfo\fi + \vskip2ex\Large\sffamily\bfseries\@bioinfo\normalfont\fi \ifcsname @press\endcsname\vfill - \parbox[t]{\textwidth}{\centering - \Large\@press\vskip75\p@}\fi + \parbox[t]{\textwidth}{\centering + \sffamily\bfseries\large\@press\normalfont\vskip75\p@}\fi \clearpage - \vspace*{\fill} - \Huge\itshape\@title - \vspace*{\fill} - \restoregeometry -\end{titlepage} -} - -\AtBeginDocument{ - \everymath{\displaystyle} - \setlength{\abovedisplayskip}{3pt} - \setlength{\belowdisplayskip}{3pt} - \setcounter{tocdepth}{1} -} - -\definecolor{pkgcolor}{Hsb}{103,.8,.5} -\definecolor{moducolor}{Hsb}{290,.8,.5} -\definecolor{cmdcolor}{Hsb}{188,.8,.5} -\RequirePackage[colorlinks,linkcolor=teal,urlcolor=pkgcolor]{hyperref} -\def\pkg#1{\texorpdfstring{\textcolor{pkgcolor}{ - \href{https://ctan.org/pkg/#1}{\textsf{#1}}}}{“#1”}} -\def\mode#1{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}} -\def\cmd#1{\texorpdfstring{\textcolor{cmdcolor}{\textsf{#1}}}{“#1”}} - -\RequirePackage{lipsum,hologo} -\RequirePackage{ifxetex} -\ifxetex - \RequirePackage[quiet]{xeCJK} - \RequirePackage[quiet,no-math]{fontspec} - \RequirePackage{zhlipsum} -\fi - -\def\hmmax{0}\def\bmmax{0} -\RequirePackage{amsmath,amssymb,amsthm,mathrsfs} -\RequirePackage[libertine,mono=false]{newtx} -\RequirePackage[e]{esvect} + \vspace*{\fill}\normalfont + {\centering \Huge\sffamily\bfseries\itshape\@title\par} + \vspace{\fill} + \restoregeometry +\end{titlepage}} + +\ifdefstring{\LITE@math}{mtpro2}{% + \RequirePackage{amssymb} + \let\Bbbk\relax + \RequirePackage[mtpscr,mtpccal,mtpfrak]{mtpro2} + \RequirePackage[mono=false]{libertine} +}{\relax} + +\ifdefstring{\LITE@math}{newtx}{% + \RequirePackage[libertine,mono=false]{newtx} +}{\relax} + +\let\openbox\relax\def\hmmax{0}\def\bmmax{0} \RequirePackage{physics2,bm,fixdif,derivative,cancel,extarrows,siunitx,nicefrac,nicematrix} \usephysicsmodule{ab,braket,diagmat,doubleprod,xmat,ab.legacy,op.legacy} \RequirePackage[e]{esvect} \def\i{\mathrm i}\def\e{\mathrm e}\def\T{\mathsf T} +\numberwithin{equation}{section} +\RequirePackage{amsthm,mdframed,listofitems} +\setsepchar{;/,}\ignoreemptyitems \theoremstyle{definition} -\newtheorem{definition}{\sffamily\color{pkgcolor} Definition}[section] -\newtheorem{theorem}{\sffamily\color{moducolor} Theorem}[section] -\newtheorem{lemma}{\sffamily\color{moducolor} Lemma}[section] -\newtheorem{corollary}{\sffamily\color{moducolor}Corollary}[section] -\newtheorem{postulate}{\sffamily\color{moducolor}Postulate}[section] -\newtheorem{axiom}{\sffamily\color{moducolor}Axiom}[section] -\newtheorem{proposition}{\sffamily\color{cmdcolor}Proposition}[section] -\newtheorem*{example}{\sffamily Example} +\def\th@definition{\thm@notefont{}\normalfont} +\readlist*\thmlist{% + theorem, lemma, definition, corollary, proposition, postulate, axiom, remark; + DarkGreen, MidnightBlue, MidnightBlue, Olive, Olive, Indigo, Indigo, DarkRed +} +\ifnum \listlen\thmlist[1]<\listlen\thmlist[2] + \def\thmnum{\listlen\thmlist[1]} +\else + \def\thmnum{\listlen\thmlist[2]} +\fi + +\ifdefstring{\LITE@thmstyle}{mdframed}{% + \foreach \x in {1,...,\thmnum}{\expandafter\xdef\csname\x\x\endcsname{\noexpand + \newmdtheoremenv[ + skipabove=0pt, skipbelow=0pt, + hidealllines=true, leftline=true, + linewidth=.5ex, linecolor=\thmlist[2,\x], + innerleftmargin=1.5ex, innerrightmargin=0pt, + innertopmargin=-1.5ex, innerbottommargin=.5ex] + {\thmlist[1,\x]} + {\noexpand\color{\thmlist[2,\x]}\noexpand\sffamily\expandafter\MakeUppercase\expanded{\thmlist[1,\x]}}[chapter] +}} +}{\relax} + +\ifdefstring{\LITE@thmstyle}{amsthm}{% + \foreach \x in {1,...,\thmnum}{\expandafter\xdef\csname\x\x\endcsname{\noexpand + \newtheorem + {\thmlist[1,\x]} + {\noexpand\color{\thmlist[2,\x]}\noexpand\sffamily\expandafter\MakeUppercase\expanded{\thmlist[1,\x]}}[chapter] +}} +}{\relax} + +\foreach \x in {1,...,\thmnum}{\csname\x\x\endcsname} +\let\theremark=\relax + +\newtheorem{example}{\sffamily\color{Teal} Example}[chapter] +\def\theexample{\arabic{example}} \newtheorem{problem}{\sffamily Problem}[chapter] \def\theproblem{\arabic{problem}} -\newtheorem*{solution}{\sffamily Solution} -\numberwithin{equation}{section}
\ No newline at end of file +\newtheorem*{solution}{\sffamily Solution}
\ No newline at end of file diff --git a/macros/latex/contrib/ocgx2/ChangeLog b/macros/latex/contrib/ocgx2/ChangeLog index 5b61a6ee13..65ca63a13d 100644 --- a/macros/latex/contrib/ocgx2/ChangeLog +++ b/macros/latex/contrib/ocgx2/ChangeLog @@ -1,3 +1,7 @@ +2024-03-18 + * v0.57: ocgx2.sty + * fix: fixed link border in pdfmanagement-testphase version + 2022-12-16 * v0.56: ocgx2.sty * fix: documentation diff --git a/macros/latex/contrib/ocgx2/ocgx2.sty b/macros/latex/contrib/ocgx2/ocgx2.sty index c3b91609cd..a1081f88ac 100644 --- a/macros/latex/contrib/ocgx2/ocgx2.sty +++ b/macros/latex/contrib/ocgx2/ocgx2.sty @@ -43,8 +43,8 @@ % % The Current Maintainer of this work is A. Grahn. - \def\g@ocgxii@date@tl{2022/12/16} - \def\g@ocgxii@version@tl{0.56} + \def\g@ocgxii@date@tl{2024/03/18} + \def\g@ocgxii@version@tl{0.57} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} @@ -79,11 +79,6 @@ to~the~preamble~of~your~document. } - \msg_set:nnn{ocgx2}{beamer~and~ocgcolorlinks}{ - Option~`ocgcolorlinks'~cannot~be~used~with~class~Beamer.\\\\ - Using~`colorlinks'~instead. - } - % package options \msg_set:nnnn{ocgx2}{unknown~package~option}{Unknown~package~option~`#1'.}{ @@ -1279,15 +1274,6 @@ \DeclareDocumentCommand\ocglinkprotect{m}{#1} } - % option ocgcolorlinks and beamer are not compatible - \bool_if:NT\l_ocgxii_ocgcolorlinks_bool{ - \@ifclassloaded{beamer}{ - \bool_set_false:N\l_ocgxii_ocgcolorlinks_bool - \hypersetup{colorlinks} - \msg_warning:nn{ocgx2}{beamer~and~ocgcolorlinks} - }{} - } - \bool_if:NT\l_ocgxii_ocgcolorlinks_bool{ \@ifpackageloaded{hyperref}{ \Hy@colorlinkstrue @@ -1553,6 +1539,7 @@ \endgroup %%%%%%%%%%%%%%%%%%%%%% /pdfmanagement-testphase %%%%%%%%%%%%%%%%%%% +% pdfmanagement-testphase version starts here %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ocgx2.sty @@ -1592,8 +1579,8 @@ % % The Current Maintainer of this work is A. Grahn. -\def\g@ocgxii@date@tl{2022/08/04} -\def\g@ocgxii@version@tl{0.55} +\def\g@ocgxii@date@tl{2024/03/18} +\def\g@ocgxii@version@tl{0.57} \ProvidesExplPackage{ocgx2}{\g@ocgxii@date@tl}{\g@ocgxii@version@tl} {ports `ocgx' functionality to dvips+ps2pdf, xelatex and dvipdfmx} @@ -1620,19 +1607,6 @@ \msg_set:nnn{ocgx2}{generic~msg}{#1\\#2} -\msg_set:nnn{ocgx2}{missing~package}{ - Package~`#1'~must~be~loaded~before~ocgx2.\\\\ - Put\\\\ - \space\space\string\usepackage#2{#1}\\ - \space\space\string\usepackage[ocgcolorlinks]{ocgx2}\\\\ - to~the~preamble~of~your~document. -} - -\msg_set:nnn{ocgx2}{beamer~and~ocgcolorlinks}{ - Option~`ocgcolorlinks'~cannot~be~used~with~class~Beamer.\\\\ - Using~`colorlinks'~instead. -} - % package options \msg_set:nnnn{ocgx2}{unknown~package~option}{Unknown~package~option~`#1'.}{ @@ -2524,6 +2498,9 @@ \int_gincr:N\g_ocgxii_widcount_int } }{ + \bool_if:NF\g_ocgxii_hyperref_loaded_bool{ + \pdfannot_dict_put:nnn{link/GoTo}{Border}{[0~0~0]} + } %line-breakable annotation \pbs_pdflink:nn{ %look and feel of hyperref internal links @@ -2673,29 +2650,16 @@ % with some improvements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\bool_if:NT\l_ocgxii_ocgcolorlinks_bool{ - % option ocgcolorlinks and beamer are not compatible - \@ifclassloaded{beamer}{ - \bool_set_false:N\l_ocgxii_ocgcolorlinks_bool - \hypersetup{colorlinks} - \msg_warning:nn{ocgx2}{beamer~and~ocgcolorlinks} - }{} - % make sure that hyperref has been loaded if `ocgcolorlinks' is set via - % pkg option - \@ifpackageloaded{hyperref}{ - \hypersetup{ocgcolorlinks} - }{ - \msg_error:nnn{ocgx2}{missing~package}{hyperref} - } -} - % we'll be using the downscaled space character (32) from the pzdr % (dingbats) font at the start and at the end of every ocgcolorlink \cs_new_protected_nopar:Npn\ocgxii_tiny_space_char:{ \group_begin: \font\l_tmpa_tl=pzdr~scaled~1\l_tmpa_tl\char32 \group_end: } -\@ifpackageloaded{hyperref}{ +\bool_new:N\g_ocgxii_hyperref_loaded_bool +\AddToHook{package/hyperref/after}{ + \bool_gset_true:N\g_ocgxii_hyperref_loaded_bool + \bool_if:NT\l_ocgxii_ocgcolorlinks_bool{\hypersetup{ocgcolorlinks}} \bool_if:nTF{\sys_if_output_dvi_p: && !\g_ocgxii_dvipdfmx_bool}{ \prop_map_inline:Nn\c__hyp_map_hyp_annot_prop{ \hook_gremove_code:nn{pdfannot/link/#2/begin}{hyp/ocg} diff --git a/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf b/macros/latex/contrib/proflycee/doc/ProfLycee-doc.pdf Binary files differindex e51248bb1d..6401533972 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 8c7da1f846..55981358f1 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{3.02f} -\def\PLdate{7 mars 2024} +\def\PLversion{3.03a} +\def\PLdate{17 mars 2024} \usepackage{amsfonts} \usepackage{ProfLycee} \useproflyclib{piton,minted,pythontex,ecritures,espace} diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty index 05945a83b1..f714774351 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}[2024/03/07 3.02f Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2024/03/17 3.03a Aide pour l'utilisation de LaTeX en lycee] +% 3.03a Forme canonique + fonction homographique +% 3.02g Correction de bugs avec les arbres de probas % 3.02f Ajout de petits schémas type pour la géométrie dans l'espace + conformité avec piton % 3.02e Présentation python dans la style 'thonny' + amélioration dans la gestion du gobble avec piton % 3.02d Retenues pour les soustractions dans les opérations posées diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex index 3454738654..5e1f246ab3 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-analyse.tex @@ -882,4 +882,88 @@ } \makeatother +%===F.CANONIQUE & F.HOMOGRAPHIQUE +\NewDocumentCommand\FormeCanonique{ s O{d} m m m }{% + \def\tmpcoeffalpha{-(#4)/(2*(#3))}% + \def\tmpcoeffbeta{(#3)*(-(#4)/(2*(#3)))^2+(#4)*(-(#4)/(2*(#3)))+(#5)}% + \def\coeffaconv{\ConversionFraction[#2]{#3}}% + \def\coeffalpha{\ConversionFraction[#2]{-(#4)/(2*(#3))}}% + \def\coeffalphamoins{\ConversionFraction[#2]{(#4)/(2*(#3))}}% + \def\coeffbeta{\ConversionFraction[#2]{(#3)*(-(#4)/(2*(#3)))^2+(#4)*(-(#4)/(2*(#3)))+(#5)}}% + \ensuremath{% + %on affiche a, sauf s'il vaut 1 ou -1 + \xintifboolexpr{#3 == 1}{}{}% + \xintifboolexpr{#3 == -1}{-}{}% + \xintifboolexpr{#3 != -1 'and' #3 != 1}{\coeffaconv}{}% + \xintifboolexpr{\tmpcoeffalpha == 0}% + {% + x^2% + }% + {% + \IfBooleanTF{#1}% + {% + \xintifboolexpr{\tmpcoeffalpha < 0}% + {% + {\left(x\xintifboolexpr{\tmpcoeffalpha < 0}{-}{+}{\left(\coeffalpha\right)}\right)}^2% + }% + {% + {\left(x\xintifboolexpr{\tmpcoeffalpha > 0}{}{+}\coeffalphamoins\right)}^2% + }% + }% + {% + {\left(x\xintifboolexpr{\tmpcoeffalpha > 0}{}{+}\coeffalphamoins\right)}^2% + }% + }% + \xintifboolexpr{\tmpcoeffbeta == 0}% + {}% + {% + \xintifboolexpr{\tmpcoeffbeta > 0}{+}{}\coeffbeta% + }% + }% +} + +\NewDocumentCommand\FonctionHomographique{ s O{t} m m m m }{% + \xintifboolexpr{#3 != 0}% + {% + \def\tmpcoeffSeul{(#3)/(#5)}% + \def\tmpcoeffNum{((#4)*(#5)-(#3)*(#6))/((#5)*(#5))}% + \def\tmpcoeffDenom{(#6)/(#5)}% + \ensuremath{% + \ConversionFraction[d]{\tmpcoeffSeul}% + +\dfrac% + {\ConversionFraction[#2]{\tmpcoeffNum}}% + {x% + \xintifboolexpr{#6 == 0}{}{% + \IfBooleanTF{#1}% + {% + \xintifboolexpr{\tmpcoeffDenom > 0}{-\left(\ConversionFraction[#2]{-(\tmpcoeffDenom)}\right)}{\ConversionFraction[#2]{\tmpcoeffDenom}}% + }% + {% + \xintifboolexpr{\tmpcoeffDenom > 0}{+}{}\ConversionFraction[#2]{\tmpcoeffDenom}% + }% + }% + }% + }% + }% + {% + \def\tmpcoeffNum{(#4)/(#5)}% + \def\tmpcoeffDenom{(#6)/(#5)}% + \ensuremath{% + \dfrac% + {\ConversionFraction[#2]{\tmpcoeffNum}}% + {x% + \xintifboolexpr{#6 == 0}{}{% + \IfBooleanTF{#1}% + {% + \xintifboolexpr{\tmpcoeffDenom > 0}{-}{}\left(\ConversionFraction[#2]{-(\tmpcoeffDenom)}\right)% + }% + {% + \xintifboolexpr{\tmpcoeffDenom > 0}{+}{}\ConversionFraction[#2]{\tmpcoeffDenom}% + }% + }% + }% + }% + }% +} + \endinput
\ No newline at end of file diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex index 950c59a4a8..e817af767e 100644 --- a/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex +++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-probas.tex @@ -318,7 +318,7 @@ \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} {% - \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[3,2]}{below=1pt} + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{below=1pt} %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; }% \ifstrempty{\PLARBREDONNES[4,2]} @@ -445,7 +445,7 @@ \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} { - \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=-1pt} + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{above=-1pt} %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; } \ifstrempty{\PLARBREDONNES[4,2]} @@ -609,7 +609,7 @@ \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} {% - \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[3,2]}{below=1pt} + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{below=1pt} %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; }% \ifstrempty{\PLARBREDONNES[4,2]} @@ -736,7 +736,7 @@ \ifstrempty{\PLARBREDONNES[3,2]} {\draw[PLfleche] (A11)--(A22) ;} { - \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[2,3]}{\PLARBREDONNES[2,2]}{above=-1pt} + \IntPlaceProbasArbre{A11}{A22}{\PLARBREDONNES[3,3]}{\PLARBREDONNES[3,2]}{above=-1pt} %\draw[PLfleche] (A11)--(A22) node[probas,PLetiquette,{\PLARBREDONNES[3,3]}] {{\PLARBREDONNES[3,2]}} ; } \ifstrempty{\PLARBREDONNES[4,2]} @@ -905,7 +905,7 @@ \draw[thick,->,>=latex] (-4,0)--(4,0) ; \draw[thick,densely dotted] (0,0)--(0,0.39894) ; \draw[thick,domain=-4:4,samples=100,\GRPHPROBcoulcbe] plot (\x,{\densnorm{\x}}) ; - \end{tikzpicture} + \end{tikzpicture}% } \NewDocumentCommand\LoiExpoGraphe{ O{} D<>{} m m m }{%1=options,2=optionstikz,3=l,4=a,5=b @@ -933,7 +933,7 @@ \draw[thick,->,>=latex] (-0.2,0)--(3.8,0) ; \draw[thick,->,>=latex] (0,-0.15)--(0,0.85) ; \draw[thick,domain=0:3.8,samples=100,\GRPHPROBcoulcbe] plot (\x,{0.7*\densexpo{\x}}) ; - \end{tikzpicture} + \end{tikzpicture}% } %%------aNp/Cnp diff --git a/macros/latex/contrib/pythonhighlight/README.md b/macros/latex/contrib/pythonhighlight/README.md index 06fc5b02af..1ed233417c 100644 --- a/macros/latex/contrib/pythonhighlight/README.md +++ b/macros/latex/contrib/pythonhighlight/README.md @@ -25,9 +25,12 @@ The special method \pyth{__init__}... ``` Last but not least, you can load an external Python file with: - ```tex -\inputpython{python_file.py}{23}{50} +\inputpythonfile{python_file.py}[23][50] ``` - -to display the contents of the file ``python_file`` from line 23 to line 50. +to display the contents of the file ``python_file`` from line 23 to line 50, +or with +```tex +\inputpythonfile{python_file.py} +``` +to input the whole Python file. diff --git a/macros/latex/contrib/pythonhighlight/pythonhighlight.sty b/macros/latex/contrib/pythonhighlight/pythonhighlight.sty index 88561ed326..0c772a1e26 100644 --- a/macros/latex/contrib/pythonhighlight/pythonhighlight.sty +++ b/macros/latex/contrib/pythonhighlight/pythonhighlight.sty @@ -1,11 +1,13 @@ -% Copyright 2009--2017 by Olivier Verdier +% Copyright 2009--2024 by Olivier Verdier % License: see the file LICENSE.rst \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{pythonhighlight}[2017/02/09 python code highlighting; provided by Olivier Verdier <olivier.verdier@gmail.com>] +\UseRawInputEncoding +\ProvidesPackage{pythonhighlight}[2024/03/18 python code highlighting; provided by Olivier Verdier <olivier.verdier@gmail.com>] \RequirePackage{listings} \RequirePackage{xcolor} +\RequirePackage{xparse} \renewcommand*{\lstlistlistingname}{Code Listings} \renewcommand*{\lstlistingname}{Code Listing} @@ -27,7 +29,7 @@ \newcommand*{\pythonprompt}{\textcolor{promptcolour}{{>}{>}{>}}} -\lstdefinestyle{mypython}{ +\lstdefinestyle{pythonhighlight-style}{ %\lstset{ %keepspaces=true, language=python, @@ -40,7 +42,7 @@ showstringspaces=false, alsoletter={1234567890}, otherkeywords={\%, \}, \{, \&, \|}, keywordstyle=\color{keywordcolour}\bfseries, -emph={and,break,class,continue,def,yield,del,elif ,else,% +emph={and,as,async,await,break,class,continue,def,yield,del,elif ,else,% except,exec,finally,for,from,global,if,import,in,% lambda,not,or,pass,print,raise,return,try,while,assert,with}, emphstyle=\color{blue}\bfseries, @@ -98,12 +100,30 @@ breakindent=.5\textwidth,frame=single,breaklines=true% %} } -\newcommand*{\inputpython}[3]{\lstinputlisting[firstline=#2,lastline=#3,firstnumber=#2,frame=single,breakindent=.5\textwidth,frame=single,breaklines=true,style=mypython]{#1}} +\newcommand*{\inputpython}[3]{\lstinputlisting[firstline=#2,lastline=#3,firstnumber=#2,frame=single,breakindent=.5\textwidth,frame=single,breaklines=true,style=pythonhighlight-style]{#1}} +\NewDocumentCommand\inputpythonfile{moo}{\lstinputlisting[ + firstline=\IfValueTF{#2}{#2}{0}, + % firstnumber=\IfValueTF{#2}{#2}{0}, + lastline=\IfValueTF{#3}{#3}{9999999}, + frame=single, + breakindent=.5\textwidth, + frame=single, + breaklines=true, + style=pythonhighlight-style + ]{#1}} -\lstnewenvironment{python}[1][]{\lstset{style=mypython}}{} +\lstnewenvironment{python}[2][]{% + \lst@TestEOLChar{#2}% + \lstset{style=pythonhighlight-style}% + \lstset{#1}% % has to be in an extra \lstset{} command so that labels work correctly + \csname\@lst @SetFirstNumber\endcsname% +}{% + \let\if@nobreak\iffalse% + \csname\@lst @SaveFirstNumber\endcsname% +} -\lstdefinestyle{mypythoninline}{ -style=mypython,% +\lstdefinestyle{pythonhighlight-inline-style}{ + style=pythonhighlight-style,% basicstyle=\ttfamily,% keywordstyle=\color{keywordcolour},% emphstyle={[7]\color{keywordcolour}},% @@ -135,5 +155,5 @@ literate=*% %% emphstyle=\color{blue},% } -\newcommand*{\pyth}{\lstinline[style=mypythoninline]} +\newcommand*{\pyth}{\lstinline[style=pythonhighlight-inline-style]} |