How to represent the "Shift" key?
Just as alternative a package-based approach (menukeys
) which looks slightly different.
\documentclass{article}
\usepackage{menukeys}
\begin{document}
\keys{\shift\ Shift}
\end{document}
For just this purpose this will be an overkill, but if you have many keyboards that you wish to recreate, it might be worthwhile considering using TikZ.
\documentclass{article}
\usepackage{keystroke}
\usepackage[arrows]{boisik}
\usepackage{tikz}
\usetikzlibrary{shapes.arrows,positioning}
\begin{document}
Current solution: \keystroke{$\upwhitearrow$ Shift}
Alternative solution: \keystroke{\tikz{%
\node[single arrow,draw,shape border rotate=90,scale=0.3,minimum height=20pt](arrow){};
\node[right=5pt of arrow,font=\sffamily,inner sep=0pt](shift){Shift};
\path(shift.north)--++(0,2pt);}}
\end{document}
Why would one do this? This is IMHO the easiest way to also get the duck
key. ;-)
\documentclass{article}
\usepackage{keystroke}
\usepackage{tikzducks}
\usetikzlibrary{positioning}
\begin{document}
\keystroke{\tikz{%
\begin{scope}[scale=0.15,local bounding box=duck]
\duck
\end{scope}
\node[right=5pt of duck,yshift=1pt,font=\sffamily,inner sep=0pt](shift) {duck};
\path(shift.north)--++(0,2pt);}}
\end{document}
As there are already solutions with keystrokes
, menukeys
and ducks, I will try with tcolorbox
. Bonus: the key is clickable.
\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage[most]{tcolorbox}
\usetikzlibrary{shadings}
\tcbuselibrary{skins}
\usepackage{wasysym}
\def\shift{\tcbox[beamer, on line, size=small,
toprule=.5pt, bottomrule=2pt, leftrule=.6pt, rightrule=1.5pt,
hyperref=sec:Shift,
frame style={upper left=yellow!40!black!40,
lower left=cyan!05!black!85,
upper right=yellow!10!black!70,
lower right=red!05!black},colupper=green!10!white,
colback=black!65]{\sffamily\rotatebox{90}{\Large\pointer} Shift
} }
\begin{document}
See the \shift section.
\newpage
\section*{The shift key}
\label{sec:Shift}
This is the text about the Shift key
\end{document}