[Tex/LaTex] Creating keyboard layout diagrams

keyboardpackages

I want to create cheat sheets similar to this one for vim:

http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html

For example, I want to create one for Eclipse key bindings. But instead of laying out the text in traditional semi-structured text (lines, columns, text etc.) I want to present the information as a keyboard infographic for better mental encoding.

Is there a LaTeX package that can do it? If not, can you suggest other software that can create such diagrams?

Best Answer

I don't know any dedicated package but a while ago I used some TikZ Code to create keys for my HP-12C. Maybe you can use this and align it in a keyboard layout style.

\documentclass[12pt]{scrartcl}
\usepackage[]{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows}

\tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=gray!20,drop   shadow, text centered,  text=black, text width=8mm]
\tikzstyle{fkey}=[rectangle, draw=black, rounded corners, fill=orange,drop shadow, text centered,  text=black, text width=8mm]
\tikzstyle{gkey}=[rectangle, draw=black, rounded corners, fill=blue!40,drop shadow, text centered,  text=black, text width=8mm]

\newcommand{\mykey}[2]{%
\begin{tikzpicture} \node (Item) [abstract, rectangle split, rectangle split parts=2]    
{\textbf{\scriptsize{#1}} \nodepart{second}\textbf{\tiny{#2}}};%
\end{tikzpicture}}

\newcommand{\myfkey}{%
\begin{tikzpicture} \node (Item) [fkey, rectangle split, rectangle split parts=2]    
{\textbf{\footnotesize{f}} \nodepart{second}};%
\end{tikzpicture}}

\newcommand{\mygkey}{%
\begin{tikzpicture} \node (Item) [gkey, rectangle split, rectangle split parts=2]  
{\textbf{\footnotesize{g}} \nodepart{second}};%
\end{tikzpicture}}

\begin{document}
\mykey{n}{$12x$}
\mykey{SST}{$\Delta \text{DYS}$}

\myfkey

\mygkey

\mykey{Enter}{=}

\end{document}

enter image description here