summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-17 03:04:58 +0000
committerNorbert Preining <norbert@preining.info>2022-10-17 03:04:58 +0000
commit95ebee51840c21223810acf500805000a2c5c0df (patch)
treea6ef2119e3a7e72ed073de7c4963850236e3f897 /macros
parent84ccc4dcda9db6735202d4ed21610de28392e708 (diff)
CTAN sync 202210170304
Diffstat (limited to 'macros')
-rw-r--r--macros/eplain/doc/ChangeLog9
-rw-r--r--macros/eplain/doc/NEWS6
-rw-r--r--macros/eplain/doc/eplain.12
-rw-r--r--macros/eplain/doc/eplain.html4
-rw-r--r--macros/eplain/doc/eplain.info4
-rw-r--r--macros/eplain/doc/eplain.man1.pdfbin18523 -> 18523 bytes
-rw-r--r--macros/eplain/doc/eplain.pdfbin758051 -> 775348 bytes
-rw-r--r--macros/eplain/source/xeplain.tex5
-rw-r--r--macros/eplain/tex/eplain.tex9
-rw-r--r--macros/latex/contrib/docshots/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/docshots/README.md20
-rw-r--r--macros/latex/contrib/docshots/docshots.dtx248
-rw-r--r--macros/latex/contrib/docshots/docshots.pdfbin279951 -> 292815 bytes
-rw-r--r--macros/latex/contrib/frenchmath/frenchmath.dtx229
-rw-r--r--macros/latex/contrib/frenchmath/frenchmath.ins4
-rw-r--r--macros/latex/contrib/frenchmath/frenchmath.pdfbin477979 -> 479690 bytes
-rw-r--r--macros/latex/contrib/huaz/README23
-rw-r--r--macros/latex/contrib/huaz/huaz.pdfbin0 -> 327838 bytes
-rw-r--r--macros/latex/contrib/huaz/huaz.sty519
-rw-r--r--macros/latex/contrib/huaz/huaz.tex381
-rw-r--r--macros/luatex/generic/lutabulartools/README.md2
-rw-r--r--macros/luatex/generic/lutabulartools/lutabulartools.lua76
-rw-r--r--macros/luatex/generic/lutabulartools/lutabulartools.pdfbin82578 -> 105162 bytes
-rw-r--r--macros/luatex/generic/lutabulartools/lutabulartools.sty80
-rw-r--r--macros/luatex/generic/lutabulartools/lutabulartools.tex151
25 files changed, 1528 insertions, 245 deletions
diff --git a/macros/eplain/doc/ChangeLog b/macros/eplain/doc/ChangeLog
index ae2413996d..b96c04fd0a 100644
--- a/macros/eplain/doc/ChangeLog
+++ b/macros/eplain/doc/ChangeLog
@@ -1,3 +1,12 @@
+2022-10-16 Karl Berry <karl@freefriends.org>
+
+ * NEWS,
+ * Makefile (version): 3.13
+ * doc/eplain.texi: 3.13, still October 2022.
+ * xeplain.tex (\@gobbleminus): restore accidentally commented-out
+ definition, causing toc processing to fail.
+ https://tug.org/pipermail/tex-eplain/2022/001057.html
+
2022-10-02 Karl Berry <karl@freefriends.org>
* NEWS,
diff --git a/macros/eplain/doc/NEWS b/macros/eplain/doc/NEWS
index 9b144ca60e..b9277cd72f 100644
--- a/macros/eplain/doc/NEWS
+++ b/macros/eplain/doc/NEWS
@@ -1,6 +1,10 @@
-$Id: NEWS 61 2022-10-05 22:43:49Z karl $
+$Id: NEWS 63 2022-10-16 16:56:05Z karl $
This file records noteworthy changes. This file is public domain.
+ 3.13 (16 October 2022)
+* Fix dumb bug in 3.12 making toc processing fail (\@gobbleminus
+ definition was lost).
+
3.12 (5 October 2022)
* btxmac.tex: avoid use of \cs control sequence, conflicts with tugboat.sty.
* iftex.sty: use this instead of the now-obsolete ifpdf.sty.
diff --git a/macros/eplain/doc/eplain.1 b/macros/eplain/doc/eplain.1
index c7c34ba4f3..6915e9a262 100644
--- a/macros/eplain/doc/eplain.1
+++ b/macros/eplain/doc/eplain.1
@@ -1,4 +1,4 @@
-.TH EPLAIN 1 "2 October 2022" "Eplain 3.12"
+.TH EPLAIN 1 "2 October 2022" "Eplain 3.13"
.\"=====================================================================
.if t .ds TX \fRT\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X\fP
.if n .ds TX TeX
diff --git a/macros/eplain/doc/eplain.html b/macros/eplain/doc/eplain.html
index 7e7da4278c..ea8b83ce35 100644
--- a/macros/eplain/doc/eplain.html
+++ b/macros/eplain/doc/eplain.html
@@ -3,7 +3,7 @@
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<!-- This manual documents the Eplain macros, version 3.12,
+<!-- This manual documents the Eplain macros, version 3.13,
October 2022. Eplain provides functionality for plain TeX that
is intended to be useful regardless of how your document is actually
formatted.
@@ -70,7 +70,7 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a
</div>
<span id="Eplain"></span><h1 class="top">Eplain</h1>
-<p>This manual documents the Eplain macros, version 3.12,
+<p>This manual documents the Eplain macros, version 3.13,
October 2022. Eplain provides functionality for plain TeX that
is intended to be useful regardless of how your document is actually
formatted.
diff --git a/macros/eplain/doc/eplain.info b/macros/eplain/doc/eplain.info
index e08f2e2cdf..65fdb04c41 100644
--- a/macros/eplain/doc/eplain.info
+++ b/macros/eplain/doc/eplain.info
@@ -1,6 +1,6 @@
This is eplain.info, produced by makeinfo version 6.8 from eplain.texi.
-This manual documents the Eplain macros, version 3.12, October 2022.
+This manual documents the Eplain macros, version 3.13, October 2022.
Eplain provides functionality for plain TeX that is intended to be
useful regardless of how your document is actually formatted.
@@ -21,7 +21,7 @@ File: eplain.info, Node: Top, Next: Introduction, Up: (dir)
Eplain
******
-This manual documents the Eplain macros, version 3.12, October 2022.
+This manual documents the Eplain macros, version 3.13, October 2022.
Eplain provides functionality for plain TeX that is intended to be
useful regardless of how your document is actually formatted.
diff --git a/macros/eplain/doc/eplain.man1.pdf b/macros/eplain/doc/eplain.man1.pdf
index 802e7af2ae..7b67e4f17d 100644
--- a/macros/eplain/doc/eplain.man1.pdf
+++ b/macros/eplain/doc/eplain.man1.pdf
Binary files differ
diff --git a/macros/eplain/doc/eplain.pdf b/macros/eplain/doc/eplain.pdf
index 6ed7f61624..cee0483061 100644
--- a/macros/eplain/doc/eplain.pdf
+++ b/macros/eplain/doc/eplain.pdf
Binary files differ
diff --git a/macros/eplain/source/xeplain.tex b/macros/eplain/source/xeplain.tex
index c30fb6c01d..0436a828ca 100644
--- a/macros/eplain/source/xeplain.tex
+++ b/macros/eplain/source/xeplain.tex
@@ -1,4 +1,4 @@
-% $Id: xeplain.tex 60 2022-10-05 22:42:54Z karl $
+% $Id: xeplain.tex 62 2022-10-16 16:55:24Z karl $
% xeplain.tex: macros for nonformatting. Written 1989--94 by (mostly)
% Karl Berry. Some additions/changes 1997--98 by Adam Lewenberg,
% with subsequent contributions from many people.
@@ -125,7 +125,8 @@
\def\@@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}%
%
% True if #1 is an integer. From the UK List of TeX Frequently Asked
-% Questions, https://texfaq.org.\def\@gobbleminus#1{\ifx-#1\else#1\fi}%
+% Questions, https://texfaq.org.
+\def\@gobbleminus#1{\ifx-#1\else#1\fi}%
\def\ifinteger#1{\ifcat_\ifnum9<1\@gobbleminus#1 _\else A\fi}%
% This is a convenience to be used in places where TeX might be
% skipping tokens, e.g., in conditionals. Usage:
diff --git a/macros/eplain/tex/eplain.tex b/macros/eplain/tex/eplain.tex
index 4a9a775e0f..4037a3153f 100644
--- a/macros/eplain/tex/eplain.tex
+++ b/macros/eplain/tex/eplain.tex
@@ -1,10 +1,10 @@
%% @texfile{
%% author = "Karl Berry, Steven Smith, Oleg Katsitadze, and others",
-%% version = "3.12",
-%% date = "Wed Oct 5 15:43:01 PDT 2022",
+%% version = "3.13",
+%% date = "Sun Oct 16 09:55:26 PDT 2022",
%% filename = "eplain.tex",
%% email = "tex-eplain@tug.org",
-%% checksum = "4290 9524 139018",
+%% checksum = "4291 9525 139058",
%% codetable = "ASCII",
%% supported = "yes",
%% docstring = "This file defines macros that extend and expand on
@@ -253,6 +253,7 @@ end
\def\@emptymarkA{\@emptymarkB}
\def\ifempty#1{\@@ifempty #1\@emptymarkA\@emptymarkB}%
\def\@@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}%
+\def\@gobbleminus#1{\ifx-#1\else#1\fi}%
\def\ifinteger#1{\ifcat_\ifnum9<1\@gobbleminus#1 _\else A\fi}%
\def\isinteger{TT\fi\ifinteger}%
\def\@gobblemeaning#1:->{}%
@@ -4286,5 +4287,5 @@ end
\def\fmtname{eplain}%
\def\eplain{t}%
{\edef\plainversion{\fmtversion}%
- \xdef\fmtversion{3.12: 5 October 2022 (and plain \plainversion)}%
+ \xdef\fmtversion{3.13: 16 October 2022 (and plain \plainversion)}%
}%
diff --git a/macros/latex/contrib/docshots/DEPENDS.txt b/macros/latex/contrib/docshots/DEPENDS.txt
index d8361a6695..194336badc 100644
--- a/macros/latex/contrib/docshots/DEPENDS.txt
+++ b/macros/latex/contrib/docshots/DEPENDS.txt
@@ -3,3 +3,4 @@ hard fancyvrb
hard pdfcrop
hard pgf
hard pgf-blur
+hard pgfopts
diff --git a/macros/latex/contrib/docshots/README.md b/macros/latex/contrib/docshots/README.md
index 6201451a88..3e8327ed79 100644
--- a/macros/latex/contrib/docshots/README.md
+++ b/macros/latex/contrib/docshots/README.md
@@ -2,20 +2,22 @@
[![CTAN](https://img.shields.io/ctan/v/docshots)](https://ctan.org/pkg/docshots)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/docshots/blob/master/LICENSE.txt)
-This LaTeX package helps you add PDF snapshots to DTX documentation.
+This LaTeX package helps you show TeX code next to their PDF snapshots,
+in two-column formatting. You can use it either in `.dtx` documentation
+or in `.tex` file.
First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)
from [CTAN](https://ctan.org/pkg/docshots)
-and then use in DTX:
+and then use like this:
```tex
-% \begin{docshot}
-% \documentclass{article}
-% \pagestyle{empty}
-% \begin{document}
-% Hello, \LaTeX!
-% \end{document}
-% \end{docshot}
+\begin{docshot}
+\documentclass{article}
+\pagestyle{empty}
+\begin{document}
+ Hello, \LaTeX!
+\end{document}
+\end{docshot}
```
If you want to contribute yourself, make a fork, then create a branch,
diff --git a/macros/latex/contrib/docshots/docshots.dtx b/macros/latex/contrib/docshots/docshots.dtx
index 3fa5c9ac13..65eade188b 100644
--- a/macros/latex/contrib/docshots/docshots.dtx
+++ b/macros/latex/contrib/docshots/docshots.dtx
@@ -50,14 +50,15 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{docshots}
%<*package>
-[2022-10-14 0.0.1 TeX Samples Next to Their PDF Snapshots in DTX]
+[2022-10-16 0.0.2 TeX Samples Next to Their PDF Snapshots in DTX]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage[tt=false, type1=true]{libertine}
\usepackage{microtype}
-\usepackage{docshots}
+\usepackage[dtx]{docshots}
\usepackage{href-ul}
+\usepackage{xcolor}
\PageIndex
\EnableCrossrefs
\CodelineIndex
@@ -70,46 +71,63 @@
%</driver>
% \fi
-% \title{|docshots|: \TeX{} Samples Next to Their \\ PDF Snapshots in DTX\thanks{The sources are in GitHub at \href{https://github.com/yegor256/docshots}{yegor256/docshots}}}
+% \title{|docshots|: \LaTeX{} Package that Renders \\ \TeX{} Samples Next to Their \\ PDF Snapshots\thanks{The sources are in GitHub at \href{https://github.com/yegor256/docshots}{yegor256/docshots}}}
% \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}}
% \date{\filedate, \fileversion}
%
% \maketitle
%
-% \textbf{NB!}
+% \textbf{\color{red}NB!}
% You must run \TeX{} processor with |--shell-escape| option
-% and you must have \href{https://www.perl.org}{Perl} installed.
+% and you must have
+% \href{...}{pdflatex},
+% \href{https://www.perl.org}{Perl},
+% \href{...}{Ghostscript},
+% and \href{https://ctan.org/pkg/pdfcrop}{pdfcrop}
+% installed.
% \section{Introduction}
%
-% You put this into your |.dtx| file:
-%
-% \vspace{0pt}\begingroup\ttfamily\noindent
-% \% \char`\\begin\char`\{docshot\char`\} \\
-% \% \char`\\documentclass\char`\{article\char`\} \\
-% \% \char`\\begin\char`\{document\char`\} \\
-% \% \char`\\pagestyle\char`\{empty\char`\} \\
-% \% ~~Hello, \char`\\LaTeX! \\
-% \% \char`\\end\char`\{document\char`\} \\
-% \% \char`\\end\char`\{docshot\char`\}
-% \endgroup\vspace{0pt}
-%
-% It will be rendered as such:
+% When you want to demonstrate to the readers of your documentation
+% how to use certain \TeX{} commands, the best way would be
+% to show exactly how the entire document will be rendered in PDF,
+% using a subprocess that would render it (via |pdflatex|, for example).
+% To my best knowledge, there were no packages that would allow
+% you do exactly this. That's why I created this simple package.
+% For example, this code:
%
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\begin{docshot}
+\documentclass{article}
+\usepackage{xcolor}
+\begin{document}
+\pagestyle{empty}
+ Hello, {\color{orange}\LaTeX}!
+\end{document}
+\end{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% is rendered as such:
% \begin{docshot}
% \documentclass{article}
+% \usepackage{xcolor}
% \begin{document}
% \pagestyle{empty}
-% Hello, \LaTeX!
+% Hello, {\color{orange}\LaTeX}!
% \end{document}
% \end{docshot}
% Here is a more complex example:
-%
% \begin{docshot}
% \documentclass{article}
% \usepackage{tikz}
-% \begin{document}\pagestyle{empty}
+% \begin{document}
+% \pagestyle{empty}
% \begin{tikzpicture}
% \node [circle,draw] (v0) {$v_0$};
% \node [circle,draw,
@@ -119,11 +137,118 @@
% \end{document}
% \end{docshot}
-% The pictures you see on the left sides are rendered by a subprocess
-% executing |pdflatex| with the |.tex| content taken from |dtx| file.
+% The picture you see on the left side is rendered by a subprocess
+% executing |pdflatex| with the |.tex| content taken from the source file.
% After a successful processing of \TeX{} sources, we use
-% \href{https://ctan.org/pkg/pdfcrop}{pdfcrop} to trim the document. Then,
-% the trimmed PDF is embedded into the final document.
+% \href{https://ctan.org/pkg/pdfcrop}{pdfcrop} to trim the document.
+
+% We execute |pdflatex| with |-interaction=batchmode| option. This means that
+% \TeX{} processing errors will be ignored as much as possible and the PDF
+% rendered may look not like you expect it to look. Check your \TeX{} log
+% to understand what may go wrong.
+
+% \section{Package Options}
+
+% \DescribeMacro{pdflatex}
+% The default command line tool for turning |.tex| into
+% |.pdf| is |pdflatex|. However, you can change that by using |pdflatex| package option,
+% for example:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\documentclass{article}
+\usepackage[pdflatex=/usr/local/bin/pdflatex]{docshot}
+\begin{document}
+\begin{docshot}
+Hello, world!
+\end{docshot}
+\end{document}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{gs}
+% The default location of Ghostscript is just |gs|.
+% You can change that by using |gs| package option,
+% for example:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[gs=/usr/bin/ghostscript]{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{pdfcrop}
+% The default location of |pdfcrop| is just |pdfcrop|.
+% You can change that by using |pdfcrop| package option,
+% for example:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[pdfcrop=/bin/pdfcrop]{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{margin}
+% When we crop the PDF rendered, we leave a margin around the content. The
+% default value may be changed by the package option |margin|:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[margin=10]{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{hspace}
+% The horizontal distance between the image and its verbatim \TeX{} source
+% may be configured via |hspace| package option:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[hspace=1em]{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{left}
+% \DescribeMacro{right}
+% The default width of the image may be changed by |left| option, while
+% the width of the verbatim \TeX{} source may be modified by |right| option:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[left=2in,right=.5\linewidth]{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{dtx}
+% If you use this package inside |.dtx| documentation, add |dtx| package option. Thanks
+% to this option all comment symbols will be removed from line starts:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\usepackage[dtx]{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
% \StopEventually{}
@@ -141,19 +266,44 @@
\usetikzlibrary{shadows.blur}
% \end{macrocode}
-% Then, we show the version of |pdflatex|:
+% Then, we process package options:
+% \begin{macrocode}
+\RequirePackage{pgfopts}
+\pgfkeys{
+ /docshots/.cd,
+ dtx/.store in=\docshots@dtx,
+ pdflatex/.store in=\docshots@pdflatex,
+ pdflatex/.default=pdflatex,
+ gs/.store in=\docshots@gs,
+ gs/.default=gs,
+ pdfcrop/.store in=\docshots@pdfcrop,
+ pdfcrop/.default=pdfcrop,
+ margin/.store in=\docshots@margin,
+ margin/.default=5,
+ hspace/.store in=\docshots@hspace,
+ hspace/.default=1.8em,
+ left/.store in=\docshots@left,
+ left/.default=.3\linewidth,
+ right/.store in=\docshots@right,
+ right/.default=.65\linewidth,
+ pdflatex,gs,pdfcrop,margin,hspace,left,right
+}
+\ProcessPgfOptions{/docshots}
+% \end{macrocode}
+
+% Then, we print the version of |pdflatex| to \TeX{} log:
% \begin{macrocode}
-\iexec[log,quiet]{pdflatex --version}%
+\iexec[log,quiet]{\docshots@pdflatex\space --version}%
% \end{macrocode}
-% Then, we show the version of |pdfcrop|:
+% Then, we print the version of \href{https://ctan.org/pkg/pdfcrop}{pdfcrop} to \TeX{} log:
% \begin{macrocode}
-\iexec[log,quiet]{pdfcrop --version}%
+\iexec[log,quiet]{\docshots@pdfcrop\space --version}%
% \end{macrocode}
-% Then, we show the version of |ghostscript|:
+% Then, we print the version of |ghostscript| to \TeX{} log:
% \begin{macrocode}
-\iexec[log,quiet]{gs --version}%
+\iexec[log,quiet]{\docshots@gs\space --version}%
% \end{macrocode}
% Then, we make a directory where all temporary files will be kept:
@@ -165,26 +315,36 @@
% Then, we define |docshot| environment:
% \begin{macrocode}
\newenvironment{docshot}
-{\VerbatimEnvironment\begin{VerbatimOut}{_docshots/\jobname/verbatim.tex}}
+{\VerbatimEnvironment\begin{VerbatimOut}
+ {_docshots/\jobname/verbatim.tex}}
{\end{VerbatimOut}%
- \iexec[null]{perl -i -0777pe "s/(\\n|^)\\x{25} /\\1/g"
- _docshots/\jobname/verbatim.tex}%
+ \ifdefined\docshots@dtx%
+ \iexec[null]{perl -i -0777pe "s/(\\n|^)\\x{25} /\\1/g"
+ _docshots/\jobname/verbatim.tex}%
+ \fi%
\def\hash{\pdfmdfivesum file {_docshots/\jobname/verbatim.tex}}%
- \message{^^Jdocshots: name set to "\hash"^^J}%
- \iexec[log,quiet]{cp _docshots/\jobname/verbatim.tex
- _docshots/\jobname/\hash.tex}%
- \iexec[log,quiet]{(cd _docshots/\jobname;
- pdflatex -interaction=batchmode -shell-escape \hash.tex)}%
- \iexec[log,quiet]{pdfcrop --margins 5 _docshots/\jobname/\hash.pdf
- _docshots/\jobname/\hash.crop.pdf}%
+ \IfFileExists{_docshots/\jobname/\hash.pdf}
+ {\message{won't render, the PDF already exists: _docshots/\jobname/\hash.pdf^^J}}
+ {\iexec[log,quiet]{cp _docshots/\jobname/verbatim.tex
+ _docshots/\jobname/\hash.tex}%
+ \iexec[log,quiet]{cd _docshots/\jobname;
+ \docshots@pdflatex\space -interaction=batchmode
+ -shell-escape \hash.tex}}%
+ \IfFileExists{_docshots/\jobname/\hash.crop.pdf}
+ {\message{won't pdfcrop, the PDF already exists: _docshots/\jobname/\hash.crop.pdf^^J}}
+ {\iexec[log,quiet]{\docshots@pdfcrop\space
+ --margins \docshots@margin\space
+ _docshots/\jobname/\hash.pdf
+ _docshots/\jobname/\hash.crop.pdf}}%
\fvset{frame=leftline,numbers=left,numbersep=3pt,
framerule=.4pt,rulecolor=\color{gray},
samepage=true}%
\par%
\tikz[baseline=(a.north)] \node[draw=gray] (a)
- {\includegraphics[width=.3\linewidth]{_docshots/\jobname/\hash.crop.pdf}};%
- \hspace{1.8em}%
- \begin{minipage}[t]{.65\linewidth}%
+ {\includegraphics[width=\docshots@left]
+ {_docshots/\jobname/\hash.crop.pdf}};%
+ \hspace{\docshots@hspace}%
+ \begin{minipage}[t]{\docshots@right}%
\vspace{0pt}%
\VerbatimInput{_docshots/\jobname/\hash.tex}%
\vspace{0pt}%
diff --git a/macros/latex/contrib/docshots/docshots.pdf b/macros/latex/contrib/docshots/docshots.pdf
index 402009aed3..4c03380bb6 100644
--- a/macros/latex/contrib/docshots/docshots.pdf
+++ b/macros/latex/contrib/docshots/docshots.pdf
Binary files differ
diff --git a/macros/latex/contrib/frenchmath/frenchmath.dtx b/macros/latex/contrib/frenchmath/frenchmath.dtx
index 14118159e0..6713dd75aa 100644
--- a/macros/latex/contrib/frenchmath/frenchmath.dtx
+++ b/macros/latex/contrib/frenchmath/frenchmath.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2019-2020 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+% Copyright (C) 2019-2022 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%
% This file may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -19,8 +19,8 @@
%</driver>
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{frenchmath}
- [2020/11/02 v1.5 .dtx frenchmath file]
+\ProvidesPackage{frenchmath}
+[2022/10/16 v1.6 .dtx frenchmath file]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -29,29 +29,30 @@
\usepackage[french]{babel}
\usepackage{lmodern}
\usepackage{frenchmath}
+\usepackage{upgreek}
% pour l'exemple de la doc on utilise \PV pour simuler le ; d'origine
-\DeclareMathSymbol{\PV}\mathpunct{UpSh}{059} % 059 = code du ;
-\DisableCrossrefs
+\DeclareMathSymbol{\PV}\mathpunct{operators}{'73} % '73 = code octal du ;
+\DisableCrossrefs
%\CodelineIndex
%\RecordChanges
\usepackage{hyperref}
\hypersetup{%
colorlinks,
- linkcolor=blue,
+ linkcolor=blue,
citecolor=blue,
- pdftitle={frenchmath},
- pdfsubject={LaTeX package},
+ pdftitle={frenchmath},
+ pdfsubject={LaTeX package},
pdfauthor={Antoine Missier}
}
\begin{document}
- \DocInput{frenchmath.dtx}
- %\PrintChanges
- %\PrintIndex
+\DocInput{frenchmath.dtx}
+%\PrintChanges
+%\PrintIndex
\end{document}
%</driver>
% \fi
%
-% \CheckSum{249}
+% \CheckSum{266}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -80,17 +81,20 @@
% \changes{v1.2}{27/04/2019}{capsrm -> capsup}
% \changes{v1.3}{15/05/2019}{Intégration de icomma et psset{comma=true},
% changements dans la documentation}
-% \changes{v1.4}{2019/05/22}{Changement de la définition de fonte up -> UpSh,
+% \changes{v1.4}{2019/05/22}{Changement de la définition de fonte up -> operators,
% car incompatibilité avec l'extension unicode-math}
% \changes{v1.5}{2020/11/02}{Ajout des macros étoilées pour les repères du plan et de l'espace
% et la base (i,j,k)}
+% \changes{v1.6}{2022/10/16}{Remplacement de icomma par ncccomma, grâce à une proposition
+% de Jean-François Burnol, amélioration du code redéfinissant les majuscules mathématiques,
+% remplacement de \backslash tgh par \th pour la tangente hyperbolique.}
%
% \GetFileInfo{frenchmath.sty}
%
% \title{L'extension \textsf{frenchmath}\thanks{Ce document
-% correspond à \textsf{frenchmath}~\fileversion, dernière modification le 02/11/2020.}}
+% correspond à \textsf{frenchmath}~\fileversion, dernière modification le 16/10/2022.}}
% \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}}
-% \date{2 novembre 2020}
+% \date{16 octobre 2022}
% \maketitle
%
% \section{Introduction}
@@ -100,18 +104,18 @@
% les majuscules en romain (lettres droites) plutôt qu'en italique
% (voir~\cite{RTIN} et~\cite{IGEN})
% ainsi que des espacements corrects
-% pour les virgules et point-virgules.
+% pour les virgules et point-virgules
+%\footnote{Merci à Jean-François Burnol pour différentes améliorations proposées au code.}.
%
% D'autres solutions pour composer les majuscules mathématiques en romain
% sont proposées dans les extensions \textsf{fourier}~\cite{FOUR}
% (avec la famille des polices Adobe Utopia)
% ou encore \textsf{mathdesign}~\cite{DESIGN} (avec les polices Adobe Utopia,
% URW Garamond ou Bitstream Charter). Mais \textsf{frenchmath}
-% fournit une méthode générique s'adaptant à n'importe quelle police, en particulier
-% Latin Modern (extension \textsf{lmodern}) avec laquelle ce document a été composé.
+% fournit une solution générique s'adaptant à n'importe quelle police.
%
% D'autres préconisations, telles que composer en lettre droite
-% et non en italique le symbole différentiel, les nombres i et e~\cite{IGEN},
+% et non en italique le symbole différentiel, les constantes mathématiques i et e~\cite{IGEN},
% sont des règles internationales~\cite{TYPMA}~\cite{ICTNS}~\cite{LSHORT}.
% Elles ne sont donc pas implémentées dans \textsf{frenchmath}
% \footnote{Nous proposons pour cela l'extension \textsf{mismath}~\cite{MIS}
@@ -121,7 +125,7 @@
% Quelques différences sont à signaler avec \textsf{mafr} :
% \begin{itemize}
% \item nous avons choisi de ne pas substituer les symboles français aux symboles anglo-saxons
-% avec le même nom de commande mais de créer de nouvelles commandes ;
+% avec le même nom de commande ;
% \item les macros présentées dans la section 2 qui correspondent à des macros de \textsf{mafr}
% sont signalées par un astérisque en fin d'item, les autres sont nouvelles ;
% \item enfin quelques commandes de \textsf{mafr} ne sont pas spécifiques
@@ -135,6 +139,7 @@
%
% Mentionnons aussi l'extension \textsf{tdsfrmath}~\cite{FRM} de Yvon Henel
% qui fournit beaucoup de commandes francisées.
+%
%
% \section{Utilisation}
%
@@ -147,25 +152,24 @@
% et peu d'auteurs la respectent.
% La mise en œuvre automatique de cette recommandation est le principal bénéfice
% de \textsf{frenchmath} (comme de \textsf{mafr}).
+% Par défaut |\[ P(X)=\sum_{i=0}^{n}a_i X^i \]| donne avec \textsf{frenchmath}
+% \[ P(X)=\sum_{i=0}^{n}a_i X^i \]
%
-% \medskip
-% \DescribeEnv{capsup, capsit}
-% L'extension \textsf{frenchmath} possède deux options : |capsup| (par défaut) et |capsit|.
-% Avec |capsit|, les majuscules du mode mathématique sont composées automatiquement
-% en italique et avec |capsup|
-% en forme droite (dans la famille de fonte par défaut, généralement romain).
-% Quelque soit l'option choisie, il est toujours possible de changer l'aspect
+% \DescribeEnv{capsit}
+% L'extension \textsf{frenchmath} possède une option : |capsit|,
+% qui permet de conserver la composition des majuscules du mode mathématique
+% en italique (dans la famille de fonte par défaut).
+% Que l'option soit activée ou pas, il est toujours possible de changer l'aspect
% d'une lettre particulière, avec les macros \LaTeX\ |\mathrm| et |\mathit|.
-% Par défaut |\[ P(X)=\sum_{i=0}^{n}a_i X^i \]| donne
-% \[ P(X)=\sum_{i=0}^{n}a_i X^i \]
%
% \subsection{Virgules et point-virgule}
% \StandardMathComma
% Dans le mode mathématique de \LaTeX, la virgule est toujours, par défaut,
-% un symbole de ponctuation qui sera donc suivi d'une espace.
+% un symbole de ponctuation et sera donc suivi d'une espace.
% Ceci est légitime dans un intervalle :
% |$[a,b]$| donne $[a,b]$, mais pas pour un nombre en français : |$12,5$| donne $12,5$
-% au lieu de \DecimalMathComma $12,5$.
+% \DecimalMathComma
+% au lieu de $12,5$.
% L'extension \textsf{babel}, avec l'option |french|~\cite{BABEL}, fournit deux bascules :
% |\DecimalMathComma| et |\StandardMathComma|, qui permettent d'adapter
% le comportement de la virgule du mode mathématique.
@@ -182,21 +186,22 @@
% (sans espace), sinon c'est un caractère de ponctuation.
% \end{itemize}
% Cette deuxième approche parait meilleure, néanmoins \textsf{ncccomma}
-% ne fonctionne pas avec l'extension \textsf{numprint}
-% lorsque celle-ci est chargée avec l'option \texttt{autolanguage}
-% \footnote{L'option \texttt{autolanguage} de \textsf{numprint} utilisé
+% ne fonctionne pas avec avec l'option \texttt{autolanguage}
+% \footnote{L'option \texttt{autolanguage} de \textsf{numprint} utilisée
% conjointement avec l'option \texttt{french} de \textsf{babel} garantit un espacement
% correct entre les groupes de trois chiffres dans les grands nombres,
% qui doit être une espace insécable et non dilatable~\cite{RTIN},
-% légèrement plus grand que l'espace que l'on obtient sans cette option.}.
-% Par contre \textsf{icomma} fonctionne mais à condition d'être chargé postérieurement.
-% Vu son intérêt cette extension est automatiquement chargée par \textsf{frenchmath}.
-% Il faudra donc prendre garde à appeler, dans le préambule, |\usepackage{frenchmath}|
-% \emph{après} un éventuel |\usepackage[autolanguage]{numprint}|.
+% légèrement plus grande que l'espace que l'on obtient sans cette option.}
+% de l'extension \textsf{numprint}.
+% Par contre \textsf{icomma} fonctionne et était utilisé
+% jusqu'à la version 1.5 de \textsf{frenchmath}.
+% Un code proposé par Jean-François Burnol permet, depuis la version 1.6, d'utiliser
+% \textsf{ncccomma} qui sera donc chargée par \textsf{frenchmath}
+% à la place de \textsf{icomma}.
%
% Mentionnons enfin l'article \emph{Intelligent commas} de Claudio Beccari~\cite{BECC}
-% qui propose une solution simplifiée par rapport à \textsf{ncccomma} mais qui
-% ne fonctionne pas mieux.
+% qui propose une solution simplifiée par rapport à \textsf{ncccomma} mais dont
+% l'avantage est discutable.
%
% \medskip
% Lorsque l'on utilise l'extension \textsf{pstricks-add} de \textsf{PSTricks}
@@ -211,11 +216,11 @@
% $x\in [0,25 \PV 3,75 ]$ sans \textsf{frenchmath} et $x\in [0,25; 3,75]$
% avec \textsf{frenchmath} ;
% le comportement de \og ;\fg devient identique à celui de \og:\fg
+% \StandardMathComma
% \footnote{Un autre problème d'espacement, non spécifique au français,
% se pose avec les délimiteurs $[$ et $]$,
-% par exemple $x \in ]0, \pi[$. Une solution est proposée
-% dans l'extension \textsf{mismath}.}.
-% \StandardMathComma
+% par exemple $x \in ]0, \uppi[$. L'extension \textsf{mismath}
+% fournit une solution à ce problème.}.
%
% \subsection{Quelques macros et alias utiles}
%
@@ -240,9 +245,6 @@
% \medskip
% \DescribeMacro{\vide}
% Le symbole $\vide$
-% \footnote{\LaTeX\ fournit la commande \texttt{\bslash o} qui compose
-% également un O barré, mais trop décalé vers le bas (pour l'ensemble vide) : $S=\o$,
-% alors qu'avec \texttt{\bslash vide} on obtient $S=\vide$.}
% s'obtient avec |\vide| (alias de |\varnothing| de l'extension \textsf{amssymb}) ;
% il diffère de la version anglaise
% obtenue avec |\emptyset| : $\emptyset$.*
@@ -263,7 +265,7 @@
% \medskip
% \DescribeMacro{\cmod}
% Bien que \LaTeX\ propose par défaut le modulo entre parenthèses, avec |\pmod|,
-% qui est d'usage en français, on peut vouloir composer un modulo entre crochets,
+% qui est standard aussi en français, on peut vouloir composer un modulo entre crochets,
% ce que permet la commande |\cmod| en respectant le bon espacement
% propre au modulo : $ 5 \equiv 53 \cmod{12}$.
%
@@ -275,7 +277,7 @@
% \footnote{Cette dernière n'est pas implémentée en standard dans \LaTeX\
% (mais dans \textsf{mismath}).}.
%
-% \newpage
+% \pagebreak
% \DescribeMacro{\card} \DescribeMacro{\Card}
% Pour le cardinal d'un ensemble, nous proposons |\card|, cité dans~\cite{RTIN} et \cite{AA},
% ou |\Card|, d'usage courant (cf. Wikipedia).
@@ -297,13 +299,16 @@
% et l'espace vectoriel engendré par une famille de vecteurs avec |\Vect|.
%
% \medskip
-% \DescribeMacro{\ch} \DescribeMacro{\sh} \DescribeMacro{\tgh}
-% En principe, les fonctions hyperboliques s'écrivent en français avec les macros \LaTeX\ standard
-% |\cosh, \sinh, \tanh| ; les écritures $\ch x$, $\sh x$ et $\tgh x$ ne sont la norme
+% \DescribeMacro{\ch} \DescribeMacro{\sh} \DescribeMacro{\th}
+% En principe, les fonctions hyperboliques s'écrivent en français
+% avec les macros \LaTeX\ standard |\cosh|, |\sinh|, |\tanh| ;
+% les écritures $\ch x$, $\sh x$ et $\th x$ ne sont la norme
% qu'avec les langues d'Europe de l'Est~\cite{COMP}, néanmoins ces écritures
% sont aussi utilisées en France~\cite{RTIN}.
-% On les obtient avec les commandes |\ch|, |\sh| et |\tgh|
-% \footnote{La commande \texttt{\bslash th} existe déjà et produit $\th$.}.
+% On les obtient avec les commandes |\ch|, |\sh| et |\th|
+% \footnote{La commande \texttt{\bslash th} existe déjà (pour le mode texte uniquement) ;
+% elle a été redéfinie, uniquement pour le mode mathématique, à la place
+% de l'ancienne commande \texttt{\bslash tgh}, désormais obsolète.}.
%
% \subsection{Bases et repères}
%
@@ -333,56 +338,62 @@
\RequirePackage{ifthen}
\newboolean{capsit}
\DeclareOption{capsit}{\setboolean{capsit}{true}}
-\DeclareOption{capsup}{\setboolean{capsit}{false}} % valeur par défaut
\ProcessOptions \relax
\RequirePackage{mathrsfs} % fournit les majuscules cursives
\RequirePackage{amssymb} % fournit \leqslant, \geqslant et \varnothing
\RequirePackage{amsopn} % fournit \DeclareMathOperator
\RequirePackage{xspace} % utile pour les commandes \curs, \ssi, \Oij
-\RequirePackage{icomma} % virgule intelligente
-
-\DeclareSymbolFont{UpSh}{\encodingdefault}{\familydefault}{m}{n}
+% \RequirePackage{icomma}
+\RequirePackage{ncccomma} % virgule intelligente
+\AtBeginDocument{\mathcode`\,="8000\relax
+ \@ifpackageloaded{babel}{\addto\extrasfrench{\mathcode`\,="8000\relax}}{}}
% \end{macrocode}
-% L'option \texttt{capsup} redéfinit toutes les lettres majuscules
+% Merci à J.F. Burnol pour ce patch permettant d'utiliser \textsf{ncccomma}
+% à la place de \textsf{icomma}, ainsi que pour l'amélioration du code ci-après,
+% redéfinissant les majuscules mathématiques.
+%
+% Sauf avec l'option \texttt{capsit}, on redéfinit toutes les lettres majuscules
% du mode mathématique ; |\AtBeginDocument| est nécessaire pour que
-% ces définitions soient prises en compte avec l'extension \textsf{beamer}.
+% ces définitions soient prises en compte avec la classe \textsf{beamer}
+% par exemple.
% \smallskip
% \begin{macrocode}
+
\ifthenelse{\boolean{capsit}}{}{\AtBeginDocument{
- \DeclareMathSymbol{A}\mathalpha{UpSh}{`A} %'A codage octal du A
- \DeclareMathSymbol{B}\mathalpha{UpSh}{`B}
- \DeclareMathSymbol{C}\mathalpha{UpSh}{`C}
- \DeclareMathSymbol{D}\mathalpha{UpSh}{`D}
- \DeclareMathSymbol{E}\mathalpha{UpSh}{`E}
- \DeclareMathSymbol{F}\mathalpha{UpSh}{`F}
- \DeclareMathSymbol{G}\mathalpha{UpSh}{`G}
- \DeclareMathSymbol{H}\mathalpha{UpSh}{`H}
- \DeclareMathSymbol{I}\mathalpha{UpSh}{`I}
- \DeclareMathSymbol{J}\mathalpha{UpSh}{`J}
- \DeclareMathSymbol{K}\mathalpha{UpSh}{`K}
- \DeclareMathSymbol{L}\mathalpha{UpSh}{`L}
- \DeclareMathSymbol{M}\mathalpha{UpSh}{`M}
- \DeclareMathSymbol{N}\mathalpha{UpSh}{`N}
- \DeclareMathSymbol{O}\mathalpha{UpSh}{`O}
- \DeclareMathSymbol{P}\mathalpha{UpSh}{`P}
- \DeclareMathSymbol{Q}\mathalpha{UpSh}{`Q}
- \DeclareMathSymbol{R}\mathalpha{UpSh}{`R}
- \DeclareMathSymbol{S}\mathalpha{UpSh}{`S}
- \DeclareMathSymbol{T}\mathalpha{UpSh}{`T}
- \DeclareMathSymbol{U}\mathalpha{UpSh}{`U}
- \DeclareMathSymbol{V}\mathalpha{UpSh}{`V}
- \DeclareMathSymbol{W}\mathalpha{UpSh}{`W}
- \DeclareMathSymbol{X}\mathalpha{UpSh}{`X}
- \DeclareMathSymbol{Y}\mathalpha{UpSh}{`Y}
- \DeclareMathSymbol{Z}\mathalpha{UpSh}{`Z}
-}}
+ \DeclareMathSymbol{A}\mathalpha{operators}{`A} %'A codage octal du A
+ \DeclareMathSymbol{B}\mathalpha{operators}{`B}
+ \DeclareMathSymbol{C}\mathalpha{operators}{`C}
+ \DeclareMathSymbol{D}\mathalpha{operators}{`D}
+ \DeclareMathSymbol{E}\mathalpha{operators}{`E}
+ \DeclareMathSymbol{F}\mathalpha{operators}{`F}
+ \DeclareMathSymbol{G}\mathalpha{operators}{`G}
+ \DeclareMathSymbol{H}\mathalpha{operators}{`H}
+ \DeclareMathSymbol{I}\mathalpha{operators}{`I}
+ \DeclareMathSymbol{J}\mathalpha{operators}{`J}
+ \DeclareMathSymbol{K}\mathalpha{operators}{`K}
+ \DeclareMathSymbol{L}\mathalpha{operators}{`L}
+ \DeclareMathSymbol{M}\mathalpha{operators}{`M}
+ \DeclareMathSymbol{N}\mathalpha{operators}{`N}
+ \DeclareMathSymbol{O}\mathalpha{operators}{`O}
+ \DeclareMathSymbol{P}\mathalpha{operators}{`P}
+ \DeclareMathSymbol{Q}\mathalpha{operators}{`Q}
+ \DeclareMathSymbol{R}\mathalpha{operators}{`R}
+ \DeclareMathSymbol{S}\mathalpha{operators}{`S}
+ \DeclareMathSymbol{T}\mathalpha{operators}{`T}
+ \DeclareMathSymbol{U}\mathalpha{operators}{`U}
+ \DeclareMathSymbol{V}\mathalpha{operators}{`V}
+ \DeclareMathSymbol{W}\mathalpha{operators}{`W}
+ \DeclareMathSymbol{X}\mathalpha{operators}{`X}
+ \DeclareMathSymbol{Y}\mathalpha{operators}{`Y}
+ \DeclareMathSymbol{Z}\mathalpha{operators}{`Z}
+ }}
+\DeclareMathSymbol{;}\mathbin{operators}{'73} % \mathpunct à l'origine
\AtBeginDocument{\@ifpackageloaded{pstricks-add}{\psset{comma=true}}{}}
-\DeclareMathSymbol{;}\mathbin{UpSh}{059} % \mathpunct à l'origine
\newcommand*\curs[1]{\ensuremath{\mathscr{#1}}\xspace}
-\newcommand\infeg{\leqslant}
-\newcommand\supeg{\geqslant}
+\newcommand\infeg{\leqslant}
+\newcommand\supeg{\geqslant}
\newcommand\vide{\varnothing}
\newcommand\paral{\mathrel{/\!\!/}} % \parallel existe déjà : ||
\newcommand\ssi{si, et seulement si,\xspace}
@@ -398,48 +409,49 @@
\DeclareMathOperator{\Vect}{\Vect}
\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\sh}{sh}
-\DeclareMathOperator{\tgh}{th} %\th existe déjà
+\AtBeginDocument{\let\oldth\th %\th existe déjà (mode texte uniquement)
+ \renewcommand{\th}{\TextOrMath{\oldth}{\mathop{\operatorfont th}}}
+}
+\PackageWarningNoLine{frenchmath}{
+ command \bslash tgh in now obsolete, use \bslash th instead
+}
\newcommand\@Oij{\ensuremath{
- \left(O, \vec{\imath}, \vec{\jmath}\,\right)
- }\xspace
+ \left(O, \vec{\imath}, \vec{\jmath}\,\right)}\xspace
}
\newcommand\@@Oij{\ensuremath{
- \left(O ; \vec{\imath}, \vec{\jmath}\,\right)
- }\xspace
+ \left(O ; \vec{\imath}, \vec{\jmath}\,\right)}\xspace
}
\newcommand\Oij{\@ifstar{\@@Oij}{\@Oij}}
\newcommand\@Oijk{\ensuremath{
- \left(O, \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
- \vec{\vphantom{t}\smash{k}}\,\right)
+ \left(O, \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
+ \vec{\vphantom{t}\smash{k}}\,\right)
}\xspace
}
\newcommand\@@Oijk{\ensuremath{
- \left(O ; \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
- \vec{\vphantom{t}\smash{k}}\,\right)
+ \left(O ; \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
+ \vec{\vphantom{t}\smash{k}}\,\right)
}\xspace
}
\newcommand\Oijk{\@ifstar{\@@Oijk}{\@Oijk}}
\newcommand\@Ouv{\ensuremath{
- \left(O, \vec{u}, \vec{v}\,\right)}\xspace
+ \left(O, \vec{u}, \vec{v}\,\right)}\xspace
}
\newcommand\@@Ouv{\ensuremath{
- \left(O ; \vec{u}, \vec{v}\,\right)}\xspace
+ \left(O ; \vec{u}, \vec{v}\,\right)}\xspace
}
\newcommand\Ouv{\@ifstar{\@@Ouv}{\@Ouv}}
\AtBeginDocument{\renewcommand\ij{\ensuremath{
- \left(\vec{\imath}, \vec{\jmath}\,\right)
- }\xspace
-}}
+ \left(\vec{\imath}, \vec{\jmath}\,\right)}\xspace
+ }}
\newcommand\ijk{\ensuremath{
- \left(\vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
- \vec{\vphantom{t}\smash{k}}\,\right)
+ \left(\vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
+ \vec{\vphantom{t}\smash{k}}\,\right)
}\xspace
}
-
% \end{macrocode}
%
% \begin{thebibliography}{19}
@@ -447,7 +459,8 @@
% Édition du 26/08/2002.
% \bibitem{IGEN} \emph{Composition des textes scientifiques}.
% Inspection générale de mathématiques (IGEN-DESCO), 06/12/2001.
-% \bibitem{AA} \emph{Règles françaises de typographie mathématique}. Alexandre André, 02/09/2015.
+% \bibitem{AA} \emph{Règles françaises de typographie mathématique}.
+% Alexandre André, 02/09/2015.
% \bibitem{ES} \emph{Le petit typographe rationnel}. Eddie Saudrais, 20/03/2000.
% \bibitem{ISO} \emph{Norme ISO 31-11: 1992 et sa révision ISO 80000-2: 2009 (extraits)}.
% http://aalem.free.fr/maths/mathematiques.pdf.
diff --git a/macros/latex/contrib/frenchmath/frenchmath.ins b/macros/latex/contrib/frenchmath/frenchmath.ins
index 54462b10dc..f5a146f156 100644
--- a/macros/latex/contrib/frenchmath/frenchmath.ins
+++ b/macros/latex/contrib/frenchmath/frenchmath.ins
@@ -1,5 +1,5 @@
%%
-%% Copyright (C) 2019-2020 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+%% Copyright (C) 2019-2022 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%%
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
@@ -21,7 +21,7 @@
This is a generated file.
-Copyright (C) 2019-2020 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+Copyright (C) 2019-2022 by Antoine Missier <antoine.missier@ac-toulouse.fr>
This file may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3 of this license
diff --git a/macros/latex/contrib/frenchmath/frenchmath.pdf b/macros/latex/contrib/frenchmath/frenchmath.pdf
index 9f96baf702..f51ddf7e49 100644
--- a/macros/latex/contrib/frenchmath/frenchmath.pdf
+++ b/macros/latex/contrib/frenchmath/frenchmath.pdf
Binary files differ
diff --git a/macros/latex/contrib/huaz/README b/macros/latex/contrib/huaz/README
new file mode 100644
index 0000000000..d0fcca51b4
--- /dev/null
+++ b/macros/latex/contrib/huaz/README
@@ -0,0 +1,23 @@
+huaz.sty package
+
+Copyright 2022 by Tibor Tómács
+
+Automatic definite articles for Hungarian
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Tibor Tomacs.
+
+This work consists of the files
+
+README (this file)
+huaz.sty (package file)
+huaz.tex and the derived file huaz.pdf (documentation). \ No newline at end of file
diff --git a/macros/latex/contrib/huaz/huaz.pdf b/macros/latex/contrib/huaz/huaz.pdf
new file mode 100644
index 0000000000..a9092fdb9d
--- /dev/null
+++ b/macros/latex/contrib/huaz/huaz.pdf
Binary files differ
diff --git a/macros/latex/contrib/huaz/huaz.sty b/macros/latex/contrib/huaz/huaz.sty
new file mode 100644
index 0000000000..c6b40e6f14
--- /dev/null
+++ b/macros/latex/contrib/huaz/huaz.sty
@@ -0,0 +1,519 @@
+%%
+%% `huaz.sty'
+%%
+%% Automatic Hungarian definite articles
+%%
+%% Copyright 2022 by Tibor Tomacs
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Tibor Tomacs.
+%%
+\NeedsTeXFormat{LaTeX2e}[2021/10/10]
+\ProvidesPackage{huaz}[2022/10/16 v1.0 Automatic Hungarian definite articles]
+
+\RequirePackage{xstring,refcount,iftex}
+
+\newif\ifhuaz@must@z@\huaz@must@z@false
+\newif\ifhuaz@must@oneunit@\huaz@must@oneunit@false
+\newif\ifhuaz@temp@if@\huaz@temp@if@false
+\newif\ifhuaz@show@\huaz@show@true
+
+\newcounter{huaz@temp@count}
+\newcounter{huaz@temp@count@}
+
+%=================================================
+%
+% utf8:
+% \huaz@list@A = ö,ü,ó,ő,ú,é,á,ű,í,Ö,Ü,Ó,Ő,Ú,É,Á,Ű,Í,Ä,À,Ã,Â,Ă,Å,Ą,Æ,ä,à,ã,â,ă,å,ą,æ,Ë,È,Ê,Ě,Ę,ë,è,ê,ě,ę,Ï,Í,Ì,Î,ï,ì,î,Ò,Õ,Ô,Ø,OE,ò,õ,ô,ø,Ù,Û,Ů,ù,û,ů
+% \huaz@list@X = Ĺ,Ł,ļ,ĺ,ł,Ņ,Ń,Ñ,Ň,Ŋ,ń,ñ,ň,ŋ,Ŗ,Ŕ,Ř,ŗ,ŕ,ř,Ş,Ș,Ś,Š,ş,ș,ś,š,Ÿ,Ý,ÿ,ý
+%
+% latin2:
+% \huaz@list@A = Ą,ą,Á,Â,Ă,Ä,É,Ę,Ë,Ě,Í,Î,Ó,Ô,Ő,Ö,Ů,Ú,Ű,Ü,á,â,ă,ä,é,ę,ë,ě,í
+% \huaz@list@X = Ľ,Ś,Š,Ş,ś,š,ş,Ŕ,Ĺ,Ń,Ň,Ř,Ý,ĺ
+%
+%=================================================
+
+\ifpdftex
+ \def\huaz@utfviii{utf8}
+ \ifx\inputencodingname\huaz@utfviii
+ \def\huaz@list@A{^^c3^^b6,^^c3^^bc,^^c3^^b3,^^c5^^91,^^c3^^ba,^^c3^^a9,^^c3^^a1,^^c5^^b1,^^c3^^ad,^^c3^^96,^^c3^^9c,^^c3^^93,^^c5^^90,^^c3^^9a,^^c3^^89,^^c3^^81,^^c5^^b0,^^c3^^8d,^^c3^^84,^^c3^^80,^^c3^^83,^^c3^^82,^^c4^^82,^^c3^^85,^^c4^^84,^^c3^^86,^^c3^^a4,^^c3^^a0,^^c3^^a3,^^c3^^a2,^^c4^^83,^^c3^^a5,^^c4^^85,^^c3^^a6,^^c3^^8b,^^c3^^88,^^c3^^8a,^^c4^^9a,^^c4^^98,^^c3^^ab,^^c3^^a8,^^c3^^aa,^^c4^^9b,^^c4^^99,^^c3^^8f,^^c3^^8d,^^c3^^8c,^^c3^^8e,^^c3^^af,^^c3^^ac,^^c3^^ae,^^c3^^92,^^c3^^95,^^c3^^94,^^c3^^98,^^4f^^45,^^c3^^b2,^^c3^^b5,^^c3^^b4,^^c3^^b8,^^c3^^99,^^c3^^9b,^^c5^^ae,^^c3^^b9,^^c3^^bb,^^c5^^af}
+ \def\huaz@list@X{^^c4^^b9,^^c5^^81,^^c4^^bc,^^c4^^ba,^^c5^^82,^^c5^^85,^^c5^^83,^^c3^^91,^^c5^^87,^^c5^^8a,^^c5^^84,^^c3^^b1,^^c5^^88,^^c5^^8b,^^c5^^96,^^c5^^94,^^c5^^98,^^c5^^97,^^c5^^95,^^c5^^99,^^c5^^9e,^^c8^^98,^^c5^^9a,^^c5^^a0,^^c5^^9f,^^c8^^99,^^c5^^9b,^^c5^^a1,^^c5^^b8,^^c3^^9d,^^c3^^bf,^^c3^^bd}
+ \huaz@must@oneunit@false
+ \fi
+ \def\huaz@latinii{latin2}
+ \ifx\inputencodingname\huaz@latinii
+ \def\huaz@list@A{^^a1,^^b1,^^c1,^^c2,^^c3,^^c4,^^c9,^^ca,^^cb,^^cc,^^cd,^^ce,^^d3,^^d4,^^d5,^^d6,^^d9,^^da,^^db,^^dc,^^e1,^^e2,^^e3,^^e4,^^e5,^^e9,^^ea,^^eb,^^ec,^^ed,^^ee,^^f3,^^f4,^^f5,^^f6,^^f9,^^fa,^^fb,^^fc}
+ \def\huaz@list@X{^^a3,^^a5,^^a6,^^a9,^^aa,^^b3,^^b6,^^b9,^^ba,^^c0,^^c5,^^d1,^^d2,^^d8,^^dd,^^df,^^e0,^^f1,^^f2,^^f8,^^fd}
+ \huaz@must@oneunit@true
+ \fi
+ \ifx\inputencodingname\huaz@utfviii\else
+ \ifx\inputencodingname\huaz@latinii\else
+ \PackageError{huaz}{You should use utf8 or latin2 inputenc}{}
+ \fi
+ \fi
+\else
+ \def\huaz@list@A{^^^^00f6,^^^^00fc,^^^^00f3,^^^^0151,^^^^00fa,^^^^00e9,^^^^00e1,^^^^0171,^^^^00ed,^^^^00d6,^^^^00dc,^^^^00d3,^^^^0150,^^^^00da,^^^^00c9,^^^^00c1,^^^^0170,^^^^00cd,^^^^00c4,^^^^00c0,^^^^00c3,^^^^00c2,^^^^0102,^^^^00c5,^^^^0104,^^^^00c6,^^^^00e4,^^^^00e0,^^^^00e3,^^^^00e2,^^^^0103,^^^^00e5,^^^^0105,^^^^00e6,^^^^00cb,^^^^00c8,^^^^00ca,^^^^011a,^^^^0118,^^^^00eb,^^^^00e8,^^^^00ea,^^^^011b,^^^^0119,^^^^00cf,^^^^00cd,^^^^00cc,^^^^00ce,^^^^00ef,^^^^00ec,^^^^00ee,^^^^00d2,^^^^00d5,^^^^00d4,^^^^00d8,^^^^004f,^^^^0045,^^^^00f2,^^^^00f5,^^^^00f4,^^^^00f8,^^^^00d9,^^^^00db,^^^^016e,^^^^00f9,^^^^00fb,^^^^016f}
+ \def\huaz@list@X{^^^^0139,^^^^0141,^^^^013c,^^^^013a,^^^^0142,^^^^0145,^^^^0143,^^^^00d1,^^^^0147,^^^^014a,^^^^0144,^^^^00f1,^^^^0148,^^^^014b,^^^^0156,^^^^0154,^^^^0158,^^^^0157,^^^^0155,^^^^0159,^^^^015e,^^^^0218,^^^^015a,^^^^0160,^^^^015f,^^^^0219,^^^^015b,^^^^0161,^^^^0178,^^^^00dd,^^^^00ff,^^^^00fd}
+ \huaz@must@oneunit@true
+\fi
+
+%=================================================
+%
+% \NewHook{huaz}
+%
+%=================================================
+
+\NewHook{huaz}
+
+\AddToHook{huaz}{% In \StrChar, these commands will be considered as one syntax unit.
+ \let\"\relax\let\'\relax\let\H\relax\let\`\relax\let\~\relax\let\^\relax\let\v\relax\let\u\relax%
+ \let\=\relax\let\k\relax\let\.\relax\let\AA\relax\let\aa\relax\let\AE\relax\let\ae\relax\let\&\relax%
+ \let\#\relax\let\_\relax}
+
+\def\huaz@y@#1#{\@gobble}
+\def\huaz@deloptparam{\huaz@y@\relax}% \def\textcolor{\huaz@deloptparam} --> \textcolor[RGB]{0,255,0}{text} --> text; \textcolor{red}{text} --> text
+
+\AddToHook{huaz}{% Ignored commands
+ \def\textrm{}\def\rmfamily{}%
+ \def\textsf{}\def\sffamily{}%
+ \def\texttt{}\def\ttfamily{}%
+ \def\textnormal{}\def\normalfont{}%
+ \def\textbf{}\def\bfseries{}%
+ \def\textmd{}\def\mdseries{}%
+ \def\textit{}\def\itshape{}%
+ \def\textsl{}\def\slshape{}%
+ \def\textsc{}\def\scshape{}%
+ \def\textup{}\def\upshape{}%
+ \def\textulc{}\def\ulcshape{}%
+ \def\textsw{}\def\swshape{}%
+ \def\textssc{}\def\sscshape{}%
+ \def\emph{}\def\em{}%
+ \def\underline{}%
+ \def\tiny{}\def\scriptsize{}\def\footnotesize{}\def\small{}\def\normalsize{}%
+ \def\large{}\def\Large{}\def\LARGE{}\def\huge{}\def\Huge{}%
+ \def\uppercase{}\def\lowercase{}\def\MakeUppercase{}\def\MakeLowercase{}%
+ \def\textcolor{\huaz@deloptparam}\def\color{\huaz@deloptparam}%
+ \def\mbox{}\def\fbox{}}
+
+\AddToHook{huaz}{% Expandable cross-references commands
+ \def\ref#1{\getrefnumber{#1}}%
+ \def\eqref#1{\getrefnumber{#1}}%
+ \def\pageref#1{\getpagerefnumber{#1}}%
+ \def\cite{\huaz@cite}}
+
+%=================================================
+%
+% \huaz@z{<...>} --> "z", if the definite article of <...> is "az"
+% E.g. \huaz@z{asztal} --> "z" ("az asztal")
+% \huaz@z{szék} --> "" ("a szék")
+%
+%=================================================
+
+\NewDocumentCommand{\huaz@z}{m}{%
+ \begingroup%
+ \exploregroups%
+ \UseHook{huaz}%
+ \huaz@must@z@false%
+ %
+ % 1. syntax unit \AA,\aa,\AE,\ae,e,u,i,o,a,E,U,I,O,A,5
+ \StrChar{#1}{1}[\huaz@temp]%
+ \@for\huaz@list:={\AA,\aa,\AE,\ae,e,u,i,o,a,E,U,I,O,A,5}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ %
+ % 1. syntax unit accent command and 2. character e,u,i,o,a,E,U,I,O,A (e.g. "\'A")
+ \ifhuaz@must@z@\else%
+ \huaz@temp@if@false%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \@for\huaz@list:={\",\',\H,\`,\~,\^,\v,\u,\=,\k}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
+ \ifhuaz@temp@if@%
+ \StrChar{#1}{2}[\huaz@temp]%
+ \@for\huaz@list:={e,u,i,a,E,U,I,O,A}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ \fi%
+ \fi%
+ %
+ % 1. character ö,ü,ó,ő,ú,é,á,ű,í,Ö,Ü,Ó,Ő,Ú,É,Á,Ű,Í,...
+ \ifhuaz@must@z@\else%
+ \ifhuaz@must@oneunit@\StrLeft{#1}{1}[\huaz@tempa]\else\StrLeft{#1}{2}[\huaz@tempa]\fi% in pdflatex(utf8) Ő is two syntax units; in pdflatex(latin2)/xelatex/lualatex Ő is one syntax unit
+ \@for\huaz@list:=\huaz@list@A%
+ \do{\StrLeft{\huaz@list}{2}[\huaz@tempb]%
+ \IfStrEq{\huaz@tempa}{\huaz@tempb}{\huaz@must@z@true}{}}%
+ \fi%
+ %
+ % 1. character f,l,m,n,r,x,y,F,L,M,N,S,R,X,Y and the 2. character is not letter (e.g. "M-10")
+ \ifhuaz@must@z@\else%
+ \huaz@temp@if@false%
+ \StrChar{#1}{2}[\huaz@temp]%
+ \@for\huaz@list:={;,`,',",+,!,/,=,(,),<,>,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\&,\#,\_,\unskip,\kern}% \kern, \unskip for active characters
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
+ \ifhuaz@temp@if@%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \@for\huaz@list:={f,l,m,n,r,x,y,F,L,M,N,S,R,X,Y}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ \ifhuaz@must@oneunit@%
+ \ifhuaz@must@z@\else%
+ \@for\huaz@list:=\huaz@list@X% in pdflatex(latin2)/xelatex/lualatex Š is one syntax unit
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % 1. syntax unit accent command, 2. character f,l,m,n,r,x,y,F,L,M,N,S,R,X,Y and the 3. character is not letter (e.g. "\^Y.")
+ \ifhuaz@must@z@\else%
+ \huaz@temp@if@false%
+ \StrChar{#1}{3}[\huaz@temp]%
+ \@for\huaz@list:={;,`,',",+,!,/,=,(,),<,>,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\&,\#,\_,\unskip,\kern}% \kern, \unskip for active characters
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
+ \ifhuaz@temp@if@%
+ \huaz@temp@if@false%
+ \StrChar{#1}{2}[\huaz@temp]%
+ \@for\huaz@list:={f,l,m,n,r,x,y,F,L,M,N,S,R,X,Y}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
+ \ifhuaz@temp@if@%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \@for\huaz@list:={\",\',\H,\`,\~,\^,\v,\u,\=,\k}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % first two characters ly,Ly,LY,ny,Ny,NY,sz,Sz,SZ,... and the 3. character is not letter (e.g. "NY" or "SZ-2")
+ \ifhuaz@must@z@\else%
+ \huaz@temp@if@false%
+ \StrChar{#1}{3}[\huaz@temp]%
+ \@for\huaz@list:={;,`,',",+,!,/,=,(,),<,>,@,.,?,:,-,*,0,1,2,3,4,5,6,7,8,9,{,},{ },{},\&,\#,\_,\unskip,\kern}% \kern, \unskip for active characters
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@temp@if@true}{}}%
+ \ifhuaz@temp@if@%
+ \StrLeft{#1}{2}[\huaz@temp]%
+ \@for\huaz@list:={ly,Ly,LY,ny,Ny,NY,sz,Sz,SZ}%
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ \ifhuaz@must@oneunit@\else%
+ \ifhuaz@must@z@\else%
+ \@for\huaz@list:=\huaz@list@X% in pdflatex(utf8) Š is two syntax units
+ \do{\IfStrEq{\huaz@temp}{\huaz@list}{\huaz@must@z@true}{}}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ %
+ % 1. character 1 and the 2. character is not number (e.g. "1H")
+ \ifhuaz@must@z@\else%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \IfStrEq{\huaz@temp}{1}{%
+ \StrChar{#1}{2}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
+ }{}%
+ \fi%
+ %
+ % 1000,...,1999 and the 5. character is not number ("ezer...")
+ \ifhuaz@must@z@\else%
+ \StrLen{#1}[\huaz@temp]%
+ \setcounter{huaz@temp@count}{\huaz@temp}%
+ \ifnum\value{huaz@temp@count}>3%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \IfStrEq{\huaz@temp}{1}{%
+ \StrMid{#1}{2}{4}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{%
+ \StrChar{#1}{5}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
+ }{}%
+ }{}%
+ \fi%
+ \fi%
+ %
+ % 1000000,...,1999999 and the 8. character is not number ("egymillió...")
+ \ifhuaz@must@z@\else%
+ \StrLen{#1}[\huaz@temp]%
+ \setcounter{huaz@temp@count}{\huaz@temp}%
+ \ifnum\value{huaz@temp@count}>6%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \IfStrEq{\huaz@temp}{1}{%
+ \StrMid{#1}{2}{7}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{%
+ \StrChar{#1}{8}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
+ }{}%
+ }{}%
+ \fi%
+ \fi%
+ %
+ % 1000000000,...,1999999999 and the 11. character is not number ("egymilliárd...")
+ \ifhuaz@must@z@\else%
+ \StrLen{#1}[\huaz@temp]%
+ \setcounter{huaz@temp@count}{\huaz@temp}%
+ \ifnum\value{huaz@temp@count}>9%
+ \StrChar{#1}{1}[\huaz@temp]%
+ \IfStrEq{\huaz@temp}{1}{%
+ \StrMid{#1}{2}{10}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{%
+ \StrChar{#1}{11}[\huaz@temp]%
+ \IfInteger{\huaz@temp}{}{\huaz@must@z@true}%
+ }{}%
+ }{}%
+ \fi%
+ \fi%
+ %
+ \gdef\huaz@save{}%
+ \ifhuaz@must@z@\gdef\huaz@save{z}\ifhuaz@show@ z\fi\fi%
+ \endgroup}
+
+%=================================================
+%
+% \huaz@romantoarabic{<...>}
+% If <...> is a roman number, then it will be converted to arabic.
+% If <...> is not a roman number, then the result is -1.
+% If <...> is empty, then the result is 0.
+% E.g. \huaz@\romantoarabic{xiv} --> "14"
+% \huaz@\romantoarabic{aaaa} --> "-1"
+% \huaz@\romantoarabic{} --> "0"
+%
+%=================================================
+
+\ExplSyntaxOn
+\NewExpandableDocumentCommand{\huaz@romantoarabic}{m}
+ {
+ \int_from_roman:f { #1 }
+ }
+\cs_generate_variant:Nn \int_from_roman:n { f }
+\ExplSyntaxOff
+
+%=================================================
+%
+% \huaz@try@roman{<...>}
+% Collect the characters i,v,x,l,c,d,m,I,V,X,L,C,D,M from the beginning of <...>.
+% This string is saved into \huaz@try@roman@result.
+% If this string is empty, then \huaz@try@roman@result is <...>. E.g.
+% \huaz@try@roman{XIV.6}\huaz@try@roman@result --> "XIV"
+% \huaz@try@roman{xiii.x}\huaz@try@roman@result --> "xiii"
+% \huaz@try@roman{d.xiii}\huaz@try@roman@result --> "d"
+% \huaz@try@roman{a.xiii}\huaz@try@roman@result --> "a.xiii"
+% \huaz@try@roman{XIii}\huaz@try@roman@result --> "XIii"
+% \huaz@try@roman{aXIIII}\huaz@try@roman@result --> "aXIIII"
+%
+%=================================================
+
+\NewDocumentCommand{\huaz@try@roman}{m}{%
+ \begingroup%
+ \exploregroups%
+ \UseHook{huaz}%
+ \StrLen{#1}[\huaz@temp]%
+ \setcounter{huaz@temp@count}{\huaz@temp}%
+ \setcounter{huaz@temp@count@}{1}%
+ \gdef\huaz@try@roman@result{}%
+ \loop%
+ \huaz@temp@if@false%
+ \StrChar{#1}{\thehuaz@temp@count@}[\huaz@temp]%
+ \IfSubStr{ivxlcdmIVXLCDM}{\huaz@temp}{%
+ \expandafter\g@addto@macro\expandafter\huaz@try@roman@result\expandafter{\huaz@temp}}
+ {\setcounter{huaz@temp@count@}{\value{huaz@temp@count}}}%
+ \ifnum\value{huaz@temp@count@}<\value{huaz@temp@count}\stepcounter{huaz@temp@count@}%
+ \repeat%
+ \ifx\huaz@try@roman@result\@empty\gdef\huaz@try@roman@result{#1}\fi%
+ \endgroup}
+
+%=================================================
+%
+% \aznotshow
+%
+%=================================================
+
+\def\aznotshow{\huaz@show@false}
+
+%=================================================
+%
+% \huaz@text
+%
+%=================================================
+
+\NewDocumentCommand{\huaz@text}{st{=}m}{%
+ \huaz@try@roman{#3}%
+ \def\huaz@tempa{-1}%
+ \edef\huaz@tempb{\huaz@romantoarabic{\huaz@try@roman@result}}%
+ \IfBooleanTF{#2}{\huaz@z{#3}}{%
+ \ifx\huaz@tempb\huaz@tempa%
+ \huaz@z{#3}%
+ \else%
+ \huaz@z{\huaz@romantoarabic{\huaz@try@roman@result}}%
+ \fi}%
+ \IfBooleanF{#1}{\ifhuaz@show@~#3\fi}%
+ \huaz@show@true}
+
+%=================================================
+%
+% \az \Az \azv \Azv \azsaved
+%
+%=================================================
+
+\DeclareDocumentCommand{\az}{sm}{\ifhuaz@show@ a\fi\IfBooleanTF{#1}{\huaz@text*{#2}}{\huaz@text{#2}}\xdef\azsaved{a\huaz@save}}
+\DeclareDocumentCommand{\Az}{sm}{\ifhuaz@show@ A\fi\IfBooleanTF{#1}{\huaz@text*{#2}}{\huaz@text{#2}}\xdef\azsaved{A\huaz@save}}
+\DeclareDocumentCommand{\azv}{sm}{\ifhuaz@show@ a\fi\IfBooleanTF{#1}{\huaz@text*={#2}}{\huaz@text={#2}}\xdef\azsaved{a\huaz@save}}
+\DeclareDocumentCommand{\Azv}{sm}{\ifhuaz@show@ A\fi\IfBooleanTF{#1}{\huaz@text*={#2}}{\huaz@text={#2}}\xdef\azsaved{A\huaz@save}}
+
+%=================================================
+%
+% \aref \Aref \avref \Avref
+%
+%=================================================
+
+\DeclareDocumentCommand{\aref}{sm}{\IfBooleanTF{#1}{\az*{\ref{#2}}}{\az{\ref{#2}}}}
+\DeclareDocumentCommand{\Aref}{sm}{\IfBooleanTF{#1}{\Az*{\ref{#2}}}{\Az{\ref{#2}}}}
+\DeclareDocumentCommand{\avref}{sm}{\IfBooleanTF{#1}{\azv*{\ref{#2}}}{\azv{\ref{#2}}}}
+\DeclareDocumentCommand{\Avref}{sm}{\IfBooleanTF{#1}{\Azv*{\ref{#2}}}{\Azv{\ref{#2}}}}
+
+%=================================================
+%
+% \apageref \Apageref \avpageref \Avpageref
+%
+%=================================================
+
+\DeclareDocumentCommand{\apageref}{sm}{\IfBooleanTF{#1}{\az*{\pageref{#2}}}{\az{\pageref{#2}}}}
+\DeclareDocumentCommand{\Apageref}{sm}{\IfBooleanTF{#1}{\Az*{\pageref{#2}}}{\Az{\pageref{#2}}}}
+\DeclareDocumentCommand{\avpageref}{sm}{\IfBooleanTF{#1}{\azv*{\pageref{#2}}}{\azv{\pageref{#2}}}}
+\DeclareDocumentCommand{\Avpageref}{sm}{\IfBooleanTF{#1}{\Azv*{\pageref{#2}}}{\Azv{\pageref{#2}}}}
+
+%=================================================
+%
+% \aeqref \Aeqref \aveqref \Aveqref
+%
+%=================================================
+
+\DeclareDocumentCommand{\aeqref}{sm}{\IfBooleanTF{#1}{\az*{\eqref{#2}}}{\az{\eqref{#2}}}}
+\DeclareDocumentCommand{\Aeqref}{sm}{\IfBooleanTF{#1}{\Az*{\eqref{#2}}}{\Az{\eqref{#2}}}}
+\DeclareDocumentCommand{\aveqref}{sm}{\IfBooleanTF{#1}{\azv*{\eqref{#2}}}{\azv{\eqref{#2}}}}
+\DeclareDocumentCommand{\Aveqref}{sm}{\IfBooleanTF{#1}{\Azv*{\eqref{#2}}}{\Azv{\eqref{#2}}}}
+
+%=================================================
+%
+% \acite \Acite \avcite \Avcite
+%
+%=================================================
+
+\DeclareDocumentCommand{\acite}{som}{%
+ \IfBooleanTF{#1}{%
+ \IfNoValueTF{#2}{%
+ \az*{\cite{#3}}%
+ }{%
+ \az*{\cite[#2]{#3}}%
+ }%
+ }{%
+ \IfNoValueTF{#2}{%
+ \az{\cite{#3}}%
+ }{%
+ \az{\cite[#2]{#3}}%
+ }%
+ }}
+
+\DeclareDocumentCommand{\Acite}{som}{%
+ \IfBooleanTF{#1}{%
+ \IfNoValueTF{#2}{%
+ \Az*{\cite{#3}}%
+ }{%
+ \Az*{\cite[#2]{#3}}%
+ }%
+ }{%
+ \IfNoValueTF{#2}{%
+ \Az{\cite{#3}}%
+ }{%
+ \Az{\cite[#2]{#3}}%
+ }%
+ }}
+
+\DeclareDocumentCommand{\avcite}{som}{%
+ \IfBooleanTF{#1}{%
+ \IfNoValueTF{#2}{%
+ \azv*{\cite{#3}}%
+ }{%
+ \azv*{\cite[#2]{#3}}%
+ }%
+ }{%
+ \IfNoValueTF{#2}{%
+ \azv{\cite{#3}}%
+ }{%
+ \azv{\cite[#2]{#3}}%
+ }%
+ }}
+
+\DeclareDocumentCommand{\Avcite}{som}{%
+ \IfBooleanTF{#1}{%
+ \IfNoValueTF{#2}{%
+ \Azv*{\cite{#3}}%
+ }{%
+ \Azv*{\cite[#2]{#3}}%
+ }%
+ }{%
+ \IfNoValueTF{#2}{%
+ \Azv{\cite{#3}}%
+ }{%
+ \Azv{\cite[#2]{#3}}%
+ }%
+ }}
+
+%=================================================
+%
+% \huaz@cite
+%
+%=================================================
+
+\def\huaz@x@#1#{\huaz@citelist}
+\def\huaz@cite{\huaz@x@\relax}
+\def\huaz@citelist#1{\huaz@@citelist#1,\relax,}
+\def\huaz@@citelist#1,{\ifx#1\relax\else\@nameuse{huaz@bib@#1},\expandafter\huaz@@citelist\fi}%
+
+\AddToHook{begindocument/before}{
+ %
+ \def\huaz@bibparam{}
+ %
+ \@ifpackageloaded{natbib}{
+ \ifNAT@numbers\def\huaz@bibparam#1#2#3{#1}\else\def\huaz@bibparam#1#2#3{#3}\fi}{}
+ %
+ \@ifpackageloaded{babel}{
+ \let\huaz@old@bbl@bibcite\bbl@bibcite
+ \def\bbl@bibcite#1#2{\global\@namedef{huaz@bib@#1}{\huaz@bibparam#2}\huaz@old@bbl@bibcite{#1}{#2}}}{}
+ %
+ \@ifpackageloaded{hyperref}{
+ \let\huaz@old@Hy@bibcite\Hy@bibcite
+ \def\Hy@bibcite#1#2{\global\@namedef{huaz@bib@#1}{\huaz@bibparam#2}\huaz@old@Hy@bibcite{#1}{#2}}}{}
+ %
+ \let\huaz@old@bibcite\bibcite
+ \def\bibcite#1#2{\global\@namedef{huaz@bib@#1}{\huaz@bibparam#2}\huaz@old@bibcite{#1}{#2}}
+ %
+ \@ifpackageloaded{biblatex}{
+ \def\huaz@biblatexlabel{}
+ \ifx\blx@opt@eldt@style\@empty\ifx\blx@opt@eldt@citestyle\@empty\def\huaz@biblatexlabel{\strfield{labelnumber}}\fi\fi
+ \def\huaz@temp{numeric}
+ \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
+ \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
+ \def\huaz@temp{numeric-verb}
+ \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
+ \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\csfield{labelnumber}}\fi
+ \def\huaz@temp{alphabetic}
+ \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
+ \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
+ \def\huaz@temp{alphabetic-verb}
+ \ifx\blx@opt@eldt@style\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
+ \ifx\blx@opt@eldt@citestyle\huaz@temp\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
+ \def\huaz@temp{authoryear}
+ \ifx\blx@opt@eldt@style\huaz@temp\settoggle{blx@labelalpha}{true}\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
+ \ifx\blx@opt@eldt@citestyle\huaz@temp\settoggle{blx@labelalpha}{true}\def\huaz@biblatexlabel{\strfield{labelalpha}}\fi
+ \ifx\huaz@biblatexlabel\@empty\else
+ \AtEveryBibitem{\protected@write\@auxout{}{\string\global\string\@namedef{huaz@bib@\strfield{entrykey}}{\huaz@biblatexlabel}}}
+ \fi}{}}
+
+%=================================================
+%
+% end
+%
+%=================================================
+
+\endinput \ No newline at end of file
diff --git a/macros/latex/contrib/huaz/huaz.tex b/macros/latex/contrib/huaz/huaz.tex
new file mode 100644
index 0000000000..0d1eb4b74a
--- /dev/null
+++ b/macros/latex/contrib/huaz/huaz.tex
@@ -0,0 +1,381 @@
+%%
+%% `huaz.tex' documentation of the huaz package
+%%
+%% Copyright 2022 by Tibor Tomacs
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Tibor Tomacs.
+%%
+\documentclass[12pt]{article}
+\usepackage{listings,xcolor,lmodern,xurl}
+\usepackage[pdfstartview=FitH,colorlinks,allcolors=teal,bookmarksnumbered]{hyperref}
+\usepackage[a4paper,top=1in,bottom=1.2in]{geometry}
+\usepackage[T1]{fontenc}
+\PassOptionsToPackage{defaults=hu-min}{magyar.ldf}
+\usepackage[english,magyar]{babel}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{6pt}
+
+\lstset{literate={<}{{$\langle$}}1{>}{{$\rangle$}}1
+ {ö}{{\"o}}1{ü}{{\"u}}1{ó}{{\'o}}1{é}{{\'e}}1{á}{{\'a}}1{í}{{\'i}}1}
+
+\lstnewenvironment{examplelst}{\lstset{
+aboveskip=\bigskipamount,
+basicstyle=\footnotesize\color{blue!70!black}\ttfamily,
+backgroundcolor=\color{black!3},
+rulecolor=\color{black!15},
+frame=trbl,
+framesep=5pt,
+columns=fullflexible,
+xleftmargin=5.4pt,
+xrightmargin=5.4pt,
+keepspaces}}{}
+
+\newcommand{\commandinline}{\hspace*{-15mm}\lstinline[
+delim={[is][\color{green!50!black}\normalfont\small\sffamily]{!}{!}},
+basicstyle=\color{red!70!black}\normalfont\ttfamily,
+columns=fullflexible,
+keepspaces]}
+
+\newcommand{\verbinline}{\lstinline[
+delim={[is][\color{green!50!black}\normalfont\small\sffamily]{!}{!}},
+basicstyle=\normalfont\ttfamily,
+columns=fullflexible,
+keepspaces]}
+
+\makeatletter
+\def\@oddfoot{\hfill\textsf{\color{gray}\thepage}\hfill}
+\def\@evenfoot{\@oddfoot}
+\def\ps@plain{\def\@oddfoot{\hfill\textsf{\color{gray}\thepage}\hfill}}
+\makeatother
+
+\def\huaz{\textbf{\sffamily hu\color{gray}az}}
+
+\begin{document}
+
+\title{The \huaz\ package\\
+ {\large v1.0 (2022/10/16)}}
+\author{Tibor Tómács\\
+ {\normalsize\href{email:tomacs.tibor@uni-eszterhazy.hu}{\nolinkurl{tomacs.tibor@uni-eszterhazy.hu}}}}
+\date{}
+\maketitle
+
+\begin{otherlanguage}{english}
+\begin{abstract}
+In Hungarian there are two definite articles, \emph{``a''} and \emph{``az''}, which are determined by the pronunciation of the subsequent word. The definite article is \emph{``az''}, if the first phoneme of the pronounced word is a vowel, otherwise it is \emph{``a''}.
+The \huaz\ package helps the user to insert automatically the correct definite article for cross-references and other commands containing text. Thus, if these change, the definite articles will also change accordingly.
+
+\medskip
+\emph{Sorry, the documentation is in Hungarian, because only users of the Hungarian language are interested.}
+\end{abstract}
+\end{otherlanguage}
+
+\section{Bevezetés}
+
+A magyar nyelvben a határozott névelő egy szó előtt aszerint \emph{,,a''} vagy \emph{,,az''}, hogy a szó kiejtve mássalhangzóval vagy magánhangzóval kezdődik. Például \emph{,,a szék''} vagy \emph{,,az asztal''}. Ez egyszerűnek tűnik, de gondoljon a következő esetekre:
+
+\begin{itemize}
+\item Például ha oldalszámra akar hivatkozni, akkor a \verb|\pageref| parancsot szoktuk használni. Ha ez elé akar határozott névelőt rakni, akkor nem mindegy, hogy mi az oldalszám. Például \emph{,,az~1.~oldal''}, \emph{,,a~2.~oldal''}, \emph{,,az~5.~oldal''}, \emph{,,a~10.~oldal''}. Így egyáltalán nem biztos, hogy az ,,\verbinline|a \pageref{!<kulcs>!}|'' kód megfelelő eredményt ad. Hasonló a probléma minden kereszthivatkozás esetén (\verb|\ref|, \verb|\pageref|, \verb|\eqref|, \verb|\cite|).
+
+\item Az is fontos, hogy egy kifejezés római szám vagy sem. Például \emph{,,az~V.~fejezet''}, ha \emph{V} római szám, azaz 5 a jelentése. Ugyanakkor \emph{,,a~V.~fejezet''}, ha \emph{V} betűt jelöl vagy alfanumerikus szám esetén a 22 értéket (\emph{V} az angol ábécében a 22.~betű).
+
+\item Néhány mássalhangzó speciális tulajdonságú. Például \emph{,,az M betű''}, de \emph{,,a Magyar Közlöny''}; \emph{,,az Ny betű''}, de \emph{,,a Nyugdíjfolyósító Igazgatóság''}; stb.
+\end{itemize}
+
+Először megemlítünk két eddigi megoldást a határozott névelők automatikus kezelésére, kiemelve azok hibáit és hiányosságait.
+
+\subsection{A magyar.ldf}
+
+Egyik lehetőség a \texttt{babel} csomag \texttt{magyar} opcióját beállító \texttt{magyar.ldf} fájl használata. Ennek teljes dokumentációja elérhető innen: \url{https://math.bme.hu/latex/magyarldf-doc.pdf}.
+
+Az ebben definiált \verb|\az|, \verb|\aref|, \verb|\apageref|, \verb|\acite|, stb. parancsok alapvetően jól használhatóak, de van néhány fontos hiba, melyek a \huaz\ csomag megírását motiválták:
+
+\begin{itemize}
+\item Az \verb|\eqref| parancsnak nincs névelős verziója. Helyette az \verbinline|\aref({!<kulcs>!})| használható, de ez dőlt betűs környezetben nem álló betűs eredményt ad, mint az \verb|\eqref| esetében. Másik lehetőség, ami ezt a problémát megoldja, az \verbinline|\az{\eqref{!<kulcs>!}}| parancs. Ugyanakkor egyik megoldás sem kezeli a római számozású vagy a \verb|\tag| paranccsal címkézett egyenleteket.
+
+\item Az \verbinline|\az{\ref{!<kulcs>!}}| és \verbinline|\az{\pageref{!<kulcs>!}}| nem kezeli a római számozású hivatkozásokat.
+
+\item Az előző hiba akkor is fennáll, amikor az \verb|\az| parancsban egy római számmal kezdődő szöveg van. Például \verb|\az{V.~osztály}| eredménye \emph{,,a V.~osztály''}.
+
+\item Amennyiben nem kereszthivatkozáshoz, hanem egy szöveghez, vagy valamilyen szöveget tároló parancshoz kell automatikus névelő, akkor az ékezetes betűket UTF-8 kódolás esetén rosszul detektálja. A hiba alapvető oka, hogy az UTF-8 kódolású karakterek nem egy, hanem több bájton vannak kódolva, amit a \texttt{magyar.ldf} nem vesz figyelembe. Ezért például \verb|\az{ágy}| eredménye \emph{,,a ágy''}, mert nem betűként érzékeli az \emph{,,á''} betűt, így azt sem tudja, hogy ez magánhangzó. Meglepő módon \verb|\az{száz}| eredménye \emph{,,az száz''} is rossz. Ennek az az oka, hogy mivel számára az \emph{,,á''} nem betű, ezért az \emph{,,sz''} betűt különállónak tekinti, ami elé valóban \emph{,,az''} kell.
+
+\item Hibának ugyan nem tekinthető, de mindenesetre kényelmetlen, hogy például \verb|\az{\textbf{N betű}}| esetén a \verb|\textbf| parancs megzavarja a szó betűinek detektálását, így a névelő helytelenül \emph{,,a''} lesz.
+\end{itemize}
+
+\subsection{A nevelok csomag}
+
+2015-ben készült a \texttt{nevelok} csomag, ami szintén az automatikus határozott névelők kezelésére készült. A szerzője valószínűleg nem ismerte a \texttt{magyar.ldf} már akkor létező lehetőségeit, ezért készíthette ezt a jóval kevesebbet tudó csomagot.
+
+2022-ben telepített \TeX-rendszeren tesztelve azt tapasztaltam, hogy nem kezeli az ékezetes betűk semmilyen formáját és sok esetben ad kereszthivatkozásoknál is rossz névelőt. Az utóbbinak az az oka, hogy közvetlenül a \verb|\ref| parancsot vizsgálja, ami nem kifejthető parancs.
+
+Ezen dokumentáció elkészültéig semmilyen fejlesztése nem történt. Jelen állapotában nem javasolt ennek a csomagnak a használata.
+
+\subsection{A \texorpdfstring{\huaz}{huaz} csomag célja és működése}
+
+A \huaz\ csomag célja segíteni a felhasználót abban, hogy a kereszthivatkozásokhoz és szöveget tartalmazó parancsokhoz automatikusan beszúrja a megfelelő határozott névelőt. Így ha ezek változnak, akkor a határozott névelők is megfelelően változnak.
+
+A másik cél ezt úgy megtenni, hogy a \texttt{magyar.ldf} és a \texttt{nevelok.sty} hibáit és hiányosságait korrigálja illetve pótolja.
+
+A \huaz\ csomag a következő esetekben illeszt az adott szöveg elé ,,az'' névelőt:
+
+\begin{enumerate}
+\item Az első betű magánhangzó (legyen az kis- vagy nagybetű, ékezetes vagy sem, magyar vagy sem, UTF-8, ISO-8859-2 karakterrel vagy repülő ékezettel megadva).
+
+\item Az első betű olyan kis vagy nagy mássalhangzó, amit önmagában kiejtve magánhangzóval kezdünk (például F, L, M, stb.) míg a második karakter (ha van) nem betű, hanem szám, írásjel vagy szóköz. Például ,,M-10''. Ide soroltunk néhány nem magyar ékezetes mássalhangzót is. Például ,,Ň.1''.
+
+\item Az első két karakter egy olyan kis vagy nagy kétjegyű mássalhangzó, amit önmagában kiejtve magánhangzóval kezdünk (például Ny, Ly, Sz, stb.) míg a harmadik karakter (ha van) nem betű, hanem szám, írásjel vagy szóköz. Például ,,NY betű''.
+
+\item Az első karakter 5.
+
+\item 1, 4, 7 vagy 10 jegyű számmal kezdődik és az első számjegy 1 (egy, ezer, egymillió, egymilliárd).
+\end{enumerate}
+
+Ha a szó elején található karakterek római számként is értelmezhetőek, akkor megválasztható, hogy azt konvertálja arab számra és a névelőt ahhoz határozza meg vagy sem. Például ,,XII/A'' esetén.
+
+\section{A \texorpdfstring{\huaz}{huaz} csomag használata}
+
+A \huaz\ csomagot a szokott módon kell betölteni:
+
+\commandinline|\usepackage{huaz}|
+
+Csomagopciók nincsenek. UTF-8 (\texttt{utf8}) és ISO-8859-2 (\texttt{latin2}) kódolású forrásfájl esetén működik, de a repülő ékezeteket is jól kezeli. Kompatibilis a \texttt{pdflatex}, \texttt{xelatex} és \texttt{lualatex} fordítókkal is. Például \texttt{pdflatex} fordítóval a következő betöltés megfelelő:
+
+\begin{examplelst}
+\documentclass{article}
+\usepackage[T1]{fontenc}
+\usepackage{huaz}
+\PassOptionsToPackage{defaults=hu-min}{magyar.ldf}
+\usepackage[magyar]{babel}
+\begin{document}
+ ...
+\end{document}
+\end{examplelst}
+A \texttt{hyperref} csomaggal is kompatibilis, így az is betölthető a \huaz\ mellé.
+
+A \texttt{magyar.ldf} \texttt{defaults=hu-min} opciója bekapcsol néhány olyan opciót is, amely elérhetővé teszi a saját automatikus névelőparancsait. Ezt ugyan nem kötelező, de hasznos a \huaz\ csomag használata esetén kikapcsolni. Ehhez a
+\begin{examplelst}
+\PassOptionsToPackage{defaults=hu-min}{magyar.ldf}
+\end{examplelst}
+sor helyett használja a következőt:
+\begin{examplelst}
+\PassOptionsToPackage{defaults=hu-min,az=no,
+ shortrefcmds=no,hunnewlabel=no}{magyar.ldf}
+\end{examplelst}
+
+A \texttt{xelatex} és \texttt{lualatex} fordítók esetén \texttt{babel} helyett a
+\begin{examplelst}
+\usepackage{polyglossia}
+\setdefaultlanguage{hungarian}
+\end{examplelst}
+is használható.
+
+A \huaz\ csomag felhasználja az \texttt{xstring}, \texttt{refcount} és \texttt{iftex} csomagok szolgáltatásait, így ezek is betöltődnek. Másrészt felhasználásra kerül néhány 2021. október 10-én bevezetett változás a \LaTeX\ kerneljében, így csak az ezután telepített rendszereken működik megfelelően a csomag.
+
+\subsection{Parancsok}
+
+\commandinline|\az{!<szöveg>!}|
+
+A \verbinline|!<szöveg>!| elé a megfelelő határozott névelő kerül kisbetűs alakban. Ha a \verbinline|!<szöveg>!| elején római számként értelmezhető karakterek vannak, akkor a névelő az arab megfelelőjéhez igazodik. Például
+\begin{examplelst}
+Idén \az{V.B}~osztály rendezi a farsangot.
+\end{examplelst}
+eredménye ,,Idén az V.B~osztály rendezi a farsangot.''.
+
+A \verbinline|!<szöveg>!| lehet szöveget tároló parancs is. Például
+\begin{examplelst}
+\newcommand{\osztaly}{V.B}
+Idén \az{\osztaly}~osztály rendezi a farsangot.
+\end{examplelst}
+eredménye ,,Idén az V.B~osztály rendezi a farsangot.''.
+
+A \verbinline|!<szöveg>!| tartalmazhat szövegformázó parancsokat is (bővebben lásd \az{\ref{subsec-kapocs}}.~alszakaszban). Például
+\begin{examplelst}
+\newcommand{\osztaly}{V.B}
+Idén \az{\textbf{\osztaly}}~osztály rendezi a farsangot.
+\end{examplelst}
+eredménye ,,Idén az \textbf{V.B}~osztály rendezi a farsangot.''.
+
+A \verbinline|!<szöveg>!| lehet standard kereszthivatkozás is (\verb|\ref|, \verb|\pageref|, \verb|\eqref|, \verb|\cite|). Például
+\begin{examplelst}
+\section{Cím}\label{seca}
+\section{Cím}\label{secb}
+\az{\ref{seca}}.~szakaszban, \az{\textbf{\ref{secb}}}.~szakaszban
+\end{examplelst}
+eredménye ,,az 1. szakaszban, a \textbf{2}. szakaszban''. Ha a \texttt{section} számláló kiírása római számozásra van állítva a \verb|\renewcommand{\thesection}{\Roman{section}}| paranccsal, akkor az előző kód eredménye ,,az I. szakaszban, a \textbf{II}. szakaszban''.
+
+\subsubsection*{Korlátozások}
+\begin{enumerate}
+\item A \verbinline|!<szöveg>!| elején csak a \verb|\ref|, \verb|\pageref|, \verb|\eqref|, \verb|\cite| kereszthivatkozásokkal működik helyesen. Például a \texttt{hyperref} csomag \verb|\ref*| és \verb|\pageref*| parancsai nem működnek közvetlenül \verbinline|!<szöveg>!|-ként, de ez megoldható a később ismertetett \verb|\az*| paranccsal.
+
+\item A \verbinline|!<szöveg>!| elején a \verb|\cite| parancs jól működik a \texttt{natbib} csomaggal és \texttt{bibtex} esetében is. A \texttt{biblatex} csomag használata esetén akkor működik jól, ha a \texttt{style} vagy \texttt{citestyle} opciók értéke \texttt{numeric}, \texttt{numeric-verb}, \texttt{alphabetic}, \texttt{alphabetic-verb} vagy \texttt{authoryear}. Akkor is jól működik, ha nem adjuk meg a \texttt{style} illetve \texttt{citestyle} opciók egyikét sem.
+
+\item A pdf vázlatfájába nem lehet \verb|\az| paranccsal szöveget beilleszteni. Tehát például a következő kód nem ad helyes vázlatfát, ha \texttt{hyperref} vagy \texttt{bookmark} csomagot használ:
+\begin{examplelst}
+\section{...\az{\ref{sec}}...}
+\end{examplelst}
+Viszont a cím a szövegben, fejlécben és a tartalomjegyzékben jól fog megjelenni. A problémát a később ismertetett \verb|\azsaved| paranccsal lehet megoldani.
+\end{enumerate}
+
+\commandinline|\az*{!<szöveg>!}|
+
+Ugyanaz mint a \texttt{*} nélküli esetben, de ekkor csak a névelő kerül kiírásra. Például \texttt{hyperref} csomag használatával:
+\begin{examplelst}
+\section{Cím}\label{sec}
+\az*{\ref{sec}}~\ref*{sec}.~szakaszban
+\end{examplelst}
+
+\commandinline|\azv{!<szöveg>!}|
+
+Ugyanaz mint \verbinline|\az{!<szöveg>!}|, de ha a \verbinline|!<szöveg>!| elején római számként értelmezhető karakterek vannak, akkor a névelő nem az arab megfelelőjéhez igazodik, hanem mint egyszerű karakterekhez. Például
+\begin{examplelst}
+\renewcommand{\thesection}{\Alph{section}}
+\setcounter{section}{21}
+\section{Cím}\label{sec}
+\az{\ref{sec}}.~szakaszban, \azv{\ref{sec}}.~szakaszban
+\end{examplelst}
+eredménye ,,az V.~szakaszban, a V.~szakaszban'', mert az első esetben a V betűt római számként értelmezte, a második esetben pedig nem. Mivel most alfanumerikus számra van beállítva a \texttt{section} számláló, ezért a második eset a jó.
+
+\commandinline|\azv*{!<szöveg>!}|
+
+Ugyanaz mint a \texttt{*} nélküli esetben, de ekkor csak a névelő kerül kiírásra.
+
+A parancsok nevében az ,,a'' betű kicserélhető ,,A'' betűre. Ekkor a határozott névelő nagybetűvel fog kezdődni, ami mondatok elején szükséges.
+
+\commandinline|\Az{!<szöveg>!}|\\
+\commandinline|\Az*{!<szöveg>!}|\\
+\commandinline|\Azv{!<szöveg>!}|\\
+\commandinline|\Azv*{!<szöveg>!}|
+
+Például
+\begin{examplelst}
+\section{Cím}\label{sec}
+\Az{\ref{sec}}.~szakaszban áttekintjük a téma rövid történetét.
+\end{examplelst}
+eredménye {,,Az 1.~szakaszban áttekintjük a téma rövid történetét.''}.
+
+\commandinline|\azsaved|
+
+Amikor kiadja az előző parancsok bármelyikét, akkor generálódik egy kifejthető \verb|\azsaved| parancs is. Ennek eredménye az a határozott névelő amelyik a szó elé kell.
+
+Amikor \texttt{hyperref} vagy \texttt{bookmark} csomagot használ, akkor ahogyan azt korábban említettük, a következő kód esetén a cím, fejléc, tartalomjegyzék rendben lesz, de a pdf vázlatfája nem:
+\begin{examplelst}
+\section{\Az{\ref{sec}}...}
+\end{examplelst}
+Ez az \verb|\azsaved| paranccsal a következő módon oldható meg:
+\begin{examplelst}
+\section{\texorpdfstring{\Az{\ref{sec}}...}{\azsaved~\ref{sec}...}}
+\end{examplelst}
+Ekkor a vázlatfába az
+\begin{examplelst}
+\azsaved~\ref{sec}...
+\end{examplelst}
+kód kerül, ami már helyes eredményt ad. Ez a probléma a \verb|\texorpdfstring| helyett az
+
+\commandinline|\aznotshow|
+
+paranccsal egyszerűbben is megoldható. Ugyanis ezt helyezve az \verb|\az| (vagy bármelyik verziója) elé, az eredmény nem jelenik meg, csak az \verb|\azsaved| generálódik le a megfelelő határozott névelővel. Így
+\begin{examplelst}
+\aznotshow\Az{\ref{sec}}
+\section{\azsaved~\ref{sec}...}
+\end{examplelst}
+szintén helyes eredményt ad a vázlatfában is.
+
+\subsection{Rövidítések}
+
+\commandinline|\aref{!<kulcs>!} | $\equiv$ \verbinline|\az{\ref{!<kulcs>!}}|\\
+\commandinline|\aref*{!<kulcs>!} | $\equiv$ \verbinline|\az*{\ref{!<kulcs>!}}|\\
+\commandinline|\avref{!<kulcs>!} | $\equiv$ \verbinline|\azv{\ref{!<kulcs>!}}|\\
+\commandinline|\avref*{!<kulcs>!}| $\equiv$ \verbinline|\azv*{\ref{!<kulcs>!}}|
+
+\commandinline|\aeqref{!<kulcs>!} | $\equiv$ \verbinline|\az{\eqref{!<kulcs>!}}|\\
+\commandinline|\aeqref*{!<kulcs>!} | $\equiv$ \verbinline|\az*{\eqref{!<kulcs>!}}|\\
+\commandinline|\aveqref{!<kulcs>!} | $\equiv$ \verbinline|\azv{\eqref{!<kulcs>!}}|\\
+\commandinline|\aveqref*{!<kulcs>!}| $\equiv$ \verbinline|\azv*{\eqref{!<kulcs>!}}|
+
+\commandinline|\apageref{!<kulcs>!} | $\equiv$ \verbinline|\az{\pageref{!<kulcs>!}}|\\
+\commandinline|\apageref*{!<kulcs>!} | $\equiv$ \verbinline|\az*{\pageref{!<kulcs>!}}|\\
+\commandinline|\avpageref{!<kulcs>!} | $\equiv$ \verbinline|\azv{\pageref{!<kulcs>!}}|\\
+\commandinline|\avpageref*{!<kulcs>!}| $\equiv$ \verbinline|\azv*{\pageref{!<kulcs>!}}|
+
+\commandinline|\acite[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!} | $\equiv$ \verbinline|\az{\cite[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!}}|\\
+\commandinline|\acite*[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!} | $\equiv$ \verbinline|\az*{\cite[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!}}|\\
+\commandinline|\avcite[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!} | $\equiv$ \verbinline|\azv{\cite[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!}}|\\
+\commandinline|\avcite*[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!}| $\equiv$ \verbinline|\azv*{\cite[!<szöveg>!]{!<kulcs1>!,!<kulcs2>!,!...!}}|
+
+A parancsok nevében az első ,,a'' betű kicserélhető ,,A'' betűre. Ekkor a határozott névelő nagybetűvel fog kezdődni, ami mondatok elején szükséges:
+
+\commandinline|\Aref \Avref \Aeqref \Aveqref \Apageref \Avpageref \Acite \Avcite|
+
+Például
+\begin{examplelst}
+\section{Cím}\label{seca}
+\section{Cím}\label{secb}
+\Aref{seca}.~és \aref{secb}.~szakaszban
+\end{examplelst}
+eredménye ,,Az 1. és a 2. szakaszban''.
+
+\subsection{A huaz kapocs}\label{subsec-kapocs}
+
+Amikor a \huaz\ csomag megkeresi a megfelelő határozott névelőt, akkor a szövegben található kereszthivatkozásokat lecseréli a kifejthető verziójukra, továbbá a kifejtés során a formázó parancsokat (\verb|\emph|, \verb|\textbf|, \verb|\small|, stb.) figyelmen kívül hagyja. Emiatt lehetséges, hogy például a következő kódok működnek:
+\begin{examplelst}
+\newcommand{\osztaly}{V.B}
+Idén \az{\textbf{\osztaly}}~osztály rendezi a farsangot.
+\end{examplelst}
+
+\begin{examplelst}
+\section{Cím}\label{sec}
+\az{\textbf{\ref{sec}}}
+\end{examplelst}
+
+\commandinline|\AddToHook{huaz}{!<kód>!}|
+
+A \huaz\ csomag azon szövegformázó parancsokat hagyja figyelmen kívül, melyek egy előre definiált listában szerepelnek. Amennyiben olyan formázó parancsot használ, ami még ezen a listán nem található, akkor az a felhasználó által is bővíthető. Például
+\begin{examplelst}
+\newcommand{\myfont}[1]{{\usefont{T1}{yv1d}{m}{n}#1}}
+\newcommand{\mytext}{X.A~osztály}
+\az{\myfont{\mytext}}
+\end{examplelst}
+esetén a \verb|\myfont| nincs ezen a listán, ezért ez a kód hibával fordul. A listára az
+\begin{examplelst}
+\AddToHook{huaz}{\def\myfont{}}
+\end{examplelst}
+módon vehető fel. Ezzel azt érjük el, hogy a névelő megállapítása során a \verb|\myfont| parancs ne jelentsen semmit. Tehát a következő kód már megfelelően működik:
+\begin{examplelst}
+\AddToHook{huaz}{\def\myfont{}}
+\newcommand{\myfont}[1]{{\usefont{T1}{yv1d}{m}{n}#1}}
+\newcommand{\mytext}{X.A~osztály}
+\az{\myfont{\mytext}}
+\end{examplelst}
+Az előző eset a \texttt{huaz} kapocs nélkül így is megoldható:
+\begin{examplelst}
+\newcommand{\myfont}[1]{{\usefont{T1}{yv1d}{m}{n}#1}}
+\newcommand{\mytext}{X.A~osztály}
+\az*{\mytext}~\myfont{\mytext}
+\end{examplelst}
+Ha a \verb|\myfont| a \verb|\mytext| definíciójában szerepel, akkor a \texttt{huaz} kapocs használata nem kerülhető meg:
+\begin{examplelst}
+\AddToHook{huaz}{\def\myfont{}}
+\newcommand{\myfont}[1]{{\usefont{T1}{yv1d}{m}{n}#1}}
+\newcommand{\mytext}{\myfont{X.A~osztály}}
+\az{\mytext}
+\end{examplelst}
+Kereszthivatkozásnál, ha maga a számozás van standardtól különböző paranccsal formázva, akkor a \texttt{huaz} kapocs használata szintén nem kerülhető meg. Például
+\begin{examplelst}
+\AddToHook{huaz}{\def\myfont{}}
+\DeclareRobustCommand{\myfont}[1]{{\usefont{T1}{yv1d}{m}{n}#1}}
+\renewcommand{\thesection}{\myfont{\arabic{section}}}
+\section{Cím}\label{sec}
+\aref{sec}
+\end{examplelst}
+Itt a \verb|\myfont| azért lett erős parancsként definiálva, mert mozgó argumentumba kerül. Az előző példa esete ritkán fordul elő, mert a számláló típusának megadásánál (arab, római, stb.) nem szokás szövegformázó parancsot is alkalmazni.
+
+\end{document} \ No newline at end of file
diff --git a/macros/luatex/generic/lutabulartools/README.md b/macros/luatex/generic/lutabulartools/README.md
index ba443802b8..51055a89e5 100644
--- a/macros/luatex/generic/lutabulartools/README.md
+++ b/macros/luatex/generic/lutabulartools/README.md
@@ -1,6 +1,6 @@
# lutabulartools
-This LuaLaTeX package offers some useful macros for tabular matter. The `\MC` command it provides allows one to specify a multi-row and or multi-column cell with minimal syntax. The package loads `booktabs` and adds a gray midrule, and allows a user to specify multiple `\cmidrules` with one command. The [github repo](https://github.com/kalekje/lutabulartools) has an MS Excel
+This LuaLaTeX package offers some useful macros for tabular matter. The `\MC` command it provides allows one to specify a multi-row and or multi-column cell with minimal syntax. The package loads `booktabs` and adds a gray midrule, and allows a user to specify multiple `\cmidrules` with one command, or produce midrules every Xth row with `\midruleX`. The [github repo](https://github.com/kalekje/lutabulartools) has an MS Excel
macro-enabled spreadsheet named "LaTeX-Tabular-Generator.xlsm" to help make tables in LaTeX.
diff --git a/macros/luatex/generic/lutabulartools/lutabulartools.lua b/macros/luatex/generic/lutabulartools/lutabulartools.lua
index fd783332a9..361530bc97 100644
--- a/macros/luatex/generic/lutabulartools/lutabulartools.lua
+++ b/macros/luatex/generic/lutabulartools/lutabulartools.lua
@@ -1,5 +1,5 @@
--% Kale Ewasiuk (kalekje@gmail.com)
---% 2022-04-16
+--% 2022-10-15
--% Copyright (C) 2021-2022 Kale Ewasiuk
--%
--% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -45,24 +45,19 @@ ltt.col = '' -- current column spec, single char, only applies to tabular with m
ltt.col_num = 1 -- current column number
-local glue_t, unset_t, tabskip_st = node.id'glue', node.id'unset'
-local tabskip_st = table.swapped(node.subtypes'glue').tabskip
-assert(tabskip_st)
-
-
function ltt.set_col_num()
-- register current column info (column number and specification)
local nest
for i = tex.nest.ptr, 1, -1 do
local tail = tex.nest[i].tail
- if tail.id == glue_t and tail.subtype == tabskip_st then
+ if tail.id == node.id'glue' and tail.subtype == table.swapped(node.subtypes'glue').tabskip then
nest = tex.nest[i]
break
end
end
if nest then
local col = 1
- for _, sub in node.traverse_id(unset_t, nest.head) do
+ for _, sub in node.traverse_id(node.id'unset', nest.head) do
col = col + sub + 1
end
ltt.col_num = col
@@ -288,6 +283,71 @@ function ltt.makecmidrules(s, r, c, cmd)
end
+local T = pl.tablex
+
+ltt.mrX = {}
+ltt.mrX.defaults = {step=5, rule='midrule', reset=false, resetnum=0, cntr=0}
+ltt.mrX.settings = T.copy(ltt.mrX.defaults)
+ltt.mrX.cntr = 0
+ltt.mrX.pgcntr = 0
+
+
+
+function ltt.mrX.set_midruleX(new_sett, def)
+ def = def or ''
+ local curr_sett = {}
+ if def == pl.tex._xTrue then -- default flag, if true, reset all non-used keys to default
+ curr_sett = ltt.mrX.defaults
+ else
+ curr_sett = ltt.mrX.settings
+ end
+ new_sett = luakeys.parse(new_sett)
+ ltt.mrX.settings = T.union(curr_sett, new_sett)
+ ltt.debugtalk{ltt.mrX.settings, 'new settings'}
+ ltt.mrX.cntr = curr_sett.cntr
+end
+
+function ltt.mrX.midruleX(n)
+ n = n or '' -- todo placeholder for noalign ?
+ local s = ltt.mrX.settings
+ if pl.hasval(s.reset) and ltt.mrX.add_label_and_check_page_change() then ltt.mrX.cntr = s.resetnum end
+ ltt.mrX.cntr = ltt.mrX.cntr + 1
+ if ltt.mrX.cntr == s.step then
+ ltt.debugtalk{s.rule, 'apply midruleX'}
+ tex.sprint('\\'..s.rule)
+ ltt.mrX.cntr = 0
+ end
+end
+
+function ltt.mrX.add_label_and_check_page_change()
+ ltt.mrX.pgcntr = ltt.mrX.pgcntr + 1
+ tex.print('\\noalign{\\label{ltt@tabular@row@'..ltt.mrX.pgcntr..'}}')
+ local _, pgcurr = pl.tex.get_ref_info('ltt@tabular@row@'..ltt.mrX.pgcntr)
+ local _, pgprev = pl.tex.get_ref_info('ltt@tabular@row@'..ltt.mrX.pgcntr-1)
+ if pgcurr ~= pgprev then
+ return true
+ end
+ return false
+end
+
+
+
+
+
+
+--
+--ltt.tabular_row_pages_cntr = 0
+--function ltt.reset_midruleX_on_newpage(n)
+-- local n = n or 0
+-- ltt.tabular_row_pages_cntr = ltt.tabular_row_pages_cntr + 1
+-- tex.print('\\noalign{\\label{tabular@row@'..ltt.tabular_row_pages_cntr..'}}')
+-- if ltt.get_ref_page('tabular@row@'..ltt.tabular_row_pages_cntr) -
+-- ltt.get_ref_page('tabular@row@'..(ltt.tabular_row_pages_cntr-1)) == 1 then
+-- tex.print('\\setcounter{midruleX}{'..n..'}')
+-- end
+--end
+
+
--help_wrt('TEST COL ')
--for _, s in ipairs{ 'll', '*{6}{s}', 'l*{6}{l}', 'lll', 'll[]', 'll[]*{6}{l}', '*{6}{l}', 'y*{6}{sq}x', } do
-- ltt. set_col_spec(s)
diff --git a/macros/luatex/generic/lutabulartools/lutabulartools.pdf b/macros/luatex/generic/lutabulartools/lutabulartools.pdf
index bf53cad818..789cf01125 100644
--- a/macros/luatex/generic/lutabulartools/lutabulartools.pdf
+++ b/macros/luatex/generic/lutabulartools/lutabulartools.pdf
Binary files differ
diff --git a/macros/luatex/generic/lutabulartools/lutabulartools.sty b/macros/luatex/generic/lutabulartools/lutabulartools.sty
index abeb1afdef..5a501a8346 100644
--- a/macros/luatex/generic/lutabulartools/lutabulartools.sty
+++ b/macros/luatex/generic/lutabulartools/lutabulartools.sty
@@ -1,5 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2022-04-16
+% 2022-10-15
% Copyright (C) 2021-2022 Kale Ewasiuk
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -23,7 +23,7 @@
% OR OTHER DEALINGS IN THE SOFTWARE.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lutabulartools}[2022-04-16]
+\ProvidesPackage{lutabulartools}[2022-10-15]
\RequirePackage{booktabs}
\RequirePackage{multirow}
@@ -49,35 +49,13 @@
-%% adapted from
-% https://tex.stackexchange.com/questions/182953/add-midrule-every-5-lines-automatically
-%% https://tex.stackexchange.com/questions/145084/what-is-the-function-of-noalign
-
-\def\midruleXstep{5}
-\def\midruleXrule{\gmidrule}
-
-\newcounter{midruleX}
-\newcommand*{\midruleX}{%
- \aftergroup\aftergroup\aftergroup\midruleXaux
-}
-\newif\ifmidruleX
-
-\newcommand*{\midruleXaux}{%
- \noalign{%
- \stepcounter{midruleX}%
- \ifnum\value{midruleX}=\midruleXstep %
- \global\midruleXtrue
- \resetmidruleX%
- \else
- \global\midruleXfalse
- \fi
- }
- \ifmidruleX\midruleXrule\fi
-}
-\newcommand*{\resetmidruleX}{\setcounter{midruleX}{0}} %%% todo maybe put noalign in here
-
-\resetmidruleX
+%%% midrule every X rows
+\def\midruleX{\aftergroup\aftergroup\aftergroup\midruleX@aux}
+\def\midruleX@aux{\luadirect{lutabt.mrX.midruleX('')}} % todo argument for vadjust or noalign??
+\NewDocumentCommand{\setmidruleX}{s m}{\luadirect{lutabt.mrX.set_midruleX(\luastring{#2}, \luastring{#1})}}
+\NewDocumentCommand{\midruleXreset}{O{0}}{\luadirect{lutabt.mrX.cntr = tonumber(\luastring{#1})}}
+\NewCommandCopy\resetmidruleX\midruleXreset
@@ -235,3 +213,45 @@
% \newcolumntype{\ltt@ltrim}{@{\stepcounter{RowNumCnt}}}
%% \newcolumntype{\ltt@rtrim}{@{\luadirect{lutabt.get_TabColNum()}}}
%}
+
+
+%% adapted from
+% https://tex.stackexchange.com/questions/182953/add-midrule-every-5-lines-automatically
+%% https://tex.stackexchange.com/questions/145084/what-is-the-function-of-noalign
+%
+%\def\midruleXstep{5}
+%\def\midruleXrule{\gmidrule}
+%
+%\newcounter{midruleX}
+%\newcommand*{\midruleXa}{%
+% \aftergroup\aftergroup\aftergroup\midruleXaux
+%}
+%
+%\newif\ifmidruleX
+%
+%\newcommand*{\midruleXaux}{%
+% \noalign{%
+% \stepcounter{midruleX}%
+% \ifnum\value{midruleX}=\midruleXstep %
+% \global\midruleXtrue
+% \resetmidruleX%
+% \else
+% \global\midruleXfalse
+% \fi
+% }
+% \ifmidruleX\midruleXrule\fi
+%}
+
+%\newcommand*{\resetmidruleX}{\setcounter{midruleX}{0}} %
+%\resetmidruleX
+
+%\NewDocumentCommand{\resetmidruleXonNP}{O{0}}{\luadirect{lutabt.reset_midruleX_on_newpage(\luastring{#1})}}
+
+%
+%\NewDocumentCommand{\IfmidruleX}{m m}{% if a midruleX was placed, do #1, if not, do #2
+% \ifnum\the\value{midruleX}=0
+% #1
+% \else
+% #2
+% \fi%
+%} \ No newline at end of file
diff --git a/macros/luatex/generic/lutabulartools/lutabulartools.tex b/macros/luatex/generic/lutabulartools/lutabulartools.tex
index 8a2b5f8569..ecc35df511 100644
--- a/macros/luatex/generic/lutabulartools/lutabulartools.tex
+++ b/macros/luatex/generic/lutabulartools/lutabulartools.tex
@@ -1,5 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2022-04-16
+% 2022-10-15
% Copyright (C) 2021-2022 Kale Ewasiuk
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,10 +24,14 @@
\documentclass[11pt,parskip=half]{scrartcl}
+
+
\setlength{\parindent}{0ex}
+
\newcommand{\llcmd}[1]{\leavevmode\llap{\texttt{\detokenize{#1}\ }}}
-\newcommand{\cmd}[1]{\texttt{\detokenize{#1}}}
-\newcommand{\qcmd}[1]{``\cmd{#1}''}
+\def\cmd{\bgroup\catcode`\\=12 \catcode`\ =12 \cmdA}
+\def\cmdA#1{\egroup{\texttt{\detokenize{#1}}}}
+
\usepackage{url}
\usepackage{showexpl}
\lstset{explpreset={justification=\raggedright,pos=r,wide=true}}
@@ -57,18 +61,23 @@
\newcommand{\tMC}{\cmd{\\MC}}
+
+\usepackage{longtable}
+
\usepackage[pl,extrasnoglobals]{penlight}
\RequirePackage{lutabulartools}
\title{lutabulartools}
-\subtitle{some useful tabular tools (LuaLaTeX-based)}
+\subtitle{some useful LuaLaTeX-based tabular tools}
\usepackage{tabularx}
\usepackage{siunitx}
\lttdebugON
+\usepackage{hyperref}
+
\begin{document}
% todo: can improve naming... set col spec to a table instead of a string
@@ -127,31 +136,31 @@ However, the \cmd{\MC} command attempts to detect this automatically.
\llcmd{[cell spec]}%
Any letters placed in this argument are used for cell alignment.
-You can use one of three: \qcmd{t}, \qcmd{m}, \qcmd{b} for top, middle, bottom (vertical alignment),
-or \qcmd{l}, \qcmd{c}, \qcmd{r} for horizontal alignment.
+You can use one of three: \cmd{t}, \cmd{m}, \cmd{b} for top, middle, bottom (vertical alignment),
+and/or \cmd{l}, \cmd{c}, \cmd{r} for horizontal alignment, in no particular order.
By default, \cmd{\MC} will try to autodetect the horizontal alignment based on the current column.
If it can't, it will be left-aligned.
The default vertical alginment is top. More on this in section \ref{s.def}.
This argument can also contain two integers, separated by a comma (if two are used).
-\qcmd{C,R}, \qcmd{C}, or \qcmd{,R} are a valid inputs,
+\cmd{C,R}, \cmd{C}, or \cmd{,R} are a valid inputs,
where \cmd{R}=rows (int), and \cmd{C}=columns, (int).
If you want a 1 column wide, multirow cell,
-you can pass \qcmd{,R}. These numbers can be negative (positive numbers occupy columns to the right
+you can pass \cmd{,R}. These numbers can be negative (positive numbers occupy columns to the right
and rows below, and negative numbers occupy columns to the left and rows above).
If no spec is passed, (argument empty), \cmd{\MC}
acts like a \texttt{makecell}.
-Additionally, you can pass \qcmd{+} in place of C (number of columns wide),
+Additionally, you can pass \cmd{+} in place of C (number of columns wide),
and it will make the cell width fill until the end of the current row.
Examples:\\
-\qcmd{\MC[2,2]} means two columns wide, two rows tall.\\
-\qcmd{\MC[2,1]} or \qcmd{\MC[2]} means two columns wide, one row tall.\\
-\qcmd{\MC[1,2]} or \qcmd{\MC[,2]} means one column wide, two rows tall.\\
-\qcmd{\MC[+,2]}, if placed in the first column, occupies the entire row and is two rows tall.\\
-\qcmd{\MC[+,2]}, if placed in the second column, occupies the second column to the end of the table and is two rows tall.\\
+\cmd{\MC[2,2]} means two columns wide, two rows tall.\\
+\cmd{\MC[2,1]} or \cmd{\MC[2]} means two columns wide, one row tall.\\
+\cmd{\MC[1,2]} or \cmd{\MC[,2]} means one column wide, two rows tall.\\
+\cmd{\MC[+,2]}, if placed in the first column, occupies the entire row and is two rows tall.\\
+\cmd{\MC[+,2]}, if placed in the second column, occupies the second column to the end of the table and is two rows tall.\\
In any of these examples, you can place the alignment letters anywhere.
-So, \qcmd{\MC[l1,2b]} and \qcmd{\MC[1,2 lb]} are both left-bottom aligned (spaces are ignored).
+So, \cmd{\MC[l1,2b]} and \cmd{\MC[1,2 lb]} are both left-bottom aligned (spaces are ignored).
\llcmd{(override}%
@@ -298,9 +307,9 @@ or reference with respect to the last column (blank, \texttt{+1}, \texttt{+0}, o
or omit the last number.\\
\llcmd{\cmidrule}is a single partial rule, with the above features\\
\llcmd{\gcmidrule}is a single partial gray rule, with the above features\\
-You can add multiple \qcmd{cmidrule}'s with the \texttt{(g)cmidrules} command. Separate with a comma.
-You can apply global trimming of the rules with the \qcmd{()} optional argument, and then
-override it for a specific rule by placing \qcmd{r} or \qcmd{l} with the span specification.\\
+You can add multiple \cmd{cmidrule}'s with the \texttt{(g)cmidrules} command. Separate with a comma.
+You can apply global trimming of the rules with the \cmd{()} optional argument, and then
+override it for a specific rule by placing \cmd{r} or \cmd{l} with the span specification.\\
\llcmd{\gcmidrules}Can produce multiple, light gray partial rules\\
\llcmd{\cmidrules}Can produce multiple black partial rules.\\
Here's an example:
@@ -332,27 +341,34 @@ Here's an example:
\llcmd{\midruleX}%
With this command, you can place a rule
every X rows.
-You can change the step size and what kind of midrule you prefer.
-\begin{verbatim}
-\def\midruleXstep{5}
-\def\midruleXrule{\gmidrule}
-\end{verbatim}
-
-
-To use, insert \cmd{@{\midrulex}} at the end of each row using the tabular column spec.
+To use, place \cmd{@{\midruleX}} at the end of the tabular column spec, eg. \cmd{\begin{tabular}{ll@{\midruleX}}..}.
+You can configure the step size and what kind of midrule you prefer with the following key-val syntax, with default values below:\\
+\cmd{\setmidruleX{step=5,rule=midrule,reset=false,resetnum=0,cntr=0}}\\
+\cmd{step} is the number of rows (X) before applying the rule set by \cmd{rule}. \\
+Concering \cmd{longtable}s: If \cmd{reset} is set to \cmd{true},
+\cmd{\midruleX} will also add a unique \cmd{\label{}} on each row, and if the row starts on a newpage,
+resets the row counter to \cmd{resetnum}, to ensure you have the same X number of rows after the header of each page of a \cmd{longtable}.\\
+The starred version of first reverts the settings to default, then loads your inputted settings, which the non-starred
+version only overwrites the settings specified. \cmd{\setmidruleX*{}} will restore to default.
Before you want counting to begin, you should
apply \cmd{\resetmidruleX} to avoid header rows being counted.
-Use \cmd{\noalign{\resetmiduleX}} if you need place a rule on the same line or in a cell.
+Use \cmd{\noalign{\resetmiduleX}} if you need place a rule on the same line the reset takes place, or in a cell before \cmd{\\}.
+Note that \cmd{\resetmidruleX} resets the row counter to 0, and is in effect, a short-cut for \cmd{\setmidruleX{}} or \cmd{\setmidruleX{cntr=0}}
+%
+%\begin{tabular}{l@{\luadirect{tex.print('\\midrule')}}}
+% Hello \\
+%\end{tabular}
+%
\begin{LTXexample}
-\def\midruleXstep{3}
-\def\midruleXrule{\cmidrules{1,3-4r}}
+\setmidruleX{step=3,rule=gmidrule}
\begin{tabular}{rclc@{\midruleX}}
% ^^^ inject midrule
\toprule
Num & . & . & . \\
-\midrule\resetmidruleX % reset
+\midrule\resetmidruleX
+% reset so header dont count
1 & & & \\
2 & & & \\
3 & & & \\
@@ -364,10 +380,83 @@ Num & . & . & . \\
9 & & & \\
10 & & & \\
11 & & & \\
-\resetmidruleX % no bottom rule
+\resetmidruleX % resest
+ % so no bottom gray rule
12 & & & \\
\bottomrule
\end{tabular}
\end{LTXexample}
+%}
+
+%
+
+\pagebreak
+
+Here's an example with long table. Notice the gray rules reliably appear 3 rows after each header.
+\begin{verbatim}
+\setmidruleX{reset=true,resetnum=0}
+\def\tblhead{\toprule No & Name & Place & other\\\midrule}
+\def\tblcontinued{\MC[+l]{Continued...}\\}
+\def\tblcontinues\MC[+r]{...Continues}\\}
+\begin{longtable}{rclc@{\midruleX}}
+ \tblhead\endfirsthead
+ \tblcontinued\head\endhead % all the lines above this will be repeated on every page
+ \tblcontinues\endfoot
+ \bottomrule End.\endlastfoot
+ \resetmidruleX
+1 & & & \\
+2 & & & \\
+3 & & & \\
+4 & & & \\
+5 & & & \\
+6 & & & \\
+7 & & & \\
+8 & & & \\
+9 & & & \\
+10 & & & \\
+11 & & & \\
+12 & & & \\
+13 & & & \\
+14 & & & \\
+15 & & & \\\newpage
+16 & & & \\
+17 & & & \\\resetmidruleX
+18 & & & \\
+19 & & & \\
+\end{longtable}
+\end{verbatim}
+
+\setmidruleX{reset=true,resetnum=0}
+\def\tblhead{\toprule No & Name & Place & other\\\midrule}
+\def\tblcontinued{\MC[+l]{Continued...}\\}
+\def\tblcontinues{\MC[+r]{...Continues}\\}
+\begin{longtable}{rclc@{\midruleX}}
+ \tblhead\endfirsthead
+ \tblcontinued\tblhead\endhead % all the lines above this will be repeated on every page
+ \tblcontinues\endfoot
+ \bottomrule End.\endlastfoot
+ \resetmidruleX
+1 & & & \\
+2 & & & \\
+3 & & & \\
+4 & & & \\
+5 & & & \\
+6 & & & \\
+7 & & & \\
+8 & & & \\
+9 & & & \\
+10 & & & \\
+11 & & & \\
+12 & & & \\
+13 & & & \\
+14 & & & \\
+15 & & & \\\newpage
+16 & & & \\
+17 & & & \\
+18 & & & \\\resetmidruleX
+19 & & & \\
+\end{longtable}
+
+
\end{document}