[TxMt] LaTeX: Insert Environment based on current word

Charilaos Skiadas cskiadas at uchicago.edu
Fri Jun 16 16:19:05 UTC 2006


Hi Dan,
On Jun 16, 2006, at 4:41 AM, Daniel Käsmayr wrote:

> e.g. for enum inserts the following:
>
> \begin{enumerate}{:\label{enu:\}}
> 	\item
> \end{enumerate}
>
> please note the ":" which are not very useful and make LaTeX go  
> angry at you.

Indeed, the first ":" is not supposed to be there, it was supposed to  
be used to give a default value to the placeholder. Thanks for  
pointing this out. I use the script without TM_LATEX_INSERT_LABEL  
set, so I hadn't noticed this before.
> Please change this line in the snippet:
> 	zeroLineToPrint = "\\begin{#{name}}{$1:\\label{#{labPrefix}:$2\\}}"
> to:
> 	zeroLineToPrint = "\\begin{#{name}}{${1:}\\label{#{labPrefix}:$2\}}"
>
Actually it should be:
	zeroLineToPrint = "\\begin{#{name}}${1:\\label{#{labPrefix}:$2\\}}"

The idea here being that the whole \label... part is selected in case  
you don't want it, so that you could easily delete it. If you do want  
it, pressing tab once takes you inside the argument to the \label  
command, so that you can type the label.
I committed a fix.
>
> Dan

Haris





More information about the textmate mailing list