summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-11-17 03:01:35 +0000
committerNorbert Preining <norbert@preining.info>2022-11-17 03:01:35 +0000
commit3692808268baf9f2c56b28f61c266ef0efbb0fe6 (patch)
treec4f2221ea448c419130ee989be4cd0f00a0560c5 /macros/latex
parentfa9eff5f7febdf005dca510a70e57ffe92257c2c (diff)
CTAN sync 202211170301
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/eolang/eolang.dtx132
-rw-r--r--macros/latex/contrib/eolang/eolang.pdfbin1415294 -> 1448472 bytes
-rw-r--r--macros/latex/contrib/ffcode/DEPENDS.txt2
-rw-r--r--macros/latex/contrib/ffcode/ffcode.dtx138
-rw-r--r--macros/latex/contrib/ffcode/ffcode.pdfbin487461 -> 493615 bytes
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md8
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin617655 -> 617721 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-number.dtx8
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin666267 -> 666266 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx.tex2
11 files changed, 207 insertions, 85 deletions
diff --git a/macros/latex/contrib/eolang/eolang.dtx b/macros/latex/contrib/eolang/eolang.dtx
index 49a30283bb..74c346d52f 100644
--- a/macros/latex/contrib/eolang/eolang.dtx
+++ b/macros/latex/contrib/eolang/eolang.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{eolang}
%<*package>
-[2022-11-13 0.5.0 Formulas and Graphs for EO Programming Language]
+[2022-11-16 0.6.0 Formulas and Graphs for EO Programming Language]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -62,7 +62,7 @@
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage[runs=2,dtx]{docshots}
-\usepackage{eolang}
+\usepackage[nocomments]{eolang}
\usepackage{href-ul}
\PageIndex
\EnableCrossrefs
@@ -101,8 +101,8 @@
% \begin{document}
% \begin{phiquation*}
% a -> [[ % it's abstract!
-% ^ !-> $.b.^{^2}, 0-> TRUE,
-% b -> [[ c -> |fn|(56),
+% ^ !-> $.b.^{^2}, 0/t-> TRUE,
+% b -> [[ *-> |fn|(56),
% @ -> |hello|($),
% \Delta ..> 01-FE-C3 ]]]],\\
% x -> [[ \alpha_0 -> ? ]].
@@ -147,7 +147,14 @@
% (|\vDash|).
% \end{itemize}
-% Before any arrow you can put a number, which will be rendered as |\alpha| with an index.
+% Before any arrow you can put a number, which will be rendered as |\alpha| with an index, for example
+% |\phiq{0->x}| will render ``\phiq{0->x}''.
+% Instead of a number you can use asterix too.
+
+% You can append a slash and a title to the number of an attribute, such as |0/g->x|.
+% this will render as \phiq{0/g->x}. You can use fixed-width words too, for example
+% \verb=\phiq{0/|foo|->x}= will render as ``\phiq{0/|foo|->x}''. It's also possible
+% to use an asterix instead of a number, such that |\phiq{*/g->x}| renders as ``\phiq{*/g->x}''
% Numbers are automatically converted to fixed-width font, no need to always decorate them with vertical bars.
@@ -173,8 +180,7 @@
% \DescribeEnv{sodg}
% The environment |sodg| allows you to draw a \href{https://github.com/objectionary/sodg}{SODG} graph:
% \begin{docshot}
-% \documentclass{article}
-% \pagestyle{empty}
+% \documentclass{standalone}
% \usepackage{eolang}
% \begin{document}
% \begin{sodg}
@@ -208,7 +214,6 @@
% The following markers are supported for an edge:
% \begin{itemize}\setlength\itemsep{0em}
% \item ``|rho|'' places a backward snake arrow to the edge,
-% \item ``|rrho|'' places a reverse |rho|,
% \item ``|bend:<angle>|'' bend it right by the amount of ``|<angle>|,''
% \item ``|a:<txt>|'' attaches label ``|<txt>|'' to it,
% \item ``|pi|'' makes it dotted, with $\pi$ label.
@@ -343,7 +348,7 @@
% \begin{phiquation*}
% \dfrac{\begin{split}
% x->[[@->y, z->42,
-% 0->?, 1->42]]
+% 0/g->?, 1/|foo|->42]]
% \end{split}}{\begin{split}
% x->[[@->y, z->?, f ~> |pi|(
% 0->[[ \psi !-> |hello|(12) ]],
@@ -450,13 +455,13 @@
% \begin{sodg}
% v0
% v1 xy:v0,.7,1
-% v0->v1 a:x bend:-10
+% v0->v1 a:x bend:-10 rho
% v0+a xy:v0,3,0 \\ v0=>v0a
% v2a xy:v1a,-.8,1.3
% v1a->v2a a:e
% v0a+b xy:v0a,3,0 \\ v0a=>v0b
% v3b xy:v2b,-1,-1
-% v2b->v3b a:\psi
+% v2b->v3b a:\psi{} rho
% \end{sodg}
% \end{document}
% \end{docshot}
@@ -534,6 +539,7 @@
% Then, we process package options:
% \changes{0.1.0}{2022/10/26}{Parsing of package options introduced.}
+% \changes{0.6.0}{2022/11/14}{Package option \texttt{nocomments} added in order to enable comments suppression in temporary \texttt{.tex} files (may be pretty important for \texttt{.dtx} documents).}
% \begin{macrocode}
\RequirePackage{pgfopts}
\RequirePackage{ifluatex}
@@ -542,6 +548,7 @@
/eolang/.cd,
tmpdir/.store in=\eolang@tmpdir,
tmpdir/.default=_eolang\ifxetex-xe\else\ifluatex-lua\fi\fi,
+ nocomments/.store in=\eolang@nocomments,
tmpdir
}
\ProcessPgfOptions{/eolang}
@@ -580,6 +587,7 @@
% \changes{0.3.0}{2022/10/30}{New arrow added, that looks like \texttt{\char`\\leadsto}.}
% \changes{0.5.0}{2022/11/11}{Automated formatting of \texttt{TRUE} and \texttt{FALSE} added.}
% \changes{0.5.0}{2022/11/13}{A new syntax introduced for \texttt{\char`\\alpha}-attributes: \texttt{0->}.}
+% \changes{0.5.0}{2022/11/14}{It's possible to use double names for attributes, such as \texttt{0/g->}.}
% Then, we create a Perl script for |phiquation| processing using |VerbatimOut| from
% \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}:
% \begin{macrocode}
@@ -610,7 +618,10 @@ if ($env ne 'phiq') {
$tex =~ s/\n*(\\label\{[^\}]+\})\n*/\1/g;
}
$tex =~ s/&/\\sigma{}/g;
-$tex =~ s/(\s|^)([0-9]+)(->|\.\.>|~>|:=|!->)/\1\\alpha_{\2} \3/g;
+$tex =~ s/([^^_]|^)([0-9]+|\*)\/(\\?[a-z]+|\|[a-z]+\|)
+ (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\vert{}\3\\space{}\4/xg;
+$tex =~ s/([^^_]|^)([0-9]+|\*)
+ (->|\.\.>|~>|:=|!->)/\1\\alpha_{\2}\\space{}\3/xg;
if ($env ne 'phiq') {
$tex =~ s/\\begin\{split\}\n/\\begin{split}&/g;
$tex =~ s/\n\s*\\end\{split\}/\\end{split}/g;
@@ -630,7 +641,8 @@ $tex =~ s/\$/\\xi{}/g;
$tex =~ s/(?<!\{)\^/\\rho{}/g;
$tex =~ s/\[\[/\\llbracket\\mathrel{}/g;
$tex =~ s/\]\]/\\mathrel{}\\rrbracket{}/g;
-$tex =~ s/([\s,>\(])([0-9A-F]{2}(?:-[0-9A-F]{2})+|[0-9]+(?:\.[0-9]+)?)/\1|\2|/g;
+$tex =~ s/([\s,>\(])([0-9A-F]{2}(?:-[0-9A-F]{2})+|
+ [0-9]+(?:\.[0-9]+)?)/\1|\2|/xg;
$tex =~ s/TRUE/|TRUE|/g;
$tex =~ s/FALSE/|FALSE|/g;
$tex =~ s/\?/\\varnothing{}/g;
@@ -668,7 +680,7 @@ if ($env eq 'phiq') {
}
print '\end{', $env, '}';
}
-print '\endinput%';
+print '\endinput';
\end{VerbatimOut}
\message{eolang: File with Perl script
'\eolang@tmpdir/eolang-phi.pl' saved^^J}%
@@ -690,17 +702,18 @@ print '\endinput%';
\iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{
perl "\eolang@tmpdir/eolang-phi.pl"
'#1'
- "\eolang@tmpdir/\jobname/\hash.tex"}%
+ "\eolang@tmpdir/\jobname/\hash.tex"
+ \ifdefined\eolang@nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
\setcounter{FancyVerbLine}{\value{eolang@lineno}}%
}
\newenvironment{phiquation*}%
-{\VerbatimEnvironment%
+{\catcode`\|=12 \VerbatimEnvironment%
\setcounter{eolang@lineno}{\value{FancyVerbLine}}%
\begin{VerbatimOut}
{\eolang@tmpdir/\jobname/phiquation.tex}}
{\end{VerbatimOut}\eolang@process{equation*}}
\newenvironment{phiquation}%
-{\VerbatimEnvironment%
+{\catcode`\|=12 \VerbatimEnvironment%
\setcounter{eolang@lineno}{\value{FancyVerbLine}}%
\begin{VerbatimOut}
{\eolang@tmpdir/\jobname/phiquation.tex}}
@@ -722,7 +735,8 @@ print '\endinput%';
"\eolang@tmpdir/\jobname/\hash.tex"}%
\iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{
perl \eolang@tmpdir/eolang-phi.pl 'phiq'
- "\eolang@tmpdir/\jobname/\hash.tex"}%
+ "\eolang@tmpdir/\jobname/\hash.tex"
+ \ifdefined\eolang@nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
}\makeatother
% \end{macrocode}
% \end{macro}
@@ -738,6 +752,7 @@ print '\endinput%';
% \changes{0.5.0}{2022/11/09}{Now edges may have \texttt{break} attribute, to make them shorter.}
% \changes{0.5.0}{2022/11/10}{It is possible to use multiple ``equaltion sign'' symbols for transition arrows \texttt{=>}.}
% \changes{0.5.0}{2022/11/12}{It is possible to use tikz commands inside \texttt{sodg} environment.}
+% \changes{0.6.0}{2022/11/13}{The attribute \texttt{rrho} is retired, now \texttt{rho} works just fine in all situations.}
% Then, we create a Perl script for |sodg| graphs processing using |VerbatimOut| from
% \href{https://ctan.org/pkg/fancyvrb}{fancyvrb}:
% \begin{macrocode}
@@ -812,20 +827,22 @@ for (my $c = 0; $c < 0+@cmds; $c++) {
$opts{'a'} = '\pi';
}
}
+ if (exists $opts{'rho'} and not(exists $opts{'bend'})) {
+ $draw = $draw . '<MB:,phi-rho>';
+ }
$draw = $draw . ']';
my ($from, $to) = split (/->/, $head);
$draw = $draw . " (${from}) ";
if (exists $opts{'bend'}) {
- $draw = $draw . 'edge [<F:draw=none,><MF:bend right=' .
- num($opts{'bend'}) . '>]';
+ $draw = $draw . 'edge [<F:draw=none><MF:,bend right=' .
+ num($opts{'bend'}) . '>';
+ if (exists $opts{'rho'}) {
+ $draw = $draw . '<MB:,phi-rho>';
+ }
+ $draw = $draw . ']';
} else {
$draw = $draw . '--';
}
- if (exists $opts{'rho'} or exists $opts{'rrho'}) {
- $draw = $draw . ' pic[sloped,phi-rho]{parallel arrow={';
- $draw = $draw . '-' if not exists $opts{'rrho'};
- $draw = $draw . '0.3,-0.15}}';
- }
if (exists $opts{'a'}) {
my $a = $opts{'a'};
if (index($a, '$') == -1) {
@@ -992,7 +1009,7 @@ foreach my $c (@cmds) {
print '% ', $c, "\n";
}
print '% --- (' . (0+@cmds) . " lines)\n";
-print '\endinput%';
+print '\endinput';
\end{VerbatimOut}
\message{eolang: File with Perl script
'\eolang@tmpdir/eolang-sodg.pl' saved^^J}%
@@ -1019,8 +1036,11 @@ print '\endinput%';
\usetikzlibrary{snakes}
\usetikzlibrary{decorations}
\usetikzlibrary{decorations.pathmorphing}
+ \usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
+ \usetikzlibrary{math}
+ \usetikzlibrary{arrows.meta}
% \end{macrocode}
% \end{macro}
@@ -1045,8 +1065,59 @@ print '\endinput%';
\tikzstyle{phi-data} = [phi-thing,regular polygon,
regular polygon sides=8]
\tikzstyle{phi-empty} = [phi-object]
-\tikzstyle{phi-rho} = [draw,decorate,decoration={
- snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
+\tikzset{%
+ phi-rho/.style={
+ postaction={%
+ decoration={
+ show path construction,
+ curveto code={
+ \tikzmath{
+ coordinate \I, \F, \v;
+ \I = (\tikzinputsegmentfirst);
+ \F = (\tikzinputsegmentlast);
+ \v = ($(\I) -(\F)$);
+ real \d, \a, \r, \t;
+ \d = 0.8;
+ \t = atan2(\vy, \vx);
+ if \vx<0 then { \a = 90; } else { \a = -90; };
+ {
+ \draw[arrows={-latex}, decorate,
+ decoration={%
+ snake, amplitude=.4mm,
+ segment length=2mm,
+ post length=1mm
+ }]
+ ($(\F)!.5!(\I) +(\t: -\d em) +(\t +\a: 1ex)$)
+ -- ++(\t: 2*\d em);
+ };
+ }
+ },
+ lineto code={
+ \tikzmath{
+ coordinate \I, \F, \v;
+ \I = (\tikzinputsegmentfirst);
+ \F = (\tikzinputsegmentlast);
+ \v = ($(\I) -(\F)$);
+ real \d, \a, \r, \t;
+ \d = 0.8;
+ \t = atan2(\vy, \vx);
+ if \vx<0 then { \a = 90; } else { \a = -90; };
+ {
+ \draw[arrows={-latex}, decorate,
+ decoration={%
+ snake, amplitude=.4mm,
+ segment length=2mm,
+ post length=1mm}]
+ ($(\F)!.5!(\I) +(\t: -\d em) +(\t +\a: 1ex)$)
+ -- ++(\t: 2*\d em);
+ };
+ }
+ }
+ },
+ decorate
+ }
+ }
+}
\tikzstyle{phi-pi} = [draw,dotted]
\tikzstyle{phi-atom} = [phi-object,double]
\tikzstyle{phi-box} = [xshift=-5pt,yshift=3pt,draw,fill=white,
@@ -1064,7 +1135,7 @@ print '\endinput%';
% \href{https://tex.stackexchange.com/questions/661056}{here}:
% \begin{macrocode}
\makeatletter\newenvironment{sodg}%
-{\VerbatimEnvironment%
+{\catcode`\|=12 \VerbatimEnvironment%
\setcounter{eolang@lineno}{\value{FancyVerbLine}}%
\begin{VerbatimOut}
{\eolang@tmpdir/\jobname/sodg.tex}}
@@ -1075,7 +1146,8 @@ print '\endinput%';
"\eolang@tmpdir/\jobname/\hash.tex"}%
\iexec[trace,stdout=\eolang@tmpdir/\jobname/\hash-post.tex]{
perl "\eolang@tmpdir/eolang-sodg.pl"
- "\eolang@tmpdir/\jobname/\hash.tex"}%
+ "\eolang@tmpdir/\jobname/\hash.tex"
+ \ifdefined\eolang@nocomments | perl -pe 's/\%.*(\\n|$)//g'\fi}%
\setcounter{FancyVerbLine}{\value{eolang@lineno}}%
}\makeatother
% \end{macrocode}
diff --git a/macros/latex/contrib/eolang/eolang.pdf b/macros/latex/contrib/eolang/eolang.pdf
index 763d5bf07b..92ebceb0d5 100644
--- a/macros/latex/contrib/eolang/eolang.pdf
+++ b/macros/latex/contrib/eolang/eolang.pdf
Binary files differ
diff --git a/macros/latex/contrib/ffcode/DEPENDS.txt b/macros/latex/contrib/ffcode/DEPENDS.txt
index 935840f850..d55ae167dd 100644
--- a/macros/latex/contrib/ffcode/DEPENDS.txt
+++ b/macros/latex/contrib/ffcode/DEPENDS.txt
@@ -1,3 +1,3 @@
-hard xkeyval
+hard pgfopts
hard minted
hard tcolorbox
diff --git a/macros/latex/contrib/ffcode/ffcode.dtx b/macros/latex/contrib/ffcode/ffcode.dtx
index e3c430c8de..e50bb899eb 100644
--- a/macros/latex/contrib/ffcode/ffcode.dtx
+++ b/macros/latex/contrib/ffcode/ffcode.dtx
@@ -50,7 +50,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{ffcode}
%<*package>
-[2022-10-30 0.5.1 Fixed Font Code]
+[2022-11-16 0.6.0 Fixed Font Code]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -93,8 +93,7 @@
% \usepackage{ffcode}
% \pagestyle{empty}
% \begin{document}
-% The function \ff{fibo()}
-% is recursive:
+% The function |fibo()| is recursive:
% \begin{ffcode}
% int fibo(int n) {
% if (n < 2) {
@@ -103,8 +102,8 @@
% return fibo(n-1)+fibo(n-2);
% }
% \end{ffcode}
-% The line no.~\ref{ln:ret}
-% terminates it.
+% Line no.~\ref{ln:ret} returns \ff{n}
+% and terminates it.
% \end{document}
% \end{docshot}
@@ -141,10 +140,11 @@
% A pair of vertical lines decorate a TeX command inside the snippet.
% If you want to print a single vertical line, use this:
-% \ff{|\char`\\vert|}.
+% ``\verb+|\char`\\vert|+''.
% The command |\ff| behaves differently in math mode --- it doesn't
% add gray frames:
+% \docshotOptions{firstline=6,lastline=8}
% \begin{docshot}
% \documentclass{article}
% \usepackage{ffcode}
@@ -152,7 +152,7 @@
% \pagestyle{empty}
% \begin{document}
% \begin{equation*}
-% x = \int_\ff{home}^N f(x).
+% x = \int_{|home|}^N f(x).
% \end{equation*}
% \end{document}
% \end{docshot}
@@ -162,14 +162,14 @@
% You can highlight some lines in your |ffcode| environment,
% or can use any other additional configuration parameters from
% |minted| package:
+% \docshotOptions{firstline=6,lastline=13}
% \begin{docshot}
% \documentclass{article}
% \usepackage[paperwidth=3in]{geometry}
% \usepackage{ffcode}
% \pagestyle{empty}
% \begin{document}
-% \begin{ffcode*}
-% {highlightlines={1,4-5}}
+% \begin{ffcode*}{highlightlines={1,4-5}}
% while (true) {
% print("Hello!")
% print("Enter your name:")
@@ -189,28 +189,35 @@
% \section{Implementation}
% \changes{v0.1.0}{2021/06/10}{Initial version}
-% First, we parse package options:
+% First, we parse package options with the help of
+% \href{https://ctan.org/pkg/pgfopts}{pgfopts} package:
+% \changes{v0.2.0}{2021/06/13}{Package options \texttt{nonumbers} and \texttt{noframes} added.}
+% \changes{v0.3.0}{2021/09/07}{Package option \texttt{nocn} added.}
+% \changes{v0.4.0}{2022/01/09}{Package option \texttt{nobars} added.}
+% \changes{v0.6.0}{2021/11/14}{We use \texttt{pgfopts} instead of \texttt{xkeyval}.}
+% \changes{v0.6.0}{2021/11/14}{Package option \texttt{novert} added, to disable redefinition of vertical bar.}
% \begin{macrocode}
-\RequirePackage{xkeyval}
-\makeatletter
-\DeclareOptionX{nopygments}{\PassOptionsToPackage{draft=true}{minted}}
-\newif\ifff@noframes
-\DeclareOptionX{noframes}{\ff@noframestrue}
-% \changes{v0.4.0}{2022/01/09}{Package option "nobars" added.}
-\newif\ifff@nobars
-\DeclareOptionX{nobars}{\ff@nobarstrue}
-% \changes{v0.2.0}{2021/06/13}{Package options "nonumbers"
-% and "noframes" added.}
-\newif\ifff@nonumbers
-\DeclareOptionX{nonumbers}{\ff@nonumberstrue}
-% \changes{v0.3.0}{2021/09/07}{Package option "nocn" added.}
-\newif\ifff@nocn
-\DeclareOptionX{nocn}{\ff@nocntrue}
-\ProcessOptionsX\relax
-\makeatother
+\RequirePackage{pgfopts}
+\pgfkeys{
+ /ff/.cd,
+ nopygments/.store in=\ff@nopygments,
+ noframes/.store in=\ff@noframes,
+ nonumbers/.store in=\ff@nonumbers,
+ nobars/.store in=\ff@nobars,
+ novert/.store in=\ff@novert,
+ nocn/.store in=\ff@nocn,
+}
+\ProcessPgfOptions{/ff}
% \end{macrocode}
-% Then, we configure |minted| package:
+% Then, we disable pygments for \href{https://ctan.org/pkg/minted}{minted}, if necessary:
+% \begin{macrocode}
+\makeatletter\ifdefined\ff@nopygments
+ \PassOptionsToPackage{draft=true}{minted}
+\fi\makeatother
+% \end{macrocode}
+
+% Then, we configure \href{https://ctan.org/pkg/minted}{minted} package:
% \begin{macrocode}
\RequirePackage{minted}
\setminted{breaklines}
@@ -222,8 +229,8 @@
% \begin{macro}{ffcode}
% Then, we define |ffcode| environment:
% \begin{macrocode}
-\makeatletter\ifff@nonumbers
- \ifff@nobars
+\makeatletter\ifdefined\ff@nonumbers
+ \ifdefined\ff@nobars
\newminted[ffcode]{text}{}
\else
\newminted[ffcode]{text}{framesep=6pt,
@@ -232,8 +239,8 @@
\else
\renewcommand{\theFancyVerbLine}{\textcolor{gray}%
{\tiny\oldstylenums{\ttfamily\arabic{FancyVerbLine}}}}
- \ifff@nocn
- \ifff@nobars
+ \ifdefined\ff@nocn
+ \ifdefined\ff@nobars
\newminted[ffcode]{text}{
linenos,numbersep=2pt
}
@@ -244,7 +251,7 @@
}
\fi
\else
- \ifff@nobars
+ \ifdefined\ff@nobars
\newminted[ffcode]{text}{
firstnumber=last,linenos,numbersep=2pt
}
@@ -260,12 +267,11 @@
% \end{macro}
% \begin{macro}{\ff@print}
-% Then, we define supplementary commands |\ff@print| and |\ff@printx|:
-% \changes{v0.5.1}{2022/10/30}{Now, the command "ff" ignores italic and bold and always prints "texttt" as it should be.}
+% Then, we define a supplementary macro |\ff@print|:
+% \changes{v0.5.1}{2022/10/30}{Now, the command \texttt{ff} ignores italic and bold and always prints \texttt{\char`\\texttt} as it should be.}
% \begin{macrocode}
\makeatletter
-\newcommand\ff@print{\begingroup\obeyspaces\ff@printx}
-\newcommand\ff@printx[1]{\textnormal{\texttt{#1}}\endgroup}
+\newcommand\ff@print[1]{\textnormal{\texttt{#1}}}
\makeatother
% \end{macrocode}
% \end{macro}
@@ -279,22 +285,60 @@
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\ff}
-% Finally, we define |\ff| command:
+% \begin{macro}{tcolorbox}
+% Then, we use \href{https://ctan.org/pkg/tcolorbox}{tcolorbox} to define |\ff@box|
+% command for a gray box around verbatim text block:
% \begin{macrocode}
-\makeatletter\ifff@noframes
- \newcommand\ff[1]{\ff@rule\ff@print{#1}}
-\else
+\makeatletter
+\ifdefined\ff@noframes\else
\RequirePackage{tcolorbox}
- \newtcbox\ff@box{nobeforeafter,colframe=gray!80!white,
+ \newtcbox\ff@box{nobeforeafter,colframe=gray!80!white,
colback=gray!5!white,boxrule=0.1pt,arc=1pt,
boxsep=1.2pt,left=0.5pt,right=0.5pt,top=0.2pt,bottom=0.2pt,
tcbox raise base}
- \newcommand\ff[1]{\relax\ifmmode%
- {\ff@rule\ff@print{#1}}%
+\fi
+\makeatother
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\ff@x}
+% Then, we define |\ff@x| internal command for printing a piece of fixed-width-font text:
+% \begin{macrocode}
+\makeatletter
+\NewDocumentCommand\ff@x{v}{%
+ \ifdefined\ff@noframes%
+ \ff@rule\ff@print{#1}%
\else%
- {\ff@box{\ff@rule\ff@print{#1}}}%
- \fi}
+ \relax\ifmmode%
+ \ff@rule\ff@print{#1}%
+ \else%
+ \ff@box{\ff@rule\ff@print{#1}}%
+ \fi%
+ \fi%
+}
+\makeatother
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\ff}
+% Then, we define |\ff| macro:
+% \begin{macrocode}
+\makeatletter
+\def\ff{\ff@x}
+\makeatother
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{novert}
+% Finally, we let vertical bars work similar to |\ff|, as suggested
+% \href{https://tex.stackexchange.com/a/665105/1449}{here}
+% and \href{https://tex.stackexchange.com/a/665303/1449}{here}
+% (unless |novert| package option is used):
+% \begin{macrocode}
+\makeatletter\ifdefined\ff@novert\else
+ \catcode`\|\active
+ \AtBeginDocument{\catcode`\|\active\protected\def|{\ff@x|}}
+ \catcode`\| 12 %
\fi\makeatother
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf
index a24f23e4b0..f87101ad3f 100644
--- a/macros/latex/contrib/ffcode/ffcode.pdf
+++ b/macros/latex/contrib/ffcode/ffcode.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index d1d7b1c61f..e26a8b74c1 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,11 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.1.10] - 2022-11-16
+
+### Fixed
+- Rounding to uncertainty in some cases (see issue
+ [\#627](https://github.com/josephwright/siunitx/issues/627))
## [v3.1.9] - 2022-10-23
### Added
@@ -1826,7 +1831,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.9...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.1.10...HEAD
+[v3.1.10]: https://github.com/josephwright/siunitx/compare/v3.1.9...v3.1.10
[v3.1.9]: https://github.com/josephwright/siunitx/compare/v3.1.8...v3.1.9
[v3.1.8]: https://github.com/josephwright/siunitx/compare/v3.1.7...v3.1.8
[v3.1.7]: https://github.com/josephwright/siunitx/compare/v3.1.6...v3.1.7
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index 7bfe53e8a8..a57ecf29bc 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-number.dtx b/macros/latex/contrib/siunitx/siunitx-number.dtx
index 1d11f909f0..b88e369c08 100644
--- a/macros/latex/contrib/siunitx/siunitx-number.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-number.dtx
@@ -3168,9 +3168,9 @@
{
\use:e
{
- \exp_not:N \@@_round_uncertainty:nnnnn
+ \exp_not:N \@@_round_uncertainty:nnnnnn
\@@_round:nnn {#1} { } {#4}
- {#2} {#3} {#1}
+ {#2} {#3} {#1} {#4}
}
}
% \end{macrocode}
@@ -3179,7 +3179,7 @@
% the uncertainty rounded up, which also links to additional treatment. We
% therefore split paths here.
% \begin{macrocode}
-\cs_new:Npn \@@_round_uncertainty:nnnnn #1#2#3#4#5
+\cs_new:Npn \@@_round_uncertainty:nnnnnn #1#2#3#4#5#6
{
\tl_if_blank:nTF {#1}
{
@@ -3191,7 +3191,7 @@
{
\tl_if_blank:nTF {#4}
{ #5 }
- { 0 - ( \tl_count:n {#4} - \tl_count:n {#2} - #5 + 1 ) }
+ { ( \tl_count:n {#6} - \tl_count:n {#4} ) - \tl_count:n {#2} }
}
{ 0 }
}
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index b39fdd662e..d02beaf573 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -121,7 +121,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2022-10-23} {3.1.9}
+\ProvidesExplPackage {siunitx} {2022-11-16} {3.1.10}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 92efe61c67..9f1a21c58f 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx.tex b/macros/latex/contrib/siunitx/siunitx.tex
index 1c4b9ab910..a92d0ee0db 100644
--- a/macros/latex/contrib/siunitx/siunitx.tex
+++ b/macros/latex/contrib/siunitx/siunitx.tex
@@ -318,7 +318,7 @@ optional argument, \meta{options}, and one mandatory one, \meta{number}. The
contents of \meta{number} are automatically formatted. The formatter removes
both \enquote{soft} (\verb*| |) and \enquote{hard} spaces (|\,| and |~|),
automatically identifies exponents (as standard marked using |e|, |E|, |d| or
-|D|) and adds the appropriate spacing of large numbers.If required,
+|D|) and adds the appropriate spacing of large numbers. If required,
a leading zero is added before a decimal marker: both |.|
and "," are recognised as decimal markers.
\begin{LaTeXdemo}