Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to change fonts in lstlisting package?

2,094 views
Skip to first unread message

loudking

unread,
Jan 9, 2008, 5:46:01 AM1/9/08
to
Hi all,

I am enclosing some C source code in my latex file with the help of
lstlisting package.

However, I would like those source code to have a different font than
other normal texts. For example, monospace should be used for source
code.

Would anybody tell me how to do that with lstlisting package?

Thanks in advance

Lars Madsen

unread,
Jan 9, 2008, 8:07:18 AM1/9/08
to

that is well described in the listings manual

--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html

loudking

unread,
Jan 9, 2008, 9:14:46 AM1/9/08
to
On Jan 9, 2:07 pm, Lars Madsen <dal...@RTFSIGNATUREimf.au.dk> wrote:
> loudking wrote:
> > Hi all,
>
> > I am enclosing some C source code in my latex file with the help of
> > lstlisting package.
>
> > However, I would like those source code to have a different font than
> > other normal texts. For example, monospace should be used for source
> > code.
>
> > Would anybody tell me how to do that with lstlisting package?
>
> > Thanks in advance
>
> that is well described in the listings manual
>

Sorry, I didn't find it

Martin Heller

unread,
Jan 9, 2008, 9:29:15 AM1/9/08
to
loudking skrev:

>> that is well described in the listings manual
>
> Sorry, I didn't find it

\lstset{%
basicstyle=\ttfamily
}

loudking

unread,
Jan 9, 2008, 9:42:31 AM1/9/08
to

Ok, Thanks,

I have been trying
stringstyle
....

0 new messages