From fac21618bdcd44d7ca47228c8b856488b12ee6a2 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 26 Oct 2022 03:00:55 +0000 Subject: CTAN sync 202210260300 --- macros/latex/contrib/docshots/DEPENDS.txt | 1 - macros/latex/contrib/docshots/docshots.dtx | 25 +- macros/latex/contrib/docshots/docshots.pdf | Bin 336674 -> 335433 bytes macros/latex/contrib/eolang/README.md | 4 +- macros/latex/contrib/eolang/eolang.dtx | 137 ++++--- macros/latex/contrib/eolang/eolang.pdf | Bin 533580 -> 591918 bytes macros/latex/contrib/frenchmath/README.md | 3 +- macros/latex/contrib/frenchmath/frenchmath.dtx | 409 ++++++++++++++++----- macros/latex/contrib/frenchmath/frenchmath.pdf | Bin 479690 -> 502874 bytes macros/latex/contrib/iexec/iexec.dtx | 28 +- macros/latex/contrib/iexec/iexec.pdf | Bin 327771 -> 328403 bytes macros/latex/contrib/mismath/mismath.dtx | 56 +-- macros/latex/contrib/mismath/mismath.pdf | Bin 360639 -> 247929 bytes macros/luatex/generic/penlight/penlight.pdf | Bin 59406 -> 59499 bytes macros/luatex/generic/penlight/penlight.sty | 12 +- macros/luatex/generic/penlight/penlight.tex | 2 +- macros/luatex/generic/penlight/penlightextras.lua | 7 +- macros/luatex/latex/luaquotes/README | 3 +- .../latex/luaquotes/luaquotes-documentation.pdf | Bin 107332 -> 110314 bytes .../latex/luaquotes/luaquotes-documentation.tex | 147 +++++++- macros/luatex/latex/luaquotes/luaquotes.sty | 23 +- 21 files changed, 643 insertions(+), 214 deletions(-) (limited to 'macros') diff --git a/macros/latex/contrib/docshots/DEPENDS.txt b/macros/latex/contrib/docshots/DEPENDS.txt index da7d048685..93a73e061e 100644 --- a/macros/latex/contrib/docshots/DEPENDS.txt +++ b/macros/latex/contrib/docshots/DEPENDS.txt @@ -2,7 +2,6 @@ hard iexec hard fancyvrb hard pdfcrop hard pgf -hard pgf-blur hard pgfopts hard listings hard minted \ No newline at end of file diff --git a/macros/latex/contrib/docshots/docshots.dtx b/macros/latex/contrib/docshots/docshots.dtx index 8dfd11cf52..2e6d03614c 100644 --- a/macros/latex/contrib/docshots/docshots.dtx +++ b/macros/latex/contrib/docshots/docshots.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{docshots} %<*package> -[2022-10-18 0.0.4 TeX Samples Next to Their PDF Snapshots in DTX] +[2022-10-25 0.0.5 TeX Samples Next to Their PDF Snapshots in DTX] % %<*driver> \documentclass{ltxdoc} @@ -128,9 +128,13 @@ % \begin{docshot} % \documentclass{article} % \usepackage{tikz} +% \usetikzlibrary{backgrounds} % \pagestyle{empty} % \begin{document} -% \begin{tikzpicture} +% \begin{tikzpicture}[ +% show background rectangle, +% background rectangle/.style= +% {draw=none,fill=gray!20}] % \node [circle,draw] (v0) {$v_0$}; % \node [circle,draw=orange,thick, % below right of=v0] (v1) {$v_1$}; @@ -355,6 +359,7 @@ Hello, world! % \section{Prerequisites} % \DescribeMacro{\docshotPrerequisite} +% \changes{0.0.3}{2022/10/14}{The command is added to enable copying of supplementary files into docshots snippets processing directory.} % If you need some files to be present next to the |.tex| snippet while % it's rendered by |pdflatex|, you can use |\docshotPrerequisite| with % a single mandatory argument. The argument is the name of a file you need @@ -429,8 +434,7 @@ Hello, world! % \StopEventually{} % \section{Implementation} - -% \changes{v0.0.1}{2022/10/09}{Initial version} +% \changes{0.0.1}{2022/10/09}{Initial version} % First, we include a few packages: % \begin{macrocode} @@ -439,17 +443,18 @@ Hello, world! \RequirePackage{xcolor} \RequirePackage{graphicx} \RequirePackage{tikz} -\usetikzlibrary{shadows.blur} % \end{macrocode} % Then, we process package options: +% \changes{0.0.4}{2022/10/18}{Package options "lstinputlisting" and "inputminted" introduced to enable printing of verbatim text either via listings or minted packages.} +% \changes{0.0.5}{2022/10/24}{Package option "log" added, which enables detailed logging via exec. By default, there is no logging at all.} % \begin{macrocode} \RequirePackage{pgfopts} +\def\docshots@log{} \pgfkeys{ /docshots/.cd, dtx/.store in=\docshots@dtx, - log/.store in=\docshots@log, - log/.default=, + log/.code=\def\docshots@log{log}, lstinputlisting/.store in=\docshots@lstinputlisting, inputminted/.store in=\docshots@inputminted, tmpdir/.store in=\docshots@tmpdir, @@ -472,7 +477,7 @@ Hello, world! left/.default=.3\linewidth, right/.store in=\docshots@right, right/.default=.55\linewidth, - tmpdir,pdflatex,gs,pdfcrop,margin,hspace,left,right,runs,log + tmpdir,pdflatex,gs,pdfcrop,margin,hspace,left,right,runs } \ProcessPgfOptions{/docshots} % \end{macrocode} @@ -549,7 +554,7 @@ Hello, world! % Otherwise, we ask |pdfcrop| to crop the PDF: % \begin{macrocode} \IfFileExists{\docshots@tmpdir/\jobname/\hash.crop.pdf} - {\message{docshots: on't pdfcrop, the PDF already exists + {\message{docshots: won't pdfcrop, the PDF already exists (\docshots@tmpdir/\jobname/\hash.crop.pdf)^^J}} {\iexec[\docshots@log,quiet]{\docshots@pdfcrop\space --margins \docshots@margin\space @@ -574,7 +579,7 @@ Hello, world! \begingroup% \par% \tikz[baseline=(a.north)] - \node (a) [draw=gray] + \node (a) [draw=gray,inner sep=0] {\includegraphics[width=\docshots@left] {\docshots@tmpdir/\jobname/\hash.crop.pdf}};% \hspace{\docshots@hspace}% diff --git a/macros/latex/contrib/docshots/docshots.pdf b/macros/latex/contrib/docshots/docshots.pdf index fbec067a70..888639741d 100644 Binary files a/macros/latex/contrib/docshots/docshots.pdf and b/macros/latex/contrib/docshots/docshots.pdf differ diff --git a/macros/latex/contrib/eolang/README.md b/macros/latex/contrib/eolang/README.md index 740df01a47..257b0c163e 100644 --- a/macros/latex/contrib/eolang/README.md +++ b/macros/latex/contrib/eolang/README.md @@ -1,6 +1,6 @@ -[![l3build](https://github.com/yegor256/eolang.sty/actions/workflows/l3build.yml/badge.svg)](https://github.com/yegor256/eolang.sty/actions/workflows/l3build.yml) +[![l3build](https://github.com/objectionary/eolang.sty/actions/workflows/l3build.yml/badge.svg)](https://github.com/objectionary/eolang.sty/actions/workflows/l3build.yml) [![CTAN](https://img.shields.io/ctan/v/eolang.sty)](https://ctan.org/pkg/eolang.sty) -[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/eolang.sty/blob/master/LICENSE.txt) +[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/objectionary/eolang.sty/blob/master/LICENSE.txt) This LaTeX package helps you write 𝜑-calculus formulas and [SODG](https://github.com/objectionary/sodg) graphs diff --git a/macros/latex/contrib/eolang/eolang.dtx b/macros/latex/contrib/eolang/eolang.dtx index b10f1a8c35..1fabdd6282 100644 --- a/macros/latex/contrib/eolang/eolang.dtx +++ b/macros/latex/contrib/eolang/eolang.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{eolang} %<*package> -[2022-10-20 0.0.1 Formulas and Graphs for EO Programming Language] +[2022-10-25 0.0.2 Formulas and Graphs for EO Programming Language] % %<*driver> \documentclass{ltxdoc} @@ -60,7 +60,6 @@ \usepackage{microtype} \usepackage{graphicx} \usepackage[runs=1,dtx]{docshots} -\docshotPrerequisite{eolang.sty} \usepackage{eolang} \usepackage{href-ul} \PageIndex @@ -75,7 +74,7 @@ % % \fi -% \title{\includegraphics[height=1in]{cactus.pdf} \\ |eolang|: \LaTeX{} Package \\ for Formulas and Graphs \\ of EO Programming Language \\ and $\varphi$-calculus\thanks{The sources are in GitHub at \href{https://github.com/yegor256/eolang.sty}{yegor256/eolang.sty}}} +% \title{\includegraphics[height=1in]{cactus.pdf} \\ |eolang|: \LaTeX{} Package \\ for Formulas and Graphs \\ of EO Programming Language \\ and $\varphi$-calculus\thanks{The sources are in GitHub at \href{https://github.com/objectionary/eolang.sty}{objectionary/eolang.sty}}} % \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}} % \date{\filedate, \fileversion} % @@ -98,12 +97,13 @@ % \usepackage{eolang} % \begin{document} % \begin{phiquation*} -% a -> [ -% b -> [ c -> |x|(56), -% \rho -> |hello|(\xi), -% \Delta ~> |01-FE-C3| ]], +% a -> [[ +% ^ !-> $.b, +% b -> [[ c -> |fn|(56), +% @ -> |hello|($), +% \Delta ~> |01-FE-C3| ]]]], -% x -> [ \lambda ~> M_1 ]. +% x -> [[ \alpha_0 -> ? ]] % \end{phiquation*} % \end{document} % \end{docshot} @@ -112,11 +112,35 @@ % The environment |phiquation| lets you write a $\varphi$-calculus expressions % using simple plain-text notation, where: % \begin{itemize}\setlength\itemsep{0em} -% \item ``|->|'' maps to ``$\mapsto$'' (|\mapsto|), -% \item ``|~>|'' maps to ``$\mapstochar\dashrightarrow$'' (|\mapstochar\dashrightarrow|), -% \item ``|[|'' maps to ``$\llbracket$'' (|\llbracket|), -% \item ``|]|'' maps to ``$\rrbracket$'' (|\rrbracket|), -% \item ``$\vert$|abc|$\vert$'' maps to ``\texttt{abc}'' (|\texttt{abc}|). +% \item ``|@|'' maps to ``$\varphi$'' +% (|\varphi|), +% \item ``|^|'' maps to ``$\rho$'' +% (|\rho|), +% \item ``|$|'' maps to ``$\xi$'' +% (|\xi|), +% \item ``|&|'' maps to ``$\sigma$'' +% (|\sigma|), +% \item ``|?|'' maps to ``$\varnothing$'' +% (|\varnothing|), +% \item ``|->|'' maps to ``$\mapsto$'' +% (|\mapsto|), +% \item ``|!->|'' maps to ``$\mapstochar\relbar\mathrel{\mkern-12mu}\mapsto$'' +% (|\mapstochar\relbar\mathrel{\mkern-12mu}\mapsto|), +% \item ``|~>|'' maps to ``$\mapstochar\dashrightarrow$'' +% (|\mapstochar\dashrightarrow|), +% \item ``|[[|'' maps to ``$\llbracket$'' +% (|\llbracket|), +% \item ``|]]|'' maps to ``$\rrbracket$'' +% (|\rrbracket|), +% \item ``$\vert$|abc|$\vert$'' maps to ``\texttt{abc}'' +% (|\texttt{abc}|). +% \end{itemize} +% Also, a few symbols are supported for $\varphi$PU architecture: +% \begin{itemize}\setlength\itemsep{0em} +% \item ``|-abc>|'' maps to ``$\xrightarrow{\text{\sffamily\scshape abc}}$'' +% (|\xrightarrow{\text{\sffamily\scshape abc}}|), +% \item ``|:=|'' maps to ``$\vDash$'' +% (|\vDash|). % \end{itemize} % \DescribeMacro{\phiq} @@ -129,28 +153,28 @@ % \usepackage{eolang} % \begin{document} % A simple object -% \phiq{x -> [\varphi -> y]} +% \phiq{x -> [[@ -> y]]} % is a decorator of % the data object -% \phiq{y -> [\Delta ~> 42]}. +% \phiq{y -> [[\Delta ~> 42]]}. % \end{document} % \end{docshot} -% \DescribeEnv{phigure} -% The environment |phigure| allows you to draw a \href{https://github.com/objectionary/sodg}{SODG} graph: +% \DescribeEnv{sodg} +% The environment |sodg| allows you to draw a \href{https://github.com/objectionary/sodg}{SODG} graph: % \begin{docshot} % \documentclass{article} % \pagestyle{empty} % \usepackage{eolang} % \begin{document} -% \begin{phigure} +% \begin{sodg} % v0 % v1 xy:v0,-2,+1 data:|42| % v0->v1 a:$x$ rho % v2 xy:v0,+1,+1 atom:$\xi.x+1$ % v1->v2 a:|hi| bend:-15 % v2->v0 pi bend:10 -% \end{phigure} +% \end{sodg} % \end{document} % \end{docshot} % The content of the environment is parsed line by line. Markers in each line are @@ -178,38 +202,49 @@ % \section{Implementation} -% \changes{v0.0.1}{2022/10/05}{Initial version} - % First, we include a few packages: % \begin{macrocode} \RequirePackage{stmaryrd} \RequirePackage{amsmath} +\RequirePackage{amssymb} \RequirePackage{amsfonts} \RequirePackage{iexec} \RequirePackage{fancyvrb} % \end{macrocode} % \begin{macro}{\eolang@env} +% \changes{0.0.2}{2022/10/21}{The symbols ``['' and ``]'' replaced with ``[['' and ``]]'' for abstract object brackets, because they conflicted with normal square brackets} +% \changes{0.0.2}{2022/10/21}{New symbol added for basket slots} +% \changes{0.0.2}{2022/10/21}{Parsing of symbols ``@,'' ``\^{},'' and ``\&'' enabled (varphi, rho, and sigma)} % Then, we define |\eolang@env| supplementary command. % It is implemented with the help of |\iexec| from % \href{https://github.com/yegor256/iexec}{iexec} package: % \begin{macrocode} \makeatletter\newcommand\eolang@env[2]{ \iexec[trace]{ - /bin/echo -n '\\begin{#1}\\begin{split} &'; + /bin/echo -n '\\begin{#1}\\begin{split} &' + && /bin/echo -n '\detokenize{#2}' | perl -pe 's/^\\r\\+//g' | perl -pe 's/\\r\\+$//g' + | perl -pe 's/\\?/\\\\varnothing/g' + | perl -pe 's/@/\\\\varphi/g' + | perl -pe 's/&/\\\\sigma/g' + | perl -pe 's/\\^/\\\\rho/g' + | perl -pe 's/\\$/\\\\xi/g' + | perl -pe 's/-([a-z]+)>/\\\\xrightarrow{\\\\text{\\\\sffamily\\\\scshape \\1}}/g' + | perl -pe 's/!->/\\\\mapstochar\\\\relbar\\\\mathrel{\\\\mkern-12mu}\\\\mapsto/g' | perl -pe 's/->/\\\\mapsto/g' + | perl -pe 's/:=/\\\\vDash/g' | perl -pe 's/\unexpanded{~}>/\\\\mapstochar\\\\dashrightarrow/g' | perl -pe 's/\\|([^\\|]+)\\|/\\\\texttt{\\1}/g' - | perl -pe 's/\\[/\\\\llbracket/g' - | perl -pe 's/\\]/\\\\rrbracket/g' + | perl -pe 's/\\[\\[/\\\\llbracket/g' + | perl -pe 's/\\]\\]/\\\\rrbracket/g' | perl -pe 's/\\r\\r/\\\\\\\\ \&/g' | perl -pe 's/\\r/\\\\\\\\[-4pt] \&/g' | perl -pe 's/([^& ]) {2}([^ ])/\\1 \\2/g' | perl -pe 's/ {2}/\\\\quad{}/g' - ; + && /bin/echo -n '\\end{split}\\end{#1}\\endinput' }% }\makeatother @@ -233,17 +268,27 @@ % \end{macro} % \begin{macro}{\phiq} +% \changes{0.0.2}{2022/10/21}{Parsing of additional symbols enabled} % Then, we define |\phiq| command: % \begin{macrocode} \newcommand\phiq[1]{ \iexec[trace]{ - /bin/echo -n '$'; + /bin/echo -n '$' + && /bin/echo -n '\detokenize{#1}' + | perl -pe 's/\\^/\\\\rho/g' + | perl -pe 's/\\$/\\\\xi/g' + | perl -pe 's/&/\\\\sigma/g' + | perl -pe 's/\\?/\\\\varnothing/g' + | perl -pe 's/@/\\\\varphi/g' + | perl -pe 's/!->/\\\\mapstochar\\\\relbar\\\\mathrel{\\\\mkern-12mu}\\\\mapsto/g' | perl -pe 's/->/\\\\mapsto/g' + | perl -pe 's/-([a-z]+)>/\\\\xrightarrow{\\\\text{\\\\sffamily\\\\scshape \\1}}/g' | perl -pe 's/\unexpanded{~}>/\\\\mapstochar\\\\dashrightarrow/g' - | perl -pe 's/\\[/\\\\llbracket/g' - | perl -pe 's/\\]/\\\\rrbracket/g' - ; + | perl -pe 's/:=/\\\\vDash/g' + | perl -pe 's/\\[\\[/\\\\llbracket/g' + | perl -pe 's/\\]\\]/\\\\rrbracket/g' + && /bin/echo -n '$\\endinput' }% } @@ -251,9 +296,10 @@ % \end{macro} % \begin{macro}{Perl} +% \changes{0.0.2}{2022/10/24}{The Perl file now has a fixed name, which doesn't depend on the name of the TeX job. This file may be shared among jobs, no need to make it uniquely named.} % Then, create a Perl script: % \begin{macrocode} -\begin{VerbatimOut}{\jobname.pl.eolang} +\begin{VerbatimOut}{eolang.pl} $tex = $ARGV[0]; $tex =~ s/^\s+|\s+$//g; $tex =~ s/(\\[a-zA-Z]+)\s+/\1/g; @@ -336,13 +382,12 @@ foreach my $c (@cmds) { } print '\end{phig}', "\n", '\endinput'; \end{VerbatimOut} -\message{^^Jeolang: file with Perl script (\jobname.pl.eolang) saved^^J}% -\iexec[trace,stdout=/dev/null]{ - perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g' \jobname.pl.eolang} +\message{^^Jeolang: File with Perl script (eolang.pl) saved^^J}% +\iexec[trace,null]{perl -pi -e 's/(\\\\[a-zA-Z])\\s+/\\1/g' eolang.pl} % \end{macrocode} % \end{macro} -% \begin{macro}{phigure} +% \begin{macro}{tikz} % Then, we include |tikz| package and its libraries: % \begin{macrocode} \RequirePackage{tikz} @@ -352,7 +397,6 @@ print '\end{phig}', "\n", '\endinput'; \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{intersections} \usetikzlibrary{positioning} - \usetikzlibrary{backgrounds} \usetikzlibrary{calc} \usetikzlibrary{shapes.arrows} % \end{macrocode} @@ -389,27 +433,28 @@ print '\end{phig}', "\n", '\endinput'; % \end{macrocode} % \end{macro} -% \begin{macro}{phigure} -% Then, create a new environment |figure|, as suggested +% \begin{macro}{sodg} +% \changes{0.0.2}{2022/10/20}{The environment ``phigure'' renamed to ``sodg'' for the sake of better semantic. The graph in the picture is solely a SODG graph, that's why the name ``sodg'' is better.} +% Then, create a new environment |sodg|, as suggested % \href{https://tex.stackexchange.com/questions/661056}{here}: % \begin{macrocode} -\NewDocumentEnvironment{phigure}{b}{% +\NewDocumentEnvironment{sodg}{b}{% \catcode`\ =10 % \catcode`\^^M=5 % \iexec[trace,stdout=\jobname.tex.eolang]{ - perl \jobname.pl.eolang '\detokenize{#1}'}% + perl eolang.pl '\detokenize{#1}'}% }{} -\AddToHook{env/phigure/before}{\bgroup\obeylines\obeyspaces} -\AddToHook{env/phigure/after}{\egroup} +\AddToHook{env/sodg/before}{\bgroup\obeylines\obeyspaces} +\AddToHook{env/sodg/after}{\egroup} % \end{macrocode} % \end{macro} % \Finale -%\clearpage - +% \clearpage % \printbibliography +% \clearpage -%\PrintChanges -%\clearpage -%\PrintIndex +% \PrintChanges +% \clearpage +% \PrintIndex diff --git a/macros/latex/contrib/eolang/eolang.pdf b/macros/latex/contrib/eolang/eolang.pdf index ba13e9dcb4..9d25d90981 100644 Binary files a/macros/latex/contrib/eolang/eolang.pdf and b/macros/latex/contrib/eolang/eolang.pdf differ diff --git a/macros/latex/contrib/frenchmath/README.md b/macros/latex/contrib/frenchmath/README.md index 28cc6dc4ce..0e6ac53066 100644 --- a/macros/latex/contrib/frenchmath/README.md +++ b/macros/latex/contrib/frenchmath/README.md @@ -4,7 +4,8 @@ ## Presentation The package provides: -- capital letters in upright shape for mathematical mode according to French rule (package option), +- roman uppercase letters in mathematical mode according to French rule (can be optionnally disabled), +- optionally lowercase Greek letters in upright shape, - correct spacing after commas and before a semicolon in math mode, - some useful macros and aliases for symbols used in France : `\infeg`, `\supeg`, `\paral`,... - several macros for writing french operator names like pgcd, ppcm, Card, rg, Vect,... diff --git a/macros/latex/contrib/frenchmath/frenchmath.dtx b/macros/latex/contrib/frenchmath/frenchmath.dtx index 6713dd75aa..2172fda603 100644 --- a/macros/latex/contrib/frenchmath/frenchmath.dtx +++ b/macros/latex/contrib/frenchmath/frenchmath.dtx @@ -20,7 +20,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{frenchmath} -[2022/10/16 v1.6 .dtx frenchmath file] + [2022/10/25 v2.0 .dtx frenchmath file] % %<*driver> \documentclass{ltxdoc} @@ -28,10 +28,13 @@ \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{lmodern} -\usepackage{frenchmath} -\usepackage{upgreek} +\usepackage[upgreek]{frenchmath} % pour l'exemple de la doc on utilise \PV pour simuler le ; d'origine -\DeclareMathSymbol{\PV}\mathpunct{operators}{'73} % '73 = code octal du ; +\DeclareMathSymbol{\PV}\mathpunct{operators}{'73} % '73 = code octal du ; dans ecrm (ou cmr) +% pour récupérer le symbole \emptyset de computer modern au cas où on voudrait +% changer la fonte de ce doc : +\DeclareSymbolFont{cmsymbols}{OMS}{cmsy}{m}{n} +\DeclareMathSymbol{\cmemptyset}{\mathord}{cmsymbols}{'73} % code octal dans cmsy \DisableCrossrefs %\CodelineIndex %\RecordChanges @@ -39,7 +42,7 @@ \hypersetup{% colorlinks, linkcolor=blue, - citecolor=blue, + citecolor=red, pdftitle={frenchmath}, pdfsubject={LaTeX package}, pdfauthor={Antoine Missier} @@ -52,7 +55,7 @@ % % \fi % -% \CheckSum{266} +% \CheckSum{523} % % \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 @@ -88,13 +91,18 @@ % \changes{v1.6}{2022/10/16}{Remplacement de icomma par ncccomma, grâce à une proposition % de Jean-François Burnol, amélioration du code redéfinissant les majuscules mathématiques, % remplacement de \backslash tgh par \th pour la tangente hyperbolique.} +% \changes{v2.0}{2022/10/24}{option permettant de définir les lettres +% grecques minuscules en forme droite, +% correction de bug avec la commande \bslash qui n'était pas définie, +% compatibilité avec mathdesign, +% \mathop{\operatorfont th} remplacé par \operatorname{th}} % % \GetFileInfo{frenchmath.sty} % % \title{L'extension \textsf{frenchmath}\thanks{Ce document -% correspond à \textsf{frenchmath}~\fileversion, dernière modification le 16/10/2022.}} +% correspond à \textsf{frenchmath}~\fileversion, dernière modification le 25/10/2022.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{16 octobre 2022} +% \date{25 octobre 2022} % \maketitle % % \section{Introduction} @@ -102,20 +110,27 @@ % permet le respect des règles typographiques mathématiques françaises, % en particulier la possibilité d'obtenir automatiquement % les majuscules en romain (lettres droites) plutôt qu'en italique -% (voir~\cite{RTIN} et~\cite{IGEN}) +% (voir~\cite{RTIN} et~\cite{IGEN}) % ainsi que des espacements corrects % pour les virgules et point-virgules %\footnote{Merci à Jean-François Burnol pour différentes améliorations proposées au code.}. +% Depuis la version 2.0, une option permet également de composer les minuscules grecques +% du mode mathématique en forme droite plutôt qu'en italique. % % D'autres solutions pour composer les majuscules mathématiques en romain -% sont proposées dans les extensions \textsf{fourier}~\cite{FOUR} -% (avec la famille des polices Adobe Utopia) -% ou encore \textsf{mathdesign}~\cite{DESIGN} (avec les polices Adobe Utopia, -% URW Garamond ou Bitstream Charter). Mais \textsf{frenchmath} -% fournit une solution générique s'adaptant à n'importe quelle police. +% sont proposées dans les extensions \textsf{fourier} de Michel Bovani~\cite{FOUR} +% (avec la famille des fontes Adobe Utopia) +% ou encore \textsf{mathdesign} de Paul Pichaureau~\cite{DESIGN} +% (avec les fontes Adobe Utopia, URW Garamond ou Bitstream Charter). +% Mais \textsf{frenchmath} fournit une solution générique +% s'adaptant à n'importe quelle fonte +% \footnote{Si l'on souhaite néanmoins utiliser \textsf{mathdesign} avec \textsf{frenchmath}, +% il faut charger \textsf{frenchmath} \emph{après} \textsf{mathdesign}.}. +% \textdollar % % D'autres préconisations, telles que composer en lettre droite -% et non en italique le symbole différentiel, les constantes mathématiques i et e~\cite{IGEN}, +% et non en italique le symbole différentiel, +% les constantes mathématiques i et e~\cite{IGEN}, % sont des règles internationales~\cite{TYPMA}~\cite{ICTNS}~\cite{LSHORT}. % Elles ne sont donc pas implémentées dans \textsf{frenchmath} % \footnote{Nous proposons pour cela l'extension \textsf{mismath}~\cite{MIS} @@ -124,11 +139,11 @@ % L'extension fournit en outre diverses macros francisées. % Quelques différences sont à signaler avec \textsf{mafr} : % \begin{itemize} -% \item nous avons choisi de ne pas substituer les symboles français aux symboles anglo-saxons -% avec le même nom de commande ; -% \item les macros présentées dans la section 2 qui correspondent à des macros de \textsf{mafr} +% \item nous avons choisi de ne pas substituer les symboles français aux symboles +% anglo-saxons avec le même nom de commande ; +% \item les macros présentées dans la section 2 correspondant à des macros de \textsf{mafr} % sont signalées par un astérisque en fin d'item, les autres sont nouvelles ; -% \item enfin quelques commandes de \textsf{mafr} ne sont pas spécifiques +% \item enfin quelques commandes de \textsf{mafr} ne sont pas spécifiques % aux mathématiques françaises et ne sont donc pas abordées ici : % c'est le cas de |\vect| % \footnote{Pour de jolis vecteurs on dispose de l'extension \textsf{esvect} @@ -150,18 +165,96 @@ % Il faut dire que cette convention n'est pas commode à mettre en œuvre, % ni avec \LaTeX, ni avec les éditeurs de formule des traitements de textes usuels, % et peu d'auteurs la respectent. -% La mise en œuvre automatique de cette recommandation est le principal bénéfice -% de \textsf{frenchmath} (comme de \textsf{mafr}). +% La mise en œuvre automatique de cette recommandation, quelle que soit la fonte utilisée, +% est le principal bénéfice +% de \textsf{frenchmath}. % Par défaut |\[ P(X)=\sum_{i=0}^{n}a_i X^i \]| donne avec \textsf{frenchmath} -% \[ P(X)=\sum_{i=0}^{n}a_i X^i \] +% \[ P(X)=\sum_{i=0}^{n}a_i X^i. \] % % \DescribeEnv{capsit} -% L'extension \textsf{frenchmath} possède une option : |capsit|, +% L'extension \textsf{frenchmath} possède l'option |capsit|, % qui permet de conserver la composition des majuscules du mode mathématique % en italique (dans la famille de fonte par défaut). % Que l'option soit activée ou pas, il est toujours possible de changer l'aspect % d'une lettre particulière, avec les macros \LaTeX\ |\mathrm| et |\mathit|. % +% \subsection{Lettres grecques} +% La norme concernant l'usage des lettres grecques en italique ou en forme droite +% pour les mathématiques françaises ne semble pas très claire et les auteurs +% divergent sur ce point. Plusieurs recommandent l'usage des lettres grecques +% minuscules en forme droite~\cite{FOUR}~\cite{DESIGN}, mais d'autres +% préconisent l'italique, +% comme pour toutes les variables mathématiques~\cite{AA}. +% Le lexique des règles typographiques en usage à l’Imprimerie Nationale~\cite{RTIN} +% les compose en forme droite et relativement grasses (p.108) +% sans préciser s'il s'agit vraiment d'une règle +% s'appliquant aux variables, au même titre que celles énoncées pour l'alphabet latin. +% +% Pour les physiciens (et chimistes) l'affaire est plus claire puisque +% les quantités doivent toujours être écrites en italique et les unités ou les constantes en +% romain (forme droite), conformément à la norme ISO~\cite{ISO}~\cite{TYPMA}~\cite{ICTNS}. +% Ainsi la constante $\pi \approx 3,14$ ne s'écrit pas de la même manière +% qu'une variable $\itpi$. +% Les extensions \textsf{mathdesign}~\cite{DESIGN} +% ou \textsf{fourier}~\cite{FOUR} disposent d'une option permettant +% l'écriture automatique des lettres grecques minuscules en forme droite. +% +% \DescribeEnv{upgreek} +% Avec la même philosophie, \textsf{frenchmath} fournit l'option \texttt{upgreek} +% basée sur l'extension \textsf{upgreek} de Walter Schmidt~\cite{UPGREEK} qui donne +% accès aux lettres grecques minuscules en forme droite : +% |\upalpha|, |\upbeta|, \ldots +% L'extension \textsf{upgreek} sera chargée avec l'option par défaut, \texttt{Euler}. +% Si l'on veut, par contre, utiliser l'extension \textsf{upgreek} +% avec l'une de deux autres options disponibles, \texttt{Symbol} +% ou \texttt{Symbolsmallscale} (utilisant la fonte Adobe Symbol), +% il faut charger l'extension \textsf{upgreek} avec l'option souhaitée +% \emph{avant} \textsf{frenchmath} +% \footnote{L'option \texttt{Symbol} de \textsf{upgreek} se marie mieux +% avec une fonte comme Times par exemple.}. +% L'option \texttt{upgreek} de \textsf{frenchmath} redéfinit les commandes +% |\alpha|, |\beta|, \ldots +% pour produire automatiquement les lettres en forme droite +% $\alpha$, $\beta$, \ldots, les formes italiques, $\italpha, \itbeta$, \ldots +% restant cependant disponibles avec les commandes |\italpha|, |\itbeta|, \ldots +% +% Mentionnons ce commentaire de Walter Schmidt~\cite{UPGREEK} que le mu +% utilisé pour le préfixe des unités physiques, \textmu, doit se composer avec |\textmu|, +% disponible en mode texte dans la plupart des fontes (ou avec \textsf{textcomp}) ; +% il diffère du $\upmu$ de |\upmu|. +% +% \medskip +% \DescribeEnv{Upgreek} +% Avec \LaTeX, les lettres grecques majuscules sont automatiquement composées +% en forme droite, néanmoins il peut être utile de disposer de toutes +% les lettres grecques dans le même style ; ainsi l'extension \textsf{upgreek} +% propose aussi |\Upgamma|, \ldots, |Upomega| : $\Upgamma, \ldots, \Upomega$. +% L'option \texttt{Upgreek} de \textsf{frenchmath} redéfinit les majuscules +% |\Gamma|,\ldots, |\Omega| pour correspondre à ces variantes. +% Par contre l'on n'a alors plus accès aux caractères d'origine : $\Gamma, \ldots, \Omega$. +% +% L'option \texttt{Upgreek} couvre aussi toutes les fonctionnalités +% des minuscules grecques de l'option \texttt{upgreek}, qu'il est donc +% inutile d'invoquer simultanément. +% +% \medskip +% Les caractères grecs de l'extension \textsf{upgreek} ne se marient pas toujours de manière +% harmonieuse avec n'importe quelle fonte de texte. +% On peut vouloir charger une autre fonte de lettres grecques +% compatible avec la fonte de texte utilisée, si tant est qu'elle soit disponible. +% Il suffit alors simplement de charger l'extension voulue sans appeler l'option +% \texttt{upgreek} dans \textsf{frenchmath}. +% Citons \textsf{pxgreeks}~\cite{PXGREEK}, \textsf{txgreeks}~\cite{TXGREEK} +% ou \textsf{libgreek}~\cite{LIBGREEK} de Jean-François Burnol, +% qui donnent de beaux résultats pour une utilisation avec +% respectivement les fontes Palatino, Times et Libertine. +% Mais attention ces extensions doivent être chargées \emph{après} \textsf{amsmath} +% (et donc aussi \textsf{mismath}) +% \footnote{En effet, elles redéfinissent les commandes \texttt{\bslash iint}, +% \texttt{\bslash iiint}, \texttt{\bslash iiiint}, \texttt{\bslash idotsint}.}. +% Ces paquets fournissent également des options +% pour redéfinir les commandes de lettres grecques, minuscules comme majuscules. +% % \subsection{Virgules et point-virgule} % \StandardMathComma % Dans le mode mathématique de \LaTeX, la virgule est toujours, par défaut, @@ -185,6 +278,7 @@ % la virgule se comporte comme un caractère ordinaire si elle est suivie d'un chiffre % (sans espace), sinon c'est un caractère de ponctuation. % \end{itemize} +% % Cette deuxième approche parait meilleure, néanmoins \textsf{ncccomma} % ne fonctionne pas avec avec l'option \texttt{autolanguage} % \footnote{L'option \texttt{autolanguage} de \textsf{numprint} utilisée @@ -219,35 +313,37 @@ % \StandardMathComma % \footnote{Un autre problème d'espacement, non spécifique au français, % se pose avec les délimiteurs $[$ et $]$, -% par exemple $x \in ]0, \uppi[$. L'extension \textsf{mismath} -% fournit une solution à ce problème.}. +% par exemple $x \in ]0, \pi[$. L'extension \textsf{mismath} +% corrige ce problème.}. % % \subsection{Quelques macros et alias utiles} % % \DescribeMacro{\curs} -% Les lettres cursives ($\curs{A}, \curs{B}, \curs{C}, \curs{D}, \ldots$) sont composées -% avec la macro |\curs| et sont différentes de celles obtenues +% Les lettres cursives ($\curs{A}, \curs{B}, \curs{C}, \curs{D}, \ldots$), +% provenant de l'extension \textsf{mathrsfs} chargée par \textsf{frenchmath}, sont composées +% avec |\curs| et sont différentes de celles obtenues % avec |\mathcal| % \footnote{L'extension \textsf{calrsfs} fournit les mêmes cursives mais en redéfinissant % la commande \texttt{\bslash mathcal}.} % ($\mathcal{A}, \mathcal{B}, \mathcal{C}, \mathcal{D}, \ldots$). -% L'activation du mode mathématique n'est pas nécessaire.* -% \footnote{Comme dit dans l'introduction, l'astérisque en fin d'item signale +% La commande |\curs| permet aussi de composer ces lettres en mode texte, +% sans les délimiteurs du mode mathématique.* +% \footnote{Comme précisé dans l'introduction, l'astérisque en fin d'item signale % une fonctionnalité similaire dans \textsf{mafr}.} % % \medskip % \DescribeMacro{\infeg} \DescribeMacro{\supeg} % Les relations $\infeg$ et $\supeg$ s'obtiennent avec les commandes |\infeg| et |\supeg| % et diffèrent des versions anglaises de |\leq| ($\leq$) et |\geq| ($\geq$). -% Ce sont des alias des commandes |\leqslant| et |\geqslant| de l'extension \textsf{amssymb} +% Ce sont des alias de |\leqslant| et |\geqslant| de l'extension \textsf{amssymb}, % chargée par \textsf{frenchmath}.* % % \medskip % \DescribeMacro{\vide} -% Le symbole $\vide$ -% s'obtient avec |\vide| (alias de |\varnothing| de l'extension \textsf{amssymb}) ; -% il diffère de la version anglaise -% obtenue avec |\emptyset| : $\emptyset$.* +% Le symbole de l'ensemble vide $\vide$ +% s'obtient avec |\vide| (alias de la commande |\varnothing| de l'extension \textsf{amssymb}) ; +% il diffère de celui obtenu avec |\emptyset| +% (particulièrement laid dans la fonte par défaut Computer Modern : $\cmemptyset$).* % % \medskip % \DescribeMacro{\paral} @@ -264,8 +360,8 @@ % % \medskip % \DescribeMacro{\cmod} -% Bien que \LaTeX\ propose par défaut le modulo entre parenthèses, avec |\pmod|, -% qui est standard aussi en français, on peut vouloir composer un modulo entre crochets, +% Le modulo se compose normalement entre parenthèses, avec |\pmod|, +% mais on rencontre aussi, en français, le modulo entre crochets, % ce que permet la commande |\cmod| en respectant le bon espacement % propre au modulo : $ 5 \equiv 53 \cmod{12}$. % @@ -277,15 +373,16 @@ % \footnote{Cette dernière n'est pas implémentée en standard dans \LaTeX\ % (mais dans \textsf{mismath}).}. % -% \pagebreak +% \medskip % \DescribeMacro{\card} \DescribeMacro{\Card} -% Pour le cardinal d'un ensemble, nous proposons |\card|, cité dans~\cite{RTIN} et \cite{AA}, -% ou |\Card|, d'usage courant (cf. Wikipedia). +% Pour le cardinal d'un ensemble, nous proposons |\card|, +% cité dans~\cite{RTIN} et~\cite{AA}, +% ou |\Card|, qui est aussi d'usage courant (cf. Wikipedia). % % \medskip % \DescribeMacro{\Ker} \DescribeMacro{\Hom} % \LaTeX\ fournit les macros -% |\ker| et |\hom| alors que l'usage français est souvent +% |\ker| et |\hom|, alors que l'usage français est souvent % de commencer ces noms par une majuscule pour obtenir $\Ker$ % \footnote{La commande \texttt{\bslash Im} existe déjà pour la % partie imaginaire des nombres complexes et produit $\Im$ ; @@ -301,9 +398,9 @@ % \medskip % \DescribeMacro{\ch} \DescribeMacro{\sh} \DescribeMacro{\th} % En principe, les fonctions hyperboliques s'écrivent en français -% avec les macros \LaTeX\ standard |\cosh|, |\sinh|, |\tanh| ; -% les écritures $\ch x$, $\sh x$ et $\th x$ ne sont la norme -% qu'avec les langues d'Europe de l'Est~\cite{COMP}, néanmoins ces écritures +% avec les macros \LaTeX\ standard |\cosh|, |\sinh|, |\tanh|. +% Néanmoins les écritures $\ch x$, $\sh x$ et $\th x$, qui sont la norme +% avec les langues d'Europe de l'Est~\cite{COMP}, % sont aussi utilisées en France~\cite{RTIN}. % On les obtient avec les commandes |\ch|, |\sh| et |\th| % \footnote{La commande \texttt{\bslash th} existe déjà (pour le mode texte uniquement) ; @@ -321,14 +418,15 @@ % % \DescribeMacro{\Oij*} \DescribeMacro{\Oijk*} \DescribeMacro{\Ouv*} % Les versions étoilées utilisent le point-virgule et non la virgule -% comme séparateur après le point O, comme mentionné dans \cite{RTIN}. +% comme séparateur après le point O, comme mentionné dans~\cite{RTIN}. % On obtient \Oij*, \Oijk*, \Ouv*. % % \DescribeMacro{\ij} \DescribeMacro{\ijk} -% Enfin les macros |\ij| et |\ijk| composent la base du plan \ij -% et de l'espace \ijk, en homogénéisant la hauteur des flèches. +% Enfin les macros |\ij| et |\ijk| composent les bases du plan et de l'espace, \ij +% et \ijk, en homogénéisant la hauteur des flèches. % Notons que la macro |\ij| existait déjà (ligature entre i et j pour le hollandais) % et a été redéfinie. +% % % \StopEventually{} % @@ -338,30 +436,43 @@ \RequirePackage{ifthen} \newboolean{capsit} \DeclareOption{capsit}{\setboolean{capsit}{true}} +\newboolean{upgreek} +\newboolean{Upgreek} +\DeclareOption{upgreek}{\setboolean{upgreek}{true}} +\DeclareOption{Upgreek}{\setboolean{upgreek}{true} + \setboolean{Upgreek}{true}} \ProcessOptions \relax -\RequirePackage{mathrsfs} % fournit les majuscules cursives -\RequirePackage{amssymb} % fournit \leqslant, \geqslant et \varnothing +\@ifpackageloaded{mathdesign}{ + \PackageWarningNoLine{frenchmath}{Package mathdesign is loaded, + I don't load mathrsfs and amssymb packages} +}{ + \RequirePackage{mathrsfs} % fournit les majuscules cursives + \RequirePackage{amssymb} % fournit \leqslant, \geqslant, \varnothing +} \RequirePackage{amsopn} % fournit \DeclareMathOperator \RequirePackage{xspace} % utile pour les commandes \curs, \ssi, \Oij % \RequirePackage{icomma} \RequirePackage{ncccomma} % virgule intelligente \AtBeginDocument{\mathcode`\,="8000\relax - \@ifpackageloaded{babel}{\addto\extrasfrench{\mathcode`\,="8000\relax}}{}} + \@ifpackageloaded{babel}{ + \addto\extrasfrench{\mathcode`\,="8000\relax} + }{} +} % \end{macrocode} -% Merci à J.F. Burnol pour ce patch permettant d'utiliser \textsf{ncccomma} +% Merci à J.F.~Burnol pour ce patch permettant d'utiliser \textsf{ncccomma} % à la place de \textsf{icomma}, ainsi que pour l'amélioration du code ci-après, % redéfinissant les majuscules mathématiques. % -% Sauf avec l'option \texttt{capsit}, on redéfinit toutes les lettres majuscules +% Sauf si l'option \texttt{capsit} est activée, on redéfinit toutes les lettres majuscules % du mode mathématique ; |\AtBeginDocument| est nécessaire pour que % ces définitions soient prises en compte avec la classe \textsf{beamer} % par exemple. % \smallskip % \begin{macrocode} - -\ifthenelse{\boolean{capsit}}{}{\AtBeginDocument{ - \DeclareMathSymbol{A}\mathalpha{operators}{`A} %'A codage octal du A +\ifthenelse{\boolean{capsit}}{}{ + \AtBeginDocument{ + \DeclareMathSymbol{A}\mathalpha{operators}{`A} \DeclareMathSymbol{B}\mathalpha{operators}{`B} \DeclareMathSymbol{C}\mathalpha{operators}{`C} \DeclareMathSymbol{D}\mathalpha{operators}{`D} @@ -387,7 +498,95 @@ \DeclareMathSymbol{X}\mathalpha{operators}{`X} \DeclareMathSymbol{Y}\mathalpha{operators}{`Y} \DeclareMathSymbol{Z}\mathalpha{operators}{`Z} - }} + } +} +% \end{macrocode} +% Avec l'option \texttt{upgreek}, on charge l'extension \textsf{upgreek} +% (sauf si elle est déjà chargée, ce qui évite les incompatibilités d'option) +% et on redéfinit les commandes |\alpha|, |\beta|, \ldots +% \texttt{Upgreek} transforme en outre les majuscules grecques pour garder +% le même style. +% \begin{macrocode} + +\ifthenelse{\boolean{upgreek}}{ + \@ifpackageloaded{upgreek}{}{\RequirePackage[Euler]{upgreek}} + \@ifundefined{italpha}{\let\italpha\alpha}{ + \PackageWarningNoLine{frenchmath}{Italicized Greek \bslash italpha + also defined, no more warning for the other letters} + } + \@ifundefined{itbeta}{\let\itbeta\beta}{} + \@ifundefined{itgamma}{\let\itgamma\gamma}{} + \@ifundefined{itdelta}{\let\itdelta\delta}{} + \@ifundefined{itepsilon}{\let\itepsilon\epsilon}{} + \@ifundefined{itzeta}{\let\itzeta\zeta}{} + \@ifundefined{iteta}{\let\iteta\eta}{} + \@ifundefined{ittheta}{\let\ittheta\theta}{} + \@ifundefined{itiota}{\let\itiota\iota}{} + \@ifundefined{itkappa}{\let\itkappa\kappa}{} + \@ifundefined{itlambda}{\let\itlambda\lambda}{} + \@ifundefined{itmu}{\let\itmu\mu}{} + \@ifundefined{itnu}{\let\itnu\nu}{} + \@ifundefined{itxi}{\let\itxi\xi}{} + \@ifundefined{itpi}{\let\itpi\pi}{} + \@ifundefined{itrho}{\let\itrho\rho}{} + \@ifundefined{itsigma}{\let\itsigma\sigma}{} + \@ifundefined{ittau}{\let\ittau\tau}{} + \@ifundefined{itupsilon}{\let\itupsilon\upsilon}{} + \@ifundefined{itphi}{\let\itphi\phi}{} + \@ifundefined{itchi}{\let\itchi\chi}{} + \@ifundefined{itpsi}{\let\itpsi\psi}{} + \@ifundefined{itomega}{\let\itomega\omega}{} + \@ifundefined{itvarepsilon}{\let\itvarepsilon\varepsilon}{} + \@ifundefined{itvartheta}{\let\itvartheta\vartheta}{} + \@ifundefined{itvarpi}{\let\itvarpi\varpi}{} + \@ifundefined{itvarsigma}{\let\itvarsigma\varsigma}{} + \@ifundefined{itvarphi}{\let\itvarphi\varphi}{} + + \renewcommand\alpha{\upalpha} + \renewcommand\beta{\upbeta} + \renewcommand\gamma{\upgamma} + \renewcommand\delta{\updelta} + \renewcommand\epsilon{\upepsilon} + \renewcommand\zeta{\upzeta} + \renewcommand\eta{\upeta} + \renewcommand\theta{\uptheta} + \renewcommand\iota{\upiota} + \renewcommand\kappa{\upkappa} + \renewcommand\lambda{\uplambda} + \renewcommand\mu{\upmu} + \renewcommand\nu{\upnu} + \renewcommand\xi{\upxi} + \renewcommand\pi{\uppi} + \renewcommand\rho{\uprho} + \renewcommand\sigma{\upsigma} + \renewcommand\tau{\uptau} + \renewcommand\upsilon{\upupsilon} + \renewcommand\phi{\upphi} + \renewcommand\chi{\upchi} + \renewcommand\psi{\uppsi} + \renewcommand\omega{\upomega} + \renewcommand\varepsilon{\upvarepsilon} + \renewcommand\vartheta{\upvartheta} + \renewcommand\varpi{\upvarpi} + \renewcommand\varrho{\upvarrho} + \renewcommand\varsigma{\upvarsigma} + \renewcommand\varphi{\upvarphi} +}{} + +\ifthenelse{\boolean{Upgreek}}{ + \renewcommand\Gamma{\Upgamma} + \renewcommand\Delta{\Updelta} + \renewcommand\Theta{\Uptheta} + \renewcommand\Lambda{\Uplambda} + \renewcommand\Xi{\Upxi} + \renewcommand\Pi{\Uppi} + \renewcommand\Sigma{\Upsigma} + \renewcommand\Upsilon{\Upupsilon} + \renewcommand\Phi{\Upphi} + \renewcommand\Psi{\Uppsi} + \renewcommand\Omega{\Upomega} +}{} + \DeclareMathSymbol{;}\mathbin{operators}{'73} % \mathpunct à l'origine \AtBeginDocument{\@ifpackageloaded{pstricks-add}{\psset{comma=true}}{}} @@ -410,90 +609,100 @@ \DeclareMathOperator{\ch}{ch} \DeclareMathOperator{\sh}{sh} \AtBeginDocument{\let\oldth\th %\th existe déjà (mode texte uniquement) - \renewcommand{\th}{\TextOrMath{\oldth}{\mathop{\operatorfont th}}} -} +\renewcommand{\th}{\TextOrMath{\oldth}{\mathop{\operatorfont th}}}} +{\catcode`\|=\z@ \catcode`\\=12 |gdef|bslash{\}} % la commande \bslash \PackageWarningNoLine{frenchmath}{ - command \bslash tgh in now obsolete, use \bslash th instead -} + Command \bslash tgh in now obsolete, use \bslash th instead} +% \end{macrocode} +% La commande |\bslash| provient du package \textsf{doc.sty} de Frank +% Mittelbach. Elle est utilisée à la place de |\textbackslash| +% (qui ne fonctionne pas ici). -\newcommand\@Oij{\ensuremath{ - \left(O, \vec{\imath}, \vec{\jmath}\,\right)}\xspace -} -\newcommand\@@Oij{\ensuremath{ - \left(O ; \vec{\imath}, \vec{\jmath}\,\right)}\xspace -} +% \begin{macrocode} + +\newcommand\@Oij{% + \ensuremath{\left(O, \vec{\imath}, \vec{\jmath}\,\right)}\xspace} +\newcommand\@@Oij{% + \ensuremath{\left(O ; \vec{\imath}, \vec{\jmath}\,\right)}\xspace} \newcommand\Oij{\@ifstar{\@@Oij}{\@Oij}} -\newcommand\@Oijk{\ensuremath{ +\newcommand\@Oijk{% + \ensuremath{% \left(O, \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath}, - \vec{\vphantom{t}\smash{k}}\,\right) - }\xspace -} -\newcommand\@@Oijk{\ensuremath{ + \vec{\vphantom{t}\smash{k}}\,\right)}% + \xspace} +\newcommand\@@Oijk{% + \ensuremath{% \left(O ; \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath}, - \vec{\vphantom{t}\smash{k}}\,\right) - }\xspace -} + \vec{\vphantom{t}\smash{k}}\,\right)}% + \xspace} \newcommand\Oijk{\@ifstar{\@@Oijk}{\@Oijk}} -\newcommand\@Ouv{\ensuremath{ - \left(O, \vec{u}, \vec{v}\,\right)}\xspace -} -\newcommand\@@Ouv{\ensuremath{ - \left(O ; \vec{u}, \vec{v}\,\right)}\xspace -} +\newcommand\@Ouv{% + \ensuremath{\left(O, \vec{u}, \vec{v}\,\right)}\xspace} +\newcommand\@@Ouv{% + \ensuremath{\left(O ; \vec{u}, \vec{v}\,\right)}\xspace} \newcommand\Ouv{\@ifstar{\@@Ouv}{\@Ouv}} -\AtBeginDocument{\renewcommand\ij{\ensuremath{ - \left(\vec{\imath}, \vec{\jmath}\,\right)}\xspace - }} -\newcommand\ijk{\ensuremath{ +\AtBeginDocument{ + \renewcommand\ij{% + \ensuremath{\left(\vec{\imath}, \vec{\jmath}\,\right)}\xspace}} +\newcommand\ijk{% + \ensuremath{% \left(\vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath}, - \vec{\vphantom{t}\smash{k}}\,\right) - }\xspace -} + \vec{\vphantom{t}\smash{k}}\,\right)}% + \xspace} % \end{macrocode} -% % \begin{thebibliography}{19} +% \begin{raggedright} % \bibitem{RTIN} \emph{Lexique des règles typographiques en usage à l’Imprimerie Nationale}. % Édition du 26/08/2002. % \bibitem{IGEN} \emph{Composition des textes scientifiques}. % Inspection générale de mathématiques (IGEN-DESCO), 06/12/2001. -% \bibitem{AA} \emph{Règles françaises de typographie mathématique}. +% \bibitem{AA} \emph{Règles françaises de typographie mathématique}. % Alexandre André, 02/09/2015. % \bibitem{ES} \emph{Le petit typographe rationnel}. Eddie Saudrais, 20/03/2000. -% \bibitem{ISO} \emph{Norme ISO 31-11: 1992 et sa révision ISO 80000-2: 2009 (extraits)}. -% http://aalem.free.fr/maths/mathematiques.pdf. +% \bibitem{ISO} \emph{Norme ISO 31-11}, 1992 et sa révision \emph{ISO 80000-2}, 2009. % \bibitem{TYPMA} \emph{Typesetting mathematics for science and technology according % to ISO 31/XI}, Claudio Beccari, TUGboat Volume 18 (1997), \No1. % \bibitem{ICTNS} \emph{On the Use of Italic and up Fonts for Symbols in Scientific Text}, -% I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee on Nomenclature and Symbols), -% dec 1999. +% I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee on Terminology, +% Nomenclature and Symbols), dec 1999. % \bibitem{COMP} \emph{\LaTeX\ Companion}. Frank Mittelbach, Michel Goossens, % 2\ieme édition, Pearson Education France, 2005. % \bibitem{LSHORT} \emph{The Not So Short Introduction to \LaTeXe}. Manuel \LaTeX\ % de Tobias Oetiker, Hubert Partl, Irene Hyna et Elisabeth Schlegl, CTAN, v6.2 28/02/2018. -% \bibitem{MAFR} \emph{La distribution \textsf{mafr}}. Extension \LaTeX\ de Christian Obrecht, +% \bibitem{MAFR} \emph{La distribution \textsf{mafr}}. Christian Obrecht, % CTAN, v1.0 17/09/2006. -% \bibitem{FRM} \emph{L'extension \textsf{tdsfrmath}}. Extension \LaTeX\ de Yvon Henel, +% \bibitem{FRM} \emph{L'extension \textsf{tdsfrmath}}. Yvon Henel, % CTAN, v1.3 22/06/2009. -% \bibitem{FOUR} \textsf{Fourier}-GUT\hspace{-0.1em}\emph{enberg}. -% Extension \LaTeX\ de Michel Bovani, CTAN, v1.3 30/01/2005. -% \bibitem{DESIGN} \emph{The \textsf{mathdesign} package}. Extension \LaTeX\ de +% \bibitem{FOUR} \textsf{Fourier-GUT\hspace{-0.1em}\emph{enberg}}. +% Michel Bovani, CTAN, v1.3 30/01/2005. +% \bibitem{DESIGN} \emph{The \textsf{mathdesign} package}. % Paul Pichaureau, CTAN, 29/08/2013. +% \bibitem{UPGREEK} \emph{The \textsf{upgreek} package for \LaTeXe}. Walter Schmidt, CTAN, +% v2.0 12/03/2003. +% \bibitem{PXGREEK} \emph{The \textsf{pxgreeks} package}. Jean-François Burnol, CTAN, +% v1.0 16/03/2011. +% \bibitem{TXGREEK} \emph{The \textsf{txgreeks} package}. Jean-François Burnol, CTAN, +% v1.0 16/03/2011. +% \bibitem{LIBGREEK} \emph{The \textsf{libgreek} package}. Jean-François Burnol, CTAN, +% v1.0 14/03/2011. % \bibitem{BABEL} \emph{A Babel language definition file for French}. Extension \LaTeX\ % \textsf{babel-french} de Daniel Flipo, CTAN, v3.5c 14/09/2018. % \bibitem{ICOMMA} \emph{The \textsf{icomma} package for \LaTeXe}. -% Extension \LaTeX\ de Walter Schmidt, CTAN, v2.0 10/03/2002. +% Walter Schmidt, CTAN, v2.0 10/03/2002. % \bibitem{NCC} \emph{The \textsf{ncccomma} package}. Alexander I.~Rozhenko, % CTAN, v1.0 10/02/2005. % \bibitem{BECC} \emph{Intelligent commas}. Claudio Beccari, The Prac\TeX\ Journal, % 2011, No.\@1 % \bibitem{VECT} \emph{Typesetting vectors with beautiful arrow with \LaTeXe}. % Extension \LaTeX\ \textsf{esvect} d'Eddie Saudrais, CTAN, v1.3 11/07/2013. -% \bibitem{MIS} \emph{\textsf{mismath} -- Miscellaneus mathematical macros}. Extension \LaTeX\ -% d'Antoine Missier, CTAN, v1.4 22/05/2019. +% \bibitem{MIS} \emph{\textsf{mismath} -- Miscellaneus mathematical macros}. +% Antoine Missier, CTAN, v1.10 25/10/2022. +% \end{raggedright} % \end{thebibliography} % \Finale \endinput + diff --git a/macros/latex/contrib/frenchmath/frenchmath.pdf b/macros/latex/contrib/frenchmath/frenchmath.pdf index f51ddf7e49..96dd7338c7 100644 Binary files a/macros/latex/contrib/frenchmath/frenchmath.pdf and b/macros/latex/contrib/frenchmath/frenchmath.pdf differ diff --git a/macros/latex/contrib/iexec/iexec.dtx b/macros/latex/contrib/iexec/iexec.dtx index 94b924652a..0ee16eed8f 100644 --- a/macros/latex/contrib/iexec/iexec.dtx +++ b/macros/latex/contrib/iexec/iexec.dtx @@ -50,7 +50,7 @@ %\NeedsTeXFormat{LaTeX2e} %\ProvidesPackage{iexec} %<*package> -[2022-10-23 0.11.1 Inputable Shell Executions] +[2022-10-25 0.11.2 Inputable Shell Executions] % %<*driver> \documentclass{ltxdoc} @@ -354,7 +354,7 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. \ifdefined\iexec@append>\fi> \ifdefined\iexec@null/dev/null\else\iexec@stdout\fi \space\ifdefined\iexec@stderr2>\iexec@stderr\else2>&1\fi; - /bin/echo -n $?\% >\iexec@exit} + /bin/echo -n $?\% >\iexec@exit}% \ShellEscape{\iexec@cmd}% % \end{macrocode} % Then, a message is printed to \TeX{} log: @@ -364,21 +364,31 @@ This file won't be deleted: \iexec[stdout=me.txt]{whoami}. \fi% \endgroup% % \end{macrocode} +% Then, we read back the exit code, from the file: +% \begin{macrocode} + \immediate\openin\iexec@exitfile=\iexec@exit% + \read\iexec@exitfile to \iexec@code% + \immediate\closein\iexec@exitfile% +% \end{macrocode} % Then, if required, we print the content of the stdout file to \TeX{} log: +% \changes{0.11.2}{2022/10/25}{If execution fails, we print the content of 'stdout' anyway, even if the 'log' is not turned on.} % \begin{macrocode} \ifdefined\iexec@null\else% \ifdefined\iexec@log% - \message{iexec: This is the content of \iexec@stdout:^^J}% + \message{iexec: This is the content of '\iexec@stdout':^^J}% \iexec@typeout{\iexec@stdout}% \message{^^J}% + \else% + \ifnum\iexec@code=0\else% + \ifdefined\iexec@ignore\else% + \message{iexec: See the content of '\iexec@stdout' + after failure:^^J}% + \iexec@typeout{\iexec@stdout}% + \message{^^J}% + \fi% + \fi% \fi\fi% % \end{macrocode} -% Then, we read back the exit code, from the file: -% \begin{macrocode} - \immediate\openin\iexec@exitfile=\iexec@exit% - \read\iexec@exitfile to \iexec@code% - \immediate\closein\iexec@exitfile% -% \end{macrocode} % Then, we check whether it's zero or not (if not zero, we either print a message or fail the build, depending on the presence of |ignore| option): % \begin{macrocode} \ifnum\iexec@code=0\else% diff --git a/macros/latex/contrib/iexec/iexec.pdf b/macros/latex/contrib/iexec/iexec.pdf index c3d51f4982..1e6394be47 100644 Binary files a/macros/latex/contrib/iexec/iexec.pdf and b/macros/latex/contrib/iexec/iexec.pdf differ diff --git a/macros/latex/contrib/mismath/mismath.dtx b/macros/latex/contrib/mismath/mismath.dtx index 1475b084fa..b4c6465b24 100644 --- a/macros/latex/contrib/mismath/mismath.dtx +++ b/macros/latex/contrib/mismath/mismath.dtx @@ -20,21 +20,23 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{mismath} - [2022/10/17 v1.9 .dtx mismath file] + [2022/10/25 v1.10 .dtx mismath file] % %<*driver> \documentclass{ltxdoc} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} -\usepackage{lmodern,mathpazo} +\usepackage{mathpazo} \DeclareTextFontCommand{\extrafont}{\fontfamily{cmr}\selectfont} +% used for showing original \i and \j in text mode. \usepackage{mismath} \usepackage{amssymb} \usepackage{multicol} + %\enumber \inumber -\pinumber[Symbol] +\pinumber[Euler] % for an example in this doc we substitute [ and ] by \OB and \CB \DeclareMathSymbol{\OB}\mathclose{operators}{093} \DeclareMathSymbol{\CB}\mathopen{operators}{091} @@ -46,7 +48,7 @@ \hypersetup{% colorlinks, linkcolor=blue, - citecolor=blue, + citecolor=red, pdftitle={mismath}, pdfsubject={LaTeX package}, pdfauthor={Antoine Missier} @@ -59,7 +61,7 @@ % % \fi % -%% \CheckSum{428} +%% \CheckSum{430} % % \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 @@ -97,11 +99,14 @@ % \changes{v1.7}{2019/12/27}{Adding a table of contents to the documentation} % \changes{v1.8}{2020/11/15}{Incompatibility and solution mentioned when using i % with accent in beamer titles small changes in documentation} -% \changes{v1.9}{2020/10/17}{UpSh replaced by operators font in math mode, +% \changes{v1.9}{2020/10/17}{UpSh replaced by "operators" font in math mode, % PackageWarning "command exist" replaced by PackageWarningNoLine, % and also used by commands with arguments, % medspace replaced by thickspace in the \bslash lfrac command, % changing font in documentation} +% \changes{v1.10}{2020/10/25}{\bslash pinumber command code adapted to avoid +% incompatibility with the new release of frenchmath, +% default option (in upgreek) changed from Symbol to Euler.} % % \GetFileInfo{mismath.sty} % @@ -109,7 +114,7 @@ % corresponds to \textsf{mismath}~\fileversion, dated \filedate. % Thanks to François Bastouil for help in English translation.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{October 17, 2022} +% \date{October 25, 2022} % % \maketitle % \tableofcontents @@ -170,9 +175,10 @@ % \medskip % A recommendation, seldom observed, is to typeset uppercase Greek letters in italic shape % like other variables~\cite{ICTNS}. This is automatically done with -% the \textsf{fixmath} package by Walter Schmidt~\cite{FIXM}, +% the \textsf{fixmath} package by Walter Schmidt~\cite{FIXM} +% or the \textsf{isomath} package by Günter Milde~\cite{ISOM}, % but this feature is not implemented in \textsf{mismath} because this rule is conflicting -% to the one used for instance in France where all mathematics capitals +% to the one used in France where all mathematics capitals % have to be typeset in upright shape\footnote{The \textsf{frenchmath} package~\cite{FR} % takes this rule into account.}. % The choice of loading or not one of these packages remains thus to the user. @@ -232,10 +238,13 @@ % This recommendation is even less observed than the one concerning % $\e$ and $\i$~\cite{TYPMA}. % The \textsf{upgreek} package by Walter Schmidt~\cite{GREEK} makes it possible to typeset -% Greek letters in upright font by using commands such as |\upalpha|, |\upbeta|, \ldots\@ +% Greek letters in upright font\footnote{Many other packages deal with this problem, let us +% mention \textsf{mathdesign}, \textsf{fourier}, \textsf{pm-isomath}, +% \textsf{alphabeta}, \textsf{kpfonts}, \textsf{pxgreeks}, \textsf{libgreek}, etc.} +% by using commands such as |\upalpha|, |\upbeta|, \ldots\@ % To avoid typing a lot of |\uppi|, we provide the |\pinumber| macro, % which has to be put in the preamble. This command loads the \textsf{upgreek} package -% with an optional \meta{font} argument: \texttt{Symbol} (by default), \texttt{Euler} +% with an optional \meta{font} argument: \texttt{Euler} (by default), \texttt{Symbol} % or \texttt{Symbolsmallscale} (see~\cite{GREEK}). It also redefines the |\pi| % command to typeset all |\pi| in the selected upright font. @@ -640,7 +649,8 @@ % of [ as |mathopen| really appropriate % where this symbol could almost also logically have been defined as |mathclose|?}. % And consider that these symbols are most of the time preceded or followed by relational, -% binary or punctuation symbols and therefore spaces are correct without a delimiter definition. +% binary or punctuation symbols and therefore spaces are correct +% without a delimiter definition. % % \subsection{Environments for systems of equations and small matrices} % @@ -830,7 +840,7 @@ % % \medskip % \begin{macrocode} -\providecommand{\mathup}[1]{{\operatorfont #1}} +\providecommand{\mathup}[1]{{\operatorfont #1}} % exist also in kpfonts \@mmacro{e}{\mathup{e}} \AtBeginDocument{\let\oldi\i \let\oldj\j \renewcommand{\i}{\TextOrMath{\oldi}{\mathup{i}}} @@ -842,9 +852,9 @@ \AtBeginDocument{\DeclareMathSymbol{i}\mathalpha{operators}{`i}} } \newcommand{\jnumber}{ \AtBeginDocument{\DeclareMathSymbol{j}\mathalpha{operators}{`j}} } -\newcommand*{\pinumber}[1][Symbol]{ +\newcommand*{\pinumber}[1][Euler]{ \@ifpackageloaded{upgreek}{}{\usepackage[#1]{upgreek}} - \let\itpi\pi + \@ifundefined{itpi}{\let\itpi\pi}{\@mwarning{itpi}} \renewcommand{\pi}{\uppi} } \newboolean{arrowvect} @@ -1001,14 +1011,15 @@ % \end{macrocode} % \bigskip % \begin{thebibliography}{17} +% \begin{raggedright} % \bibitem{TYPMA} \emph{Typesetting mathematics for science and technology according % to ISO 31/XI}, Claudio Beccari, TUGboat Volume 18 (1997), No.~1. -% \bibitem{NIST} \emph{Typefaces for Symbols in Scientific Manuscripts}.\\ -% https://www.physics.nist.gov/cuu/pdf/typefaces.pdf. +% \bibitem{NIST} \emph{Typefaces for Symbols in Scientific Manuscripts}. +% \url{https://www.physics.nist.gov/cuu/pdf/typefaces.pdf}. % \bibitem{ICTNS} \emph{On the Use of Italic and up Fonts for Symbols in Scientific Text}, % I.M.~Mills and W.V.~Metanomski, ICTNS (Interdivisional Committee -% on Nomenclature and Symbols), dec 1999. -% \bibitem{ISO} \emph{ISO 80000-2}. https://en.wikipedia.org/wiki/ISO\_80000-2 +% on Terminology, Nomenclature and Symbols), dec 1999. +% \bibitem{ISO} \emph{ISO 80000-2}. \url{https://en.wikipedia.org/wiki/ISO\_80000-2}. % \bibitem{AMS} \emph{The \textsf{amsmath} package}. Frank Mittelbach, Rainer Schöpf, % Michael Downes, Davis M.~Jones, David Carlisle, CTAN, v2.17b 2018/12/01. % \bibitem{TOOL} \emph{The \textsf{mathtool} package}. Morten Høgholm, Lars Madsen, CTAN, @@ -1019,18 +1030,21 @@ % CTAN, v2.0 2003/02/12. % \bibitem{FIXM} \emph{The \textsf{fixmath} package for \LaTeXe}, Walter Schmidt, % CTAN, v0.9 2000/04/11. -% \bibitem{ISOM} \emph{\textsf{isomath}. Mathematical style for science and technology}. +% \bibitem{ISOM} \emph{\textsf{isomath} -- Mathematical style for science and technology}. % Günter Milde, CTAN, v0.6.1 2012/09/04. +% \bibitem{PMISO} \emph{PM-ISOmath, The Poor Man ISO math bundle}, +% \textsf{pm-isomath} package by Claudio Beccari, CTAN, v1.2.00 2021/08/04. % \bibitem{INT} \emph{The \textsf{interval} package}. Lars Madsen, CTAN, % v0.3 2014/08/04. % \bibitem{SYST} \emph{L'extension pour \TeX\ et \LaTeX\ \textsf{systeme}}. % Christian Tellechea, CTAN v0.32 2019/01/13. % \bibitem{SPAL} \emph{The \textsf{spalign} package}. Joseph Rabinoff, CTAN, 2016/10/05. -% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}. Antoine Missier, CTAN, v1.6 2022/10/16. +% \bibitem{FR} \emph{L'extension \textsf{frenchmath}}. Antoine Missier, CTAN, v2.0 2022/10/25. % \bibitem{LSHORT} \emph{The Not So Short Introduction to \LaTeXe}. \textsf{lshort} package by % Tobias Oetiker, Hubert Partl, Irene Hyna and Elisabeth Schlegl, CTAN, v6.2 2018/02/28. % \bibitem{COMP} \emph{The \LaTeX\ Companion}. Frank Mittelbach, Michel Goossens, % Johannes Braams, David Carlisle, Chris Rowley, 2nd edition, Pearson Education, 2004. +% \end{raggedright} % \end{thebibliography} % \Finale diff --git a/macros/latex/contrib/mismath/mismath.pdf b/macros/latex/contrib/mismath/mismath.pdf index 24612b9bd9..6159e38149 100644 Binary files a/macros/latex/contrib/mismath/mismath.pdf and b/macros/latex/contrib/mismath/mismath.pdf differ diff --git a/macros/luatex/generic/penlight/penlight.pdf b/macros/luatex/generic/penlight/penlight.pdf index 586bfa8dbf..d8a0ac2f15 100644 Binary files a/macros/luatex/generic/penlight/penlight.pdf and b/macros/luatex/generic/penlight/penlight.pdf differ diff --git a/macros/luatex/generic/penlight/penlight.sty b/macros/luatex/generic/penlight/penlight.sty index 5af886786e..8180a839ac 100644 --- a/macros/luatex/generic/penlight/penlight.sty +++ b/macros/luatex/generic/penlight/penlight.sty @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2022-10-22 +% 2022-10-24 % Copyright (C) 2021-2022 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,19 +22,19 @@ % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE % OR OTHER DEALINGS IN THE SOFTWARE. -\ProvidesPackage{penlight}[2022-10-22] +\ProvidesPackage{penlight}[2022-10-24] \RequirePackage{luacode} -\IfFileExists{luakeys.lua}{}{\PackageError{penlight}{This package requires that luakeys be installed}{help text}} +\IfFileExists{luakeys.lua}{}{\PackageError{penlight}{This package requires that luakeys be installed}{}} \DeclareOption{pl}{\luadirect{ - pl = require('penlight') + pl = require'penlight' __PENLIGHT__ = 'pl' }} \DeclareOption{penlight}{\luadirect{ - penlight = require('penlight') + penlight = require'penlight' __PENLIGHT__ = 'penlight' }} @@ -52,7 +52,7 @@ \luadirect{ if __PENLIGHT__ == nil then - tex.print('\\PackageError{penlight}{penlight or pl option must be passed to penlight as the first option}{}') + tex.sprint('\\PackageError{penlight}{"penlight" or "pl" option must be passed to penlight as the first option}{}') end } diff --git a/macros/luatex/generic/penlight/penlight.tex b/macros/luatex/generic/penlight/penlight.tex index f3ee02f2ec..dad50c7be2 100644 --- a/macros/luatex/generic/penlight/penlight.tex +++ b/macros/luatex/generic/penlight/penlight.tex @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2022-10-22 +% 2022-10-24 % Copyright (C) 2021-2022 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/macros/luatex/generic/penlight/penlightextras.lua b/macros/luatex/generic/penlight/penlightextras.lua index a6a5c1ff0a..7d0a7eb6b5 100644 --- a/macros/luatex/generic/penlight/penlightextras.lua +++ b/macros/luatex/generic/penlight/penlightextras.lua @@ -1,5 +1,5 @@ --% Kale Ewasiuk (kalekje@gmail.com) ---% 2022-10-22 +--% 2022-10-24 --% Copyright (C) 2021-2022 Kale Ewasiuk --% --% Permission is hereby granted, free of charge, to any person obtaining a copy @@ -775,10 +775,7 @@ end - - - -if _PL_GLOBALS__ then +if pl.hasval(__PL_GLOBALS__) then __PL_EXTRAS__ = 2 -- iterators kpairs = pl.utils.kpairs diff --git a/macros/luatex/latex/luaquotes/README b/macros/luatex/latex/luaquotes/README index 1fd076cfac..162a742f06 100644 --- a/macros/luatex/latex/luaquotes/README +++ b/macros/luatex/latex/luaquotes/README @@ -1,6 +1,6 @@ luaquotes - smart quotes with lua -version: 1.0.2 +version: 1.1.0 This package automatically creates smart quotes using lua filters and provides auxiliary commands for typesetting specific lua punctuation @@ -12,6 +12,7 @@ For suggestions, feature requests, and bug reports, please use the project's GitHub site: https://github.com/ezgranet/luaquotes Version history: +25/10/2022—support for elision 30/08/2022—resolving bug with language versions 28/08/2022—resolving bug with language versions 24/08/2022 —package creation diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf index 22014a7ade..f0d7e414d1 100644 Binary files a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf and b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf differ diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex index 739edba838..d5bf6ed5ef 100644 --- a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex +++ b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex @@ -50,7 +50,11 @@ Don\sqoneright t!\sqoneright% \end{tabular} \end{center} + \section{Smart quotes} + + + \subsection{Options} The default option, for English quotation marks, is called by: \begin{minted}[ @@ -77,6 +81,23 @@ breaklines, \usepackage[fr]{luaquotes} %French \usepackage[de]{luaquotes} % German \end{minted} +\subsubsection{English Features} +The English features are designed to smartly recognise English punctuation: +\begin{center} +\renewcommand{\arraystretch}{2} +\begin{tabular}{ccc} +\ttfamily Feature & User input & Output\\ + Double Quotes & \LARGE\texttt{"Salut!"}% +& +\LARGE "Hello"\\ +Single Quotes& \LARGE\texttt{'Hello!'}% +& \LARGE 'Hello' \\ +Contractions & \LARGE \texttt{Don't} & \LARGE Don't\\ +Elision & \LARGE\texttt{'ello} & \LARGE 'ello \\ + + +\end{tabular} +\end{center} \subsubsection{French option} The French option produces the following output, including the extra space around punctuation prescribed by French typography: @@ -255,9 +276,9 @@ breaklines, firstnumber=last ] {latex} -\def\luaquotesversionnumber{1.0.2} -\ProvidesPackage{luaquotes} - [2022/08/01\luaquotesversionnumber smart quotes with lua] +\def\luaquotesversionnumber{1.1} +\ProvidesPackage{dev-lua} + [2022/10/25\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -474,7 +495,39 @@ firstnumber=last ] {latex} } - + \luaexec{ + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} + + +function abbrevsingle ( s ) + return ( s:gsub ( " '(..-) " , " ’\%1 " ) ) + end + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + + } + + \luaexec{ \end{minted} \begin{minted}[ @@ -579,6 +632,74 @@ firstnumber=last ] {latex} }} +\newcommand\abbrevsingleon{\directlua{ + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} + + +luatexbase.add_to_callback ( + "process_input_buffer" , + abbrevsingle , + "abbrevsingle" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + + + }} +\newcommand\abbrevsingleoff{\directlua{ + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} + +luatexbase.remove_from_callback ( + "process_input_buffer" , + "abbrevsingle" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + + }} + + + \newcommand\singlequotelinestarton{\directlua{ \end{minted} \begin{minted}[ @@ -685,8 +806,11 @@ firstnumber=last \newcommand{\smartquotes}{% \doublequoteson% \singlequotelinestarton% +\abbrevsingleon% \singlequoteson} - \newcommand{\dumbquotes}{\doublequotesoff + \newcommand{\dumbquotes}{ + \doublequotesoff +\abbrevsingleoff \singlequotelinestartoff \singlequotesoff} \end{minted} @@ -1381,16 +1505,23 @@ firstnumber=last \end{minted} \section{Version History} -\subsection{\texttt{1.0.1}} + +\subsection{\normalfont\texttt{1.1.0}} +\ttfamily 25 October 2022: Added support for elision + + +\subsection{\normalfont\texttt{1.0.1}} + + \ttfamily 30 August 2022: Further corrections to bug preventing non-English usage -\subsection{\texttt{1.0.1}} +\subsection{\normalfont\texttt{1.0.1}} \ttfamily 28 August 2022: Change bug preventing non-English usage -\subsection{\texttt{1.0.0}} +\subsection{\normalfont\texttt{1.0.0}} \ttfamily 21 August 2022: Package creation diff --git a/macros/luatex/latex/luaquotes/luaquotes.sty b/macros/luatex/latex/luaquotes/luaquotes.sty index 15801e9ba2..87ef2eb7cd 100644 --- a/macros/luatex/latex/luaquotes/luaquotes.sty +++ b/macros/luatex/latex/luaquotes/luaquotes.sty @@ -1,6 +1,6 @@ -\def\luaquotesversionnumber{1.0.2} -\ProvidesPackage{luaquotes} - [2022/08/30\luaquotesversionnumber smart quotes with lua] +\def\luaquotesversionnumber{1.1} +\ProvidesPackage{dev-lua} + [2022/10/25\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -92,6 +92,13 @@ function doublequotes ( s ) return (s:gsub ("^'","‘" ) ) end} + + +\luaexec{ +function abbrevsingle ( s ) + return ( s:gsub ( " '(..-) " , " ’\%1 " ) ) + end} + \luaexec{function singlequotes ( s ) return ( s:gsub ( " '"," ‘" ) ) end} @@ -107,6 +114,14 @@ function doublequotes ( s ) \newcommand\doublequotesoff{\directlua{luatexbase.remove_from_callback ( "process_input_buffer" , "doublequotes" )}} +\newcommand\abbrevsingleon{\directlua{luatexbase.add_to_callback ( + "process_input_buffer" , + abbrevsingle , + "abbrevsingle" )}} +\newcommand\abbrevsingleoff{\directlua{luatexbase.remove_from_callback ( + "process_input_buffer" , + "abbrevsingle" )}} + \newcommand\singlequotelinestarton{\directlua{ luatexbase.add_to_callback ( "process_input_buffer" , singlequotelinestart , "singlequotelinestart" ) @@ -129,9 +144,11 @@ luatexbase.add_to_callback ( \newcommand{\smartquotes}{% \doublequoteson% \singlequotelinestarton% +\abbrevsingleon% \singlequoteson} \newcommand{\dumbquotes}{ \doublequotesoff +\abbrevsingleoff \singlequotelinestartoff \singlequotesoff} -- cgit v1.2.3