menukeys is a very fancy package.

We can use it by:

\usepackage[os=win]{menukeys} % Show keys in Windows style

or by:

\usepackage[os=mac]{menukeys} % Show keys in Mac style

However, in my article, I want to show keys in both styles.

How to dynamically switch the style in the same article?


You may define two macros to switch the OS style:



enter image description here




\shift \capslock \tab \esc \ctrl \Alt \AltGr \cmd \return \winmenu
\enter \backspace \del \arrowkeyup \arrowkeydown \arrowkeyleft
\arrowkeyright \Space \SPACE


\shift \capslock \tab \esc \ctrl \Alt \AltGr \cmd \return \enter
\backspace \del \arrowkeyup \arrowkeydown \arrowkeyleft \arrowkeyright
\Space \SPACE



To change the mackeys option dynamically, you may define the following macros (not tested):

| improve this answer | |
  • 2
    It might also be of interest that one can append mac or win to any key macro, e.g., \ctrlwin vs. \ctrlmac instead of just \ctrl. I use this in tables where I contrast key bindings for different operating systems in different columns. – Florian H. Mar 4 '17 at 1:02
  • @FlorianH. You can define your own macros. Ex: \def\ctrlwin{\setmenukeyswin\ctrl} – Paul Gaborit Mar 4 '17 at 1:17
  • 1
    @Paul Gaborit: Wait, I'm saying that \ctrlwin and \ctrlmac` macros are already defined in the menukeys package (and might be useful in a situation like the OP describes). – Florian H. Mar 5 '17 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.