(This is my first time contributing, so please be gentle.)
I've found a problem (annoyance?) with the way that the `Typeset & View (PDF)` command works in the LaTeX bundle. I set `TM_LATEX_COMPILER` to `latexmk.pl` so that I don't have to deal with manually running BibTeX and all that, but I also use packages that depend on PSTricks and thus don't work with pdfLaTeX.
The problem is that while the command normally looks for the presence of `\usepackage{pstricks}` and then automatically uses `latex` instead of `pdflatex` for typesetting if appropriate, this does not happen if the compiler is set to `latexmk.pl`, since the rc file passed to the latter says to use `pdflatex`.
I've attached a quick and dirty patch to tell `latexmk.pl` to typeset to PostScript first if PSTricks is detected, which fixes the problem. The patch also contains a modification to the PSTricks detection part to add a search for the following packages which depend on it:
* [xyling] [1] * [pst-asr] [2] * [OTtablx] [3]
These are packages that I personally frequently use, and it's annoying to have to manually do a `\usepackage{pstricks}` just for the sake of telling TextMate it's being used. There's probably a better way to detect if *any* package uses PSTricks, but it would be cool if this could be committed for now. Feel free to consider that a completely selfish request, though maybe there are a few other linguists who would appreciate it. :-)
Aaron Jacobs
[1]: http://www.ling.uni-potsdam.de/~rvogel/xyling/ [2]: http://www.math.neu.edu/ling/tex/ [3]: http://wso.williams.edu/~nsanders/OTtablx/
Le 9 déc. 06 à 09:12, Aaron Jacobs a écrit :
(This is my first time contributing, so please be gentle.)
I've found a problem (annoyance?) with the way that the `Typeset & View (PDF)` command works in the LaTeX bundle. I set `TM_LATEX_COMPILER` to `latexmk.pl` so that I don't have to deal with manually running BibTeX and all that, but I also use packages that depend on PSTricks and thus don't work with pdfLaTeX.
It's possible to use PSTricks with pdfLaTeX but you need \usepackage {pst-pdf} and to use the script ps4pdf
The problem is that while the command normally looks for the presence of `\usepackage{pstricks}` and then automatically uses `latex` instead of `pdflatex` for typesetting if appropriate, this does not happen if the compiler is set to `latexmk.pl`, since the rc file passed to the latter says to use `pdflatex`.
I know anything about `latexmk.pl`, but the real problem it's the command Typset and VieW, we have the only options : xetex and pdflatex perhaps latex it's important for some users.
Greetings
Alain
On 12/9/06, Alain Matthes alain.matthes@mac.com wrote:
It's possible to use PSTricks with pdfLaTeX but you need \usepackage {pst-pdf} and to use the script ps4pdf
I'd rather avoid such workarounds and just use the `latex` -> `dvips` -> `ps2pdf` route. It's really no problem, and works fine out of the box with the TextMate bundle as long as one doesn't use `latexmk.pl`.
I know anything about `latexmk.pl`, but the real problem it's the command Typset and VieW, we have the only options : xetex and pdflatex perhaps latex it's important for some users.
I'm sorry, I don't really understand what you are saying here. If it's that `latex` isn't an option then that's not the case, because it *is* appropriately used if `\usepackage{pstricks}` is found in the document. The problem is that this is broken by using `latexmk.pl` as your compiler, which I want to do so that I don't have to run BibTeX by hand.
My patch fixes this; I'm just trying to find someone who will commit it (or another modification that fixes the same problem).
Aaron
Le 9 déc. 06 à 10:03, Aaron Jacobs a écrit :
I know anything about `latexmk.pl`, but the real problem it's the command Typset and VieW, we have the only options : xetex and pdflatex perhaps latex it's important for some users.
I'm sorry, I don't really understand what you are saying here. If it's that `latex` isn't an option then that's not the case, because it *is* appropriately used if `\usepackage{pstricks}` is found in the document. The problem is that this is broken by using `latexmk.pl` as your compiler, which I want to do so that I don't have to run BibTeX by hand.
My patch fixes this; I'm just trying to find someone who will commit it (or another modification that fixes the same problem).
In Typset & view script :
# Set up TeX compiler, fallback to xelatex if document indicates it if grep -Esq '\usepackage{.*(xunicode|fontspec)|program=xelatex' "$M" then DEF_TEX=xelatex else DEF_TEX=pdflatex fi TEX=${TM_LATEX_COMPILER:-$DEF_TEX}
also if need to work latex , i prefer to make a new script but you can use perhaps shell variable !
look at this old mail
"I don't know much about postscript drawing, but is it possible that it wouldn't work because of TextMate using pdflatex instead of plain latex?
In that case you might want to play around with the Shell variable TEX in TextMate. You should try setting it to "latexmk.pl"[1] or "latex". This will cause TextMate to use that command as the latex command (latexmk.pl is included in the distribution of TextMate).
To set that variable, go to TextMate's preferences, select the Advanced tab and then click on the Shell Variables button. Changes take effect immediately."
Alain
On 12/9/06, Alain Matthes alain.matthes@mac.com wrote:
In Typset & view script :
# Set up TeX compiler, fallback to xelatex if document indicates it if grep -Esq '\usepackage{.*(xunicode|fontspec)|program=xelatex' "$M" then DEF_TEX=xelatex else DEF_TEX=pdflatex fi TEX=${TM_LATEX_COMPILER:-$DEF_TEX}
Oh, I see the problem. You have an older version of the bundle. The latest version in SVN has an else if line that looks for the use of the PSTricks package. If it finds it, it sets `DEF_TEX` to `latex`.
Charilaos: Thanks a lot, I look forward to it.
Hi Aaron,
On Dec 9, 2006, at 4:03 AM, Aaron Jacobs wrote:
My patch fixes this; I'm just trying to find someone who will commit it (or another modification that fixes the same problem).
thanks for the patch, I'll try to get it in some time soon, though I am rather busy for the next half-day or so. I had no idea we actually have to tell latexmk what LaTeX to use, I would have expected it to find out for itself (the Typeset command is one the oldest ones in there, and I try to stay away from it as much as possible ;) ).
In general this list is the accepted place to send patches/questions/ suggestions about the Bundles. And you can usually find me in the irc channel as well, except when I'm sleeping, as in this case ;).
Welcome aboard!
Aaron
Haris