4

Possible Duplicate:
Keyboard Font for LaTeX

So the result looks like:

Press F5 for help.

I've checked the fancybox package, but it only includes three patterns: doublebox, ovalbox, shadowbox. I need something like buttonbox.

Lenik
  • 1,075

3 Answers3

3

Maybe a short tikz command can help you to do it

\documentclass[10pt]{article}

\usepackage{tikz}
\usetikzlibrary{shadows}

\tikzstyle{buttonstyle} = [rectangle, fill = black!30, draw = black!80, drop shadow, font={\sffamily\bfseries}, text=white]

\newcommand*{\button}[1]{\tikz{\node[buttonstyle] {#1};}}

\begin{document}
Press \button{F5} for help !
\end{document}

enter image description here

Ger
  • 2,720
3

It is also possible to get it with pdflatex. I used xelatex (lualatex) in this example:

\documentclass{article}
\usepackage{libertineotf}

\begin{document}
Press \LKeyF{5} for help !
\end{document}

enter image description here

for a newer system, like TL2014 runt this document with xelatex or lualatex:

\documentclass{article}
\usepackage{libertine}

\begin{document}
Press \LKey{5} for help !
\end{document}
2

Improving a little on Ger's answer:

Code

\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{shadows}

\newcommand{\button}[1]%
{   \begin{tikzpicture}[baseline=(tempname.base)]
        \node[draw=gray, fill=yellow!5, rounded corners=0.5pt, inner sep=2pt, minimum width=1.5em, minimum height=1.5em, general shadow={fill=gray!50, shadow xshift=0.5pt, shadow yshift=-0.5pt, shadow scale=1.15}] (tempname) {#1};
    \end{tikzpicture}
}

\begin{document}

\textsc{Count von Count:} There are \button{8}, \button{8} buttons!

\end{document}

Result

enter image description here

Tom Bombadil
  • 40,123