I apologize if this has been answered elsewhere. I haven't been able to find it. I am using the minted package and I would like to have sections similar to
\section{Section Headings}
So I have two problems:
How do I use the latex command
\sectionin the middle of the minted environmentI thought maybe I could just use
\end{minted}\section{My Section}\begin{minted}[ ... ], however this introduces a new problem where my line numbers start counting from 1 again in the new section, which I don't want.
Any help or insight would be much appreciated.

\begin[linenos,firstnumber=...,], although i'm affraid you need to manually insert the first line number yourself. – guillem Jan 17 at 15:41