[Tugindia] LaTeX question: Verbatim font size adjustment.

S. venkataraman svenkat at ignou.ac.in
Tue Oct 20 13:05:31 CEST 2009


On Fri, Oct 16, 2009 at 11:47 AM, Shakthi Kannan <shakthimaan at gmail.com>wrote:

> Hi,
>
> --- On Fri, 2009-10-16 at 10:28 +0530, Manjunatha G. wrote:
> | I use the \begin{verbatim} ... \end{verbatim} block when I want to
> | display computer output. It works fine, but I want to be able to
> | control the font size in the block - how do I do that?
> \--
>
> If you want more control, you can define your own font with size,
> colour, attributes using:
>
>  \newcommand{\bigsize}[1]{\color{red}{\fontsize{60}{60}{\textbf
>      {\selectfont #1}}}}
>
>  \newcommand{\medsize}[1]{\fontsize{25}{25}\selectfont #1}
>
>  \newcommand{\command}[1]{\textsl{\textit{#1}}}
>
> and you can use it as:
>
>  \bigsize{Nice}
>  \medsize{output with}
>  \command{$ /bin/dmesg}
>
> SK
>
> --
> Shakthi Kannan
> http://www.shakthimaan.com
> _______________________________________________
> Home:        http://www.tug.org.in/
> TeX FAQ:     http://www.tex.ac.uk/faq
> unsubscribe: http://tug.org/mailman/listinfo/tugindia
>
Another option is the listings package.  It is specifically for
typesetting programmes. It supports a lot of languages, C, C++, Java,
and so on.  You can add your own language if you want.
It is a very versatile and powerful package.
Venkataraman


More information about the tugindia mailing list