tweh / menukeys Goto Github PK
View Code? Open in Web Editor NEWA LaTeX package to typeset menu sequences, key strokes, paths etc.
A LaTeX package to typeset menu sequences, key strokes, paths etc.
Suggestion to add more styles for keys, e.g.:
% create new menustyle styles (used for keys)
% - roundedkeyscondensed: no '+' between keys
\copymenustyle{roundedkeyscondensed}{roundedkeys}
\changemenuelement{roundedkeyscondensed}{sep}{%
\hspace{0.2em plus 0.1em minus 0.05em}%
}
% - nobordercondensed: no border around keys, and no '+' between keys
\copymenustyle{nobordercondensed}{paths}
\changemenuelement{nobordercondensed}{pre}{%
\hspace{0.2em plus 0.1em}%
}
\changemenuelement{nobordercondensed}{sep}{%
\hspace{0.2em plus 0.1em}%
}
% replace \keys with borderless condensed version
\renewmenumacro{\keys}[+]{nobordercondensed}
% create new menu macro \keysb (orginal style with border and '+' between keys)
\newmenumacro{\keysb}[+]{roundedkeys}
% create new menu macro \keysbc (orginal style with border but no '+' between keys)
\newmenumacro{\keysbc}[+]{roundedkeyscondensed}
Does menukeys
really need babel
?
See http://www.golatex.de/korrumpierte-tasten-symbole-paket-menukeys-t9663.html
menukeys
before babel
— really necessary?catoptions
menukeys/menukeys-farbe.zip
)\strut
as a helpful macro inside the user defined styles to make all boxes the same height.\renewmenumacro
) in section 4.2.4With an up to date TeX Live 2013 as of today, and even if menukeys is loaded after babel, the 'activeness' of 2 (:
and !
) of the 4 characters that are active with french
option is lost.
\documentclass[french]{article}
\usepackage{babel}
% \usepackage{menukeys}
\begin{document}
\begin{itemize}
\item Test:
\item Test;
\item Test?
\item Test!
\end{itemize}
\end{document}
\documentclass[french]{article}
\usepackage{babel}
\usepackage{menukeys}
\begin{document}
\begin{itemize}
\item Test:
\item Test;
\item Test?
\item Test!
\end{itemize}
\end{document}
Here is my file list of the last .tex
file:
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
babel.sty 2013/10/10 3.9g The Babel package
frenchb.ldf 2013/07/06 v2.6e French support from the babel system
frenchb.cfg
scalefnt.sty
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
menukeys.sty 2013/07/23 v1.2a a package to format menus paths and shortcuts
xparse.sty 2013/10/13 v4597 L3 Experimental document command parser
expl3.sty 2013/10/13 v4597 L3 Experimental code bundle wrapper
l3names.sty 2012/12/07 v4346 L3 Namespace for primitives
l3bootstrap.sty 2013/07/28 v4581 L3 Experimental bootstrap code
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty 2013/07/28 v4581 L3 Basic definitions
l3expan.sty 2013/08/17 v4584 L3 Argument expansion
l3tl.sty 2013/09/16 v4592 L3 Token lists
l3seq.sty 2013/07/28 v4581 L3 Sequences and stacks
l3int.sty 2013/08/02 v4583 L3 Integers
l3quark.sty 2013/07/21 v4564 L3 Quarks
l3prg.sty 2013/08/25 v4587 L3 Control structures
l3clist.sty 2013/07/28 v4581 L3 Comma separated lists
l3token.sty 2013/08/25 v4587 L3 Experimental token manipulation
l3prop.sty 2013/07/28 v4581 L3 Property lists
l3msg.sty 2013/07/28 v4581 L3 Messages
l3file.sty 2013/10/13 v4596 L3 File and I/O operations
l3skip.sty 2013/07/28 v4581 L3 Dimensions and skips
l3keys.sty 2013/07/28 v4581 L3 Experimental key-value interfaces
l3fp.sty 2013/07/09 v4521 L3 Floating points
l3box.sty 2013/07/28 v4581 L3 Experimental boxes
l3coffins.sty 2012/09/09 v4212 L3 Coffin code layer
l3color.sty 2012/08/29 v4156 L3 Experimental color support
l3luatex.sty 2013/07/28 v4581 L3 Experimental LuaTeX-specific functions
l3candidates.sty 2013/07/24 v4576 L3 Experimental additions to l3kernel
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
xstring.sty 2013/10/13 v1.7c String manipulations (C Tellechea)
etoolbox.sty 2011/01/03 v2.1 e-TeX tools for LaTeX
tikz.sty 2010/10/13 v2.10 (rcs-revision 1.76)
pgf.sty 2008/01/15 v2.10 (rcs-revision 1.12)
pgfrcs.sty 2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfcore.sty 2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
pgfsys.sty 2010/06/30 v2.10 (rcs-revision 1.37)
pgfsys.code.tex
pgfsyssoftpath.code.tex 2008/07/18 (rcs-revision 1.7)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pgfcore.code.tex
pgfcomp-version-0-65.sty 2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty 2007/07/23 v2.10 (rcs-revision 1.1)
pgffor.sty 2010/03/23 v2.10 (rcs-revision 1.18)
pgfkeys.sty
pgfkeys.code.tex
pgffor.code.tex
tikz.code.tex
adjustbox.sty 2012/05/21 v1.0 Adjusting TeX boxes (trim, clip, ...)
xkeyval.sty 2012/10/14 v2.6b package option processing (HA)
xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)
adjcalc.sty 2012/05/16 v1.1 Provides advanced setlength with multiple back-
ends (calc, etex, pgfmath)
trimclip.sty 2012/05/16 v1.0 Trim and clip general TeX material
collectbox.sty 2012/05/17 v0.4b Collect macro arguments as boxes
tc-pdftex.def 2012/05/13 v1.0 Clipping driver for pdftex
ifoddpage.sty 2011/09/13 v1.0 Conditionals for odd/even page detection
varwidth.sty 2009/03/30 ver 0.92; Variable-width minipages
relsize.sty 2013/03/29 ver 4.1
catoptions.sty 2012/11/22 v0.2.7f Securing catcodes and parsing options (AM)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
supp-pdf.mkii
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
epstopdf-base.sty 2010/02/09 v2.5 Base part for package epstopdf
grfext.sty 2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
***********
One feature I would like to suggest concerns menus: I would like to be able to write \menu{File>} and \menu{>Exit} and those items to be drawn correspondingly just as the pieces of \menu{File>Exit} would be drawn. Currently, both of these are drawn as single items, like \menu{File} and \menu{Exit}.
Of course, if you implement this, then also \menu{>Settings>} should be possible and drawn accordingly.
All the above will let us differentiate the menu, the commands, and the intermediate commands.
(by Flavio)
I was trying to use the “menukeys” LaTeX package when writing my diploma thesis, but I cannot manage to compile the document, because when I add the package, and MikTex downloads all the dependencies, I get the following error:
latex.exe> ("C:\Program Files (x86)\MikTex\tex\latex\adjustbox\adjustbox.sty"
latex.exe> ("C:\Program Files (x86)\MikTex\tex\latex\adjustbox\adjcalc.sty")
latex.exe> ("C:\Program Files (x86)\MikTex\tex\latex\adjustbox\trimclip.sty"
latex.exe> ("C:\Program Files (x86)\MikTex\tex\latex\collectbox\collectbox.sty")
latex.exe>
latex.exe> ! LaTeX Error: Command \clipbox already defined.
latex.exe> Or name \end... illegal, see p.192 of the manual.
latex.exe>
latex.exe> See the LaTeX manual or LaTeX Companion for explanation.
latex.exe> Type H <return> for immediate help.
The header file I use for my document is appended at the end of this email. Do you have an idea why I’m getting that error? Is there a known collisions of the dependencies that “menukeys” use? Is there an (easy) way to remove the colliding dependency? Maybe some features don’t work, but at least I can print buttons and menu paths, I don’t know how dependent is “menukeys” from that package.
% PACKAGE DECLARATIONS --------------------------------------------------------
\usepackage[T1]{fontenc}
\usepackage{ae,aecompl}
\usepackage[english,spanish]{babel}
\usepackage[ansinew]{inputenc}
\usepackage{enumerate}
\usepackage{fancyhdr}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{cancel}
\usepackage{graphicx}
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\usepackage[usenames]{color}
\usepackage{textcomp}
\usepackage[miktex]{gnuplottex}
\def\pgfsysdriver{pgfsys-dvipdfm.def}
\usepackage{pstricks,pspicture}
\usepackage{upgreek}
\usepackage[printonlyused,withpage]{acronym}
\usepackage{lscape}
\usepackage{marvosym}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{appendix}
\usepackage{listings}
\usepackage{longtable}
\usepackage[hyphens]{url}
\usepackage[breaklinks]{hyperref}
%For button rendering
\usepackage{menukeys}
% FANCY HEADERS ---------------------------------------------------------------
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\lfoot{Flavio González Vázquez}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhfoffset[E]{\linewidth}
% CUSTOM COMMANDS -------------------------------------------------------------
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Horizontal rule
\newcommand{\thinrule}{\rule{\linewidth}{0.1mm}} % Thin horizontal rule
\newcommand{\thickrule}{\HRule}
\newcommand{\fvtitle}[1]{\title{#1} \begin{center} \LARGE \emph{#1} \end{center} \bigskip} % My title
\newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}
\newcommand{\subscript}[1]{\ensuremath{_{\textrm{#1}}}}
\newcommand{\df}[2]{\dfrac{\partial #1}{\partial #2}}
\newcommand{\dftwo}[2]{\dfrac{\partial^2 #1}{\partial #2^2}} % Second order derivative
\newcommand{\dftwoo}[3]{\dfrac{\partial^2 #1}{\partial #2 \partial #3}} % Second order derivative with mixed variables
\newcommand{\nc}[1]{\textbf{\emph{#1}}} % Bold variable
\newcommand{\abs}[1]{\left|#1\right|} % Absolute value with big delimiters
\newcommand{\ms}{$\ \dfrac{\text{m}}{\text{s}}\ $} % Meters per second
\newcommand{\mss}{$\ \dfrac{\text{m}}{\text{s}^2}\ $} % Meters per second squared
\ifx\dB\undefined\newcommand{\dB}{\text{ dB}}\fi
\ifx\dBm\undefined\newcommand{\dBm}{\text{ dBm}}\fi
\ifx\dBW\undefined\newcommand{\dBW}{\text{ dBW}}\fi
\newcommand{\ds}{\displaystyle}
\newcommand{\ts}{\textstyle}
\newcommand{\bp}[1]{\left(#1\right)} % Big parentheses
\newcommand{\bsb}[1]{\left[#1\right]} % Big square brackets
\newcommand{\infsum}[1]{\sum_{#1=-\infty}^\infty} % Infinity sum
\newcommand{\infint}{\ds\int_{-\infty}^\infty} % Infinity integral
\newcommand{\p}{^\prime}
\newcommand{\pp}{^{\prime\prime}}
\newcommand{\dom}[1]{\text{Dom}\left(#1\right)}
\newcommand{\recorrido}[1]{\text{Im}\left(#1\right)}
\newcommand{\sol}[1]{\begin{flushright}Sol.: #1\end{flushright}} % Right flushed solution box
\newcommand{\fvheader}[1]{\renewcommand{\headrulewidth}{0.4pt}
\lhead{#1}} % Change header title
\newcommand{\fvrightheader}[1]{\rhead{#1}}
\newcommand{\fvfooter}[1]{\lfoot{#1}}
\newcommand{\fvstandardmargins}{\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}} % Change defaults margins
\newcommand{\fvnarrowmargins}{\usepackage[top=2cm,bottom=1.5cm,left=1.5cm,right=2cm]{geometry}}
\newcommand{\fvbullets}{\renewcommand{\labelitemi}{$\bullet$}} % Change itemize boxes to bullets
\ifx\sinc\undefined\newcommand{\sinc}{\text{sinc}}\fi
\newcommand{\mathre}{\Re e} % Real part
\newcommand{\mathim}{\Im m} % Imaginary part
\newcommand{\inv}{^{-1}}
\newcommand{\micro}{$\upmu$}
\newcommand{\e}[1]{\cdot 10^{#1}}
\newcommand{\ex}[1]{10^{#1}}
\newcommand{\smallerfig}{\def\JPicScale{.8}\footnotesize}
% XML STYLING -----------------------------------------------------------------
\definecolor{gray}{rgb}{0.4,0.4,0.4}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\definecolor{cyan}{rgb}{0.0,0.6,0.6}
\lstset{
basicstyle=\ttfamily,
columns=fullflexible,
showstringspaces=false,
commentstyle=\color{gray}\upshape
}
\lstdefinelanguage{XML}{
morestring=[b]",
morestring=[s]{>}{<},
morecomment=[s]{<?}{?>},
stringstyle=\color{black},
identifierstyle=\color{darkblue},
keywordstyle=\color{cyan},
morekeywords={xmlns,version,type}
}
Every menu macro should get an according font macro, e.g. \menu
get’s \menufont
, to make changes of fonts more easy. Care for the right size, i.e. the text normally should keep smaller than the regular text, so \menufontsize
should be added too.
\menufontsize
mus be called after \menufont
so that size changes in \menufont
dont have an effect.
Other idea: A macro to change internal font macros, e.g. \mk@font@menu
and \mk@size@menu
\menumacrofont{<menu macro>}{<font macros>}
\menumacrofont{\menu}{\itshape}
\menumacrofontsize{<menu macro>}{<font size macros>}
\menumacrofontsize{\menu}{\small}
It seems as if there is an incompatibility between menukeys and biblatex. The following example complains that
! Package xkeyval Error: `style' undefined in families `blx@opt@pre'.
See the xkeyval package documentation for explanation.
Type H <return> for immediate help.
...
l.13053 \blx@processoptions
?
! Package xkeyval Error: `backend' undefined in families `blx@opt@pre'.
See the xkeyval package documentation for explanation.
Type H <return> for immediate help.
...
l.13053 \blx@processoptions
?
)
Here is the minimal example:
\documentclass[12pt,ngerman]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{menukeys}
\usepackage[style=authortitle-icomp,backend=biber]{biblatex}%
\begin{document}
foo
\end{document}
Whereas \ul{ü}
works like a charm, \menu{\ul{ü}}
throws a "! Argument of @Firstofone has an extra }." error, as shown by the following MCE.
\documentclass{article}
%
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{soulutf8}
\usepackage{menukeys}
%
\begin{document}
\ul{ü}
\menu{\ul{ü}}
\end{document}
BTW this error didn't arise with older versions of menukeys (e.g. in TL
2012) and it appeared with recent versions.
Whenever I got a path with a dash (-) in it, like c:\temp\dir-dir
, menukeys puts a space before the -.
So, it comes out like this: c:\temp\dir -dir
This is not correct, since a reader will assume a space before the dash.
This only occurs when using the [bslash]
option. ->\directory[bslash]{c:\temp\dir-dir}
Page up
and Page down
Pos1
or Home
End
\let\alt\Alt
(by Tommaso)
The \edef
that you have added to the last version of the package are wrong. In fact, they must be \protected@edef
.
Try typeset the following example:
\documentclass{article}
\usepackage{menukeys}
\begin{document}
\menu{\textsc{europe}}
\end{document}
There are many other errors.
(by Denis)
AFAICS, menukeys changes the page size of the documents: running
pdflatex on the following test.tex file
\documentclass{article}
% \usepackage{menukeys}
\begin{document}
Foo
\end{document}
leads to an A4 page size document (setting I chose when installing TeX
Live 2013):
$ pdfinfo test.pdf | grep 'Page size'
Page size: 595.276 x 841.89 pts (A4)
but, with menukeys loaded, to a letter page size document:
$ pdfinfo test.pdf | grep 'Page size'
Page size: 612 x 792 pts (letter)
\renewmenumacro{\directory}{pathswithfolder}
causes a warning that the command is already robust …
(by Klaus)
\usepackage[autostyle,german=guillemets]{csquotes}
\usepackage{menukeys}
menukeys
nach csquotes
geladen werden: Sonst
no value specified for key ‘german’
und \tab etc funktionieren nicht.
(by Denis)
I noticed a trouble when a \menu or a \keys contains ordinary text and
\listinline' listings and is at the beginning of a list's item. In the
following MCE, the bullet is inside the frame:
\documentclass{article}
\usepackage{listings}
\usepackage{menukeys}
\begin{document}
\begin{itemize}
\item \menu{Test \lstinline|test|}
\item \keys{Test \lstinline|test|}
\end{itemize}
\end{document}
As a workaround, it is possible to add a \mbox{} after the \item, but
it is not very elegant …
Hi!
Like described in a comment in http://tex.stackexchange.com/a/62352 your Mac escape and delete keys are drawn to the right, but it should be to the left.
Hope you will fix this. Regards,
Add a macro \click
(\doubleclick
, \rightclick
). These macros should print a mouse pointer indicating the click and the left or right button. The style depends on the os
option.
If used inside a menu macro the pointer should suppress the border etc. A starred version shouldn’t suppress it.
All pointer forms should be available as macros.
L
by `R!´!)More alternatives
Linux pointer should be available too.
If I use
\keys[-]{Alt-T} I still get [Alt + T] in the output. How can I define that e.g. "--" is to be used for the output.
The MWE
\documentclass[french]{article}
\usepackage{babel}
\usepackage{menukeys}
\begin{document}
Test:
\end{document}
points out that the work-around for babels’s active characters in
French doesn't work if menukeys is loaded after babel. Maybe it should
be mentioned in the documentation.
just in case you are not aware of this particular issue and want to include it in an updated version of the manual for your LaTeX menukeys-package. Seemingly, the package causes loads of trouble when it is loaded before BibLaTeX; basically preventing BibLaTeX from correctly understanding any of the supplied options. Loading menukeys after BibLaTeX gets rid of the problem under MikTeX 2.9 on Win 7. I am aware that you generally recommend to load menukeys as one of the latter packages, but you also state explicitly to load it after inputenc and xcolor. And since BibLaTeX is increasingly popular you may want to make sure that users know that this package should be loaded before menukeys as well.
by Manuel Weinkauf via mail …
Formatted text doesn't work. For instance:
\documentclass{article}
\usepackage{menukeys}
\begin{document}
\menu{\texttt{Foo}}
\end{document}
Often, menus in GUIs have one letter underlined in order to point
out the corresponding shortcut. Currently, when used with beamer, it
is impossible to underline text within \menu
command:
\documentclass{beamer}
\usepackage{menukeys}
\begin{document}
\menu{\underline{F}oo}
\end{document}
(by Steffen)
Zu sehen ist auch, dass trotz hyphenated paths die Trennung nicht 100%ig
am rechten Rand des Textbereiches funktioniert (T1-fontencoding ist
eingestellt!), das sollte als Warnung in die Dokumentation. Wenn
übrigens in diesen langen Pfadnamen gar kein Leerzeichen vorhanden ist,
dann wird eines vor der Dateinamenserweiterung, hier .txt
, eingefügt!
Probier’s aus. Auch das sollte erwähnt werden; Lösung ist, die Datei mit
Leerzeichen vom Hierarchietrenner, also hier den Backslash, abzutrennen.
In line 763 \ctrlname is not used
line 763 \def\tw@mk@ctrl@mac{ctrl}
Wouldn't it be better to use \def\tw@mk@ctrl@mac{\ctrlname}
With an up to date TeX Live 2013, the following MCE:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[os=win]{menukeys}
\usepackage{pstricks}
%
\begin{document}
Foo
\end{document}
throws the error:
! LaTeX Error: Option clash for package xcolor.
Loading menukeys
at the end throws the error:
! LaTeX Error: Command \clipbox already defined.
I've seen in the menukeys
documentation that the xcolor
options could be passed at the \documentclass
and, indeed, that works that way. But, with beamer
class, xcolor
options have to be passed as in the following MCE and same errors arise:
\documentclass[xcolor={table}]{beamer}
\usepackage[os=win]{menukeys}
\usepackage{pstricks}
%
\begin{document}
Foo
\end{document}
(by Steffen)
Ich habe einige Kommandos für mich in Key-Value-Syntax umgebaut. Das
finde ich deutlich besser. Ich habe dafür das Paket keycommand
genommen, ein Paketautor sollte wahrscheinlich direkt (x)keyvalue
oder pgfkeys
oder … nehmen. keycommand
nimmt wohl XKeyValue,
aber mit vielen Patches, wenn ich die Doku richtig verstehe. Ich habe
meine Version wieder angehängt. Enthält auch einen Patch von J. Wright für
keycommand
.
Verwendung dann so (die richtigen Farben sehen anders aus):
\newmenucolortheme[
clrmodel=named,
bgcolor=yellow,
brcolor=olive,
shdcolor=brown,
txtcolor=red,
]{yellow}
Hi!
It would be great if you could publish the tex sources of your menukeys abstract manual which is only published as a pdf in your Git repository. It it always nice for LaTeX beginners to see how advanced users like you write their own documents. Also, it would be a great example to see in-context how your menukeys extension has to be used.
Thanks a lot.
When you use the overlay function of the beamer
class, e. g. for displaying items step by step, the footer of the frame won't be displayed until the last occurrence of \keys
:
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usetheme{CambridgeUS}
\usepackage{menukeys}
\begin{document}
\begin{frame}
\frametitle{Slide 1}
\begin{itemize}[<+->]
\item Item 1
\item Item 2
\item Item 3 \keys{A}
\item Item 4 \keys{B}
\item Item 5
\end{itemize}
\end{frame}
\end{document}
No footer:
Footer:
While the use of menukeys
is great visually, it makes it impossible to re-use a path by selecting and copying it.
It would be great if it was possible to change the actual text behind the visual separators to re-use the same separator that was used to break the path appart.
Hi there,
Since your package makes high use of Tikz and the latter is using pgfkeys internally, I was wondering why not use that keyvalue implementation instead of kvoptions you are currently using. This would require to remove that package from the requirement list (I checked pfdkeys is actually loaded when compiling your package :( ) and I think pgfkeys is easier to use and more featureful than kvoptions.
What do you think of this? Personally I have learned pgfkeys in a few hours using the pgfkeys manual included in the one from the TIKZ.
In LaTeX, there are several keyvalues implementations. If you want to have a good overview of the available implementation, this (small, only 13 pages) article is a must read.
Regards,
(by Bernd)
\ProvidesPackage{menukeys}
[2012/04/11 v1.1b a package to format menus paths and shortcuts]
vs.
\ProvidesPackage{menukeys}
[2013/05/28 v1.1a a package to format menus paths and shortcuts]
I was writing a Windows-specific documentation about parameters and values to configure in gpedit.msc
. I was using the \menu
command to represent the hierarchy. As you know Microsoft is using pretty long hierarchy names, like this one (in French) \menu{Configuration de l’ordinateur > Modèles d’administration > Composants Windows > Chiffrement de lecteur BitLocker > Lecteurs du système d’exploitation > Autoriser Bitlocker sans un module de plateforme sécurisée compatible (requiert un mot de passe ou une clé de démarrage sur un disque mémoire flash USB)}
.
While the path is cut when the item level changes, the problem arises for the last item which is much larger than the above level. In such a case, this LaTeX package isn't breaking very long keys, so that the text continues in the margin of the page, without having a line break when the text is too long to fit on the same line.
Do you have a solution to circumvent this issue or could please provide a fix?
Thanks in advance.
(by Sašo)
I have a little problem, which I'm unable to resolve myself. I hope you can help. (Honestly, although I really tried to exclude this possibility, the problem might be limited to by box...)
Some tikz-drawn keys don't come out right:
I have a workaround: copy the keybox-producing code into the document (not the preamble). Then (see the second line) the keys are drawn perfectly.
Given the workaround, I suspect the culprit might have to do with catcodes … possibly some disagreement between tikz
and expl3
. But since I have virtually zero experience with expl3
, I'm unable to investigate further myself.
\documentclass{minimal}
\usepackage[os=win]{menukeys}
% this makes no difference in the preamble:
% \makeatletter
% \tw@make@key@box{tab@win}{%
% \begin{tikzpicture}[yshift=0.1ex,baseline={(0,0)}]
% \draw [->,semithick] (0.2em,0) -- (1.2em,0);
% \draw (1.2em,-0.45ex) -- (1.2em,0.45ex);
% \draw [<-,semithick] (0,1ex) -- (1em,1ex);
% \draw (0,0.55ex) -- (0,1.55ex);
% \end{tikzpicture}%
% }
% \tw@make@key@box{return@win}{%
% \begin{tikzpicture}[semithick]
% \draw [->] (1ex,1.25ex) |- (0,0);
% \end{tikzpicture}%
% }
% \makeatother
\begin{document}
\keys{\tab} \keys{\return}
\makeatletter
% copied verbatim from menukeys.sty
\tw@make@key@box{tab@win}{%
\begin{tikzpicture}[yshift=0.1ex,baseline={(0,0)}]
\draw [->,semithick] (0.2em,0) -- (1.2em,0);
\draw (1.2em,-0.45ex) -- (1.2em,0.45ex);
\draw [<-,semithick] (0,1ex) -- (1em,1ex);
\draw (0,0.55ex) -- (0,1.55ex);
\end{tikzpicture}%
}
\tw@make@key@box{return@win}{%
\begin{tikzpicture}[semithick]
\draw [->] (1ex,1.25ex) |- (0,0);
\end{tikzpicture}%
}
\makeatother
\keys{\tab} \keys{\return}
\end{document}
The key symbols such as \cmd
are too static, which means they don’t respect font changes like \huge
or \color{red}
. The reason is the boxing of the symbols …
\documentclass{article}
\usepackage[os=mac]{menukeys}
\newmenucolortheme{mycolors}{named}{gray}{black}{blue}
\changemenucolortheme{roundedkeys}{mycolors}
\begin{document}
Text \keys{\cmd+A}
\Huge
Text \keys{\cmd+A}
\end{document}
Create \mksetup{<options>}
.
Check which options can be set this was an which should be only real package options.
Hello,
I have just discovered your package ; it is quite nice !
However, the PDF documentation seems to lack explanation about how to select one the style presented in Section 4.2. Indeed, this section details everything about styles, but not how to produce the different examples provided in Subsection 4.2.1.
This is extremely frustrating !
I resorted to looking into the source code of the manual and it seems that using \renewmenumacro{\keys}{shadowedangularkeys}
for example works. Yet I am not sure if this is the correct way to change the style for displaying keys, as this command is only mentioned in relation with menu styles, which is also consistent with its name.
I think the documentation would be improved by adding a new Subsection just before current Subsection 4.2.1 with title "Selecting a style".
Macros in\menu
’s argument are okay:
\documentclass{article}
\usepackage{menukeys}
\newcommand{\Bar}{Foo}
\begin{document}
\menu{\Bar}
\end{document}
but not if used with \xspace
command of the xspace
package:
\documentclass{article}
\usepackage{xspace}
\usepackage{menukeys}
\newcommand{\Bar}{Foo\xspace}
\begin{document}
\menu{\Bar}
\end{document}
It could be usefull to be able to change the text for \enter
(and maybe other keys) the same way as it is possible for \ctrl
, \del
and \SPACE
. (Although it is not difficult to get around using \keys{MyEnterName}...)
(by Steffen)
ich habe hier bei mir die Version 1.1b von „menukeys“ so geändert,
dass ich zusätzlich die Farbe des Schattens und der Kante des
TikZ-Folders (also das Kommando „\drawtikzfolder“) beeinflussen kann.
Ich fände es sehr schön, wenn Du das so oder so ähnlich in Dein Paket
einbauen könntest. Siehe die Datei „mymenukeys.sty“ im Anhang.
Der große Nachteil meiner Änderung ist, dass bisheriger Code
umgeschrieben werden muss. Ich hätte auch lieber die Schattenfarbe als
optionales Argument eingeführt, aber mit meinen Kenntnissen habe ich
das nicht hinbekommen. Ich hatte es mit xparse-Kommandos ausprobiert, da
man dort ja ein optionales Argument auch als letztes angeben kann, war
aber nicht erfolgreich.
Auch „\drawtikzfolder“ hatte ich zunächst so geändert, dass ich zwei
Farben ändern kann:
\newcommand*{\drawtikzfolder}[2][\usemenucolor{br}]{%
\begin{tikzpicture}[#1,rounded corners=0.02ex,scale=0.7]
\draw (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=#2] (0,0) -- (1em,0) -- (0.85em,1.15ex) -- %
++(-1em,0) -- cycle;
\end{tikzpicture}%
}
Ich finde diese Version eigentlich besser, aber auch hier müsste Code
umgeschrieben werden. Bei der jetzt im geänderten Paket verwendeten
Version muss unter Umständen „nur“ ein eigenes Farbschema definiert
werden (für die Kantenfarbe).
The menu macros should have an optional argument to pass options, e.g. \menu[<options>]{A > B > C}
.
Check which options shouldn’t be available in this way.
The following MCE throws a "! TeX capacity exceeded" error.
\documentclass{beamer}
\usepackage{menukeys}
\begin{document}
\menu{Op\underline{t}ions}
\end{document}
Hi. You need to specify in your installation rules to put menukeys after hyperref has been loaded when the later is tweaked.
The following example does not compile and crashes on the line \PassOptionsToPackage{hyphens}{url}
.
\documentclass[twoside]{report}
\usepackage[margin=2cm]{geometry}
\usepackage{parskip}
\PassOptionsToPackage{hyphens}{url}
\usepackage[backend=biber,sorting=none,alldates=short]{biblatex}
\addbibresource{references.bib}
\usepackage{menukeys}
\usepackage{hyperref}
\begin{document}
Some very long URL: \url{http://subdomain.example.org/thread/Some-Great-Products/A-super-great-product-with-a-dedicated-page/number/322866/highlight/true\#M8821}
\end{document}
If we declare menukeys after hyperref, this solve the issue. Typically \usepackage{menukeys}
after \usepackage{hyperref}
. Link to the issue on StackOverflow.
A symbol should automatically detect if it’s inside of a \key
or not and add a \key
around itself if it’s not jet inside of one.
(by Christophe)
I think that you can improve special keys. For example, I'm adding some calculator keys. I use the following method.
\makeatletter
% Calculator keys
\newcounter{@CounterKeys}
\newcommand*\ksquare{\ifnum\value{@CounterKeys}>0 ${}^2$ \else \keys{${}^2$} \fi}
\newcommand*\kpower{\ifnum\value{@CounterKeys}>0 $x^y$ \else \keys{$x^y$} \fi}
% General methods
\let\@oldKeys\keys
\renewcommand\keys[1]{%
\addtocounter{@CounterKeys}{1}%
\@oldKeys{#1}%
\addtocounter{@CounterKeys}{-1}%
}
\makeother
This allows then to use \ksquare
or \keys{\ksquare}
without problem.
(by Steffen)
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{kpfonts} %loads by default "textcomp", too
\usepackage{xcolor}
\usepackage[english,ngerman]{babel}
\usepackage[os=win]{menukeys}
\newmenucolortheme{yellow}{named}{yellow}{blue}{red}
\copymenustyle{yellowshadowedroundedkeys}{shadowedroundedkeys}
\changemenucolortheme{yellowshadowedroundedkeys}{yellow}
\renewmenumacro{\keys}[+]{yellowshadowedroundedkeys}
\renewcommand*{\ctrlname}{Strg}
\renewcommand*{\delname}{Entf}
\copymenustyle{hyphenatepathswithyellowfolder}{hyphenatepaths}
\changemenuelement{hyphenatepathswithyellowfolder}{pre}{%
\textcolor{\usemenucolor{txt}}{\drawtikzfolder[yellow]}%
\hspace{0.2em plus 0.1em}%
}
\changemenucolortheme{hyphenatepathswithyellowfolder}{yellow}
\renewmenumacro{\directory}[bslash]{hyphenatepathswithyellowfolder}
\newcommand{\angles}[1]{\textlangle #1\textrangle}
\begin{document}
\keys{\esc} / \keys{F12} / \keys{\Alt + \tab} / \keys{\shift + \ctrl +\del} / \keys{\shift + \enter\return} /
\keys{\raisebox{0.25ex}{{\tiny\textsl{\angles{Space}}}}} / \keys{Num\,\capslock} /
\keys{Bild\hspace{0.33em}\arrowkeydown\hspace*{0.167em}} / \keys{\ctrl + Bild\hspace{0.33em}\arrowkeyup\hspace*{0.167em}}
\textbf{Beenden} \keys{\ctrl + Q}
\directory{C:\Programme\EinSehrSehrLangerOrdnernameOhneIrgendeinLeerzeichen\MeinProgrammMitLangemNamen\ MeineDatei.txt}
{\selectlanguage{english}
\directory{C:\Program Files\AVeryVeryVeryLongFolderNameWhiteoutAnyKindOfSpace\MyProgramWithALongName\ MyFile.txt}
}
\end{document}
Neben der uneinheitlichen Färbung der Tasten hätte ich auch bei den
Pfadangaben erwartet, dass sie nicht mehr schwarz bleiben.
When making a document which is for Windows and OS X users, I'd like to avoid the OS X symbols except for \cmd
which is unique to OS X (and the \enter
symbol is always shown for os=mac
), but all I get is a warning instead.
Example:
press \keys{\ctrl+F} (or \keys{\cmd+F}) to search
(by Julien via E-Mail)
\tw@declare@style@simple*{roundedkeys}{%
\tikz[baseline={($([email protected])+(0,-0.2ex)$)}]{%
\node(tw@node)[tw@roundedkeys@base]{\strut\CurrentMenuElement};}%
}[%
\hspace{0.1em plus 0.1em minus 0.05em}%
\raisebox{0.25ex}{\sffamily\relsize{-1}+}% <--- I substituted \relsize{-1} for \footnotesize here
\hspace{0.1em plus 0.1em minus 0.05em}%
]{gray}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.