[Haskell-cafe] LaTeX question: interpreter examples
Richard A. O'Keefe
ok at cs.otago.ac.nz
Fri Aug 28 08:38:33 UTC 2015
On 28/08/2015, at 8:19 pm, Christopher Howard <ch.howard at zoho.com> wrote:
> I occasionally have blocks of example interpreter interaction, and I'm
> not sure what to do with it. Is there a certain command enclosure that
> would be appropriate? Ideally, it would treat the text like monospace,
> and also preserve line breaks. Example text would be:
>
> *GCD> extEuclidean 546 2022
> (6,100,-27)
> *GCD> 546 * 100 + 2022 * (-27) == 6
> True
>
> But this does not come out looking similar in the final output.
The absolute minimum here is
\begin{verbatim}
...
\end{verbatim}
but do be careful that there are no TAB characters there.
The next step up would be to use something like the `listings'
package; see
http://texdoc.net/texmf-dist/doc/latex/listings/listings.pdf
verbatim will make the output look exactly like the input;
listings can make the output look like Haskell, if that's
what you want.
More information about the Haskell-Cafe
mailing list