1

I plan to create help files for windows and mac users but would like to add them both in the same document (if it is difference between the systems). I'd like to have the Windows button key as well as a Apple logo to begin these two short cut texts. These are not included in the "menukeys" package due to possible violation of copyright laws. Is it possible to add these manually? Also the caps lock symbol in the package is the old BIG ARROW DOWN symbol but most keyboards today have the text "Caps lock" on that key, I'd like to change this as well.

MWE:

\documentclass{article}
\usepackage[os=win]{menukeys}

\begin{document}

    You can visualize paths

    \directory{/home/moose/Desktop/manual.tex}

    or menus

    \menu{View > Highlight Mode > Markup > LaTeX} 

    or key press combinations:

    \keys{\ctrl + \shift + F} is for formatting
    in Eclipse.

    You can also visualize \keys{\tab}, \keys{\capslock}, \keys{\Space}, 
    \keys{\arrowkeyup} and many more.
\end{document}

Output: Standard output

Link to the package manual (pdf).

  • You can download a picture of the windows logo and/or the apple logo and use it like \keys{\includegraphics[width=1.5ex]{<logo>}} or something similar – Troy Aug 24 '17 at 9:33
  • For ways of getting a scalable standalone pdf of the logo(s) see tex.stackexchange.com/questions/13739/… – Marijn Aug 24 '17 at 9:37
2

The logos can be found in fontawesome.sty as \faWindows and \faApple. Internally in menukeys there are three commands for each key, \<key>, \<key>win and \<key>mac. When using \<key> it chooses one of the others depending on which OS is choosen. To create such commands for the OS key (lets just call it \OS) you can do something like:

\usepackage{fontawesome}
\makeatletter
\tw@make@key@box{OS@mac}{\faApple}
\tw@make@key@box{OS@win}{\faWindows}
\tw@make@key@macro*{\OS}
\makeatother

The same commands can be used to redefine the caps lock key. So in total I get:

\documentclass{article}
\usepackage[os=win]{menukeys}
\usepackage{fontawesome}
\makeatletter
\tw@make@key@box{OS@mac}{\faApple}
\tw@make@key@box{OS@win}{\faWindows}
\tw@make@key@macro*{\OS}
\tw@make@key@box{capslock@win}{\textsf{CapsLock}}
\tw@make@key@box{capslock@mac}{\textsf{caps lock}}
\makeatother

\begin{document}
Test of capslock: \keys{\capslock}, \keys{\capslockwin}, \keys{\capslockmac}, \capslock, \capslockwin, \capslockmac

\strut

Test of OS key: \keys{\OS}, \keys{\OSwin}, \keys{\OSmac}, \OS, \OSwin, \OSmac
\end{document}

enter image description here

| improve this answer | |
  • I have now tested but when I install the font and look in the file I see that the latest version (4.7) of FontAwesome doesn't have any UNICODE names for the symbols... so the macro of fontawesome.sty doesn'f ind anything. In the source of the macro it is stated that the macro uses \ProvidesPackage{fontawesome}[2016/05/15 v4.6.3.1 font awesome icons] – Jimmy Westberg Aug 24 '17 at 12:20
  • @JimmyWestberg, I also have v4.6.3.1, and I compile with pdflatex. The answer here might help: tex.stackexchange.com/a/192067/95544. You can also try to compile using lualatex. Another alternative is to find pdf or png of the logos and use something like \includegraphics[height=1em]{...} instead of the fonts. – StefanH Aug 24 '17 at 16:33
  • I think this could even be included in the actual package, as this would probably avoid the copyright issues. – BrainStone Jul 12 '18 at 14:19

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.