diff options
author | Norbert Preining <norbert@preining.info> | 2022-05-09 03:01:47 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-05-09 03:01:47 +0000 |
commit | fe29944c3d5256062708e9b1ae62dc378f9d9993 (patch) | |
tree | 2ff3c511d0cb27649150f24bcafec31af12d8faa /macros/latex | |
parent | ce1c001f7db86ff8f09c1203b965ed9f44531d7a (diff) |
CTAN sync 202205090301
Diffstat (limited to 'macros/latex')
39 files changed, 670 insertions, 1425 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf Binary files differindex 0b5b1c54dd..f9616191a3 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/demo/trigon_demo.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf Binary files differindex 44f97f0726..23b44851fb 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/docs/trigontheme.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx index e45237be4d..0674562c27 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamercolorthemetrigon.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamercolorthemetrigon}[2022/03/19 v0.6.4 Trigon color theme] +\ProvidesPackage{beamercolorthemetrigon}[2022/05/08 v0.6.5 Trigon color theme] %</package> % \fi % \CheckSum{0} diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx index d3c8c302d5..8329019f27 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerfontthemetrigon.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerfontthemetrigon}[2022/03/19 v0.6.4 Trigon font theme] +\ProvidesPackage{beamerfontthemetrigon}[2022/05/08 v0.6.5 Trigon font theme] %</package> % \fi % \CheckSum{0} diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx index a0adf0a1c4..c79cb5d522 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerinnerthemetrigon.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthemetrigon}[2022/03/19 v0.6.4 Trigon inner theme] +\ProvidesPackage{beamerinnerthemetrigon}[2022/05/08 v0.6.5 Trigon inner theme] %</package> % \fi % \CheckSum{0} @@ -181,6 +181,7 @@ % Defines a colored triangle with the base on the left side (pointing right). % \begin{macrocode} \newcommand{\leftColorTriangle}[3]{ + \clip(0,0) rectangle(\the\paperwidth,\the\paperheight); \path[fill=#3] \leftTriangle{#1}{#2} } @@ -191,6 +192,7 @@ % Defines a colored triangle with the base on the right side (pointing left). % \begin{macrocode} \newcommand{\rightColorTriangle}[3]{ + \clip(0,0) rectangle(\the\paperwidth,\the\paperheight); \path[fill=#3] \rightTriangle{#1}{#2} } @@ -201,6 +203,7 @@ % Defines a colored triangle with the base on the bottom side (pointing top). % \begin{macrocode} \newcommand{\topColorTriangle}[3]{ + \clip(0,0) rectangle(\the\paperwidth,\the\paperheight); \path[fill=#3] \topTriangle{#1}{#2} } @@ -281,6 +284,7 @@ \begin{tikzpicture} \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight); \begin{scope}[blend group=multiply] + \clip(0,0) rectangle(\the\paperwidth,\the\paperheight); \path[fill=tTheme]\leftTriangle{0.5\paperwidth}{0}; \topColorTriangle{0.73\paperwidth}{0.70\paperheight}{tGrey!30!tBg}; \ifx\inserttitlegraphic\@empty @@ -290,6 +294,7 @@ \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,\the\paperheight) {\inserttitlegraphic}; \fi \end{scope} + \clip(0,0) rectangle(\the\paperwidth,\the\paperheight); \path[fill=tBg]\rightTriangle{0.45\paperwidth}{\the\paperheight}; \ifx\logbig\@empty \else \node[anchor=north east,inner sep=0mm] at diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx index 29eaa37c40..c350cf9c63 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerouterthemetrigon.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerouterthemetrigon}[2022/03/19 v0.6.4 Trigon outer theme] +\ProvidesPackage{beamerouterthemetrigon}[2022/05/08 v0.6.5 Trigon outer theme] %</package> % \fi % \CheckSum{0} diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx index 71fd1a5978..26ba892133 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-trigon/source/beamerthemetrigon.dtx @@ -13,7 +13,7 @@ % \iffalse %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthemetrigon}[2022/03/19 v0.6.4 Trigon Beamer theme] +\ProvidesPackage{beamerthemetrigon}[2022/05/08 v0.6.5 Trigon Beamer theme] %</package> % \fi % \CheckSum{0} diff --git a/macros/latex/contrib/changebar/CATALOG b/macros/latex/contrib/changebar/CATALOG index 93611fa94a..a4ecdec11f 100644 --- a/macros/latex/contrib/changebar/CATALOG +++ b/macros/latex/contrib/changebar/CATALOG @@ -1,7 +1,7 @@ Name: ChangeBar -Problems-To: texniek(at)braams.xs4all.nl +Problems-To: johannes.braams(at)texniek.nl Author: J.L. Braams -Version: 3.6c +Version: 3.6d Description: @@ -15,6 +15,4 @@ See-Also: Address: TeXniek J.L. Braams -Kersengaarde 33 -2723 BP Zoetermeer The Netherlands diff --git a/macros/latex/contrib/changebar/README b/macros/latex/contrib/changebar/README index 1f51eec6e6..ffc63526e7 100644 --- a/macros/latex/contrib/changebar/README +++ b/macros/latex/contrib/changebar/README @@ -1,6 +1,6 @@ changebar bundle - March 08, 2018 + May 06, 2022 This bundle contains a package that I maintain to add changebars to a LaTeX document. @@ -14,7 +14,7 @@ be used to compare two versions of a document and automatically add the changebars. The file chbar.1, also contributed, documents the workings of chbar.sh -Copyright (C) 2018 Johannes L. Braams texniek(at)braams.xs4all.nl +Copyright (C) 2022 Johannes L. Braams johannes.braams(at)texniek.nl This program can be redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN diff --git a/macros/latex/contrib/changebar/cbtest1-ltx.pdf b/macros/latex/contrib/changebar/cbtest1-ltx.pdf Binary files differdeleted file mode 100644 index a146caad90..0000000000 --- a/macros/latex/contrib/changebar/cbtest1-ltx.pdf +++ /dev/null diff --git a/macros/latex/contrib/changebar/cbtest1-pdf.pdf b/macros/latex/contrib/changebar/cbtest1-pdf.pdf Binary files differdeleted file mode 100644 index fcdb761c73..0000000000 --- a/macros/latex/contrib/changebar/cbtest1-pdf.pdf +++ /dev/null diff --git a/macros/latex/contrib/changebar/cbtest1.tex b/macros/latex/contrib/changebar/cbtest1.tex deleted file mode 100644 index 040518bbd9..0000000000 --- a/macros/latex/contrib/changebar/cbtest1.tex +++ /dev/null @@ -1,322 +0,0 @@ -\documentclass[12pt,twoside]{article} -\usepackage{amsmath} -\usepackage[outerbars,color]{changebar} -\ifx\pdfoutput\undefined -\else\ifnum\pdfoutput>0 - \usepackage{pdfcolmk} -\fi\fi - -%\setcounter{changebargrey}{60} -\cbcolor{red} - -\usepackage{fancyhdr} - -%Header-footer instructions -\pagestyle{fancy} -\setlength{\headheight}{15pt} -\lhead{\scriptsize Changebar test file} -\chead{} -\rhead{v3.5} -\lfoot{Onecolumn text} -\cfoot{Page \thepage} -\rfoot{} -\renewcommand{\headrulewidth}{0.4pt} %print a rule below the header -\renewcommand{\footrulewidth}{0.4pt} %print a rule above the footer - -\setcounter{page}{16} -\setlength{\emergencystretch}{4em} - -\begin{document} - -%\tableofcontents - -\title{CHANGEBAR TEST FILE \\FOR ADVANCED FEATURES} -\author{Piet van Oostrum} -\maketitle - -\raggedbottom - -\begin {abstract} - -This file tests various advanced features of the changebar package. -\cbstart\textcolor{red}{\textbf{Text that should have a changebar is - printed in red, so that it can easily be checked that the changebars are - in the proper position.} This changebar should be on the left. -\cbend} - -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. -\end{abstract} - -\newpage - -This file tests various advanced features of the changebar package. -\cbstart\textcolor{red}{Text that should have a changebar (like this) is - printed in red, so that it can easily be checked that the changebars are - in the proper position.On this page, the changebar should be on the right. -\cbend} -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -\cbstart[3mm] \textcolor{red}{Here is a thicker changebar. Text that should - have a changebar (like this) is printed in red, so that it can easily be - checked that the changebars are in the proper position.On this page, the - changebar should be on the right. We also include a formula with large - descenders which should be completely covered by the changebar: - $\displaystyle \cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4+\cdots}}}$ - \cbend} - -\twocolumn -\lfoot{Twocolumn page} - -\section{Introduction} - -\cbstart -\color{red} -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. -\cbend -\color{black} - -\begin{figure} - \centering - \cbstart \color{red} - \fbox{ - \parbox{0.8\linewidth}{ - This is a figure. It has its - own changebar. This is a figure. This is a figure. It has its own - changebar. This is a figure. This is a figure. It has its own - changebar. This is a figure. This is a figure.\cbend}} - \color{black} - \caption{This is a test figure} -\end{figure} - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -\cbstart -\color{red} -Sections that have been added or modified are marked with a bar in -the margins. This is a small paragraph that crosses a column boundary. It -should have a changebar in both parts.\cbend -\color{black} - -\section{Continuation} -\cbstart -\color{red} - -\begin{figure} -\centering -\color{red} - \fbox{ - \parbox{0.8\linewidth}{ This is a figure. It inherits a changebar from - the environment. This is a figure. This is a figure. This is a - figure. This is a figure. It inherits a changebar from the - environment. This is a figure. This is a figure.}} -\caption{This is a test figure} -\color{black} -\end{figure} -\cbend -\color{black} - -\begin{figure}[p] -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. This is a figure. This is a figure. This is a figure. - This is a figure. This is a figure. This is a figure. This is a figure. - This is a figure. This is a figure. This is a figure. This is a figure. - This is a figure. This is a figure. This is a figure. This is a figure. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\cbstart \color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has its own changebar. This is a figure. It has - its own changebar. - This is a figure. It has its own changebar. This is a figure. It has - its own changebar. - This is a figure. It has its own changebar. This is a figure. It has - its own changebar. - }} \cbend\color{black} - \caption{Test figure} -\end{figure} - -\color{red} -\cbstart - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. - -\enlargethispage{1cm} -\subsection{Enlarged column} - -\noindent\parbox{\linewidth}{% -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -\\ -\textbf{This column is enlarged, therefore its extends in the footer. -The changebar should also cover the extended text.}} - -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -\section*{Specific issues} - -\addtocounter{page}{1} -\textbf{Here we change the page number (skipping one page). Therefore we - have two even pages in a row. The page change is in the righthand column - which is not proper LaTeX coding, but it should be handled properly.} -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. - - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. \cbend -\color{black} The last sentence of this part is outside the changebar. -\\[1ex] - -\color{red}\cbstart -\noindent\fbox{\parbox[t]{0.95\linewidth}{% -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -}}\cbend\color{black} -\\[2cm] -There should be a lonely figure with a changebar at the right. -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: diff --git a/macros/latex/contrib/changebar/cbtest1good.pdf b/macros/latex/contrib/changebar/cbtest1good.pdf Binary files differdeleted file mode 100644 index 1ebbe7300d..0000000000 --- a/macros/latex/contrib/changebar/cbtest1good.pdf +++ /dev/null diff --git a/macros/latex/contrib/changebar/cbtest1wrong.pdf b/macros/latex/contrib/changebar/cbtest1wrong.pdf Binary files differdeleted file mode 100644 index 2281a41da9..0000000000 --- a/macros/latex/contrib/changebar/cbtest1wrong.pdf +++ /dev/null diff --git a/macros/latex/contrib/changebar/cbtest2-ltx.pdf b/macros/latex/contrib/changebar/cbtest2-ltx.pdf Binary files differdeleted file mode 100644 index dbc4221f5c..0000000000 --- a/macros/latex/contrib/changebar/cbtest2-ltx.pdf +++ /dev/null diff --git a/macros/latex/contrib/changebar/cbtest2-pdf.pdf b/macros/latex/contrib/changebar/cbtest2-pdf.pdf Binary files differdeleted file mode 100644 index 769b847f2e..0000000000 --- a/macros/latex/contrib/changebar/cbtest2-pdf.pdf +++ /dev/null diff --git a/macros/latex/contrib/changebar/cbtest2.tex b/macros/latex/contrib/changebar/cbtest2.tex deleted file mode 100644 index 1f53624e4e..0000000000 --- a/macros/latex/contrib/changebar/cbtest2.tex +++ /dev/null @@ -1,322 +0,0 @@ -\documentclass[12pt,twoside]{article} -\usepackage{amsmath} -\usepackage[outerbars,xcolor]{changebar} -\ifx\pdfoutput\undefined -\else\ifnum\pdfoutput>0 - \usepackage{pdfcolmk} -\fi\fi - -%\setcounter{changebargrey}{60} -\cbcolor{red} - -\usepackage{fancyhdr} - -%Header-footer instructions -\pagestyle{fancy} -\setlength{\headheight}{15pt} -\lhead{\scriptsize Changebar test file} -\chead{} -\rhead{v3.5} -\lfoot{Onecolumn text} -\cfoot{Page \thepage} -\rfoot{} -\renewcommand{\headrulewidth}{0.4pt} %print a rule below the header -\renewcommand{\footrulewidth}{0.4pt} %print a rule above the footer - -\setcounter{page}{16} -\setlength{\emergencystretch}{4em} - -\begin{document} - -%\tableofcontents - -\title{CHANGEBAR TEST FILE \\FOR ADVANCED FEATURES} -\author{Piet van Oostrum} -\maketitle - -\raggedbottom - -\begin {abstract} - -This file tests various advanced features of the changebar package. -\cbstart\textcolor{red}{\textbf{Text that should have a changebar is - printed in red, so that it can easily be checked that the changebars are - in the proper position.} This changebar should be on the left. -\cbend} - -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. -\end{abstract} - -\newpage - -This file tests various advanced features of the changebar package. -\cbstart\textcolor{red}{Text that should have a changebar (like this) is - printed in red, so that it can easily be checked that the changebars are - in the proper position.On this page, the changebar should be on the right. -\cbend} -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -\cbstart[3mm] \textcolor{red}{Here is a thicker changebar. Text that should - have a changebar (like this) is printed in red, so that it can easily be - checked that the changebars are in the proper position.On this page, the - changebar should be on the right. We also include a formula with large - descenders which should be completely covered by the changebar: - $\displaystyle \cfrac{1}{2+\cfrac{1}{3+\cfrac{1}{4+\cdots}}}$ - \cbend} - -\twocolumn -\lfoot{Twocolumn page} - -\section{Introduction} - -\cbstart -\color{red} -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. -\cbend -\color{black} - -\begin{figure} - \centering - \cbstart \color{red} - \fbox{ - \parbox{0.8\linewidth}{ - This is a figure. It has its - own changebar. This is a figure. This is a figure. It has its own - changebar. This is a figure. This is a figure. It has its own - changebar. This is a figure. This is a figure.\cbend}} - \color{black} - \caption{This is a test figure} -\end{figure} - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. - -\cbstart -\color{red} -Sections that have been added or modified are marked with a bar in -the margins. This is a small paragraph that crosses a column boundary. It -should have a changebar in both parts.\cbend -\color{black} - -\section{Continuation} -\cbstart -\color{red} - -\begin{figure} -\centering -\color{red} - \fbox{ - \parbox{0.8\linewidth}{ This is a figure. It inherits a changebar from - the environment. This is a figure. This is a figure. This is a - figure. This is a figure. It inherits a changebar from the - environment. This is a figure. This is a figure.}} -\caption{This is a test figure} -\color{black} -\end{figure} -\cbend -\color{black} - -\begin{figure}[p] -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. This is a figure. This is a figure. This is a figure. - This is a figure. This is a figure. This is a figure. This is a figure. - This is a figure. This is a figure. This is a figure. This is a figure. - This is a figure. This is a figure. This is a figure. This is a figure. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\cbstart \color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has its own changebar. This is a figure. It has - its own changebar. - This is a figure. It has its own changebar. This is a figure. It has - its own changebar. - This is a figure. It has its own changebar. This is a figure. It has - its own changebar. - }} \cbend\color{black} - \caption{Test figure} -\end{figure} - -\color{red} -\cbstart - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. - -\enlargethispage{1cm} -\subsection{Enlarged column} - -\noindent\parbox{\linewidth}{% -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -\\ -\textbf{This column is enlarged, therefore its extends in the footer. -The changebar should also cover the extended text.}} - -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -\section*{Specific issues} - -\addtocounter{page}{1} -\textbf{Here we change the page number (skipping one page). Therefore we - have two even pages in a row. The page change is in the righthand column - which is not proper LaTeX coding, but it should be handled properly.} -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. - - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. - -This file tests various advanced features of the changebar package. -This file contains the following features which in combinations used to -give problems in versions of changebar before version 3.5: -Twoside document, onecolumn and towcolumn text, figures, columns of -figures, page changes in the midst of a document. -It should work both with latex, followed by a supported Postscript driver, -and with pdflatex. - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -\begin{figure}[p] -\color{red} -\centering \fbox{\parbox{.9\linewidth}{ - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - This is a figure. It has a changebar from the environment. This is a - figure. It has a changebar from the environment. - }} - \caption{Test figure} -\end{figure} - -This part contains a changebar that crosses several column and page -boundaries. Please note that it crosses several figures also but those have -their own changebars (or not), they do not fall inside the continuation -changebar. \cbend -\color{black} The last sentence of this part is outside the changebar. -\\[1ex] - -\color{red}\cbstart -\noindent\fbox{\parbox[t]{0.95\linewidth}{% -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -This is a parbox. It should have a changebar along its total height. -}}\cbend\color{black} -\\[2cm] -There should be a lonely figure with a changebar at the right. -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: diff --git a/macros/latex/contrib/changebar/changebar.bug b/macros/latex/contrib/changebar/changebar.bug index 2d239c93e6..bc04f1ca68 100644 --- a/macros/latex/contrib/changebar/changebar.bug +++ b/macros/latex/contrib/changebar/changebar.bug @@ -199,7 +199,10 @@ % % v3.6c JLB: changed the definition of \cb@checkPDF in order to prevent % an extra page at the end of the document, filled with "spsp" - +% +% v3.6d JLB: Added \relax at the end of \openin statements in order to +% prevent teX from looking too far ahead. +% % Known problems % - changebars for mmarginal paragraphs collide with changebars % for the main body of text diff --git a/macros/latex/contrib/changebar/changebar.dtx b/macros/latex/contrib/changebar/changebar.dtx index e146293a0c..b07d80083f 100644 --- a/macros/latex/contrib/changebar/changebar.dtx +++ b/macros/latex/contrib/changebar/changebar.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% Copyright 1994-2018 (C) Johannes Braams. All rights reserved. +%% Copyright 1994-2022 (C) Johannes Braams. All rights reserved. % % This file is part of the changebar package. % ------------------------------------------- @@ -24,7 +24,7 @@ % and covered by LPPL is defined by the unpacking scripts (with % extension .ins) which are part of the distribution. % \fi -% \CheckSum{2591} +% \CheckSum{2594} % %\iffalse % This file is built for \LaTeXe, so we make sure an error is @@ -39,7 +39,7 @@ \ProvidesFile{changebar.dtx} %</dtx> %<+package>\ProvidesPackage{changebar} - [2018/03/09 v3.6c Indicate changes with marginal bars] + [2022-05-06 v3.6d Indicate changes with marginal bars] % \end{macrocode} % % \section{A driver for this document} @@ -2997,6 +2997,7 @@ % Compute the left and right positions of the changebars. % \changes{v3.4g}{2004/01/09}{Added tracing information for the left % and right postions} +% \changes{v3.6d}{2022-05-06}{Added \cs{relax} to end the filename} % \begin{macrocode} \cb@positions \cb@trace{% @@ -3006,7 +3007,7 @@ Even right: \the\cb@even@right }% \immediate\closeout\cb@write - \immediate\openin\cb@read=\jobname.cb} + \immediate\openin\cb@read=\jobname.cb\relax} % \end{macrocode} % \end{macro} % @@ -3021,13 +3022,13 @@ % checking. % \changes{3.2}{1994/04/21}{Use \cs{AtEndDocument} now instead of % redefining \cs{enddocument}} -% +% \changes{v3.6d}{2022-05-06}{Added \cs{relax} to end the filename} % \begin{macrocode} \AtEndDocument{% \clearpage \cb@initstack\cb@historystack \immediate\closein\cb@read - \immediate\openin\cb@read=\jobname.cb% + \immediate\openin\cb@read=\jobname.cb\relax % \end{macrocode} % % \changes{v3.5a}{2005/05/23}{For pdftex we also close and reread the @@ -3037,7 +3038,7 @@ \ifx\cb@readxy\@undefined \else \immediate\closein\cb@readxy - \immediate\openin\cb@readxy=\jobname.cb2% + \immediate\openin\cb@readxy=\jobname.cb2\relax \def\cb@pdfpoints{}% \def\cb@pdfpagenr{0}% \fi diff --git a/macros/latex/contrib/changebar/changebar.ins b/macros/latex/contrib/changebar/changebar.ins index 8b5a9684f6..21a5332223 100644 --- a/macros/latex/contrib/changebar/changebar.ins +++ b/macros/latex/contrib/changebar/changebar.ins @@ -24,7 +24,7 @@ \preamble This is a generated file. -Copyright (C) 1994-2018 Johannes Braams, All rights reserved. +Copyright (C) 1994-2022 Johannes Braams, All rights reserved. This file was generated from file(s) of the changebar package. -------------------------------------------------------------- diff --git a/macros/latex/contrib/changebar/changebar.pdf b/macros/latex/contrib/changebar/changebar.pdf Binary files differindex 31ddeb649c..bbe1281088 100644 --- a/macros/latex/contrib/changebar/changebar.pdf +++ b/macros/latex/contrib/changebar/changebar.pdf diff --git a/macros/latex/contrib/changebar/chbar.1 b/macros/latex/contrib/changebar/chbar.1 deleted file mode 100644 index f36e68e2bb..0000000000 --- a/macros/latex/contrib/changebar/chbar.1 +++ /dev/null @@ -1,117 +0,0 @@ -.ds AL L\\v'.3m'A\\v'-.3m'\\*(ET -.TH CHBAR 1 TeX -.SH NAME -chbar \- write \*(AL file with `change bars' showing change between input \*(AL files -.SH SYNOPSIS -.B chbar -[ -.B \-h -] [ -.B \-g -] [ -.B \-G -] [ -.BI \-d " dir" -] [ -.BI \-r " rev" -] -.I old new -[ -.I output -] -.sp -.B chbar -[ -.B \-h -] [ -.B \-g -] [ -.B \-G -] [ -.BI \-d " dir" -] [ -.BI \-r " rev" -] -.I old -.sp -.B chbar -[ -.B \-h -] [ -.B \-g -] [ -.B \-G -] -.BI \-d " dir" -.BI \-r " rev" -.I files -.SH DESCRIPTION -.I chbar -takes two \*(AL files and produce a third which -has change bars highlighting the difference between them. There -are three basic modes of operation: first, pathnames can -be given for -.I old -and -.IR new ; -second, if only -.I old -is named, the -.I new -file is taken from standard input and the output is written to standard -output; thirdly, if the -.B \-r -option is used -.I files -held by RCS must be named - (see the explanation of the -.B \-r -option). -.sp -Change bars are inserted for differences after '\ebegin{document}'. -.SH OPTIONS -.TP -.BI \-d " dir" -Write the output to file -.IR dir/new , -if -.I new -is given or to file -.IR dir/old . -If -.I dir -does not exist, it is created. -If -.I output -is given, it is discarded. -.TP -.BI \-r " rev" -If the \*(AL -.I files -are kept under control of the Revision Control System RCS, the old files of -the revision -.I rev -can be retrieved. -.I rev -is specified using the RCS conventions. -This option must be used together with the -.BI \-d " dir" -option. -.I files -must be a nonempty list of files. -.TP -.B \-h -Print a help text. -.TP -.B \-g -Print some debugging info. -.TP -.B \-G -Even more debug info. -.SH SEE ALSO -.IR diff (1), -.IR rcs (1) -.SH BUGS -The -.I new -file can not be named `-'. - diff --git a/macros/latex/contrib/changebar/chbar.sh b/macros/latex/contrib/changebar/chbar.sh deleted file mode 100755 index 232b1fcc37..0000000000 --- a/macros/latex/contrib/changebar/chbar.sh +++ /dev/null @@ -1,240 +0,0 @@ -#!/bin/sh -# Gadget to take two LaTeX files and produce a third which -# has changebars highlighting the difference between them. -# -# Version 1.2 -# Author: -# Don Ward, Careful Computing (don@careful.co.uk) -# v1.0 April 1989 -# v1.1 Feb 93 Amended to use changebar.sty (v3.0) and dvips -# v1.2 Aug 95 Added support for LaTeX209/LaTeX2e -# Added RCS support to retrive old files - -CMD=`basename $0` - -SED=sed -RM="rm -f" -DIFF=diff -ED=ed -AWK=awk -GREP=grep -MV=mv -CAT=cat -MKDIR=mkdir -CO="co" - -TMPFILE=/tmp/$CMD.$$ -SED_CMD_FILE=$TMPFILE.sed - -usage() -{ -$CAT << _END_ -Usage: - $CMD [-hgG] [-d dir] old new [output] - default output is stdout - - $CMD [-hgG] [-d dir] old - new file on stdin, output on stdout - - $CMD [-hgG] -d dir -r rev files - old file retrieved using RCS - - Gadget to take two LaTeX files and produce a third which - has changebars highlighting the difference between them. - Changebars are inserted for differences after '\begin{document}'. - - Feature: \`new' can not be named \`-'. - - Options are: - -d dir : Write the output to file \`dir/new', if \`new' is given or - to file \`dir/old'. - If \`dir' does not exist, it is created. - If \`output' is given, it is discarded. - - -r rev : If the LaTeX \`files' are kept under control of the - Revision Control System RCS, the old files of - the revision \`rev' can be retrived. - \`rev' is specified using the RCS conventions. - This option must be used together with the \`-d dir' option. - \`files' must be a nonempty list of files. - - -h : Print this info text. - -g : Print some debugging info. - -G : Even more debug info. - - Version 1.2: August 3. 1995 -_END_ -exit 1 -} - -# parse options and arguments -DEBUG="NO" -DIR= -REV= -# process options -while getopts d:r:gGh i $* -do - case $i in - d ) DIR=$OPTARG;; - r ) REV=$OPTARG;; - g ) DEBUG="YES" ;; - G ) set -x; DEBUG="YES";; - h | \ - * ) usage ;; - esac -done - -shift `expr $OPTIND - 1` - -case $# in - 1 ) OLD=$1; NEW="-"; OUT="" ;; - 2 ) OLD=$1; NEW=$2; OUT="" ;; - 3 ) OLD=$1; NEW=$2; OUT="$3" ;; - * ) usage ;; -esac - -# check correct options -if [ ! -z "$DIR" ] -then - [ -d $DIR ] || $MKDIR $DIR -fi - -if [ ! -z "$REV" ] -then - [ -z "$DIR" ] && usage - FILES=$* -else - FILES=$NEW -fi - -# do the work -for NEW in $FILES -do - if [ ! -z "$DIR" ] - then - if [ $NEW = "-" ] - then - OUT=$DIR/$OLD - else - OUT=$DIR/$NEW - fi - fi - if [ ! -z "$REV" ] - then - OLD=${TMPFILE}.old - $CO -p"$REV" -q $NEW > $OLD - fi - - [ $DEBUG = "YES" ] && echo "OLD=\`$OLD' NEW=\`$NEW' OUT=\`$OUT'" - - # gather some info about the file - # Since we have for sure only the name of the OLD file, ... - $GREP "^\\\\begin{document}" $OLD > /dev/null - if [ $? -eq 0 ] - then - [ $DEBUG = "YES" ] && echo "contains a \\begin{document}" - HAS_BEGIN_DOC="YES" - else - [ $DEBUG = "YES" ] && echo "contains no \\begin{document}" - HAS_BEGIN_DOC="NO" - fi - - # Method to do the work: - # 1 Use diff to get an ed script to go from file1 to file2. - # 2 Breath on it a bit (with sed) to insert changebar commands. - # 3 Apply modified ed script to produce (nearly) the output. - # 4 Use awk to insert the changebars option into the \documentstyle - # and to handle changebar commands inside verbatim environments. - # 5 Remove changebars before \begin{document} with sed - - # SED commands to edit ED commands to edit old file - $CAT > $SED_CMD_FILE <<\_END_ -/^\.$/i\ -\\cbend{}% -/^[0-9][0-9]*[ac]$/a\ -\\cbstart{}% -/^[0-9][0-9]*,[0-9][0-9]*[ac]$/a\ -\\cbstart{}% -/^[0-9][0-9]*d$/a\ -i\ -\\cbdelete{}%\ -. -/^[0-9][0-9]*,[0-9][0-9]*d$/a\ -i\ -\\cbdelete{}%\ -. -_END_ - - # note DIFF accepts `-' as stdin - $DIFF -b -e $OLD $NEW | \ - ( $SED -f $SED_CMD_FILE ; echo w ${TMPFILE}.1 ; echo q ) | \ - $ED - $OLD - - # AWK commands to insert Changebars style and to protect - # changebar commands in verbatim environments - # and to tell what driver is in use; we assume the `dvips' driver - - $AWK ' - BEGIN {kind=""; # we saw now \documentXXX[]{} - } - /^\\documentstyle/{ - kind = "209"; - if (index($0, "changebar") == 0 ) { - opts = index($0, "[") - if (opts > 0) - printf "%schangebar,%s\n",substr($0,1,opts),substr($0,opts+1) - else - printf "\\documentstyle[changebar]%s\n", substr($0,15) - next - } - } - /^\\documentclass/{ - kind = "2e"; - printf "%s\n", $0 - printf "\\usepackage[dvips]{changebar}\n" - next - } - /\\begin{document}/ {if (kind == "209" ) {print "\\driver{dvips}"}} - /\\begin{verbatim}/{++nesting} - /\\end{verbatim}/{--nesting} - /\\cbstart{}%|\\cbend{}%|\cbdelete{}%/ { - if ( nesting > 0) { - # changebar command in a verbatim environment: Temporarily exit, - # do the changebar command and reenter. - # - # The obvious ( printf "\\end{verbatim}%s\\begin{verbatim} , $0 ) - # leaves too much vertical space around the changed line(s). - # The following magic seeems to work - # - print "\\end{verbatim}\\nointerlineskip" - print "\\vskip -\\ht\\strutbox\\vskip -\\ht\\strutbox" - printf "\\vbox to 0pt{\\vskip \\ht\\strutbox%s\\vss}\n", $0 - print "\\begin{verbatim}" - next - } - } - { print $0 } - ' ${TMPFILE}.1 > ${TMPFILE}.2 - - # if a \begin{document} is contained in the file, - # remove the changebar commands before them - - if [ $HAS_BEGIN_DOC = "YES" ] - then - SED_CMD="1,/\\\\begin{document}/s/\(\\\\cb[sed][tne][adl][^{}]*{}%\)$/%%\1/" - $SED "$SED_CMD" ${TMPFILE}.2 > ${TMPFILE}.3 - else - $CAT ${TMPFILE}.2 > ${TMPFILE}.3 - fi - if [ -z "$OUT" ] - then - $CAT ${TMPFILE}.3 - else - $MV ${TMPFILE}.3 $OUT - fi - -done - -[ $DEBUG = "NO" ] && $RM ${TMPFILE}.* - -############################################################### diff --git a/macros/latex/contrib/hvextern/Changes b/macros/latex/contrib/hvextern/Changes index 512bf9c194..0204c888fb 100644 --- a/macros/latex/contrib/hvextern/Changes +++ b/macros/latex/contrib/hvextern/Changes @@ -1,5 +1,7 @@ hvextern.sty ---------------- +v 0.23 2022-05-08 - added \runExtCmd + - added doctype shell v 0.22 2022-05-05 - added mpvalign, tclbox v 0.21 2022-04-30 - added java support v 0.20 2022-04-27 - use L3 for the comma separated lists diff --git a/macros/latex/contrib/hvextern/doc/hvdoctools.sty b/macros/latex/contrib/hvextern/doc/hvdoctools.sty index 04cdd46724..23ff524a9a 100644 --- a/macros/latex/contrib/hvextern/doc/hvdoctools.sty +++ b/macros/latex/contrib/hvextern/doc/hvdoctools.sty @@ -24,13 +24,17 @@ \def\Lprog#1{\texttt{#1}\index{#1@\texttt{#1} (program)}} \def\Lcolor#1{\texttt{#1}\index{#1@\texttt{#1} (color)}} \def\Loption#1{\texttt{#1}\index{#1@\texttt{#1} (package option)}} -\def\Lkeyword#1{\texttt{#1}\index{#1@\texttt{#1} (keyword)}} +\def\Lkeyword#1{\texttt{#1}\index{#1@\texttt{#1} (keyword)}\index{Keyword!#1@\texttt{#1}}} \def\Lkeyval#1{\texttt{#1}\index{#1@\texttt{#1} (value)}} \def\Lskip#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1} (skip)}} \def\Lkeyset#1{\expandafter\Lkeyset@i#1\@nil} \def\Lkeyset@i#1=#2\@nil{\texttt{#1=#2}% \index{#1@\texttt{#1} (keyword)}\index{Keyword!#1@\texttt{#1}} \index{#2@\texttt{#2} (value)}\index{Value!#2@\texttt{#2}}} + +\def\LKeyset#1{\expandafter\LKeyset@i#1\@nil} +\def\LKeyset@i#1=#2\@nil{\texttt{#1=#2}% + \index{#1@\texttt{#1} (keyword)}\index{Keyword!#1@\texttt{#1}}} \newsavebox\boxdef \newenvironment{BDef} {\begin{lrbox}{\boxdef} @@ -40,6 +44,7 @@ {\BCmd\fbox{\usebox\boxdef}\endBCmd} \aftergroup\@afterindentfalse\aftergroup\@afterheading } +\def\Lclass#1{\texttt{#1}\index{#1@\texttt{#1} (doc class)}} \newskip\BDefaboveskip \newskip\BDefbelowskip diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf Binary files differindex 2817fa93b8..c521b487ea 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.pdf +++ b/macros/latex/contrib/hvextern/doc/hvextern.pdf diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex index c26ac017a0..8c104803e6 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.tex +++ b/macros/latex/contrib/hvextern/doc/hvextern.tex @@ -30,7 +30,7 @@ from within a main \LaTeX\ document~--v. \hvexternFileversion} \newpage -\setkeys{hv}{moveToExampleDir,ExampleDir=Examples,showFilename} +\setkeys{hv}{moveToExampleDir,ExampleDir=Examples,showFilename,verbose} \section{Syntax} \begin{verbatim} @@ -44,7 +44,7 @@ it into the main \LaTeX\ document. \end{sloppypar} -There is only one environment: +There is only one environment and one command: \begin{verbatim} \begin{externalDocument}[<options>]{<external filename without extension>} @@ -52,6 +52,8 @@ There is only one environment: source code ... \end{externalDocument} + +\runExtCmd[<options>]{<command with arguments>}{<external filename without extension>} \end{verbatim} The main document \emph{must} be run with the \Loption{-shell-escape} option, otherwise it won't work, e.g.: @@ -71,7 +73,7 @@ automatically in the main document.. \noindent \fbox{\begin{minipage}{\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax} \emph{All} examples in this document are created on-the-fly while running this \LaTeX\ document -with \texttt{lualatex} with the \texttt{-\kern2pt-shell-escape} option. +with \texttt{lualatex} with the \texttt{-\kern1pt-shell-escape} option. \end{minipage}} @@ -114,7 +116,7 @@ shown by the environment \Lenv{externalDocument}. \end{minipage} \begin{minipage}{.39\linewidth} \begin{externalDocument}[ - compiler=pdflatex,force,cleanup={log,aux},verbose]{voss} + compiler=pdflatex,force=false,cleanup={log,aux},verbose]{voss} \documentclass{standalone} %StartVisiblePreamble \usepackage{fontenc} @@ -172,7 +174,7 @@ catagory, which is done internally by the package. The complete definition of th showFilename, code, ext=py, - force, + force=false, docType=py, usefancyvrb, grfOptions={width=\linewidth}]{python} @@ -222,7 +224,7 @@ line in the above code shows how it can be done with Python. \begin{externalDocument}[ compiler=python3, progpath=/usr/local/bin/, - force, + force=false, showFilename, runs=1, code, @@ -271,7 +273,7 @@ image.save(imageName+".png", "PNG") \begin{externalDocument}[grfOptions={width=0.95\linewidth}, compiler=xelatex,code,mpwidth=0.6\linewidth, - crop,cleanup,force,usefancyvrb=false,ext=tex]{voss} + crop,cleanup,force=false,usefancyvrb=false,ext=tex]{voss} \documentclass{article} %StartVisiblePreamble \usepackage{tikz} @@ -354,7 +356,7 @@ ext=lua, compiler=lua, docType=lua, ... The default setting is always shown in brackets. \subsection{Programs and runs} -The \texttt{progpath} should only in some +The \Lkeyword{progpath} should only in some rare cases needed. In general all used compilers will be found by the system. A given \Lkeyword{progpath} must be end with a slash, e.g. \Lkeyval{./bin/} @@ -366,9 +368,9 @@ must be end with a slash, e.g. \Lkeyval{./bin/} \end{verbatim} Instead of the optional arguments - \\Lkeyword{compiler}, \\Lkeyword{biber}, and \\Lkeyword{xindex} one can define an individual + \Lkeyword{compiler}, \Lkeyword{biber}, and \Lkeyword{xindex} one can define an individual command sequence by using the optional argument - \\Lkeyword{runsequence}. It must be comma separated list: + \Lkeyword{runsequence}. It must be comma separated list: \begin{verbatim} runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex} @@ -381,7 +383,7 @@ runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex} runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}, showFilename, verbose, - force, + force=false, cleanup={log,aux,toc,bbl,blg}, code,docType=latex, lstOptions={columns=fixed}]{voss} @@ -420,7 +422,7 @@ the environment \Lenv{externalDocument} is: \begin{externalDocument}[ verbose, compiler=java,ext=java,code, - force,docType=java,includegraphic, + force=false,docType=java,includegraphic, usefancyvrb,grfOptions={width=0.9\linewidth}]{java} import java.awt.Color; import java.awt.Graphics; @@ -484,7 +486,7 @@ public class Main { \end{externalDocument} - +%$ \subsection{Grafik options} @@ -545,7 +547,7 @@ to \Lcs{VerbatimInput}. The following example uses mpwidth=0.6\linewidth, crop, cleanup, - force, + force=false, docType=latex]{voss} \RequirePackage{pdfmanagement-testphase} \DeclareDocumentMetadata{} @@ -571,7 +573,7 @@ There are different colors for the preamble and body listing: the backgrund and \define@key{hv}{BObody}[black8]{\def\hv@extern@BObody{#1}} \end{verbatim} -The options are passed to \Lpack{tcolorbox} and preset to \Lcolor{black12} and \Lcolor{black!8}. +The options are passed to \Lpack{tcolorbox} and preset to \Lcolor{black"!12} and \Lcolor{black"!8}. The color of the frame is set to the same values, hence not seen. The following example uses \begin{verbatim} @@ -591,7 +593,7 @@ The color of the frame is set to the same values, hence not seen. The following mpwidth=0.6\linewidth, crop, cleanup, - force, + force=false, usefancyvrb, docType=latex]{voss} \RequirePackage{pdfmanagement-testphase} @@ -668,7 +670,7 @@ The image Figure~\ref{img:cox} shows an example for a floting object. % mpwidth=0.6\linewidth, crop, cleanup, - force, + force=false, usefancyvrb, float, caption={An example for Coxeter images}, @@ -730,7 +732,7 @@ The following example uses: % mpwidth=0.6\linewidth, % crop, cleanup, - force, + force=false, frame, % usefancyvrb, % float, @@ -756,7 +758,7 @@ The following example uses: \subsection{Cropping the PDF} -Instead of using the \Index{documentclass} \Lcs{standalone}, which already crops the created PDF, +Instead of using the \Index{documentclass} \Lclass{standalone}, which already crops the created PDF, one can use the optional argument \Lkeyword{crop}. \begin{verbatim} @@ -789,7 +791,7 @@ The follwoing example was created with % mpwidth=0.6\linewidth, crop, cropmargin=5, cleanup, - force, + force=false, frame, % usefancyvrb, % float, @@ -849,7 +851,7 @@ or \Lkeyval{b}. code, crop, cleanup, - force, + force=false, docType=latex]{voss} \documentclass{article} \pagestyle{empty} @@ -872,7 +874,7 @@ or \Lkeyval{b}. code, crop, cleanup, - force, + force=false, docType=latex]{voss} \documentclass{article} \pagestyle{empty} @@ -896,7 +898,7 @@ or \Lkeyval{b}. code, crop, cleanup, - force, + force=false, docType=latex]{voss} \documentclass{article} \pagestyle{empty} @@ -920,7 +922,7 @@ or \Lkeyval{b}. code, crop, cleanup, - force, + force=false, mpwidth=0.5\linewidth, docType=latex]{voss} \documentclass{article} @@ -944,7 +946,7 @@ or \Lkeyval{b}. code, crop, cleanup, - force, + force=false, mpwidth=0.5\linewidth, docType=latex]{voss} \documentclass{article} @@ -969,7 +971,7 @@ or \Lkeyval{b}. code, crop, cleanup, - force, + force=false, mpwidth=0.5\linewidth, docType=latex]{voss} \documentclass{article} @@ -981,18 +983,18 @@ or \Lkeyval{b}. \subsection{Inline images} By default code and image are own paragraphs. With the optional argument \Lkeyword{inline} the created -image can be part of the current line. This may make sense, if you need characters which are +image can be part of the \Index{current line}. This may make sense, if you need characters which are not part of your current font. \begin{verbatim} \define@boolkey{hv}[hv@extern@]{inline}[true]{\hv@extern@codefalse} \end{verbatim} -With \texttt{inline=true} the optional argument \texttt{code} is automatically set to false. The +With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code} is automatically set to false. The next Chinese characters \begin{externalDocument}[ compiler=xelatex, inline, runs=2, grfOptions={height=8pt}, - crop, cropmargin=0, cleanup, force, docType=latex]{voss}% + crop, cropmargin=0, cleanup, force=false, docType=latex]{voss}% \documentclass{ctexart} \pagestyle{empty} \begin{document} @@ -1008,7 +1010,7 @@ With \Lkeyset{inline} the optional argument \Lkeyword{code} is automatically set next Chinese characters \begin{externalDocument}[ compiler=xelatex, inline, runs=2, grfOptions={height=8pt}, - crop, cropmargin=0, cleanup, force, docType=latex]{voss} + crop, cropmargin=0, cleanup, force=false, docType=latex]{voss} \documentclass{ctexart} \pagestyle{empty} \begin{document} @@ -1020,9 +1022,9 @@ are inserted as inline image without showing the code. The complete code looks l \subsection{Input text instead of an image} -By default the created pdf which can be, of course, only test, wil be insert by \verb|\incudegraphics|. -If you have only text as output and dont want to create a pdf you can insert this kind of -output as verbatim text by setting \verb|includegraphic=false|. +By default the created pdf which can be, of course, only text, will be inserted by \Lcs{includegraphics}. +If you have only text as output and don't want to create a pdf you can insert this kind of +output as verbatim text by setting \Lkeyset{includegraphic=false}. \begin{verbatim} \define@boolkey{hv}[hv@extern@]{includegraphic}[true]{} @@ -1046,7 +1048,7 @@ sorted digits of the number $A$: $495=954-459$. \begin{externalDocument}[ - compiler=perl, force, docType=pl, ext=pl, includegraphic=false, + compiler=perl, force=false, docType=pl, ext=pl, includegraphic=false, code, mpwidth=0.6\linewidth]{voss} #!/usr/bin/perl # @@ -1101,7 +1103,7 @@ outFile = io.open(shortFN..".txt","w+") -- open external file \begin{externalDocument}[ - compiler=lua, force, docType=lua, ext=lua, includegraphic=false, code, usefancyvrb=false]{voss} + compiler=lua, force=false, docType=lua, ext=lua, includegraphic=false, code, usefancyvrb=false]{voss} #!/usr/bin/env lua local filename = arg[0] local shortFN = filename:match("(.+)%..+") @@ -1140,7 +1142,7 @@ outFile:close() \subsection{Running additional external programs} -For a \LaTeX\ additional programs for bibliography, index, a.s.o. maybe needed. +For a \LaTeX\ additional programs for \Index{bibliography}, \Index{index}, a.s.o. maybe needed. \begin{verbatim} \define@boolkey{hv}[hv@extern@]{biber}[true]{} @@ -1174,7 +1176,7 @@ The following examples uses pages=2, crop, cleanup, - force, + force=false, xindex, xindexOptions={-l DE --config AU}, mpwidth=0.6\linewidth, @@ -1230,7 +1232,7 @@ runsequence={lualatex,biber,{xindex -l de -c AU},lualatex,lualatex} runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}, showFilename, verbose, - force, + force=false, cleanup={log,aux,toc,bbl,blg}, code,docType=latex, lstOptions={columns=fixed}]{voss} @@ -1264,7 +1266,7 @@ Sort with xindex \verb|-l DE --config AU| \subsection{Using \texttt{listings}} -The default is using \verb|\lstinputlisting| for the printed code sequences. +The default is using \Lcs{lstinputlisting} for the printed code sequences. \begin{externalDocument}[ grfOptions={width=0.45\linewidth}, @@ -1272,7 +1274,7 @@ The default is using \verb|\lstinputlisting| for the printed code sequences. frame,compiler=pdflatex, showFilename, % crop, - force,runs=2,code,docType=latex, + force=false,runs=2,code,docType=latex, frame, lstOptions={columns=fixed}]{voss} %StartVisiblePreamble @@ -1322,7 +1324,7 @@ The default is using \verb|\lstinputlisting| for the printed code sequences. -It also possible to use \verb|\VerbatimInput| from package \texttt{fancyvrb}. In general +It also possible to use \Lcs{VerbatimInput} from package \Lpack{fancyvrb}. In general it makes no difference using the optional argument \Lkeyword{usefancyvrb} or not. @@ -1332,7 +1334,7 @@ it makes no difference using the optional argument \Lkeyword{usefancyvrb} or not frame,compiler=pdflatex, showFilename, % crop, - force,runs=2,code,docType=latex, + force=false,runs=2,code,docType=latex, frame,usefancyvrb]{voss} %StartVisiblePreamble \documentclass[chapterprefix=on,parskip=half-,DIV=12,fontsize=12pt]{scrbook} @@ -1392,7 +1394,7 @@ it makes no difference using the optional argument \Lkeyword{usefancyvrb} or not compiler=mpost, showFilename, % crop, - force, + force=false, cleanup, code, docType=mp, @@ -1424,7 +1426,7 @@ end; compiler=tex, showFilename, % crop, - force, + force=false, code, docType=tex, ext=tex,]{voss} @@ -1488,7 +1490,7 @@ This is the start of the introduction. compiler=lualatex, showFilename, crop, - force, + force=false, code, docType=latex, ext=tex,]{voss} @@ -1528,7 +1530,7 @@ This is the start of the introduction. compiler=context, showFilename, runs=2, - force, + force=false, code, docType=context, ext=tex,]{voss} @@ -1569,18 +1571,32 @@ foo \end{externalDocument} +\section{Running external commands} +Integrating the current directory of this document we can use the macro \Lcs{runExtCmd} with +the optional argument \Lkeyword{redirect} + +\begin{verbatim} +\runExtCmd[redirect]{ls -la}{voss} +\end{verbatim} + +to get the directory listed: + +\medskip +\runExtCmd[redirect,verbose]{ls -la}{voss} + + \section{Other options} \begin{description} -\item[\texttt{force=false}] can speed up the comiling time for the document. If a created image/output +\item[\Lkeyset{force=false}] can speed up the comiling time for the document. If a created image/output already exists, there is no need to create it with the next run again and again. -\item[\texttt{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{.aux}, \texttt{.log}. +\item[\Lkeyword{cleanup}] the auxiliary files of a \LaTeX-run are deleted, preset to \texttt{aux}, \texttt{log}. It must be a comma seperated list of the extensions of the main file, s.g. \texttt{cleanup=\{aux,log\}}. -\item[\texttt{copyToExampleDir}] name of a directory for the examples, must first be created by the user himself -\item[\texttt{ExamplesDir}] move all examples into a directory -\item[\texttt{tclbox=false}] Can be used if there are some negative interactions between package \texttt{listing} - and package \texttt{tcolorbox}. -\item[\texttt{eps}] create an eps from the pdf (historical) +\item[\Lkeyword{copyToExampleDir}] name of a directory for the examples, must first be created by the user himself +\item[\Lkeyword{ExamplesDir}] move all examples into a directory +\item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings} + and package \Lpack{tcolorbox}. +\item[\Lkeyword{eps}] create an eps from the pdf (historical). \end{description} diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty index f728f941ae..5179123aa2 100644 --- a/macros/latex/contrib/hvextern/latex/hvextern.sty +++ b/macros/latex/contrib/hvextern/latex/hvextern.sty @@ -11,8 +11,8 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\def\hvexternFileversion{0.22} -\ProvidesFile{hvextern}[2022/05/05 v\hvexternFileversion: package for running external documents (HV)] +\def\hvexternFileversion{0.23} +\ProvidesFile{hvextern}[2022/05/08 v\hvexternFileversion: package for running external documents (HV)] \RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform} \RequirePackage{tcolorbox,xparse} @@ -81,7 +81,7 @@ %\define@key{hv}{compiler}[pdflatex]{\def\hv@extern@compiler{#1}} \define@choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,% - xetex,pdflatex,lualatex,xelatex,context}[pdflatex]{% + xetex,pdflatex,lualatex,xelatex,context,sh,texlua}[pdflatex]{% \hv@typeout{>>>> Compiler type \nr}% \def\hv@extern@compiler{\val}% \edef\hv@extern@compilerNo{\nr}% @@ -297,6 +297,15 @@ {//StopVisiblePreamble} +%---- Shell +%\input{hvextern-sh.cfg} +\hv@extern@ExampleType{sh} + {\NumChar StartVisibleMain} + {\NumChar StopVisibleMain} + {\NumChar StartVisiblePreamble} + {\NumChar StopVisiblePreamble} + + %%%--------------------------------- end config part ------------------ %% @@ -305,6 +314,7 @@ \newenvironment{externalDocument}[2][]{% \xdef\hvExternDateiname{#2-\arabic{hv@example@counter}}% \setkeys{hv}{#1}% \begin + \hv@typeout{External filename: \hvExternDateiname}% \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.pdf}{}{% \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.png}{}{% \expandafter\IfFileExists\expandafter{\hv@extern@ExamplesDir\hvExternDateiname.txt}{}{% @@ -332,10 +342,11 @@ \hv@typeout{>>>> running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% \hv@extern@runLATEX{\hv@extern@progpath}{\hv@extern@compiler}{\hvExternDateiname}{\hv@extern@ext}% \else - \hv@typeout{>>>> running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% \ifhv@extern@redirect + \hv@typeout{>>>> running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext > \hvExternDateiname.txt}% \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext\space > \hvExternDateiname.txt}% \else + \hv@typeout{>>>> running \hv@extern@compiler~ \hvExternDateiname\hv@extern@ext}% \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname\hv@extern@ext}% \fi \fi @@ -350,7 +361,7 @@ \ShellEscape{xindex \hv@extern@xindexOptions\space \hvExternDateiname.idx}% NAch xindex nochmal latex \ShellEscape{\hv@extern@progpath\hv@extern@compiler\space\hvExternDateiname}% \fi - \else + \else % runsequence \expandafter\run@hv@extern@sequenceList\expandafter{\hv@extern@runsequence}% \fi \ifhv@extern@crop @@ -360,8 +371,9 @@ \ifhv@extern@eps \ShellEscape{pdftops -eps -f 1 -l 1 \hvExternDateiname.pdf}% \fi - \fi + \fi% end force \ifhv@extern@code%-------------- Code Part + \hv@typeout{>>>>Starting Code part ...}% \par\noindent \begingroup \ifdim\hv@extern@mpwidth>\z@ \minipage[\hv@extern@mpvalign]{\hv@extern@mpwidth}\vspace{0pt}\fi @@ -402,8 +414,8 @@ \fi \ifdim\hv@extern@mpwidth > \z@\relax \endminipage\fi \endgroup - \fi - \ifhv@extern@code\else + \fi % end code part + \ifhv@extern@code\else % only if no code \ifhv@extern@showFilename \hv@typeout{>>>> Set filename in the margin!}% \marginnote{\rotatebox{90}{\hvExternDateiname}}% @@ -412,6 +424,7 @@ \ifhv@extern@moveToExampleDir % \ShellEscape{mkdir\space\hv@extern@ExamplesDir/}% \hv@typeout{>>>> Move file into example dir}% + \hv@typeout{>>>>>>\hvExternDateiname ---- \hv@extern@ExamplesDir}% \ShellEscape{\hv@move \hvExternDateiname.*\space \hv@extern@ExamplesDir}% \fi \ifhv@extern@includegraphic @@ -452,15 +465,76 @@ \else% no graphic, only text \ifdim\hv@extern@mpwidth>\z@ \hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt} - \noindent\VerbatimInput{\hv@extern@ExamplesDir\hvExternDateiname.txt} + \noindent\BodyListing{\hv@extern@ExamplesDir\hvExternDateiname.txt} \endminipage \else - \noindent\VerbatimInput{\hv@extern@ExamplesDir\hvExternDateiname.txt} + \noindent\BodyListing{\hv@extern@ExamplesDir\hvExternDateiname.txt} \fi \fi \ifhv@extern@force\expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}\fi% cleanup } + \stepcounter{hv@example@counter}% + + +\newcommand\runExtCmd[3][]{% + \begingroup + \setkeys{hv}{code=false,includegraphic=false,#1}% + \xdef\hvExternDateiname{#3-\arabic{hv@example@counter}}% + \hv@typeout{>>>> running #2}% + \ifhv@extern@redirect + \ShellEscape{\hv@extern@progpath#2 > \hv@extern@ExamplesDir\hvExternDateiname.txt}% + \else + \ShellEscape{\hv@extern@progpath#2}% + \fi + \global\stepcounter{hv@example@counter}% + %------------------------------------- output ----------------------------------- + \ifhv@extern@includegraphic + \ifhv@extern@inline + \expandafter\includegraphics\expandafter[\hv@extern@grfOptions]{\hv@extern@ExamplesDir\hvExternDateiname}% + \else + \ifhv@extern@float + \hv@typeout{>>>> Floating environment}% + \begin{figure}[!htb] + \else + \hv@typeout{>>>> No floating environment}% + \par\noindent\begingroup + \fi + \hv@extern@align + \hv@typeout{>>>> Input image \hv@extern@ExamplesDir\hvExternDateiname}% + \ifhv@extern@frame + \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% + \fbox{\expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]{\hv@extern@ExamplesDir\hvExternDateiname}}% + \hspace{5pt}}\hspace*{-5pt}% + \else + \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% + \expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]% + {\hv@extern@ExamplesDir\hvExternDateiname}% + \hspace{5pt}}\hspace*{-5pt}% + \fi + \ifx\hv@extern@caption\@empty\else\caption{\hv@extern@caption}\fi + \ifx\hv@extern@label\@empty\else\label{\hv@extern@label}\fi + \ifhv@extern@float + \end{figure}% + \else + \ifdim\hv@extern@mpwidth>\z@ \endminipage\else\par\endgroup\fi + \fi + \fi + \else% no graphic, only text + \ifhv@extern@float + \hv@typeout{>>>> Floating environment}% + \begin{figure}[!htb] + \noindent\BodyListing{\hv@extern@ExamplesDir\hvExternDateiname.txt} + \ifx\hv@extern@caption\@empty\else\caption{\hv@extern@caption}\fi + \ifx\hv@extern@label\@empty\else\label{\hv@extern@label}\fi + \end{figure} + \else + \noindent\BodyListing{\hv@extern@ExamplesDir\hvExternDateiname.txt} + \fi + \fi + \ifhv@extern@force\expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}\fi% cleanup + \endgroup +} % %% \endinput diff --git a/macros/latex/contrib/hvlogos/Changes b/macros/latex/contrib/hvlogos/Changes index 9517b17c84..3e81878f5a 100644 --- a/macros/latex/contrib/hvlogos/Changes +++ b/macros/latex/contrib/hvlogos/Changes @@ -1,4 +1,5 @@ hvlogos.sty: +0.09 2022-05-06 - changed almost all \def to \providecommand 0.08 2022-04-25 - added \mkII, \mkIV 0.07 2022-02-28 - fix for \dante and \eV 0.06 2022-01-23 - added \BibLaTeXML diff --git a/macros/latex/contrib/hvlogos/doc/hvlogos-doc.pdf b/macros/latex/contrib/hvlogos/doc/hvlogos-doc.pdf Binary files differindex 8b483f54d1..c279a280b2 100644 --- a/macros/latex/contrib/hvlogos/doc/hvlogos-doc.pdf +++ b/macros/latex/contrib/hvlogos/doc/hvlogos-doc.pdf diff --git a/macros/latex/contrib/hvlogos/doc/hvlogos-doc.tex b/macros/latex/contrib/hvlogos/doc/hvlogos-doc.tex index 30ffb01ad5..bf2e1a54ee 100644 --- a/macros/latex/contrib/hvlogos/doc/hvlogos-doc.tex +++ b/macros/latex/contrib/hvlogos/doc/hvlogos-doc.tex @@ -13,7 +13,7 @@ \title{\texttt{hvlogos} -- Print \TeX-related Logos} \author{Herbert Voß\thanks{Thanks to -Denis Bitouzé, Heiko Oberdiek, Mark Senn}} +Karl Berry, Denis Bitouzé, Heiko Oberdiek, Mark Senn}} \begin{document} \maketitle diff --git a/macros/latex/contrib/hvlogos/latex/hvlogos.sty b/macros/latex/contrib/hvlogos/latex/hvlogos.sty index 5a94c04554..6fab62f878 100644 --- a/macros/latex/contrib/hvlogos/latex/hvlogos.sty +++ b/macros/latex/contrib/hvlogos/latex/hvlogos.sty @@ -10,7 +10,7 @@ % % % ------------------------------------- -\ProvidesPackage{hvlogos}[2022/04/25 v. 0.08 Logos (hv)] +\ProvidesPackage{hvlogos}[2022/05/06 v. 0.09 Logos (hv)] % \newif\if@dtk@newengine \@dtk@newenginetrue % @@ -28,13 +28,13 @@ \DeclareRobustCommand\ffmfamily{\not@math@alphabet\ffmfamily\relax \fontencoding{T1}\fontfamily{ffm}\selectfont} \DeclareTextFontCommand{\textffm}{\ffmfamily} -\def\MF{\textffm{META}\@dischyph\textffm{FONT}\@} -\def\MP{\textffm{META}\@dischyph\textffm{POST}\@} -\def\MT{\textffm{META}\@dischyph\textffm{TYPE1}\@} +\providecommand\MF{\textffm{META}\@dischyph\textffm{FONT}\@} +\providecommand\MP{\textffm{META}\@dischyph\textffm{POST}\@} +\providecommand\MT{\textffm{META}\@dischyph\textffm{TYPE1}\@} \fi -\def\mpShort{\textffm{MP}\@} -\def\mfShort{\textffm{MF}\@} +\providecommand\mpShort{\textffm{MP}\@} +\providecommand\mfShort{\textffm{MF}\@} \ExplSyntaxOn \DeclareDocumentCommand\hologo@La{ O{-0.25em} }% @@ -68,13 +68,13 @@ \ExplSyntaxOff -\def\AmS{\textsf{AMS}} +\providecommand\AmS{\textsf{AMS}} \let\AMS\AmS %{\ifluatex\mathversion{XITS}\fi% % $\mathcal{A}$\kern-.1667em\lower.5ex\hbox{$\mathcal{M}$}\kern-.125em$\mathcal{S}$}}% $ -\def\amsmath{\AMS\textsf{math}} -\def\AmSLaTeX{\mbox{\textsf{AMS}-\LaTeX}} -\def\AmSTeX{\mbox{\textsf{AMS}-\hologo{TeX}}} +\providecommand\amsmath{\AMS\textsf{math}} +\providecommand\AmSLaTeX{\mbox{\textsf{AMS}-\LaTeX}} +\providecommand\AmSTeX{\mbox{\textsf{AMS}-\hologo{TeX}}} \DeclareRobustCommand\Biber{\textsf{Biber}} \let\biber\Biber \DeclareRobustCommand{\BibLaTeXML}{B\kern-.05em% @@ -86,28 +86,28 @@ \kern-.08em\-\LaTeX{}ML} \DeclareRobustCommand\BibTeX{\@ifnextchar8\@@BibTeX\@BibTeX} \def\@BibTeX{{\hologoLogoSetup{BibTeX}{variant=sc}\hologo{BibTeX}}} -\def\BibTeXacht{{\hologoLogoSetup{BibTeX8}{variant=sc}\hologo{BibTeX8}}} +\providecommand\BibTeXacht{{\hologoLogoSetup{BibTeX8}{variant=sc}\hologo{BibTeX8}}} \def\@@BibTeX8{\hologo{BibTeX8}} \DeclareRobustCommand\BibLaTeX{Bib\LaTeX} \let\biblatex\BibLaTeX -\def\ConTeXt{\hologo{ConTeXt}} +\providecommand\ConTeXt{\hologo{ConTeXt}} \let\context\ConTeXt -\def\emTeX{\hologo{emTeX}} -\def\eTeX{\hologo{eTeX}} -\def\ExTeX{\hologo{ExTeX}} -\def\HanTheThanh{\hologo{HanTheThanh}}% +\providecommand\emTeX{\hologo{emTeX}} +\providecommand\eTeX{\hologo{eTeX}} +\providecommand\ExTeX{\hologo{ExTeX}} +\providecommand\HanTheThanh{\hologo{HanTheThanh}}% \let\HTT\HanTheThanh -\def\iniTeX{\hologo{iniTeX}} -\def\KOMAScript{\hologo{KOMAScript}} +\providecommand\iniTeX{\hologo{iniTeX}} +\providecommand\KOMAScript{\hologo{KOMAScript}} -%\def\LaTeX{\hologo{LaTeX}} -%\def\LaTeXTeX{\hologo{(La)TeX}} -\def\LaTeXe{\hologo{LaTeX2e}} -\def\LaTeXIII{\hologo{LaTeX3}} -\def\LaTeXML{\hologo{LaTeXML}} -\def\LuaLaTeX{\hologo{LuaLaTeX}} +%\providecommand\LaTeX{\hologo{LaTeX}} +%\providecommand\LaTeXTeX{\hologo{(La)TeX}} +\providecommand\LaTeXe{\hologo{LaTeX2e}} +\providecommand\LaTeXIII{\hologo{LaTeX3}} +\providecommand\LaTeXML{\hologo{LaTeXML}} +\providecommand\LuaLaTeX{\hologo{LuaLaTeX}} \let\lualatex\LuaLaTeX -\def\LuaTeX{\hologo{LuaTeX}} +\providecommand\LuaTeX{\hologo{LuaTeX}} \let\HoLogoHtml@LuaHBTeX\HoLogo@LuaHBTeX \def\HoLogo@LuaHBTeX#1{% @@ -117,13 +117,13 @@ }% } -\def\LuaHBTeX{\hologo{LuaHBTeX}} +\providecommand\LuaHBTeX{\hologo{LuaHBTeX}} \let\luahbtex\LuaHBTeX \let\LuahbTeX\LuaHBTeX \let\luatex\LuaTeX % -\def\LuaMetaTeX{% +\providecommand\LuaMetaTeX{% \mbox{Lua}% % \HOLOGO@discretionary % \mbox{\fontfamily{logo}\fontencoding{U}\selectfont META} @@ -131,7 +131,7 @@ % \HOLOGO@discretionary \hologo{TeX}% } -\def\LuaMetaLaTeX{% +\providecommand\LuaMetaLaTeX{% \mbox{Lua}% % \HOLOGO@discretionary % \mbox{\fontfamily{logo}\fontencoding{U}\selectfont META} @@ -139,61 +139,61 @@ % \HOLOGO@discretionary \hologo{LaTeX}% } -\def\LMTX{\textsf{LMTX}} +\providecommand\LMTX{\textsf{LMTX}} \let\lmtx\LMTX -\def\LyX{\hologo{LyX}} -\def\META{\HoLogoFont@font{METAFONT}{logo}{\mbox{META}}} -\def\METAFONT{\hologo{METAFONT}} +\providecommand\LyX{\hologo{LyX}} +\providecommand\META{\HoLogoFont@font{METAFONT}{logo}{\mbox{META}}} +\providecommand\METAFONT{\hologo{METAFONT}} \let\MF\METAFONT -\def\MetaFun{\textffm{METAFUN}} +\providecommand\MetaFun{\textffm{METAFUN}} \let\MFun\MetaFun -\def\METAPOST{\hologo{METAPOST}} -\def\MetaPost{\hologo{MetaPost}} -\def\mkII{\textsf{mkII}} +\providecommand\METAPOST{\hologo{METAPOST}} +\providecommand\MetaPost{\hologo{MetaPost}} +\providecommand\mkII{\textsf{mkII}} \let\mkii\mkII -\def\mkIV{\textsf{mkIV}} +\providecommand\mkIV{\textsf{mkIV}} \let\mkiv\mkIV \let\MP\METAPOST -\def\MiKTeX{\hologo{MiKTeX}} -\def\NTS{\hologo{NTS}} -\def\OzMF{\hologo{OzMF}} -\def\OzMP{\hologo{OzMP}} -\def\OzTeX{\hologo{OzTeX}} -\def\OzTtH{\hologo{OzTtH}} -\def\PCTeX{\hologo{PCTeX}} -\def\pdfTeX{\hologo{pdfTeX}} +\providecommand\MiKTeX{\hologo{MiKTeX}} +\providecommand\NTS{\hologo{NTS}} +\providecommand\OzMF{\hologo{OzMF}} +\providecommand\OzMP{\hologo{OzMP}} +\providecommand\OzTeX{\hologo{OzTeX}} +\providecommand\OzTtH{\hologo{OzTtH}} +\providecommand\PCTeX{\hologo{PCTeX}} +\providecommand\pdfTeX{\hologo{pdfTeX}} \let\pdftex\pdfTeX -\def\pdfLaTeX{\hologo{pdfLaTeX}} +\providecommand\pdfLaTeX{\hologo{pdfLaTeX}} \let\pdflatex\pdfLaTeX -\def\PiC{\hologo{PiC}} -\def\PiCTeX{\hologo{PiCTeX}} -\def\plainTeX{\hologo{plainTeX}} -\def\PostScript{Post\-Script} +\providecommand\PiC{\hologo{PiC}} +\providecommand\PiCTeX{\hologo{PiCTeX}} +\providecommand\plainTeX{\hologo{plainTeX}} +\providecommand\PostScript{Post\-Script} \let\PS\PostScript -\def\SageTeX{\hologo{SageTeX}} -\def\SLiTeX{\hologo{SLiTeX}} -\def\teTeX{\hologo{teTeX}} -\def\TeXivht{\hologo{TeX4ht}} +\providecommand\SageTeX{\hologo{SageTeX}} +\providecommand\SLiTeX{\hologo{SLiTeX}} +\providecommand\teTeX{\hologo{teTeX}} +\providecommand\TeXivht{\hologo{TeX4ht}} \def\tex4ht{\hologo{TeX4ht}} -\def\TTH{\hologo{TTH}} -\def\virTeX{\hologo{virTeX}} -\def\VTeX{\hologo{VTeX}} -\def\XeLaTeX{\hologo{XeLaTeX}} -\def\XeTeX{\hologo{XeTeX}} +\providecommand\TTH{\hologo{TTH}} +\providecommand\virTeX{\hologo{virTeX}} +\providecommand\VTeX{\hologo{VTeX}} +\providecommand\XeLaTeX{\hologo{XeLaTeX}} +\providecommand\XeTeX{\hologo{XeTeX}} \DeclareRobustCommand\xypic{\textsf{\hbox{\kern-.1em X\kern-.1em\lower.4ex\hbox{Y\kern-.1em}-pic}}} \let\XYpic\xypic %% % \newcommand\BibTool{\textsc{Bib\hskip-.1em T\hskip-.15emo\hskip-.05emo\hskip-.05eml}\xspace} -\def\tikzlogo{Ti\textit{k}Z} -\def\ALEPH{\ensuremath{\aleph}} +\providecommand\tikzlogo{Ti\textit{k}Z} +\providecommand\ALEPH{\ensuremath{\aleph}} \let\TikZ\tikzlogo -\def\eV{e.\kern-0.1em V\kern-0.18em.} +\providecommand\eV{e.\kern-0.1em V\kern-0.18em.} -\def\dante{DANTE~e.\kern-0.1em V\kern-0.18em.} +\providecommand\dante{DANTE~e.\kern-0.1em V\kern-0.18em.} \iffalse \def\d@nte{\@ifnextchar.% @@ -222,34 +222,34 @@ \fi} \providecommand\dtk{Die \TeX\-ni\-sche Ko\-mö\-die} -\providecommand\DTK{``\dtk''} +\providecommand\DTK{\glqq\dtk\grqq} \providecommand\PS{Post\-Script} \providecommand\TUG{\TeX{} Users Group} \providecommand\TUGboat{\textsl{TUGboat}} \let\DANTE\dantelogo \def\pgf/tikz{pgf/Ti\textit{k}Z} -\def\pgftikz{pgf/Ti\textit{k}Z} -\def\TeXLive{\TeX{}Live\xspace} +\providecommand\pgftikz{pgf/Ti\textit{k}Z} +\providecommand\TeXLive{\TeX{}Live\xspace} -\def\CTAN{\textsf{CTAN}\xspace} +\providecommand\CTAN{\textsf{CTAN}\xspace} -\def\PSTricks{\textsf{PSTricks}\xspace} +\providecommand\PSTricks{\textsf{PSTricks}\xspace} \let\pstricks\PSTricks \if@dtk@newengine \newfontfamily\dtk@LinWikipedia{Linux Libertine O}% - \def\WikipediA{{\dtk@LinWikipedia\char"E02F\textsc{ikipediA}}} % hexadezimal + \providecommand\WikipediA{{\dtk@LinWikipedia\char"E02F\textsc{ikipediA}}} % hexadezimal \else - \def\WikipediA{WikipediA}% + \providecommand\WikipediA{WikipediA}% \fi \let\Wikipedia\WikipediA \let\wikipedia\WikipediA % -\def\macOS{\textsf{macOS}\xspace} +\providecommand\macOS{\textsf{macOS}\xspace} -\def\PurdueThesis{P\kern-0.15ex urdue\kern-0.05ex T\kern-0.1ex hesis} +\providecommand\PurdueThesis{P\kern-0.15ex urdue\kern-0.05ex T\kern-0.1ex hesis} \let\purduethesis = \PurdueThesis -\def\PuTh{P\kern-0.15ex u\kern-0.05ex T\kern-0.1ex h} +\providecommand\PuTh{P\kern-0.15ex u\kern-0.05ex T\kern-0.1ex h} \let\puth = \PuTh diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf Binary files differindex bfccc07f4e..92b1181a85 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex index 4e76c71235..66246c9ba2 100644 --- a/macros/latex/contrib/nicematrix/nicematrix-french.tex +++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex @@ -1170,64 +1170,6 @@ Cette commande |\diagbox| peut aussi être utilisée dans un |\Block|. -\subsection{Filets en pointillés} - -\label{dotted} - -Dans les environnements de \pkg{nicematrix}, il est possible d'utiliser la -commande |\hdottedline| (fournie par \pkg{nicematrix}) qui est l'équivalent pour -les pointillés de la commande |\hline|. - -\medskip -\begin{BVerbatim}[baseline=c,boxwidth=9.5cm] -\begin{pNiceMatrix} -1 & 2 & 3 & 4 & 5 \\ -~emphase#\hdottedline@ -6 & 7 & 8 & 9 & 10 \\ -11 & 12 & 13 & 14 & 15 -\end{pNiceMatrix} -\end{BVerbatim} -$\begin{pNiceMatrix} -1 & 2 & 3 & 4 & 5 \\ -\hdottedline -6 & 7 & 8 & 9 & 10 \\ -11 & 12 & 13 & 14 & 15 -\end{pNiceMatrix}$ - - -\medskip -Dans les environnements avec un préambule explicite (comme |{NiceTabular}|, -|{NiceArray}|, etc.), il est possible de dessiner un trait vertical en -pointillés avec le spécificateur «|:|». - -\medskip -\begin{BVerbatim}[baseline=c,boxwidth=9.5cm] -\begin{pNiceArray}{cccc~emphase#:@c} -1 & 2 & 3 & 4 & 5 \\ -6 & 7 & 8 & 9 & 10 \\ -11 & 12 & 13 & 14 & 15 -\end{pNiceArray} -\end{BVerbatim} -$\begin{pNiceArray}{cccc:c} -1 & 2 & 3 & 4 & 5 \\ -6 & 7 & 8 & 9 & 10 \\ -11 & 12 & 13 & 14 & 15 -\end{pNiceArray}$ - -\medskip -Il est possible de changer dans \pkg{nicematrix} la lettre utilisée pour -indiquer dans le préambule un trait vertical en pointillés avec l'option -|letter-for-dotted-lines| disponible dans |\NiceMatrixOptions|. - -\medskip -\emph{Remarque} : Quand l'extension \pkg{array} (sur laquelle s'appuie -\pkg{nicematrix}) est chargée, les traits verticaux et horizontaux que l'on -insère rendent le tableau plus large ou plus long d'une quantité égale à la -largeur du trait\footnote{En fait, avec l'extension \pkg{array}, cela est vrai - pour |\hline| et «\verb+|+» mais pas pour |\cline| : cf. - p.~\pageref{remark-cline}}. Avec \pkg{nicematrix}, les lignes en pointillés -tracées par |\hdottedline| et «|:|» ont ce même effet. - \subsection{Commandes pour filets personnalisés} \label{custom-line} @@ -1272,35 +1214,9 @@ d'intérêt que dans le cas où la clé |multiplicity| est utilisée). \end{itemize} \medskip -\item \emph{Deuxième possibilité}\par\nobreak - -On peut utiliser la clé |dotted| qui impose un style de pointillés qui utilise -le système de pointillés de la commande |\hdottedline| (et de la lettre -\verb|:|) décrit à la partie précédente (cf. p.~\pageref{dotted}). La clé -|color| est en fait aussi utilisable dans ce cas-là. - -\medskip -\item \colorbox{yellow!50}{\textbf{Nouveau 6.6}}\enskip \emph{Troisième - possibilité} - -On peut utiliser la clé |tikz| (si Tikz est chargé, \pkg{nicematrix} ne -chargeant par défaut que \textsc{pgf}). Dans ce cas-là, le filet est tracé -directement avec Tikz en utilisant comme paramètres la valeur de la clé |tikz| -qui doit être une liste de couples \textsl{clé=valeur} applicables à un chemin -Tikz. - -Par défaut aucune réservation de place n'est faite par défaut pour le filet qui -sera tracé avec Tikz. On peut demander une réservation (horizontale pour un -filet vertical et verticale pour un filet horizontal) avec la clé |width| qui -est donc en quelque sorte la largeur du filet qui sera tracé (cette largeur -n'est pas déduite des caractéristiques fournies par la clé |tikz|). -\end{itemize} - - -\medskip Ce système permet en particulier de définir des commandes pour tracer des filets -avec une couleur spécifique (et ces filets respecteront les blocs comme les -autres filets de \pkg{nicematrix}). +avec une couleur spécifique (et ces filets respecteront les blocs et les coinn +comme les autres filets de \pkg{nicematrix}). \medskip \begin{Verbatim} @@ -1331,31 +1247,40 @@ Produit C & 5 & 4 & 1 \\ \end{center} +\item \colorbox{yellow!50}{\textbf{Nouveau 6.6}}\enskip \emph{Deuxième + possibilité} + +On peut utiliser la clé |tikz| (si Tikz est chargé, \pkg{nicematrix} ne +chargeant par défaut que \textsc{pgf}). Dans ce cas-là, le filet est tracé +directement avec Tikz en utilisant comme paramètres la valeur de la clé |tikz| +qui doit être une liste de couples \textsl{clé=valeur} applicables à un chemin +Tikz. + +Par défaut aucune réservation de place n'est faite par défaut pour le filet qui +sera tracé avec Tikz. On peut demander une réservation (horizontale pour un +filet vertical et verticale pour un filet horizontal) avec la clé |width| qui +est donc en quelque sorte la largeur du filet qui sera tracé (cette largeur +n'est pas déduite des caractéristiques fournies par la clé |tikz|). + \bigskip -Voici un exemple avec la clé |tikz|. +Voici ce que l'on obtient avec la clé |dotted| de Tikz. \begin{Verbatim} -\documentclass{article} -\usepackage{nicematrix,tikz} -\usetikzlibrary{decorations.pathmorphing} - \NiceMatrixOptions { custom-line = { letter = I , - ~emphase#tikz = { decorate, decoration = { coil, aspect = 0 } }}@ , - ~emphase#width = 2 mm@ + ~emphase#tikz = dotted @ , + ~emphase#width = \pgflinewidth@ } } -\begin{document} \begin{NiceTabular}{cIcIc} un & deux & trois \\ quatre & cinq & six \\ sept & huit & neuf \end{NiceTabular} -\end{document} \end{Verbatim} \begin{center} @@ -1364,8 +1289,8 @@ sept & huit & neuf custom-line = { letter = I , - tikz = { decorate, decoration = { coil, aspect = 0 } } , - width = 2 mm + tikz = dotted , + width = \pgflinewidth } } \begin{NiceTabular}{cIcIc} @@ -1375,6 +1300,80 @@ sept & huit & neuf \end{NiceTabular} \end{center} +\medskip +\item \emph{Troisième possibilité} : la clé |dotted|\par\nobreak +\label{dotted} + +Comme on le voit dans l'exemple précédent, les pointillés tracés par la clé +|dotted| de Tikz ne sont pas ronds. C'est pourquoi l'extension \pkg{nicematrix} +propose dans la clé |custom-line| une clé |dotted| qui va tracer des pointillés +ronds. La valeur de la clé |width| est, dans ce cas-là, déjà réglée sur le +diamètre des points. Ces pointillés ronds sont aussi utilisés par +\pkg{nicematrix} pour des lignes en pointillées continues créées entre deux +composantes de la matrice par |\Cdots|, |\Vdots|, etc (voir p.~\pageref{Cdots}). + +\medskip +L'extension \pkg{nicematrix} prédéfinit en fait la commande |\hdottedline| et la +lettre «|:|» pour ces filets en pointillés.\footnote{Néanmoins, l'utilisateur peut écraser ces définitions de |\hdottedline| et de +«|:|» avec |custom-line| s'il le souhaite (par exemple pour les remplacer par des +lignes en tiretés).} + +\smallskip +\begin{BVerbatim} +% ~textsl#présent dans nicematrix.sty@ +\NiceMatrixOptions + { + custom-line = + { + letter = : , + command = hdottedline , + dotted + } + } +\end{BVerbatim} + +\bigskip +Dans les environnements de \pkg{nicematrix}, il est donc possible d'utiliser la +commande |\hdottedline| pour tracer des filets horizontaux en pointillés. + +\medskip +\begin{BVerbatim}[baseline=c,boxwidth=9.5cm] +\begin{pNiceMatrix} +1 & 2 & 3 & 4 & 5 \\ +~emphase#\hdottedline@ +6 & 7 & 8 & 9 & 10 \\ +11 & 12 & 13 & 14 & 15 +\end{pNiceMatrix} +\end{BVerbatim} +$\begin{pNiceMatrix} +1 & 2 & 3 & 4 & 5 \\ +\hdottedline +6 & 7 & 8 & 9 & 10 \\ +11 & 12 & 13 & 14 & 15 +\end{pNiceMatrix}$ + + +\medskip +Dans les environnements avec un préambule explicite (comme |{NiceTabular}|, +|{NiceArray}|, etc.), il est possible de dessiner un trait vertical en +pointillés avec le spécificateur «|:|». + +\medskip +\begin{BVerbatim}[baseline=c,boxwidth=9.5cm] +\begin{pNiceArray}{cccc~emphase#:@c} +1 & 2 & 3 & 4 & 5 \\ +6 & 7 & 8 & 9 & 10 \\ +11 & 12 & 13 & 14 & 15 +\end{pNiceArray} +\end{BVerbatim} +$\begin{pNiceArray}{cccc:c} +1 & 2 & 3 & 4 & 5 \\ +6 & 7 & 8 & 9 & 10 \\ +11 & 12 & 13 & 14 & 15 +\end{pNiceArray}$ +\end{itemize} + + \section{Les couleurs des rangées et des colonnes} @@ -2117,9 +2116,7 @@ $\begin{array}{c} \label{varwidth} -\colorbox{yellow!50}{\textbf{Nouveau 6.3}} -\smallskip Rappelons d'abord le fonctionnement d'un environnement |{varwidth}| de l'extension éponyme \pkg{varwidth}. Un tel environnement est similaire à l'environnement classique |{minipage}| mais la largeur indiquée (en argument) @@ -3211,8 +3208,6 @@ a_{31} & a_{32} & a_{33} \subsection{Les commandes \textbackslash OverBrace et \textbackslash UnderBrace dans le \textbackslash CodeAfter} -\colorbox{yellow!50}{\textbf{Nouveau 6.4}} - Les commandes |\OverBrace| and |\UnderBrace| permettent de placer des accolades horizontales sur une partie du tableau. Ces commandes prennent trois arguments : \begin{itemize} @@ -3392,6 +3387,12 @@ des notes avant les notes numérotées. \pkg{nicematrix}), la clé |notes/bottomrule| permet de faire tracer un |\bottomrule| de \pkg{booktabs} \emph{après} les notes. +\item \colorbox{yellow!50}{\textbf{Nouveau 6.8}}\enskip Lorsque plusieurs +commandes |\tabularnote| sont utilisées avec le même argument, une seule note +est insérée en fin de tableau (mais tous les labels sont marqués). Il est +possible de désactiver cette fonctionnalité avec la clé +|notes/detect-duplicates| + \item Il est possible de référencer une note de tableau (avec la commande |\label| placée après le |\tabularnote|). \end{itemize} @@ -3406,8 +3407,7 @@ remarques illustrées. Cette table a été composée avec le code suivant. \setlength{\belowcaptionskip}{1ex} \centering \caption{Utilisation de \texttt{\textbackslash - tabularnote}~emphase#\tabularnote{On peut! - ~emphase# mettre une note dans le titre.}!} + tabularnote}~emphase#\tabularnote{On peut mettre une note dans le titre.}!} \label{t:tabularnote} \begin{NiceTabular}{@{}llc@{}}% [~emphase#notes/bottomrule!, tabularnote = Un peu de texte avant les notes.] @@ -3417,9 +3417,9 @@ Nom & Prénom & Durée de vie \\ Barrère & Bertrand & 86\\ Nightingale~emphase#\tabularnote{Souvent considérée comme la première! ~emphase#infirmière.}\tabularnote{Surnommée «la Dame à la Lampe».}! -& Florence & 90 \\ +& Florence~emphase#\tabularnote{Cette note est commune à deux appels de notes.}! & 90 \\ Schœlcher & Victor & 89~emphase#\tabularnote{L'appel de note déborde à droite.}!\\ -Touchet & Marie & 89 \\ +Touchet & Marie~emphase#\tabularnote{Cette note est commune à deux appels de notes.}! & 89 \\ Wallis & John & 87 \\ \bottomrule \end{NiceTabular} @@ -3441,9 +3441,9 @@ Nom & Prénom & Durée de vie \\ Barrère & Bertrand & 86\\ Nightingale\tabularnote{Souvent considérée comme la première infirmière.}\tabularnote{Surnommée «la Dame à la Lampe».} -& Florence & 90 \\ +& Florence\tabularnote{Cette note est commune à deux appels de notes.} & 90 \\ Schœlcher & Victor & 89\tabularnote{L'appel de note déborde à droite.}\\ -Touchet & Marie & 89 \\ +Touchet & Marie\tabularnote{Cette note est commune à deux appels de notes.} & 89 \\ Wallis & John & 87 \\ \bottomrule \end{NiceTabular} @@ -3603,13 +3603,10 @@ Si on souhaite, par exemple, que les notes soient composées en gris et en On peut aussi mettre dans cette clé |\raggedright| ou |\RaggedRight| (cette dernière est une commande de \pkg{ragged2e}). -\item \colorbox{yellow!50}{\textbf{Nouveau 6.8}}\enskip À partir de la version -6.8, les doublons dans les notes de tableau sont détectés par défaut: lorsque -plusieurs commandes |\tabularnote| sont utilisées avec le même argument, une -seule note est insérée en fin de tableau (mais tous les labels sont marqués). Il -est possible de désactiver cette fonctionnalité avec la clé -|notes/detect-duplicates| (sa valeur initiale est |true|). +\item La clé |notes/detect-duplicates| active la détection des +commandes |\tabularnote| avec le même argument. +Valeur initiale : |true| \end{itemize} @@ -4085,10 +4082,9 @@ a & a & a \end{pNiceMatrix}\] -\colorbox{yellow!50}{\textbf{Nouveau 6.3}}\enskip Les nœuds de la dernière -colonne (hors éventuelle «colonne extérieure» spécifiée par |last-col|) peuvent -aussi être désignés par $i$-|last|. De même, les nœuds de la dernière ligne -peuvent être désignés par |last|-$j$. +Les nœuds de la dernière colonne (hors éventuelle «colonne extérieure» spécifiée +par |last-col|) peuvent aussi être désignés par $i$-|last|. De même, les nœuds +de la dernière ligne peuvent être désignés par |last|-$j$. \medskip \subsubsection{Les colonnes V de varwidth} diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx index 74e7b7c98f..c95554cfac 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.dtx +++ b/macros/latex/contrib/nicematrix/nicematrix.dtx @@ -15,8 +15,8 @@ % % \fi % \iffalse -\def\myfileversion{6.8} -\def\myfiledate{2022/03/11} +\def\myfileversion{6.8a} +\def\myfiledate{2022/05/08} % % %<*batchfile> @@ -101,6 +101,8 @@ version 2005/12/01 or later. \makeatother + + \begin{document} \DocInput{nicematrix.dtx} \end{document} @@ -1181,59 +1183,7 @@ version 2005/12/01 or later. % It's possible to use the command |\diagbox| in a |\Block|. % % -% \subsection{Dotted rules} -% -% \label{dotted} -% -% In the environments of the package \pkg{nicematrix}, it's possible to use -% the command |\hdottedline| (provided by \pkg{nicematrix}) which is a -% counterpart of the classical command |\hline|. -% -% \medskip -% \begin{BVerbatim}[baseline=c,boxwidth=9.5cm] -% \begin{pNiceMatrix} -% 1 & 2 & 3 & 4 & 5 \\ -% ~emphase#\hdottedline@ -% 6 & 7 & 8 & 9 & 10 \\ -% 11 & 12 & 13 & 14 & 15 -% \end{pNiceMatrix} -% \end{BVerbatim} -% $\begin{pNiceMatrix} -% 1 & 2 & 3 & 4 & 5 \\ -% \hdottedline -% 6 & 7 & 8 & 9 & 10 \\ -% 11 & 12 & 13 & 14 & 15 -% \end{pNiceMatrix}$ -% -% -% \bigskip -% In the environments with an explicit preamble (like |{NiceTabular}|, -% |{NiceArray}|, etc.), it's possible to draw a vertical dotted line with the -% specifier ``|:|''. -% -% \medskip -% \begin{BVerbatim}[baseline=c,boxwidth=9.5cm] -% \left(\begin{NiceArray}{cccc~emphase#:@c} -% 1 & 2 & 3 & 4 & 5 \\ -% 6 & 7 & 8 & 9 & 10 \\ -% 11 & 12 & 13 & 14 & 15 -% \end{NiceArray}\right) -% \end{BVerbatim} -% $\left(\begin{NiceArray}{cccc:c} -% 1 & 2 & 3 & 4 & 5 \\ -% 6 & 7 & 8 & 9 & 10 \\ -% 11 & 12 & 13 & 14 & 15 -% \end{NiceArray}\right)$ -% % -% \bigskip -% \emph{Remark}: In the package \pkg{array} (on which the package -% \pkg{nicematrix} relies), horizontal and vertical rules make the array larger -% or wider by a quantity equal to the width of the rule\footnote{In fact, with -% \pkg{array}, this is true only for |\hline| and ``"|"'' but not for |\cline|: -% cf p.~\pageref{remark-cline}}. In \pkg{nicematrix}, the dotted lines drawn by -% |\hdottedline| and ``|:|'' do likewise. -% % % \subsection{Commands for customized rules} % \label{custom-line} @@ -1274,36 +1224,12 @@ version 2005/12/01 or later. % \item the key |sep-color| sets the color between two successive rules (should be % used only in conjonction with |multiplicity|). % \end{itemize} -% -% \bigskip -% \item \emph{Second possibility}\par\nobreak -% -% The key |dotted| forces a style with dotted rules such as those created by -% |\hdottedline| or the letter ``|:|'' in the preamble (cf. -% p.~\pageref{dotted}). The key |color| may be used also in that case. % -% \bigskip -% \item \colorbox{yellow!50}{\textbf{New 6.6}}\enskip \emph{Third -% possibility}\par\nobreak -% -% It's possible to use the key |tikz| (if Tikz is loaded). In that case, the -% rule is drawn directly with Tikz by using as parameters the value of the key -% |tikz| which must be a list of \textsl{key=value} pairs which may be applied -% to a Tikz path. -% -% By default, no space is reserved for the rule that will be drawn with Tikz. It -% possible to specify a reservation (horizontal for a vertical rule and vertical -% for an horizontal one) with the key |width|. That value of that key, is, in -% some ways, the width of the rule that will be drawn (\pkg{nicematrix} does not -% compute that width from the characteristics of the rule specified in |tikz|). -% \end{itemize} -% -% \bigskip +% \medskip % That system may be used, in particular, for the definition of commands and % letters to draw rules with a specific color (and those rules will respect the -% blocks as do all rules of \pkg{nicematrix}). -% -% +% blocks and corners as do all the rules of \pkg{nicematrix}). +% % \medskip % \begin{Verbatim} % \begin{NiceTabular}{lcIcIc}~emphase#[custom-line = {letter=I, color=blue}]@ @@ -1318,6 +1244,23 @@ version 2005/12/01 or later. % \end{NiceTabular} % \end{Verbatim} % +% +% \bigskip +% \item \colorbox{yellow!50}{\textbf{New 6.6}}\enskip \emph{Second +% possibility}\par\nobreak +% +% It's possible to use the key |tikz| (if Tikz is loaded). In that case, the +% rule is drawn directly with Tikz by using as parameters the value of the key +% |tikz| which must be a list of \textsl{key=value} pairs which may be applied +% to a Tikz path. +% +% By default, no space is reserved for the rule that will be drawn with Tikz. It +% is possible to specify a reservation (horizontal for a vertical rule and +% vertical for an horizontal one) with the key |width|. That value of that key, +% is, in some ways, the width of the rule that will be drawn (\pkg{nicematrix} +% does not compute that width from the characteristics of the rule specified in +% |tikz|). +% % % \begin{center} % \begin{NiceTabular}{lcIcIc}[custom-line = {letter=I, color=blue}] @@ -1333,40 +1276,33 @@ version 2005/12/01 or later. % \end{center} % % \bigskip -% Here is an example of the key |tikz|. -% -% \begin{Verbatim} -% \documentclass{article} -% \usepackage{nicematrix,tikz} -% \usetikzlibrary{decorations.pathmorphing} +% Here is an example with the key |dotted| of Tikz. % +% \begin{BVerbatim}[boxwidth=9cm,baseline=c] % \NiceMatrixOptions % { % custom-line = % { % letter = I , -% ~emphase#tikz = { decorate, decoration = { coil, aspect = 0 } }}@ , -% ~emphase#width = 2 mm@ +% ~emphase#tikz = dotted@ , +% ~emphase#width = \pgflinewidth@ % } % } % -% \begin{document} % \begin{NiceTabular}{cIcIc} % one & two & three \\ % four & five & six \\ % seven & eight & nine % \end{NiceTabular} -% \end{document} -% \end{Verbatim} -% -% \begin{center} +% \end{BVerbatim} +% \begin{scope} % \NiceMatrixOptions % { % custom-line = % { % letter = I , -% tikz = { decorate, decoration = { coil, aspect = 0 } } , -% width = 2 mm +% tikz = dotted , +% width = \pgflinewidth % } % } % \begin{NiceTabular}{cIcIc} @@ -1374,9 +1310,81 @@ version 2005/12/01 or later. % four & five & six \\ % seven & eight & nine % \end{NiceTabular} -% \end{center} +% \end{scope} +% +% \bigskip +% \item \emph{Third possibility} : the key |dotted| +% \label{dotted} +% +% As one can see, the dots of a dotted line of Tikz have the shape of a square, +% and not a circle. That's why the extension \pkg{nicematrix} provides in the +% key |custom-line| a key |dotted| which will draw rounded dots. The value of +% the key |width| is, in this case, preset to the diameter of the dots. Those +% dotted rules are also used by \pkg{nicematrix} to draw continuous dotted rules +% between cells of the matrix with |\Cdots|, |\Vdots|, etc. (cf. p.~\pageref{Cdots}). +% +% In fact, \pkg{nicematrix} defines by default the command |\hdottedline| and the +% letter ``|:|'' for those dotted rules.\footnote{However, it's possible to +% overwrite those definitions with a |custom-line| (in order, for example, to +% switch to dashed lines).} +% +%\smallskip +%\begin{BVerbatim} +% +% \NiceMatrixOptions % ~textsl#présent dans nicematrix.sty@ +% { +% custom-line = +% { +% letter = : , +% command = hdottedline , +% ~emphase#dotted@ +% } +% } +% \end{BVerbatim} +% +% Thus, it's possible to use the command |\hdottedline| to draw a horizontal +% dotted rule. +% +% \medskip +% \begin{BVerbatim}[baseline=c,boxwidth=9.5cm] +% \begin{pNiceMatrix} +% 1 & 2 & 3 & 4 & 5 \\ +% ~emphase#\hdottedline@ +% 6 & 7 & 8 & 9 & 10 \\ +% 11 & 12 & 13 & 14 & 15 +% \end{pNiceMatrix} +% \end{BVerbatim} +% $\begin{pNiceMatrix} +% 1 & 2 & 3 & 4 & 5 \\ +% \hdottedline +% 6 & 7 & 8 & 9 & 10 \\ +% 11 & 12 & 13 & 14 & 15 +% \end{pNiceMatrix}$ % % +% \bigskip +% In the environments with an explicit preamble (like |{NiceTabular}|, +% |{NiceArray}|, etc.), it's possible to draw a vertical dotted line with the +% specifier ``|:|''. +% +% \medskip +% \begin{BVerbatim}[baseline=c,boxwidth=9.5cm] +% \left(\begin{NiceArray}{cccc~emphase#:@c} +% 1 & 2 & 3 & 4 & 5 \\ +% 6 & 7 & 8 & 9 & 10 \\ +% 11 & 12 & 13 & 14 & 15 +% \end{NiceArray}\right) +% \end{BVerbatim} +% $\left(\begin{NiceArray}{cccc:c} +% 1 & 2 & 3 & 4 & 5 \\ +% 6 & 7 & 8 & 9 & 10 \\ +% 11 & 12 & 13 & 14 & 15 +% \end{NiceArray}\right)$ +% +% \end{itemize} +% +% +% %\section{The color of the rows and columns} % % \subsection{Use of colortbl} @@ -2092,9 +2100,6 @@ version 2005/12/01 or later. % % \label{varwidth} % -% \colorbox{yellow!50}{\textbf{New 6.3}} -% -% \smallskip % Let's recall first the behaviour of the environment |{varwidth}| of the % eponymous package \pkg{varwidth}. That environment is similar to the classical % environment |{minipage}| but the width provided in the argument is only the @@ -3168,8 +3173,6 @@ version 2005/12/01 or later. % \subsection{The commands \textbackslash OverBrace and \textbackslash % UnderBrace in the \textbackslash CodeAfter} % -% \colorbox{yellow!50}{\textbf{New 6.4}} -% % The commands |\OverBrace| and |\UnderBrace| provide a way to put % horizontal braces on a part of the array. These commands take in three % arguments: @@ -3347,6 +3350,12 @@ version 2005/12/01 or later. % the environment of \pkg{nicematrix}. Thus, it's possible to use it on the % title inserted by |\caption| in an environment |{table}| of LaTeX. % +% \colorbox{yellow!50}{\textbf{New 6.8}}\enskip If several commands +% |\tabularnote| are used in a tabular with the same argument, only one note is +% inserted at the end of the tabular (but all the labels are composed, of +% course). It's possible to control that feature with the key +% |notes/detect-duplicates|. +% % \item It's possible to create a reference to a tabular note created by |\tabularnote| % (with the usual command |\label| used after the |\tabularnote|). % \end{itemize} @@ -3370,11 +3379,11 @@ version 2005/12/01 or later. % Last name & First name & Length of life \\ % \midrule % Churchill & Wiston & 91\\ -% Nightingale~emphase#\tabularnote{Considered as the first nurse of! -% ~emphase#history.}\tabularnote{Nicknamed ``the Lady with the Lamp''.}! -% & Florence & 90 \\ +% Nightingale~emphase#\tabularnote{Considered as the first nurse of history}! +% ~emphase#\tabularnote{Nicknamed ``the Lady with the Lamp''.}! +% & Florence~emphase#\tabularnote{This note is shared by two references.}! & 90 \\ % Schoelcher & Victor & 89~emphase#\tabularnote{The label of the note is overlapping.}!\\ -% Touchet & Marie & 89 \\ +% Touchet & Marie~emphase#\tabularnote{This note is shared by two references.}! & 89 \\ % Wallis & John & 87 \\ % \bottomrule % \end{NiceTabular} @@ -3397,9 +3406,9 @@ version 2005/12/01 or later. % Churchill & Wiston & 91\\ % Nightingale\tabularnote{Considered as the first nurse of % history.}\tabularnote{Nicknamed ``the Lady with the Lamp''.} -% & Florence & 90 \\ +% & Florence\tabularnote{This note is shared by two references.} & 90 \\ % Schoelcher & Victor & 89\tabularnote{The label of the note is overlapping.}\\ -% Touchet & Marie & 89 \\ +% Touchet & Marie\tabularnote{This note is shared by two references.} & 89 \\ % Wallis & John & 87 \\ % \bottomrule % \end{NiceTabular} @@ -3549,12 +3558,10 @@ version 2005/12/01 or later. % It's also possible to add |\raggedright| or |\RaggedRight| in that key (|\RaggedRight| % is a command of \pkg{ragged2e}). % -% \item \colorbox{yellow!50}{\textbf{New 6.8}}\enskip Since the version 6.8, the -% duplicates in the notes of a tabular are detected by default: if several -% commands |\tabularnote| are used in a tabular with the same argument, only one -% note is inserted at the end of the tabular (but all the labels are composed, -% of course). It's possible to de-activate that feature with the key -% |notes/detect-duplicates| (whose initial value is |true|). +% \item The key |notes/detect-duplicates| activates the detection of the commands +% |\tabularnotes| with the same argument. +% +% Initial value : |true| % \end{itemize} % % @@ -11061,12 +11068,16 @@ version 2005/12/01 or later. % by LaTeX for incorrect nested environments). % \begin{macrocode} { - \peek_meaning_ignore_spaces:NTF \end \@@_analyze_end:Nn + \peek_remove_spaces:n + { + \peek_meaning:NTF \end + \@@_analyze_end:Nn % \end{macrocode} % Here is the call to |\array| (we have a dedicated macro |\@@_array:| because % of compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}). % \begin{macrocode} - { \exp_args:NV \@@_array: \g_@@_preamble_tl } + { \exp_args:NV \@@_array: \g_@@_preamble_tl } + } } { \@@_create_col_nodes: @@ -13926,6 +13937,7 @@ version 2005/12/01 or later. % \begin{macrocode} \NewDocumentCommand \@@_RowStyle:n { O { } m } { + \tl_clear:N \l_tmpa_tl \keys_set:nn { NiceMatrix / RowStyle } { #1 } % \end{macrocode} % If the key |rowcolor| has been used. @@ -15321,9 +15333,12 @@ version 2005/12/01 or later. % \begin{macrocode} \cs_set:Npn \@@_Hline_i:n #1 { - \peek_meaning_ignore_spaces:NTF \Hline - { \@@_Hline_ii:nn { #1 + 1 } } - { \@@_Hline_iii:n { #1 } } + \peek_remove_spaces:n + { + \peek_meaning:NTF \Hline + { \@@_Hline_ii:nn { #1 + 1 } } + { \@@_Hline_iii:n { #1 } } + } } % \end{macrocode} % diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf Binary files differindex 3629b4506a..b09ef2e986 100644 --- a/macros/latex/contrib/nicematrix/nicematrix.pdf +++ b/macros/latex/contrib/nicematrix/nicematrix.pdf diff --git a/macros/latex/contrib/simplebnf/simplebnf-doc.pdf b/macros/latex/contrib/simplebnf/simplebnf-doc.pdf Binary files differindex 1285776fe6..fb80c407fb 100644 --- a/macros/latex/contrib/simplebnf/simplebnf-doc.pdf +++ b/macros/latex/contrib/simplebnf/simplebnf-doc.pdf diff --git a/macros/latex/contrib/simplebnf/simplebnf-doc.tex b/macros/latex/contrib/simplebnf/simplebnf-doc.tex index 62d6cba868..30ea889f18 100644 --- a/macros/latex/contrib/simplebnf/simplebnf-doc.tex +++ b/macros/latex/contrib/simplebnf/simplebnf-doc.tex @@ -8,7 +8,7 @@ \tcbset{listing engine=listings,colframe=black,colback=white,size=small} \NewDocumentEnvironment {exampleside} {} - { \tcblisting{listing side text,righthand width=.5\textwidth} } + { \tcblisting{listing side text,righthand width=.55\textwidth} } { \endtcblisting } \NewDocumentCommand \cmd { m } {\texttt{\textbackslash#1}} @@ -32,10 +32,10 @@ \title{% \textsf{simplebnf} --- A simple package to format Backus-Naur form% - \footnote{This file describes v0.2.0.}} + \footnote{This file describes v0.3.0.}} \author{Jay Lee\footnote{E-mail: % \href{mailto:jaeho.lee@snu.ac.kr}{\texttt{jaeho.lee@snu.ac.kr}}}} -\date{2020/09/01} +\date{2022/05/07} \begin{document} \maketitle @@ -64,6 +64,8 @@ where each of the \textit{rhs} represents alternative syntactic forms of the \te A sample code and the result is shown below: \begin{exampleside} \begin{bnfgrammar} + a \in \textit{Vars} + ;; expr ::= expr + term : sum | term : term @@ -73,4 +75,58 @@ A sample code and the result is shown below: | a : variable \end{bnfgrammar} \end{exampleside} -\end{document}
\ No newline at end of file + +Annotations can also be provided on left-hand sides, to label the nonterminal instead of a specific production. +\begin{exampleside} + \begin{bnfgrammar} + a : Variables \in \textit{Vars} + ;; + expr : Expressions ::= + expr + term + | term + ;; + term ::= + term * a + | a + \end{bnfgrammar} +\end{exampleside} + +You can also provide an optional specification to the grammar environment, to redefine alignment or spacing. +\begin{tcblisting}{text above listing} + \begin{bnfgrammar}[lr@{\hspace{4pt}}c@{\hspace{2pt}}ll] + a : Variables \in \textit{Vars} + ;; + expr ::= + expr + term : sum + | term : term + ;; + term ::= + term * a : product + | a : variable + \end{bnfgrammar} +\end{tcblisting} + +If you want to typeset multiple productions on a single line, you can use double vertical bars by default. +\begin{exampleside} + \begin{bnfgrammar} + a \in \textit{Vars} + ;; + expr ::= expr + term || term + ;; + term ::= term * a || a + \end{bnfgrammar} +\end{exampleside} + +The second and third optional arguments specify regular expressions for the line-breaking and non-breaking RHS seperators: +\begin{tcblisting}{text above listing} + \begin{bnfgrammar}[llcll][\|\|][\|] + a \in \textit{Vars} + ;; + expr ::= expr + term | term + ;; + term ::= term * a + || a + \end{bnfgrammar} +\end{tcblisting} + +\end{document} diff --git a/macros/latex/contrib/simplebnf/simplebnf.sty b/macros/latex/contrib/simplebnf/simplebnf.sty index a8ae523036..fd7b707ff7 100644 --- a/macros/latex/contrib/simplebnf/simplebnf.sty +++ b/macros/latex/contrib/simplebnf/simplebnf.sty @@ -13,11 +13,13 @@ \RequirePackage{mathtools} \ProvidesExplPackage {simplebnf} - {2020/09/01} - {0.2.0} + {2022/05/07} + {0.3.0} {A simple package to format Backus–Naur form} -\cs_generate_variant:Nn \seq_set_split:Nnn {NVn} +\cs_generate_variant:Nn \regex_split:nnNTF {nVNTF} +\cs_generate_variant:Nn \regex_split:NnN {NVN} + \tl_new:N \g__simplebnf_defeq_tl \tl_gset:Nn \g__simplebnf_defeq_tl { \ensuremath{\Coloneqq} } @@ -32,6 +34,9 @@ \seq_new:N \l__keypairs_seq \bool_new:N \l__first_rhs +\regex_new:N \g_simplebnf_rhs_newline_r +\regex_new:N \g_simplebnf_rhs_nb_r + %% Typeset a single rhs of a production. %% \l__first_rhs = true => `::=' already typeset %% \l__first_rhs = false => move to a newline and typeset `|' @@ -43,15 +48,18 @@ \bool_set_false:N \l__first_rhs } { - \tl_put_right:Nn \l__table_tl { \\ & \g__simplebnf_defor_tl & } + \tl_put_right:Nn \l__table_tl { \\ && \g__simplebnf_defor_tl & } } - \regex_split:nnNTF { : } { #1 } \l_tmpa_seq + \tl_set:Nn \l_tmpa_tl { #1 } + \regex_replace_once:nnN { ^\s+ } {} \l_tmpa_tl + \regex_replace_once:nnN { \s+$ } {} \l_tmpa_tl + \regex_split:nVNTF { : } \l_tmpa_tl \l_tmpa_seq { \seq_pop_left:NNT \l_tmpa_seq \l_tmpa_tl { - \tl_set:Nx \l_tmpa_tl { \bnfexpr { \l_tmpa_tl } } - \tl_put_right:NV \l__table_tl \l_tmpa_tl + \regex_replace_all:NnN \g_simplebnf_rhs_nb_r { \c{g__simplebnf_defor_tl} } \l_tmpa_tl + \tl_put_right:Nx \l__table_tl { \bnfexpr { \l_tmpa_tl } } } \tl_put_right:Nn \l__table_tl { & } @@ -63,34 +71,67 @@ } } { - \tl_put_right:Nn \l__table_tl { \bnfexpr { #1 } &} + \regex_replace_all:NnN \g_simplebnf_rhs_nb_r { \c{g__simplebnf_defor_tl} } \l_tmpa_tl + + \tl_put_right:Nx \l__table_tl { \bnfexpr { \l_tmpa_tl } } + \tl_put_right:Nn \l__table_tl { & } + } +} + +%% Typeset a single lhs of a production. +%% #1 - lhs : either term or (term : annotation) +\cs_new:Nn \simplebnf_typeset_lhs:n +{ + \tl_set:Nx \l_tmpa_tl { #1 } + \regex_replace_once:nnN { ^\s+ } {} \l_tmpa_tl + \regex_replace_once:nnN { \s+$ } {} \l_tmpa_tl + + \regex_split:nVNTF { : } \l_tmpa_tl \l_tmpa_seq + { + \seq_pop_right:NN \l_tmpa_seq \l_tmpa_tl + \tl_put_right:Nx \l__table_tl + { + \bnfannot{\l_tmpa_tl} + } + \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl + \tl_put_right:Nx \l__table_tl + { + & \bnfexpr { \l_tmpa_tl } + } + } + { + \tl_put_right:Nx \l__table_tl + { + & \bnfexpr { \l_tmpa_tl } + } } } \NewDocumentCommand \bnfexpr { m } { \texttt { #1 } } \NewDocumentCommand \bnfannot { m } { \textit{ #1 } } -\NewDocumentEnvironment { bnfgrammar } { +b } +%% Typeset a BNF grammar. +%% #1 - tabular specification (llcll) +%% #2 - regexp for newline separator for rhses +%% #2 - regexp for non-breaking separator for rhses +%% #3 - grammar +\NewDocumentEnvironment { bnfgrammar } { O{llcll} O{[^\|]\|[^\|]} O{\|\|} +b } { + \regex_gset:Nn \g_simplebnf_rhs_newline_r { #2 } + \regex_gset:Nn \g_simplebnf_rhs_nb_r { #3 } + %% \l__input_seq is a list of term definitions. - \regex_split:nnN { ;; } { #1 } \l__input_seq + \regex_split:nnN { ;; } { #4 } \l__input_seq \begin{center} \tl_set:Nn \l__table_tl { - \begin{tabular}{lcll} + \begin{tabular}{#1} } + \bool_set_true:N \l_tmp_first_term % Is this the first term in this grammar? \seq_map_inline:Nn \l__input_seq { - %% \l__term_seq - (term, rhses)... - %% \l__term_tl - term - %% \l__keypairs_tl - rhses - \regex_split:nnN { ::= } { ##1 } \l__term_seq - \seq_pop_left:NN \l__term_seq \l__term_tl - \seq_pop_left:NN \l__term_seq \l__keypairs_tl - - \regex_replace_once:nnN { ^\s+ } {} \l__term_tl - + %% If not-first, add newline \bool_if:NTF \l_tmp_first_term { \bool_set_false:N \l_tmp_first_term @@ -98,15 +139,48 @@ { \tl_put_right:Nn \l__table_tl { \\ } } - \tl_put_right:Nx \l__table_tl + + \regex_split:nnNTF { ::= } { ##1 } \l__term_seq + % Parse a ::= definition { - \bnfexpr { \l__term_tl } & \g__simplebnf_defeq_tl & + %% \l__term_seq - (lhs, rhses)... + %% \l__term_tl - lhs + %% \l__keypairs_tl - rhses + \seq_pop_left:NN \l__term_seq \l__term_tl + \seq_pop_left:NN \l__term_seq \l__keypairs_tl + + \simplebnf_typeset_lhs:n{\l__term_tl} + \tl_put_right:Nx \l__table_tl + { + & \g__simplebnf_defeq_tl & + } + %% \l__keypairs_seq - (rhs:annot | rhs)... + \regex_split:NVN \g_simplebnf_rhs_newline_r \l__keypairs_tl \l__keypairs_seq + + \bool_set_true:N \l__first_rhs + \seq_map_function:NN \l__keypairs_seq \simplebnf_typeset_rhs:n } - %% \l__keypairs_seq - (rhs:annot | rhs)... - \seq_set_split:NnV \l__keypairs_seq { | } \l__keypairs_tl + { + % Else, parse a \in declaration + \regex_split:nnNTF { \c{in} } { ##1 } \l__term_seq + { + %% \l__term_seq - (lhs, rhs) + \seq_pop_left:NN \l__term_seq \l_tmpa_tl - \bool_set_true:N \l__first_rhs - \seq_map_function:NN \l__keypairs_seq \simplebnf_typeset_rhs:n + \simplebnf_typeset_lhs:n{\l_tmpa_tl} + \tl_put_right:Nn \l__table_tl + { + & $\in$ & $ + } + \seq_pop_left:NN \l__term_seq \l_tmpa_tl + \tl_put_right:NV \l__table_tl \l_tmpa_tl + \tl_put_right:Nn \l__table_tl + { + $ & + } + } + { \msg_error:nn {simplebnf} { Could not parser ##1 } } + } } \tl_put_right:Nn \l__table_tl { \end{tabular} } |