[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] (New?) No indentation in some circumstances
From: |
Mosè Giordano |
Subject: |
Re: [AUCTeX] (New?) No indentation in some circumstances |
Date: |
Sun, 19 Jun 2016 23:24:01 +0200 |
Hi Denise,
2016-06-19 18:18 GMT+02:00 Denis Bitouzé <address@hidden>:
> Hi,
>
> consider the following minimal `.dtx' example:
>
> --8<---------------cut here---------------start------------->8---
> % \begin{macrocode}
> \newcommand{\blah}{%
> \textbf{%
> blah%
> }%
> }
> \newcommand*{\bleh}{%
> address@hidden
> \begin{tabular}{l}
> }{%
> \begin{tabular}{r}
> }%
> bleh
> \end{tabular}
> }
> \newcommand{\blih}[1]{%
> \textbf{%
> blih%
> }%
> }
> % \end{macrocode}
> --8<---------------cut here---------------end--------------->8---
>
> The content of the \blah macro can be indented as usually with the TAB
> key.
>
> But, I guess because of the disruptive two \begin{tabular} for only one
> \end{tabular}, the content of the \blih macro cannot be properly
> indented.
>
> IIRC, indentation used to work properly in both cases.
Are you sure it used to work in this case? If you could provide a
version where it worked we could try to look for the culprit.
> Do you know what's going on?
I think you got it right: unbalanced "\begin" and "\end" are a
problem. 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; make "\newcommand" a verbatim
command (I don't remember it it's possible to do it for two-argument
macros, though). In addition, can't you do the conditional test on
the argument of "\begin{tabular}" only and call "\begin{tabular}" just
once?
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"?
Bye,
Mosè