LaTeX style for octave programs ?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

LaTeX style for octave programs ?

Ferdinand Schinagl-2
Hello,

does anybody know about a style file for LaTeX to include octave
programs and have them typeset in a nice fashionable way?

Regards,
--
Ferdinand Schinagl
Institut fuer Halbleiterphysik
Johannes Kepler Universitaet Linz

Reply | Threaded
Open this post in threaded view
|

LaTeX style for octave programs ?

John W. Eaton-6
Ferdinand Schinagl <[hidden email]> wrote:

: does anybody know about a style file for LaTeX to include octave
: programs and have them typeset in a nice fashionable way?

I don't know of anything that will help with this in the short term,
but I have thought a little bit about how I might be able to modify
Octave to allow people to write add-on code to walk Octave's parse
trees and generate anything they want, given the information available
in the tree.

Currently, the built-in `type' function does something like this, but
it isn't implemented in a way that is extensible and it doesn't handle
comments.  Handling comments in the parse tree may actually turn out
to the the hardest part of doing this, but I have some ideas about how
to do that as well.

If anyone is interested in working on this, please let me know.

Thanks,

jwe

Reply | Threaded
Open this post in threaded view
|

LaTeX style for octave programs ?

Jarle Brinchmann
John W. Eaton writes:
 > Ferdinand Schinagl <[hidden email]> wrote:
 >
 > : does anybody know about a style file for LaTeX to include octave
 > : programs and have them typeset in a nice fashionable way?
 >
 > I don't know of anything that will help with this in the short term,
 > but I have thought a little bit about how I might be able to modify
 > Octave to allow people to write add-on code to walk Octave's parse
 > trees and generate anything they want, given the information available
 > in the tree.

I never got around answering this before, but the standard way to do
this for any computer language is to use either lgrind of vgrind. I
personally recommend lgrind, but it's not much of a difference. If you
don't have it on your computer, you can get it on the CTAN machines
(ie. http://www.tex.ac.uk/tex-archive/support/lgrind/ in England,
change to www.dante.de in Germany and  www.SHSU.edu in the US)

This is a pretty printer that is general for a lot of different
languages. The newest version of lgrind includes support for MATLAB,
the clue is an entry in the lgrindef file that contains definitions
for the language. There are also precompiled versions for PC/OS-2
available at the above site.  

                                        Check it out!
                                        Jarle.

Reply | Threaded
Open this post in threaded view
|

Re: LaTeX style for octave programs ?

U-E59264-Osman Buyukisik-3
 > Ferdinand Schinagl <[hidden email]> wrote:
 >
 > : does anybody know about a style file for LaTeX to include octave
 > : programs and have them typeset in a nice fashionable way?
 >

I would suggest literate programming tools:
noweb/nuweb/fweb/funnelweb/CLiP any will do. Check the litprog FAQ
(comp.programming.literate). These tools will let you do the
styling yourself. But there may be spider (spiderweb) for MATLAB which you can
use for octave. This tool will pretty print/index automatically.

Except for CLiP they all depend on LaTex/TeX. CLiP will work with any word
processor.

These tools allow programs to be written like a book. ALso allow the
programmer to split/mix/create "chunks."  This way, one does not need
to worry about the order functions/vars defined.

Hope this will results in some additional literati!

Osman