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

Re: Source Code into latex



On Mon, 9 Jul 2001, Dominik Paul wrote:

>
> Hi there,
>
> does somebody know, how I can convert or create a latex-document out of my
> IDL Source Code?

I often include IDL code in LaTeX (and ConTeXt) documents using the
ProTeX literate programming macro package.

Simple example:


\documentclass[11pt]{article}
\usepackage{txfonts} %

% ProTex:
% http://www.cis.ohio-state.edu/~gurari/tpf/html/LitProg.html
% Eitan Gurari, "TeX and LaTeX: Drawing and Literate Programming".
% McGraw-Hill, 1994. ISBN 0-07-025208-4 / 0-07-911616-7
\ifx\AlProTex\undefined%
 \input{ProTex.sty}
 \fi
\AlProTex{f,<<<>>>,title,list,`}

\title{IDL in \LaTeX}
\author{George N. White III}
\begin{document}
\maketitle

Here is an IDL procedure.  Using the literate programming tool,
sections can be defined elsewhere and will be embedded into the
output file.

\<dummy\><<<
pro dummy
;dummy IDL procdure
`<print`>
END
>>>

Here is the definition of the \verb|print| section.

\<print\><<<
print, '...'
>>>

Finally, we write the complete program.

\OutputCode[pro]\<dummy\>

\end{document}


-- 
George N. White III <gnw3@acm.org> Bedford Institute of Oceanography