# How can I use < and > in \keys{} of menukeys?

For the sake of this question I have created the following small example to reproduce the issue I am asking about.

\documentclass[a4paper]{article}
\usepackage{parskip}

\begin{document}
\keys{a} \keys{b}\\
\keys{A} \keys{B}\\
\keys{<} \keys{>}
\end{document}


I would like to synthesize the < and > character as a key press using \keys{}. However, I am not talking about the cursor keys here. I mean the smaller than and greater than keys which can be accessed by using the Shift+, and Shift+. sequence on a US-English keyboard.

The above example produces this:

Edit: I'd like to add the ~ key to the list of problematic characters which won't render inside \keys{}.

\documentclass[a4paper]{article}
\usepackage{parskip}
\usepackage[T1]{fontenc}
\begin{document}
\keys{a} \keys{b}\\
\keys{A} \keys{B}\\
\keys{<} \keys{>}
\end{document}

• thanks, that covers < and > quite nicely. Any idea for ~? – 0xC0000022L Mar 28 '15 at 22:03
• – Ulrike Fischer Mar 28 '15 at 22:06

To add the ~, you can try to create your own tilde and use it inside \keys.

\documentclass[a4paper]{article}
\usepackage{parskip}
\newcommand{\til}{{\raise.17ex\hbox{$\scriptstyle{\sim}$}}}