I would like to compile a *plain* tex document which includes some postscript (.eps) figures. The problem is that if I choose tex (or etex) as the engine the dvi file is correctly generated, but its not automatically converted to pdf, nor the dvi file is sent by the viewer (Skim). This is no problem with *latex* files containing eps figures, since in that case the command "Typeset & View (PDF)" converts the .dvi file to .ps (by running dvips) and the resulting .ps file to .pdf (with ps2pdf), and opens the .pdf file. Is there an easy way to get TextMate to automatically run dvips and ps2pdf in succession when the engine is tex or etex, instead of latex?
Cheers,
Artemio
Artemio,
That sounds like a case that I probably did not cover. I only setup the autoconvert to work for the typesetting engines that are included as a part of the preferences dialog, since I could not possibly guess the right thing to do for variant xxxx of TeX that people might specify with a %!TEX directive.
My suggestion is that you you write yourself a little script call it mytex that calls plain tex and then dvips / ps2pdf If mytex is on your PATH then you can use mytex as the typesetting engine in the %! TEX directive.
Brad
On Jan 14, 2008, at 1:04 PM, agl wrote:
I would like to compile a *plain* tex document which includes some postscript (.eps) figures. The problem is that if I choose tex (or etex) as the engine the dvi file is correctly generated, but its not automatically converted to pdf, nor the dvi file is sent by the viewer (Skim). This is no problem with *latex* files containing eps figures, since in that case the command "Typeset & View (PDF)" converts the .dvi file to .ps (by running dvips) and the resulting .ps file to .pdf (with ps2pdf), and opens the .pdf file. Is there an easy way to get TextMate to automatically run dvips and ps2pdf in succession when the engine is tex or etex, instead of latex?
Cheers,
Artemio
View this message in context: http://www.nabble.com/compiling-*plain*-tex-documents-with-postscript-figure... Sent from the textmate users mailing list archive at Nabble.com.
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
Brad Miller-6 wrote:
Artemio,
That sounds like a case that I probably did not cover. I only setup the autoconvert to work for the typesetting engines that are included as a part of the preferences dialog, since I could not possibly guess the right thing to do for variant xxxx of TeX that people might specify with a %!TEX directive.
My suggestion is that you you write yourself a little script call it mytex that calls plain tex and then dvips / ps2pdf If mytex is on your PATH then you can use mytex as the typesetting engine in the %! TEX directive.
Brad
Brad,
Thanks a lot for your help! Although I am a total newbie with TextMate, after some experiment I came up with the following script called "alttex", which works like a charm (I'm posting it in case it may be of help to someone else):
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}" etex "$FILE" && dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "${FILE.tex}.ps"
Thanks a lot again,
Artemio
agl wrote:
Brad Miller-6 wrote:
My suggestion is that you you write yourself a little script call it mytex that calls plain tex and then dvips / ps2pdf If mytex is on your PATH then you can use mytex as the typesetting engine in the %! TEX directive.
Brad
Brad,
Thanks a lot for your help! Although I am a total newbie with TextMate, after some experiment I came up with the following script called "alttex", which works like a charm (I'm posting it in case it may be of help to someone else):
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}" etex "$FILE" && dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "${FILE.tex}.ps"
Thanks a lot again,
Artemio
Unfortunately, my previous message was wrong. What happens is that TextMate's "Typeset & View PDF" correctly runs the first command of my script (etex "$FILE") and generates the dvi file, but does NOT go on running the next commands. So if there is already an old pdf file it shows it (that's what confused me), but otherwise fails. What did am I missing here?
Cheers,
Artemio
On Jan 15, 2008, at 5:54 AM, agl wrote:
agl wrote:
Brad Miller-6 wrote:
My suggestion is that you you write yourself a little script call it mytex that calls plain tex and then dvips / ps2pdf If mytex is on your PATH then you can use mytex as the typesetting engine in the %! TEX directive.
Brad
Brad,
Thanks a lot for your help! Although I am a total newbie with TextMate, after some experiment I came up with the following script called "alttex", which works like a charm (I'm posting it in case it may be of help to someone else):
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}" etex "$FILE" && dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "$ {FILE.tex}.ps"
^ missing a % here
I think that should fix it.
Brad
Thanks a lot again,
Artemio
Unfortunately, my previous message was wrong. What happens is that TextMate's "Typeset & View PDF" correctly runs the first command of my script (etex "$FILE") and generates the dvi file, but does NOT go on running the next commands. So if there is already an old pdf file it shows it (that's what confused me), but otherwise fails. What did am I missing here?
Cheers,
Artemio
-- View this message in context: http://www.nabble.com/compiling-*plain*-tex-documents-with-postscript-figure... Sent from the textmate users mailing list archive at Nabble.com.
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
Brad Miller-6 wrote:
On Jan 15, 2008, at 5:54 AM, agl wrote:
agl wrote:
Brad Miller-6 wrote:
My suggestion is that you you write yourself a little script call it mytex that calls plain tex and then dvips / ps2pdf If mytex is on your PATH then you can use mytex as the typesetting engine in the %! TEX directive.
Brad
Brad,
Thanks a lot for your help! Although I am a total newbie with TextMate, after some experiment I came up with the following script called "alttex", which works like a charm (I'm posting it in case it may be of help to someone else):
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}" etex "$FILE" && dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "$ {FILE.tex}.ps"
^
missing a % here
I think that should fix it.
Brad
Brad,
That indeed fixed it. However, there's still a minor nag, namely if there is no pdf file corresponding to the tex file when you run the script TextMate doesn't open the newly generated pdf file after the script runs, and it wrongly complains that it doesn't exist (see my previous posting for more details). (The second and successive times everything works as expected, i.e, the existing pdf file is reloaded and brought to the front). Do you know how this (minor) problem could be fixed?
Cheers,
Artemio
agl wrote:
agl wrote:
Brad Miller-6 wrote:
My suggestion is that you you write yourself a little script call it mytex that calls plain tex and then dvips / ps2pdf If mytex is on your PATH then you can use mytex as the typesetting engine in the %! TEX directive.
Brad
Thanks a lot for your help! Although I am a total newbie with TextMate, after some experiment I came up with the following script called "alttex", which works like a charm (I'm posting it in case it may be of help to someone else):
FILE="${TM_LATEX_MASTER:-$TM_FILEPATH}" etex "$FILE" && dvips -t a4 "${FILE%.tex}.dvi" && ps2pdf "${FILE.tex}.ps"
Unfortunately, my previous message was wrong. What happens is that TextMate's "Typeset & View PDF" correctly runs the first command of my script (etex "$FILE") and generates the dvi file, but does NOT go on running the next commands. So if there is already an old pdf file it shows it (that's what confused me), but otherwise fails. What did am I missing here?
I just figured out that 99% of the problem was caused by a typo in the last command (ps2pdf "${FILE.tex}.ps"), which should have been ps2pdf "${FILE%.tex}.ps". After I corrected the typo, everything works EXCEPT for one thing. Namely, when I run my script for the first time (i.e., when there is no pdf file), the pdf is created but NOT opened, and I get the following error:
Document '/Users/.../xxx.pdf' not open in application The file /Users/.../xxx.pdf does not exist. error number 256 opening viewer
even if the file exists. The second and further times (as long as I don't delete the pdf file), everything works as expected.
Artemio