You can change font size quite easily with it:


   \usepackage{fancyvrb}

   \begin{Verbatim}[fontsize=8]
      foobar
   \end{Verbatim}


The fancyvrb environment rocks supremely when you include another package
called 'relsize' because it allows you to change fontsize relative to the
current fontsize:


   \usepackage{fancyvrb,relsize}

   \begin{Verbatim}[fontsize=\relsize{-2}]
      foobar
   \end{Verbatim}


It also allows you to print line numbers next to the text on the left margin
(note you can also use "numbers=right" to get the numbers to the right of
the text).


   \begin{Verbatim}[fontsize=\relsize{-2},numbers=left]
      item 1
      item 2
      item 3
   \end{Verbatim}


You can even define your own environment so you don't have to keep putting
the same options within the [] everytime you use fancyvrb:


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


   \begin{VerbatimProg}
   int main( int argc, char *argv[] );
   \end{VerbatimProg}


BTW, the "frame=single" means "put a frame box around the verbatim text".
Another very cool feature.

One really great thing about fancyvrb is that you __can__ use LaTeX commands
from within the verbatim environment.  OH YESSSSSSSS!!!!!!

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


Allows you to do...



   \begin{VerbatimCmdProg}
   int main( void )
   \{
         printf("hello world\Backslash{n}");   \label{printf_call}
         return 0;
   \}
   \end{VerbatimCmdProg}


   Here we call {\tt printf()} at line \ref{printf_call}.


Two things to note when you use the commandchars feature of fancyvrb:

   * You have to escape the French braces "{" and "}".
   * You also have to jump through a hoop to print backslashes.  Here's how
      I defined \Backslash:

         \newcommand{\Backslash}[1]{\texttt{\symbol{92}}#1}


This is just a very tiny example of the power of fancyvrb.

Have fun!

Peter
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech