auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Indenting sections like environments


From: Tassilo Horn
Subject: Re: [AUCTeX] Indenting sections like environments
Date: Wed, 04 Mar 2015 08:11:07 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Chase Dwelle <address@hidden> writes:

> Thanks for the response, could one "cheat" and enclose sections in
> brackets, and then use the "TeX-brace-indent-level" option to force
> this behavior, i.e.,
>
> \chapter{Chapter 1}{
> \section{A section}{
> Text in section.
> }
> }

Yes, that would probably work.

> Or would the brackets potentially break some other behavior when
> trying to compile.  I have tested this without any problems, but not
> sure if something would happen with a more complicated document.

I think it wouldn't make a difference wrt compilation.  However, one
problem is that AUCTeX then treats everything inside one pair of {...}
as one paragraph.  E.g., with

--8<---------------cut here---------------start------------->8---
\section{section}{
  \label{sec:section}
  
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.

    \subsection{subsection}{
      \label{sec:subsection}
    
      This is some text.  This is some text.  This is some text.  This is some 
text.
      This is some text.  This is some text.  This is some text.  This is some 
text.
      This is some text.  This is some text.  This is some text.  This is some 
text.
      This is some text.  This is some text.  This is some text.  This is some 
text.
      This is some text.  This is some text.  This is some text.  This is some 
text.
      This is some text.  This is some text.  This is some text.  This is some 
text.
  }
}
--8<---------------cut here---------------end--------------->8---

pressing `M-q' on the very first "This is some text." will fill the
complete section as if it were one paragraph, i.e., you end up with

--8<---------------cut here---------------start------------->8---
\section{section}{
  \label{sec:section}
  
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.
  This is some text.  This is some text.  This is some text.  This is some text.

    \subsection{subsection}{
      \label{sec:subsection}
    
      This is some text.  This is some text.  This is some text.  This is some
      text.  This is some text.  This is some text.  This is some text.  This
      is some text.  This is some text.  This is some text.  This is some text.
      This is some text.  This is some text.  This is some text.  This is some
      text.  This is some text.  This is some text.  This is some text.  This
      is some text.  This is some text.  This is some text.  This is some text.
      This is some text.  This is some text.  } }
--8<---------------cut here---------------end--------------->8---

which is probably not what you expect.  Especially in larger documents,
it could be problematic when doing `M-q' on text at the very beginning
of a \chapter fills something in its last \subsubsection some 20 pages
further below where you have no chance to actually see what's modified.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]