0

I've adapted Peter Grill's \Menu command in Create a command for 'menu sequences' to type menu sequences in some documents. It looks like hyphenation is not allowed inside these menu sequences and I'd like to allow it. How can I do it?

As you can see from next code, hyphenation is working outside \menu

\documentclass[a5paper]{article}
\usepackage[english,catalan]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{etoolbox}

\newtoggle{FirstOne}%
\newcommand*{\menu}[1]{%
   \toggletrue{FirstOne}%
   \foreach \x in {#1} {%
      \iftoggle{FirstOne}{}{${}\rightarrow{}$}%
      \texttt{\x}%
      \global\togglefalse{FirstOne}%
   }%
}%

\begin{document}
Configura la simulació per analitzar les següents \emph{Global Statistics}:

    Configura la simulació per analitzar les següents \menu{Global Statistics}:
\begin{itemize}
\item \menu{Traffic Sink, Traffic Received (bist/sec).} Marca també la casella \menu{Generate scalar data} i selecciona \menu{sample mean} del menú desplegable.
\item \menu{Traffic Source, Traffic Sent (bist/sec).} Marca també la casella \menu{Generate scalar data} i selecciona \menu{sample mean} del menú desplegable.
\item \menu{Node Statistics, Ethcoax, Collision Count} i \menu{Transmission attempts}.
\item \menu{Node Statistics, Traffic Sink, Traffic Received (bist/sec).}
\item \menu{Node Statistics, Traffic Source, Traffic Sent (bist/sec).}
\end{itemize}
\end{document}

enter image description here

2
  • 2
    \texttt disables hyphenation.
    – egreg
    Mar 28 '14 at 11:00
  • @egreg: Thanks, I didn't know it. Can I get a typewritter aspect with any other command?
    – Ignasi
    Mar 28 '14 at 11:03
1

See this question for how to do hyphenation of tt text. You might as well also want to use something else than typewriter font for Menus. With the package menu there is a command \menutext for changing how menus are rendered.

1
  • 1
    menukeys is pretty nice.
    – jub0bs
    Mar 28 '14 at 11:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.