Just out of curiosity, I fail to understand, why do the LaTeX bundle snippet tab triggers almost all start with a capital letter? I really frustrates me, because I always forget to capitalize the first letter, and each time I wonder why they are this way. Of course I can redefine them, and probably will do so real soon, just wondering if anyone can shed some light into the original -to my eyes not so clear- choice of tab trigger.
Also, is anyone planning to implement more snippets for LaTeX? Would there be interest in some, and if so, which?
Haris
On May 6, 2005, at 16:48, Charilaos Skiadas wrote:
Also, is anyone planning to implement more snippets for LaTeX? Would there be interest in some, and if so, which?
heh... what a coincidence, I just did this commit (message) earlier today http://lists.macromates.com/pipermail/textmate-dev/2005-May/ 001328.html:
It's been some years since I did LaTeX myself, but these are some of the things I recall I did a lot, so I added snippets for these, since none of the current snippets seems to cover this basic stuff, and during the last few weeks the topic of LaTeX support in TextMate has come up more than once :)
Feel free to extend this basic set! Also, maybe we should consider to remove or at least rework the current snippets, seeing how some of the text inserted is in French, and the tab triggers are IMHO not very ergonomic (no offense to the original author).
So you are very welcome to improve upon the default LaTeX snippets! I can set you up with write-access to the bundle repository if you are interested.
On May 6, 2005, at 10:13 AM, Allan Odgaard wrote:
So you are very welcome to improve upon the default LaTeX snippets! I can set you up with write-access to the bundle repository if you are interested.
That would be perfect, since I use LaTeX on a daily basis. It would be good to know what people would want though, otherwise I might add things that are really only useful to me :-).
Also, is there a place I can learn about working with a bundle repository in general? I.e. how to not delete everything etc. I've never worked with anything like svn, cvs and the rest, and the last thing I would want to do is screw up with the excellent work already done.
Haris
That is how they were set up originally (by Marcin maybe????) I assumed it was just to avoid conflicts, and/or accidentally triggering one of the Latex snippets in some other language. I've always thought about changing them back to lowercase, which especially makes sense now that we have scoping.
I too use Latex on a daily basis and would be more than happy to retrain my fingers in this case. I was going to add snippets for ref and cite so I could just as easily do the renaming while I'm in the mess.
Brad
On May 6, 2005, at 12:35 PM, Charilaos Skiadas wrote:
On May 6, 2005, at 10:13 AM, Allan Odgaard wrote:
So you are very welcome to improve upon the default LaTeX snippets! I can set you up with write-access to the bundle repository if you are interested.
That would be perfect, since I use LaTeX on a daily basis. It would be good to know what people would want though, otherwise I might add things that are really only useful to me :-).
Also, is there a place I can learn about working with a bundle repository in general? I.e. how to not delete everything etc. I've never worked with anything like svn, cvs and the rest, and the last thing I would want to do is screw up with the excellent work already done.
Haris ______________________________________________________________________ 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
On May 6, 2005, at 12:58 PM, Brad Miller wrote:
I too use Latex on a daily basis and would be more than happy to retrain my fingers in this case. I was going to add snippets for ref and cite so I could just as easily do the renaming while I'm in the mess.
When you do that, could you also change the key equivalent for "LaTeX and TeXniscope"? Right now, it conflicts with the "Edit Languages..." menu item. I've personally redefined it to be Opt-Cmd-T, put maybe there are other more appropriate options.
Also, the BibDesk completion thing doesn't seem to work quite right for me. For instance, I got:
Kashiwara}:1977 % Kashiwara, B}-functions and holonomic systems. {R}ationality of roots of B}-functions
when the cite key is Kashiwara:1977 and the title is:
${B}$-functions and holonomic systems. {R}ationality of roots of ${B}$-functions
Maybe it doesn't like the colon? It also added the closing brace, which would probably result in an extra brace in most uses I can think of. I'll try to see if I can fix it, though not sure when I'll get the time to do it.
Brad
Haris
On May 7, 2005, at 2:12, Charilaos Skiadas wrote:
When you do that, could you also change the key equivalent for "LaTeX and TeXniscope"? Right now, it conflicts with the "Edit Languages..." menu item. I've personally redefined it to be Opt-Cmd-T, put maybe there are other more appropriate options.
Generally I want bundle stuff to be on ctrl-shift-<key>. I've now made it ctrl-shift-L. Although it probably would make sense to come up with a general “build” key, similar to how we have ctrl-shift-V to validate whatever source/markup one is using.
Also, the BibDesk completion thing doesn't seem to work quite right for me [...]
Maybe it doesn't like the colon?
Yes, it inserts the bracket after first word, colon being a non-word character. I've fixed it.
It also added the closing brace, which would probably result in an extra brace in most uses I can think of.
Well, the problem is that the result from BibDesk contains a comment, so this is sort of required, or the comment should be stripped.
I think Thomas Schröder (who initiated the command) did actually strip the comment, so maybe that should be the default.
On May 7, 2005, at 3:09 AM, Allan Odgaard wrote:
On May 7, 2005, at 2:12, Charilaos Skiadas wrote:
Generally I want bundle stuff to be on ctrl-shift-<key>. I've now made it ctrl-shift-
That is in general a great combo for this, but wouldn't it conflict with the "Lines to enviroment" key equivalent? (Btw, Lines to environment seems to be broken in b8, the TM_BUNDLE_PATH variable doesn't seem to be set to anything. so it looks for "/linesToList.py".)
L. Although it probably would make sense to come up with a general “build” key, similar to how we have ctrl-shift-V to validate whatever source/markup one is using.
Yeah, I agree.
Also, the BibDesk completion thing doesn't seem to work quite right for me [...]
Maybe it doesn't like the colon?
Yes, it inserts the bracket after first word, colon being a non-word character. I've fixed it.
Works great in b7! That is broken too in b8 I'm afraid. (I guess this all has to do with TM_* variables not being inherited by commands anymore?)
It also added the closing brace, which would probably result in an extra brace in most uses I can think of.
Well, the problem is that the result from BibDesk contains a comment, so this is sort of required, or the comment should be stripped.
The comment is a nice touch (though I can see it as being irritating if someone doesn't want it there. I certainly didn't expect it to show up the first time I ran the command). Maybe the command could check whether there is a brace right after the selection, and strip it first before inserting the new text? Don't know how easy that would be.
I think Thomas Schröder (who initiated the command) did actually strip the comment, so maybe that should be the default.
It would certainly be nice if that were an option. I personally don't like the comments there, they disrupt my paragraph flow, so if the reference appears in the middle of a paragraph, makes it harder to read (for me at least).
Thanks for changing the tab triggers btw.
Haris
On May 7, 2005, at 18:58, Charilaos Skiadas wrote:
Generally I want bundle stuff to be on ctrl-shift-<key>. I've now made it ctrl-shift-
That is in general a great combo for this, but wouldn't it conflict with the "Lines to enviroment" key equivalent? (Btw, Lines to environment seems to be broken in b8, the TM_BUNDLE_PATH variable doesn't seem to be set to anything. so it looks for "/linesToList.py".)
hmm... seems TM_BUNDLE_PATH is missing for snippets, I'll fix that.
Not sure what the best key binding is though, but I do see that they currently clash.
Yes, it inserts the bracket after first word, colon being a non-word character. I've fixed it.
Works great in b7! That is broken too in b8 I'm afraid. (I guess this all has to do with TM_* variables not being inherited by commands anymore?)
No -- the TM_-stuff should be unnoticed for “normal” users. And BibDesk does work for me with b8.
The comment is a nice touch (though I can see it as being irritating if someone doesn't want it there. I certainly didn't expect it to show up the first time I ran the command). Maybe the command could check whether there is a brace right after the selection, and strip it first before inserting the new text? Don't know how easy that would be.
It can't really strip the comment after the selection, but it could change the inserted text, depending on the presence of bracket. But maybe it should just always strip the comment.
I think Thomas Schröder (who initiated the command) did actually strip the comment, so maybe that should be the default.
It would certainly be nice if that were an option. I personally don't like the comments there, they disrupt my paragraph flow, so if the reference appears in the middle of a paragraph, makes it harder to read (for me at least).
The option is just go change the command! :)
Currently it does (to process the res from BibDesk): res=`perl -pe <<<$res 's/^(.*?)(\s*)%/$1}$2%/'`
You could change it e.g. to: res=`awk <<<$res '{ printf("%s", $1) }'`
On May 7, 2005, at 1:04 PM, Allan Odgaard wrote:
Not sure what the best key binding is though, but I do see that they currently clash.
How about shift-ctrl-T ? Is that taken? I tend to think that T is more appropriate for LaTeX than L, or at least just as fine, and it will be natural to anyone using cmd-T in TeXShop (I think it was cmd-T, haven't used TeXShop in a while).
Yes, it inserts the bracket after first word, colon being a non-word character. I've fixed it.
Works great in b7! That is broken too in b8 I'm afraid. (I guess this all has to do with TM_* variables not being inherited by commands anymore?)
No -- the TM_-stuff should be unnoticed for “normal” users. And BibDesk does work for me with b8.
Hm, checked again and it works fine now. I wonder what my problem was before... There is the following behavior I can't understand though. In my case I have a comment that says: % Kashiwara, ${B}$-functions and holonomic systems. {R}ationality of roots of ${B}$-functions and it becomes % Kashiwara, B}-functions and holonomic systems. {R}ationality of roots of B}-functions Not really a big deal, especially since I changed the command and don't keep the comment, but I am just curious what happens to the dollar signs and the left brace.
The comment is a nice touch (though I can see it as being irritating if someone doesn't want it there. I certainly didn't expect it to show up the first time I ran the command). Maybe the command could check whether there is a brace right after the selection, and strip it first before inserting the new text? Don't know how easy that would be.
It can't really strip the comment after the selection, but it could change the inserted text, depending on the presence of bracket. But maybe it should just always strip the comment.
I think Thomas Schröder (who initiated the command) did actually strip the comment, so maybe that should be the default.
It would certainly be nice if that were an option. I personally don't like the comments there, they disrupt my paragraph flow, so if the reference appears in the middle of a paragraph, makes it harder to read (for me at least).
The option is just go change the command! :)
Already did, and now it works great! Thanks for the suggestion. One thing though: If i press cancel instead of selecting a reference, it replaces the selection with the word "false". One more suggestion. How about, if there is no selection and no current word, it just produces a list of all the bibliography items?
Currently it does (to process the res from BibDesk): res=`perl -pe <<<$res 's/^(.*?)(\s*)%/$1}$2%/'`
You could change it e.g. to: res=`awk <<<$res '{ printf("%s", $1) }'`
Haris
On May 7, 2005, at 20:31, Charilaos Skiadas wrote:
Not sure what the best key binding is though, but I do see that they currently clash.
How about shift-ctrl-T ? Is that taken?
It's “show scope”, but really, shift-ctrl-T is what I personally use for my various “test” commands, and it just slipped into the repository. It's probably time to make a list on the wiki with reserved keys ;)
There is the following behavior I can't understand though. In my case I have a comment that says: % Kashiwara, ${B}$-functions and holonomic systems. {R}ationality of roots of ${B}$-functions and it becomes % Kashiwara, B}-functions and holonomic systems. {R}ationality of roots of B}-functions Not really a big deal, especially since I changed the command and don't keep the comment, but I am just curious what happens to the dollar signs and the left brace.
Ah, it's inserted as a snippet, thus the dollar signs have special meaning. I have committed a fix.
It can't really strip the comment after the selection, but it could change the inserted text, depending on the presence of bracket. But maybe it should just always strip the comment.
I've made it do so.
One thing though: If i press cancel instead of selecting a reference, it replaces the selection with the word "false". One more suggestion. How about, if there is no selection and no current word, it just produces a list of all the bibliography items?
Well, makes sense -- but for that you'll have to learn shell scripting and add it yourself! ;)
On May 10, 2005, at 8:11 PM, Allan Odgaard wrote:
I've made it do so.
One thing though: If i press cancel instead of selecting a reference, it replaces the selection with the word "false". One more suggestion. How about, if there is no selection and no current word, it just produces a list of all the bibliography items?
Well, makes sense -- but for that you'll have to learn shell scripting and add it yourself! ;)
In fact, I just did both :-). If the current word ends in }, which will be the case for instance if someone has just typed: \cite{}, then it will pop up a list of all references in the first bibliography file open in BibDesk. (should probably make it look at all open files)
The fix you made for the comments seems to not work well in my case. It just inserted the comment too, just not commented any more :-) : kashiwara:1977 Kashiwara, ${B}$-functions and holonomic systems. {R}ationality of roots of ${B}$-functions
But I left it there because I don't have time right now to figure out what the correct thing should be. This one: res=`awk <<<$res '{ printf("%s", $1) }'` worked ok for me, producing just the cite key. I prefer it that way, but maybe other people prefer the comments? Dunno, so I did not touch that part.
Haris
PS: That is really one of the main things I've gained by using TM, I learned a whole lot of stuff about the shell. :-)