1

I'm using the listings package and am satisfied with how my code listings look. The font in my inline-listings however is too small compared to the rest of the text. How can I only increase the font size of inline-listings?

this:

There also \lstinline{Send} and \lstinline$Receive$ classes to transfer data

becomes this:

enter image description here

This is my common style:

% common styles
\lstdefinestyle{common} {
  tabsize=2,
  numberstyle=\tiny,
  stepnumber=1, 
  inputencoding=latin1, 
  lineskip=-1pt,
  rulecolor=,
  basicstyle=\ttfamily\footnotesize,
  columns=flexible,
  upquote=true,
  aboveskip={1.3\baselineskip},
  showstringspaces=false,
  extendedchars=true,
  breaklines=false,
  prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
  escapechar=@,
  frame=single,
  showtabs=false,
  showspaces=false,
  showstringspaces=false,
  identifierstyle=\ttfamily,
  keywordstyle=\color[rgb]{1.0,0,0},
  keywordstyle=[1]\color[rgb]{0.133,0.545,0.133},
  keywordstyle=[2]\color[rgb]{0.5,0.0,0.0},
  keywordstyle=[3]\color[rgb]{0.127,0.427,0.514},
  keywordstyle=[4]\color[rgb]{0.4,0.4,0.4},
  commentstyle=\color[rgb]{0.266,0.537,0.553},
  stringstyle=\color[rgb]{0.769,0.114,0.145},
}
  • 1
    Please provide a complete document we can compile to reproduce the problem. How should we know what options you pass the class or what font packages you use? – cfr Aug 26 '15 at 0:54
  • Related: tex.stackexchange.com/questions/161549/… – jub0bs Aug 26 '15 at 8:04
2

The inline verbatim is small because you specify it that way! Change the line

  basicstyle=\ttfamily\footnotesize,

to

  basicstyle=\ttfamily,

or whatever and you'll be fine.

  • the question is about changing style in inline snippets, while your proposal would change style also in whole-paragraph snippets. – Gyom Sep 28 '15 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.