Hello everybody,
I have been trying Textmate for a couple of days now and am quite stunned -- it really has improved greatly compared to an older version I had tried before. It seems to have most of the key features I am missing in TeXShop for writing my Ph.D. dissertation (like tabs and code folding), so I am seriously considering switching.
Let me ask one question about using it for LaTeX however:
I would prefer to keep TeXShop to control the LaTeX processing rather than Textmate's own processing since I have some .engine file (i.e. scripts that are started form within TeXShop) I would like to keep to perform some specific tasks.
Of course I can simply set TeXShop to "external editor", open my main .tex file there and process it, but this is not so nice because of two reasons: - You have to switch applications. Not a big deal, but pressing a shortcut from within Textmate was nicer. - Syncing does not work. I suppose TeXShop would have to provide a feature to call an external editor and jump to a defined line, just like in TeXniscope (where it works fine).
Is there any chance that there will be a solution in the feature that would allow Textmate so tell TeXShop to begin the TeX processing (with a given .engine used), and that would allow syncing? Has there been a feature request for TeXShop already to implement the needed features?
Or am I simply missing something?
Thanks in advance, best
Matthias
On Jan 10, 2006, at 11:38 AM, Matthias Damm wrote:
Hello everybody,
Let me ask one question about using it for LaTeX however:
I would prefer to keep TeXShop to control the LaTeX processing rather than Textmate's own processing since I have some .engine file (i.e. scripts that are started form within TeXShop) I would like to keep to perform some specific tasks.
These .engine files seem to me to be just regular scripts, so you could directly create commands in TM to call those scripts, or am I missing something? Why do you need TeXShop for the scripts? My suggestion would be to get TextMate to do the script work that TeXShop would be doing, and avoid calling TeXShop at all. Can you be more specific about this .engine file, and what it does, or more specifically what are the things that TextMate can't do for you?
Thanks in advance, best
Matthias
-- Matthias Damm mad@macpla.net PGP key: http://macpla.net/MatthiasDamm.asc PGP fingerprint: CED3 6074 7F7D 3148 C6F3 DFF2 05FF 3A0B 0D12 4D41
Haris
Am 10.01.2006 um 22:08 schrieb Charilaos Skiadas:
I would prefer to keep TeXShop to control the LaTeX processing rather than Textmate's own processing since I have some .engine file (i.e. scripts that are started form within TeXShop) I would like to keep to perform some specific tasks.
These .engine files seem to me to be just regular scripts, so you could directly create commands in TM to call those scripts, or am I missing something? Why do you need TeXShop for the scripts? My suggestion would be to get TextMate to do the script work that TeXShop would be doing, and avoid calling TeXShop at all. Can you be more specific about this .engine file, and what it does, or more specifically what are the things that TextMate can't do for you?
They basically are scripts, yes.
I am working with this .engine file for example:
#!/bin/sh location=$(dirname "$1") basefname="${location}/`basename "$1" .tex`" # process the bibliography for file in "${location}/${basefname}"?.aux ; do bibtex "${file}" done
(BibTeX is called for any file1.bbl, file2.bbl etc., which are created by bibtopic to make multiple bibliographies possible.)
Would something like that work from Textmate? (Maybe it obviously does, I am not a shell guru ...)
Thanks, Matthias
On Jan 10, 2006, at 3:35 PM, Matthias Damm wrote:
They basically are scripts, yes.
I am working with this .engine file for example:
#!/bin/sh location=$(dirname "$1") basefname="${location}/`basename "$1" .tex`" # process the bibliography for file in "${location}/${basefname}"?.aux ; do bibtex "${file}" done
(BibTeX is called for any file1.bbl, file2.bbl etc., which are created by bibtopic to make multiple bibliographies possible.)
Would something like that work from Textmate? (Maybe it obviously does, I am not a shell guru ...)
Yes you should be able to just add this as the text to a command. The only thing you will have to do is to change $1 to $TM_FILEPATH, I think. The great thing about Textmate is exactly that it can help you become a shell guru. :) I knew very little about the shell before textmate. You just look at the various commands, and you learn. So if you just create a new command using $TM_FILEPATH instead of $1, asking it to save the file first, have it input the entire document and output either nothing or "HTML", you should be set. The hardest part would be choosing a good key equivalent for it. Bonus points if you make it create a nice looking HTML output, and allow you to click on any errors that appear. There are all sorts of possibilities...
Thanks, Matthias
-- Matthias Damm mad@macpla.net PGP key: http://macpla.net/MatthiasDamm.asc PGP fingerprint: CED3 6074 7F7D 3148 C6F3 DFF2 05FF 3A0B 0D12 4D41
Haris
Hi,
Yes you should be able to just add this as the text to a command. The only thing you will have to do is to change $1 to $TM_FILEPATH, I think. The great thing about Textmate is exactly that it can help you become a shell guru. :) I knew very little about the shell before textmate. You just look at the various commands, and you learn. So if you just create a new command using $TM_FILEPATH instead of $1, asking it to save the file first, have it input the entire document and output either nothing or "HTML", you should be set. The hardest part would be choosing a good key equivalent for it. Bonus points if you make it create a nice looking HTML output, and allow you to click on any errors that appear. There are all sorts of possibilities...
well, that worked (and thus was rather easy) indeed ...
The only change I had to make was to add "|pre" to the bibtex command to get a nice output.
For the records: To call BibTeX in a bibtopic-compatible way, use the following macro from within Textmate:
location=$(dirname "$TM_FILEPATH") basefname="${location}/`basename "$TM_FILEPATH" .tex`" # process the bibliography for file in "${basefname}"?.aux ; do bibtex "${file}"|pre done
Thanks for the quick help, best regards
Matthias
In that case, go to the TextMate preferences, create a new shell variable "TEX" and set its value to "latexmk.pl".
Go back to your latex file, do typeset and view, and everything is run automatically for you.
This is all thanks to the magic of the latexmk script[1].
You might also want to create the variable TM_LATEX_ERRLVL and set it to 2, that way the script pauses when there are warnings (otherwise it only stops on fatal errors that prevent the output of a pdf).
Jeroen.
Hi,
In that case, go to the TextMate preferences, create a new shell variable "TEX" and set its value to "latexmk.pl".
Go back to your latex file, do typeset and view, and everything is run automatically for you.
This is all thanks to the magic of the latexmk script[1].
Thanks for the hint. I knew about this script but I seem to have underestimated what it can do -- it seems to (generally) be able to work with bibtopic. However, I still seem to have some problems at the moment, so I will need some time to sort that out ...
Being able to created specialized scripts is valuable nevertheless, since I have a rather slow machine and won't want to go through the whole processing each time.
Thanks again, Matthias
Am 17.01.2006 um 21:18 schrieb Matthias Damm:
Thanks for the hint. I knew about this script but I seem to have underestimated what it can do -- it seems to (generally) be able to work with bibtopic. However, I still seem to have some problems at the moment, so I will need some time to sort that out ...
O.k., I've found out now: latexmk.pl is not able to work with bibtopic :-( What I saw worked only because there still were files created by my TeXShop macros, but latexmk can't update those.
So I will have to do the following:
1. make latexmk work with bibtopic (could be possible generally, since you can configure latexmk to use another bibtex program, and it could be possible to make it use some script here) 2. use latexmk for everything except bibtex 3. use some selfmade scripts instead
I probably will choose 3., if nobody has a brilliant hint for me to make 1. or 2. work ...
Best, Matthias