General ⇒ different font size lstinline and lstinputlisting
different font size lstinline and lstinputlisting
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
different font size lstinline and lstinputlisting
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
different font size lstinline and lstinputlisting
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