Article View: comp.text
Article #6871Re: Typesetting programming languages in LaTeX
From: Sebastian Rahtz
Date: Wed, 21 Feb 1990 01:45
Date: Wed, 21 Feb 1990 01:45
34 lines
2172 bytes
2172 bytes
>>>>> On 20 Feb 90 02:03:14 GMT, barrett@jhunix.HCF.JHU.EDU (Dan Barrett) said:
> For the computer programming courses I teach, I make a lot of
> handouts that contain code in C, Pascal, LISP, etc. I would like to
> have a nice way to typeset these languages in LaTeX.
> The major problems are:
> o Not interpreting symbols of the language as LaTeX symbols;
> o Handling TAB's.
> For the time being, I use the "verbatim" environment. However, it doesn't
> understand TAB characters; I have to substitute 8 space characters for
> my TAB's (and this isn't always correct).
well, a few random points strike me:
a) there is often a `detabbing' program on Unix systems which
resolves TAB characters into appropriate places
b) where do you stand on code being in typewriter font? if you are
not wedded to that, have you tried the `trgind' system of
prettifying code?
c) if you don't need / { and } in your code (!), you could use the
`alltt' environment
d) note sure what you mean by
> o Not interpreting symbols of the language as LaTeX symbols;
if you can do what you want with a verbatim environment which
permits an escape character to get TeX symbols, then I can supply
one
there are many other thoughts, of course. but mainly dependent on the
answer to b) above
--
Sebastian Rahtz S.Rahtz@uk.ac.soton.ecs (JANET)
Computer Science S.Rahtz@ecs.soton.ac.uk (Bitnet)
Southampton S09 5NH, UK S.Rahtz@sot-ecs.uucp (uucp)
Technical Details
Message-ID:
<SPQR.90Feb21014548@manutius.ecs.soton.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!ukc!icdoc!sot-ecs!spqrReferences:
<4285@jhunix.HCF.JHU.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!ukc!icdoc!sot-ecs!spqr From: spqr@ecs.soton.ac.uk (Sebastian Rahtz) Newsgroups: comp.text Subject: Re: Typesetting programming languages in LaTeX Message-ID: <SPQR.90Feb21014548@manutius.ecs.soton.ac.uk> Date: 21 Feb 90 01:45:48 GMT References: <4285@jhunix.HCF.JHU.EDU> Sender: spqr@ecs.soton.ac.uk Followup-To: comp.text Organization: Southampton University Computer Science Lines: 34 In-reply-to: barrett@jhunix.HCF.JHU.EDU's message of 20 Feb 90 02:03:14 GMT