Hi everybody,
It took me a little while to come up with this, what with finding the correct command and environment variable etc., so I figured that I might as well share it here. When you compile something with TeX or LaTeX in Terminal.app instead of say TeXShop or our favourite editor and an error message like this pops up
-----------
! Missing $ inserted. <inserted text> $ l.7
?
----------
you can enter 'e' to edit that file and correct the error. The problem on a vanilla TeX installation is that the vi editor is used for this. To use TextMate instead you can put this command in your .tcshrc
setenv TEXEDIT "mate -w -l %d %s"
and on entering 'e' TextMate will be launched and the caret will be placed on the line where the error occured. For the bash shell the above command would be
export TEXEDIT="mate -w -l %d %s"
I hope you'll find this useful, I certainly do :-)
Bye, Thomas
On 10/10/2005, at 12.56, Thomas Schröder wrote:
[...] you can enter 'e' to edit that file and correct the error. The problem on a vanilla TeX installation is that the vi editor is used for this. To use TextMate instead you can put this command in your .tcshrc
setenv TEXEDIT "mate -w -l %d %s"
Very nice tip! I have rolled it into the manual. I changed it to (for bash):
export TEXEDIT='mate -w -l %d "%s"'
So that it also works with paths containing spaces (tex didn't seem to handle this itself).
On the subject of “external editor”, I saw this [1] about doing similar for less. The blog post uses open with the txmt://-scheme, using mate it becomes:
export LESSEDIT='mate -l %lm %f'
[1] http://woss.name/2005/09/28/opening-files-in-textmate-from-less1/
On 11 Oct 2005, at 12:53, Allan Odgaard wrote:
On the subject of “external editor”, I saw this [1] about doing similar for less. The blog post uses open with the txmt://-scheme, using mate it becomes:
export LESSEDIT='mate -l %lm %f'
Ooh, that's much tidier. Thanks. :-)