Hi,
can anybody tell me how to change the font size automatically in all inline listings? Normal listings should be in a smaller size. I wrote an own environment for C# (\lstdefinelanguage{CS}), but all my inline listings and my normal listings use this environment. If i change the size there, all sizes change. but i only want to change the inline listing size because i want it in the same size as the normal text.
Nico
General ⇒ different font size lstinline and lstinputlisting
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10340
- Joined: Mon Mar 10, 2008 9:44 pm
different font size lstinline and lstinputlisting
Hi Nico,
if you don't find a solution in the listings documentation I can offer you a solution using internal macros, for example:
Stefan
if you don't find a solution in the listings documentation I can offer you a solution using internal macros, for example:
Code: Select all
\makeatletter
\lst@AddToHook{TextStyle}{\let\lst@basicstyle\normalsize}
\makeatother
LaTeX.org admin
different font size lstinline and lstinputlisting
wow.. just working... cool.. thank you.
By the way, i did it like this, because i just wanted to change the size and not the font itself:
By the way, i did it like this, because i just wanted to change the size and not the font itself:
Code: Select all
\makeatletter
\lst@AddToHook{TextStyle}{\let\lst@basicstyle\ttfamily\normalsize\fontfamily{pcr}\selectfont}
\makeatother
-
- Posts: 1
- Joined: Thu Apr 23, 2009 4:11 pm
Re: different font size lstinline and lstinputlisting
Thank's a lot for that piece code. Very useful.