My problem is that I am writing a LaTeX document in emacs that has a lot of C code in it. I am using both the \minted and the \verbatim environments in various places. When I compile the LaTeX (using pdflatex), the resulting pdf looks fine. In the raw LaTeX code, I would like to be able to auto-indent using the rules of the C-major mode.
For example, I want to be able to mark the following region
\begin{verbatim}
void main(void)
{
printf("Hello World \n\r");
}
\end{verbatim}
And have emacs auto-format it to look like
\begin{verbatim}
void main(void)
{
printf("Hello World \n\r");
}
\end{verbatim}
In other words, I want to be able to run indent-region on the part that is actually C code using the rules from C mode, even though I am in LaTeX mode.
Does anyone know if this is possible?