[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] (New?) No indentation in some circumstances
From: |
Denis Bitouzé |
Subject: |
Re: [AUCTeX] (New?) No indentation in some circumstances |
Date: |
Tue, 21 Jun 2016 10:26:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Le 20/06/16 à 23h37, Mosè Giordano a écrit :
> Hi *Denis*,
Congratulations! ;)
>>> Hi Denise,
>>
>> Denise is a female name and mine is Denis, a male one ;)
>
> oh my bad, I have a (female) friend called Denise, that's why I'm more
> used to type Denise than Denis, sorry :-)
You are forgiven :)
> To be honest, I don't remember a "recent" change that could have
> broken this kind of indentation. I trust you if you tell me that it
> worked at some point in the past, but having a working version to
> compare would be really great in order to try and fix this problem.
Is there a way to go back to previous versions of AUCTeX with the Emacs
package manager?
>>> 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...
>
> Didn't I tell you it was "dirty"? :-D
Yes, but you didn't tell overdirty ;)
>>> 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?
>
> Yes, but I don't think "\newcommand" is an often-used command,
> especially with long arguments.
Yes it is, especially in `.dtx' files.
>>> 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}%
>> address@hidden
>> {l}%
>> }{%
>> {r}%
>> }%
>> bleh
>> \end{tabular}
>> }
>> \newcommand{\blih}[1]{%
>> \textbf{%
>> blih%
>> }%
>> }
>>
>> \bleh
>> \end{document}
>> --8<---------------cut here---------------end--------------->8---
>
> I was thinking about something like
>
> \documentclass{article}
> \usepackage{xifthen}
> \newcommand*{\bleh}{%
> \begin{tabular}{\ifthenelse{\isnamedefined{foo}}{l}{r}}
> bleh
> \end{tabular}
> }
> \begin{document}
> \bleh{}
> \end{document}
>
> but not exactly this because it won't work.
Indeed: I guess, LaTeX won't agree :)
> You should ask for help on a specialized *TeX forum or mailing list,
> I think this would be the best solution, both for readability and to
> avoid the problem you ran into.
OK, I'll ask probably on SE.
Thanks.
--
Denis