auctex
[Top][All Lists]
Advanced

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

Re: disable automatic indentation in table like environments


From: Thibaut Verron
Subject: Re: disable automatic indentation in table like environments
Date: Mon, 10 Aug 2020 15:11:41 +0200

Dear all,

For what it's worth, I have put up together a while ago an alternative function for `LaTeX-indent-tabular`. My biggest problem with the old function was its insistence on indenting hanging ampersands as if they were not hanging. It makes it impossible to break long lines, since AUCTeX then wants to indent the new line to the last column of the previous one.

The function is attached, it does not call `LaTeX-hanging-ampersand-position`.
I cannot guarantee that it always does the right thing, but so far it matched all my expectations.

Best,
Thibaut

Le dim. 2 août 2020 à 09:28, Jean-Jacques Rétorré <jj.retorre@gmail.com> a écrit :
sam. 01 août 2020,  François Patte <francois.patte@mi.parisdescartes.fr> disait :

> Le 01/08/2020 à 19:24, Jean-Jacques Rétorré a écrit :
>> sam. 01 août 2020,  François Patte <francois.patte@mi.parisdescartes.fr> disait :
>>
>>> Bonjour,
>>>
>>> I am wondering if it is possible to disable automatic indentation in
>>> table like environments (tabular, longtable, etc.).
>>>
>>> In a complex table, the result of automatic indentation is awfull and
>>> makes the able unreadable in emacs, so it is difficult to find errors...
>>>
>>> Thank you.
>>>
>>> PS. If possible give me some details on how to proceed, I don't know
>>> anything of lisp language (shame on me!)
>>
>> You can customize the variable 'LaTeX-indent-environment-list
>> and disable the functions you don't want to be active for the
>> ennvironments you want to customize
>>
>> M-x customize-variable ...
>
> Thank you for answering. I edited the LaTeX-indent-environment-list and
> found that only verbatim and verbatim* environments were set to :
> "current indentation".
>
> The others (equation, equation*, picture, tabbing, table, table*) are
> set to : "ignore".
>
> Do I have to add longtable for instance and how to do this?
>

I don't have this configuration, yet I haven't changed the default configuration.
Value:
(("verbatim" current-indentation)
  ("verbatim *" current-indentation)
  ("filecontents" current-indentation)
  ("filecontents *" current-indentation)
  ("tabular" LaTeX-indent-tabular)
  ("tabular *" LaTeX-indent-tabular)
  ("align" LaTeX-indent-tabular)
  ("align *" LaTeX-indent-tabular)
  ("array" LaTeX-indent-tabular)
  ("eqnarray" LaTeX-indent-tabular)
  ("eqnarray *" LaTeX-indent-tabular)
  ("displaymath")
  ("equation")
  ("equation*")
  ("picture")
  ("tabbing"))

Indentation in an environment is controlled by a function. I find that
the LaTeX-indent-tabular function is not very satisfactory in some
cases. The solution would be to write a function that does what you
want, but that's Emacs-lisp code.  It is one of the easiest computer
languages to learn and use that I know ...

--
JJR.


Attachment: latex-indent-tabular.el
Description: Text Data


reply via email to

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