2

EDIT Rephrased question to be more abstract and less specific to only fragile-frames.

Context:

While recompiling a presentation, the process halted with err-msg

file ended while scanning use of next.

During debugging the whole thing I found indented fragile-frames, although they weren't supposed to be.

I assume, TeXstudio might have indented the code as part of the code folding routine.


Problem: How do I prevent parts of source code from being automatically indented? How can arara or latexindent be utilized for this purpose?

A minimalistic WE using fragile-frame to exemplify the problem:

\documentclass{beamer}

\usepackage{listings}

\begin{document}

%not to be indented by texstudio!
\begin{frame}[fragile]{a title}
some explanation to the snippet
\begin{lstlisting}[caption=func foo not bar,label=fct:foo]
foo(a,b,c)
    c = a + b
    return c
\end{lstlisting}
\end{frame}

%allowed to be indented.
   \begin{frame}{smart title}
   some input
   \end{frame}

\end{document}
naphaneal
  • 2,614
  • 2
    This doesn't seem to be related to (La)TeX in the sense that it is probably a design consideration for the TeXstudio development team. Moreover, this seems a super-specific request: A frame that is fragile under beamer containing a lstlisting. What if you define a lstnewenvironment, or it's not in beamer, or...? – Werner Mar 17 '16 at 01:22
  • 1
    @Werner: according to help center, it is a question about TeX related tools (4th bullet). Yes, the problem itself might be very specfic in this case, the behaviour is not limited to only fragile-frames. The solution could be adapted to other sections of code, which aren't allowed to be indented as well. I'm currently rephrasing the question. Not sure how this would make it more on-topic, though. – naphaneal Mar 17 '16 at 08:44
  • @Naphaneal Yes, but the point that this can only be solved in the editor remains. Feature requests for editors are off-topic as they can only be implemented by the developers. – Joseph Wright Mar 17 '16 at 09:20
  • 1
    @Naphaneal Another approach would be to allow indented \end{frame}s http://tex.stackexchange.com/questions/234778/indenting-endframe-in-fragile-slides – samcarter_is_at_topanswers.xyz Mar 17 '16 at 14:02

0 Answers0