Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!netnews.upenn.edu!cps3xx!cpsvax!smithda From: smithda@cpsvax.cps.msu.edu (J. Daniel Smith) Newsgroups: comp.text.tex Subject: Re: Typesetting programming languages -- RESULTS Keywords: TeX, LaTeX, C Message-ID: <6658@cps3xx.UUCP> Date: 27 Feb 90 22:12:44 GMT References: <4354@jhunix.HCF.JHU.EDU> Sender: usenet@cps3xx.UUCP Reply-To: smithda@cpsvax.UUCP (J. Daniel Smith) Organization: Michigan State University, Computer Science Department Lines: 38 In article <4354@jhunix.HCF.JHU.EDU> barrett@jhunix.HCF.JHU.EDU (Dan Barrett) writes: > > Thank you everybody who sent me suggestions on how to typeset >programming languages (like C) in LaTeX. >[..] >run something through tgrind, it is hard to edit later. I'd really prefer >a system that allowed me to do: > >\begin{c_code} >main() >{ > int foo; > ...etc... >} >\end{c_code} I just read that someone at MIT has written a BASIC interpreter in TeX. Given that, I would think it should be possible to program TeX to do something like this. Perhaps "\listing{C}{foo.c}" might be easier... Even if it didn't have lots of bells and wistles it would still be much better than the \begin{verbaim}...\end{verbatim} of LaTeX or the \listing macros from pg. 381 of the TeXbook. Of course many solutions have already been mentioned (including plain ASCII output). However, all of these require a pre-processor of some kind. WEB is great, but there are times when a system like the one mentioned above would be much better. Any thoughts? ========================================================================= J. Daniel Smith Internet: smithda@cpsvax.cps.msu.edu Michigan State University BITNET: smithdan@msuegr East Lansing, Michigan Usenet: uunet!frith!smithda Woe to the author who always wants to teach! The secret of being a bore is to tell everything. - Voltaire =========================================================================