help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave code into latex


From: Vic Norton
Subject: Re: octave code into latex
Date: Fri, 4 Jan 2008 11:55:09 -0500

This seems a bit late, but "listings" is the package to use to put octave code into latex. Here is a complete example.

   \documentclass{article}
   \usepackage{color}
   \usepackage{listings}
   \lstset{
      language=Octave,
      morecomment = [l][\itshape\color{blue}]{\%}
   }
   \begin{document}

   An octave listing example:

   \begin{lstlisting}
   % Here are two norm expressions
   function y = norm1( x )
      y = max(sum(abs( x )));
   endfunction

   function y = norm2( x )
      y = sqrt(sum( x .* x ));
   endfunction
   % End of example
   \end{lstlisting}

   \end{document}

Regards,

Vic

On Jan 4, 2008, at 8:43 AM, Peter A. Gustafson wrote:

On Thursday 11 October 2007 05:53:24 Riccardo Corradini wrote:
Hi  all,
I would like to include some octave octave into latex.
Does anybody know how do it?
Thanks a lot
Riccardo


---------------------------------

---------------------------------
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail

Check out highlight.
http://www.andre-simon.de/

It claims to support octave, though I've only used it for fortran.

Pete Gustafson



reply via email to

[Prev in Thread] Current Thread [Next in Thread]