[Tuglist] Package for syntax highlighting

Radhakrishnan CV tuglist@tug.org.in
Thu, 28 Feb 2002 12:32:54 +0530 (IST)


On Thu, 28 Feb 2002 at 11:46, E. Krishnan wrote:

   On Thu, 28 Feb 2002, Satish Annigeri wrote:
   
     I intend to include C/C++ source code within my document. Is it
     possible to the syntax of the included source code (such as
     making the keywords bold etc). Is there a package available for
     this? 

   Please have a look at the "program" package.
   
Ah, `program' package is painful, you need to recode your source
files to do the job. Life is miserable if you have thousands of
lines of code, while lgrind is like riding on a Jaguar, which
automatically recodes the sources.

It handles a variety of languages like, C, C++, lisp, TeX, Java, ...
the list goes on that includes even a Makefile. You can add words to
a config file of lgrind that are to be highlighted.  You can keep
the code bit in an environment like \begin{lgrind} ... \end{lgrind}
in your document so that lgrind will handle that area only or else
you can run lgrind on a source file to convert it into a TeX file to
be included in your document.

However, for a win32 user, program package might be a choice, if he
fails to get the binaries of lgrind for Windows.

-- 
Radhakrishnan