Currently I am trying to work with the minted package. My aim is to have a code snippet with the numbering for each line, which is centered in a figure.
My top level configuration looks like following:
\documentclass[parskip=full, fontsize=12pt, twoside=false]{scrreprt}
\usepackage{graphicx}
\usepackage{minted}
\setminted{linenos=true}
\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}
\begin{document}
\begin{figure}[!htb]
\centering
\begin{minted}{javascript}
let Parser = require('rss-parser');
let parser = new Parser();
\end{minted}
\end{figure}
\end{document}
The good thing is that it is centered in the document but the bad thing is that the numbering is missing.
If i comment out following line i get the numbering but the code is not centered anymore.
%\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}
Result looks like following then:
So is there any way how i can achieve both options? Centered and numbered? Hopefully someone has an answer! :)