# Monospace font in cases environment

I have this code:

$text \begin{cases} text, text \rightarrow text\\ text \rightarrow text, text, text, text text \end{cases}$
...
$text \begin{cases} text text \rightarrow text, text text, text\\ text, text \rightarrow text \end{cases}$
...


There is a way to format the entire text in monospace font? Something like this:

$\mathtt{text} \begin{cases} \mathtt{text, text} \rightarrow \mathtt{text}\\ \mathtt{text} \rightarrow \mathtt{text, text, text, text text} \end{cases}$
...
$\mathtt{text} \begin{cases} \mathtt{text text} \rightarrow \mathtt{text, text text, text}\\ \mathtt{text, text} \rightarrow \mathtt{text} \end{cases}$
...


but avoiding the repetition of the \mathtt command.

I've tried the solution proposed here but it doesn't work for me: font doesn't change.

I don't think the cases environment is particularly well suited for the job at hand, especially as the material that needs to be typeset doesn't appear to be all that math-y -- except, maybe, for the \rightarrow directives.
I would use a tabular environment, with \left\{ before the tabular environment and \right. after it.
\documentclass{article}
$\texttt{text} \left\{ \begin{tabular}{@{}>{\ttfamily}l@{}} text, text \to text\\ text \to text, text, text, text text\\ \end{tabular} \right.$

• \begin{tabular}{@{}>{\ttfamily}l@{}} – egreg Dec 21 '15 at 14:59