TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I change the font size of the number in minted environment? The font can be modified with fontsize parameter, but the number on the left side is not affected with it.

enter image description here enter image description here

This is the code:





  string title = "This is a Unicode π in the sky"
  Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
  of an $n$-sided regular polygon circumscribing a
  circle of diameter $d$.
  const double pi = 3.1415926535

share|improve this question
up vote 4 down vote accepted

\theFancyVerbLine should be redefined to control the line number style.

\renewcommand{\theFancyVerbLine}{\sffamily \textcolor[rgb]{0.5,0.5,1.0}{\huge \oldstylenums{\arabic{FancyVerbLine}}}}
share|improve this answer
How does this affect line number referencing? – Werner Sep 11 '13 at 20:25
@Werner fancyvrb redefines \refstepcounter for its purposes so that it essentially uses \arabic{FancyVerbLine} for defining \@currentlabel, rather than \theFancyVerbLine (see lines 1076–1080). So redefining \theFancyVerbLine is OK. – egreg Sep 11 '13 at 21:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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