I want the content of \verbatim
to be indented relative to the actual indent of \verbatim
, not the exact number of spaces.
For example, I like to indent at sections to make the LaTeX source more readable:
\section{a}
Regular paragraph.
\begin{verbatim}
Gets indented by 2 spaces. Bad!
\end{verbatim}
The problem is that the verbatim will also get an unwanted 2 space indent in that case.
I could solve it via:
\section{a}
Regular paragraph.
\begin{verbatim}
Not indented in output, GOOD. But LaTeX source is ugly. BAD!
\end{verbatim}
or:
\section{a}
Regular paragraph.
\begin{verbatim}
Not indented in output, GOOD. but LaTeX source is ugly.
\end{verbatim}
but then I'd lose all my LaTeX source indentation.
Is there a way to only count spaces relative to the indent of the verbatim
environment?
If this were possible, I would expect:
\section{a}
Regular paragraph.
\begin{verbatim}
Gets indented. Bad!
\end{verbatim}
to either render without indentation, or with negative indentation, but it does not matter since I don't intend to ever use it.
<blank line><blank line>\section{Title}<blank line>
that, together with syntax coloring makes section titles recognizable.