auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Modify environments interactively


From: Lars Madsen
Subject: Re: [AUCTeX] Modify environments interactively
Date: Mon, 16 Feb 2015 10:13:20 +0000

Bad formulation, meant to say

not as a first approximation to a macro. 

/Lars Madsen
Institut for Matematik / Department of Mathematics
Aarhus Universitet / Aarhus University
Mere info: http://au.dk/address@hidden / More information: 
http://au.dk/en/address@hidden


________________________________________
From: address@hidden address@hidden on behalf of Lars Madsen address@hidden
Sent: 16 February 2015 10:26
To: Tassilo Horn; address@hidden
Subject: Re: [AUCTeX] Modify environments interactively

Not as a first env

I was thinking more on the lines of

\begin{foo}
  \begin{bar}
   cursor
  \end{bar}
\end{foo}

then some macro would transform this into

\begin{foo}
   cursor
\end{foo}

i.e. if the env to be deleted is on lines of their own, then those lines are 
removed.

BTW: I haven't switched to 11.88 yet, was hooks added to 
LaTeX-modify-environment? AFAIR we can add environment hooks to C-c C-e but not 
to C-u C-c C-e (I think someone mentioned at one point that that should be 
added as well.

Why is this needed: I add cleanup hooks to certain envs, so if I mark a region 
and insert an env around it, then it clean up the contents. But at least with 
11.87 no such hook fires if you change an env.

An example of such a cleaner is for a hint env, used in exercises to make sure 
all hints are formatted the same way. Authors often forget this, thus the text 
is often

Hint: Blah blah...

My clean up hook here removes the 'Hint: '







/Lars Madsen
Institut for Matematik / Department of Mathematics
Aarhus Universitet / Aarhus University
Mere info: http://au.dk/address@hidden / More information: 
http://au.dk/en/address@hidden


________________________________________
From: address@hidden address@hidden on behalf of Tassilo Horn address@hidden
Sent: 16 February 2015 07:56
To: address@hidden
Subject: Re: [AUCTeX] Modify environments interactively

Igor Sosa Mayor <address@hidden> writes:

>> related, is there a build in feature for deleting a given env?
>>
>> This is sometimes handy when editing other peoples work. (some people
>> are very messy)
>
> this would be a good idea...

I guess doing `C-u C-c C-e' and then deleting the environment name could
do that, i.e., modifying an environment so that is has an empty name.
But there's no good way to delete an environment.  I mean, deleting the
\begin/\end is easy, but you'd probably also want to delete its \items
in case its an enumerate/itemize, etc.

Bye,
Tassilo


_______________________________________________
auctex mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/auctex

_______________________________________________
auctex mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/auctex



reply via email to

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