summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-12-19 21:26:22 +0000
committerKarl Berry <karl@freefriends.org>2020-12-19 21:26:22 +0000
commit3320cb1941d08cbcf8838f61a16a436fabe1df2a (patch)
tree97f98d1a74c8aec49fa44769da91d7ed035d723a /Master
parent2908eb2689ddc98f7cfba4a9b7391afdbcf31d38 (diff)
menukeys (19dec20)
git-svn-id: svn://tug.org/texlive/trunk@57172 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/menukeys/README7
-rw-r--r--Master/texmf-dist/doc/latex/menukeys/menukeys.pdfbin585677 -> 579072 bytes
-rw-r--r--Master/texmf-dist/source/latex/menukeys/menukeys.dtx195
-rw-r--r--Master/texmf-dist/source/latex/menukeys/menukeys.ins6
-rw-r--r--Master/texmf-dist/tex/latex/menukeys/menukeys.sty137
5 files changed, 203 insertions, 142 deletions
diff --git a/Master/texmf-dist/doc/latex/menukeys/README b/Master/texmf-dist/doc/latex/menukeys/README
index 8dcbf3fa7d5..aa740c38025 100644
--- a/Master/texmf-dist/doc/latex/menukeys/README
+++ b/Master/texmf-dist/doc/latex/menukeys/README
@@ -5,8 +5,11 @@
Tobias Weh
mail@tobiw.de
- http://tobiw.de/en
+ https://tobiw.de/en
+ Jonathan P. Spratte
+ jspratte@yahoo.de
+
ctan.org/pkg/menukeys
github.com/tweh/menukeys
@@ -25,7 +28,7 @@ This material is subject to the LaTeX Project Public License
option) any later version. The latest version of this
license is in the file
- http://www.latex-project.org/lppl.txt
+ https://www.latex-project.org/lppl.txt
Files:
diff --git a/Master/texmf-dist/doc/latex/menukeys/menukeys.pdf b/Master/texmf-dist/doc/latex/menukeys/menukeys.pdf
index ff2f9fa6ef2..dd1b548f2d2 100644
--- a/Master/texmf-dist/doc/latex/menukeys/menukeys.pdf
+++ b/Master/texmf-dist/doc/latex/menukeys/menukeys.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/menukeys/menukeys.dtx b/Master/texmf-dist/source/latex/menukeys/menukeys.dtx
index 0d65a027b99..d7fcb2684c5 100644
--- a/Master/texmf-dist/source/latex/menukeys/menukeys.dtx
+++ b/Master/texmf-dist/source/latex/menukeys/menukeys.dtx
@@ -7,11 +7,11 @@
%% 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
+%% https://www.latex-project.org/lppl.txt
%%
%<package>\NeedsTeXFormat{LaTeX2e}[2009/01/01]
%<package>\ProvidesPackage{menukeys}
-%<package> [2020/10/31 v1.6 -- A package to format menus, paths and shortcuts]
+%<package> [2020/12/19 v1.6.1 -- A package to format menus, paths and shortcuts]
%
%<*driver>
\documentclass{ltxdoc}
@@ -175,6 +175,7 @@
}{blacknwhite}
\newmenumacro{\filefolder}[/]{pathswithblackfolder}
\newmenumacro{\MENU}[,]{menusbig}
+\newcommand\email[1]{\href{mailto:#1}{\texttt{#1}}}
\makeatother
\EnableCrossrefs
@@ -221,7 +222,7 @@
%
% \GetFileInfo{menukeys.sty}
%
-% \DoNotIndex{\?,\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
+% \DoNotIndex{\?,\_,\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
% \DoNotIndex{\@badmath,\@centercr,\@cite}
% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
% \DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
@@ -285,11 +286,16 @@
% \IfStrEq,\hyphenchar,\expandonce,\encodingdefault,\DeclareStringOption}
%
% \title{\Huge\MENU[,]{M,E,N,U,K,E,Y,S}}
-% \author{Tobias Weh\\
-% \normalsize\href{mailto:mail@tobiw.de}{\texttt{mail@tobiw.de}}\\
-% \normalsize\url{http://tobiw.de/en}\\
-% \normalsize\url{http://github.com/tweh/menukeys}\\
-% \normalsize\url{http://www.ctan.org/pkg/menukeys}\\
+% \author{^^A
+% Tobias Weh\\
+% {\normalsize\email{mail@tobiw.de}}\\
+% {\normalsize\url{https://tobiw.de/en}}\\[\medskipamount]
+% ^^A
+% Jonathan P.\@ Spratte\\
+% {\normalsize\email{jspratte@yahoo.de}}\\[\medskipamount]
+% ^^A
+% \normalsize\url{https://github.com/tweh/menukeys}\\
+% \normalsize\url{https://www.ctan.org/pkg/menukeys}\\
% \normalsize\filefolder{macros/latex/contrib/menukeys}}
% \date{\filedate{} --- \fileversion}
% \thispagestyle{empty}
@@ -304,20 +310,17 @@
% manual -- send me an e-mail, please.
% \par\bigskip\noindent
% \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.}
+% code at \url{https://tex.stackexchange.com/a/44989/4918}.}
+% \par
% \end{abstract}
%
% \newpage\tableofcontents\newpage
%
% \section{Introduction}\label{intro}
% The \menukeys package is mainly designed to parse and print
-% sequences of software menus, folders and files or keystrokes.
-% The most predefined styles use the power of \TikZ\footnote{See
-% \url{http://www.ctan.org/pkg/pgf}.} to format the output.
+% sequences of software menus, folders and files, or keystrokes.
+% Most predefined styles use the power of \TikZ\footnote{See
+% \url{https://www.ctan.org/pkg/pgf}.} to format the output.
%
% For example if you want to tell the reader of a manual how to set the ruler
% unit you may type
@@ -327,9 +330,9 @@
% to view the rulers is \keys{cmd + R}. Pressing these keys again
% will hide the rulers.
%
-% The standard path for saving your document is \directory{Macintosh HD/Users/
-% Your Name/Documents} but you can change it at \menu{Extras > Settings
-% > Saving} by clicking \menu{Change save path}.
+% The standard path for saving your document is \directory{Macintosh HD/
+% Users/Your Name/Documents} but you can change it at \menu{Extras >
+% Settings > Saving} by clicking \menu{Change save path}.
% \end{verbatim}
% and get this:
%
@@ -339,9 +342,9 @@
% to view the rulers is \keys{cmd + R}. Pressing these keys again
% will hide the rulers.
%
-% The standard path for saving your document is \directory{Macintosh HD/Users/
-% Your Name/Documents} but you can change it at \menu{Extras > Settings
-% > Saving} by clicking \menu{Change save path}.
+% The standard path for saving your document is \directory{Macintosh HD/
+% Users/Your Name/Documents} but you can change it at \menu{Extras >
+% Settings > Saving} by clicking \menu{Change save path}.
%
% \bigskip\noindent
% The package is loaded as usual via
@@ -369,7 +372,7 @@
% \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}
+% (even after \pkg{hyperref}\footnote{See \url{https://tex.stackexchange.com/q/237683/4918}
% and \url{https://github.com/tweh/menukeys/issues/41}.}).
% \textbf{This is no longer the case!}
%
@@ -739,7 +742,7 @@
% loaded after it. Otherwise some key macros get corrupted.
% \item \changes{v1.1}{2012/02/26}{Load \pkg{xcolor} before \menukeys.}
% \menukeys must be loaded after \pkg{xcolor}, if you load
-% the latter with options. Otherwise you'll get an option clash
+% 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| or directly to it via
% |\PassOptionsToPackage|.
@@ -794,7 +797,8 @@
% \begin{macrocode}
\ExplSyntaxOn
\cs_new_eq:NN \tw@mk@trimspaces \tl_trim_spaces:n
-\cs_new_eq:NN \tw@mk@expanded \use:x
+\cs_new_eq:NN \tw@mk@exp@Nnno \exp_args:Nnno
+\cs_new_eq:NN \tw@mk@string \cs_to_str:N
\prg_generate_conditional_variant:Nnn \tl_if_in:nn { xx } { TF }
\cs_new:Npn \tw@mk@xifinsetTF #1 #2
{
@@ -864,12 +868,12 @@
% 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_generate_variant:Nn \seq_set_split:Nnn { Noo }
\cs_new_protected:Npn \tw@mk@indrisloop #1 #2 #3
{
\__twmk_pushseq:
\__twmk_pushint:
- \seq_set_split:Nno \l__twmk_indris_seq {#1} {#2}
+ \seq_set_split:Noo \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 } }
{
@@ -1573,7 +1577,7 @@
% \begin{macro}{\tw@default@input@sep}
% First we define our default input separator
% \begin{macrocode}
-\edef\tw@default@input@sep{,}
+\def\tw@default@input@sep{,}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\CurrentMenuElement} and the |\CurrentMenuElement| dummy
@@ -1582,17 +1586,22 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\tw@define@menu@macro}
+% \changes{v1.6.1}{2020/12/19}{Handles default input separator.}
+% \begin{macro}{\tw@define@menu@macro@}
% \changes{v1.1a}{2013/05/28}{Fixed minor bug, that causes a warning about robustifying (issue \#23),
% 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}{Added \cs{leavevmode}}
% \changes{v1.6}{2020/10/27}{Don't use \cs{NewDocumentCommand}}
+% \changes{v1.6.1}{2020/12/19}{Renamed from \cs{tw@define@menu@macro}}
+% \changes{v1.6.1}{2020/12/19}{No x-type expansion on the separator to call the
+% loop}
% 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}. Jonathan P.\@ Spratte
+% \url{https://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!
+% and reimplemented the parsing code using \LaTeX3. Thank you both very much!
% \begin{macrocode}
\begingroup
\lccode`\,=1
@@ -1605,72 +1614,98 @@
}%
}%
}
-\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#2}##1{%
- \tw@mk@iflastindris
+\newcommand\tw@define@menu@macro[3]
+ {%
+ \IfNoValueTF{#3}
+ {\tw@mk@exp@Nnno\tw@define@menu@macro@{#1}{#2}\tw@default@input@sep}
+ {\tw@define@menu@macro@{#1}{#2}{#3}}%
+ }
+\newcommand\tw@define@menu@macro@[4]
+ {%
+ \ifcsundef{tw@style@#4@sep}
+ {%
+ \tw@mk@error
{%
- \ifnum\tw@mk@indrisnr=\@ne
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@single}%
- \else
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@last}%
- \fi
- }
+ Can't define menu macro \string#2\space,\MessageBreak
+ because the style '#4' is not available!%
+ }%
+ }
+ {%
+ \csdef{tw@parse@menu@list@\tw@mk@string#2}##1%
{%
- \ifnum\tw@mk@indrisnr=\@ne
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@first}%
- \else
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@mid}%
- \fi
+ \def\CurrentMenuElement{##1}%
+ \tw@mk@iflastindris
+ {%
+ \ifnum\tw@mk@indrisnr=\@ne
+ \@nameuse{tw@style@#4@single}%
+ \else
+ \@nameuse{tw@style@#4@sep}%
+ \@nameuse{tw@style@#4@last}%
+ \fi
+ }
+ {%
+ \ifnum\tw@mk@indrisnr=\@ne
+ \@nameuse{tw@style@#4@first}%
+ \else
+ \@nameuse{tw@style@#4@sep}%
+ \@nameuse{tw@style@#4@mid}%
+ \fi
+ }%
+ }%
+ #1#2{+O{#3}+m}%
+ {%
+ \leavevmode
+ \begingroup
+ \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{\tw@mk@trimspaces{##1}}%
+ }%
+ \begingroup
+ \letcs{\tw@mk@tempb}{tw@parse@menu@list@\tw@mk@string#2}%
+ \tw@mk@indrisloop\tw@mk@tempa\tw@menu@list\tw@mk@tempb
+ \endgroup
+ \@nameuse{tw@style@#4@post}%
+ \endgroup
}%
}%
- #1 #2 { +O{#3} +m }{%
- \leavevmode%
- {\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{\tw@mk@trimspaces{##1}}%
- }%
- {\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}}%
- }%
- }%
-}
+ }
% \end{macrocode}
% \end{macro}
+% \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}}
+% \changes{v1.6.1}{2020/12/19}{default handled by \cs{tw@define@menu@macro}}
% \begin{macro}{\renewmenumacro}
% \changes{v1.6}{2020/10/27}{use \cs{RenewDocumentCommand}}
+% \changes{v1.6.1}{2020/12/19}{default handled by \cs{tw@define@menu@macro}}
% \begin{macro}{\providemenumacro}
% \changes{v1.6}{2020/10/27}{use \cs{ProvideDocumentCommand}}
+% \changes{v1.6.1}{2020/12/19}{default handled by \cs{tw@define@menu@macro}}
% 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}{%
+\NewDocumentCommand{\newmenumacro}{m o m}{%
+ \ifcsundef{\tw@mk@string#1}{%
\tw@define@menu@macro\NewDocumentCommand{#1}{#2}{#3}%
}{%
\tw@mk@error{Menu macro '\string#1' already defined!\MessageBreak
Use \string\renewmenustyle\space instead.}%
}%
}
-\NewDocumentCommand{\renewmenumacro}{m O{\tw@default@input@sep} m}{%
+\NewDocumentCommand{\renewmenumacro}{m o m}{%
\tw@define@menu@macro\RenewDocumentCommand{#1}{#2}{#3}%
}
-\NewDocumentCommand{\providemenumacro}{m O{\tw@default@input@sep} m}{%
- \ifcsundef{\expandafter\@gobble\string#1}{%
+\NewDocumentCommand{\providemenumacro}{m o m}{%
+ \ifcsundef{\tw@mk@string#1}{%
\tw@define@menu@macro\ProvideDocumentCommand{#1}{#2}{#3}%
}{%
\tw@mk@warning{Menu macro '\string#1' already defined!\MessageBreak
@@ -1738,25 +1773,25 @@
% \begin{macrocode}
\NewDocumentCommand{\tw@make@key@macro}{s m}{%
\IfBooleanTF{#1}{%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2@\tw@mk@os}}%
+ \@nameuse{tw@mk@\tw@mk@string#2@\tw@mk@os}}%
}%
}%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2mac\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2mac\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2@mac}}%
+ \@nameuse{tw@mk@\tw@mk@string#2@mac}}%
}%
}%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2win\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2win\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2@win}}%
+ \@nameuse{tw@mk@\tw@mk@string#2@win}}%
}%
}%
}{%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2}}%
+ \@nameuse{tw@mk@\tw@mk@string#2}}%
}%
}%
}%
diff --git a/Master/texmf-dist/source/latex/menukeys/menukeys.ins b/Master/texmf-dist/source/latex/menukeys/menukeys.ins
index cbf8e23e6ef..8999ea72759 100644
--- a/Master/texmf-dist/source/latex/menukeys/menukeys.ins
+++ b/Master/texmf-dist/source/latex/menukeys/menukeys.ins
@@ -7,7 +7,7 @@ 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
+ https://www.latex-project.org/lppl.txt
\fi
@@ -28,7 +28,7 @@ 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
+ https://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.
@@ -53,4 +53,4 @@ LaTeX version 1999/12/01 or later.
\Msg{* *}
\Msg{****************************************************}
-\endbatchfile \ No newline at end of file
+\endbatchfile
diff --git a/Master/texmf-dist/tex/latex/menukeys/menukeys.sty b/Master/texmf-dist/tex/latex/menukeys/menukeys.sty
index 3765286a07a..b6c28a440ba 100644
--- a/Master/texmf-dist/tex/latex/menukeys/menukeys.sty
+++ b/Master/texmf-dist/tex/latex/menukeys/menukeys.sty
@@ -16,7 +16,7 @@
%% 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
+%% https://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.
@@ -28,11 +28,11 @@
%% 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
+%% https://www.latex-project.org/lppl.txt
%%
\NeedsTeXFormat{LaTeX2e}[2009/01/01]
\ProvidesPackage{menukeys}
- [2020/10/31 v1.6 -- A package to format menus, paths and shortcuts]
+ [2020/12/19 v1.6.1 -- A package to format menus, paths and shortcuts]
\RequirePackage{xparse}
\RequirePackage{xstring}
\RequirePackage{etoolbox}
@@ -43,7 +43,8 @@
\RequirePackage{relsize}
\ExplSyntaxOn
\cs_new_eq:NN \tw@mk@trimspaces \tl_trim_spaces:n
-\cs_new_eq:NN \tw@mk@expanded \use:x
+\cs_new_eq:NN \tw@mk@exp@Nnno \exp_args:Nnno
+\cs_new_eq:NN \tw@mk@string \cs_to_str:N
\prg_generate_conditional_variant:Nnn \tl_if_in:nn { xx } { TF }
\cs_new:Npn \tw@mk@xifinsetTF #1 #2
{
@@ -85,12 +86,12 @@
\int_set:Nn \l__twmk_indris_int \l__twmk_indris_tl
}
}
-\cs_generate_variant:Nn \seq_set_split:Nnn { Nno }
+\cs_generate_variant:Nn \seq_set_split:Nnn { Noo }
\cs_new_protected:Npn \tw@mk@indrisloop #1 #2 #3
{
\__twmk_pushseq:
\__twmk_pushint:
- \seq_set_split:Nno \l__twmk_indris_seq {#1} {#2}
+ \seq_set_split:Noo \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 } }
{
@@ -651,7 +652,7 @@
\drawtikzfolder[\usemenucolor{c}][\usemenucolor{b}]%
\hspace{0.2em plus 0.1em}%
}
-\edef\tw@default@input@sep{,}
+\def\tw@default@input@sep{,}
\def\CurrentMenuElement{}
\begingroup
\lccode`\,=1
@@ -664,60 +665,82 @@
}%
}%
}
-\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#2}##1{%
- \tw@mk@iflastindris
+\newcommand\tw@define@menu@macro[3]
+ {%
+ \IfNoValueTF{#3}
+ {\tw@mk@exp@Nnno\tw@define@menu@macro@{#1}{#2}\tw@default@input@sep}
+ {\tw@define@menu@macro@{#1}{#2}{#3}}%
+ }
+\newcommand\tw@define@menu@macro@[4]
+ {%
+ \ifcsundef{tw@style@#4@sep}
+ {%
+ \tw@mk@error
{%
- \ifnum\tw@mk@indrisnr=\@ne
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@single}%
- \else
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@last}%
- \fi
- }
+ Can't define menu macro \string#2\space,\MessageBreak
+ because the style '#4' is not available!%
+ }%
+ }
+ {%
+ \csdef{tw@parse@menu@list@\tw@mk@string#2}##1%
{%
- \ifnum\tw@mk@indrisnr=\@ne
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@first}%
- \else
- \def\CurrentMenuElement{##1}%
- \@nameuse{tw@style@#4@sep}\@nameuse{tw@style@#4@mid}%
- \fi
+ \def\CurrentMenuElement{##1}%
+ \tw@mk@iflastindris
+ {%
+ \ifnum\tw@mk@indrisnr=\@ne
+ \@nameuse{tw@style@#4@single}%
+ \else
+ \@nameuse{tw@style@#4@sep}%
+ \@nameuse{tw@style@#4@last}%
+ \fi
+ }
+ {%
+ \ifnum\tw@mk@indrisnr=\@ne
+ \@nameuse{tw@style@#4@first}%
+ \else
+ \@nameuse{tw@style@#4@sep}%
+ \@nameuse{tw@style@#4@mid}%
+ \fi
+ }%
+ }%
+ #1#2{+O{#3}+m}%
+ {%
+ \leavevmode
+ \begingroup
+ \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{\tw@mk@trimspaces{##1}}%
+ }%
+ \begingroup
+ \letcs{\tw@mk@tempb}{tw@parse@menu@list@\tw@mk@string#2}%
+ \tw@mk@indrisloop\tw@mk@tempa\tw@menu@list\tw@mk@tempb
+ \endgroup
+ \@nameuse{tw@style@#4@post}%
+ \endgroup
}%
}%
- #1 #2 { +O{#3} +m }{%
- \leavevmode%
- {\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{\tw@mk@trimspaces{##1}}%
- }%
- {\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}}%
- }%
- }%
-}
-\NewDocumentCommand{\newmenumacro}{m O{\tw@default@input@sep} m}{%
- \ifcsundef{\expandafter\@gobble\string#1}{%
+ }
+\NewDocumentCommand{\newmenumacro}{m o m}{%
+ \ifcsundef{\tw@mk@string#1}{%
\tw@define@menu@macro\NewDocumentCommand{#1}{#2}{#3}%
}{%
\tw@mk@error{Menu macro '\string#1' already defined!\MessageBreak
Use \string\renewmenustyle\space instead.}%
}%
}
-\NewDocumentCommand{\renewmenumacro}{m O{\tw@default@input@sep} m}{%
+\NewDocumentCommand{\renewmenumacro}{m o m}{%
\tw@define@menu@macro\RenewDocumentCommand{#1}{#2}{#3}%
}
-\NewDocumentCommand{\providemenumacro}{m O{\tw@default@input@sep} m}{%
- \ifcsundef{\expandafter\@gobble\string#1}{%
+\NewDocumentCommand{\providemenumacro}{m o m}{%
+ \ifcsundef{\tw@mk@string#1}{%
\tw@define@menu@macro\ProvideDocumentCommand{#1}{#2}{#3}%
}{%
\tw@mk@warning{Menu macro '\string#1' already defined!\MessageBreak
@@ -737,25 +760,25 @@
}
\NewDocumentCommand{\tw@make@key@macro}{s m}{%
\IfBooleanTF{#1}{%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2@\tw@mk@os}}%
+ \@nameuse{tw@mk@\tw@mk@string#2@\tw@mk@os}}%
}%
}%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2mac\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2mac\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2@mac}}%
+ \@nameuse{tw@mk@\tw@mk@string#2@mac}}%
}%
}%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2win\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2win\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2@win}}%
+ \@nameuse{tw@mk@\tw@mk@string#2@win}}%
}%
}%
}{%
- \expandafter\providecommand\csname\expandafter\@gobble\string#2\endcsname{%
+ \expandafter\providecommand\csname\tw@mk@string#2\endcsname{%
\expandonce{\maxsizebox{!}{1.8ex}{%
- \@nameuse{tw@mk@\expandafter\@gobble\string#2}}%
+ \@nameuse{tw@mk@\tw@mk@string#2}}%
}%
}%
}%