# minted custom numbering

Is it possible to define custom numbers to each source code line, like:

1 string title = "This is a Unicode π in the sky"
22 /*
23 Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the perimeter
24 of an $n$-sided regular polygon circumscribing a
25 circle of diameter $d$.
26 */
30-40 ...
162 const double pi = 3.1415926535

• There isn't a built-in way to do this. But if you work with fancyvrb, which is what minted uses internally, you can probably figure out a way to do this. You would want to look at the counter FancyVerbLine (line number) and maybe the macro \theFancyVerbLine (typesetting style). – G. Poore Jan 15 '14 at 3:10

\inputminted[texcomments]{python}{code/excerpt.py}

# \setcounter{FancyVerbLine}{20}