🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #2077

Big verbatim C listings (from c.t.t)

#2077
From: Norman
Date: Fri, 04 Sep 1992 10:05
70 lines
3900 bytes
    Jonathan, Greetings!

    Before you get too excited, I don't have a solution to your
    problem.  Instead I have a couple of suggestions, partly based on
    my experience with a similar (though smaller) problem in my own
    thesis, as well as the offer of a style file which may make part
    of your task a bit easier.

    Can I suggest that, rather than trying to set the C programs as
    explicitly {verbatim}, you set the font to \tt, make tabs active
    and expanding to eight spaces (this will work for leading tabs at
    least), recatcode all of C's character set into letters or others,
    and then simply \input the C files.  You'll have to do other
    things like \obeylines and \obeyspaces, and you'll have to be a
    bit clever about the timing of the catcode changes.  In short,
    you'll (logically) be calling \begin{verbatim} without the
    \end{verbatim}.

    The advantage of doing it this way, rather than in some souped-up
    verbatim environment, is that the contents of the file will be
    `ordinary LaTeX' (in some strange extended sense) as opposed to
    the weird contents of some bizarre environment.  That in turn
    means that you can be sure that TeX's page-breaking algorithm and
    output routines will still be used, you could put index entries in
    as usual (as long as you had made some space character into the
    escape character),things like two-column formatting will work, and
    headings would still be under LaTeX's control.

    Talking about headings, rather than rotate the contents of each
    page, could you not simply give LaTeX the sizes for a landscape
    page - wider than it's high.  That would mean that the heading
    would be placed in the correct place for a landscape page, so that
    to get a heading in the right place for a portrait page (which is
    what I presume you want), you could cunningly specify a heading
    which is offset and rotated, so that it will appear to TeX to be a
    landscape heading, although the ink will be in the position for a
    portrait heading.  Hmm, I don't think I've expressed that
    particularly clearly....

    All this mucking around could seriously mess up the remainder of
    your document, so it would be best to keep these pages in a
    separate file, and LaTeX them independently (this is what I had to
    do when I dealt with a similar problem).  The problem with /that/
    is that things like chapter numbers and pages and so on are set
    out of sequence.  So: I have a style file (with startling
    originality I call it `supplements.sty') which will allow such
    separated parts of a document to kept in line with each other, by
    synchronising counters, and moving index entries and cross
    references around.

    If you want, I can send you a copy of the style file and its
    documentation - sending it as a zip file would be easiest, but a
    tar file should be possible (of course, a VMS backup saveset would
    be best of all, but since you seem to be on a unix-impaired
    site...).

    I've copied this to Info-Tex.

    See you,

    Norman

===============================================================================
Norman Gray                     N.O.Gray@open.ac.uk (Internet)
Department of Physics
Open University
Milton Keynes,  MK7 6AA         +44 908 652279
UK                              +44 908 653744 (fax)
===============================================================================
Technical Details
Message-ID: <8048399@MVB.SAIC.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!network.ucsd.edu!mvb.saic.com!info-tex

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!network.ucsd.edu!mvb.saic.com!info-tex
From: N.O.Gray@open.ac.uk (Norman)
Newsgroups: comp.text.tex
Subject: Big verbatim C listings (from c.t.t)
Message-ID: <8048399@MVB.SAIC.COM>
Date: Fri, 4 Sep 1992 11:05:58 +0100
Organization: Info-Tex<==>Comp.Text.Tex Gateway
X-Gateway-Source-Info: Mailing List
Lines: 70