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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- 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