Hi Maarten,
welcome aboard! I hope you like it and stay with us!
This might overlap with what Jacob said, but since I wrote it while offline I'll just send it along as is.
On Dec 2, 2006, at 8:50 AM, Maarten Sneep wrote:
Hi,
This is my first post to this list. I've been a user of BBEdit for many years, and out of curiosity I've decided to check out TextMate. I'm actively involved in the MacTeX effort, mainly for testing, and I've written a set of Applescripts and shell scripts for BBEdit to play nice with LaTeX. For these scripts I made sure they play nice with the tricks TeXShop uses for multi-file projects, since TeXShop is the standard entry-level application that most will use when they start with (La)TeX on Mac OS X, and if you're compatible with the starting point, you make it a lot easier to upgrade to a serious editor.
TeXShop defines some meta comments, describing the source, and how it can be typeset. From the help-files:
%!TEX TS-program = command %!TEX encoding = encoding %:Marker %!TEX root = Document
By an odd coincidence, Kevin Ballard added yesterday support for %! TEX root, and some rudimentary support for %!TEX TS-program. To check that out, you will need to check out the subversion version of the bundle, which gets updated very frequently. Look at the TextMate manual [1] in the section “Getting More Bundles” for information how to set that up, and you can email the list with any problems (or even better, join us at the ##textmate IRC channel)
We actually already were doing a bit of sniffing of the file to detect which program should be used, for instance switching to latex +dvips in the presence of pstricks, or to xelatex in the presence of the xunicode or fontspec packages. But these settings will take precedence.
It would be useful to have a "open selection" command that opens a referenced file, and an open master command. I have some of those in my scripts in my bundle [1], for regular tex files, and graphics files (either open the original metapost source, of open the graphic in preview or so).
That's actually not a bad idea, and should be easy to implement. I suppose you mean something like: If the caret is over the filename in \include{filename}, then to open filename for editing, or if the caret is over the image in \includegraphics{image}, to open the image. Or would you rather the command scans the entire line for any such relevant things, and offer you a popup if there are more than one?
Addendum: I just prepared such a command, and will be committing it shortly. Probably not perfect yet.
As far as encoding goes, TextMate always presents its commands with utf-8 data, taking care of trying to figure out the encoding of the original file as best it can, and keeping this transparent from the bundle items, which just act on utf-8 data. Allan has talked extensively on his views on the whole encoding issue [2]. Let us know of any particular problems you encounter.
Finally, the %: markers have been implemented for some time now I think, you should be seeing them in the symbol list, which you can see in the bottom right of the window, or you can bring it up via ctrl-shift-T.
Perhaps here I will take the opportunity to list the various resources on the workings of the LaTeX bundle, even though they are slightly out of date (and the mailing list archives offer for the moment more up to date info).
1. The built in LaTeX bundle help, which you can find by opening the bundle menu via ctrl-esc for instance, and navigating to LaTeX -> Help. Pressing the Help button on your keyboard (if you have such a button) while in a LaTeX file should have the same effect. 2. There are a number of screencasts and post on my blog: [3]
I have a sample project that shows most of the issues, mail me off- list if you are interested.
Please do send it to me.
Haris
[1] http://www.macromates.com/textmate/manual [2] http://macromates.com/blog/archives/2005/09/18/handling-encodings- utf-8/ [3] http://skiadas.dcostanet.net/afterthought/list-of-my-textmate-pages/
Regards,
Maarten Sneep
References: [1] http://www.nat.vu.nl/~sneep/tex/CompileTeX-BBEdit8.dmg [2] http://mactextoolbox.sourceforge.net/articles/japanese.html
List of supported encodings in TeXShop. There is one item to take care of in editing TeX sources for Japanese users. The details for that can be found at [2].
MacOSRoman, IsoLatin, IsoLatin2, IsoLatin5, MacJapanese, DOSJapanese, SJIS_X0213, EUC_JP, JISJapanese, MacKorean, UTF-8 Unicode, Standard Unicode, Mac Cyrillic, DOS Cyrillic, DOS Russian, Windows Cyrillic, KOI8_R, Mac Chinese Traditional, Mac Chinese Simplified, DOS Chinese Traditional, DOS Chinese Simplified, GBK, GB 2312, GB 18030.