Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm currently writing a user guide containing a lot of keyboard shortcuts. I'm looking for a "keyboard" font where single characters or special keys (like tab or backspace) appear like the "real" key (i.e. with a box around; hope you get the idea).

Is there any package available for this or do I have to wrap one of the existing PS/TTF Fonts?

share|improve this question
+1 Nice idea. could look nice. –  Johan Nov 11 '10 at 19:41

5 Answers 5

up vote 44 down vote accepted

The keystroke package is your friend.


Sadeq's suggestion could be mimicked very inexpensively by the pgf/tikZ package.


      drop shadow={shadow xshift=0.25ex,shadow yshift=-0.25ex,fill=black,opacity=0.75},
      rounded corners=2pt,
      inner sep=1pt,
      line width=0.5pt,
    ](key) {#1\strut}

  The quick brown fox jumps over the lazy dog. \keystroke{Strg} The quick brown fox jumps over the lazy dog. \keystroke{Ctrl} The quick brown fox jumps over the lazy dog. \keystroke{Page $\uparrow$} \keystroke{Esc} \keystroke{F1}

enter image description here

share|improve this answer
Exactly what I needed - Thank you very much! –  Udo Schneider Nov 11 '10 at 20:48
Excellent! So no one will really have to buy a font :) You saved us $120! –  Sadeq Dousti Feb 16 '11 at 23:22
It was a great starting point. Now I am using following code (works correctly w/ sequences like Ctrl+F1): \renewcommand*\keystroke[1]{\hspace{0.2ex}\tikz[baseline=(key.base)]\node[draw,‌​text height=1.5ex,text depth=0ex,fill=black!10,drop shadow={shadow xshift=0.2ex,shadow yshift=-0.2ex,fill=black,opacity=0.50},rectangle,rounded corners=2pt,inner sep=2.75pt,line width=0.5pt,font=\footnotesize\sffamily] (key) {#1};\hspace{0.4ex}}. \re..., because I still use keystroke package for convenient \PgUp and similar macros (you have to add \ after them if used in the middle of sentence, etc.). –  przemoc Jul 7 '11 at 14:37

You can use the menukeys package.



 \section{The Manual}
    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.


enter image description here

share|improve this answer
Is the package \menukeys in a standard latex installation or do we have to download it via CTAN? –  71GA Sep 26 '13 at 6:52
What is a "standard latex installation"? It is included in texlive-full if that is the question. –  moose 9 hours ago

Another free keyboard font is Linux Biolinum Keyboard. See the following graphic for an example:

Linux Biolinum Keyboard Sample

share|improve this answer
Yes, and linux libertine. They're nicer than keystroke. –  Leo Liu Feb 16 '11 at 14:18
Very nice. But only available with the Libertine font. –  Thorsten Donig Feb 16 '11 at 19:41

the ones with Libertine:



\LKeyStrg\ The quick brown fox jumps over the lazy dog. \\
\LKeyStrg\ The quick brown fox jumps over the lazy dog. \\
\LKeyPos\ \LKeyEsc \LKeyF{1}


enter image description here

share|improve this answer
This package seems to have been depreciated. Will you please update the answer with the latest version (I think is libertineOTF). –  Yiannis Lazarides Mar 15 '12 at 22:32
why should it be deprecated? The above is an example for pdflatex and not xetex or luatex! –  Herbert Mar 15 '12 at 22:57
Look into libertinekey.sty (in an up-to-date distribution). It is unfortunately needed to load libertine.sty from libertine-legacy. –  Speravir Mar 16 '12 at 2:29
I see, but that seems to be a bug. All packages of libertine-legacy should be the old one. I'll report it. –  Herbert Mar 16 '12 at 5:43

Thorsten Donig's answer is excellent, and provides a free solution. However, if you are in need of a more advanced typographic solution, you may consider buying fonts specially designed to represent "keyboard caps."

One such font is the family of PIXymbols Shadowkey fonts. In my opinion, they are prettier (but much more expensive!)

share|improve this answer
Or use an open-source such font, like Linux Biolinum. –  ℝaphink Sep 14 '11 at 13:27
@Raphink: See Philipp's answer! –  Sadeq Dousti Sep 14 '11 at 21:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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