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

AI Thread Summary
For representing input and output from Mathematica in LaTeX, a common approach is to use the verbatim environment, which allows for monospaced text and preserves line breaks. The \begin{verbatim} ... \end{verbatim} command is recommended for simplicity. For enhanced features, users can explore additional packages like "moreverb" and "fancyverb" available from TeX archive sites. Another useful package is "listings," which, while not directly compatible with .nb files, can be utilized for formatting plain text. This method offers a straightforward way to present Mathematica data in a clear and visually distinct manner.
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
 
Physics news 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:

Similar threads

Replies
11
Views
5K
Replies
1
Views
1K
Replies
8
Views
12K
Replies
4
Views
3K
Replies
3
Views
2K
Replies
16
Views
4K
Replies
2
Views
2K
Replies
8
Views
13K
Back
Top