I'm using the minted package for a paper that I'm writing and everything works perfectly fine and compiles without errors, except that, after the first time I use \begin{minted}{csharp}
the usual paragraph indentations aren't working anymore. Before that, whenever I leave a blank line between paragraphs, the following paragraph is indented automatically (as it should be), but after the first occurrence of minted, the same thing does not produce an indent. This is what my code looks like and what it produces:
\documentclass{article}
\usepackage{subcaption}
\usepackage{float}
\usepackage{minted}
\usepackage{listings}
\usemintedstyle{friendly}
\setminted[csharp]{
breaklines,
mathescape,
obeytabs=true,
tabsize=4,
linenos,
numbersep=5pt,
frame=single,
numbersep=5pt,
xleftmargin=0pt,
}
\newcommand{\lstCapLbl}[2]{%
\vspace{-0.9\baselineskip}
\captionof{listing}{#1\label{lst:#2}}
\vspace{0.9\baselineskip}
}
\begin{document}
\section{Paragraph}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\begin{minted}{csharp}
AudioSource audio = gameObject.GetComponent<AudioSource>();
\end{minted}
\lstCapLbl{Example Code Showing the Use of GetComponent}{}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
Using \indent
to manually indent the paragraph isn't working either after this piece of code. Does anyone have an idea what might be causing this?
UPDATE: I found out that the \lstCapLbl
command is causing the issue, any idea how to create such a caption without breaking the following paragraphs?