[TxMt] LaTeX: feature suggestions for the LaTeX bundle.

Maarten Sneep maarten.sneep at xs4all.nl
Sat Dec 2 13:50:04 UTC 2006


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.

I must say that I like what I've seen so far, but I have some  
suggestions:

Textmate runs either the current file or a file pointed to in some  
environment variable. I guess there is an easy way to set this  
variable, but TeXShop uses a method that is not all that hard to  
implement; I did so for some BBEdit AppleScripts [1]. The core is  
actually implemented in a (rather ugly) shell script, you may be able  
to reuse parts of the script.

TeXShop defines some meta comments, describing the source, and how it  
can be typeset. From the help-files:

%!TEX TS-program = command
-- use command to typeset this file (pdflatex, latex, pdftex, texexec  
(context), …). If you encounter one of the classic tex formats  
(latex, tex), you should prepend with simpdf (simpdftex, simpdflatex)  
to handle some code which will not work in pdftex, like pstricks,  
simpdf(la)tex will take care of the final conversion to pdf and  
previewing.

%!TEX encoding = encoding
-- this file is encoded in encoding (a string using the Apple system  
names, see below for a list). Since all sane encoding use the same  
lower 7 bits, you can start reading in US ASCII until this string is  
encountered, and re-open in the correct encoding. 

%:Marker
-- use Marker in a tags menu. 

%!TEX root = Document
-- Use Document as the root for typesetting the current file.

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).

I have a sample project that shows most of the issues, mail me off- 
list if you are interested.

Regards,

Maarten Sneep

You haven't had real fun with regular expressions until you've  
written a vi regular expression to search for a vaguely remembered  
regular expression in a document which describes how they work.

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.




More information about the textmate mailing list