On Thursday 07 December 2006 16:32, [EMAIL PROTECTED] wrote: > On Thu 07 Dec 06, 8:50 AM, Dylan Beaudette <[EMAIL PROTECTED]> said: > > On 12/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >On Tue 05 Dec 06, 7:44 PM, Dylan Beaudette <[EMAIL PROTECTED]> > > > > > >said: > > >> Greetings, > > >> > > >> I am attempting to use the ucthesis.cls document class for my MS > > >> thesis, > > > > > >but > > > > > >> have run into a bit of a snag in terms of altering font size. Commands > > > > > >like > > > > > >> \tiny \scriptsize etc. do not seem to have any effect within a > > >> verbatim environment. I did not have this problem when using a > > >> different document class. Ideally I would like all verbatim blocks to > > >> be slightly smaller > > > > > >than > > > > > >> the rest of the text so that they don't take up as much room on the > > >> page. > > >> > > >> here is a link to some of the details: > > >> http://www.movesinstitute.org/~kolsch/ucthesis/ucthesis.readme > > >> > > >> Cheers, > > > > > >Hey Dylan, > > > > > >Do yourself a favor and don't ever use verbatim. There's another > > > package which is at least an order of magnitude better. Maybe even two > > > orders of magnitude. It's called fancyvrb. > > > > > > > > >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 > > > > Thanks Pete! > > > > I will look into this immediately! > > > > Also, as a more general question: would you or any others recommend > > using the slightly dated ucthesis.cls ? Or would the book class, with > > some tweaking be better? > > > > Any ideas? > > > > Cheers, > > > > Dylan > > The ucthesis is subtley different from Davis's requirement. I believe > ucthesis is actually "ucberkeleythesis". Apparently the requirements are > _not_ uniform across the UC campuses. > > That said, it gets you very close. It all depends on the mood of the > person who checks your document. I don't think anyone hunches over your > thesis with a ruler and straight edge any longer. There was a very minor > thing with my dissertation, but I can't even remember what it was anymore. > That's the other fiction...since the advent of a computer, all of a sudden, > reformatting your thesis takes on a whole different dimension. A few > clicks of a keyboard. Back in the day, of course, you had to rewrite a > 100+ page tech document. > > > I would start with ucthesis since it's so close to what you need. > Borrowing someone's modified file is the best thing to do. If you like, I > can dig around for my modified ucthesis and send it to you offlist. > > Pete > _______________________________________________ > vox-tech mailing list > [email protected] > http://lists.lugod.org/mailman/listinfo/vox-tech
Thanks Pete. The document is looking better already. Cheers, -- Dylan Beaudette Soils and Biogeochemistry Graduate Group University of California at Davis 530.754.7341 _______________________________________________ vox-tech mailing list [email protected] http://lists.lugod.org/mailman/listinfo/vox-tech
