# How to remove minted indentation level with correct latex indentation?

When writing with minted code snippets I dislike to remove indentation in latex source, so correct results are generated. Is there a way to substract latex indentation-level from minted indentation? I hope this mwe makes it clear:

\documentclass{beamer}
\usepackage{minted}
\begin{document}
\begin{frame}[fragile,t]
\begin{itemize}

\begin{minted}{python}
l = 1
\end{minted}

not so nice Latex source but, correct indentation

\begin{minted}{python}
l = 1
\end{minted}

So how to subtract the indentation level from latex source?

\end{itemize}
\end{frame}
\end{document}


producing this output:

BTW: Please consider that code listings may have a line lengths up to 80 characters, where this additional indent will cause overlapping source, or linebreaks.

There's an option called autogobble which does exactly what you want.

% arara: pdflatex: {shell: 1}
\documentclass{beamer}
\usepackage{minted}
\begin{document}
\begin{frame}[fragile,t]
\begin{itemize}

\begin{minted}[autogobble]{python}
l = 1
\end{minted}

not so nice Latex source but, correct indentation

\begin{minted}{python}
l = 1
\end{minted}

So how to subtract the indentation level from latex source?

\end{itemize}
\end{frame}
\end{document}