My problem is that I am writing a LaTeX document in emacs that has a lot of C code in it. I use both \ minted and \ verbatim environments in different places. When I compile LaTeX (using pdflatex), the resulting pdf looks great. In raw LaTeX code, I would like to be able to indent automatically using C-major mode rules.
For example, I want to mark the following area
\begin{verbatim} void main(void) { printf("Hello World \n\r"); } \end{verbatim}
And emacs automatically formats 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 the indentation region into the part, which is actually C code, using the rules from C mode, even if I enter LaTeX mode.
Does anyone know if this is possible?
jarvisschultz
source share