summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-11-01 03:02:20 +0000
committerNorbert Preining <norbert@preining.info>2020-11-01 03:02:20 +0000
commitf3fbfce65a7de58853550aedf1b6e6acd5c29a1e (patch)
tree8f04a2559eeb450628ea2ab3eaa5dae4c0ce88cf /macros/latex/contrib
parent246102ab63f099b158dd29e1d911471223cdb207 (diff)
CTAN sync 202011010302
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/bytefield/bytefield.dtx243
-rw-r--r--macros/latex/contrib/bytefield/bytefield.pdfbin487156 -> 583061 bytes
-rw-r--r--macros/latex/contrib/menukeys/README9
-rw-r--r--macros/latex/contrib/menukeys/menukeys.dtx286
-rw-r--r--macros/latex/contrib/menukeys/menukeys.ins26
-rw-r--r--macros/latex/contrib/menukeys/menukeys.pdfbin567795 -> 585677 bytes
6 files changed, 402 insertions, 162 deletions
diff --git a/macros/latex/contrib/bytefield/bytefield.dtx b/macros/latex/contrib/bytefield/bytefield.dtx
index 4354a50e78..8af3e52bbf 100644
--- a/macros/latex/contrib/bytefield/bytefield.dtx
+++ b/macros/latex/contrib/bytefield/bytefield.dtx
@@ -22,7 +22,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{bytefield}
%<*package>
- [2020/10/22 v2.5 Network protocol diagrams]
+ [2020/10/31 v2.6 Network protocol diagrams]
%</package>
%
%<*driver>
@@ -68,7 +68,7 @@
%</driver>
% \fi
%
-% \CheckSum{1161}
+% \CheckSum{1194}
%
% \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
@@ -108,6 +108,11 @@
% \changes{v2.5}{2020/10/22}{Accept a new \protect\optname{perword}
% option to execute a macro for each word in a word box. This addresses
% a feature request by Victor Toni}
+% \changes{v2.6}{2020/10/29}{Accept new \protect\optname{curlystyle},
+% \protect\optname{leftcurlystyle}, and
+% \protect\optname{rightcurlystyle} options to control the styling
+% (e.g.,~color) of curly braces. This addresses a feature request by
+% Victor Toni}
%
% \GetFileInfo{bytefield.dtx}
%
@@ -607,12 +612,12 @@
%
% \begin{decl}
% \SpecialEnvIndex{rightwordgroup}
-% |\begin{rightwordgroup}| \marg{text} \\
+% |\begin{rightwordgroup}| \oarg{options} \marg{text} \\
% \meta{rows of bit boxes and word boxes} \\
% |\end{rightwordgroup}| \\
% \\
% \SpecialEnvIndex{leftwordgroup}
-% |\begin{leftwordgroup}| \marg{text} \\
+% |\begin{leftwordgroup}| \oarg{options} \marg{text} \\
% \meta{rows of bit boxes and word boxes} \\
% |\end{leftwordgroup}|
% \end{decl}
@@ -627,6 +632,12 @@
% |\end{|\meta{side}|wordgroup}| must lie right \emph{before} the end of
% the row (i.e.,~right before a ``|\\|'').
%
+% The optional argument is a comma-separated list of
+% \meta{key}=\meta{value} pairs from the set described in
+% Section~\ref{sec:options}. In practice, only \optname{curlystyle},
+% \optname{leftcurlystyle}, and \optname{rightcurlystyle}, make sense
+% within the context of a |\begin{|\meta{side}|wordgroup}|.
+%
% Unlike other \LaTeX\ environments, |rightwordgroup| and
% |leftwordgroup| do not have to nest properly with each other.
% However, they cannot overlap themselves. In other words,
@@ -751,7 +762,7 @@
% A document author can customize many of the \pkgname{bytefield}
% package's figure-formatting parameters, either globally or on a
% per-figure basis. The parameters described below can be specified in
-% five locations:
+% six locations:
%
% \begin{itemize}
% \item as package options (i.e.,~in the
@@ -769,6 +780,10 @@
% that particular header. (Only a few parameters are meaningful in
% this context.)
%
+% \item as the optional argument to a |\begin{leftwordgroup}| or
+% |\begin{rightwordgroup}|, which affects only that particular word
+% group. (Only a few parameters are meaningful in this context.)
+%
% \item as the second optional argument to a \cs{bitbox}, \cs{wordbox},
% or \cs{bitboxes}, which affects only that particular box. (Only a
% few parameters are meaningful in this context.)
@@ -799,7 +814,7 @@
%
% As a special case, if \optname{bitwidth} is set to the word
% ``|auto|'', it will be set to the width of ``|99i|'' in the current
-% bit-number formatting (cf.~\optname{bitformatting} below). This
+% bit-number formatting (see \optname{bitformatting} below). This
% feature provides a convenient way to adjust the bit width after a
% formatting change.
%
@@ -1081,6 +1096,55 @@
% different heights.
%
% \begin{decl}
+% \optname{leftcurlystyle} = \meta{command} \\
+% \optname{rightcurlystyle} = \meta{command} \\
+% \optname{curlystyle} = \meta{command}
+% \end{decl}
+%
+% Provide a macro that will be invoked before the code that draws left,
+% right, or both curly braces. The macro must accept either zero or one
+% argument. It can be used, for example, to color the curly brace:
+%
+% \begin{verbatim}
+% \begin{bytefield}[curlystyle=\color{blue}]{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{verbatim}
+%
+% \begin{bffigure}
+% \begin{bytefield}[curlystyle=\color{blue}]{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{bffigure}
+%
+% \noindent
+% or
+%
+% \begin{verbatim}
+% \begin{bytefield}{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}[curlystyle=\color{blue}]{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{verbatim}
+%
+% \begin{bffigure}
+% \begin{bytefield}{16}
+% \bitheader{0-15} \\
+% \begin{rightwordgroup}[curlystyle=\color{blue}]{Sign-extended}
+% \bitbox{4}{Tag} & \bitbox{12}{Data}
+% \end{rightwordgroup} \\
+% \end{bytefield}
+% \end{bffigure}
+%
+% \begin{decl}
% \optname{lsb} = \meta{integer}
% \end{decl}
%
@@ -2052,7 +2116,7 @@
% \changes{v2.3}{2015/10/28}{Rewrote the macro based on discussions with
% David Carlisle to avoid producing ``\texttt{No room for a new
% \string\string\string\dimen}'' errors in newer versions of $\varepsilon$-\TeX\
-% (cf.~\url{http://tex.stackexchange.com/q/275042})}
+% (see \url{http://tex.stackexchange.com/q/275042})}
% \begin{macrocode}
\AtBeginDocument{%
\expandafter\ifx\csname e@alloc\endcsname\relax
@@ -2160,6 +2224,7 @@
% \begin{macrocode}
\vbox\bgroup\ialign\bgroup##\amp##\amp##\cr\amp
}{%
+ \unskip
\amp\show@wordlabelr\cr\egroup\egroup
\end{lrbox}%
\usebox{\entire@bytefield@picture}%
@@ -2581,7 +2646,7 @@
% \begin{macrocode}
\def\bf@bitboxes@star@i#1#2{%
\def\bf@call@box@arg@iv{#1}%
- \def\bf@bitboxes@arg@ii{#2}%
+ \def\bf@bitboxes@arg@ii{#2}%
\ifx\bf@bitboxes@arg@ii\bf@relax
\bf@bitbox
\let\next=\relax
@@ -2978,6 +3043,17 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\bf@leftcurlystyle}
+% \begin{macro}{\bf@rightcurlystyle}
+% Define the default formatting for left and right curly braces as ``do
+% nothing special''.
+% \begin{macrocode}
+\let\bf@leftcurlystyle=\relax
+\let\bf@rightcurlystyle=\relax
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\curly@box}
% Define a box in which to temporarily store formatted curly braces.
% \changes{v1.2}{2004/06/14}{Bug fix: Defined \cs{curly@box} globally
@@ -3009,11 +3085,13 @@
\setlength{\curly@shift}{\half@curly@height + 0.5\curly@shift}%
\global\sbox{#1}{\raisebox{\curly@shift}{%
$\xdef\old@axis{\the\fontdimen22\textfont2}$%
- $\fontdimen22\textfont2=0pt%
- \left.
- \vrule height\half@curly@height
- width 0pt
- depth\half@curly@height\right\bf@rightcurly$%
+ \bf@rightcurlystyle{%
+ $\fontdimen22\textfont2=0pt%
+ \left.
+ \vrule height\half@curly@height
+ width 0pt
+ depth\half@curly@height\right\bf@rightcurly$%
+ }%
$\fontdimen22\textfont2=\old@axis$}}%
\endgroup
}
@@ -3042,11 +3120,13 @@
\setlength{\curly@shift}{\half@curly@height + 0.5\curly@shift}%
\global\sbox{#1}{\raisebox{\curly@shift}{%
$\xdef\old@axis{\the\fontdimen22\textfont2}$%
- $\fontdimen22\textfont2=0pt%
- \left\bf@leftcurly
- \vrule height\half@curly@height
- width 0pt
- depth\half@curly@height\right.$%
+ \bf@leftcurlystyle{%
+ $\fontdimen22\textfont2=0pt%
+ \left\bf@leftcurly
+ \vrule height\half@curly@height
+ width 0pt
+ depth\half@curly@height\right.$%
+ }%
$\fontdimen22\textfont2=\old@axis$}}%
\endgroup
}
@@ -3081,12 +3161,17 @@
%
% \begin{environment}{rightwordgroup}
% \usermacro
-% Label the words defined between |\begin{rightwordgroup}| and |\end{rightwordgroup}|
-% on the right side of the bit field.
-% The argument is the text of the label. The label is typeset to the
-% right of a large curly brace, which groups the words together.
-% \begin{macrocode}
-\newenvironment{rightwordgroup}[1]{%
+% Label the words defined between |\begin{rightwordgroup}| and
+% |\end{rightwordgroup}| on the right side of the bit field. The first,
+% optional, argument is a list of parameters, as defined in
+% Section~\ref{sec:options}. The second, mandatory, argument is the
+% text of the label. The label is typeset to the right of a large curly
+% brace, which groups the words together.
+% \changes{v2.6}{2020/10/29}{Suppress spaces following the
+% \protect\cs{end}\protect\texttt{\{rightwordgroup\}}}
+% \changes{v2.6}{2020/10/31}{Accept key/value options}
+% \begin{macrocode}
+\newenvironment{rightwordgroup}[2][]{%
% \end{macrocode}
% We begin by ending the group that |\begin{rightwordgroup}| created. This
% lets the |rightwordgroup| environment span rows (because we're technically
@@ -3095,21 +3180,25 @@
\endgroup
% \end{macrocode}
% \begin{macro}{\wordlabelr@start}
+% \begin{macro}{\wordlabelr@params}
% \begin{macro}{\wordlabelr@text}
-% |\begin{rightwordgroup}| merely stores the starting height in |\wordlabelr@start|
-% and the user-supplied text in |\wordlabelr@text|. |\end{rightwordgroup}|
-% does most of the work.
+% |\begin{rightwordgroup}| merely stores the starting height in
+% |\wordlabelr@start| and the user-supplied text in |\wordlabelr@text|.
+% |\end{rightwordgroup}| does most of the work.
% \begin{macrocode}
\global\wordlabelr@start=\bytefield@height
- \gdef\wordlabelr@text{#1}%
+ \gdef\wordlabelr@params{#1}%
+ \gdef\wordlabelr@text{#2}%
\ignorespaces
}{%
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
% \begin{macro}{\wordlabelr@end}
-% Because we already ended the group that |\begin{rightwordgroup}| created
-% we now have to begin a group for |\end{rightwordgroup}| to end.
+% Because we already ended the group that |\begin{rightwordgroup}|
+% created we now have to begin a group for |\end{rightwordgroup}| to
+% end.
% \begin{macrocode}
\begingroup
\global\wordlabelr@end=\bytefield@height
@@ -3125,23 +3214,32 @@
% \begin{macrocode}
\gdef\show@wordlabelr{%
\sbox{\word@label@box}{%
- \begin{tabular}[b]{@{}l@{}}\wordlabelr@text\end{tabular}}%
+ \begin{tabular}[b]{@{}l@{}}\wordlabelr@text\end{tabular}%
+ }%
\settowidth{\label@box@width}{\usebox{\word@label@box}}%
\setlength{\label@box@height}{\wordlabelr@end-\wordlabelr@start}%
+% \end{macrocode}
+% Evaluate any parameters passed to |\begin{rightwordgroup}| right
+% before we render the curly brace.
+% \begin{macrocode}
+ \expandafter\bf@bytefieldsetup\expandafter{\wordlabelr@params}%
\store@rcurly{\curly@box}{\label@box@height}%
\bf@newdimen\total@box@width
\setlength{\total@box@width}{%
\bf@rightcurlyspace +
\widthof{\usebox{\curly@box}} +
\bf@rightlabelspace +
- \label@box@width}%
+ \label@box@width
+ }%
\begin{picture}(\strip@pt\total@box@width,0)
\put(0,0){%
\hspace*{\bf@rightcurlyspace}%
\usebox{\curly@box}%
\hspace*{\bf@rightlabelspace}%
\makebox(\strip@pt\label@box@width,\strip@pt\label@box@height){%
- \usebox{\word@label@box}}}
+ \usebox{\word@label@box}%
+ }%
+ }%
\end{picture}%
% \end{macrocode}
% The last thing |\show@wordlabelr| does is redefine itself back to a no-op.
@@ -3156,7 +3254,7 @@
% |\begin|.
% \begin{macrocode}
\def\@currenvir{rightwordgroup}%
- \ignorespaces
+ \ignorespacesafterend
}
% \end{macrocode}
% \end{macro}
@@ -3220,25 +3318,28 @@
% there will eventually be enough space to accomodate the label, we know
% that the label won't overlap the bit field or extend beyond the bit-field
% boundaries.
+% \changes{v2.6}{2020/10/29}{Suppress spaces following the
+% \protect\cs{end}\protect\texttt{\{leftwordgroup\}}}
+% \changes{v2.6}{2020/10/31}{Accept key/value options}
% \begin{macrocode}
-\newenvironment{leftwordgroup}[1]{%
-% \end{macrocode}
-% We begin by ending the group that |\begin{rightwordgroup}| created. This
-% lets the |leftwordgroup| environment span rows (because we're technically
-% no longer within the environment).
-% \begin{macrocode}
- \endgroup
+\newenvironment{leftwordgroup}[2][]{%
% \end{macrocode}
% \begin{macro}{\wordlabell@start}
+% \begin{macro}{\wordlabell@params}
% \begin{macro}{\wordlabell@text}
-% We store the starting height and label text, which are needed by the
-% |\end{leftwordgroup}|.
+% We store the starting height, optional parameters (see
+% Section~\ref{sec:options}), and label text, all of which are needed by
+% the |\end{leftwordgroup}|. We immediately parse the parameters
+% because they may affect the \cs{store@lcurly} invocation below.
% \begin{macrocode}
\global\wordlabell@start=\bytefield@height
- \gdef\wordlabell@text{#1}%
+ \gdef\wordlabell@params{#1}%
+ \gdef\wordlabell@text{#2}%
+ \bf@bytefieldsetup{#1}%
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
% Next, we typeset a draft version of the label into |\word@label@box|,
% which we measure (into |\total@lbox@width|) and then discard.
% We can't typeset the final version of the label until we reach the
@@ -3269,7 +3370,14 @@
% \begin{macrocode}
\gdef\make@lspace{%
\hspace*{\total@lbox@width}%
- \gdef\make@lspace{}}%
+ \gdef\make@lspace{}%
+ }%
+% \end{macrocode}
+% We now end the group that |\begin{rightwordgroup}| created. This lets
+% the |leftwordgroup| environment span rows (because we're technically
+% no longer within the environment).
+% \begin{macrocode}
+ \endgroup
\ignorespaces
}{%
% \end{macrocode}
@@ -3288,6 +3396,10 @@
% that we typeset the entire label in the second column, but in a $0
% \times 0$ |picture| environment and with a negative horizontal offset
% (|\starting@point|), thereby making it overlap the first column.
+% Before typesetting the curly brace we re-parse the optional parameters
+% because we're in a new group from the one in which we parsed them
+% before, and the parameters can affect the second \cs{store@lcurly}
+% invocation just they could have affected the first.
% \begin{macrocode}
\global\wordlabell@end=\bytefield@height
\bf@newdimen\starting@point
@@ -3297,6 +3409,7 @@
\begin{tabular}[b]{@{}l@{}}\wordlabell@text\end{tabular}}%
\settowidth{\label@box@width}{\usebox{\word@label@box}}%
\setlength{\label@box@height}{\wordlabell@end-\wordlabell@start}%
+ \expandafter\bf@bytefieldsetup\expandafter{\wordlabell@params}%
\store@lcurly{\curly@box}{\label@box@height}%
\begin{picture}(0,0)
\put(\strip@pt\starting@point,0){%
@@ -3314,7 +3427,7 @@
% |\begin|.
% \begin{macrocode}
\def\@currenvir{leftwordgroup}%
- \ignorespaces
+ \ignorespacesafterend
}
% \end{macrocode}
% \end{macro}
@@ -3530,6 +3643,8 @@
%
% \begin{macro}{\KV@bytefield@leftcurly}
% \begin{macro}{\KV@bytefield@rightcurly}
+% \begin{macro}{\bf@leftcurly}
+% \begin{macro}{\bf@rightcurly}
% Specify the symbol to use for bracketing a left or right word group.
% This must be an extensible math delimiter (i.e.,~something that can
% immediately follow |\left| or |\right| in math mode).
@@ -3539,10 +3654,14 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV@bytefield@leftcurlyspace}
% \begin{macro}{\KV@bytefield@rightcurlyspace}
% \begin{macro}{\KV@bytefield@curlyspace}
+% \begin{macro}{\bf@leftcurlyspace}
+% \begin{macro}{\bf@rightcurlyspace}
% Specify the amount of space between the bit fields in a word group and
% the adjacent left or right curly brace. The \optname{curlyspace}
% option is a shortcut that puts the same space before both left and
@@ -3558,10 +3677,14 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV@bytefield@leftlabelspace}
% \begin{macro}{\KV@bytefield@rightlabelspace}
% \begin{macro}{\KV@bytefield@labelspace}
+% \begin{macro}{\bf@leftlabelspace}
+% \begin{macro}{\bf@rightlabelspace}
% Specify the amount of space between a left or right word group's curly
% brace and the associated label text. The |labelspace| option is a
% shortcut that puts the same space after both left and right curly
@@ -3577,10 +3700,14 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV@bytefield@leftcurlyshrinkage}
% \begin{macro}{\KV@bytefield@rightcurlyshrinkage}
% \begin{macro}{\KV@bytefield@curlyshrinkage}
+% \begin{macro}{\bf@leftcurlyshrinkage}
+% \begin{macro}{\bf@rightcurlyshrinkage}
% Specify the number of points by which to reduce the height of a curly
% brace (left, right, or both) so its ends don't overlap whatever's
% above or below it.
@@ -3595,6 +3722,30 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\KV@bytefield@leftcurlystyle}
+% \begin{macro}{\KV@bytefield@rightcurlystyle}
+% \begin{macro}{\KV@bytefieldcurlystyle}
+% \begin{macro}{\bf@leftcurlystyle}
+% \begin{macro}{\bf@rightcurlystyle}
+% Specify a macro that takes either zero or one argument and that
+% precedes the text that draws a left curly brace, right curly brace, or
+% either curly brace.
+% \begin{macrocode}
+\define@key{bytefield}{leftcurlystyle}{\def\bf@leftcurlystyle{#1}}
+\define@key{bytefield}{rightcurlystyle}{\def\bf@rightcurlystyle{#1}}
+\define@key{bytefield}{curlystyle}{%
+ \def\bf@leftcurlystyle{#1}%
+ \def\bf@rightcurlystyle{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\KV@bytefield@endianness}
% \begin{macro}{\bf@parse@endianness}
diff --git a/macros/latex/contrib/bytefield/bytefield.pdf b/macros/latex/contrib/bytefield/bytefield.pdf
index 44c093147a..46b2b36d09 100644
--- a/macros/latex/contrib/bytefield/bytefield.pdf
+++ b/macros/latex/contrib/bytefield/bytefield.pdf
Binary files differ
diff --git a/macros/latex/contrib/menukeys/README b/macros/latex/contrib/menukeys/README
index eac3eeb486..8dcbf3fa7d 100644
--- a/macros/latex/contrib/menukeys/README
+++ b/macros/latex/contrib/menukeys/README
@@ -20,9 +20,12 @@ a flexible way.
License:
-This material is subject to the LaTeX Project Public License.
-See http://mirror.ctan.org/help/Catalogue/licenses.lppl.html
-for the details of that license.
+This material is subject to the LaTeX Project Public License
+(LPPL), either version 1.3c of this license or (at your
+option) any later version. The latest version of this
+license is in the file
+
+ http://www.latex-project.org/lppl.txt
Files:
diff --git a/macros/latex/contrib/menukeys/menukeys.dtx b/macros/latex/contrib/menukeys/menukeys.dtx
index 02a3c5904f..0d65a027b9 100644
--- a/macros/latex/contrib/menukeys/menukeys.dtx
+++ b/macros/latex/contrib/menukeys/menukeys.dtx
@@ -1,24 +1,17 @@
% \iffalse meta-comment
-%
-% Copyright (c) 2016 by Tobias Weh
-% www.tobias-weh.de
-%
-% This file may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either
-% version 1.3 of this license or (at your option) any later
-% version. The latest version of this license is in:
-%
-% http://www.latex-project.org/lppl.txt
-%
-% and version 1.2 or later is part of all distributions of
-% LaTeX version 1999/12/01 or later.
%
-% \fi
-%
-% \iffalse
+%% File: menukeys.dtx Copyright (c) Tobias Weh
+%%
+%% This file may be distributed and/or modified under the conditions of the
+%% LaTeX Project Public License (LPPL), either version 1.3c of this
+%% license or (at your option) any later version. The latest version
+%% of this license is in the file
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
%<package>\NeedsTeXFormat{LaTeX2e}[2009/01/01]
%<package>\ProvidesPackage{menukeys}
-%<package> [2016/08/08 v1.5 -- A package to format menus, paths and shortcuts]
+%<package> [2020/10/31 v1.6 -- A package to format menus, paths and shortcuts]
%
%<*driver>
\documentclass{ltxdoc}
@@ -29,7 +22,6 @@
\usepackage[english]{babel}
\usepackage{menukeys}
\usepackage{xspace}
-\usepackage{lmodern}
\usepackage[hang]{footmisc}
\usepackage{dblfnote}
\setlength{\footnotemargin}{1em}
@@ -269,10 +261,10 @@
% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
% \DoNotIndex{\wd,\xiipt,\year,\z@}
% \expandafter\DoNotIndex{\,}
-% \DoNotIndex{\next,\unexpanded,\xifinsetTF,\robust@def,\@backslashchar,
-% \@ifundefinedcolor,\@nameuse,\detokenize,\cpt@parserlist,\cptexpanded
-% \cptrobustify,\cpttrimspaces,\cslet,\csname,\edef,\endcsname,\iflastindris,
-% \indrisloop,\indrisnr,\NewDocumentCommand,\cptexpanded}
+% \DoNotIndex{\next,\unexpanded,\@backslashchar,
+% \@ifundefinedcolor,\@nameuse,\detokenize,
+% \cslet,\csname,\edef,\endcsname,
+% \NewDocumentCommand}
% \DoNotIndex{\@afterheading,\@afterindentfalse,\@ifpackageloaded,\ ,
% \appto,\AtBeginDocument,\AtEndPreamble,\baselineskip,\BODY,
% \centering,\contentspage,\CurrentOption,\dots,\endquote,\fill,\filright,
@@ -285,7 +277,8 @@
% \DoNotIndex{\lccode,\listof,\lowercase,\PackageWarningNoLine,\PackageError,
% \PackageWarning,\renewenvironment,\romannumeral,\string,\strut}
% \DoNotIndex{\csdef,\cslet\csletcs,\letcs,\DeclareDocumentCommand,\ifcsundef,
-% \RenewDocumentCommand,\NewDocumentCommand,\hspace,\IfBooleanTF,\IfSubStr}
+% \RenewDocumentCommand,\ProvideDocumentCommand,\NewDocumentCommand,\hspace,
+% \IfBooleanTF,\IfSubStr}
% \DoNotIndex{\tikz,\node,\draw,\definecolor,\colorlet,\usetikzlibrary,
% \texttt,\textcolor,\raisebox,\maxsizebox,\small,\ttfamily,\DeclareBoolOption}
% \DoNotIndex{\value,\usebox,\sbox,\providecommand,\ProcessKeyvalOptions,\newbox,
@@ -310,9 +303,13 @@
% If you like to support this package -- especially improving or proofreading the
% manual -- send me an e-mail, please.
% \par\bigskip\noindent
-% \emph{Many thanks to Ahmed Musa, who provided the list parsing code at
-% \url{http://tex.stackexchange.com/a/44989/4918}.}
-% \end{abstract}
+% \emph{Many thanks to Ahmed Musa, who provided the original list parsing
+% code at \url{http://tex.stackexchange.com/a/44989/4918}.}
+% \par\bigskip\noindent
+% \emph{Special thanks to Jonathan P.\@ Spratte, who made the changes in v1.6
+% to remove the \pkg{catoptions} dependency so that \pkg{menukeys} works with
+% \LaTeX\ releases starting from 2020/10/01.}
+% \end{abstract}
%
% \newpage\tableofcontents\newpage
%
@@ -369,10 +366,12 @@
% \end{verbatim}
%
% \section{Package loading and options}\label{options}
-% Since \menukeys uses \pkg{catoptions}, which does some heavy changes on key-value
-% options, it is recommended to load \menukeys as the \textbf{last package}
+% \changes{v1.6}{2020/10/27}{Load order no longer important}
+% Since \menukeys used to use \pkg{catoptions}, which does some heavy changes on key-value
+% options, it \textbf{was} recommended to load \menukeys as the last package
% (even after \pkg{hyperref}\footnote{See \url{http://tex.stackexchange.com/q/237683/4918}
-% and \url{https://github.com/tweh/menukeys/issues/41}.})!
+% and \url{https://github.com/tweh/menukeys/issues/41}.}).
+% \textbf{This is no longer the case!}
%
% These are the possible options:
% \begin{description}
@@ -394,8 +393,7 @@
% value is |symbols|.
% \item [os:] You can specify the OS \DO{os} by saying |os=mac| or |os=win|. This will cause
% some key macros to be rendered differently. The default value is |mac|.
-% \item [hyperrefcolorlinks:] Use this if you want \pkg{hyperref}'s \DO{hyperrefcolorlinks}
-% colored links, since you can't use the \pkg{hyperref} option \opt{colorlinks} directly
+% \item [hyperrefcolorlinks:] \emph{Obsolete}
% (see sec.~\ref{sec:issues} and~\ref{sec:hyperref-colorlinks}).
% \end{description}
%
@@ -743,18 +741,17 @@
% \menukeys must be loaded after \pkg{xcolor}, if you load
% the latter with options. Otherwise you'll get an option clash
% Since \menukeys loads \pkg{xcolor} internally you may pass
-% options as global options via |\documentclass|.
+% options as global options via |\documentclass| or directly to it via
+% |\PassOptionsToPackage|.
% \example Set \pkg{xcolor} to |cmyk| model:
% \begin{verbatim}
-% \documentclass[cmyk]{article}
+% \documentclass{article}
+% \PassOptionsToPackage{cmyk}{xcolor}
% \usepackage{menukeys}
% \begin{document}
% Hello World!
% \end{document}
% \end{verbatim}
-% \item Using \pkg{hyperref} with the \opt{colorlinks} options causes
-% an option clash. If you want colored links please load \pkg{hyperref}
-% \emph{without} this option and load \pkg{menukeys} with \opt{hyperrefcolorlinks}.
% \end{itemize}
%
% If you find something to add to this list please send me an e-mail or report a
@@ -764,6 +761,7 @@
%
% \section{Implementation}
% \subsection{Required packages}
+% \changes{v1.6}{2020/10/27}{Don't load \pkg{catoptions}}
% Load the required packages
% \begin{macrocode}
\RequirePackage{xparse}
@@ -787,9 +785,102 @@
\RequirePackage{relsize}
% \end{macrocode}
% To define the list parsing commands and allow |\| as
-% a separator we load \pkg{catoptions}
+% a separator we used to load \pkg{catoptions}. Instead we now use some
+% \pkg{expl3} functions to replace the macros we required from \pkg{catoptions}.
+%
+% The first few of these functions are more or less direct equivalents. A bit of
+% attention has to be paid for |\tw@mk@xifinsetTF| as it requires the arguments
+% to get swapped.
+% \begin{macrocode}
+\ExplSyntaxOn
+\cs_new_eq:NN \tw@mk@trimspaces \tl_trim_spaces:n
+\cs_new_eq:NN \tw@mk@expanded \use:x
+\prg_generate_conditional_variant:Nnn \tl_if_in:nn { xx } { TF }
+\cs_new:Npn \tw@mk@xifinsetTF #1 #2
+ {
+ \tl_if_in:xxTF {#2} {#1}
+ }
+% \end{macrocode}
+% The replacement for |\indrisloop| will not set the conditional
+% |\iflastindris|, instead we can check whether the sequence is empty to see
+% whether this is the last element. This test will not use a TeX-like
+% |\iflastindris...\else...\fi| construct but instead two branches.
+% \begin{macrocode}
+\cs_new:Npn \tw@mk@iflastindris
+ {
+ \seq_if_empty:NTF \l__twmk_indris_seq
+ }
+% \end{macrocode}
+% Replacing |\indrisloop| is a bit more work as it requires us to push some
+% values to a stack (to allow nested usage, this may not be necessary for
+% \pkg{menukeys}, but it is part of the original |\indrisloop| so we should
+% play nice here). First we'll need a few variables.
% \begin{macrocode}
-\RequirePackage{catoptions}[2011/12/07]
+\seq_new:N \l__twmk_indris_seq
+\int_new:N \l__twmk_indris_int
+\tl_new:N \l__twmk_indris_tl
+\cs_new_eq:NN \tw@mk@indrisnr \l__twmk_indris_int
+\seq_new:N \l__twmk_indris_seqstack_seq
+\seq_new:N \l__twmk_indris_intstack_seq
+% \end{macrocode}
+% Our stack will use another sequence in which the definitions of the parent
+% call will be stored for the sequence and the integer. The other variables put
+% on a stack by |\indrisloop| aren't required. The synopsis of
+% |\tw@mk@indrisloop| will be different to the one provided by \pkg{catoptions}.
+% The delimiter will be a mandatory argument (not in brackets), and there is no
+% starred version.
+% \begin{macrocode}
+\cs_new_protected:Npn \__twmk_pushseq:
+ {
+ \seq_push:No \l__twmk_indris_seqstack_seq \l__twmk_indris_seq
+ }
+\cs_new_protected:Npn \__twmk_pushint:
+ {
+ \seq_push:NV \l__twmk_indris_intstack_seq \l__twmk_indris_int
+ }
+\cs_new_protected:Npn \__twmk_popseq:
+ {
+ \seq_if_empty:NTF \l__twmk_indris_seqstack_seq
+ { \seq_clear:N \l__twmk_indris_seq }
+ { \seq_pop:NN \l__twmk_indris_seqstack_seq \l__twmk_indris_seq }
+ }
+\cs_new_protected:Npn \__twmk_popint:
+ {
+ \seq_if_empty:NTF \l__twmk_indris_intstack_seq
+ { \int_zero:N \l__twmk_indris_int }
+ {
+ \group_begin:
+ \seq_pop:NN \l__twmk_indris_intstack_seq \l__twmk_indris_tl
+ \exp_args:NNNo
+ \group_end:
+ \int_set:Nn \l__twmk_indris_int \l__twmk_indris_tl
+ }
+ }
+% \end{macrocode}
+% The real loop works by first splitting the input into a sequence according to
+% the delimiter in |#1|. Then this sequence is stepped through, but instead of
+% using |\seq_map:NN| we'll have to pop the sequence into a local variable so
+% that our test for the last element works. The parameter |#2| has to be
+% expanded once as it is handed in as a token storing the real argument in later
+% use.
+% \begin{macrocode}
+\cs_generate_variant:Nn \seq_set_split:Nnn { Nno }
+\cs_new_protected:Npn \tw@mk@indrisloop #1 #2 #3
+ {
+ \__twmk_pushseq:
+ \__twmk_pushint:
+ \seq_set_split:Nno \l__twmk_indris_seq {#1} {#2}
+ \int_zero:N \l__twmk_indris_int
+ \bool_do_while:nn { \bool_not_p:n { \seq_if_empty_p:N \l__twmk_indris_seq } }
+ {
+ \int_incr:N \l__twmk_indris_int
+ \seq_pop_left:NN \l__twmk_indris_seq \l__twmk_indris_tl
+ \exp_args:No #3 \l__twmk_indris_tl
+ }
+ \__twmk_popseq:
+ \__twmk_popint:
+ }
+\ExplSyntaxOff
% \end{macrocode}
%
% \subsection{Helper macros}
@@ -853,32 +944,22 @@
% \end{macrocode}
%
% \subsection{Workarounds}
-% Some workarounds to ``slove'' some incompatibilities:
+% Some workarounds to ``solve'' some incompatibilities:
% \subsubsection{\pkg{hyperref}'s \opt{colorlinks} option}\label{sec:hyperref-colorlinks}
+% \changes{v1.6}{2020/10/27}{\opt{hyperrefcolorlinks} obsolete}
% \changes{v1.5}{2016/08/08}{New option \opt{hyperrefcolorlinks}}
-% Since the \opt{colorlinks} option of \pkg{hyperref} loads \pkg{color} (with
-% some kind of |\AtBeginDocument|) it results in an option clas due to the
-% changes made by \pkg{catoptions}. Thus one can't use \opt{colorlinks}. Here we
-% provide the code to activate colored links without the extra loading of
-% \pkg{color}.
+% There used to be an issue with using the \opt{colorlinks} option of
+% \pkg{hyperref} due to \pkg{catoptions} being loaded. Since \pkg{catoptions}
+% isn't required any more, this workaround isn't necessary. For backwards
+% compatibility the \opt{hyperrefcolorlinks} option is still evaluated and just
+% uses |\hypersetup| or |\PassOptionsToPackage| depending on whether
+% \pkg{hyperref} is already loaded.
% \begin{macrocode}
\iftw@mk@hyperrefcolorlinks
- \Hy@AtBeginDocument{% (hyperref.sty, line 4790)
- \def\@pdfborder{0 0 0}% (hyperref.sty, line 4806...)
- \let\@pdfborderstyle\@empty
-% \ifHy@typexml% <--------------+
-% \else% | This part
-% \Hy@CatcodeWrapper{% | bust be
-% \RequirePackage{color}% | omitted
-% }% |
-% \fi% <------------------------+
- \def\Hy@colorlink#1{%
- \begingroup
- \HyColor@UseColor#1%
- }%
- \def\Hy@endcolorlink{\endgroup}%
- \Hy@Info{Link coloring ON}%
- }
+ \tw@mk@warning{The option `hyperrefcolorlinks' is obsolete}
+ \@ifpackageloaded{hyperref}
+ {\hypersetup{colorlinks}}
+ {\PassOptionsToPackage{colorlinks}{hyperref}}
\fi
% \end{macrocode}
%
@@ -1505,88 +1586,95 @@
% by deleting the line to make the command robust.}
% \changes{v1.2}{2013/07/23}{Replaced \cs{edef} by \cs{protected@edef}}
% \changes{v1.2c}{2013/07/23}{Replaced \cs{protected@edef} by \cs{def}}
-% \changes{v1.2}{2013/07/23}{Addded \cs{leavevmode}}
+% \changes{v1.2}{2013/07/23}{Added \cs{leavevmode}}
+% \changes{v1.6}{2020/10/27}{Don't use \cs{NewDocumentCommand}}
% Then we set up the internal command to create new menu macros.
% The list parsing code was essentially provided by Ahmed Musa at
-% \url{http://tex.stackexchange.com/a/44989/4918}. Thank you very much!
+% \url{http://tex.stackexchange.com/a/44989/4918}. Jonathan P.\@ Spratte
+% made some major changes to make \pkg{menukeys} work without \pkg{catoptions}
+% and reimplemented the parsing code usding \LaTeX3. Thank you both very much!
% \begin{macrocode}
\begingroup
\lccode`\,=1
\lowercase{\endgroup
- \robust@def*\tw@mk@test@input@sep#1{%
- \xifinsetTF{,\cpttrimspaces{#1},}{,bslash,backslash,directory,location,}%
- }%
+ \@ifdefinable\tw@mk@test@input@sep
+ {%
+ \protected\def\tw@mk@test@input@sep#1{%
+ \tw@mk@xifinsetTF
+ {,\tw@mk@trimspaces{#1},}{,bslash,backslash,directory,location,}%
+ }%
+ }%
}
-\NewDocumentCommand{\tw@define@menu@macro}{%
- m O{\tw@default@input@sep} m
-}{%
- \ifcsundef{tw@style@#3@sep}{%
- \tw@mk@error{Can't define menu macro \string#1\space,\MessageBreak
- because the style '#3' is not available!}
+\newcommand\tw@define@menu@macro[4]{%
+ \ifcsundef{tw@style@#4@sep}{%
+ \tw@mk@error{Can't define menu macro \string#2\space,\MessageBreak
+ because the style '#4' is not available!}
}{%
- \csdef{tw@parse@menu@list@\expandafter\@gobble\string#1}##1{%
- \iflastindris
- \ifnum\indrisnr=\@ne
+ \csdef{tw@parse@menu@list@\expandafter\@gobble\string#2}##1{%
+ \tw@mk@iflastindris
+ {%
+ \ifnum\tw@mk@indrisnr=\@ne
\def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#3@single}%
+ \@nameuse{tw@style@#4@single}%
\else
\def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#3@sep}\@nameuse{tw@style@#3@last}%
+ \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@last}%
\fi
- \else
- \ifnum\indrisnr=\@ne
+ }
+ {%
+ \ifnum\tw@mk@indrisnr=\@ne
\def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#3@first}%
+ \@nameuse{tw@style@#4@first}%
\else
\def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#3@sep}\@nameuse{tw@style@#3@mid}%
+ \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@mid}%
\fi
- \fi
+ }%
}%
- \expandafter\newcommand\csname\expandafter\@gobble\string#1\endcsname[2][#2]{%
+ #1 #2 { +O{#3} +m }{%
\leavevmode%
- {\def\tw@current@color@theme{\csname tw@style@#3@color@theme\endcsname}%
- \@nameuse{tw@style@#3@pre}%
+ {\def\tw@current@color@theme{\csname tw@style@#4@color@theme\endcsname}%
+ \@nameuse{tw@style@#4@pre}%
\tw@mk@test@input@sep{##1}{%
\edef\tw@menu@list{\detokenize{##2}}\edef\tw@mk@tempa{\@backslashchar}%
}{%
- \edef\tw@menu@list{\unexpanded{##2}}\edef\tw@mk@tempa{\cpttrimspaces{##1}}%
+ \edef\tw@menu@list{\unexpanded{##2}}\edef\tw@mk@tempa{\tw@mk@trimspaces{##1}}%
}%
- {\letcs{\tw@mk@tempb}{tw@parse@menu@list@\expandafter\@gobble\string#1}%
- \cptexpanded{\indrisloop*[\tw@mk@tempa]}\tw@menu@list\tw@mk@tempb}%
- \@nameuse{tw@style@#3@post}}%
+ {\letcs{\tw@mk@tempb}{tw@parse@menu@list@\expandafter\@gobble\string#2}%
+ \tw@mk@expanded{\tw@mk@indrisloop{\tw@mk@tempa}}\tw@menu@list\tw@mk@tempb}%
+ \@nameuse{tw@style@#4@post}}%
}%
}%
}
-\edef\cpt@parserlist{\cpt@parserlist\@backslashchar}
% \end{macrocode}
% \end{macro}
% \subsubsection{User-level commands}
% \begin{macro}{\newmenumacro}
% \changes{v1.1a}{2013/05/28}{Added a line to make a new macro robust.}
+% \changes{v1.6}{2020/10/27}{use \cs{NewDocumentCommand}}
% \begin{macro}{\renewmenumacro}
+% \changes{v1.6}{2020/10/27}{use \cs{RenewDocumentCommand}}
% \begin{macro}{\providemenumacro}
+% \changes{v1.6}{2020/10/27}{use \cs{ProvideDocumentCommand}}
% Now it's time to build the user-level commands
% \begin{macrocode}
\NewDocumentCommand{\newmenumacro}{m O{\tw@default@input@sep} m}{%
\ifcsundef{\expandafter\@gobble\string#1}{%
- \tw@define@menu@macro{#1}[#2]{#3}%
- \expandafter\cptrobustify\csname\expandafter\@gobble\string#1\endcsname
- }{
+ \tw@define@menu@macro\NewDocumentCommand{#1}{#2}{#3}%
+ }{%
\tw@mk@error{Menu macro '\string#1' already defined!\MessageBreak
- Use \string\renewmenustyle\space instead.}
+ Use \string\renewmenustyle\space instead.}%
}%
}
\NewDocumentCommand{\renewmenumacro}{m O{\tw@default@input@sep} m}{%
- \cslet{\expandafter\@gobble\string#1}{\relax}%
- \tw@define@menu@macro{#1}[#2]{#3}%
+ \tw@define@menu@macro\RenewDocumentCommand{#1}{#2}{#3}%
}
\NewDocumentCommand{\providemenumacro}{m O{\tw@default@input@sep} m}{%
\ifcsundef{\expandafter\@gobble\string#1}{%
- \tw@define@menu@macro{#1}[#2]{#3}%
- }{
+ \tw@define@menu@macro\ProvideDocumentCommand{#1}{#2}{#3}%
+ }{%
\tw@mk@warning{Menu macro '\string#1' already defined!\MessageBreak
- Use \string\renewmenustyle\space to redefine it.}
+ Use \string\renewmenustyle\space to redefine it.}%
}%
}
% \end{macrocode}
@@ -1989,4 +2077,4 @@
%
%
% \Finale
-\endinput \ No newline at end of file
+\endinput
diff --git a/macros/latex/contrib/menukeys/menukeys.ins b/macros/latex/contrib/menukeys/menukeys.ins
index 79a6792f6f..cbf8e23e6e 100644
--- a/macros/latex/contrib/menukeys/menukeys.ins
+++ b/macros/latex/contrib/menukeys/menukeys.ins
@@ -1,17 +1,15 @@
-%%
-%% Copyright (C) 2016 by Tobias Weh
-%% www.tobiw.de/en
-%%
-%% This file may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either
-%% version 1.3 of this license or (at your option) any later
-%% version. The latest version of this license is in:
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% and version 1.2 or later is part of all distributions of
-%% LaTeX version 1999/12/01 or later.
-%%
+\iffalse meta-comment
+
+File menukeys.ins Copyright (c) Tobias Weh
+
+This file may be distributed and/or modified under the conditions of the
+LaTeX Project Public License (LPPL), either version 1.3c of this
+license or (at your option) any later version. The latest version
+of this license is in the file
+
+ http://www.latex-project.org/lppl.txt
+
+\fi
\input docstrip.tex
\keepsilent
diff --git a/macros/latex/contrib/menukeys/menukeys.pdf b/macros/latex/contrib/menukeys/menukeys.pdf
index 74800cd1cb..ff2f9fa6ef 100644
--- a/macros/latex/contrib/menukeys/menukeys.pdf
+++ b/macros/latex/contrib/menukeys/menukeys.pdf
Binary files differ