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

Click For Summary

Discussion Overview

The discussion revolves around the best methods for representing input and output from Mathematica in a LaTeX report. Participants explore various formatting options and packages that could simplify this process.

Discussion Character

  • Technical explanation, Conceptual clarification, Debate/contested

Main Points Raised

  • One participant describes their current method in OpenOffice for formatting input and output, expressing a desire for a simpler approach in LaTeX.
  • Another participant suggests using the \begin{verbatim}...\end{verbatim} environment for monospaced text, which preserves line breaks.
  • A different participant mentions that Mathematica can output a LaTeX file, implying this could be a potential solution.
  • Another suggestion is to use the listings package from CTAN for formatting, although it is noted that it won't read .nb files.

Areas of Agreement / Disagreement

Participants present multiple approaches and suggestions, indicating that there is no consensus on a single best method for formatting input and output in LaTeX.

Contextual Notes

Some methods discussed may depend on specific LaTeX packages or configurations, and the effectiveness of each approach could vary based on the user's requirements and familiarity with LaTeX.

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 ·
Replies
11
Views
6K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K