summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-12-13 03:02:44 +0000
committerNorbert Preining <norbert@preining.info>2022-12-13 03:02:44 +0000
commit7b8bd496c62a5a8e18fb7a038217d4118c02b1e2 (patch)
treeef531a0b7c481a8139f7603155e33684ad95e40e /macros
parentd9c472147310b678beb9f80f0e90fc82f8825ec5 (diff)
CTAN sync 202212130302
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/bibcop/DEPENDS.txt3
-rw-r--r--macros/latex/contrib/bibcop/LICENSE.txt21
-rw-r--r--macros/latex/contrib/bibcop/README.md54
-rw-r--r--macros/latex/contrib/bibcop/bibcop-logo.pdfbin0 -> 5100 bytes
-rw-r--r--macros/latex/contrib/bibcop/bibcop.dtx346
-rw-r--r--macros/latex/contrib/bibcop/bibcop.ins55
-rw-r--r--macros/latex/contrib/bibcop/bibcop.pdfbin0 -> 330862 bytes
-rwxr-xr-xmacros/latex/contrib/bibcop/bibcop.pl492
-rw-r--r--macros/latex/contrib/csbulletin/README2
-rw-r--r--macros/latex/contrib/csbulletin/doc/csbulletin.pdfbin276383 -> 276383 bytes
-rw-r--r--macros/latex/contrib/csbulletin/doc/csbulletin.tex2
-rw-r--r--macros/latex/contrib/csbulletin/tex/csbulletin.cls4
-rw-r--r--macros/latex/contrib/minted/minted.dtx701
-rw-r--r--macros/latex/contrib/minted/minted.ins2
-rw-r--r--macros/latex/contrib/minted/minted.pdfbin845885 -> 859601 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin510884 -> 510920 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx814
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin1324741 -> 1326867 bytes
-rw-r--r--macros/latex/contrib/ukbill/README3
-rw-r--r--macros/latex/contrib/ukbill/immigration-bill.pdfbin85276 -> 85020 bytes
-rw-r--r--macros/latex/contrib/ukbill/immigration-bill.tex10
-rw-r--r--macros/latex/contrib/ukbill/ukbill-documentation.pdfbin98091 -> 97522 bytes
-rw-r--r--macros/latex/contrib/ukbill/ukbill-documentation.tex5
-rw-r--r--macros/latex/contrib/ukbill/ukbill.cls2
-rw-r--r--macros/luatex/latex/luaquotes/README3
-rw-r--r--macros/luatex/latex/luaquotes/luaquotes-documentation.pdfbin111052 -> 113378 bytes
-rw-r--r--macros/luatex/latex/luaquotes/luaquotes-documentation.tex320
-rw-r--r--macros/luatex/latex/luaquotes/luaquotes.sty58
-rw-r--r--macros/luatex/latex/scikgtex/LICENSE21
-rw-r--r--macros/luatex/latex/scikgtex/README21
-rw-r--r--macros/luatex/latex/scikgtex/scikgtex.lua685
-rw-r--r--macros/luatex/latex/scikgtex/scikgtex.sty149
32 files changed, 3008 insertions, 765 deletions
diff --git a/macros/latex/contrib/bibcop/DEPENDS.txt b/macros/latex/contrib/bibcop/DEPENDS.txt
new file mode 100644
index 0000000000..08a680f05b
--- /dev/null
+++ b/macros/latex/contrib/bibcop/DEPENDS.txt
@@ -0,0 +1,3 @@
+hard iexec
+hard fancyvrb
+hard verbatimcopy \ No newline at end of file
diff --git a/macros/latex/contrib/bibcop/LICENSE.txt b/macros/latex/contrib/bibcop/LICENSE.txt
new file mode 100644
index 0000000000..463e7d252d
--- /dev/null
+++ b/macros/latex/contrib/bibcop/LICENSE.txt
@@ -0,0 +1,21 @@
+(The MIT License)
+
+Copyright (c) 2022 Yegor Bugayenko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the 'Software'), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/macros/latex/contrib/bibcop/README.md b/macros/latex/contrib/bibcop/README.md
new file mode 100644
index 0000000000..b3cbd2ef8a
--- /dev/null
+++ b/macros/latex/contrib/bibcop/README.md
@@ -0,0 +1,54 @@
+<img src="https://raw.githubusercontent.com/yegor256/bibcop/master/logo.svg" height="92px"/>
+
+[![l3build](https://github.com/yegor256/bibcop/actions/workflows/l3build.yml/badge.svg)](https://github.com/yegor256/bibcop/actions/workflows/l3build.yml)
+[![CTAN](https://img.shields.io/ctan/v/bibcop)](https://ctan.org/pkg/bibcop)
+[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/bibcop/blob/master/LICENSE.txt)
+
+This LaTeX package checks the quality of your `.bib` file and
+emits warning message if any issues found. You may also like
+[biblint](https://github.com/Kingsford-Group/biblint) tool —
+it does almost the same but from the command line.
+
+First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)
+from [CTAN](https://ctan.org/pkg/bibcop)
+and then use in the preamble (if you use BibTeX, for example):
+
+```tex
+\documentclass{article}
+\usepackage{bibcop}
+\begin{document}
+\bibliographystyle{plain}
+\bibliography{main}
+\end{document}
+```
+
+Otherwise, you can download [`bibcop.sty`](https://raw.githubusercontent.com/yegor256/bibcop/gh-pages/bibcop/bibcop.sty) and add to your project.
+
+You can also download [bibcop.pl](https://raw.githubusercontent.com/yegor256/bibcop/master/bibcop.pl)
+and use it as a command line tool
+to check your `.bib` files and to auto-fix them:
+
+```
+$ ./bibcop.pl --fix main.bib > fixed.bib
+```
+
+This command will read the `main.bib` file and create `fixed.bib`, which
+will have the fixed and properly formatted content (well, to some extent).
+
+## How to Contribute
+
+If you want to contribute yourself, make a fork, then create a branch,
+then run `l3build ctan` in the root directory.
+It should compile everything without errors. If not, submit an issue and wait.
+Otherwise, make your changes and then run `l3build ctan` again. If the build is
+still clean, submit a pull request.
+
+If you want to add a new check, add it as a Perl subroutine to the `bibcop.pl` file.
+Don't forget to add a test to one of the test files that stay in the `perl-tests/` directory.
+When ready, run this, in order to check that all tests pass:
+
+```bash
+$ ./tests.pl
+```
+
+You should see the `GREAT!` message. \ No newline at end of file
diff --git a/macros/latex/contrib/bibcop/bibcop-logo.pdf b/macros/latex/contrib/bibcop/bibcop-logo.pdf
new file mode 100644
index 0000000000..497d52dc0b
--- /dev/null
+++ b/macros/latex/contrib/bibcop/bibcop-logo.pdf
Binary files differ
diff --git a/macros/latex/contrib/bibcop/bibcop.dtx b/macros/latex/contrib/bibcop/bibcop.dtx
new file mode 100644
index 0000000000..07d513b49f
--- /dev/null
+++ b/macros/latex/contrib/bibcop/bibcop.dtx
@@ -0,0 +1,346 @@
+% \iffalse meta-comment
+% (The MIT License)
+%
+% Copyright (c) 2022 Yegor Bugayenko
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the 'Software'), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
+% \fi
+
+% \CheckSum{0}
+%
+% \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
+% Lower-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
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+
+% \GetFileInfo{bibcop.dtx}
+% \DoNotIndex{\endgroup,\begingroup,\let,\else,\s,\n,\r,\\,\1,\fi}
+
+% \iffalse
+%<*driver>
+\ProvidesFile{bibcop.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{bibcop}
+%<*package>
+[2022-12-12 0.0.2 Style Checker of Bibliography Files]
+%</package>
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[maxnames=1,minnames=1,maxbibnames=1,natbib=true,citestyle=authoryear,bibstyle=authoryear,doi=false,url=false,isbn=false,isbn=false]{biblatex}
+\addbibresource{bibcop.bib}
+\usepackage[tt=false, type1=true]{libertine}
+\usepackage{microtype}
+\AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}
+\usepackage{href-ul}
+\usepackage{xcolor}
+\usepackage{graphicx}
+\PageIndex
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{bibcop.dtx}
+ \PrintChanges
+ \PrintIndex
+\end{document}
+%</driver>
+% \fi
+
+% \title{\includegraphics[height=1in]{bibcop-logo.pdf} \\ |bibcop|: \LaTeX{} Package \\ for Style Checking of |.bib| Files\thanks{The sources are in GitHub at \href{https://github.com/yegor256/bibcop}{yegor256/bibcop}}}
+% \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}}
+% \date{\filedate, \fileversion}
+%
+% \maketitle
+%
+% \textbf{\color{red}NB!}
+% You must run \TeX{} processor with |--shell-escape| option
+% and you must have \href{https://www.perl.org}{Perl} installed.
+% This package doesn't work on Windows.
+
+% \section{Introduction}
+%
+% This package scans your |.bib| files for style errors and emits
+% warning messages if any issues are found (make sure you use it before
+% all other bibliography related packages):
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\documentclass{article}
+\usepackage{bibcop}
+\begin{document}
+\bibliographystyle{plain}
+\bibliography{main}
+\end{document}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% You may see warnings in the \TeX log. Fix the issues in the |main.bib| file
+% and the warnings will disappear.
+
+% If you use the |.sty| file (without installing it into the \TeX{} tree), don't forget
+% to also copy the |bibcop.pl| file --- it is the Perl script that does all the work
+% of checking your |.bib| files. The |.sty| is just a simple wrapper around it.
+
+% Make sure |\usepackage{bibcop}| stays before all other |\usepackage| commands, otherwise
+% you won't see any warnings from |bibcop|.
+
+% \section{The Rules}
+
+% This is a more or less complete list of rules we enforce on a |.bib| file:
+
+% \DescribeMacro{types}
+% Only |@article|, |@book|, |@inproceedings|, and |@misc| types of bib items are allowed.
+% Everything else, like |@manual|, |@phdthesis|, and many others are simply prohibited.
+% The mentioned four should be enough for everything.
+
+% \DescribeMacro{keys}
+% There are pretty limited lists of allowed keys for each type of bib item. The keys
+% that are not in the list are prohibited to use.
+
+% \DescribeMacro{doi}
+% Every bib item must have the |doi| key, which is a unique
+% \href{https://www.doi.org}{Digital Object Identifier}
+% of the material that you reference. It seems to be a good practice, in order to avoid ambiguity,
+% to always mention the DOI.
+
+% \DescribeMacro{caps}
+% In |title|, |booktitle|, and |journal| keys, all major words must be capitalized,
+% as it is \href{https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case}{recommended by APA}:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+title = {A Preliminary Architecture for a Basic Data-Flow Processor}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% Here, the leading ``|A|'' is capital because it opens the title.
+% The word ``|for|'' and the article ``|a|'' are minor words, that's why they are in lower case.
+% Both parts of the composite word ``|Data-Flow|'' are capitalized.
+
+% \DescribeMacro{author}
+% The |author| must contain a list of authors separated by ``|and|''. Each author
+% must have two parts separated by a comma. The first part is the last name of the author,
+% the second part is a list of their first names separated by a space, for example:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+author = {Knuth, Donald E. and Duane, Bibby}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% When the list of authors is too long, it's possible to say ``|and others|'':
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+author = {Knuth, Donald E. and others}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% When first names are shortened to a single letter, it has to have a tailing dot.
+
+% \DescribeMacro{shorts}
+% It is not allowed to shorten any words, for example this is illegal:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+journal = {J. Log. Comput.}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% This must be replaced with the following:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+journal = {Journal of Logic and Computation}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{brackets}
+% The |title|, |booktitle|, and |journal| must be wrapped with double brackets, for example:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+title = {{A Survey of Symbolic Execution Techniques}}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% This is necessary in order to prevent down-casing of capitalized words, which is done by some
+% bibliography styles.
+
+% \DescribeMacro{year}
+% It is not allowed to mention the year inside the title of a conference or a journal, for example,
+% this would be illegal:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+booktitle = {{1994 IEEE International Conference on Computer Languages}},
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+% The year should only be mentioned in the |year| key, nowhere else.
+% In the |year| key only numbers are allowed:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+year = {1994},
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{month}
+% The |month| may contain only a number:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+month = {12},
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{volume}
+% The |volume| may contain only a number:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+volume = {32},
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{pages}
+% The |pages| may contain either a number or two numbers separated by a double dash:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+pages = {145--163},
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \DescribeMacro{proceedings}
+% The |booktitle| in the |@inproceedings| bib item must always start with ``|Proceedings| |of| |the|'',
+% as in this example:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+booktitle = {{Proceedings of the International
+ Conference on Computer Languages}},
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% \StopEventually{}
+
+% \section{Implementation}
+% \changes{0.0.1}{2022/12/11}{First draft.}
+% \changes{0.0.2}{2022/12/12}{Documentation extended, more rules added.}
+
+% First, we include a few packages.
+% We need \href{https://ctan.org/pkg/iexec}{iexec} for executing Perl scripts:
+% \begin{macrocode}
+\RequirePackage{iexec}
+% \end{macrocode}
+
+% \begin{macro}{bibcop.pl}
+% Then, we copy the Perl script using |\VerbatimCopy| from
+% \href{https://ctan.org/pkg/verbatimcopy}{verbatimcopy}:
+% \begin{macrocode}
+\RequirePackage{verbatimcopy}
+\VerbatimCopy{bibcop.pl}{bibcop.tmp.pl}
+\message{bibcop: File with Perl script 'bibcop.pl' copied^^J}%
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\bibliography}
+% Then, we re-define the |\bibliography| command:
+% \begin{macrocode}
+\makeatletter
+\ifdefined\bibliography\else\gdef\bibliography#1{}\fi
+\let\bibcop@oldbibliography\bibliography
+\renewcommand\bibliography[1]{%
+ \iexec{perl "./bibcop.tmp.pl" --latex '#1.bib'}%
+ \bibcop@oldbibliography{#1}%
+}
+\makeatother
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\addbibresource}
+% Then, we re-define the |\addbibresource| command:
+% \begin{macrocode}
+\makeatletter
+\ifdefined\addbibresource\else\gdef\addbibresource#1{}\fi
+\let\bibcop@oldaddbibresource\addbibresource
+\renewcommand\addbibresource[1]{%
+ \iexec{perl "./bibcop.tmp.pl" --latex '#1'}%
+ \bibcop@oldaddbibresource{#1}%
+}
+\makeatother
+% \end{macrocode}
+% \end{macro}
+
+% \Finale
+
+% \clearpage
+% \printbibliography
+% \clearpage
+
+% \PrintChanges
+% \clearpage
+% \PrintIndex
diff --git a/macros/latex/contrib/bibcop/bibcop.ins b/macros/latex/contrib/bibcop/bibcop.ins
new file mode 100644
index 0000000000..4c619469dd
--- /dev/null
+++ b/macros/latex/contrib/bibcop/bibcop.ins
@@ -0,0 +1,55 @@
+%% (The MIT License)
+%%
+%% Copyright (c) 2022 Yegor Bugayenko
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a copy
+%% of this software and associated documentation files (the 'Software'), to deal
+%% in the Software without restriction, including without limitation the rights
+%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+%% copies of the Software, and to permit persons to whom the Software is
+%% furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in all
+%% copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+%% SOFTWARE.
+
+\input docstrip.tex
+\keepsilent
+\usedir{macros/latex/contrib/bibcop}
+\preamble
+(The MIT License)
+
+Copyright (c) 2022 Yegor Bugayenko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the 'Software'), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+\endpreamble
+\generate{\file{bibcop.sty}{\from{bibcop.dtx}{package}}}
+\obeyspaces
+\Msg{To finish the installation you have to move the ".sty"}
+\Msg{file into a directory searched by TeX. To produce the}
+\Msg{documentation run the file ".dtx" through LaTeX. If any}
+\Msg{questions, submit a new GitHub issue.}
+\endbatchfile
diff --git a/macros/latex/contrib/bibcop/bibcop.pdf b/macros/latex/contrib/bibcop/bibcop.pdf
new file mode 100644
index 0000000000..a8320c97a1
--- /dev/null
+++ b/macros/latex/contrib/bibcop/bibcop.pdf
Binary files differ
diff --git a/macros/latex/contrib/bibcop/bibcop.pl b/macros/latex/contrib/bibcop/bibcop.pl
new file mode 100755
index 0000000000..3fa1444b92
--- /dev/null
+++ b/macros/latex/contrib/bibcop/bibcop.pl
@@ -0,0 +1,492 @@
+#!/usr/bin/perl
+# (The MIT License)
+#
+# Copyright (c) 2022 Yegor Bugayenko
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the 'Software'), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+package bibcop;
+
+use warnings;
+use strict;
+
+# If you want to add an extra check, just create a new procedure
+# named as "check_*".
+
+# Only these keys are allowed and only these types of items.
+my %blessed = (
+ 'article' => ['doi', 'year', 'title', 'author', 'journal', 'volume', 'number', 'publisher?'],
+ 'inproceedings' => ['doi', 'booktitle', 'title', 'author', 'year', 'pages?', 'organization?', 'volume?'],
+ 'book' => ['doi', 'title', 'author', 'year', 'publisher'],
+ 'misc' => ['title', 'author', 'year', 'eprint?', 'archiveprefix?', 'primaryclass?', 'publisher?', 'organization?', 'doi?'],
+);
+
+# Check the presence of mandatory keys.
+sub check_mandatory_keys {
+ my (%item) = @_;
+ my $type = $item{':type'};
+ my $mandatory = $blessed{$type};
+ foreach my $key (@$mandatory) {
+ if ($key =~ /^.*\?$/) {
+ next;
+ }
+ if (not(exists $item{$key})) {
+ my $listed = listed_keys(%item);
+ return "A mandatory '$key' key for '\@$type' is missing among $listed"
+ }
+ }
+ if (exists $blessed{$type}) {
+ my %required = map { $_ => 1 } @$mandatory;
+ foreach my $key (keys %item) {
+ if ($key =~ /^:/) {
+ next;
+ }
+ if (not(exists $required{$key}) && not(exists $required{$key . '?'})) {
+ return "The '$key' key is not suitable for '$type', use only these: (@$mandatory)"
+ }
+ }
+ }
+}
+
+# Check that all major words are capitalized.
+sub check_capitalization {
+ my (%item) = @_;
+ my %keys = map { $_ => 1 } qw/title booktitle journal/;
+ my %minors = map { $_ => 1 } qw/in of at to by the a an and or as if up via yet nor but off on for into/;
+ foreach my $key (keys %item) {
+ if (not exists $keys{$key}) {
+ next;
+ }
+ my $value = $item{$key};
+ my @words = only_words($value);
+ my $pos = 0;
+ foreach my $word (@words) {
+ if (not $word =~ /^[A-Za-z]/) {
+ next;
+ }
+ $pos = $pos + 1;
+ if (exists $minors{$word}) {
+ next;
+ }
+ if (exists $minors{lc($word)} and $pos gt 1) {
+ return "All minor words in the '$key' must be lower-cased, while '$word' (no.$pos) is not"
+ }
+ if ($word =~ /^[a-z].*/) {
+ return "All major words in the '$key' must be capitalized, while '$word' (no.$pos) is not"
+ }
+ }
+ }
+}
+
+# Check that the 'author' is formatted correctly.
+sub check_author {
+ my (%item) = @_;
+ if (exists $item{'author'} and not $item{'author'} =~ /^\{.+\}$/) {
+ my $author = clean_tex($item{'author'});
+ if (not $author =~ /^[A-Z][^ ]+(,( [A-Z][^ ]+)+)?( and [A-Z][^ ]+(,( [A-Z][^ ]+)+)?)*( and others)?$/) {
+ return "The format of the 'author' is wrong, use something like 'Knuth, Donald E. and Duane, Bibby'"
+ }
+ if ($author =~ /.*[A-Z]([ ,]|$).*/) {
+ return "A shortened name must have a tailing dot, as in 'Knuth, Donald E.'"
+ }
+ }
+}
+
+# Check that titles don't have shortened words with a tailing dot.
+sub check_shortenings {
+ my (%item) = @_;
+ my %keys = map { $_ => 1 } qw/title booktitle journal/;
+ foreach my $key (keys %item) {
+ if (not exists $keys{$key}) {
+ next;
+ }
+ my $value = $item{$key};
+ my @words = only_words($value);
+ foreach my $word (@words) {
+ if (not $word =~ /^[A-Za-z]/) {
+ next;
+ }
+ if ($word =~ /^.*\.$/) {
+ return "Do not shorten the words in the '$key', such as '$word'"
+ }
+ }
+ }
+}
+
+# Check the right format of the 'title' and 'booktitle.'
+sub check_titles {
+ my (%item) = @_;
+ my @keys = qw/title booktitle/;
+ foreach my $key (@keys) {
+ if (not exists($item{$key})) {
+ next;
+ }
+ my $title = $item{$key};
+ if (not $title =~ /^\{.+\}$/) {
+ return "The '$key' must be wrapped in double curled brackets"
+ }
+ }
+}
+
+# Check that no values have tailing dots.
+# Check that there are no spaces before commans.
+sub check_typography {
+ my (%item) = @_;
+ foreach my $key (keys %item) {
+ if ($key =~ /^:.*/) {
+ next;
+ }
+ my $value = $item{$key};
+ if ($value =~ /.*\.$/ and $key ne 'author') {
+ return "The '$key' must not end with a dot"
+ }
+ if ($value =~ /.* ,.*/) {
+ return "In the '$key', do not put a space before the comma"
+ }
+ }
+}
+
+# Check the year is not mentioned in titles.
+sub check_year_in_titles {
+ my (%item) = @_;
+ my @keys = qw/title booktitle journal/;
+ foreach my $key (@keys) {
+ if (not exists($item{$key})) {
+ next;
+ }
+ my @words = only_words($item{$key});
+ foreach my $word (@words) {
+ if ($word =~ /^[1-9][0-9]{3}$/) {
+ return "The '$key' must not contain the year $word, it is enough to have the 'year' key"
+ }
+ }
+ }
+}
+
+# Check the right format of the 'booktitle' in the 'inproceedings' item.
+sub check_booktile_of_inproceedings {
+ my (%item) = @_;
+ my $key = 'inproceedings';
+ if ($item{':type'} eq $key) {
+ if (exists $item{'booktitle'}) {
+ my @words = only_words($item{'booktitle'});
+ if (lc($words[0]) ne 'proceedings' or lc($words[1]) ne 'of' or lc($words[2]) ne 'the') {
+ return "The '$key' must start with 'Proceedings of the ...'"
+ }
+ }
+ }
+}
+
+# Check the right format of the 'doi.'
+sub check_doi {
+ my (%item) = @_;
+ if (exists $item{'doi'}) {
+ my $doi = $item{'doi'};
+ if (not $item{'doi'} =~ /^[0-9a-zA-Z.]+\/[0-9a-zA-Z._\-]+$/) {
+ return "The format of the 'doi' is wrong"
+ }
+ }
+}
+
+# Check the right format of the 'year.'
+sub check_year {
+ my (%item) = @_;
+ if (exists $item{'year'}) {
+ my $year = $item{'year'};
+ if (not $item{'year'} =~ /^[0-9]{3,4}$/) {
+ return "The format of the 'year' is wrong"
+ }
+ }
+}
+
+# Check the right format of the 'month.'
+sub check_month {
+ my (%item) = @_;
+ if (exists $item{'month'}) {
+ my $month = $item{'month'};
+ if (not $item{'month'} =~ /^[1-9]|10|11|12$/) {
+ return "The format of the 'month' is wrong"
+ }
+ }
+}
+
+# Check the right format of the 'volume.'
+sub check_volume {
+ my (%item) = @_;
+ if (exists $item{'volume'}) {
+ my $volume = $item{'volume'};
+ if (not $item{'volume'} =~ /^[1-9][0-9]*$/) {
+ return "The format of the 'volume' is wrong"
+ }
+ }
+}
+
+# Check the right format of the 'pages.'
+sub check_pages {
+ my (%item) = @_;
+ if (exists $item{'pages'}) {
+ my $pages = $item{'pages'};
+ if (not $item{'pages'} =~ /^[1-9][0-9]*--[1-9][0-9]*|[1-9][0-9]*$/) {
+ return "The format of the 'pages' is wrong"
+ }
+ my @parts = split(/--/, $pages);
+ if (@parts+0 eq 2) {
+ if ($parts[0] gt $parts[1]) {
+ return "The 'pages' are in the wrong order"
+ }
+ }
+ }
+}
+
+# Check one item.
+sub process_item {
+ my (%item) = @_;
+ my @checks;
+ foreach my $entry (keys %bibcop::) {
+ if ($entry =~ /^check_/) {
+ push(@checks, $entry);
+ }
+ }
+ my @sorted = sort @checks;
+ my @errors;
+ foreach my $check (@sorted) {
+ no strict 'refs';
+ my $err = $check->(%item);
+ if ($err ne '') {
+ push(@errors, $err);
+ }
+ }
+ return @errors;
+}
+
+# Parse the incoming .bib file and return an array
+# of hash-maps, where each one is a bibitem.
+sub bibitems {
+ my ($bib) = @_;
+ my @items;
+ my $s = 'top';
+ my %item;
+ my $acc = '';
+ my $key = '';
+ my $lineno = 0;
+ my $nest = 0;
+ my $escape = 0;
+ for my $pos (0..length($bib)-1) {
+ my $char = substr($bib, $pos, 1);
+ if ($char eq ' ') {
+ # ignore the white space
+ } elsif ($char eq "\n") {
+ # ignore the EOL
+ $lineno = $lineno + 1;
+ } elsif ($char eq '@' and $s eq 'top') {
+ %item = ();
+ $s = 'start';
+ $acc = '';
+ } elsif ($char =~ /[a-z]/ and $s eq 'start') {
+ # @article
+ } elsif ($char eq '{' and $s eq 'start') {
+ $item{':type'} = substr($acc, 1);
+ $acc = '';
+ $s = 'body';
+ } elsif ($char =~ /[a-zA-Z]/ and $s eq 'body') {
+ $acc = '';
+ $s = 'key';
+ } elsif ($char =~ /[a-zA-Z0-9_]/ and $s eq 'key') {
+ # reading the key
+ } elsif ($char =~ /[a-zA-Z0-9]/ and $s eq 'value') {
+ # reading the value without quotes or brackets
+ } elsif ($char eq ',' and $s eq 'key') {
+ $item{':name'} = $acc;
+ $s = 'body';
+ } elsif ($char eq '=' and $s eq 'key') {
+ $key = $acc;
+ $s = 'value';
+ $acc = '';
+ } elsif ($char eq ',' and $s eq 'value') {
+ if (not exists $item{lc($key)}) {
+ my $tex = substr($acc, 1);
+ $tex =~ s/\s//g;
+ $item{lc($key)} = $tex;
+ }
+ $s = 'body';
+ } elsif ($char eq '}' and $s eq 'body') {
+ push(@items, { %item });
+ $s = 'top';
+ } elsif ($char eq '}' and $s eq 'value') {
+ if (not exists $item{lc($key)}) {
+ my $tex = substr($acc, 1);
+ $tex =~ s/\s//g;
+ $item{lc($key)} = $tex;
+ }
+ push(@items, { %item });
+ $s = 'top';
+ } elsif ($char eq '}' and $s eq 'key') {
+ $item{':name'} = $acc;
+ push(@items, { %item });
+ $s = 'top';
+ } elsif ($char eq '"' and $s eq 'value') {
+ $s = 'quote';
+ $acc = '';
+ } elsif ($char eq '"' and $s eq 'quote') {
+ $item{lc($key)} = substr($acc, 1);
+ $s = 'value';
+ } elsif ($s eq 'quote') {
+ # nothing
+ } elsif ($char eq '{' and $s eq 'value') {
+ $nest = 1;
+ $s = 'brackets';
+ $acc = '';
+ } elsif ($s eq 'brackets') {
+ if ($char eq '\\') {
+ $escape = 1;
+ } elsif ($char eq '{' and $escape ne 1) {
+ $nest = $nest + 1;
+ } elsif ($char eq '}' and $escape ne 1) {
+ $nest = $nest - 1;
+ if ($nest eq 0) {
+ $item{lc($key)} = substr($acc, 1);
+ $s = 'value';
+ }
+ }
+ $escape = 0;
+ } else {
+ print "\\PackageWarningNoLine{bibcop}{It is impossible to parse the .bib file, because I do not know what to do with '$char' at line #$lineno (s=$s)}\n";
+ last;
+ }
+ if ($char eq ' ' and not($s =~ /quote|brackets/)) {
+ next;
+ }
+ $acc = $acc . $char;
+ }
+ return @items;
+}
+
+# Takes the text and returns only list of words seen there.
+sub only_words {
+ my ($tex) = @_;
+ return split(/[ \-]/, clean_tex($tex));
+}
+
+# Take a TeX string and return a cleaner one, without redundant spaces, brackets, etc.
+sub clean_tex {
+ my ($tex) = @_;
+ $tex =~ s/\s+/ /g;
+ $tex =~ s/^\{+//g;
+ $tex =~ s/\}+$//g;
+ return $tex;
+}
+
+# Take a bibitem and print all its keys as a comma-separated string.
+sub listed_keys {
+ my (%item) = @_;
+ my @list;
+ foreach my $key (keys %item) {
+ if ($key =~ /^:.*/) {
+ next;
+ }
+ push(@list, $key);
+ }
+ my @sorted = sort @list;
+ return '(' . join(', ', @sorted) . ')';
+}
+
+my %args = map { $_ => 1 } @ARGV;
+if (@ARGV+0 eq 0 or exists $args{'--help'}) {
+ debug("Bibcop is a Style Checker of .bib Files\n" .
+ "Usage: bibcop [<options>] <.bib file path>\n" .
+ " --version Print the current version of the tool and exit\n" .
+ " --help Print this help screen\n" .
+ " --fix Fix the errors and print a new version of the .bib file to the console\n" .
+ " --latex Report errors in LaTeX format using \\PackageWarningNoLine command");
+} elsif (exists $args{'--version'}) {
+ debug('0.0.2');
+} else {
+ my ($file) = grep { not($_ =~ /^--.*$/) } @ARGV;
+ open(my $fh, '<', $file);
+ my $bib; { local $/; $bib = <$fh>; }
+ my @items = bibitems($bib);
+ if (exists $args{'--fix'}) {
+ for my $i (0..(@items+0 - 1)) {
+ my %item = %{ $items[$i] };
+ my $type = $item{':type'};
+ if (not exists $blessed{$type}) {
+ error("I don't know what to do with \@$type type of bibitem");
+ }
+ my $keys = $blessed{$item{':type'}};
+ my %allowed = map { $_ => 1 } @$keys;
+ my @lines;
+ foreach my $key (keys %item) {
+ if ($key =~ /^:/) {
+ next;
+ }
+ if (not exists $allowed{$key} and not exists $allowed{$key . '?'}) {
+ next;
+ }
+ my $value = clean_tex($item{$key});
+ if ($key =~ /title|booktitle|journal/) {
+ $value = '{' . $value . '}';
+ }
+ push(@lines, " $key = {$value},");
+ }
+ debug("\@$type\{$item{':name'},");
+ my @sorted = sort @lines;
+ foreach my $line (@sorted) {
+ debug($line);
+ }
+ debug("}\n");
+ }
+ } else {
+ debug((@items+0) . ' bibitems found in ' . $file);
+ for my $i (0..(@items+0 - 1)) {
+ my %item = %{ $items[$i] };
+ debug("Checking $item{':name'} (#$i)...");
+ foreach my $err (process_item(%item)) {
+ warning("$err, in the '$item{':name'}' bibitem");
+ }
+ }
+ }
+}
+
+# Print ERROR message to the console and die.
+sub error {
+ my ($txt) = @_;
+ print $txt . "\n";
+ exit 1;
+}
+
+# Print DEBUG message to the console.
+sub debug {
+ my ($txt) = @_;
+ if (exists $args{'--latex'}) {
+ print '% ';
+ }
+ print $txt . "\n";
+}
+
+# Print INFO message to the console.
+sub warning {
+ my ($txt) = @_;
+ if (exists $args{'--latex'}) {
+ print "\\PackageWarningNoLine{bibcop}{$txt}\n";
+ } else {
+ print $txt . "\n";
+ }
+}
+
+1;
diff --git a/macros/latex/contrib/csbulletin/README b/macros/latex/contrib/csbulletin/README
index 2dbbecfc7a..e19816fae1 100644
--- a/macros/latex/contrib/csbulletin/README
+++ b/macros/latex/contrib/csbulletin/README
@@ -1,5 +1,5 @@
=============================================================================
-Package: csbulletin 2 December 2022
+Package: csbulletin 12 December 2022
Maintainer: Vít Novotný <witiko@mail.muni.cz> License: LPPL 1.3c
=============================================================================
diff --git a/macros/latex/contrib/csbulletin/doc/csbulletin.pdf b/macros/latex/contrib/csbulletin/doc/csbulletin.pdf
index 5f6da725a6..1401deecaf 100644
--- a/macros/latex/contrib/csbulletin/doc/csbulletin.pdf
+++ b/macros/latex/contrib/csbulletin/doc/csbulletin.pdf
Binary files differ
diff --git a/macros/latex/contrib/csbulletin/doc/csbulletin.tex b/macros/latex/contrib/csbulletin/doc/csbulletin.tex
index c4c30b0954..ed305ce8a7 100644
--- a/macros/latex/contrib/csbulletin/doc/csbulletin.tex
+++ b/macros/latex/contrib/csbulletin/doc/csbulletin.tex
@@ -1,6 +1,6 @@
%% $Id$
\documentclass{csbulletin}
-\DeclareRobustCommand\version{\unskip~2022/12/02}
+\DeclareRobustCommand\version{\unskip~2022/12/12}
\let\pkg\textsc
\usepackage[pdftitle=LaTeX\ Class\ for\ CSTUG\ Bulletin, pdfauthor={Zdenek\ Wagner, Vit\ Novotny},
diff --git a/macros/latex/contrib/csbulletin/tex/csbulletin.cls b/macros/latex/contrib/csbulletin/tex/csbulletin.cls
index 7a4ec6c207..f34e7fa55b 100644
--- a/macros/latex/contrib/csbulletin/tex/csbulletin.cls
+++ b/macros/latex/contrib/csbulletin/tex/csbulletin.cls
@@ -1,4 +1,4 @@
-\ProvidesClass{csbulletin}[2022/11/29 CSTUG Bulletin class]
+\ProvidesClass{csbulletin}[2022/12/12 CSTUG Bulletin class]
\ClassInfo{csbulletin}{$Id$}
% Switch
@@ -310,7 +310,7 @@
\headheight \z@
\headsep \z@
\textwidth 27cc
-\evensidemargin 16mm
+\evensidemargin 13mm
\textheight 41\baselineskip
\advance\textheight \topskip
\topmargin 13mm
diff --git a/macros/latex/contrib/minted/minted.dtx b/macros/latex/contrib/minted/minted.dtx
index 3d2ac0219d..6ff75d9069 100644
--- a/macros/latex/contrib/minted/minted.dtx
+++ b/macros/latex/contrib/minted/minted.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2013-2021 by Geoffrey M. Poore <gpoore@gmail.com>
+% Copyright (C) 2013-2022 by Geoffrey M. Poore <gpoore@gmail.com>
% Copyright (C) 2010-2011 by Konrad Rudolph <konrad_rudolph@madrat.net>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
@@ -31,7 +31,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{minted}
%<*package>
- [2021/12/24 v2.6 Yet another Pygments shim for LaTeX]
+ [2022/12/12 v2.7 Yet another Pygments shim for LaTeX]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -55,6 +55,7 @@
\usepackage{multicol}
\usepackage{hyperref}
+\newcommand{\env}[1]{\texttt{#1}}
\makeatletter
% The typesetting for macrocode doesn't use \@noligs, which upquote modifies.
@@ -198,6 +199,8 @@
\setlength{\parindent}{0pt}
\addtolength{\parskip}{0.5\baselineskip}
+\def\warn{\textcolor{red}{\large\textbf{\textsf{WARNING}}}}
+
\begin{document}
\DocInput{minted.dtx}
\PrintIndex
@@ -205,7 +208,7 @@
%</driver>
% \fi
%
-% \CheckSum{2593}
+% \CheckSum{2548}
%
% \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
@@ -226,6 +229,18 @@
%
%
%
+% \begin{changelog}{v2.7}{2022/12/12}
+% \item Reimplemented \texttt{\string\mintinline} to use \texttt{fvextra}'s argument reading and processing macros, and to use \texttt{fvextra}'s \texttt{\string\Verb} internally. \texttt{\string\mintinline} now works with all line breaking options supported by \texttt{fvextra}'s \texttt{\string\Verb}, including \texttt{breakanywhere} (\#329, \#340). It now gives better results when used inside other commands, since it uses \texttt{fvextra}'s retokenization macros. It is now compatible with \texttt{hyperref} for PDF strings such as bookmarks.
+% \item Reimplemented \texttt{\string\newmintinline} based on new \texttt{\string\mintinline}.
+% \item Reimplemented \texttt{\string\mint} to use \texttt{fvextra}'s argument reading and processing macros. It now gives better results when used inside other commands, since it uses \texttt{fvextra}'s retokenization macros. Fixed a bug that caused a continued paragraph after \texttt{\string\mint} to be indented (\#218).
+% \item Reimplemented \texttt{\string\newmint} based on new \texttt{\string\mint}. Commands created with \texttt{\string\newmint} can now use curly braces as delimiters, just like \texttt{\string\mint} (\#254).
+% \item Settings passed to \Verb{pygmentize} as command-line options are now quoted. This prevents \Verb{escapeinside} characters from being interpreted as special shell characters (\#179, \#262).
+% \item Fixed bug with \texttt{autogobble} that produced incorrect dedent when using \texttt{lastline} with the lines beyond \texttt{lastline} having less indentation than the selected range (\#326).
+% \item Fixed unintended line breaks after hyphens under LuaTeX (\#263).
+% \item Added warning to documentation of \Verb{\inputminted} regarding filenames and shell command execution (\#338).
+% \end{changelog}
+%
+%
% \begin{changelog}{v2.6}{2021/12/24}
% \item \texttt{autogobble} automatically uses \texttt{python} or \texttt{python3} executables, depending on availability, instead of requiring \texttt{python}. A custom executable can be specified by redefining \texttt{\string\MintedPython} (\#277, \#287).
% \item Fixed \texttt{autogobble} compatibility with \texttt{fancyvrb} 4.0+ (\#315, \#316).
@@ -318,7 +333,7 @@
%
%
% \begin{changelog}{v2.0}{2015/01/31}
-% \item Added the compatibility package \texttt{minted1}, which provides the \pkg{minted} 1.7 code. This may be loaded when 1.7 compatibility is required. This package works with other packages that \texttt{\string\RequirePackage\{minted\}}, so long as it is loaded first.
+% \item Added the compatibility package \texttt{minted1}, which provides the \texpkg{minted} 1.7 code. This may be loaded when 1.7 compatibility is required. This package works with other packages that \texttt{\string\RequirePackage\{minted\}}, so long as it is loaded first.
% \item Moved all old \texttt{\string\changes} into \texttt{changelog}.
% \end{changelog}
%
@@ -345,7 +360,7 @@
% \item Improved behavior of \texttt{\string\mint} and \texttt{\string\mintinline} in \texttt{draft} mode.
% \item The \texttt{\string\mint} command now has the additional capability to take code delimited by paired curly braces \texttt{\{\}}.
% \item It is now possible to set options only for \texttt{\string\mintinline} using the new \texttt{\string\setmintedinline} command. Inline options override options specified via \texttt{\string\setminted}.
-% \item Completely rewrote option handling. \pkg{fancyvrb} options are now handled on the \LaTeX\ side directly, rather than being passed to Pygments and then returned. This makes caching more efficient, since code is no longer rehighlighted just because \pkg{fancyvrb} options changed.
+% \item Completely rewrote option handling. \texpkg{fancyvrb} options are now handled on the \LaTeX\ side directly, rather than being passed to Pygments and then returned. This makes caching more efficient, since code is no longer rehighlighted just because \texpkg{fancyvrb} options changed.
% \item Fixed buffer size error caused by using \texttt{cache} with a very large number of files (\#61).
% \item Fixed \texttt{autogobble} bug that caused failure under some operating systems.
% \item Added support for \texttt{escapeinside} (requires Pygments 2.0+; \#38).
@@ -435,17 +450,17 @@
%
% \GetFileInfo{minted.sty}
%
-% \newcommand\pkg[1]{\textsf{#1}}
-% \newcommand\app[1]{\textsf{#1}}
+% \newcommand{\texpkg}[1]{\textsf{#1}}
+% \newcommand{\app}[1]{\textsf{#1}}
%
-% \title{The \textcolor{minted@mint}{\pkg{minted}} package:\\Highlighted source code in \LaTeX}
+% \title{The \textcolor{minted@mint}{\texpkg{minted}} package:\\Highlighted source code in \LaTeX}
% \author{Geoffrey M.\ Poore \\ \url{gpoore@gmail.com} \\ \href{https://github.com/gpoore/minted}{\texttt{github.com/gpoore/minted}} \\ ~\\ Originally created and maintained (2009--2013) by \\ Konrad Rudolph}
% \date{\fileversion~from \filedate}
%
% \maketitle
%
% \begin{abstract}
-% \noindent\pkg{minted} is a package that facilitates expressive syntax highlighting
+% \noindent\texpkg{minted} is a package that facilitates expressive syntax highlighting
% using the powerful \app{Pygments} library. The package also provides options to
% customize the highlighted source code output.
% \end{abstract}
@@ -473,7 +488,7 @@
%
%
%
-% \pkg{minted} is a package that allows formatting source code in \LaTeX.
+% \texpkg{minted} is a package that allows formatting source code in \LaTeX.
% For example:
% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
% \begin{minted}{<language>}
@@ -485,12 +500,12 @@
% will highlight a piece of code in a chosen language.
% The appearance can be customized with a number of options and color schemes.
%
-% Unlike some other packages, most notably \pkg{listings}, \pkg{minted} requires
+% Unlike some other packages, most notably \texpkg{listings}, \texpkg{minted} requires
% the installation of additional software, \app{Pygments}.
% This may seem like a disadvantage, but there are also significant advantages.
%
% \app{Pygments} provides superior syntax highlighting compared to conventional packages.
-% For example, \pkg{listings} basically only highlights strings, comments and keywords.
+% For example, \texpkg{listings} basically only highlights strings, comments and keywords.
% \app{Pygments}, on the other hand, can be completely customized to highlight any kind of token the
% source language might support.
% This might include special formatting sequences inside strings, numbers, different kinds of
@@ -528,21 +543,21 @@
% If you don't have Python installed, you can download it from the \href{http://www.python.org/download/}{Python website} or
% use your operating system's package manager.
%
-% Some Python distributions include \pkg{Pygments} (see some of the options under ``Alternative Implementations'' on the Python site). Otherwise, you will need to install \pkg{Pygments} manually. This may be done by installing \href{http://pypi.python.org/pypi/setuptools}{\app{setuptools}}, which facilitates the distribution of Python applications. You can then install \app{Pygments} using the following command:
+% Some Python distributions include \texpkg{Pygments} (see some of the options under ``Alternative Implementations'' on the Python site). Otherwise, you will need to install \texpkg{Pygments} manually. This may be done by installing \href{http://pypi.python.org/pypi/setuptools}{\app{setuptools}}, which facilitates the distribution of Python applications. You can then install \app{Pygments} using the following command:
% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
% \$ sudo easy_install Pygments
% \end{Verbatim}
-% Under Windows, you will not need the |sudo|, but may need to run the command prompt as administrator. \pkg{Pygments} may also be installed with |pip|:
+% Under Windows, you will not need the |sudo|, but may need to run the command prompt as administrator. \texpkg{Pygments} may also be installed with |pip|:
% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
% \$ pip install Pygments
% \end{Verbatim}
%
-% If you already have \app{Pygments} installed, be aware that the latest version is recommended (at least 1.4 or later). Some features, such as |escapeinside|, will only work with 2.0+. \pkg{minted} may work with versions as early as 1.2, but there are no guarantees.
+% If you already have \app{Pygments} installed, be aware that the latest version is recommended (at least 1.4 or later). Some features, such as |escapeinside|, will only work with 2.0+. \texpkg{minted} may work with versions as early as 1.2, but there are no guarantees.
%
%
% \subsection{Required packages}
%
-% \pkg{minted} requires that the following packages be available and reasonably up to date on your system. All of these ship with recent \TeX\ distributions.
+% \texpkg{minted} requires that the following packages be available and reasonably up to date on your system. All of these ship with recent \TeX\ distributions.
%
% \begin{multicols}{3}
% \begingroup
@@ -573,10 +588,10 @@
% \end{multicols}
%
%
-% \subsection{Installing \pkg{minted}}
+% \subsection{Installing \texpkg{minted}}
% \label{sec:installing:installing}
%
-% You can probably install \pkg{minted} with your \TeX\ distribution's package manager. Otherwise, or if you want the absolute latest version, you can install it manually by following the directions below.
+% You can probably install \texpkg{minted} with your \TeX\ distribution's package manager. Otherwise, or if you want the absolute latest version, you can install it manually by following the directions below.
%
% You may download |minted.sty| from the
% \href{https://github.com/gpoore/minted}{project's homepage}. We have to install the file so that \TeX\ is able to find it.
@@ -590,7 +605,7 @@
% \subsection{Preliminary}
% \label{sec:basic:preliminary}
%
-% Since \pkg{minted} makes calls to the outside world (that is, \app{Pygments}), you need to tell the
+% Since \texpkg{minted} makes calls to the outside world (that is, \app{Pygments}), you need to tell the
% \LaTeX{} processor about this by passing it the |-shell-escape| option or it won't allow such calls.
% In effect, instead of calling the processor like this:
% \begin{Verbatim}[gobble=3,commandchars=\\\{\}]
@@ -610,7 +625,7 @@
%
% \subsubsection*{Working with OS X}
%
-% If you are using \pkg{minted} with some versions/configurations of OS X, and are using caching with a large number of code blocks ($>256$), you may receive an error like
+% If you are using \texpkg{minted} with some versions/configurations of OS X, and are using caching with a large number of code blocks ($>256$), you may receive an error like
%\begin{Verbatim}
%OSError: [Errno 24] Too many open files:
%\end{Verbatim}
@@ -620,7 +635,7 @@
%
% \subsection{A minimal complete example}
%
-% The following file |minimal.tex| shows the basic usage of \pkg{minted}.
+% The following file |minimal.tex| shows the basic usage of \texpkg{minted}.
%
% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
% \documentclass{article}
@@ -656,7 +671,7 @@
% \subsection{Formatting source code}
%
% \DescribeEnv{minted}
-% Using \pkg{minted} is straightforward. For example, to highlight some Python source code we might use
+% Using \texpkg{minted} is straightforward. For example, to highlight some Python source code we might use
% the following code snippet (result on the right):
%
% \begin{example}
@@ -694,14 +709,16 @@
% X\mintinline{python}{print(x**2)}X
% \end{example}
%
-% The syntax is \cmd\mintinline\oarg{options}\marg{language}\meta{delim}\meta{code}\meta{delim}. The delimiters can be a pair of characters, as for \cmd\mint. They can also be a matched pair of curly braces, |{}|.
+% The syntax is \cmd\mintinline\oarg{options}\marg{language}\meta{delim}\meta{code}\meta{delim}. The delimiters can be a single repeated character, just like for \cmd{\verb}. They can also be a pair of curly braces, |{}|. Curly braces are required when \cmd{\mintinline} is used in a movable argument, such as in a \cmd{\section}.
%
-% The command has been carefully crafted so that in most cases it will function correctly when used inside other commands.\footnote{For example, \mintinline{latex}{\mintinline} works in footnotes! The main exception is when the code contains the percent \texttt{\%} or hash \texttt{\#} characters, or unmatched curly braces.}
+% \cmd{\mintinline} has been carefully crafted so that in most cases it will function correctly when used inside other commands. The main exception is when the code contains the percent \texttt{\%} or hash \texttt{\#} characters, or unmatched curly braces. For example, \cmd{\mintinline} works in \cmd{\footnote} and \cmd{\section}! The code typesetting for \cmd{\mintinline} is based on \texpkg{fvextra}'s \cmd{\Verb}. See the \href{https://github.com/gpoore/fvextra/}{\texpkg{fvextra} documentation on \cmd{\Verb}} for details about functionality and limitations.
%
% \DescribeMacro{\inputminted}
% Finally, there's the |\inputminted| command to read and format whole files.
% Its syntax is \cmd\inputminted\oarg{options}\marg{language}\marg{filename}.
%
+% \warn: \meta{filename} is used to generate a shell command for highlighing the file. Due to limitations in the design of \texpkg{minted} and limitations with TeX as a programming language, there is currently no escaping or sanitization of the filename as part of this process. Providing a malformed filename can execute arbitrary system commands. For example, providing ``|file.txt; touch file2.txt|'' as \meta{filename} could highlight one file while subsequently creating a new file. (Issue \href{https://github.com/gpoore/minted/issues/338}{\#338}.)
+%
%
% \subsection{Using different styles}
%
@@ -720,7 +737,7 @@
%
%
% Creating your own styles is also easy. Just follow the instructions provided on the
-% \href{http://pygments.org/docs/styles/#creating-own-styles}{\pkg{Pygments} website}.
+% \href{http://pygments.org/docs/styles/#creating-own-styles}{\texpkg{Pygments} website}.
%
%
% \subsection{Supported languages}
@@ -735,7 +752,7 @@
% \section{Floating listings}\label{sec:float}
%
% \DescribeEnv{listing}
-% \pkg{minted} provides the |listing| environment to wrap around a source code block. This puts the code into a floating box, with the default placement |tbp| like figures and tables. You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is, as for the |figure| and |table| environments):
+% \texpkg{minted} provides the |listing| environment to wrap around a source code block. This puts the code into a floating box, with the default placement |tbp| like figures and tables. You can also provide a |\caption| and a |\label| for such a listing in the usual way (that is, as for the |figure| and |table| environments):
% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
% \begin{listing}[H]
% \mint{cl}/(car (cons 1 '(2)))/
@@ -755,13 +772,13 @@
% \end{minipage}}
% \hfill\hfill
%
-% The default |listing| placement can be modified easily. When the package option |newfloat=false| (default), the \pkg{float} package is used to create the |listing| environment. Placement can be modified by redefining |\fps@listing|. For example,
+% The default |listing| placement can be modified easily. When the package option |newfloat=false| (default), the \texpkg{float} package is used to create the |listing| environment. Placement can be modified by redefining |\fps@listing|. For example,
%\begin{verbatim}
%\makeatletter
%\renewcommand{\fps@listing}{htp}
%\makeatother
%\end{verbatim}
-% When |newfloat=true|, the more powerful \pkg{newfloat} package is used to create the |listing| environment. In that case, \pkg{newfloat} commands are available to customize |listing|:
+% When |newfloat=true|, the more powerful \texpkg{newfloat} package is used to create the |listing| environment. In that case, \texpkg{newfloat} commands are available to customize |listing|:
%\begin{verbatim}
%\SetupFloatingEnvironment{listing}{placement=htp}
%\end{verbatim}
@@ -775,16 +792,16 @@
% \end{example}
%
% \subsection*{Customizing the \texttt{listing} environment}
-% By default, the |listing| environment is created using the \pkg{float} package. In that case, the |\listingscaption| and |\listoflistingscaption| macros described below may be used to customize the caption and list of listings. If \pkg{minted} is loaded with the |newfloat| option, then the |listing| environment will be created with the more powerful \href{http://www.ctan.org/pkg/newfloat}{\pkg{newfloat}} package instead. \pkg{newfloat} is part of \href{http://www.ctan.org/pkg/caption}{\pkg{caption}}, which provides many options for customizing captions.
+% By default, the |listing| environment is created using the \texpkg{float} package. In that case, the |\listingscaption| and |\listoflistingscaption| macros described below may be used to customize the caption and list of listings. If \texpkg{minted} is loaded with the |newfloat| option, then the |listing| environment will be created with the more powerful \href{http://www.ctan.org/pkg/newfloat}{\texpkg{newfloat}} package instead. \texpkg{newfloat} is part of \href{http://www.ctan.org/pkg/caption}{\texpkg{caption}}, which provides many options for customizing captions.
%
-% When \pkg{newfloat} is used to create the |listing| environment, customization should be achieved using \pkg{newfloat}'s |\SetupFloatingEnvironment| command. For example, the string ``Listing'' in the caption could be changed to ``Program code'' using
+% When \texpkg{newfloat} is used to create the |listing| environment, customization should be achieved using \texpkg{newfloat}'s |\SetupFloatingEnvironment| command. For example, the string ``Listing'' in the caption could be changed to ``Program code'' using
%\begin{verbatim}
%\SetupFloatingEnvironment{listing}{name=Program code}
%\end{verbatim}
% And ``List of Listings'' could be changed to ``List of Program Code'' with %\begin{verbatim}
%\SetupFloatingEnvironment{listing}{listname=List of Program Code}
%\end{verbatim}
-% Refer to the \pkg{newfloat} and \pkg{caption} documentation for additional information.
+% Refer to the \texpkg{newfloat} and \texpkg{caption} documentation for additional information.
%
% \DescribeMacro{\listingscaption}
% (Only applies when package option |newfloat| is not used.) The string ``Listing'' in a listing's caption can be changed.
@@ -807,14 +824,14 @@
%
% \DescribeMacro{chapter}
% To control how \LaTeX{} counts the |listing| floats, you can pass either the
-% |section| or |chapter| option when loading the \pkg{minted} package.
+% |section| or |chapter| option when loading the \texpkg{minted} package.
% For example, the following will cause listings to be counted by chapter:
%
% \mint[frame=lines]{latex}/\usepackage[chapter]{minted}/
%
%
% \DescribeMacro{cache=\meta{boolean} (default:~true)}
-% \pkg{minted} works by saving code to a temporary file, highlighting the code via \app{Pygments} and saving the output to another temporary file, and inputting the output into the \LaTeX\ document. This process can become quite slow if there are several chunks of code to highlight. To avoid this, the package provides a |cache| option. This is on by default.
+% \texpkg{minted} works by saving code to a temporary file, highlighting the code via \app{Pygments} and saving the output to another temporary file, and inputting the output into the \LaTeX\ document. This process can become quite slow if there are several chunks of code to highlight. To avoid this, the package provides a |cache| option. This is on by default.
%
% The |cache| option creates a directory |_minted-|\meta{jobname} in the document's root directory (this may be customized with the |cachedir| option).\footnote{The directory is actually named using a ``sanitized'' copy of \meta{jobname}, in which spaces and asterisks have been replaced by underscores, and double quotation marks have been stripped. If the file name contains spaces, \texttt{\string\jobname} will contain a quote-wrapped name, except under older versions of MiKTeX which used the name with spaces replaced by asterisks. Using a ``sanitized'' \meta{jobname} is simpler than accomodating the various escaping conventions.} Files of highlighted code are stored in this directory, so that the code will not have to be highlighted again in the future. In most cases, caching will significantly speed up document compilation.
%
@@ -835,7 +852,7 @@
%
%
% \DescribeMacro{finalizecache=\meta{boolean} (default:~false)}
-% In some cases, it may be desirable to use \pkg{minted} in an environment in which |-shell-escape| is not allowed. A document might be submitted to a publisher or preprint server or used with an online service that does not support |-shell-escape|. This is possible as long as \pkg{minted} content does not need to be modified.
+% In some cases, it may be desirable to use \texpkg{minted} in an environment in which |-shell-escape| is not allowed. A document might be submitted to a publisher or preprint server or used with an online service that does not support |-shell-escape|. This is possible as long as \texpkg{minted} content does not need to be modified.
%
% Compiling with the |finalizecache| option prepares the cache for use in an environment without |-shell-escape|.\footnote{Ordinarily, cache files are named using an MD5 hash of highlighting settings and highlighted text. \texttt{finalizecache} renames cache files using a \texttt{listing<number>.pygtex} scheme. This makes it simpler to match up document content and cache files, and is also necessary for the XeTeX engine since prior to TeX Live 2016 it lacked the built-in MD5 capabilities that pdfTeX and LuaTeX have.} Once this has been done, the |finalizecache| option may be swapped for the |frozencache| option, which will then use the frozen (static) cache in the future, without needing |-shell-escape|.
%
@@ -848,22 +865,22 @@
% \DescribeMacro{frozencache=\meta{boolean} (default:~false)}
% Use a frozen (static) cache created with the |finalizecache| option. When |frozencache| is on, |-shell-escape| is not needed, and Python and Pygments are not required. In addition, any external files accessed through |\inputminted| are no longer necessary.
%
-% \textbf{This option must be used with care. A document \emph{must} be in final form, as far as \pkg{minted} is concerned, \emph{before} \texttt{frozencache} is turned on, and the document \emph{must} have been compiled with \texttt{finalizecache}. When this option is on, \pkg{minted} content cannot be modified, except by editing the cache files directly. Changing any \pkg{minted} settings that require Pygments or Python is not possible. If \pkg{minted} content is incorrectly modified after \texttt{frozencache} is turned on, \pkg{minted} \emph{cannot} detect the modification.}
+% \textbf{This option must be used with care. A document \emph{must} be in final form, as far as \texpkg{minted} is concerned, \emph{before} \texttt{frozencache} is turned on, and the document \emph{must} have been compiled with \texttt{finalizecache}. When this option is on, \texpkg{minted} content cannot be modified, except by editing the cache files directly. Changing any \texpkg{minted} settings that require Pygments or Python is not possible. If \texpkg{minted} content is incorrectly modified after \texttt{frozencache} is turned on, \texpkg{minted} \emph{cannot} detect the modification.}
%
-% If you are using |frozencache|, and want to verify that \pkg{minted} settings or content have not been modified in an invalid fashion, you can test the cache using the following procedure.
+% If you are using |frozencache|, and want to verify that \texpkg{minted} settings or content have not been modified in an invalid fashion, you can test the cache using the following procedure.
% \begin{enumerate}
% \item Obtain a copy of the cache used with |frozencache|.
% \item Compile the document in an environment that supports |-shell-escape|, with |finalizecache=true| and |frozencache=false|. This essentially regenerates the frozen (static) cache.
-% \item Compare the original cache with the newly generated cache. Under Linux and OS X, you could use |diff|; under Windows, you probably want |fc|. If \pkg{minted} content and settings have not been modified in an invalid fashion, all files will be identical (assuming that compatible versions of Pygments are used for both caches).
+% \item Compare the original cache with the newly generated cache. Under Linux and OS X, you could use |diff|; under Windows, you probably want |fc|. If \texpkg{minted} content and settings have not been modified in an invalid fashion, all files will be identical (assuming that compatible versions of Pygments are used for both caches).
% \end{enumerate}
%
%
% \DescribeMacro{draft=\meta{boolean} (default:~false)}
-% This uses \pkg{fancyvrb} alone for all typesetting; \app{Pygments} is not used. This trades syntax highlighting and some other \app{minted} features for faster compiling. Performance should be essentially the same as using \pkg{fancyvrb} directly; no external temporary files are used. Note that if you are not changing much code between compiles, the difference in performance between caching and draft mode may be minimal. Also note that |draft| settings are typically inherited from the document class.
+% This uses \texpkg{fancyvrb} alone for all typesetting; \app{Pygments} is not used. This trades syntax highlighting and some other \app{minted} features for faster compiling. Performance should be essentially the same as using \texpkg{fancyvrb} directly; no external temporary files are used. Note that if you are not changing much code between compiles, the difference in performance between caching and draft mode may be minimal. Also note that |draft| settings are typically inherited from the document class.
%
% Draft mode does not support |autogobble|. Regular |gobble|, |linenos|, and most other options not related to syntax highlighting will still function in draft mode.
%
-% Documents can usually be compiled without shell escape in draft mode. The \pkg{ifplatform} package may issue a warning about limited functionality due to shell escape being disabled, but this may be ignored in almost all cases. (Shell escape is only really required if you have an unusual system configuration such that the |\ifwindows| macro must fall back to using shell escape to determine the system. See the \pkg{ifplatform} documentation for more details: \url{http://www.ctan.org/pkg/ifplatform}.)
+% Documents can usually be compiled without shell escape in draft mode. The \texpkg{ifplatform} package may issue a warning about limited functionality due to shell escape being disabled, but this may be ignored in almost all cases. (Shell escape is only really required if you have an unusual system configuration such that the |\ifwindows| macro must fall back to using shell escape to determine the system. See the \texpkg{ifplatform} documentation for more details: \url{http://www.ctan.org/pkg/ifplatform}.)
%
% If the |cache| option is set, then all existing cache files will be kept while draft mode is on. This allows caching to be used intermitently with draft mode without requiring that the cache be completely recreated each time. Automatic cleanup of cached files will resume as soon as draft mode is turned off. (This assumes that the auxiliary file has not been deleted in the meantime; it contains the cache history and allows automatic cleanup of unused files.)
%
@@ -873,15 +890,15 @@
%
%
% \DescribeMacro{kpsewhich=\meta{boolean} (default:~false)}
-% This option uses |kpsewhich| to locate files that are to be highlighted. Some build tools such as |texi2pdf| function by modifying |TEXINPUTS|; in some cases, users may customize |TEXINPUTS| as well. The |kpsewhich| option allows \pkg{minted} to work with such configurations.
+% This option uses |kpsewhich| to locate files that are to be highlighted. Some build tools such as |texi2pdf| function by modifying |TEXINPUTS|; in some cases, users may customize |TEXINPUTS| as well. The |kpsewhich| option allows \texpkg{minted} to work with such configurations.
%
% This option may add a noticeable amount of overhead on some systems, or with some system configurations.
%
-% This option does \emph{not} make \pkg{minted} work with the |-output-directory| and |-aux-directory| command-line options for \LaTeX. For those, see the |outputdir| package option.
+% This option does \emph{not} make \texpkg{minted} work with the |-output-directory| and |-aux-directory| command-line options for \LaTeX. For those, see the |outputdir| package option.
%
%
% \DescribeMacro{langlinenos=\meta{boolean} (default:~false)}
-% \pkg{minted} uses the \pkg{fancyvrb} package behind the scenes for the code typesetting. \pkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified. For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off. The |langlinenos| option makes |firstnumber| work for each language individually with all |minted| and |\mint| usages. For example, consider the code and output below.
+% \texpkg{minted} uses the \texpkg{fancyvrb} package behind the scenes for the code typesetting. \texpkg{fancyvrb} provides an option |firstnumber| that allows the starting line number of an environment to be specified. For convenience, there is an option |firstnumber=last| that allows line numbering to pick up where it left off. The |langlinenos| option makes |firstnumber| work for each language individually with all |minted| and |\mint| usages. For example, consider the code and output below.
%
% \begin{VerbatimOut}[gobble=1]{minted.doc.out}
% \begin{minted}[linenos]{python}
@@ -911,23 +928,23 @@
%
%
% \DescribeMacro{newfloat=\meta{boolean} (default:~false)}
-% By default, the |listing| environment is created using the \pkg{float} package. The |newfloat| option creates the environment using \pkg{newfloat} instead. This provides better integration with the \pkg{caption} package.
+% By default, the |listing| environment is created using the \texpkg{float} package. The |newfloat| option creates the environment using \texpkg{newfloat} instead. This provides better integration with the \texpkg{caption} package.
%
%
% \DescribeMacro{outputdir=\meta{directory} (default:~\meta{none})}
-% The |-output-directory| and |-aux-directory| (MiKTeX) command-line options for \LaTeX\ cause problems for \pkg{minted}, because the \pkg{minted} temporary files are saved in |<outputdir>|, but \pkg{minted} still looks for them in the document root directory. There is no way to access the value of the command-line option so that \pkg{minted} can automatically look in the right place. But it is possible to allow the output directory to be specified manually as a package option.
+% The |-output-directory| and |-aux-directory| (MiKTeX) command-line options for \LaTeX\ cause problems for \texpkg{minted}, because the \texpkg{minted} temporary files are saved in |<outputdir>|, but \texpkg{minted} still looks for them in the document root directory. There is no way to access the value of the command-line option so that \texpkg{minted} can automatically look in the right place. But it is possible to allow the output directory to be specified manually as a package option.
%
% The output directory should be specified using an absolute path or a path relative to the document root directory. Paths should use forward slashes, even under Windows. Special characters must be escaped, while spaces require quoting and need the entire \meta{directory} to be wrapped in curly braces |{}|. See |cachedir| above for examples of escaping and quoting.
%
%
% \DescribeMacro{section}
% To control how \LaTeX{} counts the |listing| floats, you can pass either the
-% |section| or |chapter| option when loading the \pkg{minted} package.
+% |section| or |chapter| option when loading the \texpkg{minted} package.
%
%
% \subsection{Macro option usage}
%
-% All \pkg{minted} highlighting commands accept the same set of options.
+% All \texpkg{minted} highlighting commands accept the same set of options.
% Options are specified as a comma-separated list of |key=value| pairs.
% For example, we can specify that the lines should be numbered:
%
@@ -944,7 +961,7 @@
%
% An option value of |true| may also be omitted entirely (including the ``|=|'').
% To customize the display of the line numbers further, override the |\theFancyVerbLine| command.
-% Consult the \pkg{fancyvrb} documentation for details.
+% Consult the \texpkg{fancyvrb} documentation for details.
%
% |\mint| accepts the same options:
%
@@ -994,7 +1011,7 @@
% \newcommand\appliesto[1]{\textsf{[For #1 only]}}
%
% Following is a full list of available options.
-% For more detailed option descriptions please refer to the \pkg{fancyvrb} and \app{Pygments} documentation.
+% For more detailed option descriptions please refer to the \texpkg{fancyvrb} and \app{Pygments} documentation.
%
% \begin{optionlist}
% \item[autogobble (boolean) (false)]
@@ -1013,11 +1030,11 @@
%
%
% \item[beameroverlays (boolean) (false)]
-% Give the |<| and |>| characters their normal text meanings when used with |escapeinside| and |texcomments|, so that \pkg{beamer} overlays of the form |\only<1>{...}| will work.
+% Give the |<| and |>| characters their normal text meanings when used with |escapeinside| and |texcomments|, so that \texpkg{beamer} overlays of the form |\only<1>{...}| will work.
%
%
% \item[breakafter (string) (\meta{none})]
-% Break lines after specified characters, not just at spaces, when \texttt{breaklines=true}. Does not apply to |\mintinline|.
+% Break lines after specified characters, not just at spaces, when \texttt{breaklines=true}.
%
% For example, \texttt{breakafter=-/} would allow breaks after any hyphens or slashes. Special characters given to \texttt{breakafter} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
%
@@ -1039,7 +1056,7 @@
% The symbol inserted post-break for breaks inserted by \texttt{breakafter}.
%
% \item[breakanywhere (boolean) (false)]
-% Break lines anywhere, not just at spaces, when \texttt{breaklines=true}. Does not apply to |\mintinline|.
+% Break lines anywhere, not just at spaces, when \texttt{breaklines=true}.
%
% \begingroup
% \fvset{xrightmargin=1em}
@@ -1060,7 +1077,7 @@
% When a line is broken, automatically indent the continuation lines to the indentation level of the first line. When \texttt{breakautoindent} and \texttt{breakindent} are used together, the indentations add. This indentation is combined with \texttt{breaksymbolindentleft} to give the total actual left indentation. Does not apply to \texttt{\string\mintinline}.
%
% \item[breakbefore (string) (\meta{none})]
-% Break lines before specified characters, not just at spaces, when \texttt{breaklines=true}. Does not apply to |\mintinline|.
+% Break lines before specified characters, not just at spaces, when \texttt{breaklines=true}.
%
% For example, \texttt{breakbefore=A} would allow breaks before capital A's. Special characters given to \texttt{breakbefore} should be backslash-escaped (usually \texttt{\hashchar}, \texttt{\{}, \texttt{\}}, \texttt{\%}, \texttt{[}, \texttt{]}; the backslash \texttt{\textbackslash} may be obtained via \texttt{\textbackslash\textbackslash}).
%
@@ -1100,7 +1117,7 @@
% \item[breaklines (boolean) (false)]
% Automatically break long lines in \texttt{minted} environments and \texttt{\string\mint} commands, and wrap longer lines in \texttt{\string\mintinline}.
%
-% By default, automatic breaks occur at space characters. Use \texttt{breakanywhere} to enable breaking anywhere; use \texttt{breakbytoken}, \texttt{breakbytokenanywhere}, \texttt{breakbefore}, and \texttt{breakafter} for more fine-tuned breaking. Currently, only \texttt{breakbytoken} and \texttt{breakbytokenanywhere} work with |\mintinline|. Using \texttt{escapeinside} to escape to \LaTeX\ and then insert a manual break is also an option. For example, use \texttt{escapeinside=||}, and then insert \texttt{|\textbackslash\textbackslash|} at the appropriate point. (Note that \texttt{escapeinside} does not work within strings.)
+% By default, automatic breaks occur at space characters. Use \texttt{breakanywhere} to enable breaking anywhere; use \texttt{breakbytoken}, \texttt{breakbytokenanywhere}, \texttt{breakbefore}, and \texttt{breakafter} for more fine-tuned breaking. Using \texttt{escapeinside} to escape to \LaTeX\ and then insert a manual break is also an option. For example, use \texttt{escapeinside=||}, and then insert \texttt{|\textbackslash\textbackslash|} at the appropriate point. (Note that \texttt{escapeinside} does not work within strings.)
%
% \begin{example}
% ...text.
@@ -1112,7 +1129,7 @@
%
% Breaking in \texttt{minted} and \texttt{\string\mint} may be customized in several ways. To customize the indentation of broken lines, see \texttt{breakindent} and \texttt{breakautoindent}. To customize the line continuation symbols, use \texttt{breaksymbolleft} and \texttt{breaksymbolright}. To customize the separation between the continuation symbols and the code, use \texttt{breaksymbolsepleft} and \texttt{breaksymbolsepright}. To customize the extra indentation that is supplied to make room for the break symbols, use \texttt{breaksymbolindentleft} and \texttt{breaksymbolindentright}. Since only the left-hand symbol is used by default, it may also be modified using the alias options \texttt{breaksymbol}, \texttt{breaksymbolsep}, and \texttt{breaksymbolindent}. Note than none of these options applies to \texttt{\string\mintinline}, since they are not relevant in the inline context.
%
-% An example using these options to customize the \texttt{minted} environment is shown below. This uses the \texttt{\string\carriagereturn} symbol from the \pkg{dingbat} package.
+% An example using these options to customize the \texttt{minted} environment is shown below. This uses the \texttt{\string\carriagereturn} symbol from the \texpkg{dingbat} package.
%
% \begingroup
% \fvset{breaklines, xleftmargin=2em, xrightmargin=2em}
@@ -1132,11 +1149,11 @@
% \end{longexample}
% \endgroup
%
-% Automatic line breaks are limited with \app{Pygments} styles that use a colored background behind large chunks of text. This coloring is accomplished with \texttt{\string\colorbox}, which cannot break across lines. It may be possible to create an alternative to \texttt{\string\colorbox} that supports line breaks, perhaps with \pkg{TikZ}, but the author is unaware of a satisfactory solution. The only current alternative is to redefine \texttt{\string\colorbox} so that it does nothing. For example,
+% Automatic line breaks are limited with \app{Pygments} styles that use a colored background behind large chunks of text. This coloring is accomplished with \texttt{\string\colorbox}, which cannot break across lines. It may be possible to create an alternative to \texttt{\string\colorbox} that supports line breaks, perhaps with \texpkg{TikZ}, but the author is unaware of a satisfactory solution. The only current alternative is to redefine \texttt{\string\colorbox} so that it does nothing. For example,
%\begin{Verbatim}
%\AtBeginEnvironment{minted}{\renewcommand{\colorbox}[3][]{#3}}
%\end{Verbatim}
-% uses the \pkg{etoolbox} package to redefine \texttt{\string\colorbox} within all \texttt{minted} environments.
+% uses the \texpkg{etoolbox} package to redefine \texttt{\string\colorbox} within all \texttt{minted} environments.
%
% Automatic line breaks will not work with \texttt{showspaces=true} unless you use \texttt{breakanywhere} or \texttt{breakafter=\string\space}.
%
@@ -1146,7 +1163,7 @@
% \item[breaksymbolleft (string) (\string\tiny\string\ensuremath\{\string\hookrightarrow\}, {\tiny\ensuremath{\hookrightarrow}})]
% The symbol used at the beginning (left) of continuation lines when \texttt{breaklines=true}. To have no symbol, simply set \texttt{breaksymbolleft} to an empty string (``\texttt{=,}'' or ``\texttt{=\{\}}''). The symbol is wrapped within curly braces \texttt{\{\}} when used, so there is no danger of formatting commands such as \texttt{\string\tiny} ``escaping.''
%
-% The \texttt{\string\hookrightarrow} and \texttt{\string\hookleftarrow} may be further customized by the use of the \texttt{\string\rotatebox} command provided by \pkg{graphicx}. Additional arrow-type symbols that may be useful are available in the \pkg{dingbat} (\texttt{\string\carriagereturn}) and \pkg{mnsymbol} (hook and curve arrows) packages, among others.
+% The \texttt{\string\hookrightarrow} and \texttt{\string\hookleftarrow} may be further customized by the use of the \texttt{\string\rotatebox} command provided by \texpkg{graphicx}. Additional arrow-type symbols that may be useful are available in the \texpkg{dingbat} (\texttt{\string\carriagereturn}) and \texpkg{mnsymbol} (hook and curve arrows) packages, among others.
%
% Does not apply to \texttt{\string\mintinline}.
%
@@ -1191,7 +1208,7 @@
%
%
% \item[breaksymbolsepright (dimension) (\meta{breaksymbolseprightnchars})]
-% The \emph{minimum} separation between the |breaksymbolright| and the adjacent text. This is the separation between |breaksymbolright| and the furthest extent to which adjacent text could reach. In practice, |\linewidth| will typically not be an exact integer multiple of the character width (assuming a fixed-width font), so the actual separation between the |breaksymbolright| and adjacent text will generally be larger than |breaksymbolsepright|. This ensures that break symbols have the same spacing from the margins on both left and right. If the same spacing from text is desired instead, |breaksymbolsepright| may be adjusted. (See the definition of |\FV@makeLineNumber| in \pkg{fvextra} for implementation details.)
+% The \emph{minimum} separation between the |breaksymbolright| and the adjacent text. This is the separation between |breaksymbolright| and the furthest extent to which adjacent text could reach. In practice, |\linewidth| will typically not be an exact integer multiple of the character width (assuming a fixed-width font), so the actual separation between the |breaksymbolright| and adjacent text will generally be larger than |breaksymbolsepright|. This ensures that break symbols have the same spacing from the margins on both left and right. If the same spacing from text is desired instead, |breaksymbolsepright| may be adjusted. (See the definition of |\FV@makeLineNumber| in \texpkg{fvextra} for implementation details.)
%
% \item[breaksymbolseprightnchars (integer) (2)]
% Allows |breaksymbolsepright| to be specified as an integer number of characters rather than as a dimension (assumes a fixed-width font).
@@ -1211,7 +1228,7 @@
% \end{minted}
% \end{example}
%
-% This option puts \texttt{minted} environments and \texttt{\string\mint} commands in a \texttt{snugshade*} environment from the \pkg{framed} package, which supports breaks across pages. (Prior to \pkg{minted} 2.2, a \texttt{minipage} was used, which prevented page breaks and gave undesirable spacing from surrounding text.) Be aware that if \texttt{bgcolor} is used with \texttt{breaklines=true}, and a line break occurs just before a page break, then text may extend below the colored background in some instances. It is best to use a more advanced framing package in those cases; see ``Framing alternatives'' below.
+% This option puts \texttt{minted} environments and \texttt{\string\mint} commands in a \texttt{snugshade*} environment from the \texpkg{framed} package, which supports breaks across pages. (Prior to \texpkg{minted} 2.2, a \texttt{minipage} was used, which prevented page breaks and gave undesirable spacing from surrounding text.) Be aware that if \texttt{bgcolor} is used with \texttt{breaklines=true}, and a line break occurs just before a page break, then text may extend below the colored background in some instances. It is best to use a more advanced framing package in those cases; see ``Framing alternatives'' below.
%
% This option puts \texttt{\string\mintinline} inside a \texttt{\string\colorbox}, which \textbf{does not allow line breaks}. If you want to use \texttt{\string\setminted} to set background colors, and only want background colors on \texttt{minted} and \texttt{\string\mint}, you may use \texttt{\string\setmintedinline\{bgcolor=\{\}\}} to turn off the coloring for inline commands.
%
@@ -1219,16 +1236,16 @@
%
% \textbf{Framing alternatives}
%
-% If you want more reliable and advanced options for background colors and framing, you should consider a more advanced framing package such as \pkg{mdframed} or \pkg{tcolorbox}. It is easy to add framing to \pkg{minted} commands and environments using the \pkg{etoolbox} package, which is automatically loaded by \pkg{minted}. For example, using \pkg{mdframed}:
+% If you want more reliable and advanced options for background colors and framing, you should consider a more advanced framing package such as \texpkg{mdframed} or \texpkg{tcolorbox}. It is easy to add framing to \texpkg{minted} commands and environments using the \texpkg{etoolbox} package, which is automatically loaded by \texpkg{minted}. For example, using \texpkg{mdframed}:
%\begin{Verbatim}
%\BeforeBeginEnvironment{minted}{\begin{mdframed}}
%\AfterEndEnvironment{minted}{\end{mdframed}}
%\end{Verbatim}
-% Some framing packages also provide built-in commands for such purposes. For example, \pkg{mdframed} provides a \texttt{\string\surroundwithmdframed} command, which could be used to add a frame to all \texttt{minted} environments:
+% Some framing packages also provide built-in commands for such purposes. For example, \texpkg{mdframed} provides a \texttt{\string\surroundwithmdframed} command, which could be used to add a frame to all \texttt{minted} environments:
%\begin{Verbatim}
%\surroundwithmdframed{minted}
%\end{Verbatim}
-% \pkg{tcolorbox} even provides a built-in framing environment with \pkg{minted} support. Simply use \texttt{\string\tcbuselibrary\{minted\}} in the preamble, and then put code within a \texttt{tcblisting} environment:
+% \texpkg{tcolorbox} even provides a built-in framing environment with \texpkg{minted} support. Simply use \texttt{\string\tcbuselibrary\{minted\}} in the preamble, and then put code within a \texttt{tcblisting} environment:
%\begin{Verbatim}
%\begin{tcblisting}{<tcb options>,
% minted language=<language>,
@@ -1237,7 +1254,7 @@
%<code>
%\end{tcblisting}
%\end{Verbatim}
-% \pkg{tcolorbox} provides other commands and environments for fine-tuning listing appearance and for working with external code files.
+% \texpkg{tcolorbox} provides other commands and environments for fine-tuning listing appearance and for working with external code files.
%
% \item[codetagify (list of strings) (\textrm{highlight \texttt{XXX}, \texttt{TODO}, \texttt{BUG}, and \texttt{NOTE}})]
% Highlight special code tags in comments and docstrings.
@@ -1250,7 +1267,7 @@
% \item[escapeinside (string) (\meta{none})]
% Escape to \LaTeX\ between the two characters specified in \texttt{\string(string\string)}. All code between the two characters will be interpreted as \LaTeX\ and typeset accordingly. This allows for additional formatting. The escape characters need not be identical. Special \LaTeX\ characters must be escaped when they are used as the escape characters (for example, \texttt{escapeinside=\textbackslash\#\textbackslash\%}). Requires \app{Pygments} 2.0+.
%
-% \textbf{Escaping does not work inside strings and comments (for comments, there is \texttt{texcomments}). As of Pygments 2.0.2, this means that escaping is ``fragile'' with some lexers.} Due to the way that Pygments implements \texttt{escapeinside}, any ``escaped'' \LaTeX\ code that resembles a string or comment for the current lexer may break \texttt{escapeinside}. There is a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1118}{Pygments issue} for this case. Additional details and a limited workaround for some scenarios are available on the \href{https://github.com/gpoore/minted/issues/70#issuecomment-111729930}{\pkg{minted} GitHub site}.
+% \textbf{Escaping does not work inside strings and comments (for comments, there is \texttt{texcomments}). As of Pygments 2.0.2, this means that escaping is ``fragile'' with some lexers.} Due to the way that Pygments implements \texttt{escapeinside}, any ``escaped'' \LaTeX\ code that resembles a string or comment for the current lexer may break \texttt{escapeinside}. There is a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1118}{Pygments issue} for this case. Additional details and a limited workaround for some scenarios are available on the \href{https://github.com/gpoore/minted/issues/70#issuecomment-111729930}{\texpkg{minted} GitHub site}.
%
% \begingroup ^^A Need to prevent active "|" from causing problems
% \catcode`\|=11
@@ -1263,7 +1280,7 @@
% \end{example}
% \endgroup
%
-% \textbf{Note that when math is used inside escapes, any active characters beyond those that are normally active in verbatim can cause problems.} Any package that relies on special active characters in math mode (for example, \pkg{icomma}) will produce errors along the lines of \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}. This may be fixed by modifying \texttt{\string\@noligs}, as described at \url{http://tex.stackexchange.com/questions/223876}.
+% \textbf{Note that when math is used inside escapes, any active characters beyond those that are normally active in verbatim can cause problems.} Any package that relies on special active characters in math mode (for example, \texpkg{icomma}) will produce errors along the lines of \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}. This may be fixed by modifying \texttt{\string\@noligs}, as described at \url{http://tex.stackexchange.com/questions/223876}.
% \item[firstline (integer) (1)]
% The first line to be shown.
% All lines before that line are ignored and do not appear in the output.
@@ -1292,7 +1309,7 @@
% Remove the first $n$ characters from each input line.
%
% \item[highlightcolor (string) (LightCyan)]
-% Set the color used for |highlightlines|, using a predefined color name from \pkg{color} or \pkg{xcolor}, or a color defined via |\definecolor|.
+% Set the color used for |highlightlines|, using a predefined color name from \texpkg{color} or \texpkg{xcolor}, or a color defined via |\definecolor|.
%
%
% \item[highlightlines (string) (\meta{none})]
@@ -1305,12 +1322,12 @@
% Changes capitalization of keywords. Takes |lower|, |upper|, or |capitalize|.
% \item[label (string) (\emph{empty})]
% Add a label to the top, the bottom or both of the frames around the code.
-% See the \pkg{fancyvrb} documentation for more information and examples.
+% See the \texpkg{fancyvrb} documentation for more information and examples.
% \emph{Note:} This does \emph{not} add a |\label| to the current listing.
% To achieve that, use a floating environment (section \ref{sec:float}) instead.
% \item[labelposition (none \| topline \| bottomline \| all) (topline, all, \textrm{or} none)]
% Position where to print the label (see above; default: |topline| if one label is defined, |all| if two are defined, |none| else).
-% See the \pkg{fancyvrb} documentation for more information.
+% See the \texpkg{fancyvrb} documentation for more information.
% \item[lastline (integer) (\meta{last line of input})]
% The last line to be shown.
% \item[linenos (boolean) (false)]
@@ -1340,7 +1357,7 @@
% Essentially the same as |linenos|, except the side on which the numbers appear may be specified.
% \item[mathescape (boolean) (false)]
% Enable \LaTeX{} math mode inside comments.
-% Usage as in package \pkg{listings}.
+% Usage as in package \texpkg{listings}.
% See the note under \texttt{escapeinside} regarding math and ligatures.
% \item[numberblanklines (boolean) (true)]
% Enables or disables numbering of blank lines.
@@ -1395,7 +1412,7 @@
% Strip leading and trailing newlines from the input.
%
%
-% \item[tab (macro) ({\rmfamily\pkg{fancyvrb}'s} \string\FancyVerbTab, \FancyVerbTab)]
+% \item[tab (macro) ({\rmfamily\texpkg{fancyvrb}'s} \string\FancyVerbTab, \FancyVerbTab)]
% Redefine the visible tab character. Note that this is only used if |showtabs=true|. |\rightarrowfill|, \hbox to 2em{\rightarrowfill}, may be a nice alternative.
%
%
@@ -1407,11 +1424,11 @@
% The number of spaces a tab is equivalent to. If |obeytabs| is \emph{not} active, tabs will be converted into this number of spaces. If |obeytabs| is active, tab stops will be set this number of space characters apart.
% \item[texcl (boolean) (false)]
% Enables \LaTeX{} code inside comments.
-% Usage as in package \pkg{listings}. See the note under \texttt{escapeinside} regarding math and ligatures.
+% Usage as in package \texpkg{listings}. See the note under \texttt{escapeinside} regarding math and ligatures.
% \item[texcomments (boolean) (false)]
% Enables \LaTeX{} code inside comments. The newer name for |texcl|. See the note under |escapeinside| regarding math and ligatures.
%
-% As of Pygments 2.0.2, \texttt{texcomments} fails with multiline C/C++ preprocessor directives, and may fail in some other circumstances. This is because preprocessor directives are \href{http://pygments.org/docs/tokens/}{tokenized as \texttt{Comment.Preproc}}, so \texttt{texcomments} causes preprocessor directives to be treated as literal \LaTeX\ code. \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1086/wrong-processing-of-in-c-c-macros-if-is}{An issue has been opened} at the Pygments site; additional details are also available on the \href{https://github.com/gpoore/minted/issues/66}{\pkg{minted} GitHub site}.
+% As of Pygments 2.0.2, \texttt{texcomments} fails with multiline C/C++ preprocessor directives, and may fail in some other circumstances. This is because preprocessor directives are \href{http://pygments.org/docs/tokens/}{tokenized as \texttt{Comment.Preproc}}, so \texttt{texcomments} causes preprocessor directives to be treated as literal \LaTeX\ code. \href{https://bitbucket.org/birkenfeld/pygments-main/issue/1086/wrong-processing-of-in-c-c-macros-if-is}{An issue has been opened} at the Pygments site; additional details are also available on the \href{https://github.com/gpoore/minted/issues/66}{\texpkg{minted} GitHub site}.
% \item[xleftmargin (dimension) (0)]
% Indentation to add before the listing.
% \item[xrightmargin (dimension) (0)]
@@ -1430,7 +1447,7 @@
%
% One option is to use \cmd\setminted, but even then you must still specify the language each time.
%
-% \pkg{minted} therefore defines a set of commands that lets you define shortcuts for the highlighting commands.
+% \texpkg{minted} therefore defines a set of commands that lets you define shortcuts for the highlighting commands.
% Each shortcut is specific for one programming language.
%
% \DescribeMacro{\newminted}
@@ -1458,7 +1475,7 @@
% \end{cppcode*}
% \end{example}
%
-% Notice the star ``|*|'' behind the environment name---due to restrictions in \pkg{fancyvrb}'s handling
+% Notice the star ``|*|'' behind the environment name---due to restrictions in \texpkg{fancyvrb}'s handling
% of options, it is necessary to provide a \emph{separate} environment that accepts options, and the options
% are \emph{not} optional on the starred version of the environment.
%
@@ -1466,7 +1483,7 @@
% If this name clashes with another environment or if you want to choose an own name for another reason, you may
% do so by specifying it as the first argument: \cmd\newminted\oarg{environment name}\marg{language}\marg{options}.
%
-% Like normal \pkg{minted} environments, environments created with |\newminted| may be used within other environment definitions. Since the \pkg{minted} environments use \pkg{fancyvrb} internally, any environment based on them must include the \pkg{fancyvrb} command |\VerbatimEnvironment|. This allows \pkg{fancyvrb} to determine the name of the environment that is being defined, and correctly find its end. It is best to include this command at the beginning of the definition. For example,
+% Like normal \texpkg{minted} environments, environments created with |\newminted| may be used within other environment definitions. Since the \texpkg{minted} environments use \texpkg{fancyvrb} internally, any environment based on them must include the \texpkg{fancyvrb} command |\VerbatimEnvironment|. This allows \texpkg{fancyvrb} to determine the name of the environment that is being defined, and correctly find its end. It is best to include this command at the beginning of the definition. For example,
%\begin{Verbatim}
%\newminted{cpp}{gobble=2,linenos}
%\newenvironment{env}{\VerbatimEnvironment\begin{cppcode}}{\end{cppcode}}
@@ -1507,32 +1524,32 @@
%
% \section{FAQ and Troubleshooting}
%
-% In some cases, \pkg{minted} may not give the desired result due to other document settings that it cannot control. Common issues are described below, with workarounds or solutions. You may also wish to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \pkg{minted} in a non-typical context.
+% In some cases, \texpkg{minted} may not give the desired result due to other document settings that it cannot control. Common issues are described below, with workarounds or solutions. You may also wish to search \href{http://tex.stackexchange.com/}{tex.stackexchange.com} or ask a question there, if you are working with \texpkg{minted} in a non-typical context.
%
% \begin{itemize}
-% \item \textbf{There are intermittent ``I can't write on file'' errors.} This can be caused by using \pkg{minted} in a directory that is synchronized with Dropbox or a similar file syncing program. These programs can try to sync \pkg{minted}'s temporary files while it still needs to be able to modify them. The solution is to turn off file syncing or use a directory that is not synced.
-% \item \textbf{I receive a ``Font Warning: Some font shapes were not available'' message, or bold or italic seem to be missing.} This is due to a limitation in the font that is currently in use for typesetting code. In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored. In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font. See The \LaTeX\ Font Catalogue's section on \href{http://www.tug.dk/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives. If you like the default \LaTeX\ fonts, the \pkg{lmodern} package is a good place to start. The \pkg{beramono} and \pkg{courier} packages may also be good options.
+% \item \textbf{There are intermittent ``I can't write on file'' errors.} This can be caused by using \texpkg{minted} in a directory that is synchronized with Dropbox or a similar file syncing program. These programs can try to sync \texpkg{minted}'s temporary files while it still needs to be able to modify them. The solution is to turn off file syncing or use a directory that is not synced.
+% \item \textbf{I receive a ``Font Warning: Some font shapes were not available'' message, or bold or italic seem to be missing.} This is due to a limitation in the font that is currently in use for typesetting code. In some cases, the default font shapes that \LaTeX\ substitutes are perfectly adequate, and the warning may be ignored. In other cases, the font substitutions may not clearly indicate bold or italic text, and you will want to switch to a different font. See The \LaTeX\ Font Catalogue's section on \href{http://www.tug.dk/FontCatalogue/typewriterfonts.html}{Typewriter Fonts} for alternatives. If you like the default \LaTeX\ fonts, the \texpkg{lmodern} package is a good place to start. The \texpkg{beramono} and \texpkg{courier} packages may also be good options.
% \item \textbf{I receive a ``Too many open files'' error under OS X when using caching.} See the note on OS X under Section~\ref{sec:basic:preliminary}.
% \item \textbf{TeXShop can't find \texttt{pygmentize}.} You may need to create a symlink. See \url{https://tex.stackexchange.com/questions/279214}.
-% \item \textbf{Weird things happen when I use the \pkg{fancybox} package.} \pkg{fancybox} conflicts with \pkg{fancyvrb}, which \pkg{minted} uses internally. When using \pkg{fancybox}, make sure that it is loaded before \pkg{minted} (or before \pkg{fancyvrb}, if \pkg{fancyvrb} is not loaded by \pkg{minted}).
-% \item \textbf{When I use \pkg{minted} with KOMA-Script document classes, I get warnings about \texttt{\string\float@addtolists}.} \pkg{minted} uses the \pkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats. Load the package \pkg{scrhack} to resolve the conflict. Or use \pkg{minted}'s |newfloat| package option.
+% \item \textbf{Weird things happen when I use the \texpkg{fancybox} package.} \texpkg{fancybox} conflicts with \texpkg{fancyvrb}, which \texpkg{minted} uses internally. When using \texpkg{fancybox}, make sure that it is loaded before \texpkg{minted} (or before \texpkg{fancyvrb}, if \texpkg{fancyvrb} is not loaded by \texpkg{minted}).
+% \item \textbf{When I use \texpkg{minted} with KOMA-Script document classes, I get warnings about \texttt{\string\float@addtolists}.} \texpkg{minted} uses the \texpkg{float} package to produce floated listings, but this conflicts with the way KOMA-Script does floats. Load the package \texpkg{scrhack} to resolve the conflict. Or use \texpkg{minted}'s |newfloat| package option.
% \item \textbf{Tilde characters \texttt{\string~} are raised, almost like superscripts.}
% This is a font issue. You need a different font encoding, possibly with a different font. Try |\usepackage[T1]{fontenc}|, perhaps with |\usepackage{lmodern}|, or something similar.
%
% \item \textbf{I'm getting errors with math, something like \texttt{TeX capacity exceeded} and \texttt{\string\leavevmode \string\kern \string\z@}.} This is due to ligatures being disabled within verbatim content. See the note under |escapeinside|.
%
-% \item \textbf{With \texttt{mathescape} and the \pkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.} Some math packages like \pkg{breqn} give certain characters like the comma special meanings in math mode. These can conflict with \pkg{minted}. In the \pkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
+% \item \textbf{With \texttt{mathescape} and the \texpkg{breqn} package (or another special math package), the document never finishes compiling or there are other unexpected results.} Some math packages like \texpkg{breqn} give certain characters like the comma special meanings in math mode. These can conflict with \texpkg{minted}. In the \texpkg{breqn} and comma case, this can be fixed by redefining the comma within |minted| environments:
%\begin{verbatim}
%\AtBeginEnvironment{minted}{\catcode`\,=12\mathcode`\,="613B}
%\end{verbatim}
%Other packages/special characters may need their own modifications.
%
-% \item \textbf{I'm getting errors with Beamer.} Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \pkg{minted} commands and environments. |fragile=singleslide| works best, but it disables overlays. |fragile| works by saving the contents of each frame to a temp file and then reusing them. This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment). To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
+% \item \textbf{I'm getting errors with Beamer.} Due to how Beamer treats verbatim content, you may need to use either the |fragile| or |fragile=singleslide| options for frames that contain \texpkg{minted} commands and environments. |fragile=singleslide| works best, but it disables overlays. |fragile| works by saving the contents of each frame to a temp file and then reusing them. This approach allows overlays, but will break if you have the string |\end{frame}| at the beginning of a line (for example, in a |minted| environment). To work around that, you can indent the content of the environment (so that the |\end{frame}| is preceded by one or more spaces) and then use the |gobble| or |autogobble| options to remove the indentation.
%
% \item \textbf{Tabs are eaten by Beamer.} This is due to \href{https://bitbucket.org/rivanvx/beamer/issue/310/tab-characters-in-listings-lost-when-using}{a bug in Beamer's treatment of verbatim content}. Upgrade Beamer or use the linked patch. Otherwise, try |fragile=singleslide| if you don't need overlays, or consider using \cmd\inputminted\ or converting the tabs into spaces.
%
-% \item \textbf{I'm trying to create several new \pkg{minted} commands/environments, and want them all to have the same settings. I'm saving the settings in a macro and then using the macro when defining the commands/environments. But it's failing.}
-% This is due to the way that \pkg{keyval} works (\pkg{minted} uses it to manage options). Arguments are not expanded. See \href{http://tex.stackexchange.com/questions/13563/building-keyval-arguments-using-a-macro/13564#13564}{this} and \href{http://tex.stackexchange.com/questions/145363/why-does-includegraphics-varone-vartwo-not-compile/145366#145366}{this} for more information. It is still possible to do what you want; you just need to expand the options macro before passing it to the commands that create the new commands/environments. An example is shown below. The |\expandafter| is the vital part.
+% \item \textbf{I'm trying to create several new \texpkg{minted} commands/environments, and want them all to have the same settings. I'm saving the settings in a macro and then using the macro when defining the commands/environments. But it's failing.}
+% This is due to the way that \texpkg{keyval} works (\texpkg{minted} uses it to manage options). Arguments are not expanded. See \href{http://tex.stackexchange.com/questions/13563/building-keyval-arguments-using-a-macro/13564#13564}{this} and \href{http://tex.stackexchange.com/questions/145363/why-does-includegraphics-varone-vartwo-not-compile/145366#145366}{this} for more information. It is still possible to do what you want; you just need to expand the options macro before passing it to the commands that create the new commands/environments. An example is shown below. The |\expandafter| is the vital part.
%\begin{verbatim}
%\def\args{linenos,frame=single,fontsize=\footnotesize,style=bw}
%
@@ -1555,10 +1572,10 @@
%\commandthatdoesnotlikeverbatim{Text \usebox{\mybox}}
%\end{verbatim}
%
-% \item \textbf{Extended characters do not work inside \pkg{minted} commands and environments, even when the \pkg{inputenc} package is used.}
-% Version 2.0 adds support for extended characters under the pdfTeX engine. But if you need characters that are not supported by \pkg{inputenc}, you should use the XeTeX or LuaTeX engines instead.
+% \item \textbf{Extended characters do not work inside \texpkg{minted} commands and environments, even when the \texpkg{inputenc} package is used.}
+% Version 2.0 adds support for extended characters under the pdfTeX engine. But if you need characters that are not supported by \texpkg{inputenc}, you should use the XeTeX or LuaTeX engines instead.
%
-% \item \textbf{The \pkg{polyglossia} package is doing undesirable things to code. (For example, adding extra space around colons in French.)} You may need to put your code within |\begin{english}...\end{english}|. This may done for all |minted| environments using \pkg{etoolbox} in the preamble:
+% \item \textbf{The \texpkg{polyglossia} package is doing undesirable things to code. (For example, adding extra space around colons in French.)} You may need to put your code within |\begin{english}...\end{english}|. This may done for all |minted| environments using \texpkg{etoolbox} in the preamble:
% \begin{verbatim}
%\usepackage{etoolbox}
%\BeforeBeginEnvironment{minted}{\begin{english}}
@@ -1568,27 +1585,27 @@
% \item \begin{sloppypar} \textbf{Tabs are being turned into the character sequence \texttt{\string^\string^I}}.
% This happens when you use XeLaTeX. You need to use the |-8bit| command-line option so that tabs may be written correctly to temporary files. See \url{http://tex.stackexchange.com/questions/58732/how-to-output-a-tabulation-into-a-file} for more on XeLaTeX's handling of tab characters. \end{sloppypar}
%
-% \item \textbf{The \pkg{caption} package produces an error when \texttt{\string\captionof} and other commands are used in combination with \pkg{minted}.}
-% Load the \pkg{caption} package with the option |compatibility=false|. Or better yet, use \pkg{minted}'s |newfloat| package option, which provides better \pkg{caption} compatibility.
+% \item \textbf{The \texpkg{caption} package produces an error when \texttt{\string\captionof} and other commands are used in combination with \texpkg{minted}.}
+% Load the \texpkg{caption} package with the option |compatibility=false|. Or better yet, use \texpkg{minted}'s |newfloat| package option, which provides better \texpkg{caption} compatibility.
%
% \item \textbf{I need a listing environment that supports page breaks.} The built-in listing environment is a standard float; it doesn't support page breaks. You will probably want to define a new environment for long floats. For example,
%\begin{verbatim}
%\usepackage{caption}
%\newenvironment{longlisting}{\captionsetup{type=listing}}{}
%\end{verbatim}
-% With the \pkg{caption} package, it is best to use \pkg{minted}'s |newfloat| package option. See \url{http://tex.stackexchange.com/a/53540/10742} for more on |listing| environments with page breaks.
+% With the \texpkg{caption} package, it is best to use \texpkg{minted}'s |newfloat| package option. See \url{http://tex.stackexchange.com/a/53540/10742} for more on |listing| environments with page breaks.
%
% \item \textbf{I want to use a custom script/executable to access Pygments, rather than |pygmentize|.} Redefine |\MintedPygmentize|:
%\begin{verbatim}
%\renewcommand{\MintedPygmentize}{...}
%\end{verbatim}
%
-% \item \textbf{I want to use the command-line option \texttt{-output-directory}, or MiKTeX's \texttt{-aux-directory}, but am getting errors.} Use the package option |outputdir| to specify the location of the output directory. Unfortunately, there is no way for \pkg{minted} to detect the output directory automatically.
+% \item \textbf{I want to use the command-line option \texttt{-output-directory}, or MiKTeX's \texttt{-aux-directory}, but am getting errors.} Use the package option |outputdir| to specify the location of the output directory. Unfortunately, there is no way for \texpkg{minted} to detect the output directory automatically.
%
-% \item \textbf{I want extended characters in frame labels, but am getting errors.} This can happen with \pkg{minted} <2.0 and Python 2.7, due to a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/801/python-2-fails-to-detect-terminal-encoding}{terminal encoding issue with Pygments}. It should work with any version of Python with \pkg{minted} 2.0+, which processes labels internally and does not send them to Python.
+% \item \textbf{I want extended characters in frame labels, but am getting errors.} This can happen with \texpkg{minted} <2.0 and Python 2.7, due to a \href{https://bitbucket.org/birkenfeld/pygments-main/issue/801/python-2-fails-to-detect-terminal-encoding}{terminal encoding issue with Pygments}. It should work with any version of Python with \texpkg{minted} 2.0+, which processes labels internally and does not send them to Python.
% \item \textbf{\texttt{minted} environments have extra vertical space inside \texttt{tabular}.} It is possible to \href{https://github.com/gpoore/minted/issues/82}{create a custom environment} that eliminates the extra space. However, a general solution that behaves as expected in the presence of adjacent text remains to be found.
-% \item \textbf{I'm receiving a warning from \texttt{lineno.sty} that ``Command \texttt{\string\@parboxrestore} has changed.''} This can happen when \pkg{minted} is loaded after \pkg{csquotes}. Try loading \pkg{minted} first. If you receive this message when you are not using \pkg{csquotes}, you may want to experiment with the order of loading packages and might also open an issue.
-% \item \textbf{I'm using \app{texi2pdf}, and getting ``Cannot stat'' errors from \app{tar}}: This is due to the way that \app{texi2pdf} handles temporary files. \pkg{minted} automatically cleans up its temporary files, but \app{texi2pdf} assumes that any temporary file that is ever created will still exist at the end of the run, so it tries to access the files that \pkg{minted} has deleted. It's possible to disable minted's temp file cleanup by adding |\renewcommand{\DeleteFile}[2][]{}| after the |\usepackage{minted}|.
+% \item \textbf{I'm receiving a warning from \texttt{lineno.sty} that ``Command \texttt{\string\@parboxrestore} has changed.''} This can happen when \texpkg{minted} is loaded after \texpkg{csquotes}. Try loading \texpkg{minted} first. If you receive this message when you are not using \texpkg{csquotes}, you may want to experiment with the order of loading packages and might also open an issue.
+% \item \textbf{I'm using \app{texi2pdf}, and getting ``Cannot stat'' errors from \app{tar}}: This is due to the way that \app{texi2pdf} handles temporary files. \texpkg{minted} automatically cleans up its temporary files, but \app{texi2pdf} assumes that any temporary file that is ever created will still exist at the end of the run, so it tries to access the files that \texpkg{minted} has deleted. It's possible to disable minted's temp file cleanup by adding |\renewcommand{\DeleteFile}[2][]{}| after the |\usepackage{minted}|.
% \end{itemize}
%
%
@@ -1667,7 +1684,7 @@
%
% \begin{macro}{newfloat}
%
-% Define an option to use \pkg{newfloat} rather than \pkg{float} to create a floated |listing| environment.
+% Define an option to use \texpkg{newfloat} rather than \texpkg{float} to create a floated |listing| environment.
%
% \begin{macrocode}
\DeclareBoolOption{newfloat}
@@ -1715,7 +1732,7 @@
%
%
% \begin{macro}{frozencache}
-% Define an option that uses a fixed set of cache files, using |listing<number>| file naming with |\write18| disabled. This is convenient for working with a document in an environment in which |\write18| support is disabled and \pkg{minted} content does not need to be modified.
+% Define an option that uses a fixed set of cache files, using |listing<number>| file naming with |\write18| disabled. This is convenient for working with a document in an environment in which |\write18| support is disabled and \texpkg{minted} content does not need to be modified.
% \begin{macrocode}
\DeclareBoolOption{frozencache}
% \end{macrocode}
@@ -1723,7 +1740,7 @@
%
%
% \begin{macro}{\minted@outputdir}
-% The |-output-directory| command-line option for \LaTeX\ causes problems for \pkg{minted}, because the \pkg{minted} temporary files are saved in the output directory, but \pkg{minted} still looks for them in the document root directory. There is no way to access the value of the command-line option. But it is possible to allow the output directory to be specified manually as a package option. A trailing slash is automatically appended to the |outputdir|, so that it may be directly joined to |cachedir|. This may be redundant if the user-supplied value already ends with a slash, but doubled slashes are ignored under *nix and Windows, so it isn't a problem.
+% The |-output-directory| command-line option for \LaTeX\ causes problems for \texpkg{minted}, because the \texpkg{minted} temporary files are saved in the output directory, but \texpkg{minted} still looks for them in the document root directory. There is no way to access the value of the command-line option. But it is possible to allow the output directory to be specified manually as a package option. A trailing slash is automatically appended to the |outputdir|, so that it may be directly joined to |cachedir|. This may be redundant if the user-supplied value already ends with a slash, but doubled slashes are ignored under *nix and Windows, so it isn't a problem.
% \begin{macrocode}
\let\minted@outputdir\@empty
\let\minted@outputdir@windows\@empty
@@ -1752,7 +1769,7 @@
%
%
% \begin{macro}{draft}
-% Define an option that allows \pkg{fancyvrb} to do all typesetting directly, without using \app{Pygments}. This trades syntax highlighting for speed. Note that in many cases, the difference in performance between caching and draft mode will be minimal. Also note that draft settings may be inherited from the document class.
+% Define an option that allows \texpkg{fancyvrb} to do all typesetting directly, without using \app{Pygments}. This trades syntax highlighting for speed. Note that in many cases, the difference in performance between caching and draft mode will be minimal. Also note that draft settings may be inherited from the document class.
% \begin{macrocode}
\DeclareBoolOption{draft}
% \end{macrocode}
@@ -1766,7 +1783,7 @@
% \end{macro}
%
%
-% Process package options. Proceed with everything that immediately relies upon them. If PGF/Ti\textit{k}Z externalization is in use, switch on |draft| mode and turn off |cache|. Externalization involves compiling the \emph{entire} document; all parts not related to the current image are ``silently thrown away.'' \pkg{minted} needs to cooperate with that by not writing any temp files or creating any directories. Two checks are done for externalization. The first, using |\tikzifexternalizing|, works if externalization is set before \pkg{minted} is loaded. The second, using |\tikzexternalrealjob|, works if externalization is set after \pkg{minted} is loaded.
+% Process package options. Proceed with everything that immediately relies upon them. If PGF/Ti\textit{k}Z externalization is in use, switch on |draft| mode and turn off |cache|. Externalization involves compiling the \emph{entire} document; all parts not related to the current image are ``silently thrown away.'' \texpkg{minted} needs to cooperate with that by not writing any temp files or creating any directories. Two checks are done for externalization. The first, using |\tikzifexternalizing|, works if externalization is set before \texpkg{minted} is loaded. The second, using |\tikzexternalrealjob|, works if externalization is set after \texpkg{minted} is loaded.
%
% \begin{macrocode}
\ProcessKeyvalOptions*
@@ -2005,7 +2022,7 @@
%
% \subsection{Option processing}
%
-% Option processing is somewhat involved, because we want to be able to define options at various levels of hierarchy: individual command/environment, language, global (document). And once those options are defined, we need to go through the hierarchy in a defined order of precedence to determine which option to apply. As if that wasn't complicated enough, some options need to be sent to Pygments, some need to be sent to \pkg{fancyvrb}, and some need to be processed within \pkg{minted} itself.
+% Option processing is somewhat involved, because we want to be able to define options at various levels of hierarchy: individual command/environment, language, global (document). And once those options are defined, we need to go through the hierarchy in a defined order of precedence to determine which option to apply. As if that wasn't complicated enough, some options need to be sent to Pygments, some need to be sent to \texpkg{fancyvrb}, and some need to be processed within \texpkg{minted} itself.
%
% To begin with, we need macros for storing lists of options that will later be passed via the command line to Pygments (|optlistcl|). These are defined at the global (|cl@g|), language (|cl@lang|), and command or environment (|cl@cmd|) levels, so that settings can be specified at various levels of hierarchy. The language macro is actually a placeholder. The current language will be tracked using |\minted@lang|. Each individual language will create a |\minted@optlistcl@lang|\meta{language} macro. |\minted@optlistcl@lang| may be |\let| to this macro as convenient; otherwise, the general language macro merely serves as a placeholder.
%
@@ -2047,7 +2064,7 @@
% \end{macrocode}
% \end{macro}
%
-% We also need macros for storing lists of options that will later be passed to \pkg{fancyvrb} (|optlistfv|). As before, these exist at the global (|fv@g|), language (|fv@lang|), and command or environment (|fv@cmd|) levels. Pygments accepts \pkg{fancyvrb} options, but in almost all cases, these options may be applied via |\fvset| rather than via running Pygments. This is significantly more efficient when caching is turned on, since it allows formatting changes to be applied without having to re-highlight the code.
+% We also need macros for storing lists of options that will later be passed to \texpkg{fancyvrb} (|optlistfv|). As before, these exist at the global (|fv@g|), language (|fv@lang|), and command or environment (|fv@cmd|) levels. Pygments accepts \texpkg{fancyvrb} options, but in almost all cases, these options may be applied via |\fvset| rather than via running Pygments. This is significantly more efficient when caching is turned on, since it allows formatting changes to be applied without having to re-highlight the code.
%
% \begin{macro}{\minted@optlistfv@g}
% \begin{macrocode}
@@ -2101,7 +2118,7 @@
% \end{macrocode}
% \end{macro}
%
-% We need a way to define options in bulk at the global, language, and command levels. How this is done will depend on the type of option. The keys created are grouped by level: |minted@opt@g|, |minted@opt@lang|, and |minted@opt@cmd|, plus inline variants. The language-level key groupings use |\minted@lang| internally, so we don't need to duplicate the internals for different languages. The key groupings are independent of whether a given option relates to Pygments, \pkg{fancyvrb}, etc. Organization by level is the only thing that is important here, since keys are applied in a hierarchical fashion. Key values are stored in macros of the form |\minted@opt@|\meta{level}|:|\meta{key}, so that they may be retrieved later. In practice, these key macros will generally not be used directly (hence the colon in the name). Rather, the hierarchy of macros will be traversed until an existing macro is found.
+% We need a way to define options in bulk at the global, language, and command levels. How this is done will depend on the type of option. The keys created are grouped by level: |minted@opt@g|, |minted@opt@lang|, and |minted@opt@cmd|, plus inline variants. The language-level key groupings use |\minted@lang| internally, so we don't need to duplicate the internals for different languages. The key groupings are independent of whether a given option relates to Pygments, \texpkg{fancyvrb}, etc. Organization by level is the only thing that is important here, since keys are applied in a hierarchical fashion. Key values are stored in macros of the form |\minted@opt@|\meta{level}|:|\meta{key}, so that they may be retrieved later. In practice, these key macros will generally not be used directly (hence the colon in the name). Rather, the hierarchy of macros will be traversed until an existing macro is found.
%
% \begin{macro}{\minted@def@optcl}
%
@@ -2111,47 +2128,54 @@
%
% Options are added to the option lists in such a way that they will be detokenized. This is necessary since they will ultimately be used in |\write18|.
% \begin{macrocode}
-\newcommand{\minted@addto@optlistcl}[2]{%
+\ifwindows
+ \newcommand{\minted@optlistcl@quote}[2]{%
+ \detokenize{#1="#2"}}
+\else
+ \newcommand{\minted@optlistcl@quote}[2]{%
+ \detokenize{#1='#2'}}
+\fi
+\newcommand{\minted@addto@optlistcl}[3]{%
\expandafter\def\expandafter#1\expandafter{#1%
- \detokenize{#2}\space}}
-\newcommand{\minted@addto@optlistcl@lang}[2]{%
+ \minted@optlistcl@quote{#2}{#3}\space}}
+\newcommand{\minted@addto@optlistcl@lang}[3]{%
\expandafter\let\expandafter\minted@tmp\csname #1\endcsname
\expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp%
- \detokenize{#2}\space}%
+ \minted@optlistcl@quote{#2}{#3}\space}%
\expandafter\let\csname #1\endcsname\minted@tmp}
\newcommand{\minted@def@optcl}[4][]{%
\ifthenelse{\equal{#1}{}}%
{\define@key{minted@opt@g}{#2}{%
- \minted@addto@optlistcl{\minted@optlistcl@g}{#3=#4}%
+ \minted@addto@optlistcl{\minted@optlistcl@g}{#3}{#4}%
\@namedef{minted@opt@g:#2}{#4}}%
\define@key{minted@opt@g@i}{#2}{%
- \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3=#4}%
+ \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3}{#4}%
\@namedef{minted@opt@g@i:#2}{#4}}%
\define@key{minted@opt@lang}{#2}{%
- \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3=#4}%
+ \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
\define@key{minted@opt@lang@i}{#2}{%
\minted@addto@optlistcl@lang{%
- minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+ minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
\define@key{minted@opt@cmd}{#2}{%
- \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3=#4}%
+ \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3}{#4}%
\@namedef{minted@opt@cmd:#2}{#4}}}%
{\define@key{minted@opt@g}{#2}[#1]{%
- \minted@addto@optlistcl{\minted@optlistcl@g}{#3=#4}%
+ \minted@addto@optlistcl{\minted@optlistcl@g}{#3}{#4}%
\@namedef{minted@opt@g:#2}{#4}}%
\define@key{minted@opt@g@i}{#2}[#1]{%
- \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3=#4}%
+ \minted@addto@optlistcl{\minted@optlistcl@g@i}{#3}{#4}%
\@namedef{minted@opt@g@i:#2}{#4}}%
\define@key{minted@opt@lang}{#2}[#1]{%
- \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3=#4}%
+ \minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
\define@key{minted@opt@lang@i}{#2}[#1]{%
\minted@addto@optlistcl@lang{%
- minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+ minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
\define@key{minted@opt@cmd}{#2}[#1]{%
- \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3=#4}%
+ \minted@addto@optlistcl{\minted@optlistcl@cmd}{#3}{#4}%
\@namedef{minted@opt@cmd:#2}{#4}}}%
}
% \end{macrocode}
@@ -2159,88 +2183,78 @@
%
% This covers the typical options that must be passed to Pygments. But some, particularly |escapeinside|, need more work. Since their arguments may contain escaped characters, expansion rather than detokenization is needed. Getting expansion to work as desired in a |\write18| context requires the redefinition of some characters.
%
-% \begin{macro}{\minted@escchars}
-% We need to define versions of common escaped characters that will work correctly under expansion for use in |\write18|.
-% \begin{macrocode}
-\edef\minted@hashchar{\string#}
-\edef\minted@dollarchar{\string$}
-\edef\minted@ampchar{\string&}
-\edef\minted@underscorechar{\string_}
-\edef\minted@tildechar{\string~}
-\edef\minted@leftsquarebracket{\string[}
-\edef\minted@rightsquarebracket{\string]}
-\newcommand{\minted@escchars}{%
- \let\#\minted@hashchar
- \let\%\@percentchar
- \let\{\@charlb
- \let\}\@charrb
- \let\$\minted@dollarchar
- \let\&\minted@ampchar
- \let\_\minted@underscorechar
- \let\\\@backslashchar
- \let~\minted@tildechar
- \let\~\minted@tildechar
- \let\[\minted@leftsquarebracket
- \let\]\minted@rightsquarebracket
-} %$ <- highlighting
+% \begin{macro}{\minted@escape}
+% Process (possibly backslash-escaped) characters into a form that will work correctly under expansion for use in |\write18|. This assumes that only punctuation characters are escaped. (Otherwise, trailing spaces from |\detokenize| would need to be stripped.) This is currently only used for |escapeinside|.
+% \begin{macrocode}
+\begingroup
+\catcode`\!=0
+!catcode`!\=12
+!gdef!minted@escape#1{%
+ !expandafter!minted@escape@i!detokenize{#1}\!FV@Sentinel}
+!gdef!minted@escape@i#1\#2!FV@Sentinel{%
+ !if!relax!detokenize{#2}!relax
+ !expandafter!@firstoftwo
+ !else
+ !expandafter!@secondoftwo
+ !fi
+ {#1!minted@escape@end\#2!FV@Sentinel}
+ {#1!minted@escape@esc\#2!FV@Sentinel}}
+!gdef!minted@escape@end#1!FV@Sentinel{}
+!gdef!minted@escape@esc\#1#2!FV@Sentinel{%
+ #1!minted@escape@i#2!FV@Sentinel}
+!endgroup
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\minted@def@optcl@e}
-% Now to define options that are expanded.
-% \begin{macrocode}
-\newcommand{\minted@addto@optlistcl@e}[2]{%
- \begingroup
- \minted@escchars
- \xdef\minted@xtmp{#2}%
- \endgroup
- \expandafter\minted@addto@optlistcl@e@i\expandafter{\minted@xtmp}{#1}}
-\def\minted@addto@optlistcl@e@i#1#2{%
- \expandafter\def\expandafter#2\expandafter{#2#1\space}}
-\newcommand{\minted@addto@optlistcl@lang@e}[2]{%
- \begingroup
- \minted@escchars
- \xdef\minted@xtmp{#2}%
- \endgroup
- \expandafter\minted@addto@optlistcl@lang@e@i\expandafter{\minted@xtmp}{#1}}
-\def\minted@addto@optlistcl@lang@e@i#1#2{%
+% Now to define options that involve backslash escapes.
+% \begin{macrocode}
+\newcommand{\minted@addto@optlistcl@e}[3]{%
+ \edef\minted@tmp{\minted@escape{#3}}%
+ \expandafter\minted@addto@optlistcl@e@i\expandafter{\minted@tmp}{#1}{#2}}
+\def\minted@addto@optlistcl@e@i#1#2#3{%
+ \expandafter\def\expandafter#2\expandafter{#2\minted@optlistcl@quote{#3}{#1}\space}}
+\newcommand{\minted@addto@optlistcl@lang@e}[3]{%
+ \edef\minted@tmp{\minted@escape{#3}}%
+ \expandafter\minted@addto@optlistcl@lang@e@i\expandafter{\minted@tmp}{#1}{#2}}
+\def\minted@addto@optlistcl@lang@e@i#1#2#3{%
\expandafter\let\expandafter\minted@tmp\csname #2\endcsname
- \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp#1\space}%
+ \expandafter\def\expandafter\minted@tmp\expandafter{\minted@tmp\minted@optlistcl@quote{#3}{#1}\space}%
\expandafter\let\csname #2\endcsname\minted@tmp}
\newcommand{\minted@def@optcl@e}[4][]{%
\ifthenelse{\equal{#1}{}}%
{\define@key{minted@opt@g}{#2}{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3=#4}%
+ \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3}{#4}%
\@namedef{minted@opt@g:#2}{#4}}%
\define@key{minted@opt@g@i}{#2}{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3=#4}%
+ \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3}{#4}%
\@namedef{minted@opt@g@i:#2}{#4}}%
\define@key{minted@opt@lang}{#2}{%
- \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3=#4}%
+ \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
\define@key{minted@opt@lang@i}{#2}{%
\minted@addto@optlistcl@lang@e{%
- minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+ minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
\define@key{minted@opt@cmd}{#2}{%
- \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3=#4}%
+ \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3}{#4}%
\@namedef{minted@opt@cmd:#2}{#4}}}%
{\define@key{minted@opt@g}{#2}[#1]{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3=#4}%
+ \minted@addto@optlistcl@e{\minted@optlistcl@g}{#3}{#4}%
\@namedef{minted@opt@g:#2}{#4}}%
\define@key{minted@opt@g@i}{#2}[#1]{%
- \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3=#4}%
+ \minted@addto@optlistcl@e{\minted@optlistcl@g@i}{#3}{#4}%
\@namedef{minted@opt@g@i:#2}{#4}}%
\define@key{minted@opt@lang}{#2}[#1]{%
- \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3=#4}%
+ \minted@addto@optlistcl@lang@e{minted@optlistcl@lang\minted@lang}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang:#2}{#4}}%
\define@key{minted@opt@lang@i}{#2}[#1]{%
\minted@addto@optlistcl@lang@e{%
- minted@optlistcl@lang\minted@lang @i}{#3=#4}%
+ minted@optlistcl@lang\minted@lang @i}{#3}{#4}%
\@namedef{minted@opt@lang\minted@lang @i:#2}{#4}}%
\define@key{minted@opt@cmd}{#2}[#1]{%
- \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3=#4}%
+ \minted@addto@optlistcl@e{\minted@optlistcl@cmd}{#3}{#4}%
\@namedef{minted@opt@cmd:#2}{#4}}}%
}
% \end{macrocode}
@@ -2253,39 +2267,39 @@
% \begin{macrocode}
\newcommand{\minted@def@optcl@switch}[2]{%
\define@booleankey{minted@opt@g}{#1}%
- {\minted@addto@optlistcl{\minted@optlistcl@g}{#2=True}%
+ {\minted@addto@optlistcl{\minted@optlistcl@g}{#2}{True}%
\@namedef{minted@opt@g:#1}{true}}
- {\minted@addto@optlistcl{\minted@optlistcl@g}{#2=False}%
+ {\minted@addto@optlistcl{\minted@optlistcl@g}{#2}{False}%
\@namedef{minted@opt@g:#1}{false}}
\define@booleankey{minted@opt@g@i}{#1}%
- {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2=True}%
+ {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2}{True}%
\@namedef{minted@opt@g@i:#1}{true}}
- {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2=False}%
+ {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2}{False}%
\@namedef{minted@opt@g@i:#1}{false}}
\define@booleankey{minted@opt@lang}{#1}%
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2=True}%
+ {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2}{True}%
\@namedef{minted@opt@lang\minted@lang:#1}{true}}
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2=False}%
+ {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2}{False}%
\@namedef{minted@opt@lang\minted@lang:#1}{false}}
\define@booleankey{minted@opt@lang@i}{#1}%
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2=True}%
+ {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2}{True}%
\@namedef{minted@opt@lang\minted@lang @i:#1}{true}}
- {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2=False}%
+ {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2}{False}%
\@namedef{minted@opt@lang\minted@lang @i:#1}{false}}
\define@booleankey{minted@opt@cmd}{#1}%
- {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2=True}%
+ {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2}{True}%
\@namedef{minted@opt@cmd:#1}{true}}
- {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2=False}%
+ {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2}{False}%
\@namedef{minted@opt@cmd:#1}{false}}
}
% \end{macrocode}
% \end{macro}
%
-% Now that all the machinery for Pygments options is in place, we can move on to \pkg{fancyvrb} options.
+% Now that all the machinery for Pygments options is in place, we can move on to \texpkg{fancyvrb} options.
%
% \begin{macro}{\minted@def@optfv}
%
-% Define \pkg{fancyvrb} options. The |#1={##1}| is needed because any braces enclosing the argument (|##1|) will be stripped during the initial capture, and they need to be reinserted before \pkg{fancyvrb} gets the argument and sends it through another \pkg{keyval} processing step. If there were no braces initially, adding them here doesn't hurt, since they are just stripped off again during processing.
+% Define \texpkg{fancyvrb} options. The |#1={##1}| is needed because any braces enclosing the argument (|##1|) will be stripped during the initial capture, and they need to be reinserted before \texpkg{fancyvrb} gets the argument and sends it through another \texpkg{keyval} processing step. If there were no braces initially, adding them here doesn't hurt, since they are just stripped off again during processing.
% \begin{macrocode}
\newcommand{\minted@def@optfv}[1]{%
\define@key{minted@opt@g}{#1}{%
@@ -2322,7 +2336,7 @@
%
% \begin{macro}{\minted@def@optfv@switch}
%
-% Define \pkg{fancyvrb} boolean options.
+% Define \texpkg{fancyvrb} boolean options.
% \begin{macrocode}
\newcommand{\minted@def@optfv@switch}[1]{%
\define@booleankey{minted@opt@g}{#1}%
@@ -2388,7 +2402,7 @@
% \end{macro}
%
% \begin{macro}{\minted@fvset}
-% We will need a way to actually use the lists of stored \pkg{fancyvrb} options later on.
+% We will need a way to actually use the lists of stored \texpkg{fancyvrb} options later on.
% \begin{macrocode}
\newcommand{\minted@fvset}{%
\expandafter\fvset\expandafter{\minted@optlistfv@g}%
@@ -2407,7 +2421,7 @@
% \end{macro}
%
%
-% We need a way to define \pkg{minted}-specific options at multiple levels of hierarchy, as well as a way to retrieve these options. As with previous types of options, values are stored in macros of the form |\minted@opt@|\meta{level}|:|\meta{key}, since they are not meant to be accessed directly.
+% We need a way to define \texpkg{minted}-specific options at multiple levels of hierarchy, as well as a way to retrieve these options. As with previous types of options, values are stored in macros of the form |\minted@opt@|\meta{level}|:|\meta{key}, since they are not meant to be accessed directly.
%
% The order of precedence is |cmd|, |lang@i|, |g@i|, |lang|, |g|. A value specified at the command or environment level should override other settings. In its absence, a value specified for an inline command should override other settings, if we are indeed in an inline context. Otherwise, language settings take precedence over global settings.
%
@@ -2415,7 +2429,7 @@
%
%
% \begin{macro}{\minted@def@opt}
-% Finally, on to the actual option definitions for \pkg{minted}-specific options.
+% Finally, on to the actual option definitions for \texpkg{minted}-specific options.
%
% Usage: |\minted@def@opt[|\meta{initial global value}|]{|\meta{key name}|}|
% \begin{macrocode}
@@ -2469,11 +2483,11 @@
% \begin{itemize}
% \item At sign |@| would be handled by the |\makeatletter| within the Pygments style definition if the style was brought in via |\input|, but |\makeatletter| doesn't affect tokenization with the |catchfile| approach.
% \item Percent |%| may not have its normal meaning within a |.dtx| file.
-% \item Backtick |`| is made active by some \pkg{babel} package options, such as |magyar|.
+% \item Backtick |`| is made active by some \texpkg{babel} package options, such as |magyar|.
% \end{itemize}
% |\endlinechar| also requires special handling to avoid introducing unwanted spaces.
%
-% The |\ifx\PYG\relax| tests detect outdated style definitions from \pkg{minted} <2.6 and replace them when possible, and also detect missing styles. Before \pkg{minted} 2.6, style macros used a |\PYG<style>| prefix and were defined globally. Starting with 2.6, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix. This allows more robust treatment of style names that involve punctuation characters and numbers.
+% The |\ifx\PYG\relax| tests detect outdated style definitions from \texpkg{minted} <2.6 and replace them when possible, and also detect missing styles. Before \texpkg{minted} 2.6, style macros used a |\PYG<style>| prefix and were defined globally. Starting with 2.6, styles are redefined upon every use (within groups), and all styles use macros with a |\PYG| prefix. This allows more robust treatment of style names that involve punctuation characters and numbers.
% \begin{macrocode}
\newcommand{\minted@generate@PYGdef}[1]{%
\ifthenelse{\boolean{minted@cache}}%
@@ -2540,6 +2554,7 @@
\fi
\csname minted@PYGdef@\minted@style\endcsname
\minted@patch@PYGZsq
+ \minted@patch@PYGZhy
}
\ifthenelse{\boolean{minted@draft}}{\renewcommand{\minted@defstyle}[1]{}}{}
% \end{macrocode}
@@ -2547,7 +2562,7 @@
%
%
% \begin{macro}{\minted@patch@PYGZsq}
-% The single quote macro from \pkg{Pygments} 1.6+ needs to be patched if the \pkg{upquote} package is in use. Patching is done when the default style is created. Patching is only attempted if the macro exists, so that there is a graceful fallback in the event of a custom \pkg{Pygments} stylesheet.
+% The single quote macro from \texpkg{Pygments} 1.6+ needs to be patched if the \texpkg{upquote} package is in use. Patching is done when the default style is created. Patching is only attempted if the macro exists, so that there is a graceful fallback in the event of a custom \texpkg{Pygments} stylesheet.
% \begin{macrocode}
\newcommand{\minted@patch@PYGZsq}{%
\ifcsname PYGZsq\endcsname
@@ -2560,10 +2575,23 @@
\catcode`\'=\active
\gdef\minted@patch@PYGZsq@i{\gdef\PYGZsq{'}}
\endgroup
-\ifthenelse{\boolean{minted@draft}}{}{\AtBeginDocument{\minted@patch@PYGZsq}}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\minted@patch@PYGZhy}
+% Redefine the hyphen under LuaTeX to prevent unintended line breaks.
+% \begin{macrocode}
+\newcommand{\minted@patch@PYGZhy}{%
+ \ifcsname PYGZhy\endcsname
+ \expandafter\ifdefstring\expandafter{\csname PYGZhy\endcsname}{\char`\-}%
+ {\def\PYGZhy{\mbox{-}}}%
+ {}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
%
% \begin{macro}{\minted@def@opt@switch}
% And we need a switch version.
@@ -2593,7 +2621,7 @@
%
%
% \begin{macro}{\minted@get@opt}
-% We need a way to traverse the hierarchy of values for a given key and return the current value that has precedence. In doing this, we need to specify a default value to use if no value is found. When working with \pkg{minted}-specific values, there should generally be a default value; in those cases, an empty default may be supplied. But the macro should also work with Pygments settings, which are stored in macros of the same form and will sometimes need to be accessed (for example, |encoding|). In the Pygments case, there may very well be no default values on the \LaTeX\ side, because we are falling back on Pygments' own built-in defaults. There is no need to duplicate those when very few Pygments values are ever needed; it is simpler to specify the default fallback when accessing the macro value.
+% We need a way to traverse the hierarchy of values for a given key and return the current value that has precedence. In doing this, we need to specify a default value to use if no value is found. When working with \texpkg{minted}-specific values, there should generally be a default value; in those cases, an empty default may be supplied. But the macro should also work with Pygments settings, which are stored in macros of the same form and will sometimes need to be accessed (for example, |encoding|). In the Pygments case, there may very well be no default values on the \LaTeX\ side, because we are falling back on Pygments' own built-in defaults. There is no need to duplicate those when very few Pygments values are ever needed; it is simpler to specify the default fallback when accessing the macro value.
%
% From a programming perspective, the default argument value needs to be mandatory, so that |\minted@get@opt| can be fully expandable. This significantly simplifies accessing options.
% \begin{macrocode}
@@ -2636,13 +2664,13 @@
% \end{macro}
%
%
-% \noindent Actual option definitions. Some of these must be defined conditionally depending on whether we are in |draft| mode; in |draft| mode, we need to emulate Pygments functionality with \LaTeX, particularly with \pkg{fancyvrb}, when possible. For example, gobbling must be performed by Pygments when |draft| is off, but when |draft| is on, \pkg{fancyvrb} can perform gobbling.
+% \noindent Actual option definitions. Some of these must be defined conditionally depending on whether we are in |draft| mode; in |draft| mode, we need to emulate Pygments functionality with \LaTeX, particularly with \texpkg{fancyvrb}, when possible. For example, gobbling must be performed by Pygments when |draft| is off, but when |draft| is on, \texpkg{fancyvrb} can perform gobbling.
%
% Lexers.
% \begin{macrocode}
\minted@def@optcl{encoding}{-P encoding}{#1}
\minted@def@optcl{outencoding}{-P outencoding}{#1}
-\minted@def@optcl@e{escapeinside}{-P "escapeinside}{#1"}
+\minted@def@optcl@e{escapeinside}{-P escapeinside}{#1}
\minted@def@optcl@switch{stripnl}{-P stripnl}
\minted@def@optcl@switch{stripall}{-P stripall}
% Python console
@@ -2670,7 +2698,7 @@
\minted@def@opt@detok{style}
% \end{macrocode}
%
-% \pkg{fancyvrb} and \pkg{fvextra} options.
+% \texpkg{fancyvrb} and \texpkg{fvextra} options.
% \begin{macrocode}
\minted@def@optfv{frame}
\minted@def@optfv{framesep}
@@ -2747,7 +2775,7 @@
\minted@def@optfv{fontencoding}
% \end{macrocode}
%
-% Finally, options specific to \pkg{minted}.
+% Finally, options specific to \texpkg{minted}.
%
% |bgcolor|. The original, |minipage|- and |\colorbox|-based solution was replaced with a |framed|-based solution in version 2.2. A dedicated framing package will often be preferable.
% \begin{macrocode}
@@ -2772,7 +2800,7 @@
% \subsection{Internal helpers}
%
% \begin{environment}{minted@snugshade*}
-% Define a custom version of \pkg{framed}'s |snugshade*| that takes a color as argument. This avoids the need to redefine |shadecolor|.
+% Define a custom version of \texpkg{framed}'s |snugshade*| that takes a color as argument. This avoids the need to redefine |shadecolor|.
% \begin{macrocode}
\newenvironment{minted@snugshade*}[1]{%
\def\FrameCommand##1{\hskip\@totalleftmargin
@@ -2789,7 +2817,7 @@
%
% \begin{environment}{\minted@bgbox}
%
-% Define an environment that may be wrapped around a |minted| environment to assign a background color. This is retained as a holdover from version 1.0. In most cases, it is probably better to use a dedicated framing package, such as \pkg{tcolorbox} or \pkg{mdframed}.
+% Define an environment that may be wrapped around a |minted| environment to assign a background color. This is retained as a holdover from version 1.0. In most cases, it is probably better to use a dedicated framing package, such as \texpkg{tcolorbox} or \texpkg{mdframed}.
%
% First, we need to define a new save box.
%
@@ -2797,7 +2825,7 @@
\newsavebox{\minted@bgbox}
% \end{macrocode}
%
-% Now we can define the environment that applies a background color. Prior to \pkg{minted} 2.2, this involved a |minipage|. However, that approach was problematic because it did not allow linebreaks, would be pushed into the margin by immediately preceding text, and had very different whitespace separation from preceding and following text compared to no background color. In version 2.2, this was replaced with an approach based on \pkg{framed}. |\FV@NumberSep| is adjusted by |\fboxsep| to ensure that line numbers remain in the same location in the margin regardless of whether |bgcolor| is used.
+% Now we can define the environment that applies a background color. Prior to \texpkg{minted} 2.2, this involved a |minipage|. However, that approach was problematic because it did not allow linebreaks, would be pushed into the margin by immediately preceding text, and had very different whitespace separation from preceding and following text compared to no background color. In version 2.2, this was replaced with an approach based on \texpkg{framed}. |\FV@NumberSep| is adjusted by |\fboxsep| to ensure that line numbers remain in the same location in the margin regardless of whether |bgcolor| is used.
%
% \begin{macrocode}
\newenvironment{minted@colorbg}[1]{%
@@ -2842,7 +2870,7 @@
%
%
% \begin{macro}{\minted@FVB@VerbatimOut}
-% We need a custom version of \pkg{fancyvrb}'s |\FVB@VerbatimOut| that supports Unicode (everything written to file is |\detokenized|). We also need to prevent the value of |FancyVerbLine| from being incorrectly incremented.
+% We need a custom version of \texpkg{fancyvrb}'s |\FVB@VerbatimOut| that supports Unicode (everything written to file is |\detokenized|). We also need to prevent the value of |FancyVerbLine| from being incorrectly incremented.
% \begin{macrocode}
\newcommand{\minted@write@detok}[1]{%
\immediate\write\FV@OutFile{\detokenize{#1}}}
@@ -2873,7 +2901,7 @@
%
%
% \begin{macro}{\MintedPygmentize}
-% We need a way to customize the executable/script that is called to perform highlighting. Typically, we will want |pygmentize|. But advanced users might wish to use a custom Python script instead. The command is only defined if it does not exist. In general, the command should be |\renewcommand|ed after the package is loaded, but this way, it will work if defined before \pkg{minted} is loaded.
+% We need a way to customize the executable/script that is called to perform highlighting. Typically, we will want |pygmentize|. But advanced users might wish to use a custom Python script instead. The command is only defined if it does not exist. In general, the command should be |\renewcommand|ed after the package is loaded, but this way, it will work if defined before \texpkg{minted} is loaded.
% \begin{macrocode}
\ifcsname MintedPygmentize\endcsname\else
\newcommand{\MintedPygmentize}{pygmentize}
@@ -2972,6 +3000,11 @@
% At the very beginning, a check is performed to make sure that style macros exist. This must be done before the highlighted content is generated, so that temp file names can be shared without accidental overwriting. Styles are generated here, rather than when a style is set, so that creating the style macros is done as late as possible in case a custom |pygmentize| is in use via |\MintedPygmentize|.
%
% \begin{macrocode}
+\ifwindows
+ \def\minted@opt@quote#1{\detokenize{"#1"}}
+\else
+ \def\minted@opt@quote#1{\detokenize{'#1'}}
+\fi
\newcommand{\minted@pygmentize}[2][\minted@outputdir\minted@jobname.pyg]{%
\minted@defstyle{\minted@get@opt{style}{default}}%
\stepcounter{minted@pygmentizecounter}%
@@ -2989,7 +3022,7 @@
\detokenize{for /f "usebackq tokens=*"}\space\@percentchar\detokenize{a in (`kpsewhich}\space\minted@codefile\detokenize{`) do}\space
\fi
\fi
- \MintedPygmentize\space -l #2
+ \MintedPygmentize\space -l \minted@opt@quote{#2}
-f latex -P commandprefix=PYG -F tokenmerge
\minted@optlistcl@g \csname minted@optlistcl@lang\minted@lang\endcsname
\minted@optlistcl@inlines
@@ -3094,7 +3127,7 @@
fvstartnum = }\the\numexpr\FancyVerbStartNum\detokenize{;
fvstopnum = }\the\numexpr\FancyVerbStopNum\detokenize{;
s = max(0, fvstartnum-1);
- e = min(s, fvstopnum if fvstopnum > 0 else len(t_opt));
+ e = max(s, fvstopnum) if fvstopnum > 0 else len(t_opt);
[f.write(textwrap.dedent(\"\".join(x))) for x in (t_opt[0:s], t_opt[s:e], t_opt[e:]) if x and t is not None];
f.close() if t is not None else os.remove(tmpfname);"}%
\ifminted@kpsewhich
@@ -3114,7 +3147,7 @@
% \begin{macro}{\minted@inputpyg}
% For increased clarity, the actual |\input| process is separated out into its own macro.
%
-% At the last possible moment, |\PYG| is |\let| to |\PYG|\meta{style} and redefined to used appropriate line breaking via |\VerbatimPygments| from \pkg{fvextra}.
+% At the last possible moment, |\PYG| is |\let| to |\PYG|\meta{style} and redefined to used appropriate line breaking via |\VerbatimPygments| from \texpkg{fvextra}.
%
% The |bgcolor| option needs to be dealt with in different ways depending on whether we are using |\mintinline|. It is simplest to apply this option here, so that the macro redefinitions may be local and thus do not need to be manually reset later.
% \begin{macrocode}
@@ -3223,7 +3256,7 @@
%
%
% \begin{macro}{\minted@defwhitespace@retok}
-% The |\mint| and |\mintinline| commands need to be able to retokenize the code they collect, particularly in |draft| mode. Retokenizeation involves expansion combined with |\scantokens|, with active space and tab characters. The active characters need to expand to the appropriate \pkg{fancyvrb} macros, but the macros themselves should not be expanded. We need a macro that will accomplish the appropriate definitions.
+% The |\mint| and |\mintinline| commands need to be able to retokenize the code they collect, particularly in |draft| mode. Retokenizeation involves expansion combined with |\scantokens|, with active space and tab characters. The active characters need to expand to the appropriate \texpkg{fancyvrb} macros, but the macros themselves should not be expanded. We need a macro that will accomplish the appropriate definitions.
% \begin{macrocode}
\begingroup
\catcode`\ =\active
@@ -3246,69 +3279,46 @@
%
%
% \begin{macro}{\mintinline}
-% Define an inline command. This requires some catcode acrobatics. The typical verbatim methods are not used. Rather, a different approach is taken that is generally more robust when used within other commands (for example, when used in footnotes).
+% Define an inline command. This is modeled after the reimplemented |\Verb| from \texpkg{fvextra}. See the \texpkg{fvextra} documentation for details about expansion handling, argument reading, and (re)tokenization.
%
-% Pygments saves code wrapped in a |Verbatim| environment. Getting the inline command to work correctly require redefining |Verbatim| to be |BVerbatim| temporarily. This approach would break if |BVerbatim| were ever redefined elsewhere.
+% Pygments emits code wrapped in a |Verbatim| environment. Getting the inline command to work correctly requires redefining |Verbatim| to be \texpkg{fvextra}'s |VerbEnv| temporarily.
%
% Everything needs to be within a |\begingroup...\endgroup| to prevent settings from escaping.
%
-% In the case of |draft| mode, the code is captured and retokenized. Then the internals of \pkg{fancyvrb} are used to emulate |SaveVerbatim|, so that |\BUseVerbatim| may be employed.
-%
-% The |FancyVerbLine| counter is altered somehow within |\minted@pygmentize|, so we protect against this.
+% In the case of |draft| mode, \texpkg{fvextra}'s |\Verb| is used directly.
% \begin{macrocode}
-\newrobustcmd{\mintinline}[2][]{%
+\def\mintinline{%
+ \FVExtraRobustCommand\RobustMintInline\FVExtraUnexpandedReadStarOArgMArgBVArg}
+\FVExtrapdfstringdefDisableCommands{%
+ \def\RobustMintInline{}}
+\newrobustcmd{\RobustMintInline}[2][]{%
+ \ifbool{FVExtraRobustCommandExpanded}%
+ {\@ifnextchar\bgroup
+ {\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}%
+ {\PackageError{minted}%
+ {Inline delimiters must be paired curly braces in this context}%
+ {Use curly braces as delimiters}}}%
+ {\FVExtraReadVArg{\RobustMintInlineProcess{#1}{#2}}}}
+\def\RobustMintInlineProcess#1#2#3{%
\begingroup
\setboolean{minted@isinline}{true}%
\minted@configlang{#2}%
\setkeys{minted@opt@cmd}{#1}%
\minted@fvset
- \begingroup
- \let\do\@makeother\dospecials
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\^^I=\active
- \@ifnextchar\bgroup
- {\minted@inline@iii}%
- {\catcode`\{=12\catcode`\}=12
- \minted@inline@i}}
-\def\minted@inline@i#1{%
- \endgroup
- \def\minted@inline@ii##1#1{%
- \minted@inline@iii{##1}}%
- \begingroup
- \let\do\@makeother\dospecials
- \catcode`\^^I=\active
- \minted@inline@ii}
+ \RobustMintInlineProcess@i{#3}}
\ifthenelse{\boolean{minted@draft}}%
- {\newcommand{\minted@inline@iii}[1]{%
- \endgroup
- \begingroup
- \minted@defwhitespace@retok
- \everyeof{\noexpand}%
- \endlinechar-1\relax
- \let\do\@makeother\dospecials
- \catcode`\ =\active
- \catcode`\^^I=\active
- \xdef\minted@tmp{\scantokens{#1}}%
- \endgroup
- \let\FV@Line\minted@tmp
- \def\FV@SV@minted@tmp{%
- \FV@Gobble
- \expandafter\FV@ProcessLine\expandafter{\FV@Line}}%
- \ifthenelse{\equal{\minted@get@opt{breaklines}{false}}{true}}%
- {\let\FV@BeginVBox\relax
- \let\FV@EndVBox\relax
- \def\FV@BProcessLine##1{\FancyVerbFormatLine{##1}}%
- \BUseVerbatim{minted@tmp}}%
- {\BUseVerbatim{minted@tmp}}%
+ {\def\RobustMintInlineProcess@i#1{%
+ \fvset{extra=true}%
+ \Verb{#1}%
\endgroup}}%
- {\newcommand{\minted@inline@iii}[1]{%
- \endgroup
+ {\def\RobustMintInlineProcess@i#1{%
+ \FVExtraDetokenizeVArg{%
+ \FVExtraRetokenizeVArg{\RobustMintInlineProcess@ii}{\FV@CatCodes}}{#1}}
+ \def\RobustMintInlineProcess@ii#1{%
\minted@writecmdcode{#1}%
- \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}%
- \setcounter{minted@FancyVerbLineTemp}{\value{FancyVerbLine}}%
- \minted@pygmentize{\minted@lang}%
- \setcounter{FancyVerbLine}{\value{minted@FancyVerbLineTemp}}%
+ \let\Verbatim\VerbEnv
+ \let\endVerbatim\endVerbEnv
+ \expandafter\minted@pygmentize\expandafter{\minted@lang}%
\endgroup}}
% \end{macrocode}
% \end{macro}
@@ -3316,60 +3326,57 @@
%
% \begin{macro}{\mint}
%
-% Highlight a small piece of verbatim code (a single line).
-%
-% The |draft| version digs into a good deal of \pkg{fancyvrb} internals. We want to employ |\UseVerbatim|, and this requires assembling a macro equivalent to what |SaveVerbatim| would have created. Actually, this is superior to what |SaveVerbatim| would yield, because line numbering is handled correctly.
+% Highlight a single line of code. This is essentially a shortcut for the \env{minted} environment when there is only a single line of code. The implementation follows \cmd{\mintinline} for argument reading and processing, but then typesets the code as an environment rather than command. The \cmd{\@doendpe} ensures proper paragraph indentation for following text (immediately following text with no intervening blank lines does not begin a new paragraph).
% \begin{macrocode}
-\newrobustcmd{\mint}[2][]{%
+\def\mint{%
+ \FVExtraRobustCommand\RobustMint\FVExtraUnexpandedReadStarOArgMArgBVArg}
+\FVExtrapdfstringdefDisableCommands{%
+ \def\RobustMint{}}
+\newrobustcmd{\RobustMint}[2][]{%
+ \ifbool{FVExtraRobustCommandExpanded}%
+ {\@ifnextchar\bgroup
+ {\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}%
+ {\PackageError{minted}%
+ {Delimiters must be paired curly braces in this context}%
+ {Use curly braces as delimiters}}}%
+ {\FVExtraReadVArg{\RobustMintProcess{#1}{#2}}}}
+\def\RobustMintProcess#1#2#3{%
\begingroup
\minted@configlang{#2}%
\setkeys{minted@opt@cmd}{#1}%
\minted@fvset
- \begingroup
- \let\do\@makeother\dospecials
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\^^I=\active
- \@ifnextchar\bgroup
- {\mint@iii}%
- {\catcode`\{=12\catcode`\}=12
- \mint@i}}
-\def\mint@i#1{%
- \endgroup
- \def\mint@ii##1#1{%
- \mint@iii{##1}}%
- \begingroup
- \let\do\@makeother\dospecials
- \catcode`\^^I=\active
- \mint@ii}
-\ifthenelse{\boolean{minted@draft}}%
- {\newcommand{\mint@iii}[1]{%
- \endgroup
- \begingroup
- \minted@defwhitespace@retok
- \everyeof{\noexpand}%
- \endlinechar-1\relax
- \let\do\@makeother\dospecials
- \catcode`\ =\active
- \catcode`\^^I=\active
- \xdef\minted@tmp{\scantokens{#1}}%
- \endgroup
- \let\FV@Line\minted@tmp
- \def\FV@SV@minted@tmp{%
- \FV@CodeLineNo=1\FV@StepLineNo
- \FV@Gobble
- \expandafter\FV@ProcessLine\expandafter{\FV@Line}}%
- \minted@langlinenoson
- \UseVerbatim{minted@tmp}%
- \minted@langlinenosoff
- \endgroup}}%
- {\newcommand{\mint@iii}[1]{%
- \endgroup
- \minted@writecmdcode{#1}%
- \minted@langlinenoson
- \minted@pygmentize{\minted@lang}%
- \minted@langlinenosoff
- \endgroup}}
+ \RobustMintProcess@i{#3}}
+\begingroup
+\catcode`\^^M=\active%
+\catcode`\<=1%
+\catcode`\>=2%
+\catcode`\{=12%
+\catcode`\}=12%
+\catcode`\!=0%
+\catcode`\\=12%
+!ifthenelse<!boolean<minted@draft>>%
+ <!gdef!RobustMintProcess@i#1<%
+ !FVExtraDetokenizeVArg<%
+ !FVExtraRetokenizeVArg<!RobustMintProcess@ii><!FV@CatCodes>><#1>>%
+ !gdef!RobustMintProcess@ii#1<%
+ !minted@langlinenoson%
+ !scantokens<%
+ \begin{Verbatim}
+ #1
+ \end{Verbatim}
+ !noexpand>%
+ !minted@langlinenosoff%
+ !endgroup!@doendpe>>%
+ <!gdef!RobustMintProcess@i#1<%
+ !FVExtraDetokenizeVArg<%
+ !FVExtraRetokenizeVArg<!RobustMintProcess@ii><!FV@CatCodes>><#1>>%
+ !gdef!RobustMintProcess@ii#1<%
+ !minted@writecmdcode<#1>%
+ !minted@langlinenoson%
+ !expandafter!minted@pygmentize!expandafter<!minted@lang>%
+ !minted@langlinenosoff%
+ !endgroup!@doendpe>>%
+!endgroup
% \end{macrocode}
% \end{macro}
%
@@ -3398,7 +3405,7 @@
\begin{VerbatimOut}[codes={\catcode`\^^I=12},firstline,lastline]{\minted@jobname.pyg}}%
{\end{VerbatimOut}%
\minted@langlinenoson
- \minted@pygmentize{\minted@lang}%
+ \expandafter\minted@pygmentize\expandafter{\minted@lang}%
\minted@langlinenosoff}}
% \end{macrocode}
% \end{environment}
@@ -3469,19 +3476,31 @@
%
% Define a new language-specific alias for the |\mint| short form.
% \begin{macrocode}
-\newcommand{\newmint}[3][]{
-% \end{macrocode}
-% Same as with |\newminted|, look whether an explicit name is provided.
-% If not, take the language name as command name.
-% \begin{macrocode}
- \ifthenelse{\equal{#1}{}}
- {\def\minted@shortname{#2}}
- {\def\minted@shortname{#1}}
-% \end{macrocode}
-% And define the macro.
-% \begin{macrocode}
- \expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
- \mint[#3,##1]{#2}##2}}
+\newcommand{\newmint}[3][]{%
+ \if\relax\detokenize{#1}\relax
+ \def\minted@shortname{#2}%
+ \else
+ \def\minted@shortname{#1}%
+ \fi
+ \expandafter\newmint@i\expandafter{\minted@shortname}{#2}{#3}}
+\def\newmint@i#1#2#3{%
+ \expandafter\newcommand\csname#1\endcsname{%
+ \expandafter\FVExtraRobustCommand\csname RobustNewMint#1\endcsname
+ \FVExtraUnexpandedReadStarOArgBVArg}%
+ \FVExtrapdfstringdefDisableCommands{%
+ \expandafter\def\csname RobustNewMint#1\endcsname{}}%
+ \expandafter\newrobustcmd\csname RobustNewMint#1\endcsname{%
+ \FVExtraReadOArgBeforeVArg{\csname RobustNewMint#1@i\endcsname}}%
+ \expandafter\def\csname RobustNewMint#1@i\endcsname##1{%
+ \ifbool{FVExtraRobustCommandExpanded}%
+ {\@ifnextchar\bgroup
+ {\FVExtraReadVArg{\csname RobustNewMint#1@ii\endcsname{##1}}}%
+ {\PackageError{minted}%
+ {Delimiters must be paired curly braces in this context}%
+ {Use curly braces as delimiters}}}%
+ {\FVExtraReadVArg{\csname RobustNewMint#1@ii\endcsname{##1}}}}
+ \expandafter\def\csname RobustNewMint#1@ii\endcsname##1##2{%
+ \RobustMintProcess{#3,##1}{#2}{##2}}}
% \end{macrocode}
% \end{macro}
%
@@ -3510,22 +3529,32 @@
%
% \begin{macro}{\newmintinline}
% Define an alias for |\mintinline|.
-%
-% As is usual with inline commands, a little catcode trickery must be employed.
% \begin{macrocode}
\newcommand{\newmintinline}[3][]{%
- \ifthenelse{\equal{#1}{}}%
- {\def\minted@shortname{#2inline}}%
- {\def\minted@shortname{#1}}%
- \expandafter\newrobustcmd\csname\minted@shortname\endcsname{%
- \begingroup
- \let\do\@makeother\dospecials
- \catcode`\{=1
- \catcode`\}=2
- \@ifnextchar[{\endgroup\minted@inliner[#3][#2]}%
- {\endgroup\minted@inliner[#3][#2][]}}%
- \def\minted@inliner[##1][##2][##3]{\mintinline[##1,##3]{##2}}%
-}
+ \if\relax\detokenize{#1}\relax
+ \def\minted@shortname{#2inline}%
+ \else
+ \def\minted@shortname{#1}%
+ \fi
+ \expandafter\newmintinline@i\expandafter{\minted@shortname}{#2}{#3}}
+\def\newmintinline@i#1#2#3{%
+ \expandafter\newcommand\csname#1\endcsname{%
+ \expandafter\FVExtraRobustCommand\csname RobustNewMintInline#1\endcsname
+ \FVExtraUnexpandedReadStarOArgBVArg}%
+ \FVExtrapdfstringdefDisableCommands{%
+ \expandafter\def\csname RobustNewMintInline#1\endcsname{}}%
+ \expandafter\newrobustcmd\csname RobustNewMintInline#1\endcsname{%
+ \FVExtraReadOArgBeforeVArg{\csname RobustNewMintInline#1@i\endcsname}}%
+ \expandafter\def\csname RobustNewMintInline#1@i\endcsname##1{%
+ \ifbool{FVExtraRobustCommandExpanded}%
+ {\@ifnextchar\bgroup
+ {\FVExtraReadVArg{\csname RobustNewMintInline#1@ii\endcsname{##1}}}%
+ {\PackageError{minted}%
+ {Inline delimiters must be paired curly braces in this context}%
+ {Use curly braces as delimiters}}}%
+ {\FVExtraReadVArg{\csname RobustNewMintInline#1@ii\endcsname{##1}}}}
+ \expandafter\def\csname RobustNewMintInline#1@ii\endcsname##1##2{%
+ \RobustMintInlineProcess{#3,##1}{#2}{##2}}}
% \end{macrocode}
% \end{macro}
%
@@ -3549,7 +3578,7 @@
% \end{macrocode}
% \end{environment}
%
-% The following macros only apply when |listing| is created with the \pkg{float} package. When |listing| is created with \pkg{newfloat}, its properties should be modified using \pkg{newfloat}'s |\SetupFloatingEnvironment|.
+% The following macros only apply when |listing| is created with the \texpkg{float} package. When |listing| is created with \texpkg{newfloat}, its properties should be modified using \texpkg{newfloat}'s |\SetupFloatingEnvironment|.
% \begin{macrocode}
\ifminted@newfloat\else
% \end{macrocode}
@@ -3582,7 +3611,7 @@
% \begin{macro}{\listoflistings}
%
% Used to produce a list of listings (like |\listoffigures| etc.).
-% This may well clash with other packages (for example, \pkg{listings}) but we choose to ignore this
+% This may well clash with other packages (for example, \texpkg{listings}) but we choose to ignore this
% since these two packages shouldn't be used together in the first place.
%
% \begin{macrocode}
@@ -3590,7 +3619,7 @@
% \end{macrocode}
% \end{macro}
%
-% Again, the preceding macros only apply when \pkg{float} is used to create listings, so we need to end the conditional.
+% Again, the preceding macros only apply when \texpkg{float} is used to create listings, so we need to end the conditional.
% \begin{macrocode}
\fi
% \end{macrocode}
@@ -3667,13 +3696,13 @@
%<*packageone>
% \fi
%
-% \pkg{minted} version 2 is designed to be completely compatible with version 1.7. All of the same options and commands still exist. As far as most users are concerned, the only difference should be the new commands and options.
+% \texpkg{minted} version 2 is designed to be completely compatible with version 1.7. All of the same options and commands still exist. As far as most users are concerned, the only difference should be the new commands and options.
%
-% However, \pkg{minted} 2 does require some additional packages compared to \pkg{minted} 1.7. More importantly, since \pkg{minted} 2 has almost completely new internal code, user code that accessed the internals of 1.7 will generally not work with 2.0, at least not without some modification. For these reasons, a copy of \pkg{minted} 1.7 is supplied as the package \pkg{minted1}. This is intended \emph{only} for compatibility cases when using the current version is too inconvenient.
+% However, \texpkg{minted} 2 does require some additional packages compared to \texpkg{minted} 1.7. More importantly, since \texpkg{minted} 2 has almost completely new internal code, user code that accessed the internals of 1.7 will generally not work with 2.0, at least not without some modification. For these reasons, a copy of \texpkg{minted} 1.7 is supplied as the package \texpkg{minted1}. This is intended \emph{only} for compatibility cases when using the current version is too inconvenient.
%
-% The code in \pkg{minted1} is an exact copy of \pkg{minted} version 1.7, except for two things: (1) the package has been renamed, and (2) code has been added that allows \pkg{minted1} to act as (impersonate) \pkg{minted}, so that it can cooperate with other packages that require \pkg{minted} to be loaded.\footnote{The approach used for doing this is described at \url{http://tex.stackexchange.com/a/39418/10742}.} When \pkg{minted1} is used, it must be loaded \emph{before} any other packages that would require \pkg{minted}.
+% The code in \texpkg{minted1} is an exact copy of \texpkg{minted} version 1.7, except for two things: (1) the package has been renamed, and (2) code has been added that allows \texpkg{minted1} to act as (impersonate) \texpkg{minted}, so that it can cooperate with other packages that require \texpkg{minted} to be loaded.\footnote{The approach used for doing this is described at \url{http://tex.stackexchange.com/a/39418/10742}.} When \texpkg{minted1} is used, it must be loaded \emph{before} any other packages that would require \texpkg{minted}.
%
-% All modifications to the original \pkg{minted} 1.7 source are indicated with comments. All original code that has been replaced has been commented out rather than deleted. Any future modifications of \pkg{minted1} should \emph{only} be for the purpose of allowing it to serve better as a drop-in compatibility substitute for the current release of \pkg{minted}.
+% All modifications to the original \texpkg{minted} 1.7 source are indicated with comments. All original code that has been replaced has been commented out rather than deleted. Any future modifications of \texpkg{minted1} should \emph{only} be for the purpose of allowing it to serve better as a drop-in compatibility substitute for the current release of \texpkg{minted}.
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
diff --git a/macros/latex/contrib/minted/minted.ins b/macros/latex/contrib/minted/minted.ins
index af12d42e4a..2b5da824ca 100644
--- a/macros/latex/contrib/minted/minted.ins
+++ b/macros/latex/contrib/minted/minted.ins
@@ -3,7 +3,7 @@
\askforoverwritefalse
\preamble
-Copyright 2013--2021 Geoffrey M. Poore
+Copyright 2013--2022 Geoffrey M. Poore
Copyright 2010--2011 Konrad Rudolph
This work may be distributed and/or modified under the
diff --git a/macros/latex/contrib/minted/minted.pdf b/macros/latex/contrib/minted/minted.pdf
index a66953bc0e..bfbe68653a 100644
--- a/macros/latex/contrib/minted/minted.pdf
+++ b/macros/latex/contrib/minted/minted.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index db0eac769e..4c02bff4e4 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index f36475a7a5..71f6ee632c 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -17,8 +17,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{6.13d}
-\def\myfiledate{2022/11/20}
+\def\myfileversion{6.13e}
+\def\myfiledate{2022/12/12}
%
%
%<*batchfile>
@@ -6006,16 +6006,20 @@ version 2005/12/01 or later.
\@ifpackageloaded { mdwtab }
{ \@@_fatal:n { mdwtab~loaded } }
{
- \bool_if:NF \c_@@_no_test_for_array_bool
+ \@ifpackageloaded { fontspec }
+ { }
{
- \group_begin:
- \hbox_set:Nn \l_tmpa_box
- {
- \begin { tabular } { c > { \@@_security_test:n } c c }
- text & & text
- \end { tabular }
- }
- \group_end:
+ \bool_if:NF \c_@@_no_test_for_array_bool
+ {
+ \group_begin:
+ \hbox_set:Nn \l_tmpa_box
+ {
+ \begin { tabular } { c > { \@@_security_test:n } c c }
+ text & & text
+ \end { tabular }
+ }
+ \group_end:
+ }
}
}
}
@@ -7217,6 +7221,7 @@ version 2005/12/01 or later.
% \bigskip
% \textbf{Some utilities}
%
+% \medskip
% \begin{macrocode}
\cs_set_protected:Npn \@@_cut_on_hyphen:w #1-#2\q_stop
{
@@ -17321,7 +17326,11 @@ version 2005/12/01 or later.
{
\tl_if_blank:nTF { #2 }
{ \@@_Block_i 1-1 \q_stop }
- { \@@_Block_i #2 \q_stop }
+ {
+ \int_compare:nNnTF { \char_value_catcode:n { 45 } } = { 13 }
+ \@@_Block_i_czech \@@_Block_i
+ #2 \q_stop
+ }
{ #1 } { #3 } { #4 }
}
}
@@ -17334,6 +17343,17 @@ version 2005/12/01 or later.
\cs_new:Npn \@@_Block_i #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } }
% \end{macrocode}
%
+% With \pkg{babel} with the key |czech|, the character |-| (hyphen) is active.
+% That's why we need a special version. Remark that we could not use a
+% preprocessor in the command |\@@_Block:| to do the job because the command
+% |\@@_Block:| is defined with the command |\NewExpandableDocumentCommand|.
+% \begin{macrocode}
+{
+ \char_set_catcode_active:N -
+ \cs_new:Npn \@@_Block_i_czech #1-#2 \q_stop { \@@_Block_ii:nnnnn { #1 } { #2 } }
+}
+% \end{macrocode}
+%
% \medskip
% Now, the arguments have been extracted: |#1| is $i$ (the number of rows of the
% block), |#2| is $j$ (the number of columns of the block), |#3| is the list of
@@ -21308,340 +21328,244 @@ version 2005/12/01 or later.
% }
%
%
-% \subsection*{Changes between versions 1.0 and 1.1}
-%
-% The dotted lines are no longer drawn with Tikz nodes but with Tikz circles
-% (for efficiency).
-%
-% Modification of the code which is now twice faster.
-%
-% \subsection*{Changes between versions 1.1 and 1.2}
+% \subsection*{Changes between version 6.12 and 6.13}
%
-% New environment |{NiceArray}| with column types |L|, |C| and |R|.
+% New environment |{TabularNote}| in |{NiceTabular}| with the same semantic as
+% the key |tabularnote| (for legibility).
%
-% \subsection*{Changes between version 1.2 and 1.3}
+% The command |\Hline| nows accepts options (between square brackets).
%
-% New environment |{pNiceArrayC}| and its variants.
+% \subsection*{Changes between version 6.11 and 6.12}
%
-% Correction of a bug in the definition of |{BNiceMatrix}|, |{vNiceMatrix}| and
-% |{VNiceMatrix}| (in fact, it was a typo).
+% New keys |caption|, |short-caption| and |label| in the environment
+% |{NiceTabular}|.
%
-% Options are now available locally in |{pNiceMatrix}| and its variants.
+% In |{NiceTabular}|, a caption specified by the key |caption| is wrapped to the
+% width of the tabular.
%
-% The names of the options are changed. The old names were names in ``camel
-% style''.
+% Correction of a bug: it's now possible to use |\OverBrace| and |\UnderBrace|
+% with \pkg{unicode-math} (with XeLaTeX or LuaLaTeX).
%
-% \subsection*{Changes between version 1.3 and 1.4}
-%
-% The column types |w| and |W| can now be used in the environments
-% |{NiceArray}|, |{pNiceArrayC}| and its variants with the same meaning as in
-% the package \pkg{array}.
-%
-% New option |columns-width| to fix the same width for all the columns of the
-% array.
-%
+% \subsection*{Changes between version 6.10 and 6.11}
%
-% \subsection*{Changes between version 1.4 and 2.0}
-%
-% The versions 1.0 to 1.4 of \pkg{nicematrix} were focused on the continuous
-% dotted lines whereas the version 2.0 of \pkg{nicematrix} provides different
-% features to improve the typesetting of mathematical matrices.
+% New key |matrix/columns-type| to specify the type of columns of the matrices.
%
-% \subsection*{Changes between version 2.0 and 2.1}
+% New key |ccommand| in |custom-line| and new command |\cdottedline|.
%
-% New implementation of the environment |{pNiceArrayRC}|. With this new
-% implementation, there is no restriction on the width of the columns.
+% \subsection*{Changes between version 6.9 and 6.10}
%
-% The package \pkg{nicematrix} no longer loads \pkg{mathtools} but only
-% \pkg{amsmath}.
+% New keys |xdots/shorten-start| and |xdots/shorten-end|.
%
-% Creation of ``medium nodes'' and ``large nodes''.
+% It's possible to use |\line| in the |\CodeAfter| between two blocks (and not
+% only two cells).
%
-% \subsection*{Changes between version 2.1 and 2.1.1}
+% \subsection*{Changes between version 6.8 and 6.9}
%
-% Small corrections: for example, the option |code-for-first-row| is now
-% available in the command |\NiceMatrixOptions|.
+% New keys |xdots/radius| and |xdots/inter| for customisation of the continuous
+% dotted lines.
%
-% Following a discussion on
-% TeX StackExchange\footnote{cf.
-% |tex.stackexchange.com/questions/450841/tikz-externalize-and-nicematrix-package|},
-% Tikz externalization is now deactivated in the environments of the
-% package \pkg{nicematrix}.\footnote{Before this version, there was an error
-% when using \pkg{nicematrix} with Tikz externalization. In any case, it's not
-% possible to externalize the Tikz elements constructed by \pkg{nicematrix}
-% because they use the options |overlay| and |remember picture|.}
-%
+% New command |\ShowCellNames| available in the |\CodeBefore| and in the |\CodeAfter|.
%
-% \subsection*{Changes between version 2.1.2 and 2.1.3}
+% \subsection*{Changes between version 6.7 and 6.8}
%
-% When searching the end of a dotted line from a command like |\Cdots| issued in
-% the ``main matrix'' (not in the exterior column), the cells in the exterior
-% column are considered as outside the matrix. That means that it's possible to
-% do the following matrix with only a |\Cdots| command (and a single |\Vdots|).
-% \[\begin{pNiceArray}{Wc{5mm}cWc{5mm}}[first-row,last-col]
-% & C_j & \\
-% \mbox{\Large $0$} & \Vdots & \mbox{\Large $0$} \\
-% \strut & a & \Cdots & L_i \\
-% \mbox{\Large $0$} & & \mbox{\Large $0$} \\
-% \end{pNiceArray}\]
+% In the notes of a tabular (with the command |\tabularnote|), the duplicates
+% are now detected: when several commands |\tabularnote| are used with the same
+% argument, only one note is created at the end of the tabular (but all the
+% labels are present, of course).
%
-% \subsection*{Changes between version 2.1.3 and 2.1.4}
+% \subsection*{Changes between version 6.6 and 6.7}
%
-% Replacement of some options |O { }| in commands and environments defined with
-% \pkg{xparse} by |! O { }| (because a recent version of \pkg{xparse} introduced
-% the specifier |!| and modified the default behaviour of the last optional
-% arguments).
+% Key |color| for |\OverBrace| and |\UnderBrace| in the |\CodeAfter|
%
-% See |www.texdev.net/2018/04/21/xparse-optional-arguments-at-the-end|
+% Key |tikz| in the key |borders| of a command |\Block|
%
-% \subsection*{Changes between version 2.1.4 and 2.1.5}
+% \subsection*{Changes between version 6.5 and 6.6}
%
-% Compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}.
-%
-% Option |allow-duplicate-names|.
+% Keys |tikz| and |width| in |custom-line|.
%
-% \subsection*{Changes between version 2.1.5 and 2.2}
+% \subsection*{Changes between versions 6.4 and 6.5}
%
-% Possibility to draw horizontal dotted lines to separate rows with the command
-% |\hdottedline| (similar to the classical command |\hline| and the command
-% |\hdashline| of \pkg{arydshln}).
+% Key |custom-line| in |\NiceMatrixOptions|.
%
-% Possibility to draw vertical dotted lines to separate columns with the
-% specifier ``|:|'' in the preamble (similar to the classical specifier
-% ``"|"'' and the specifier ``|:|'' of \pkg{arydshln}).
+% Key |respect-arraystretch|.
%
-% \subsection*{Changes between version 2.2 and 2.2.1}
+% \subsection*{Changes between versions 6.3 and 6.4}
%
-% Improvment of the vertical dotted lines drawn by the specifier ``:'' in the
-% preamble.
+% New commands |\UnderBrace| and |\OverBrace| in the |\CodeAfter|.
%
-% Modification of the position of the dotted lines drawn by |\hdottedline|.
+% Correction of a bug of the key |baseline| (cf. question 623258 on TeX StackExchange).
%
-% \subsection*{Changes between version 2.2.1 and 2.3}
+% Correction of a bug with the columns |V| of \pkg{varwidth}.
%
-% Compatibility with the column type |S| of \pkg{siunitx}.
-%
-% Option |hlines|.
-%
+% Correction of a bug: the use of |\hdottedline| and |:| in the preamble of the
+% array (of another letter specified by |letter-for-dotted-lines|) was
+% incompatible with the key |xdots/line-style|.
%
-% \subsection*{Changes between version 2.3 and 3.0}
+% \subsection*{Changes between versions 6.2 and 6.3}
%
-% Modification of |\Hdotsfor|. Now |\Hdotsfor| erases the |\vlines| (of ``"|"'')
-% as |\hdotsfor| does.
+% Keys |nb-rows|, |rowcolor| and |bold| for the command |\RowStyle|
%
-% Composition of exterior rows and columns on the four sides of the matrix (and
-% not only on two sides) with the options |first-row|, |last-row|, |first-col|
-% and |last-col|.
+% Key |name| for the command |\Block|.
%
-% \subsection*{Changes between version 3.0 and 3.1}
+% Support for the columns |V| of \pkg{varwidth}.
%
-% Command |\Block| to draw block matrices.
+% \subsection*{Changes between versions 6.1 and 6.2}
%
-% Error message when the user gives an incorrect value for |last-row|.
+% Better compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}.
%
-% A dotted line can no longer cross another dotted line (excepted the dotted
-% lines drawn by |\cdottedline|, the symbol ``|:|'' (in the preamble of the
-% array) and |\line| in |code-after|).
+% Key |vlines-in-sub-matrix|.
%
-% The starred versions of |\Cdots|, |\Ldots|, etc. are now deprecated because,
-% with the new implementation, they become pointless. These starred versions
-% are no longer documented.
+% \subsection*{Changes between versions 6.0 and 6.1}
+%
+% Better computation of the widths of the |X| columns.
%
-% The vertical rules in the matrices (drawn by ``"|"'') are now compatible with
-% the color fixed by \pkg{colortbl}.
+% Key |\color| for the command |\RowStyle|.
%
-% Correction of a bug: it was not possible to use the colon ``|:|'' in the
-% preamble of an array when |pdflatex| was used with \pkg{french-babel} (because
-% \pkg{french-babel} activates the colon in the beginning of the document).
+% \subsection*{Changes between versions 5.19 and 6.0}
%
+% Columns |X| and environment |{NiceTabularX}|.
%
-% \subsection*{Changes between version 3.1 and 3.2 (and 3.2a)}
+% Command |\rowlistcolors| available in the |\CodeBefore|.
%
-% Option |small|.
+% In columns with fixed width, the blocks are composed as paragraphs (wrapping
+% of the lines).
+%
+% The key |define-L-C-R| has been deleted.
%
-% \subsection*{Changes between version 3.2 and 3.3}
+% \subsection*{Changes between versions 5.18 and 5.19}
+%
+% New key |tikz| for the command |\Block|.
%
-% The options |first-row|, |last-row|, |first-col| and |last-col| are now
-% available in the environments |{NiceMatrix}|, |{pNiceMatrix}|,
-% |{bNiceMatrix}|, etc.
+% \subsection*{Changes between versions 5.17 and 5.18}
+%
+% New command |\RowStyle|
%
-% The option |columns-width=auto| doesn't need any more a second compilation.
+% \subsection*{Changes between versions 5.16 and 5.17}
%
-% The previous version of \pkg{nicematrix} was incompatible with a recent
-% version of \pkg{expl3} (released 2019/09/30). This version is compatible.
+% The key |define-L-C-R| (only available at load-time) now raises a (non fatal)
+% error.
%
+% Keys |L|, |C| and |R| for the command |\Block|.
+%
+% Key |hvlines-except-borders|.
%
-% \subsection*{Changes between version 3.3 and 3.4}
+% It's now possible to use a key |l|, |r| or |c| with the command
+% |\pAutoNiceMatrix| (and the similar ones).
%
-% Following a discussion on TeX StackExchange\footnote{cf.
-% |tex.stackexchange.com/questions/510841/nicematrix-and-tikz-external-optimize|},
-% optimization of Tikz externalization is disabled in the environments of
-% \pkg{nicematrix} when the class \cls{standalone} or the package
-% \pkg{standalone} is used.
-%
-% \subsection*{Changes between version 3.4 and 3.5}
+% \subsection*{Changes between versions 5.15 and 5.16}
%
-% Correction on a bug on the two previous versions where the |code-after| was
-% not executed.
-%
-% \subsection*{Changes between version 3.5 and 3.6}
+% It's now possible to use the cells corresponding to the contents of the nodes
+% (of the form |i-j|) in the |\CodeBefore| when the key |create-cell-nodes| of
+% that |\CodeBefore| is used. The medium and the large nodes are also available
+% if the corresponding keys are used.
%
-% LaTeX counters |iRow| and |jCol| available in the cells of the array.
-%
-% Addition of |\normalbaselines| before the construction of the array: in
-% environments like |{align}| of \pkg{amsmath} the value of |\baselineskip| is
-% changed and if the options |first-row| and |last-row| were used in an
-% environment of \pkg{nicematrix}, the position of the delimiters was wrong.
-%
-% A warning is written in the |.log| file if an obsolete environment is used.
+% \subsection*{Changes between versions 5.14 and 5.15}
%
-% There is no longer artificial errors |Duplicate~name| in the environments of
-% \pkg{amsmath}.
+% Key |hvlines| for the command |\Block|.
%
-% \subsection*{Changes between version 3.6 and 3.7}
+% The commands provided by \pkg{nicematrix} to color cells, rows and columns
+% don't color the cells which are in the ``corners'' (when the key |corner| is
+% used).
+%
+% It's now possible to specify delimiters for submatrices in the preamble of an
+% environment.
%
-% The four ``corners'' of the matrix are correctly protected against the four
-% codes: |code-for-first-col|, |code-for-last-col|, |code-for-first-row| and
-% |code-for-last-row|.
+% The version 5.15b is compatible with the version 3.0+ of \pkg{siunitx}
+% (previous versions were not).
%
-% New command |\pAutoNiceMatrix| and its variants (suggestion of Christophe
-% Bal).
+% \subsection*{Changes between versions 5.13 and 5.14}
%
-% \subsection*{Changes between version 3.7 and 3.8}
+% Nodes of the form |(1.5)|, |(2.5)|, |(3.5)|, etc.
+%
+% Keys |t| and |b| for the command |\Block|.
%
-% New programmation for the command |\Block| when the block has only one row.
-% With this programmation, the vertical rules drawn by the specifier
-% ``\verb+|+'' at the end of the block is actually drawn. In previous versions,
-% they were not because the block of one row was constructed with
-% |\multicolumn|.
+% Key |corners|.
%
-% An error is raised when an obsolete environment is used.
+% \subsection*{Changes between versions 5.12 and 5.13}
%
+% New command |\arraycolor| in the |\CodeBefore| (with its key
+% |except-corners|).
%
-% \subsection*{Changes between version 3.8 and 3.9}
-%
-% New commands |\NiceMatrixLastEnv| and |\OnlyMainNiceMatrix|.
+% New key |borders| for the command |\Block|.
%
-% New options |create-medium-nodes| and |create-large-nodes|.
+% New command |\Hline| (for horizontal rules not drawn in the blocks).
%
-% \subsection*{Changes between version 3.9 and 3.10}
+% The keys |vlines| and |hlines| takes in as value a (comma-separated) list of
+% numbers (for the rules to draw).
%
-% New option |light-syntax| (and |end-of-row|).
+% \subsection*{Changes between versions 5.11 and 5.12}
%
-% New option |dotted-lines-margin| for fine tuning of the dotted lines.
+% Keywords |\CodeBefore| and |\Body| (alternative syntax to the key
+% |code-before|).
%
-% \subsection*{Changes between versions 3.10 and 3.11}
-%
-% Correction of a bug linked to |first-row| and |last-row|.
-%
-% \subsection*{Changes between versions 3.11 and 3.12}
-%
-% Command |\rotate| in the cells of the array.
+% New key |delimiters/max-width|.
%
-% Options |vlines|, |hlines| and |hvlines|.
+% New keys |hlines|, |vlines| and |hvlines| for the command |\SubMatrix| in the
+% |\CodeAfter|.
%
-% Option |baseline| pour |{NiceArray}| (not for the other environments).
+% New key |rounded-corners| for the command |\Block|.
%
-% The name of the Tikz nodes created by the command |\Block| has changed: when
-% the command has been issued in the cell $i$|-|$j$, the name is
-% $i$|-|$j$|-block| and, if the creation of the ``medium nodes'' is required, a
-% node $i$|-|$j$|-block-medium| is created.
+% \subsection*{Changes between versions 5.10 and 5.11}
%
-% If the user tries to use more columns than allowed by its environment, an error
-% is raised by nicematrix (instead of a low-level error).
+% It's now possible, in the |code-before| and in the |\CodeAfter|, to use the
+% syntax \verb+|(i-|j)+ for the Tikz node at the intersection of the (potential)
+% horizontal rule number~$i$ and the (potential) vertical rule number~$j$.
%
-% The package must be loaded with the option |obsolete-environments| if we want
-% to use the deprecated environments.
+% \subsection*{Changes between versions 5.9 and 5.10}
+%
+% New command |\SubMatrix| available in the |\CodeAfter|.
%
-% \subsection*{Changes between versions 3.12 and 3.13}
+% It's possible to provide options (between brackets) to the keyword |\CodeAfter|.
%
-% The behaviour of the command |\rotate| is improved when used in the ``last
-% row''.
+% \subsection*{Changes between versions 5.8 and 5.9}
%
-% The option |dotted-lines-margin| has been renamed in |xdots/shorten| and the
-% options |xdots/color| and |xdots/line-style| have been added for a complete
-% customisation of the dotted lines.
+% Correction of a bug: in the previous versions, it was not possible to use the
+% key |line-style| for the continuous dotted lines when the Tikz library |babel|
+% was loaded.
+%
+% New key |cell-space-limits|.
%
-% In the environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|, etc.),
-% it's possible to use the options |l| (=|L|) or |r| (=|R|) to specify the type
-% of the columns.
+% \subsection*{Changes between versions 5.7 and 5.8}
%
-% The starred versions of the commands |\Cdots|, |\Ldots|, |\Vdots|, |\Ddots|
-% and |\Iddots| are deprecated since the version 3.1 of \pkg{nicematrix}. Now,
-% one should load \pkg{nicematrix} with the option |starred-commands| to avoid
-% an error at the compilation.
+% Keys |cols| and |restart| of the command |\rowcolors| in the |code-before|.
%
-% The code of \pkg{nicematrix} no longer uses Tikz but only \textsc{pgf}. By
-% default, Tikz is \emph{not} loaded by \pkg{nicematrix}.
+% Modification of the behaviour of |\\| in the columns of type |p|, |m| or |b|
+% (for a behaviour similar to the environments of \pkg{array}).
%
-% \subsection*{Changes between versions 3.13 and 3.14}
-%
-% Correction of a bug (question 60761504 on |stackoverflow|).
+% Better error messages for the command |\Block|.
%
-% Better error messages when the user uses |&| or |\\| when |light-syntax| is in
-% force.
-%
-% \subsection*{Changes between versions 3.14 and 3.15}
-%
-% It's possible to put labels on the dotted lines drawn by |\Ldots|, |\Cdots|,
-% |\Vdots|, |\Ddots|, |\Iddots|, |\Hdotsfor| and the command |\line| in the
-% |code-after| with the tokens |_| and |^|.
+% \subsection*{Changes between versions 5.6 and 5.7}
%
-% The option |baseline| is now available in all the environments of
-% \pkg{nicematrix}. Before, it was available only in |{NiceArray}|.
-%
-% New keyword |\CodeAfter| (in the environments of \pkg{nicematrix}).
+% New key |delimiters-color|
%
+% Keys |fill|, |draw| and |line-width| for the command |\Block|.
%
-% \subsection*{Changes between versions 3.15 and 4.0}
+% \subsection*{Changes between versions 5.5 and 5.6}
%
-% New environment |{NiceTabular}|
+% Different behaviour for the mono-row blocks.
%
-% Commands to color cells, rows and columns with a perfect result in the \textsc{pdf}.
-%
-% \subsection*{Changes between versions 4.0 and 4.1}
-%
-% New keys |cell-space-top-limit| and |cell-space-bottom-limit|
+% New command |\NotEmpty|.
%
-% New command |\diagbox|
+% \subsection*{Changes between versions 5.4 and 5.5}
%
-% The key |hvline| don't draw rules in the blocks (commands |\Block|) and in the
-% virtual blocks corresponding to the dotted lines.
-%
-% \subsection*{Changes between versions 4.1 and 4.2}
-%
-% It's now possible to write |\begin{pNiceMatrix}a&b\\c&d\end{pNiceMatrix}^2|
-% with the expected result.
-%
-% \subsection*{Changes between versions 4.2 and 4.3}
-%
-% The horizontal centering of the content of a |\Block| is correct even when an
-% instruction such as |!{\qquad}| is used in the preamble of the array.
-%
-% It's now possible to use the command |\Block| in the ``last row''.
-%
-% \subsection*{Changes between versions 4.3 and 4.4}
-%
-% New key |hvlines-except-corners| (now deprecated).
+% The user must never put |\omit| before |\CodeAfter|.
%
-% \subsection*{Changes between versions 4.4 and 5.0}
+% Correction of a bug: the tabular notes |\tabularnotes| were not composed when
+% present in a block (except a mono-column block).
%
-% Use of the standard column types |l|, |c| and |r| instead of |L|, |C| and |R|.
-%
-% It's now possible to use the command |\diagbox| in a |\Block|.
+% \subsection*{Changes between versions 5.3 and 5.4}
%
-% Command |\tabularnote|
+% Key |tabularnote|.
%
-% \subsection*{Changes between versions 5.0 and 5.1}
+% Different behaviour for the mono-column blocks.
%
-% The vertical rules specified by \verb+|+ in the preamble are not broken by
-% |\hline\hline| (and other).
-%
-% Environment |{NiceTabular*}|
+% \subsection*{Changes between versions 5.2 and 5.3}
%
-% Command |\Vdotsfor| similar to |\Hdotsfor|
+% Keys |c|, |r| and |l| for the command |\Block|.
%
-% The variable |\g_nicematrix_code_after_tl| is now public.
+% It's possible to use the key |draw-first| with |\Ddots| and |\Iddots| to
+% specify which dotted line will be drawn first (the other lines will be drawn
+% parallel to that one if parallelization is activated).
%
% \subsection*{Changes between versions 5.1 and 5.2}
%
@@ -21657,248 +21581,334 @@ version 2005/12/01 or later.
%
% The key |hvlines-except-corners| may take in as value a list of corners (eg: NW,SE).
%
-% \subsection*{Changes between versions 5.2 and 5.3}
-%
-% Keys |c|, |r| and |l| for the command |\Block|.
-%
-% It's possible to use the key |draw-first| with |\Ddots| and |\Iddots| to
-% specify which dotted line will be drawn first (the other lines will be drawn
-% parallel to that one if parallelization is activated).
-%
-% \subsection*{Changes between versions 5.3 and 5.4}
+% \subsection*{Changes between versions 5.0 and 5.1}
%
-% Key |tabularnote|.
+% The vertical rules specified by \verb+|+ in the preamble are not broken by
+% |\hline\hline| (and other).
+%
+% Environment |{NiceTabular*}|
%
-% Different behaviour for the mono-column blocks.
+% Command |\Vdotsfor| similar to |\Hdotsfor|
%
-% \subsection*{Changes between versions 5.4 and 5.5}
+% The variable |\g_nicematrix_code_after_tl| is now public.
%
-% The user must never put |\omit| before |\CodeAfter|.
+% \subsection*{Changes between versions 4.4 and 5.0}
%
-% Correction of a bug: the tabular notes |\tabularnotes| were not composed when
-% present in a block (except a mono-column block).
+% Use of the standard column types |l|, |c| and |r| instead of |L|, |C| and |R|.
+%
+% It's now possible to use the command |\diagbox| in a |\Block|.
%
-% \subsection*{Changes between versions 5.5 and 5.6}
+% Command |\tabularnote|
%
-% Different behaviour for the mono-row blocks.
+% \subsection*{Changes between versions 4.3 and 4.4}
+%
+% New key |hvlines-except-corners| (now deprecated).
%
-% New command |\NotEmpty|.
+% \subsection*{Changes between versions 4.2 and 4.3}
+%
+% The horizontal centering of the content of a |\Block| is correct even when an
+% instruction such as |!{\qquad}| is used in the preamble of the array.
+%
+% It's now possible to use the command |\Block| in the ``last row''.
%
-% \subsection*{Changes between versions 5.6 and 5.7}
+% \subsection*{Changes between versions 4.1 and 4.2}
+%
+% It's now possible to write |\begin{pNiceMatrix}a&b\\c&d\end{pNiceMatrix}^2|
+% with the expected result.
%
-% New key |delimiters-color|
+% \subsection*{Changes between versions 4.0 and 4.1}
+%
+% New keys |cell-space-top-limit| and |cell-space-bottom-limit|
%
-% Keys |fill|, |draw| and |line-width| for the command |\Block|.
-%
-% \subsection*{Changes between versions 5.7 and 5.8}
+% New command |\diagbox|
%
-% Keys |cols| and |restart| of the command |\rowcolors| in the |code-before|.
+% The key |hvline| don't draw rules in the blocks (commands |\Block|) and in the
+% virtual blocks corresponding to the dotted lines.
%
-% Modification of the behaviour of |\\| in the columns of type |p|, |m| or |b|
-% (for a behaviour similar to the environments of \pkg{array}).
+% \subsection*{Changes between versions 3.15 and 4.0}
%
-% Better error messages for the command |\Block|.
+% New environment |{NiceTabular}|
%
-% \subsection*{Changes between versions 5.8 and 5.9}
+% Commands to color cells, rows and columns with a perfect result in the \textsc{pdf}.
%
-% Correction of a bug: in the previous versions, it was not possible to use the
-% key |line-style| for the continuous dotted lines when the Tikz library |babel|
-% was loaded.
+% \subsection*{Changes between versions 3.14 and 3.15}
%
-% New key |cell-space-limits|.
+% It's possible to put labels on the dotted lines drawn by |\Ldots|, |\Cdots|,
+% |\Vdots|, |\Ddots|, |\Iddots|, |\Hdotsfor| and the command |\line| in the
+% |code-after| with the tokens |_| and |^|.
%
-% \subsection*{Changes between versions 5.9 and 5.10}
+% The option |baseline| is now available in all the environments of
+% \pkg{nicematrix}. Before, it was available only in |{NiceArray}|.
%
-% New command |\SubMatrix| available in the |\CodeAfter|.
+% New keyword |\CodeAfter| (in the environments of \pkg{nicematrix}).
%
-% It's possible to provide options (between brackets) to the keyword |\CodeAfter|.
+% \subsection*{Changes between versions 3.13 and 3.14}
%
-% \subsection*{Changes between versions 5.10 and 5.11}
+% Correction of a bug (question 60761504 on |stackoverflow|).
%
-% It's now possible, in the |code-before| and in the |\CodeAfter|, to use the
-% syntax \verb+|(i-|j)+ for the Tikz node at the intersection of the (potential)
-% horizontal rule number~$i$ and the (potential) vertical rule number~$j$.
-%
-% \subsection*{Changes between versions 5.11 and 5.12}
+% Better error messages when the user uses |&| or |\\| when |light-syntax| is in
+% force.
%
-% Keywords |\CodeBefore| and |\Body| (alternative syntax to the key
-% |code-before|).
+% \subsection*{Changes between versions 3.12 and 3.13}
%
-% New key |delimiters/max-width|.
+% The behaviour of the command |\rotate| is improved when used in the ``last
+% row''.
%
-% New keys |hlines|, |vlines| and |hvlines| for the command |\SubMatrix| in the
-% |\CodeAfter|.
+% The option |dotted-lines-margin| has been renamed in |xdots/shorten| and the
+% options |xdots/color| and |xdots/line-style| have been added for a complete
+% customisation of the dotted lines.
%
-% New key |rounded-corners| for the command |\Block|.
+% In the environments without preamble (|{NiceMatrix}|, |{pNiceMatrix}|, etc.),
+% it's possible to use the options |l| (=|L|) or |r| (=|R|) to specify the type
+% of the columns.
%
-% \subsection*{Changes between versions 5.12 and 5.13}
+% The starred versions of the commands |\Cdots|, |\Ldots|, |\Vdots|, |\Ddots|
+% and |\Iddots| are deprecated since the version 3.1 of \pkg{nicematrix}. Now,
+% one should load \pkg{nicematrix} with the option |starred-commands| to avoid
+% an error at the compilation.
+%
+% The code of \pkg{nicematrix} no longer uses Tikz but only \textsc{pgf}. By
+% default, Tikz is \emph{not} loaded by \pkg{nicematrix}.
+%
+% \subsection*{Changes between versions 3.11 and 3.12}
%
-% New command |\arraycolor| in the |\CodeBefore| (with its key
-% |except-corners|).
+% Command |\rotate| in the cells of the array.
%
-% New key |borders| for the command |\Block|.
+% Options |vlines|, |hlines| and |hvlines|.
%
-% New command |\Hline| (for horizontal rules not drawn in the blocks).
+% Option |baseline| pour |{NiceArray}| (not for the other environments).
%
-% The keys |vlines| and |hlines| takes in as value a (comma-separated) list of
-% numbers (for the rules to draw).
-%
+% The name of the Tikz nodes created by the command |\Block| has changed: when
+% the command has been issued in the cell $i$|-|$j$, the name is
+% $i$|-|$j$|-block| and, if the creation of the ``medium nodes'' is required, a
+% node $i$|-|$j$|-block-medium| is created.
%
-% \subsection*{Changes between versions 5.13 and 5.14}
+% If the user tries to use more columns than allowed by its environment, an error
+% is raised by nicematrix (instead of a low-level error).
%
-% Nodes of the form |(1.5)|, |(2.5)|, |(3.5)|, etc.
-%
-% Keys |t| and |b| for the command |\Block|.
+% The package must be loaded with the option |obsolete-environments| if we want
+% to use the deprecated environments.
%
-% Key |corners|.
+% \subsection*{Changes between versions 3.10 and 3.11}
+%
+% Correction of a bug linked to |first-row| and |last-row|.
%
-% \subsection*{Changes between versions 5.14 and 5.15}
+% \subsection*{Changes between version 3.9 and 3.10}
%
-% Key |hvlines| for the command |\Block|.
+% New option |light-syntax| (and |end-of-row|).
%
-% The commands provided by \pkg{nicematrix} to color cells, rows and columns
-% don't color the cells which are in the ``corners'' (when the key |corner| is
-% used).
+% New option |dotted-lines-margin| for fine tuning of the dotted lines.
%
-% It's now possible to specify delimiters for submatrices in the preamble of an
-% environment.
+% \subsection*{Changes between version 3.8 and 3.9}
%
-% The version 5.15b is compatible with the version 3.0+ of \pkg{siunitx}
-% (previous versions were not).
+% New commands |\NiceMatrixLastEnv| and |\OnlyMainNiceMatrix|.
%
-% \subsection*{Changes between versions 5.15 and 5.16}
+% New options |create-medium-nodes| and |create-large-nodes|.
%
-% It's now possible to use the cells corresponding to the contents of the nodes
-% (of the form |i-j|) in the |\CodeBefore| when the key |create-cell-nodes| of
-% that |\CodeBefore| is used. The medium and the large nodes are also available
-% if the corresponding keys are used.
+% \subsection*{Changes between version 3.7 and 3.8}
%
-% \subsection*{Changes between versions 5.16 and 5.17}
-%
-% The key |define-L-C-R| (only available at load-time) now raises a (non fatal)
-% error.
+% New programmation for the command |\Block| when the block has only one row.
+% With this programmation, the vertical rules drawn by the specifier
+% ``\verb+|+'' at the end of the block is actually drawn. In previous versions,
+% they were not because the block of one row was constructed with
+% |\multicolumn|.
%
-% Keys |L|, |C| and |R| for the command |\Block|.
+% An error is raised when an obsolete environment is used.
+%
+% \subsection*{Changes between version 3.6 and 3.7}
%
-% Key |hvlines-except-borders|.
+% The four ``corners'' of the matrix are correctly protected against the four
+% codes: |code-for-first-col|, |code-for-last-col|, |code-for-first-row| and
+% |code-for-last-row|.
%
-% It's now possible to use a key |l|, |r| or |c| with the command
-% |\pAutoNiceMatrix| (and the similar ones).
+% New command |\pAutoNiceMatrix| and its variants (suggestion of Christophe
+% Bal).
%
-% \subsection*{Changes between versions 5.17 and 5.18}
-%
-% New command |\RowStyle|
-%
-% \subsection*{Changes between versions 5.18 and 5.19}
-%
-% New key |tikz| for the command |\Block|.
+% \subsection*{Changes between version 3.5 and 3.6}
%
+% LaTeX counters |iRow| and |jCol| available in the cells of the array.
%
-% \subsection*{Changes between versions 5.19 and 6.0}
+% Addition of |\normalbaselines| before the construction of the array: in
+% environments like |{align}| of \pkg{amsmath} the value of |\baselineskip| is
+% changed and if the options |first-row| and |last-row| were used in an
+% environment of \pkg{nicematrix}, the position of the delimiters was wrong.
%
-% Columns |X| and environment |{NiceTabularX}|.
+% A warning is written in the |.log| file if an obsolete environment is used.
%
-% Command |\rowlistcolors| available in the |\CodeBefore|.
+% There is no longer artificial errors |Duplicate~name| in the environments of
+% \pkg{amsmath}.
%
-% In columns with fixed width, the blocks are composed as paragraphs (wrapping
-% of the lines).
-%
-% The key |define-L-C-R| has been deleted.
+% \subsection*{Changes between version 3.4 and 3.5}
+%
+% Correction on a bug on the two previous versions where the |code-after| was
+% not executed.
+%
+% \subsection*{Changes between version 3.3 and 3.4}
%
+% Following a discussion on TeX StackExchange\footnote{cf.
+% |tex.stackexchange.com/questions/510841/nicematrix-and-tikz-external-optimize|},
+% optimization of Tikz externalization is disabled in the environments of
+% \pkg{nicematrix} when the class \cls{standalone} or the package
+% \pkg{standalone} is used.
+%
+% \subsection*{Changes between version 3.2 and 3.3}
+%
+% The options |first-row|, |last-row|, |first-col| and |last-col| are now
+% available in the environments |{NiceMatrix}|, |{pNiceMatrix}|,
+% |{bNiceMatrix}|, etc.
+%
+% The option |columns-width=auto| doesn't need any more a second compilation.
%
-% \subsection*{Changes between versions 6.0 and 6.1}
+% The previous version of \pkg{nicematrix} was incompatible with a recent
+% version of \pkg{expl3} (released 2019/09/30). This version is compatible.
%
-% Better computation of the widths of the |X| columns.
+% \subsection*{Changes between version 3.1 and 3.2 (and 3.2a)}
+%
+% Option |small|.
+%
+% \subsection*{Changes between version 3.0 and 3.1}
+%
+% Command |\Block| to draw block matrices.
%
-% Key |\color| for the command |\RowStyle|.
+% Error message when the user gives an incorrect value for |last-row|.
%
-% \subsection*{Changes between versions 6.1 and 6.2}
+% A dotted line can no longer cross another dotted line (excepted the dotted
+% lines drawn by |\cdottedline|, the symbol ``|:|'' (in the preamble of the
+% array) and |\line| in |code-after|).
+%
+% The starred versions of |\Cdots|, |\Ldots|, etc. are now deprecated because,
+% with the new implementation, they become pointless. These starred versions
+% are no longer documented.
%
-% Better compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}.
+% The vertical rules in the matrices (drawn by ``"|"'') are now compatible with
+% the color fixed by \pkg{colortbl}.
%
-% Key |vlines-in-sub-matrix|.
+% Correction of a bug: it was not possible to use the colon ``|:|'' in the
+% preamble of an array when |pdflatex| was used with \pkg{french-babel} (because
+% \pkg{french-babel} activates the colon in the beginning of the document).
%
-% \subsection*{Changes between versions 6.2 and 6.3}
+% \subsection*{Changes between version 2.3 and 3.0}
%
-% Keys |nb-rows|, |rowcolor| and |bold| for the command |\RowStyle|
+% Modification of |\Hdotsfor|. Now |\Hdotsfor| erases the |\vlines| (of ``"|"'')
+% as |\hdotsfor| does.
%
-% Key |name| for the command |\Block|.
+% Composition of exterior rows and columns on the four sides of the matrix (and
+% not only on two sides) with the options |first-row|, |last-row|, |first-col|
+% and |last-col|.
%
-% Support for the columns |V| of \pkg{varwidth}.
+% \subsection*{Changes between version 2.2.1 and 2.3}
+%
+% Compatibility with the column type |S| of \pkg{siunitx}.
%
-% \subsection*{Changes between versions 6.3 and 6.4}
+% Option |hlines|.
%
-% New commands |\UnderBrace| and |\OverBrace| in the |\CodeAfter|.
+% \subsection*{Changes between version 2.2 and 2.2.1}
%
-% Correction of a bug of the key |baseline| (cf. question 623258 on TeX StackExchange).
+% Improvment of the vertical dotted lines drawn by the specifier ``:'' in the
+% preamble.
%
-% Correction of a bug with the columns |V| of \pkg{varwidth}.
+% Modification of the position of the dotted lines drawn by |\hdottedline|.
%
-% Correction of a bug: the use of |\hdottedline| and |:| in the preamble of the
-% array (of another letter specified by |letter-for-dotted-lines|) was
-% incompatible with the key |xdots/line-style|.
+% \subsection*{Changes between version 2.1.5 and 2.2}
%
-% \subsection*{Changes between versions 6.4 and 6.5}
+% Possibility to draw horizontal dotted lines to separate rows with the command
+% |\hdottedline| (similar to the classical command |\hline| and the command
+% |\hdashline| of \pkg{arydshln}).
%
-% Key |custom-line| in |\NiceMatrixOptions|.
+% Possibility to draw vertical dotted lines to separate columns with the
+% specifier ``|:|'' in the preamble (similar to the classical specifier
+% ``"|"'' and the specifier ``|:|'' of \pkg{arydshln}).
%
-% Key |respect-arraystretch|.
+% \subsection*{Changes between version 2.1.4 and 2.1.5}
+%
+% Compatibility with the classes \cls{revtex4-1} and \cls{revtex4-2}.
%
+% Option |allow-duplicate-names|.
%
-% \subsection*{Changes between version 6.5 and 6.6}
+% \subsection*{Changes between version 2.1.3 and 2.1.4}
%
-% Keys |tikz| and |width| in |custom-line|.
+% Replacement of some options |O { }| in commands and environments defined with
+% \pkg{xparse} by |! O { }| (because a recent version of \pkg{xparse} introduced
+% the specifier |!| and modified the default behaviour of the last optional
+% arguments).
%
-% \subsection*{Changes between version 6.6 and 6.7}
+% See |www.texdev.net/2018/04/21/xparse-optional-arguments-at-the-end|
%
-% Key |color| for |\OverBrace| and |\UnderBrace| in the |\CodeAfter|
+% \subsection*{Changes between version 2.1.2 and 2.1.3}
%
-% Key |tikz| in the key |borders| of a command |\Block|
+% When searching the end of a dotted line from a command like |\Cdots| issued in
+% the ``main matrix'' (not in the exterior column), the cells in the exterior
+% column are considered as outside the matrix. That means that it's possible to
+% do the following matrix with only a |\Cdots| command (and a single |\Vdots|).
+% \[\begin{pNiceArray}{Wc{5mm}cWc{5mm}}[first-row,last-col]
+% & C_j & \\
+% \mbox{\Large $0$} & \Vdots & \mbox{\Large $0$} \\
+% \strut & a & \Cdots & L_i \\
+% \mbox{\Large $0$} & & \mbox{\Large $0$} \\
+% \end{pNiceArray}\]
%
-% \subsection*{Changes between version 6.7 and 6.8}
+% \subsection*{Changes between version 2.1 and 2.1.1}
%
-% In the notes of a tabular (with the command |\tabularnote|), the duplicates
-% are now detected: when several commands |\tabularnote| are used with the same
-% argument, only one note is created at the end of the tabular (but all the
-% labels are present, of course).
+% Small corrections: for example, the option |code-for-first-row| is now
+% available in the command |\NiceMatrixOptions|.
%
-% \subsection*{Changes between version 6.8 and 6.9}
+% Following a discussion on
+% TeX StackExchange\footnote{cf.
+% |tex.stackexchange.com/questions/450841/tikz-externalize-and-nicematrix-package|},
+% Tikz externalization is now deactivated in the environments of the
+% package \pkg{nicematrix}.\footnote{Before this version, there was an error
+% when using \pkg{nicematrix} with Tikz externalization. In any case, it's not
+% possible to externalize the Tikz elements constructed by \pkg{nicematrix}
+% because they use the options |overlay| and |remember picture|.}
%
-% New keys |xdots/radius| and |xdots/inter| for customisation of the continuous
-% dotted lines.
+% \subsection*{Changes between version 2.0 and 2.1}
%
-% New command |\ShowCellNames| available in the |\CodeBefore| and in the |\CodeAfter|.
+% New implementation of the environment |{pNiceArrayRC}|. With this new
+% implementation, there is no restriction on the width of the columns.
%
-% \subsection*{Changes between version 6.9 and 6.10}
+% The package \pkg{nicematrix} no longer loads \pkg{mathtools} but only
+% \pkg{amsmath}.
%
-% New keys |xdots/shorten-start| and |xdots/shorten-end|.
+% Creation of ``medium nodes'' and ``large nodes''.
%
-% It's possible to use |\line| in the |\CodeAfter| between two blocks (and not
-% only two cells).
+% \subsection*{Changes between version 1.4 and 2.0}
+%
+% The versions 1.0 to 1.4 of \pkg{nicematrix} were focused on the continuous
+% dotted lines whereas the version 2.0 of \pkg{nicematrix} provides different
+% features to improve the typesetting of mathematical matrices.
%
-% \subsection*{Changes between version 6.10 and 6.11}
+% \subsection*{Changes between version 1.3 and 1.4}
+%
+% The column types |w| and |W| can now be used in the environments
+% |{NiceArray}|, |{pNiceArrayC}| and its variants with the same meaning as in
+% the package \pkg{array}.
+%
+% New option |columns-width| to fix the same width for all the columns of the
+% array.
%
-% New key |matrix/columns-type| to specify the type of columns of the matrices.
+% \subsection*{Changes between version 1.2 and 1.3}
%
-% New key |ccommand| in |custom-line| and new command |\cdottedline|.
+% New environment |{pNiceArrayC}| and its variants.
%
-% \subsection*{Changes between version 6.11 and 6.12}
+% Correction of a bug in the definition of |{BNiceMatrix}|, |{vNiceMatrix}| and
+% |{VNiceMatrix}| (in fact, it was a typo).
%
-% New keys |caption|, |short-caption| and |label| in the environment
-% |{NiceTabular}|.
+% Options are now available locally in |{pNiceMatrix}| and its variants.
+%
+% The names of the options are changed. The old names were names in ``camel
+% style''.
%
-% In |{NiceTabular}|, a caption specified by the key |caption| is wrapped to the
-% width of the tabular.
+% \subsection*{Changes between versions 1.1 and 1.2}
+%
+% New environment |{NiceArray}| with column types |L|, |C| and |R|.
+%
+% \subsection*{Changes between versions 1.0 and 1.1}
%
-% Correction of a bug: it's now possible to use |\OverBrace| and |\UnderBrace|
-% with \pkg{unicode-math} (with XeLaTeX or LuaLaTeX).
+% The dotted lines are no longer drawn with Tikz nodes but with Tikz circles
+% (for efficiency).
%
-% \subsection*{Changes between version 6.12 and 6.13}
-%
-% New environment |{TabularNote}| in |{NiceTabular}| with the same semantic as
-% the key |tabularnote| (for legibility).
+% Modification of the code which is now twice faster.
%
-% The command |\Hline| nows accepts options (between square brackets).
%
%
% \newpage
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index 42858eec70..94269ea86d 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/ukbill/README b/macros/latex/contrib/ukbill/README
index 37a43be539..9fc6812856 100644
--- a/macros/latex/contrib/ukbill/README
+++ b/macros/latex/contrib/ukbill/README
@@ -2,7 +2,7 @@ ukbill - easily typeset UK legislation
version: 1.0.0
-This package provides formatting to easily typeset draft UK legislation. The libre font Palatine Parliamentary is required to use this package: https://github.com/ezgranet/palatine-parliamentary
+This package provides formatting to easily typeset draft UK legislation. The libre font Palatine Parliamentary is required to use this class: https://github.com/ezgranet/palatine-parliamentary
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), version 1.3c or later.
@@ -12,4 +12,5 @@ For suggestions, feature requests, and bug reports, please use the project's
GitHub site: https://github.com/ezgranet/ukbill
Version history:
+12/12/2022: v 1.0.1 fixed errors in sample bill—no substantive changes to package
1/12/2022: package creation \ No newline at end of file
diff --git a/macros/latex/contrib/ukbill/immigration-bill.pdf b/macros/latex/contrib/ukbill/immigration-bill.pdf
index 14322d0ae7..6f0f6a1921 100644
--- a/macros/latex/contrib/ukbill/immigration-bill.pdf
+++ b/macros/latex/contrib/ukbill/immigration-bill.pdf
Binary files differ
diff --git a/macros/latex/contrib/ukbill/immigration-bill.tex b/macros/latex/contrib/ukbill/immigration-bill.tex
index ff40d40aad..d194f25ef4 100644
--- a/macros/latex/contrib/ukbill/immigration-bill.tex
+++ b/macros/latex/contrib/ukbill/immigration-bill.tex
@@ -1,4 +1,4 @@
-\documentclass[private]{ukbill}
+\documentclass{ukbill}
\drafter{The Drafter of the Bill (Mr E Z Granet)}
\billcopyright{\ccbysa\, This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International Licence.}
\publishedby{the drafter}
@@ -7,7 +7,7 @@
\humanrights{\printdrafter\ has made the following statement, which a minister would be obliged to give under section 19(1)(a), of the Human Rights Act 1998:
\vspace{1ex}
-In my view the provisions of the \printbilltitle are compatible with the Convention rights.\\
+In my view the provisions of the \printbilltitle\ are compatible with the Convention rights.\\
}
\exptitle{Explanatory Notes}
\exptext{Explanatory notes to the Bill, prepared by the Drafter, are forthcoming.}
@@ -32,7 +32,7 @@ In my view the provisions of the \printbilltitle are compatible with the Convent
\item In this Act, the term `non-designated Realm' refers to an independent sovereign State recognised by His Majesty's Government, which fulfils all of the following criteria:
\begin{alphstat}
\item the State is a member of the Commonwealth of Nations
-\item the the headship of state is vested in the person of His Majesty the King, and her heirs and successors according to law;
+\item the the headship of state is vested in the person of His Majesty the King, and His heirs and successors according to law;
\item in the State's legal system, final appellate jurisdiction does not lie with His Majesty in Council.
\end{alphstat}
\end{numstat}
@@ -43,7 +43,7 @@ In my view the provisions of the \printbilltitle are compatible with the Convent
\begin{alphstat}\item An independent sovereign State recognised by His Majesty's Government, which fulfils all of the following criteria:
\begin{romstat}
\item the State is a member of the Commonwealth of Nations
-\item the the headship of state is vested in the person of His Majesty the King, and her heirs and successors according to law;
+\item the the headship of state is vested in the person of His Majesty the King, and His heirs and successors according to law;
\item in the State's legal system, final appellate jurisdiction lies with His Majesty in Council.
\end{romstat}
\item A non-independent polity (including, but not limited to: province, federal state, sub-division, territory, dependency, or associated state) which fulfils all of the following criteria:
@@ -248,4 +248,4 @@ In my view the provisions of the \printbilltitle are compatible with the Convent
\end{numstat}
\end{nostat}
-\end{document} \ No newline at end of file
+\end{document}
diff --git a/macros/latex/contrib/ukbill/ukbill-documentation.pdf b/macros/latex/contrib/ukbill/ukbill-documentation.pdf
index 4aa3296367..715c6e0640 100644
--- a/macros/latex/contrib/ukbill/ukbill-documentation.pdf
+++ b/macros/latex/contrib/ukbill/ukbill-documentation.pdf
Binary files differ
diff --git a/macros/latex/contrib/ukbill/ukbill-documentation.tex b/macros/latex/contrib/ukbill/ukbill-documentation.tex
index 9548c4c7ae..a399e973c5 100644
--- a/macros/latex/contrib/ukbill/ukbill-documentation.tex
+++ b/macros/latex/contrib/ukbill/ukbill-documentation.tex
@@ -25,7 +25,7 @@ ItalicFont={Palatine Parliamentary Italic}]{Palatine Parliamentary Regular}
\newcommand{\thebox}{{\boxy ▯}}
%\usepackage[firstnumber=last]{fancyvrb}
\usepackage{minted}
-\date{\today\\\smallskip\ttfamily Version 1.0.0}
+\date{\today\\\smallskip\ttfamily Version 1.0.1}
\author{Elijah Z Granet\thanks{e-mail: \href{mailto:ezg21@cantab.ac.uk}{\ttfamily ezg21@cantab.ac.uk}}}
\title{\texttt{ukbill}:\\A package for typesetting UK legislation}
@@ -143,6 +143,9 @@ Private bills have a different enacting formula and also make use of recitals. D
\section{Licence}
This project is licensed under the Latex Public Project Licence version 1.3\textit{c}. This documentation is copyright of the author but licensed under CC-BY-SA 4.0.
\section{Version History}
+ \subsection{\normalfont\texttt{1.0.1}}
+\ttfamily 12 December 2022: Fixes to example documentation
+
\subsection{\normalfont\texttt{1.0.0}}
\ttfamily 1 December 2022: Class Creation
diff --git a/macros/latex/contrib/ukbill/ukbill.cls b/macros/latex/contrib/ukbill/ukbill.cls
index ebabf63344..f90e4f934d 100644
--- a/macros/latex/contrib/ukbill/ukbill.cls
+++ b/macros/latex/contrib/ukbill/ukbill.cls
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\def\ukbillversionnumber{1.0.0}
+\def\ukbillversionnumber{1.0.1}
\ProvidesClass{ukbill}[2022-12-01 A Class for Legal Notes]
% !TeX program = lualatex
% !TeX encoding = utf8
diff --git a/macros/luatex/latex/luaquotes/README b/macros/luatex/latex/luaquotes/README
index b4095e8a56..963efc971d 100644
--- a/macros/luatex/latex/luaquotes/README
+++ b/macros/luatex/latex/luaquotes/README
@@ -1,6 +1,6 @@
luaquotes - smart quotes with lua
-version: 1.2.1
+version: 1.2.2
This package automatically creates smart quotes using lua filters and provides auxiliary commands for typesetting specific lua punctuation
@@ -12,6 +12,7 @@ For suggestions, feature requests, and bug reports, please use the project's
GitHub site: https://github.com/ezgranet/luaquotes
Version history:
+12/12/2022-added degm function
23/11/2022-walking back automatic elision for now
25/10/2022—support for elision
30/08/2022—resolving bug with language versions
diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf
index 4d5e961eac..991ae4c461 100644
--- a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf
+++ b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf
Binary files differ
diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex
index 3a92f1df05..f77f8f956a 100644
--- a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex
+++ b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex
@@ -80,6 +80,7 @@ breaklines,
{latex}
\usepackage[fr]{luaquotes} %French
\usepackage[de]{luaquotes} % German
+\usepackage[degm]{luaquotes} % German with French-style quotes
\end{minted}
\subsubsection{English Features}
The English features are designed to smartly recognise English punctuation:
@@ -110,7 +111,7 @@ The French option produces the following output, including the extra space aroun
\end{tabular}
\end{center}
\subsubsection{The German option}
-The German option produces the following outpu:
+The German option produces the following output:
\begin{center}
\renewcommand{\arraystretch}{2}
@@ -123,6 +124,20 @@ The German option produces the following outpu:
\end{tabular}
\end{center}
+\subsubsection{The German (\texttt{degm}) option}
+The German (\texttt{degm}) option produces the following output:
+
+\begin{center}
+\renewcommand{\arraystretch}{2}
+\begin{tabular}{cc}
+\ttfamily User input &Output\\
+\LARGE\texttt{"Hallo!"}%
+& \LARGE \degmdouble Hallo!\degmtr\\
+\LARGE\texttt{'Hallo!'}%
+& \LARGE \degmsingle Hallo!\desgmtr\\
+
+\end{tabular}
+\end{center}
@@ -140,6 +155,7 @@ breaklines,
\dumbquotes %English
\frdumbquotes %French
\dedumbquotes %German
+\degmdumbquotes %German with French-style quotes
\end{minted}
The following commands re-activate the smart quotes function:
@@ -155,12 +171,13 @@ breaklines,
\smartquotes %English
\frsmartquotes %French
\desmartquotes % German
+\degmsmartquotes % German with French-style quotes
\end{minted}
A limitation on the (de-)activation of the package is that the Lua filters will not deactivate within the same paragraph, so the function can only be changed across paragraphs.
\subsection{Monospace}
-As a general rule, smart quotes are rather undesirable in monospace text, and therefore, within the \color{darkspringgreen}\verb! \texttt!\color{black} environment the package does not apply smart quotes. Thus, the same input produces in roman face \textcolor{darkspringgreen}{"Hello World"} but in monospace \texttt{"Hello World"}.
+As a general rule, smart quotes are rather undesirable in monospace text, and therefore, within the \color{darkspringgreen} \verb!\texttt!\color{black}\ environment the package does not apply smart quotes. Thus, the same input produces in roman face \textcolor{darkspringgreen}{"Hello World"} but in monospace \texttt{"Hello World"}.
As the example above shows, the default behaviour of this package forces straight quotes in monospace, and disables \TeX\ quote ligatures (but not other \TeX\ ligatures) to do so, on the assumption that any form of curved quotes are undesirable.
@@ -201,10 +218,12 @@ Single low quote & \ttfamily U+201A & \verb!\desingle! & \Huge\desingle\thebox\\
Right double quote & \ttfamily U+201D & \verb!\sqtworight! & \Huge\thebox\sqtworight\\
Left guillemet [w/ space]& \ttfamily U+00AB & \verb!\glmtl! & \Huge\glmtl\thebox\\
Right guillemet [w/ space]& \ttfamily U+00BB & \verb!\glmtr! & \Huge\thebox\glmtr\\
-Single left guillemet [w/ space]& \ttfamily U+2039 & \verb!\sglmtl! & \Huge\sglmtl\thebox\\
-
-Single right guillemet [w/ space]& \ttfamily U+203A & \verb!\sglmtr! & \Huge\thebox\sglmtr\\
-
+ \texttt{degm} left guillemet & \ttfamily U+00BB & \verb!\degmtl! & \Huge\degmtl\thebox\\
+ \texttt{degm} right guillemet & \ttfamily U+00AB & \verb!\degmtr! & \Huge\thebox\degmtr\\
+ Single left guillemet [w/ space]& \ttfamily U+2039 & \verb!\sglmtl! & \Huge\sglmtl\thebox\\
+ Single right guillemet [w/ space]& \ttfamily U+203A & \verb!\sglmtr! & \Huge\thebox\sglmtr\\
+ \texttt{degm} single left guillemet & \ttfamily U+203A & \verb!\desgmtl! & \Huge\desgmtl\thebox\\
+ \texttt{degm} single right guillemet & \ttfamily U+2039 & \verb!\desgmtr! & \Huge\thebox\desgmtr\\
\end{longtable}
\end{center}
@@ -236,7 +255,7 @@ For typesetting US/Imperial measurements like feet and inches, the correct symbo
-For certain Polynesian langauges, a letter called the \okina Okina is used; while this appears identical to a left single quotation mark in many fonts, it is encoded differently in Unicode because it is properly a letter, not a punctuation mark.
+For certain Polynesian languages, a letter called the \okina Okina is used; while this appears identical to a left single quotation mark in many fonts, it is encoded differently in Unicode because it is properly a letter, not a punctuation mark.
@@ -254,7 +273,7 @@ For certain Polynesian langauges, a letter called the \okina Okina is used; whil
\section{Future Development and Localisation}
- The package's online repository is the best place to report bugs, feature requests, or other contributions, and is located at: \\\url{github.com/ezgranet/luaquotes}.
+ The package's online repository is the best place to report bugs, feature requests, or other contributions, and is located at: \\\url{https://github.com/ezgranet/luaquotes}.
One obvious point of future development is the addition of other language localisations; this is technologically easy in principle but difficult for me to accomplish without assistance because it requires detailed knowledge of typographic conventions for any given language standard, and therefore the aid of contributors and collaborators. \section{Licence}
This project is licensed under the Latex Public Project Licence version 1.3\textit{c}. This documentation is copyright of the author but licensed under CC-BY-SA 3.0.
@@ -829,7 +848,10 @@ firstnumber=last
\frsmartquotes
\frdumbquotes
\desmartquotes
-\dedumbquotes\smartquotes}
+\dedumbquotes
+\degmsmartquotes
+\degmdumbquotes
+\smartquotes}
\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}}
}
@@ -1195,6 +1217,283 @@ firstnumber=last
\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}}
}
\end{minted}
+ \subsection{The German with French-style quotes (\texttt{degm}) option}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% SCHÖNERES DEUTSCH
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\luaexec{
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+function degmdoublequotes ( s )
+ return ( s:gsub ( '"(..-)"' , "»\%1«" ) )
+ end
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }
+\luaexec{
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+function degmsinglequotelinestart ( s )
+ return (s:gsub ("^'","›" ) )
+ end
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }
+\luaexec{
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+function degmsinglequotesclose( s )
+return ( s:gsub ( " '(..-)'", " ‚\%1‹" ) )
+ end
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }
+
+%% Two utility macros to activate/deactivate the Lua function:
+\newcommand\degmdoublequoteson{\directlua{
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+luatexbase.add_to_callback (
+ "process_input_buffer" , degmdoublequotes , "degmdoublequotes" )
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }}
+\newcommand\degmdoublequotesoff{\directlua{luatexbase.remove_from_callback (
+ "process_input_buffer" , "degmdoublequotes" )
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+}}
+\newcommand\degmsinglequotelinestarton{\directlua{
+\end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+luatexbase.add_to_callback (
+ "process_input_buffer" , degmsinglequotelinestart , "degmsinglequotelinestart" )\end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }}
+\newcommand\degmsinglequotelinestartoff{\directlua{
+\end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+luatexbase.remove_from_callback (
+ "process_input_buffer" , "degmsinglequotelinestart" )
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }}
+\newcommand\degmsinglequotescloseon{\directlua{
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+ luatexbase.add_to_callback (
+ "process_input_buffer" , degmsinglequotesclose , "degmsinglequotesclose" )
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }}
+\newcommand\degmsinglequotescloseoff{\directlua{
+\end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{lua}
+luatexbase.remove_from_callback (
+ "process_input_buffer" , "degmsinglequotesclose" )
+ \end{minted}
+ \begin{minted}[
+frame=lines,
+framesep=2mm,
+baselinestretch=1.2,
+bgcolor=LightGray,
+fontsize=\footnotesize,
+linenos,
+breaklines,
+firstnumber=last
+]
+{latex}
+ }}
+ \newcommand{\degmsmartquotes}{\degmdoublequoteson
+\degmsinglequotelinestarton
+\degmsinglequotescloseon}
+ \newcommand{\degmdumbquotes}{\degmdoublequotesoff
+\degmsinglequotelinestartoff
+\degmsinglequotescloseoff}
+ \DeclareOption{degm}{
+\AtBeginDocument{
+\frsmartquotes
+\frdumbquotes
+\smartquotes
+\dumbquotes\dumbquotes
+\degmsmartquotes}
+\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}}
+}
+ \end{minted}
\subsection{The French option}
\begin{minted}[
frame=lines,
@@ -1502,6 +1801,9 @@ firstnumber=last
\end{minted}
\section{Version History}
+\subsection{\normalfont\texttt{1.2.2}}
+\ttfamily Added the "degm" option
+
\subsection{\normalfont\texttt{1.2.1}}
\ttfamily Suspended automatic elision support due to implementation issues
diff --git a/macros/luatex/latex/luaquotes/luaquotes.sty b/macros/luatex/latex/luaquotes/luaquotes.sty
index f26758b909..c07785bcd6 100644
--- a/macros/luatex/latex/luaquotes/luaquotes.sty
+++ b/macros/luatex/latex/luaquotes/luaquotes.sty
@@ -1,6 +1,6 @@
-\def\luaquotesversionnumber{1.2.1}
+\def\luaquotesversionnumber{1.2.2}
\ProvidesPackage{luaquotes}
- [2022/11/23\luaquotesversionnumber smart quotes with lua]
+ [2022/12/09\luaquotesversionnumber smart quotes with lua]
% !TeX program = lualatex
% !TeX encoding = utf8
% This work may be distributed and/or modified under the
@@ -153,7 +153,7 @@ luatexbase.add_to_callback (
\singlequotesoff}
\DeclareOption{en}{
-\AtBeginDocument{\frsmartquotes\frdumbquotes\desmartquotes\dedumbquotes\smartquotes}
+\AtBeginDocument{\frsmartquotes\frdumbquotes\desmartquotes\dedumbquotes\degmsmartquotes\degmdumbquotes\smartquotes}
\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}}
}
@@ -180,6 +180,8 @@ luatexbase.add_to_callback (
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\desingle}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"201A}}}
\newcommand{\dedouble}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"201E}}}
+\newcommand{\degmsingle}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"203A}}}
+\newcommand{\degmdouble}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"00BB}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% backtick
@@ -227,6 +229,10 @@ luatexbase.add_to_callback (
\newcommand{\glmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\,»}}
\newcommand{\sglmtl}{{\addfontfeature{RawFeature={-qtbye,-tlig}}‹\,}}
\newcommand{\sglmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\,›}}
+\newcommand{\degmtl}{{\addfontfeature{RawFeature={-qtbye,-tlig}}»}}
+\newcommand{\degmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}«}}
+\newcommand{\desgmtl}{{\addfontfeature{RawFeature={-qtbye,-tlig}}›}}
+\newcommand{\desgmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}‹}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DEUTSCH
@@ -273,6 +279,50 @@ return ( s:gsub ( " '(..-)'", " ‚\%1`" ) )
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% SCHÖNERES DEUTSCH
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\luaexec{function degmdoublequotes ( s )
+ return ( s:gsub ( '"(..-)"' , "»\%1«" ) )
+ end}
+\luaexec{function degmsinglequotelinestart ( s )
+ return (s:gsub ("^'","›" ) )
+ end}
+\luaexec{function degmsinglequotesclose( s )
+return ( s:gsub ( " '(..-)'", " ‚\%1‹" ) )
+ end}
+
+%% Two utility macros to activate/deactivate the Lua function:
+\newcommand\degmdoublequoteson{\directlua{luatexbase.add_to_callback (
+ "process_input_buffer" , degmdoublequotes , "degmdoublequotes" )}}
+\newcommand\degmdoublequotesoff{\directlua{luatexbase.remove_from_callback (
+ "process_input_buffer" , "degmdoublequotes" )}}
+\newcommand\degmsinglequotelinestarton{\directlua{luatexbase.add_to_callback (
+ "process_input_buffer" , degmsinglequotelinestart , "degmsinglequotelinestart" )}}
+\newcommand\degmsinglequotelinestartoff{\directlua{luatexbase.remove_from_callback (
+ "process_input_buffer" , "degmsinglequotelinestart" )}}
+ \newcommand\degmsinglequotescloseon{\directlua{luatexbase.add_to_callback (
+ "process_input_buffer" , degmsinglequotesclose , "degmsinglequotesclose" )}}
+\newcommand\degmsinglequotescloseoff{\directlua{luatexbase.remove_from_callback (
+ "process_input_buffer" , "degmsinglequotesclose" )}}
+ \newcommand{\degmsmartquotes}{\degmdoublequoteson
+\degmsinglequotelinestarton
+\degmsinglequotescloseon}
+ \newcommand{\degmdumbquotes}{\degmdoublequotesoff
+\degmsinglequotelinestartoff
+\degmsinglequotescloseoff}
+ \DeclareOption{degm}{
+\AtBeginDocument{
+\frsmartquotes
+\frdumbquotes
+\smartquotes
+\dumbquotes\dumbquotes
+\degmsmartquotes}
+\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Français
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -308,7 +358,7 @@ return ( s:gsub ( " '(..-)'", " ‹\\,\%1\\,›" ) )
\frsinglequotelinestartoff
\frsinglequotescloseoff}
\DeclareOption{fr}{
-\AtBeginDocument{\desmartquotes\dedumbquotes\smartquotes\dumbquotes\dumbquotes\frsmartquotes}
+\AtBeginDocument{\desmartquotes\dedumbquotes\degmsmartquotes\degmdumpquotes\smartquotes\dumbquotes\dumbquotes\frsmartquotes}
\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}}
diff --git a/macros/luatex/latex/scikgtex/LICENSE b/macros/luatex/latex/scikgtex/LICENSE
new file mode 100644
index 0000000000..bde9a445ef
--- /dev/null
+++ b/macros/luatex/latex/scikgtex/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Christof Bless
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/macros/luatex/latex/scikgtex/README b/macros/luatex/latex/scikgtex/README
new file mode 100644
index 0000000000..e754496c6f
--- /dev/null
+++ b/macros/luatex/latex/scikgtex/README
@@ -0,0 +1,21 @@
+SciKGTeX
+-------------
+AUTHOR
+ Christof Bless, christofbless@gmail.com
+
+DESCRIPTION
+ Scientific Knowledge Graph TeX (SciKgTeX) is a LuaLaTeX package which makes
+ it possible to annotate specific research contributions in scientific documents.
+ SciKGTeX will enrich the document by adding the marked contributions to PDF metadata
+ in a structured XMP format which can be picked up by Search Engines and
+ Knowledge Graphs.
+ More information on how to use the package can be found here:
+ https://github.com/Christof93/SciKGTeX#readme
+
+VERSION
+ 2.1.1 (13.11.2022)
+
+LICENSE
+ This work is published under MIT License. https://opensource.org/licenses/MIT
+
+ Copyright (C) 2022 Christof Bless
diff --git a/macros/luatex/latex/scikgtex/scikgtex.lua b/macros/luatex/latex/scikgtex/scikgtex.lua
new file mode 100644
index 0000000000..94bd0c1f40
--- /dev/null
+++ b/macros/luatex/latex/scikgtex/scikgtex.lua
@@ -0,0 +1,685 @@
+RANDOM_SEED = math.randomseed(os.time())
+MATRIX_AND = {{0,0},{0,1}}
+MATRIX_OR = {{0,1},{1,1}}
+HEXES = '0123456789abcdef'
+local SciKGTeX = {}
+SciKGTeX.whole_string = ""
+SciKGTeX.properties_used = {}
+SciKGTeX.property_commands = {}
+SciKGTeX.mandatory_properties = {
+ 'researchproblem',
+ 'objective',
+ 'method',
+ 'result',
+ 'conclusion'
+}
+SciKGTeX.PRODUCE_XMP_FILE = true
+SciKGTeX.WARNING_LEVEL = 1
+
+local XMP = {}
+XMP.lines = {}
+XMP.namespaces = {}
+XMP.property_ns = {}
+XMP.XMP_TOP = [[<x:xmpmeta xmlns:x="adobe:ns:meta/">]]
+XMP.XMP_BOTTOM = [[</rdf:RDF>
+</x:xmpmeta>]]
+XMP.PACKET_END = [[<?xpacket end="r"?>]]
+
+local UUID = {}
+
+---------------------------- utilities -------------------------------
+
+-- performs the bitwise operation specified by truth matrix on two numbers.
+function BITWISE(x, y, matrix)
+ local z = 0
+ local pow = 1
+ while x > 0 or y > 0 do
+ z = z + (matrix[x%2+1][y%2+1] * pow)
+ pow = pow * 2
+ x = math.floor(x/2)
+ y = math.floor(y/2)
+ end
+ return z
+end
+
+function INT2HEX(x)
+ local s,base,pow = '',16,0
+ local d
+ while x > 0 do
+ d = x % base + 1
+ x = math.floor(x/base)
+ s = string.sub(HEXES, d, d)..s
+ end
+ if #s == 1 then s = "0" .. s end
+ return s
+end
+
+function get_output_dir()
+ if arg ~= nil then
+ for k,v in ipairs(arg) do
+ val, is_output_argument = v:gsub('%-%-output%-directory=(.*)','%1')
+ if is_output_argument > 0 then
+ return val
+ end
+ end
+ return nil
+ end
+ return nil
+end
+
+function read_header_of_file(path)
+ local fh = io.open(path, "rb")
+ if fh then
+ local first_line = assert(fh:read())
+ fh:close()
+ return first_line
+ else
+ print ("No xmp metadata file found!")
+ return nil
+ end
+end
+
+function extract_uuid_from_header(header)
+ return header:gsub('.*id=\"(.-)\".*','%1')
+end
+
+function generate_UUID()
+ UUID:initialize('00:0c:29:69:41:c6')
+ return UUID:toString()
+end
+
+function string:split(sep)
+ if sep == nil then
+ sep = "%s"
+ end
+ local t = {}
+ for str in self:gmatch("([^"..sep.."]+)") do
+ table.insert(t, str)
+ end
+ return t
+end
+
+function spaces_to_underscores(s)
+ return s:gsub('%s+','_')
+end
+
+function remove_environments(s)
+ s,c = s:gsub('\\begin%s*{.-}{.-}%s*','')
+ s,c = s:gsub('\\begin%s*{.-}%s*','')
+ s,c = s:gsub('\\end%s*{.-}%s*','')
+ return s
+end
+
+function remove_any_latex_command(s)
+ s, c = s:gsub('\\%w+%s*%[%d*%]%s*{(.*)}','%1')
+ if c > 0 then
+ return remove_latex_commands(s)
+ end
+ s, c = s:gsub('\\%w+%s*{(.*)}','%1')
+ if c > 0 then
+ return remove_latex_commands(s)
+ end
+ s, c = s:gsub('\\%w+%s*','')
+ if c > 0 then
+ return remove_latex_commands(s)
+ end
+ return s
+end
+
+function find_last_occurence(s, repls)
+ occurences = {}
+ for pattern, repl in pairs(repls) do
+ i, j = s:find(pattern)
+ if i ~= nil then
+ table.insert(occurences, {i,j,pattern})
+ end
+ end
+ table.sort(occurences, function(l, r) return l[1]>r[1] end)
+ if #occurences > 0 then
+ return occurences[1]
+ else
+ return nil
+ end
+end
+
+function exhaustively_replace_last_occurence_of_pattern(s, repls)
+ last_occurence = find_last_occurence(s, repls)
+ if last_occurence ~= nil then
+ starts, ends, pattern = table.unpack(last_occurence)
+ to_replace = s:sub(starts,ends)
+ else
+ return s
+ end
+ new_string = s:sub(0,starts-1) .. to_replace:gsub(pattern, repls[pattern], 1) .. s:sub(ends+1)
+ return exhaustively_replace_last_occurence_of_pattern(new_string, repls)
+end
+
+function remove_latex_commands(s)
+ replacements = {
+ -- contribution with * and []
+ ['\\contribution%s*%*%s*%[%d*%]%s*{.-}{.*}%s*'] = '',
+ -- contribution with *
+ ['\\contribution%s*%*%s*{.-}%s*{.*}%s*'] = '',
+ -- contribution with []
+ ['\\contribution%s*%[%d*%]%s*{.-}{(.*)}'] = '%1',
+ -- contribution normal
+ ['\\contribution%s*{.-}%s*{(.*)}'] = '%1',
+
+ ['\\uri%s*{.-}%s*{(.*)}'] = '%1',
+ }
+ for cmd, used in pairs(SciKGTeX.property_commands) do
+ -- []
+ replacements['\\'.. cmd .. '%s*%[%d*%]%s*{(.*)}'] = '%1'
+ -- normal command
+ replacements['\\'.. cmd .. '%s*{(.*)}'] = '%1'
+ -- with * and []
+ replacements['\\'.. cmd .. '%s*%*%s*%[%d*%]%s*{.*}%s*'] = ''
+ -- with *
+ replacements['\\'.. cmd .. '%s*%*%s*{.*}%s*'] =''
+ end
+ s = remove_environments(s)
+ s = exhaustively_replace_last_occurence_of_pattern(s, replacements)
+ s = remove_any_latex_command(s)
+ -- remove escape chars
+ s = s:gsub('\\','')
+ return s
+end
+
+function uri_valid(s)
+ if s:find('http') ~= 1 then
+ return false
+ else
+ return true
+ end
+end
+
+function resolve_entity(s)
+ -- make sure the entity is only resolved at the innermost of nested commands.
+ for _, cmd in ipairs(SciKGTeX.mandatory_properties) do
+ if s:find('\\' .. cmd) then
+ return false
+ end
+ end
+ if s:find('\\contribution') then
+ return false
+ end
+ uri, found = s:gsub('.*\\uri%s*{(.-)}%s*{.*}.*', '%1')
+ if found == 1 then
+ label = s:gsub('.*\\uri%s*{.-}%s*{(.*)}.*', '%1')
+ entity = string.format('<rdf:Description rdf:about=\"%s\"><rdfs:label>%s</rdfs:label></rdf:Description>', uri, label)
+ return entity
+ else
+ uri, found = s:gsub('.*\\uri%s*{(.-)}.*', '%1')
+ if found == 1 then
+ entity = string.format('<rdf:Description rdf:about=\"%s\"></rdf:Description>', uri)
+ return entity
+ else
+ return false
+ end
+ end
+end
+
+---------------------------- UUID class methods -------------------------------------
+
+-- hwaddr is a string: hexes delimited by colons. e.g.: 00:0c:29:69:41:c6
+function UUID:initialize(hwaddr)
+ self._bytes = {
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ math.random(0, 255),
+ -- should come from mac address
+ tonumber(hwaddr:sub(1, 2), 16),
+ tonumber(hwaddr:sub(4, 5), 16),
+ tonumber(hwaddr:sub(7, 8), 16),
+ tonumber(hwaddr:sub(10, 11), 16),
+ tonumber(hwaddr:sub(13, 14), 16),
+ tonumber(hwaddr:sub(16, 17), 16)
+ }
+ -- set the version
+ self._bytes[7] = BITWISE(self._bytes[7], 0x0f, MATRIX_AND)
+ self._bytes[7] = BITWISE(self._bytes[7], 0x40, MATRIX_OR)
+ -- set the variant
+ self._bytes[9] = BITWISE(self._bytes[7], 0x3f, MATRIX_AND)
+ self._bytes[9] = BITWISE(self._bytes[7], 0x80, MATRIX_OR)
+ self._string = nil
+ end
+
+ -- lazy string creation.
+ function UUID:toString()
+ if self._string == nil then
+ self._string = INT2HEX(self._bytes[1])..INT2HEX(self._bytes[2])..INT2HEX(self._bytes[3])..INT2HEX(self._bytes[4]).."-"..
+ INT2HEX(self._bytes[5])..INT2HEX(self._bytes[6]).."-"..
+ INT2HEX(self._bytes[7])..INT2HEX(self._bytes[8]).."-"..
+ INT2HEX(self._bytes[9])..INT2HEX(self._bytes[10]).."-"..
+ INT2HEX(self._bytes[11])..INT2HEX(self._bytes[12])..INT2HEX(self._bytes[13])..INT2HEX(self._bytes[14])..INT2HEX(self._bytes[15])..INT2HEX(self._bytes[16])
+ end
+ return self._string
+ end
+
+---------------------------- Main class methods -------------------------------
+
+function SciKGTeX:set_warning_level(wl)
+ self.WARNING_LEVEL = wl
+end
+
+function SciKGTeX:warn(warning_message, ...)
+ if self.WARNING_LEVEL > 0 then
+ texio.write_nl("term and log",
+ [[Package SciKGTeX Warning: ]] .. string.format(warning_message, ...))
+ texio.write_nl("term and log","\n")
+ end
+end
+
+function SciKGTeX:error(warning_message, ...)
+ tex.error([[Package SciKGTeX Error: ]] .. string.format(warning_message, ...))
+end
+
+SciKGTeX.command_factory = {}
+
+SciKGTeX.command_factory.cmd_top = [[\newcommand{\%s}[2][]{]]
+
+SciKGTeX.command_factory.cmd_top_star = [[\WithSuffix\newcommand\%s*[2][]{]]
+
+SciKGTeX.command_factory.cmd_top_override = [[\renewcommand{\%s}[2][]{]]
+
+SciKGTeX.command_factory.cmd_top_star_override = [[\WithSuffix\renewcommand\%s*[2][]{]]
+
+SciKGTeX.command_factory.directlua_part = [[ \directlua{
+ local content = "\luaescapestring{\unexpanded{#2}}"
+ local belongs_to_contribution = "\luaescapestring{\unexpanded{#1}}"
+ SciKGTeX.XMP:add_annotation(belongs_to_contribution, '%s', content, 'annotation-id')
+ }]]
+
+SciKGTeX.command_factory.cmd_bottom = [[}]]
+SciKGTeX.command_factory.cmd_bottom_star = [[\ignorespaces}]]
+
+function SciKGTeX.command_factory:build_command(command_name)
+ full_cmd = self.cmd_top .. "\n" .. self.directlua_part .. "\n #2\n" .. self.cmd_bottom
+ formatted_cmd = string.format(full_cmd, command_name, command_name)
+ for i, line in ipairs(formatted_cmd:split("\n")) do
+ tex.print(line .. "%")
+ end
+end
+
+function SciKGTeX.command_factory:build_star_command(command_name)
+ full_cmd = self.cmd_top_star .. "\n" .. self.directlua_part .. "\n" .. self.cmd_bottom_star
+ formatted_cmd = string.format(full_cmd, command_name, command_name)
+ for i, line in ipairs(formatted_cmd:split("\n")) do
+ tex.print(line .. "%")
+ end
+end
+
+function SciKGTeX.command_factory:override_command(command_name)
+ full_cmd = self.cmd_top_override .. "\n" .. self.directlua_part .. "\n #2\n" .. self.cmd_bottom
+ formatted_cmd = string.format(full_cmd, command_name, command_name)
+ for i, line in ipairs(formatted_cmd:split("\n")) do
+ tex.print(line .. "%")
+ end
+end
+
+function SciKGTeX.command_factory:override_star_command(command_name)
+ full_cmd = self.cmd_top_star_override .. "\n" .. self.directlua_part .. "\n" .. self.cmd_bottom_star
+ formatted_cmd = string.format(full_cmd, command_name, command_name)
+ for i, line in ipairs(formatted_cmd:split("\n")) do
+ tex.print(line .. "%")
+ end
+end
+
+function SciKGTeX:make_new_command(new_property, namespace)
+ -- check if property already exists
+ if self.property_commands[new_property]~=nil then
+ self:warn([[Method newpropertycommand: Repeated definition.
+ Command %s already exists!
+ Are you sure you want to override it?]], new_property)
+ self:add_property(new_property, namespace)
+ self.command_factory:override_command(new_property, namespace)
+ self.command_factory:override_star_command(new_property, namespace)
+ else
+ self.property_commands[new_property] = false
+ self:add_property(new_property, namespace)
+ self.command_factory:build_command(new_property, namespace)
+ self.command_factory:build_star_command(new_property, namespace)
+ end
+end
+
+function SciKGTeX:add_property(new_property, namespace)
+ new_property = self.XMP:escape_xml_tags(new_property)
+ -- check if property already exists
+ if self.properties_used[new_property]~=nil then
+ self:warn([[Method addmetaproperty: Repeated definition.
+ Property %s already added!
+ Are you sure you want to replace it?]], new_property)
+ -- if not make it known to the object
+ else
+ self.properties_used[new_property] = false
+ end
+ ns_prefix = self.XMP:extract_namespace_prefix(namespace)
+ self.XMP.property_ns[new_property] = ns_prefix
+end
+
+function SciKGTeX:register_property(prop_type)
+ self.properties_used[prop_type] = true
+end
+
+function SciKGTeX:warn_unused_command()
+ warning_message = [[No %s annotation found!
+ Are you sure you don't want to mark an entity with %s?]]
+ for i, p in ipairs(self.mandatory_properties) do
+ used = self.properties_used[p]
+ if not used then
+ self:warn(warning_message, p, p);
+ end
+ end
+end
+
+function SciKGTeX:print_entity(uri, label)
+ if label ~= "" then
+ tex.print(string.format('\\href{%s}{%s}',uri , label))
+ else
+ tex.print(string.format('\\url{%s}',uri))
+ end
+end
+
+---------------------------- XMP class methods -------------------------------
+
+function XMP:escape_xml_tags(s)
+ s = spaces_to_underscores(s)
+ s, i = s:gsub('[^%a%d%.-_]','')
+ if i > 0 then
+ SciKGTeX:warn([[Method escape_xml_tags: Forbidden characters.
+ Property %s can only contain letters, digits, underscores, hyphens and periods!
+ Forbidden characters removed.]], s)
+ end
+ s, i = s:gsub('^([Xx][Mm][Ll])','_%1')
+ if i > 0 then
+ SciKGTeX:warn([[Method escape_xml_tags: Forbidden characters.
+ Property %s can not start with xml!
+ Changed to _xml.]], s)
+ end
+ return s
+end
+
+function XMP:escape_xml_content(s)
+ s = s:gsub('&', '&amp;')
+ s = s:gsub('>', '&gt;')
+ return s:gsub('<', '&lt;')
+end
+
+function XMP:add_line(...)
+ table.insert(self.lines, string.format(...))
+end
+
+function XMP:add_paper_node(paper_iri)
+ self.paper = {}
+ self.paper.contributions = {}
+ self.paper.id = paper_iri
+ self.paper.title = nil
+ self.paper.authors = {}
+ self.paper.researchfield = nil
+end
+
+function XMP:add_contribution(key, contribution_iri)
+ local contribution = {}
+ contribution.properties = {}
+ contribution.id = contribution_iri:gsub("<(default_contribution)>", "ORKG_default")
+ self.paper.contributions[key] = contribution
+end
+
+function XMP:extract_namespace_prefix(ns_arg)
+ if ns_arg == '' then
+ return nil
+ end
+ uri_and_prefix = ns_arg:split(',%s+?')
+
+ if #uri_and_prefix < 2 then
+ SciKGTeX:error([[Method addmetaproperty: No prefix found.
+ Unknown prefix, URI specification: %s.
+ Please specify the arguments as [prefix, URI]!]], ns_arg)
+ return nil
+ elseif #uri_and_prefix > 2 then
+ SciKGTeX:warn([[Method addmetaproperty: Too many arguments.
+ Too many arguments in prefix, URI specification: %s.
+ Excess arguments are ignored.]], ns_arg)
+ end
+
+ if not uri_valid(uri_and_prefix[2]) then
+ message = [[Method addmetaproperty: Invalid URI.
+ The given URI %s is not a valid choice!
+ Please use a resolvable URI starting with 'http'.]]
+ SciKGTeX:error(message, uri_and_prefix[2])
+ return nil
+ end
+ -- add the namespace if it has not been added yet
+ if self.namespaces[uri_and_prefix[1]]==nil then
+ self:add_namespace(uri_and_prefix[1], uri_and_prefix[2])
+ end
+ return uri_and_prefix[1]
+end
+
+function XMP:process_content(c)
+ c = self:escape_xml_content(c)
+ entity = resolve_entity(c)
+ if entity ~= false then
+ return entity
+ end
+ c = remove_latex_commands(c)
+ return c
+end
+
+function XMP:property_has_namespace(annotation_type)
+ annotation_type_t = annotation_type:split(':')
+
+ if #annotation_type_t > 1 then
+ annotation_type = annotation_type_t[2]
+ prefix = annotation_type_t[1]
+ else
+ annotation_type = annotation_type_t[1]
+ prefix = nil
+ end
+ return prefix, annotation_type
+end
+
+function XMP:set_title(title)
+ self.paper.title = title
+end
+
+function XMP:add_author(author)
+ table.insert(self.paper.authors, author)
+end
+
+function XMP:set_researchfield(researchfield)
+ self.paper.researchfield = researchfield
+end
+
+function XMP:add_annotation(contribution_ids, annotation_type, content, annotation_id)
+ local annotation = {}
+ -- check if a namespace is attached to the property specification
+ prefix, annotation_type = self:property_has_namespace(annotation_type)
+
+ annotation.content = content
+ annotation.id = annotation_id
+ annotation.type = self:escape_xml_tags(annotation_type)
+
+ -- take the prefix given, the prefix saved in the namespace dictionary or the default ns
+ annotation.prefix = prefix or self.property_ns[annotation.type] or 'orkg_property'
+
+ -- register the use of the property in text
+ SciKGTeX:register_property(annotation.type)
+
+ -- check if the annotation was numbered
+ if contribution_ids == '' then
+ contribution_ids = '<default_contribution>'
+ end
+ contributions_ids_t = contribution_ids:split(',%s+?')
+ -- add the annotations at the specified contribution
+ for i, contribution_id in ipairs(contributions_ids_t) do
+ -- add a new contribution if it has not been added yet
+ if self.paper.contributions[contribution_id] == nil then
+ self:add_contribution(contribution_id, 'contribution_'..contribution_id)
+ end
+ -- add the property annotation to the list of properties of a contribution
+ -- check if the same annotation already exists (in case of double evaluation of the LaTeX command for example)
+ already_there = false
+ for _, prop in pairs(self.paper.contributions[contribution_id].properties) do
+ if prop.content == annotation.content and prop.type == annotation.type then
+ already_there = true
+ break
+ end
+ end
+ if not already_there then
+ table.insert(self.paper.contributions[contribution_id].properties, annotation)
+ end
+ end
+end
+
+function XMP:add_namespace(abbr, uri)
+ self.namespaces[abbr] = uri
+end
+
+function XMP:generate_rdf_root()
+ ns_key_array = {}
+ for ns, uri in pairs(self.namespaces) do table.insert(ns_key_array, ns) end
+ root_string = [[<rdf:RDF ]]
+ table.sort(ns_key_array)
+ for i, key in ipairs(ns_key_array) do
+ root_string = root_string .. "\n xmlns:" .. key .. [[="]] .. self.namespaces[key] .. [["]]
+ end
+ root_string = root_string .. [[>]]
+ return root_string
+end
+
+function XMP:generate_xmp_string(lb_char)
+ lb_char = lb_char or "\n"
+ if lb_char == "r" then
+ lb_char = "\r"
+ end
+ output_string = ""
+ sorted_contributions = {}
+ for cb_id, contribution in pairs(XMP.paper.contributions) do
+ table.insert(sorted_contributions,cb_id)
+ end
+ table.sort(sorted_contributions)
+ self:add_line('<?xpacket begin="?" id="%s"?>',self.paper.id)
+ self:add_line(self.XMP_TOP)
+ self:add_line(self:generate_rdf_root())
+ --print(debug.traceback())
+ if self.paper then
+ self:add_line(
+ ' <rdf:Description rdf:about="https://www.orkg.org/orkg/paper/%s">',
+ self.paper.id
+ )
+ self:add_line(' <rdf:type rdf:resource="http://orkg.org/core#Paper"/>')
+ if self.paper.title ~= nil then
+ self:add_line(
+ ' <orkg:hasTitle>%s</orkg:hasTitle>',
+ self:process_content(self.paper.title)
+ )
+ end
+ for i, author in ipairs(self.paper.authors) do
+ self:add_line(
+ ' <orkg:hasAuthor>%s</orkg:hasAuthor>',
+ self:process_content(author))
+ end
+ if self.paper.researchfield ~= nil then
+ self:add_line(
+ ' <orkg:hasResearchField>%s</orkg:hasResearchField>',
+ self:process_content(self.paper.researchfield)
+ )
+ end
+ for i, cb_id in pairs(sorted_contributions) do
+ contribution = self.paper.contributions[cb_id]
+ self:add_line(' <orkg:hasResearchContribution>')
+ self:add_line(
+ ' <orkg:ResearchContribution rdf:about="https://www.orkg.org/orkg/paper/%s">',
+ self.paper.id .. "/" ..contribution.id
+ )
+ for j, property in ipairs(contribution.properties) do
+ self:add_line(
+ ' <%s:%s>%s</%s:%s>',
+ property.prefix,
+ property.type,
+ self:process_content(property.content),
+ property.prefix,
+ property.type
+ )
+ end
+ self:add_line(' </orkg:ResearchContribution>')
+ self:add_line(' </orkg:hasResearchContribution>')
+ end
+ self:add_line(' </rdf:Description>')
+ end
+ self:add_line(self.XMP_BOTTOM)
+ self:add_line(self.PACKET_END)
+
+ return table.concat(self.lines, lb_char)
+
+end
+
+function XMP:attach_metadata_pdfstream()
+ local xmp_string = self:generate_xmp_string()
+ local new_pdf = pdf.obj {
+ type = 'stream',
+ attr = '/Type/Metadata /Subtype/XML',
+ immediate = true,
+ compresslevel = 0,
+ string = xmp_string,
+ }
+ self.lines = {}
+ return new_pdf
+end
+
+function XMP:dump_metadata()
+ local xmp_string = self:generate_xmp_string()
+ local dir = get_output_dir() or '.'
+ f = io.open(dir .. '/' .. tex.jobname .. '.xmp_metadata.xml','w')
+ io.output(f)
+ io.write(xmp_string)
+ io.close(f)
+end
+
+luatexbase.add_to_callback('stop_run', function()
+ SciKGTeX:warn_unused_command()
+ if SciKGTeX.PRODUCE_XMP_FILE then
+ XMP:dump_metadata()
+ end
+end, 'at_end')
+
+-- Writing metadata packets
+luatexbase.add_to_callback('finish_pdffile', function()
+ if XMP.paper then
+ local metadata_obj = XMP:attach_metadata_pdfstream()
+ local catalog = pdf.getcatalog() or ''
+ pdf.setcatalog(catalog..string.format('/Metadata %s 0 R', metadata_obj))
+ --if SciKGTeX.PRODUCE_XMP_FILE then
+ -- XMP:dump_metadata()
+ --end
+ end
+end, 'finish')
+
+-- TODO: real identifier assigned
+
+-- get the id or generate UUID
+local output_dir = get_output_dir() or '.'
+local header = read_header_of_file(output_dir .. '/' .. tex.jobname .. '.xmp_metadata.xml')
+if header ~= nil then
+ id = extract_uuid_from_header(header)
+end
+if id == nil then
+ id = generate_UUID()
+ print('generate new id:', id)
+end
+XMP:add_paper_node(id)
+XMP:add_namespace("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#")
+XMP:add_namespace("rdfs","http://www.w3.org/2000/01/rdf-schema#")
+XMP:add_namespace("orkg","http://orkg.org/core#")
+XMP:add_namespace("orkg_property","http://orkg.org/property/")
+
+SciKGTeX.XMP = XMP
+return SciKGTeX \ No newline at end of file
diff --git a/macros/luatex/latex/scikgtex/scikgtex.sty b/macros/luatex/latex/scikgtex/scikgtex.sty
new file mode 100644
index 0000000000..9f94c11a1b
--- /dev/null
+++ b/macros/luatex/latex/scikgtex/scikgtex.sty
@@ -0,0 +1,149 @@
+%% ----------------------------------------------------------------
+%% scikgtex --- Scientific Knowledge Graph TeX (SciKgTeX) is a
+%% LuaLaTeX package which makes it possible to annotate specific
+%% research contributions in scientific documents. SciKGTeX will
+%% enrich the document by adding marked contributions to PDF
+%% metadata in a structured XMP format which can be picked up by
+%% Search Engines and Knowledge Graphs.
+%% More information on how to use the package can be found here:
+%% https://github.com/Christof93/SciKGTeX#readme
+%%
+%% Author: Christof Bless
+%% E-mail: christofbless@gmail.com
+%% Released under the MIT License
+%% See https://opensource.org/licenses/MIT
+%% ----------------------------------------------------------------
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{scikgtex}[2022/11/13 v2.1.1]
+
+\def\useignorespacesandallpars#1\ignorespaces\fi{%
+#1\fi\ignorespacesandallpars}
+
+\makeatletter
+\def\ignorespacesandallpars{%
+ \@ifnextchar\par
+ {\expandafter\ignorespacesandallpars\@gobble}%
+ {}%
+}
+\makeatother
+
+\RequirePackage{suffix}
+\RequirePackage{hyperref}
+
+\errorcontextlines=5
+
+\directlua {
+ SciKGTeX = require('scikgtex')
+}
+
+\newcommand{\addmetaproperty}[2][]{%
+ \directlua{%
+ local new_property = "\luaescapestring{\unexpanded{#2}}"%
+ local ns = "\luaescapestring{\unexpanded{#1}}"%
+ SciKGTeX:add_property(new_property, ns)%
+ }%
+ \ignorespaces
+}%
+
+\newcommand{\newpropertycommand}[2][]{%
+ \directlua{%
+ local new_property = "\luaescapestring{\unexpanded{#2}}"%
+ local ns = "\luaescapestring{\unexpanded{#1}}"%
+ SciKGTeX:make_new_command(new_property, ns)%
+ }%
+ \ignorespaces
+}%
+
+\newcommand{\metatitle}[2][]{%
+ \directlua{%
+ local value = "\luaescapestring{\unexpanded{#2}}"%
+ SciKGTeX.XMP:set_title(value)%
+ }%
+ #2%
+}%
+
+\WithSuffix\newcommand\metatitle*[2][]{%
+ \directlua{%
+ local value = "\luaescapestring{\unexpanded{#2}}"%
+ SciKGTeX.XMP:set_title(value)%
+ }%
+ \ignorespaces
+}%
+
+\newcommand{\metaauthor}[2][]{%
+ \directlua{%
+ local value = "\luaescapestring{\unexpanded{#2}}"%
+ SciKGTeX.XMP:add_author(value)%
+ }%
+ #2%
+}%
+
+\WithSuffix\newcommand\metaauthor*[2][]{%
+ \directlua{%
+ local value = "\luaescapestring{\unexpanded{#2}}"%
+ SciKGTeX.XMP:add_author(value)%
+ }%
+ \ignorespaces
+}%
+
+\newcommand{\researchfield}[2][]{%
+ \directlua{%
+ local value = "\luaescapestring{\unexpanded{#2}}"%
+ SciKGTeX.XMP:set_researchfield(value)%
+ }%
+ #2%
+}%
+
+\WithSuffix\newcommand\researchfield*[2][]{%
+ \directlua{%
+ local value = "\luaescapestring{\unexpanded{#2}}"%
+ SciKGTeX.XMP:set_researchfield(value)%
+ }%
+ \ignorespaces
+}%
+
+\newcommand{\uri}[2]{%
+ \directlua{%
+ local label = "\luaescapestring{\unexpanded{#2}}"%
+ local uri = "\luaescapestring{\unexpanded{#1}}"%
+ SciKGTeX:print_entity(uri, label)%
+ }%
+}%
+
+\newcommand{\contribution}[3][]{%
+ \directlua{%
+ local contrib_n = "\luaescapestring{\unexpanded{#1}}"%
+ local property = "\luaescapestring{\unexpanded{#2}}"%
+ local value = "\luaescapestring{\unexpanded{#3}}"%
+ SciKGTeX.XMP:add_annotation(contrib_n, property, value, 'annotation-id')%
+ }%
+ #3%
+}%
+
+\WithSuffix\newcommand\contribution*[3][]{%
+ \directlua{%
+ local contrib_n = "\luaescapestring{\unexpanded{#1}}"%
+ local property = "\luaescapestring{\unexpanded{#2}}"%
+ local value = "\luaescapestring{\unexpanded{#3}}"%
+ SciKGTeX.XMP:add_annotation(contrib_n, property, value, 'annotation-id')%
+ }%
+ \ignorespaces
+}%
+
+\newpropertycommand{researchproblem}
+\newpropertycommand{result}
+\newpropertycommand{method}
+\newpropertycommand{objective}
+\newpropertycommand{conclusion}
+
+%% Copyright (C) 2022 by Christof Bless <christofbless@gmail.com>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the MIT License.
+%%
+%% This work consists of the file scikgtex.sty
+%% and the lua file scikgtex.lua.
+%%
+%%
+%% End of file `scikgtex.sty'.