diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-18 21:51:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-18 21:51:12 +0000 |
commit | 64cac8b0408d6a7e0700efdd53dee0414f6c8bcb (patch) | |
tree | 185880e2359785cc00ed00672c8bd50a650abc4d /Master/texmf-dist/tex/latex | |
parent | 55b4e991da3e70208862ba32c31d2c7822541d28 (diff) |
menukeys (18apr16)
git-svn-id: svn://tug.org/texlive/trunk@40599 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/menukeys/menukeys.sty | 142 |
1 files changed, 86 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/latex/menukeys/menukeys.sty b/Master/texmf-dist/tex/latex/menukeys/menukeys.sty index 90bc75b22a6..3ff8a03bf00 100644 --- a/Master/texmf-dist/tex/latex/menukeys/menukeys.sty +++ b/Master/texmf-dist/tex/latex/menukeys/menukeys.sty @@ -23,7 +23,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2009/01/01] \ProvidesPackage{menukeys} - [2014/03/10 v1.3 a package to format menus paths and shortcuts] + [2016/04/18 v1.4 -- A package to format menus, paths and shortcuts] \RequirePackage{xparse} \RequirePackage{xstring} \RequirePackage{etoolbox} @@ -66,20 +66,25 @@ \tw@mk@error{Unknown value for option 'mackeys'\MessageBreak Possible values are 'symbols' or 'text'.}% } -\newcommand*{\tw@make@color@theme}[5]{% +\newcommand*{\tw@make@color@theme}[8]{% \definecolor{tw@color@theme@#1@bg}{#2}{#3}% \definecolor{tw@color@theme@#1@br}{#2}{#4}% \definecolor{tw@color@theme@#1@txt}{#2}{#5}% + \definecolor{tw@color@theme@#1@a}{#2}{#6}% + \definecolor{tw@color@theme@#1@b}{#2}{#7}% + \definecolor{tw@color@theme@#1@c}{#2}{#8}% } -\newcommand*{\newmenucolortheme}[5]{% +\NewDocumentCommand{\newmenucolortheme}{ m m m m m O{#3} O{#4} O{#5} }{% \@ifundefinedcolor{tw@color@theme@#1@bg}{% - \tw@make@color@theme{#1}{#2}{#3}{#4}{#5} + \tw@make@color@theme{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% }{% \tw@mk@error{Color theme '#1' already defined!\MessageBreak - Use \string\renewmenucolortheme\space instead.} + Use \string\renewmenucolortheme\space instead.}% } } -\let\renewmenucolortheme\tw@make@color@theme +\NewDocumentCommand{\renewmenucolortheme}{ m m m m m O{#3} O{#4} O{#5} }{% + \tw@make@color@theme{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% +} \newcommand*{\changemenucolor}[4]{% \IfSubStr{ bg br txt }{ #2 }{% \definecolor{tw@color@theme@#1@#2}{#3}{#4}% @@ -93,6 +98,9 @@ \colorlet{tw@color@theme@#1@bg}{tw@color@theme@#2@bg}% \colorlet{tw@color@theme@#1@br}{tw@color@theme@#2@br}% \colorlet{tw@color@theme@#1@txt}{tw@color@theme@#2@txt}% + \colorlet{tw@color@theme@#1@a}{tw@color@theme@#2@a}% + \colorlet{tw@color@theme@#1@b}{tw@color@theme@#2@b}% + \colorlet{tw@color@theme@#1@c}{tw@color@theme@#2@c}% }{% \tw@mk@error{Color theme '#1' already defined!\MessageBreak Use \string\renewmenucolortheme\space instead.} @@ -113,8 +121,8 @@ \newcommand{\usemenucolor}[1]{% tw@color@theme@\tw@current@color@theme @#1% } -\tw@make@color@theme{gray}{gray}{0.95}{0.3}{0} -\tw@make@color@theme{blacknwhite}{gray}{1}{0}{0} +\newmenucolortheme{gray}{gray}{0.95}{0.3}{0}[0.95][0][0] +\newmenucolortheme{blacknwhite}{gray}{1}{0}{0}[1][0][0] \newcommand{\tw@default@sep}{% \hspace{0.2em plus 0.1em minus 0.5em}% } @@ -280,7 +288,7 @@ }{% \csdef{tw@style@#2@#3}{% \tikz[baseline=(tw@node.base)]{% - \node(tw@node)[#4]{\strut\CurrentMenuElement};}}% + \node(tw@node)[#4]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}}% }% }% }{\tw@mk@error{No element '#3'. Possible values are\MessageBreak @@ -308,19 +316,19 @@ \tw@declare@style*{menus}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@menus@base,signal to=east]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]% {% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@menus@base,signal from=west,signal to=east]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@menus@base,signal from=west,]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@menus@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@menus@base]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{gray} \tikzset{tw@roundedmenus@base/.style={% @@ -339,19 +347,19 @@ \tw@declare@style*{roundedmenus}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@roundedmenus@base,signal to=east]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]% {% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@roundedmenus@base,signal from=west,signal to=east]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@roundedmenus@base,signal from=west,]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@roundedmenus@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@roundedmenus@base]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{gray} \tikzset{tw@angularmenus@base/.style={% @@ -369,19 +377,19 @@ \tw@declare@style*{angularmenus}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@angularmenus@base,signal to=east]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }[\hspace{-0.2em}\hspace{0em plus 0.1em minus 0.05em}]% {% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@angularmenus@base,signal from=west,signal to=east]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% \node(tw@node)[tw@angularmenus@base,signal from=west,]% - {\strut\CurrentMenuElement};}% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@angularmenus@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@angularmenus@base]{\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }{gray} \tikzset{tw@roundedkeys@base/.style={% @@ -396,10 +404,11 @@ }} \tw@declare@style@simple*{roundedkeys}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@roundedkeys@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@roundedkeys@base]% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }[% \hspace{0.1em plus 0.1em minus 0.05em}% - \raisebox{0.25ex}{\sffamily\relsize{-2}+}% + \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}% \hspace{0.1em plus 0.1em minus 0.05em}% ]{gray} @@ -414,15 +423,17 @@ font=\relsize{-1}\sffamily, general shadow={% shadow xshift=.2ex, shadow yshift=-.15ex, - fill=black, + fill=\usemenucolor{c}, }, }} \tw@declare@style@simple*{shadowedroundedkeys}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@shadowedroundedkeys@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@shadowedroundedkeys@base]% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};% + }% }[% \hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}% - \raisebox{0.25ex}{\sffamily\relsize{-2}+}% + \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}% \hspace{0.1em plus 0.1em minus 0.05em}% ][\hspace{0.2ex}]{gray} @@ -437,10 +448,11 @@ }} \tw@declare@style@simple*{angularkeys}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@angularkeys@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@angularkeys@base]% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }[% \hspace{0.1em plus 0.1em minus 0.05em}% - \raisebox{0.25ex}{\sffamily\relsize{-2}+}% + \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}% \hspace{0.1em plus 0.1em minus 0.05em}% ]{gray} @@ -454,15 +466,16 @@ font=\relsize{-1}\sffamily, general shadow={% shadow xshift=.2ex, shadow yshift=-.15ex, - fill=black, + fill=\usemenucolor{c}, }, }} \tw@declare@style@simple*{shadowedangularkeys}{% \tikz[baseline={($(tw@node.base)+(0,-0.2ex)$)}]{% - \node(tw@node)[tw@shadowedangularkeys@base]{\strut\CurrentMenuElement};}% + \node(tw@node)[tw@shadowedangularkeys@base]% + {\strut\color{\usemenucolor{txt}}\CurrentMenuElement};}% }[% \hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}% - \raisebox{0.25ex}{\sffamily\relsize{-2}+}% + \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}% \hspace{0.1em plus 0.1em minus 0.05em}% ][\hspace{0.2ex}]{gray} @@ -480,21 +493,22 @@ \begin{tikzpicture}[baseline={($(tw@node.south)+(0,0.8ex)$)}]% \node(tw@node)[% tw@typewriterkeys@base, inner sep=1.25pt, line width=0.6pt% - ]{\tw@typewriterkeys@curr@elem}; - \node[tw@typewriterkeys@base]{\tw@typewriterkeys@curr@elem}; + ]{\color{\usemenucolor{txt}}\tw@typewriterkeys@curr@elem}; + \node[tw@typewriterkeys@base]% + {\color{\usemenucolor{txt}}\tw@typewriterkeys@curr@elem}; \end{tikzpicture}% }[% \hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}% - \raisebox{0.25ex}{\sffamily\relsize{-2}+}% + \textcolor{\usemenucolor{b}}{\raisebox{0.25ex}{\sffamily\relsize{-2}+}}% \hspace{0.1em plus 0.1em minus 0.05em}% ]{blacknwhite} \tw@declare@style@simple*{paths}{% - {\ttfamily\CurrentMenuElement}% + {\ttfamily\color{\usemenucolor{txt}}\CurrentMenuElement}% }[% \hspace{0.2em plus 0.1em}% \raisebox{0.08ex}{% - \tikz{\fill[\usemenucolor{txt}] (0,0) -- (0.5ex,0.5ex)% + \tikz{\fill[\usemenucolor{c}] (0,0) -- (0.5ex,0.5ex)% -- (0,1ex) -- cycle;}% }% \hspace{0.2em plus 0.1em}% @@ -518,46 +532,47 @@ }% }% \hyphenchar\font=\value{tw@hyphen@char@num}\relax + \color{\usemenucolor{txt}}% \CurrentMenuElement}% }[% \hspace{0.2em plus 0.1em}% \raisebox{0.08ex}{% - \tikz{\fill[\usemenucolor{txt}] (0,0) -- (0.5ex,0.5ex)% + \tikz{\fill[\usemenucolor{c}] (0,0) -- (0.5ex,0.5ex)% -- (0,1ex) -- cycle;}% }% \hspace{0.2em plus 0.1em}% ]{blacknwhite} -\newcommand*{\drawtikzfolder}[1][white]{% +\NewDocumentCommand{\drawtikzfolder}{O{white} O{black}}{% \begin{tikzpicture}[rounded corners=0.02ex,scale=0.7] - \draw (0,0) -- (1em,0) -- (1em,1.5ex) -- (0.5em,1.5ex) -- % + \draw [#2] (0,0) -- (1em,0) -- (1em,1.5ex) -- (0.5em,1.5ex) -- % (0.4em,1.7ex) -- (0.1em,1.7ex) -- (0,1.5ex) -- cycle; - \draw [fill=#1] (0,0) -- (1em,0) -- (0.85em,1.15ex) -- % + \draw [#2,fill=#1] (0,0) -- (1em,0) -- (0.85em,1.15ex) -- % ++(-1em,0) -- cycle; \end{tikzpicture}% } \copymenustyle{pathswithfolder}{paths} \changemenuelement{pathswithfolder}{pre}{% - \textcolor{\usemenucolor{txt}}{\drawtikzfolder}% + \drawtikzfolder[\usemenucolor{a}][\usemenucolor{b}]% \hspace{0.2em plus 0.1em}% } \copymenustyle{pathswithblackfolder}{paths} \changemenuelement{pathswithblackfolder}{pre}{% - \textcolor{\usemenucolor{txt}}{\drawtikzfolder[\usemenucolor{txt}]}% + \drawtikzfolder[\usemenucolor{c}][\usemenucolor{b}]% \hspace{0.2em plus 0.1em}% } \copymenustyle{hyphenatepathswithfolder}{hyphenatepaths} \changemenuelement{hyphenatepathswithfolder}{pre}{% - \textcolor{\usemenucolor{txt}}{\drawtikzfolder}% + \drawtikzfolder[\usemenucolor{a}][\usemenucolor{b}]% \hspace{0.2em plus 0.1em}% } \copymenustyle{hyphenatepathswithblackfolder}{hyphenatepaths} \changemenuelement{hyphenatepathswithblackfolder}{pre}{% - \textcolor{\usemenucolor{txt}}{\drawtikzfolder[\usemenucolor{txt}]}% + \drawtikzfolder[\usemenucolor{c}][\usemenucolor{b}]% \hspace{0.2em plus 0.1em}% } \edef\tw@default@input@sep{,} @@ -721,25 +736,34 @@ \end{tikzpicture}% } \tw@make@key@macro*{\tab} - \def\tw@mk@esc@win{Esc} \tw@define@mackey{% \def\tw@mk@esc@mac{esc} }{% \tw@make@key@box{esc@mac}{% \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol] + \draw [->] (0.5ex,0.5ex) -- ++(135:1.1ex); + \draw (0.5ex,0.5ex) ++(105:0.6ex) arc (105:-195:0.6ex); + \end{tikzpicture}% + }% +} +\tw@make@key@macro*{\esc} +\def\tw@mk@oldesc@win{Esc} +\tw@define@mackey{% + \def\tw@mk@oldesc@mac{esc} +}{% + \tw@make@key@box{oldesc@mac}{% + \begin{tikzpicture}[yshift=-0.1ex,menukeys key symbol] \draw [->] (0.5ex,0.5ex) -- ++(45:1.1ex); \draw (0.5ex,0.5ex) ++(15:0.6ex) arc (15:-285:0.6ex); \end{tikzpicture}% }% } -\tw@make@key@macro*{\esc} - +\tw@make@key@macro*{\oldesc} \providecommand\ctrlname{Ctrl} \def\tw@mk@ctrl@win{\ctrlname} \def\tw@mk@ctrl@mac{ctrl} \tw@make@key@macro*{\ctrl} - \def\tw@mk@Alt@win{Alt} \tw@define@mackey{% \def\tw@mk@Alt@mac{alt}% @@ -752,9 +776,7 @@ }% } \tw@make@key@macro*{\Alt} - \providecommand*{\AltGr}{Alt\,Gr} - \def\tw@mk@cmd@win{% \tw@mk@warning{'\string\cmd' only for Mac!}% } @@ -771,11 +793,9 @@ }% } \tw@make@key@macro*{\cmd} - \providecommand*{\Space}{\expandonce{\rule{3em}{0pt}}} \newcommand{\spacename}{Space} \providecommand*{\SPACE}{\expandonce{\rule{2em}{0pt}\spacename\rule{2em}{0pt}}} - \tw@make@key@box{return@mac}{% \begin{tikzpicture}[yshift=0.25ex,menukeys key symbol] \draw [->, rounded corners=0.2ex] (1.25ex,1ex) -| % @@ -788,7 +808,6 @@ \end{tikzpicture}% } \tw@make@key@macro*{\return} - \def\tw@mk@enter@win{Enter} \tw@make@key@box{enter@mac}{% \begin{tikzpicture}[menukeys key symbol] @@ -797,7 +816,6 @@ \end{tikzpicture}% } \tw@make@key@macro*{\enter} - \def\tw@mk@winmenu@mac{% \tw@mk@warning{'\string\winmenu' only for Windows!}% } @@ -810,14 +828,12 @@ \end{tikzpicture}% } \tw@make@key@macro*{\winmenu} - \tw@make@key@box{backspace}{% \begin{tikzpicture}[yshift=0.65ex,menukeys key symbol] \draw [<-,menukeys thick] (0,0) -- (1.35em,0); \end{tikzpicture}% } \tw@make@key@macro{\backspace} - \providecommand{\delname}{Del.} \def\tw@mk@del@win{\delname} \tw@define@mackey{% @@ -833,6 +849,20 @@ }% } \tw@make@key@macro*{\del} +\def\tw@mk@backdel@win{\delname} +\tw@define@mackey{% + \def\tw@mk@backdel@mac{\delname}% +}{% + \tw@make@key@box{backdel@mac}{% + \begin{tikzpicture}[yshift=0.2ex,menukeys key symbol] + \draw (2ex,0) -- (0.5ex,0) -- (0,0.5ex) --% + (0.5ex,1ex) -- (2ex,1ex) -- cycle; + \draw (1ex,0.2ex) -- (1.6ex,0.8ex); + \draw (1ex,0.8ex) -- (1.6ex,0.2ex); + \end{tikzpicture}% + }% +} +\tw@make@key@macro*{\backdel} \tw@make@key@box{arrowkeyup}{% \begin{tikzpicture}[yshift=-0.2ex,menukeys key symbol] \draw [->] (0,0) -- (0,0.8em); |