[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: [OT] Producing TeX code from C source code
From:       Daniel_Schröter <d.schroeter () gmx ! de>
Date:       2002-04-10 19:31:27
[Download RAW message or body]

Hi,

Volker Augustin wrote:
> I would like to transform C/C++ source code to LaTeX code

The listings-Package is your friend (for "perfektionismus" ;-)).
ftp://ftp.dante.de/tex-archive/macros/latex/contrib/supported/listings/

There's a dvi avaiable with examples: listings.dvi

> Required or nice-to-have features:
> 1. keywords marked in bold

Avaiable.

> 2. line wrapping (I think I can work around that with indent)

Sure.

> 3. line number on the left side of the document for every line

No problem.


> 4. the ability to have mark function names with the \hyperref command
> for later generation of hyperlinked pdf documents from the tex code.

Hmm, try it. But I think it's not easy to get this, because it's like a 
verbatim environment.


> 5. colorization of keywords/function names

Maybe :-o


Your are german? de.comp.text.tex (very good newsgroup, but ask 
carefully ;-))

Here are some lines for a perl-script. Sorry it's a long time ago. I 
don't no what all lines doing. Specially the last ones

\usepackage[breaklines]{listings}
%
%% Configure the display
\lstset{flexiblecolumns=true,language=Perl,labelstyle=\tiny,labelstep=1,labelsep=5pt,tabsize=3,breaklines=true,
  MoreSelectCharTable=%
     \lst@ReplaceInput{>}{\lst@ProcessOther{>\mbox{$\,$}}}%
     \lst@ReplaceInput{<}{\lst@ProcessOther{<\mbox{$\,$}}}%
}
%% Input the file.....
\lstinputlisting{scripts/copyroot}



Bye

 
> > Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic