[Top][All Lists]

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

Re: Indenting the code written in square brackets as optional parameters

From: Arash Esbati
Subject: Re: Indenting the code written in square brackets as optional parameters
Date: Fri, 18 Mar 2022 17:40:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Hi Keita,

Ikumi Keita <> writes:

> If this proposal is acceptable, I can commit it the git repo and I'd
> appreciate if someone could write suitable paragraphs to include in
> .texi documentation ;-) .

While waiting for that someone to come up with that proposal (😉) what
do think about this:

--8<---------------cut here---------------start------------->8---
diff --git a/doc/auctex.texi b/doc/auctex.texi
index c5339097..047f387e 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -1724,6 +1724,30 @@ behavior you only need to remove @code{\|\[} and 
@code{\|\]} from
 @code{LaTeX-begin-regexp} and @code{LaTeX-end-regexp} variables

+@vindex TeX-indent-open-delimiters
+@vindex TeX-indent-close-delimiters
+A closely relevant topic is indenting of text enclosed in square brackets,
+parentheses and other pairs.  @AUCTeX{} offers two variables which control
+if indentation happens inside these pairs.
+@defopt TeX-indent-open-delimiters
+This variable contains additional opening delimiters which increase
+indentation.  For example add @code{[} to this variable to get text after
+a square bracket indented.
+@end defopt
+@defopt TeX-indent-close-delimiters
+This is the accompanying variable to @code{TeX-indent-close-delimiters}
+decreasing the indentation again.  This variable should contain @code{]}
+if @code{TeX-indent-open-delimiters} is set like described above.
+@end defopt
+Note that this is an opt-in feature, both variables are initially set to
+an empty string.  In case you only have an opening square bracket in your
+text without closing it, you can put the closing part as a comment in same
+line in order to have correct indentation for the following text.
 @node Filling
 @section Filling
 @cindex Filling
--8<---------------cut here---------------end--------------->8---

Best, Arash

reply via email to

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