[Journal] A little help with LaTex.

Markus Neteler neteler at osgeo.org
Sat Feb 20 04:35:21 EST 2010


On Fri, Feb 19, 2010 at 9:44 PM, Sunburned Surveyor
<sunburned.surveyor at gmail.com> wrote:
> I need to ask for a little help with LaTex. I'm working on the
> conversion of the "GPGPU with GDAL" article.
>
> Is there a special way I should be formatting source code within the article?

The `listings' package is a source code printer for LaTeX.
http://ctan.org/pkg/listings

See details at
http://en.wikibooks.org/wiki/LaTeX/Packages/Listings

Untested example (from [1]):

\documentclass{article}
\usepackage{listings}
\begin{document}
\lstset{language=C}
\begin{lstlisting}
main ()
   { int pid;
      switch (pid = fork())
 ....
\end{lstlisting}
\end{document}

Markus

[1] http://www.latex-community.org/forum/viewtopic.php?f=46&t=6958


More information about the newsletter mailing list