Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Creating Books and Manuals with Perl

by ash (Monk)
on Sep 10, 2002 at 09:28 UTC ( [id://196593]=note: print w/replies, xml ) Need Help??


in reply to Creating Books and Manuals with Perl

Anyone have any guides to documenting Perl with LaTeX?
I've got two books on LaTeX written by Leslie Lamport and it doesn't exactly come clear how to embed code (except pascal) into LaTeX.

-- 
ash/asksh <ask@unixmonks.net>

  • Comment on Re: Creating Books and Manuals with Perl

Replies are listed 'Best First'.
Re(2): Creating Books and Manuals with Perl
by Arien (Pilgrim) on Sep 10, 2002 at 10:35 UTC

    What you're looking for is the verbatim environment. It's similar to <code>...</code> in HTML and is written like this:

    \begin{verbatim} #!/usr/bin/perl for (1..10) { print "Hello, world\n"; } \end{verbatim}

    The result would look like this:

    #!/usr/bin/perl for (1..10) { print "Hello, world\n"; }

    Also, you may find some of the tutorials here useful if you're in a rush to see if you and LaTeX get along.

    — Arien

Re: Re: Creating Books and Manuals with Perl
by weini (Friar) on Sep 10, 2002 at 11:53 UTC
    As I mentioned earlier I use noweb for mixing Perl code and documentation. There's a onepage Guide to using noweb at http://www.eecs.harvard.edu/~nr/noweb/onepage.ps.
    I am not good at LaTeX but I understand it and was able to start my documentation work after a few minutes of reading. If you know LaTeX well, you'll be even faster.

    What I like in using noweb is the fact that I have just one file to edit. I can then extract the documentation (html, ps, pdf) and the several other files (e.g. perl-script, perl-module, sql-script, makefile). UC: I'm a real fan ;^)

    weini

Re: Re: Creating Books and Manuals with Perl
by bronto (Priest) on Sep 10, 2002 at 15:22 UTC

    Since you say you have two Lamport's books I suppose you don't have The LaTeX Companion. It explains in good detail a lot of useful LaTeX packages. I definitely reccommend it.

    Ciao!
    --bronto

    # Another Perl edition of a song:
    # The End, by The Beatles
    END {
      $you->take($love) eq $you->made($love) ;
    }

Re: Creating Books and Manuals with Perl
by crenz (Priest) on Sep 10, 2002 at 17:51 UTC

    I recommend getting hold of the listings package.

    It allows for short code snippets as well as long listings and file inclusions, source highlighting, supports a few dozen languages etc. etc. and even has a switch to display/not display POD in perl files.

    Hmm... it might be a nice project to include that in pod2latex...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://196593]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-20 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found