Hello all,
I am new with TM (and quite new with Mac anyway) and I like it a lot! I used WinEdt for LaTeX and Matlab. It has a very nice feature: If you are typing an umlaut like ä, ü, é, etc. it writes in TeX-code "{a},"{u},'{e} etc. to the tex-file, while the umlaut is still seen in the editor. The advantage of this is obvious: You don't have to care about the encoding, you can share the file easily and the spellcheck works still fine. This feature could be interesting for html as well.
Moreover, since one like to see greek letters like "α" (UTF8: CE B1) instead of \alpha an automatic replacement in the editor (while still writing \alpha to the tex-file) would be very nice, too!
I didn't found any discussion about this topic in this forum. Is this of interest for you? Is there a solution already? I would be very pleased about this feature.
Best regards
Matthias
Matthias Conrad <conrad@...> writes:
If you are typing an umlaut like ä, ü, é, etc. it writes in TeX-code "{a},"{u},'{e} etc. to the tex-file
A very simple but partial solution to your request: define a new command with the options
Input: Selected text or Word Output: Replace selected text Key equivalent: Option + u
The code for the command is the following:
#!/usr/bin/env ruby w = STDIN.read if w.length != 0 : print w[0,w.length-1]+"\"{"+w[-1,1]+"}" end
It works like this: you type Doppelga then you press OPT+U and the a gets umlaued Doppelg"{a} then you continue typing Doppelg"{a}nger
Essentially, you type the Umlaut after the vowel instead of before the vowel. Note that this disables the normal key combination OPT+U for umlauts, so you should tie it to the scope text.tex.latex (or choose a different key shortcut).
As to your second request, concerning umlauts and more general characters, personally I am totally against it. I find it very confusing working with text editors which show half text, half preview (e.g. emacs with inline preview), and it slows me down. Moreover when you need to make some correction you must switch from preview to actual text, which is a pain. But this is my taste of course
Piero
Hi,
thanks for the answer, though my request was in an other direction. I will explain it with your example:
I want to type "Doppelgänger" (I have a german keyboard) and see exactly this typing in TM. However, in my TeX-File (suppose name.tex) TM writes "Doppelg"{a}nger", especially without any "key equivalent". ... with the described benefit.
Thanks a lot
Matthias
Am 15.08.2007 um 13:44 schrieb Piero D'Ancona:
Matthias Conrad <conrad@...> writes:
If you are typing an umlaut like ä, ü, é, etc. it writes in TeX-code "{a},"{u},'{e} etc. to the tex-file
A very simple but partial solution to your request: define a new command with the options
Input: Selected text or Word Output: Replace selected text Key equivalent: Option + u
The code for the command is the following:
#!/usr/bin/env ruby w = STDIN.read if w.length != 0 : print w[0,w.length-1]+"\"{"+w[-1,1]+"}" end
It works like this: you type Doppelga then you press OPT+U and the a gets umlaued Doppelg"{a} then you continue typing Doppelg"{a}nger
Essentially, you type the Umlaut after the vowel instead of before the vowel. Note that this disables the normal key combination OPT+U for umlauts, so you should tie it to the scope text.tex.latex (or choose a different key shortcut).
As to your second request, concerning umlauts and more general characters, personally I am totally against it. I find it very confusing working with text editors which show half text, half preview (e.g. emacs with inline preview), and it slows me down. Moreover when you need to make some correction you must switch from preview to actual text, which is a pain. But this is my taste of course
Piero
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Matthias Conrad <conrad@...> writes:
I want to type "Doppelgänger" (I have a german keyboard)
and see exactly this typing in TM. However, in my TeX-File ( suppose name.tex) TM writes "Doppelg"{a}nger", especially without any "key equivalent". ... with the described benefit.
Then it's even simpler: just define a snippet which inserts "{o} associated to the key shortcut ö, a similar one for ü and a similar one for ä.
Piero
On 8/15/07, Piero D'Ancona pierodancona@gmail.com wrote:
Matthias Conrad <conrad@...> writes:
I want to type "Doppelgänger" (I have a german keyboard)
and see exactly this typing in TM. However, in my TeX-File ( suppose name.tex) TM writes "Doppelg"{a}nger", especially without any "key equivalent". ... with thedescribed benefit.
Then it's even simpler: just define a snippet which inserts "{o} associated to the key shortcut ö, a similar one for ü and a similar one for ä.
That won't work for him, if I understood him right. I think what would work would be some script, that creates out of the tex-file one is working on a temporary file and then goes through the file changes the umlauts and other stuff to entities and renders then the temporary file. But pdfsync would then be impossible. If I understand it correct he wants that he sees in textmate "Doppelgänger" but when rendering not "Doppelgänger" gets rendered but "Doppelg"{a}nger". So he never sees the entities in the document he's workin on but it gets rendered as there would be entities instead of umlauts in it.
Niels
Niels Kobschätzki <n.kobschaetzki@...> writes:
That won't work for him, if I understood him right. I think what would work would be some script, that creates out of the tex-file one is working on a temporary file and then goes through the file changes the umlauts and other stuff to entities and renders then the temporary file. But pdfsync would then be impossible. If I understand it correct he wants that he sees in textmate "Doppelgänger" but when rendering not "Doppelgänger" gets rendered but "Doppelg"{a}nger". So he never sees the entities in the document he's workin on but it gets rendered as there would be entities instead of umlauts in it.
Niels
Well, that defies the purpose of TextMate which is…… to show the content of the .tex file… I'm confused… The request is something like Lyx, some wysiwyg thing ?
On Aug 15, 2007, at 9:09 AM, guerom00 wrote:
Niels Kobschätzki <n.kobschaetzki@...> writes:
That won't work for him, if I understood him right. I think what would work would be some script, that creates out of the tex-file one is working on a temporary file and then goes through the file changes the umlauts and other stuff to entities and renders then the temporary file. But pdfsync would then be impossible. If I understand it correct he wants that he sees in textmate "Doppelgänger" but when rendering not "Doppelgänger" gets rendered but "Doppelg"{a}nger". So he never sees the entities in the document he's workin on but it gets rendered as there would be entities instead of umlauts in it.
Niels
Well, that defies the purpose of TextMate which is…… to show the content of the .tex file… I'm confused… The request is something like Lyx, some wysiwyg thing ?
Yes, TextMate is a "What You See is What Is There" editor. It is almost impossible to make it show something different than what is in the file. The only thing we can have is easily accessible scripts that take you back and forth between the two formats, i.e. one command that converts all umlauted, greek etc to their LaTeX codes, and one that does the opposite.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
When I need umlauts in LaTeX I usually use \usepackage[utf8]{inputenc}
Just save your file in utf8 encoding and you can type umlauts directly. That way your code stays readable and there is no need for an editor to replace anything.
Ruben