I am using XeTeX and tikz to generate a cheat sheet for an unusual keyboard layout (gb + apl). Inspired by this answer, I set up a command to quickly associate the symbols that are bound to each key:
\tikzstyle{abstract}=[
rectangle,
draw=black,
rounded corners,
fill=gray!20,
drop shadow,
text=black]
\newcommand{\mykey}[4]{%
\resizebox{1.25cm}{1.25cm}{%
\begin{tikzpicture}
\node [abstract, rectangle split, rectangle split parts=2]
{\textbf{\footnotesize{#2} \hfill \footnotesize{#4}} \nodepart{second}\textbf{\footnotesize{#1} \hfill \footnotesize{#3}}};%
\end{tikzpicture}}}
Then I use this command to generate the whole keyboard, as follows:
\begin{document}
\mykey{a}{A}{⍺}{⍶}
\mykey{s}{S}{⌈}{}
% etc
\end{document}
I am quite pleased with the result:
But there are a couple of small details that I do not really like:
- I would like the two columns within each key to be further apart.
- I would like the keys with three symbols to have the top row aligned to the left (for example, in the key with the Y, the capital Y should be aligned with the lowercase y).
Edit: also, I am not sure that the call to \resizebox
is the best option to achieve equal square boxes.
Thanks in advance for the help!
In case somebody is interested, I'm using the font APL333 which I downloaded here
The full code for generating the page above is this:
\documentclass[12pt]{scrartcl}
\usepackage[margin=1cm]{geometry}
\usepackage{fontspec}
\setmainfont{APL333}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,shadows}
\tikzstyle{abstract}=[
rectangle,
draw=black,
rounded corners,
fill=gray!20,
drop shadow,
text=black]
\newcommand{\mykey}[4]{%
\resizebox{1.25cm}{1.25cm}{%
\begin{tikzpicture}
\node [abstract, rectangle split, rectangle split parts=2]
{\textbf{\footnotesize{#2} \hfill \footnotesize{#4}} \nodepart{second}\textbf{\footnotesize{#1} \hfill \footnotesize{#3}}};%
\end{tikzpicture}}}
\begin{document}
\mykey{`}{¬}{⋄}{⌺}
\mykey{1}{!}{¨}{⌶}
\mykey{2}{"}{¯}{⍫}
\mykey{3}{£}{<}{⍒}
\mykey{4}{\$}{≤}{⍋}
\mykey{5}{\%}{=}{⌽}
\mykey{6}{\textasciicircum}{≥}{⍉}
\mykey{7}{\&}{>}{⊖}
\mykey{8}{*}{≠}{⍟}
\mykey{9}{(}{∨}{⍱}
\mykey{0}{)}{∧}{⍲}
\mykey{-}{\_}{×}{ }
\mykey{=}{+}{÷}{⌹}
\mykey{q}{Q}{?}{⍰}
\mykey{w}{W}{⍵}{⍹}
\mykey{e}{E}{∊}{⍷}
\mykey{r}{R}{⍴}{⌾}
\mykey{t}{T}{\textasciitilde}{⍨}
\mykey{y}{Y}{↑}{}
\mykey{u}{U}{↓}{}
\mykey{i}{I}{⍳}{⍸}
\mykey{o}{O}{○}{⍥}
\mykey{p}{P}{*}{⍣}
\mykey{[}{\{}{←}{⍞}
\mykey{]}{\}}{→}{⍬}
\mykey{a}{A}{⍺}{⍶}
\mykey{s}{S}{⌈}{}
\mykey{d}{D}{⌊}{}
\mykey{f}{F}{\_}{}
\mykey{g}{G}{∇}{⍢}
\mykey{h}{H}{∆}{}
\mykey{j}{J}{∘}{⍤}
\mykey{k}{K}{'}{⌸}
\mykey{l}{L}{⎕}{⌷}
\mykey{;}{:}{⍎}{≡}
\mykey{'}{@}{⍕}{≢}
\mykey{\#}{\textasciitilde}{⊢}{⊣}
\mykey{\textbackslash}{|}{⊢}{⊣}
\mykey{z}{Z}{⊂}{⊆}
\mykey{x}{X}{⊃}{}
\mykey{c}{C}{∩}{}
\mykey{v}{V}{∪}{}
\mykey{b}{B}{⊥}{⍭}
\mykey{n}{N}{⊤}{⍡}
\mykey{m}{M}{|}{∥}
\mykey{,}{<}{⍝}{⍪}
\mykey{.}{>}{⍀}{⍙}
\mykey{/}{?}{⌿}{⍠}
\end{document}