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

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}
  • 1
    \begin{tabular}{@{}>{\ttfamily}l@{}} – egreg Dec 21 '15 at 14:59
  • @egreg - Many thanks, have updated the code shown in the answer. – Mico Dec 21 '15 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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