auctex
[Top][All Lists]

## Re: [AUCTeX] (New?) No indentation in some circumstances

 From: Denis Bitouzé Subject: Re: [AUCTeX] (New?) No indentation in some circumstances Date: Mon, 20 Jun 2016 16:44:12 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Hi Mosè,

Le 19/06/16 à 23h24, Mosè Giordano a écrit :

> Hi Denise,

Denise is a female name and mine is Denis, a male one ;)

> Are you sure it used to work in this case?

Yes, I am quite sure as I didn't noticed this behavior earlier in
multiple files where several parts of the code are of the same kind.

> If you could provide a version where it worked we could try to look
> for the culprit.

Well, I don't know how to go back to earlier versions of AUCTeX.

>> Do you know what's going on?
>
> I think you got it right: unbalanced "\begin" and "\end" are a
> problem.

Sigh...

> A couple of possible dirty workarounds: if possible, move the
> offending code in a separate file in order not to break indentation
> for the rest of the code;

Probably a bit overkilling...

> make "\newcommand" a verbatim command (I don't remember it it's
> possible to do it for two-argument macros, though).

I will loose automatic indentation within arguments of such verbatim
command, isn't it?

> In addition, can't you do the conditional test on the argument of
> "\begin{tabular}" only and call "\begin{tabular}" just once?

The following, for instance, fails because of "! Argument of \ifthenelse
has an extra }":

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{xifthen}
\begin{document}
\newcommand{\blah}{%
\textbf{%
blah%
}%
}
\newcommand*{\bleh}{%
\begin{tabular}%
{l}%
}{%
{r}%
}%
bleh
\end{tabular}
}
\newcommand{\blih}[1]{%
\textbf{%
blih%
}%
}

\bleh
\end{document}
--8<---------------cut here---------------end--------------->8---

> In any case, I'm not sure it's good LaTeX-style to define commands
> that fiddle with "\begin" and "\end".  Shouldn't this be a task of
> "\newenvironment"?

Not in my cases where some commands provide in one go the typesetting of
several data given earlier in analogous way to:

- \title, \author, \date (data collected),
-  \maketile             (data typesetted).

Best,
--
Denis