2

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.

1 Answers1

1

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.

enter image description here

\documentclass{article}
\usepackage{array}
\begin{document}
\[
\texttt{text}
\left\{ \begin{tabular}{@{}>{\ttfamily}l@{}}
   text, text $\to$ text\\
   text $\to$ text, text, text, text text\\
\end{tabular} \right.
\]
\end{document}
Mico
  • 506,678