[TxMt] LaTeX section snippets: special chars don't get escaped in label

Charilaos Skiadas cskiadas at uchicago.edu
Wed Mar 8 19:26:26 UTC 2006


On Mar 8, 2006, at 10:33 AM, Oliver Hagmann wrote:

> Hi
>
> Here's a question for the latex pro's: Do you know if special  
> characters like german umlauts are allowed in labels? e.g.:
>
> \section{Mein grünes Apfelbäumchen}
> \label{mein_grünes_apfelbäumchen}
>

> It works when typesetting the document. I just wanted to know if  
> this is valid code. Because if

My opinion in this is: If it works, then it is valid.

> _not_ then it would be nice, if these would be escaped  
> automagically when using the section, subsection and subsubsection  
> snippets. E.g.:
> \section{Mein grünes Apfelbäumchen}
> \label{mein_gruenes_apfelbaeumchen}
>

So, if I understand correctly, you want to change the snippet so that  
what you type in the section part is automatically written in the  
label part as well with characters escaped. It is probably possible,  
but I wouldn't want it to be part of the general snippet.  It is not  
too easy to make many transformations on the fly like that, and the  
question is which characters to escape. I would be more in favor of  
creating a command that escapes the current word or selection. That  
should be a lot easier to do, once provided with a dictionary of the  
substitutions desired, and again it could be easily customized.

> If it's easier to accomplish, you could also just escape a for ä, u  
> for ü, and o for ö, etc.
>
> Another nice enhancement would be if the \section and \label  
> commands would each be on a seperate line. I just asked about the  
> oppinions on this in the irc channel and I got at least one more  
> vote for this ;-)

You can certainly change the snippet in your personal copy, and add  
the new line. These snippets are supposed to be there just for  
guidance, and they can certainly be customized to suit your personal  
preferences. They were made based on my personal preferences, and I  
like the labels at the same line as what they are describing, but if  
the majority prefers them on a separate line, we can change the  
"official" snippets as well.
In any case, these snippets are sort of deprecated in favor of the  
"insert command based on current word" command, which is pretty  
customizable in that respect.
>
> Cheers. Oliver

Haris



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060308/992dde95/attachment.html>


More information about the textmate mailing list