I'm using minted to show pieces of code in my document. Some of the code has skipped line numbers. The resulting problem is that listings with skipped line numbers have different line number formatting than the ones without.
The minted documentation and this StackExchange question shows a way to modify the theFancyVerbLine command to change the formatting. However that won't effect the listings with line skips.
I tried combining the two approaches but that would duplicate the line numbers. What do I miss from the minted documentation?
Thanks in advance.
Minimal working example:
% arara: xelatex: {shell: yes }
\documentclass{scrreprt}
\usepackage{minted}
\renewcommand{\theFancyVerbLine}{\textcolor[rgb]{0.5,0.5,1.0}{\footnotesize\arabic{FancyVerbLine}}}
\begin{document}
\begin{listing}[H]
\begin{minted}[linenos]{py}
import bar from foo
print("Hello %s!" % "World")
\end{minted}
\end{listing}
\begin{listing}[H]
\renewcommand\theFancyVerbLine{%
\ifnum\value{FancyVerbLine}=2
\setcounter{FancyVerbLine}{125}\ldots
\else
\arabic{FancyVerbLine}%
\fi
}
\begin{minted}[linenos]{py}
import deep_thought as dt
print("The answer is %s!" % dt.getAnswerTo("everything"))
\end{minted}
\end{listing}
\end{document}


