help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: indentation


From: Tassilo Horn
Subject: Re: indentation
Date: Fri, 30 Apr 2021 22:17:07 +0200
User-agent: mu4e 1.5.12; emacs 28.0.50

Wayne Harris via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> writes:

Hi Wayne,

> Today I was writing some TeX and the following happened.  Let me use
> ``[]'' to represent the point.
>
> \noindent {\em Notation.} As we often write polynomials in
> finite rings of characterisc 2, let's define
> %v
>   \[\poly(x) = ...\]
> %e
> in the same way that it was used in the introduction.  []%% Well...
>
> When I pressed RET, I got this
>
> \noindent {\em Notation.} As we often write polynomials in
> finite rings of characterisc 2, let's define
> %v
>   \[\poly(x) = ...\]
> %e
>   in the same way that it was used in the introduction.
>   []%% Well...

Electric indent works well when you just let Emacs do the indentation.
In your example, Emacs wouldn't indent the inline math (hitting TAB in
that line makes it pop to column 0), and then the next sentence wouldn't
be indented as well.  So basically you are fighting Emacs' LaTeX
indentation rules, and that becomes harder when `electric-indent-mode'
is enabled [1].  (At least with AUCTeX, `fill-paragraph' will also
adjust the indentation.)

FWIW, I'd write your example as

--8<---------------cut here---------------start------------->8---
\noindent {\em Notation.} As we often write polynomials in finite rings of
characterisc 2, let's define
\[
  \poly(x) = ...
\]
in the same way that it was used in the introduction.
--8<---------------cut here---------------end--------------->8---

which is indented according to how AUCTeX would do it or the builtin
`latex-mode' if `latex-indent-within-escaped-parens' is t.

Bye,
Tassilo



reply via email to

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