[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave code into latex
From: |
Steve Thompson |
Subject: |
Re: octave code into latex |
Date: |
Thu, 11 Oct 2007 09:58:09 -0700 |
On 11-Oct-07, Riccardo Corradini <address@hidden>
wrote:
> I would like to include some octave octave into latex. Does
> anybody know how do it?
I like the listings package. Below's an example.
% This package is used for pretty printing the source files.
% Edit to taste.
\usepackage{listings}
\lstset {numbers = left, numberstyle = \tiny,
emph = {abs, addpath, angle, ceil, clc, clear, conj, cos, diff,
end, else, elseif, erfc, error, exp, fclose, fft, fftshift,
fopen, flipdim, fliplr, floor, for, fprintf, function, hold,
if, ifft, imag, interp1, length, linspace, log10, log2, max,
mean, min, num2str, ones, pause, plot, pi, prod, pwelch, rand,
randn, real, rem, reshape, roots, round, save, sin, size, sqrt,
sum, tic, toc, unwrap, var, while, zeros},
emphstyle = \bfseries,
morecomment = [l] [\itshape] {\%},
morecomment = [l] [\slshape] {disp},
}
...
\begin{lstlisting}
% This is code.
\end{lstlisting}
\lstinputlisting {so_is_this.m}
...
Steve