l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 18: A professional photographer's view of Linux
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2005 Dec 05 10:55

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Chapters and links within pdf files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Chapters and links within pdf files



On Mon 05 Dec 05,  8:32 AM, Ken Bloom <kbloom@gmail.com> said:
> Peter Jay Salzman wrote:
> >
> > Along with amsmath, geometry, and fancyvrb, I think hyperref is in my top
> > list of groovy latex packages now.  Thanks!
> 
> ooh! fancyvrb looks cool! (getting my code examples into verbatim mode
> with a single character, and many other features)
> 
> --Ken

Oh, yeah.  Fancyvrb is one of those packages that every time you read a
section of the documentation, you find another feature which makes you
wonder how you could've lived without.

One of my favorite custom designed environments:


\DefineVerbatimEnvironment%
{VerbatimCmdProg}%
{Verbatim}%
{numbers=left, fontsize=\relsize{-2}, frame=single, commandchars=\\\{\}}



   \begin{VerbatimCmdProg}
   \textit{...previous code....}

   int i = 9999;
   while (i--) \{\label{topOfLoop}
      printf("i is \%d\Backslash{n}", i);
      ... lots of code ...
   \}

   \textit{...future code....}\label{until:9}
   \end{VerbatimCmdProg}

   The top of the loop is line~\ref{topOfLoop}


Basically, this environment:

   * places line numbers on the left
   * formats the code in a fontsize 2 lower than the current fontsize
      (really nice for long listings)
   * puts a thin single border around the entire code listing
   * allows me to \label certain lines.   very nice so you can add/delete
      lines from the code, and your reference remain valid.

The only drawback to "commandchars" (which allows labelling lines) is that
you need to escape '\' and '}' and '{'.  But this package is REALLY nice
when when you want create slides for a talk on programming.

Pete

ps- \relsize requires the relsize package.
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.