Latex: writing the input/output of program in a report

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 7K views
phillyj
Messages
30
Reaction score
0
I'm working on a report that describes the input and output from Mathematica. Is there any standard way for me to represent them? I done this openoffice already but I want to put my paper into latex. What I currently have in Openoffice format was like this:

Input:
[1] ________
[2] ________
:
:

Output:
[1] ________
[2] ________
:
:

And I put it in a box and Courier font to make it stand out.

Unless there is some other method i was going to use boxedminipage and the list format "description" to put this together with a font like "teletypefont". But this seems more hard work. Is there anything simpler?

Thanks
 
on Phys.org
Have you tried
Code:
\begin{verbatim}
... whatever ...
\end{verbatim}
That automatically gives your monospaced text, keeps line breaks, etc.

There are packages with more features that you can download from TeX archive sites, like "moreverb" and (probably the ultimate one) "fancyverb". See their documentation for the details.
 
I think mathematica will output a LaTeX file.
 
Use the http://www.ctan.org/tex-archive/macros/latex/contrib/listings/" package from ctan. (It won't read a .nb file, but you can use it with plain text.)
 
Last edited by a moderator: