# Square brackets etc inside \keys of menukeys?

How can I put special characters like the square brackets into a keys{} provided by the menukeys package?

I tried it with $ and $ respectively, but it fails. Unlike for the | character there does not seem to be a symbol I can reference by name (see below) that will work inside the \keys{} command.

I only list the characters I tried below, but I'm generally interested in how I can approach such a problem when I encounter it.

How can I address my specific problem and what would be the steps to take next time I encounter a similar problem (short of asking here).

The characters that I'm interest and found to fail so far (including what I tried):

• [ as $ • ] as $

Working in escaped or other form:

• | \textbar (not working: \vbar, \| and {\|})
• % via \%
• & via \&
• # via \#
• { via \{ and \textbraceleft
• } via \} and \textbraceright

The commands you are looking for are \lbrack and \rbrack, althought using {[} and {]} also works (as was predicted by barbara beeton in her comment):

\documentclass{article}

\begin{document}


• thanks, these work. As it turns out, though, even though I was using an old version (2003) of the comprehensive symbol list, it is not included in this list. \lBrack is, but \lbrack is not. Also, I was naturally looking for bracket and "around" the location where \textbraceleft and friends were to be found. Thanks again for your time. – 0xC0000022L Jun 19 '15 at 15:55
• i didn't try it, but might {[} and {]} work as well? (i'm guessing that "unprotected" [ may be getting interpreted as introducing an option. if that's the case than braces around ] wouldn't really be needed, but it's easier to remember if input is handled symmetrically.) – barbara beeton Jun 19 '15 at 15:57