This new version uses PDFTeX by default, and will try to use TeXShop as the previewer. (Note that TeXShop is part of MacTeX 2007.)
The bundle is available (for the moment) here:
http://www.puffinry.demon.co.uk/LaTeX%20Watch%202.0.dmg
This version should be almost ready to be incorporated into the LaTeX bundle, so please let me know about any problems.
The default behaviour can be changed by setting shell variables, as follows:
1. If TM_LATEX_VIEWER=TeXniscope, it will use TeXniscope instead of TeXShop (If you should happen to want LaTeX Watch to use a different previewer from 'Compile and View', you can set TM_LATEX_WATCH_VIEWER=TeXShop to override the TM_LATEX_VIEWER setting.)
2. If TM_LATEX_WATCH_MODE=PS, then it will compile via DVI, and use GV to preview.
3. If TM_LATEX_WATCH_DEBUG=console, additional status messages will be printed to the console; if TM_LATEX_WATCH_DEBUG=dialog, these status messages will pop up in dialog boxes.
Incidentally, there is a utility in Support/bin/check_open that may be more generally useful. It uses the Carbon API to check whether a particular document is open in a particular application. (This is used to stop watching the document when you close its preview window.) Of course the same thing could be done with AppleScript, but that is too slow. (Another alternative would be to use the Perl-Carbon bindings that are included in 10.4, but that would not work on earlier OS versions.)
Since it's a bit of a pain to install GV, and since several widely-distributed versions have irritating bugs, I wondered about including a GV binary in the package. As an experiment, I built gv-3.5.8 as a universal binary with libXaw3d statically linked in, and it comes to about 3MB. Does anyone have an opinion on this?
Robin
On Apr 5, 2007, at 7:49 AM, Robin Houston wrote:
This new version uses PDFTeX by default, and will try to use TeXShop as the previewer. (Note that TeXShop is part of MacTeX 2007.)
Have you looked at PDFView? http://pdfview.sourceforge.net/
The bundle is available (for the moment) here:
http://www.puffinry.demon.co.uk/LaTeX%20Watch%202.0.dmg
This version should be almost ready to be incorporated into the LaTeX bundle, so please let me know about any problems.
The default behaviour can be changed by setting shell variables, as follows:
- If TM_LATEX_VIEWER=TeXniscope, it will use TeXniscope instead of
TeXShop (If you should happen to want LaTeX Watch to use a different previewer from 'Compile and View', you can set TM_LATEX_WATCH_VIEWER=TeXShop to override the TM_LATEX_VIEWER setting.)
Is this TM_LATEX_WATCH_VIEWER variable really necessary?
- If TM_LATEX_WATCH_MODE=PS, then it will compile via DVI, and use
GV to preview.
- If TM_LATEX_WATCH_DEBUG=console, additional status messages will
be printed to the console; if TM_LATEX_WATCH_DEBUG=dialog, these status messages will pop up in dialog boxes.
Is there any way we can cut down on all those environment variables? The LaTeX bundle already uses more than it should. For instance there is already a TEX_PSTRICKS (hm, we should probably change that to TM_LATEX_PSTRICKS) which tells the LaTeX&View command to switch to going through ps. Perhaps you can use that instead of the TM_LATEX_WATCH_MODE?
And for the debug options, perhaps simply have only one: enabled or disabled? And simply force them to be on the console?
Incidentally, there is a utility in Support/bin/check_open that may be more generally useful. It uses the Carbon API to check whether a particular document is open in a particular application. (This is used to stop watching the document when you close its preview window.) Of course the same thing could be done with AppleScript, but that is too slow. (Another alternative would be to use the Perl-Carbon bindings that are included in 10.4, but that would not work on earlier OS versions.)
Since it's a bit of a pain to install GV, and since several widely- distributed versions have irritating bugs, I wondered about including a GV binary in the package. As an experiment, I built gv-3.5.8 as a universal binary with libXaw3d statically linked in, and it comes to about 3MB. Does anyone have an opinion on this?
The size is considerable. Perhaps we can just add instructions for installing it on the help page, or just make the above binary available somewhere?
What is the license on gv btw?
Robin
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 4/5/07, Charilaos Skiadas skiadas@hanover.edu wrote:
Have you looked at PDFView? http://pdfview.sourceforge.net/
Not yet, I'll have a look now. Should be easy to support it. Thanks for pointing it out.
Is this TM_LATEX_WATCH_VIEWER variable really necessary?
[...]
Is there any way we can cut down on all those environment variables?
The LaTeX bundle already uses more than it should.
Since environment variables are not in limited supply, I take the point to be that configuration should be as simple as possible. Of course I agree, and it would be good to give some thought to the best way of achieving this.
I thought it might be useful to have the option of using a different previewer for watching than for 'Typeset & View', but perhaps no one would ever want to do that. At the very least, it could be an undocumented option, and we could say that the recommended way to change the viewer is to set TM_LATEX_VIEWER.
For instance there
is already a TEX_PSTRICKS (hm, we should probably change that to TM_LATEX_PSTRICKS) which tells the LaTeX&View command to switch to going through ps. Perhaps you can use that instead of the TM_LATEX_WATCH_MODE?
Because of the non-standard name, I didn't realise this was an official configuration option. If it is, I agree that the name should be changed! I don't think TM_LATEX_PSTRICKS is a very good name either, since it doesn't, fundamentally, have anything to do with PSTricks per se.
Maybe TM_LATEX_POSTSCRIPT, or TM_LATEX_MODE=PS?
Another problem with this mechanism (apart from the name) is that it's only over-rideable in one direction. If you have set TEX_PSTRICKS, then it is not currently possible to use
%!TEX TS-program = pdflatex
to over-ride that setting.
The size is considerable. Perhaps we can just add instructions for
installing it on the help page,
Installing it really is a pain, if you're not a programmer, because it depends on a non-standard X library. Unless you do it via fink or something. But then you have to install fink! Even then, fink has a buggy version of gv.
or just make the above binary available somewhere?
That might be an idea. Is there anywhere suitable for it to go?
What is the license on gv btw?
GPL.
Robin
On Apr 5, 2007, at 9:21 AM, Robin Houston wrote:
On 4/5/07, Charilaos Skiadas skiadas@hanover.edu wrote: Have you looked at PDFView? http://pdfview.sourceforge.net/
Not yet, I'll have a look now. Should be easy to support it. Thanks for pointing it out.
It's basically the viewer we are suggesting at the moment (once I update the help file that is). It has the advantages of TeXniscope along with some other ones of its own, and works on Intels much better.
Is this TM_LATEX_WATCH_VIEWER variable really necessary? [...] Is there any way we can cut down on all those environment variables? The LaTeX bundle already uses more than it should.
Since environment variables are not in limited supply, I take the point to be that configuration should be as simple as possible. Of course I agree, and it would be good to give some thought to the best way of achieving this.
Yeah the point was to make it as simple for the end users as possible.
I thought it might be useful to have the option of using a different previewer for watching than for 'Typeset & View', but perhaps no one would ever want to do that. At the very least, it could be an undocumented option, and we could say that the recommended way to change the viewer is to set TM_LATEX_VIEWER.
Yeah we could have it as an undocumented option.
For instance there is already a TEX_PSTRICKS (hm, we should probably change that to TM_LATEX_PSTRICKS) which tells the LaTeX&View command to switch to going through ps. Perhaps you can use that instead of the TM_LATEX_WATCH_MODE?
Because of the non-standard name, I didn't realise this was an official configuration option. If it is, I agree that the name should be changed!
Well it's semi-official ;) Supporting pstricks and the dvi->ps->pdf route is relatively new and hasn't settled in much. So TEX_PSTRICKS was really at that point just an internal variable defined within the LaTeX&View command, not supposed to be settable by the user really. But we should probably rethink it a fair bit.
I don't think TM_LATEX_PSTRICKS is a very good name either, since it doesn't, fundamentally, have anything to do with PSTricks per se.
Maybe TM_LATEX_POSTSCRIPT, or TM_LATEX_MODE=PS?
I wonder if it is necessary at all. Is that really different than setting the TS-program to "latex" instead of "pdflatex"?
I guess this is the question: Should the user have to specify anything else other than whether they want pdflatex or latex->dvi->ps-
pdf ? Ideally one variable should do the trick, and even that
should only be needed rarely. Question is what it is the user should be deciding on. (and by "user" here I mean the 99% of the users who just want to keep writing and not learn all about obcsure three/four- word variables starting with TM ).
Another problem with this mechanism (apart from the name) is that it's only over-rideable in one direction. If you have set TEX_PSTRICKS, then it is not currently possible to use
%!TEX TS-program = pdflatex
to over-ride that setting.
Hm, that's a bug in the way we do these things currently I would say, the %!TEX directive should probably be taking precedence. Basically the whole setting sniffing method in the Typeset&View command needs a good cleanup. It has been patched so many times that it is somewhat inefficient/buggy atm.
The size is considerable. Perhaps we can just add instructions for installing it on the help page,
Installing it really is a pain, if you're not a programmer, because it depends on a non-standard X library. Unless you do it via fink or something. But then you have to install fink! Even then, fink has a buggy version of gv.
or just make the above binary available somewhere?
That might be an idea. Is there anywhere suitable for it to go?
Yes I meant to make the binary available somewhere, and then link to it from the documentation. I was thinking of someone's webpage. I can put it on my blog somewhere, or you can host in on your homepage.
What is the license on gv btw?
GPL.
Then I am not sure we can actually include it in a bundle that ships with TM, or include it at all for that matter. Can we? (I am a bit clueless when it comes to licenses).
Robin
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 4/5/07, Charilaos Skiadas skiadas@hanover.edu wrote:
It's basically the viewer we are suggesting at the moment (once I update the help file that is). It has the advantages of TeXniscope along with some other ones of its own, and works on Intels much better.
Ah, okay. Unfortunately it doesn't work brilliantly with Watch, because its AppleEvents support really sucks, so there's no way to tell if the user has closed the document. Also, it insists on updating the PDF file whenever it's changed, and there's no way to externally signal it to update instead, so presumably it will sometimes detect the change while the PDF is half-generated, and break.
I thought it might be useful to have the option of using a
different previewer for watching than for 'Typeset & View', but perhaps no one would ever want to do that. At the very least, it could be an undocumented option, and we could say that the recommended way to change the viewer is to set TM_LATEX_VIEWER.
Yeah we could have it as an undocumented option.
I've removed it. If there turns out to be a need for it, it's trivial to put it back.
Because of the non-standard name, I didn't realise this was an
official configuration option. If it is, I agree that the name should be changed!
Well it's semi-official ;) Supporting pstricks and the dvi->ps->pdf route is relatively new and hasn't settled in much. So TEX_PSTRICKS was really at that point just an internal variable defined within the LaTeX&View command, not supposed to be settable by the user really.
That's what I'd imagined.
I wonder if it is necessary at all. Is that really different than
setting the TS-program to "latex" instead of "pdflatex"?
No, not at all. But it's nice to have a global option, so you don't have to edit every single source file when you want the same for all them. But it should be possible to override the global default in the file.
I guess this is the question: Should the user have to specify
anything else other than whether they want pdflatex or latex->dvi->ps-
pdf ? Ideally one variable should do the trick, and even that
should only be needed rarely.
I heartily agree with the sentiment that it should be as simple as possible. (And maybe one day someone will write a nice graphical interface for the configuration.)
But it's not *quite* this simple. People do use xelatex, for example. Perhaps we should just use the same names as TeXShop does (so people don't have to learn two different ways of specifying the same thing), and have a variable TS_LATEX_PROGRAM that can be (at least in principle – I guess not all the options will be supported immediately) set to the same things that you can put after TS-program =.
So, for example, TX_LATEX_PROGRAM=latex would force the DVI route unless it's over-ridden by an explicit %!TEX line in the document, etc.
What do you think of this idea?
Hm, that's a bug in the way we do these things currently I would say,
the %!TEX directive should probably be taking precedence. Basically the whole setting sniffing method in the Typeset&View command needs a good cleanup. It has been patched so many times that it is somewhat inefficient/buggy atm.
I don't mind fixing up this script to support the mechanism I suggested above, if you agree it's a good idea.
Yes I meant to make the binary available somewhere, and then link to
it from the documentation. I was thinking of someone's webpage. I can put it on my blog somewhere, or you can host in on your homepage.
I don't really have a proper homepage at the moment. Well, I have my university one, but that will go away fairly soon, and I have a small amount of webspace from my ISP (where I put the 2.0 bundle), but I don't know how long I'll keep the same ISP.
If you have room for it on your blog, perhaps that would be the best place.
GPL.
Then I am not sure we can actually include it in a bundle that ships with TM, or include it at all for that matter. Can we?
I hope so! CocoaDialog is GPL, and that's included.
I'm pretty sure it's okay. The GPL specifically excludes "mere aggregation" in its viral clause.
Robin
On 4/5/07, Robin Houston robin.houston@gmail.com wrote:
TS_LATEX_PROGRAM [...] TX_LATEX_PROGRAM=latex
Erm, those should both be TM_LATEX_PROGRAM, of course!
Robin
Dear Robin, could you explain what LaTeX Watch does over an above latexmk? If the main idea is as you describe it in your initial post to the mailing list:
The idea is that you can 'watch' a LaTeX document, so that whenever you save a change the display is updated as quickly as possible to reflect the change.
then this can already be achieved with latexmk with the -pvc switch. If the LaTeX bundle could be modified to pass arguments to latexmk (which it already partially supports) then none of this code is necessary. Just a thought. Best, Mark
On 4/5/07, Mark Eli Kalderon eli@markelikalderon.com wrote:
Dear Robin, could you explain what LaTeX Watch does over an above latexmk? If the main idea is as you describe it in your initial post to the mailing list:
The idea is that you can 'watch' a LaTeX document, so that whenever you save a change the display is updated as quickly as possible to reflect the change.
then this can already be achieved with latexmk with the -pvc switch.
Dear Mark,
In a general sense, there is a difference of emphasis. The primary function of latexmk is to be as thorough as possible, compiling the document as many times as necessary to resolve cross-references. Conversely, the primary function of Watch is to be as *fast* as possible, so for example it compiles the document only once.
On a more technical level, Watch compiles a custom format file for the watched document, so that packages etc. do not have to be reloaded on each subsequent recompile. This makes it faster at reflecting changes.
It also has various Mac- and TextMate-specific features. For example, if the preview document is closed, or if you quit TextMate, then the watch script will stop running.
Of course there is some overlap with latexmk. I'm sure that each could learn some useful tricks from the other. (Some future version of Watch will probably do some automatic recompilation when references need to be resolved, though it will do it *after* displaying the updated file.)
Robin
On Apr 5, 2007, at 10:13 AM, Robin Houston wrote:
On 4/5/07, Robin Houston robin.houston@gmail.com wrote:
TS_LATEX_PROGRAM [...] TX_LATEX_PROGRAM=latex
Erm, those should both be TM_LATEX_PROGRAM, of course!
I think we already have TM_LATEX_COMPILER that should be doing exactly this, I think. Though perhaps I'm wrong, right now there's too many words flying around ;)
Anyway not time to think more about it now, unfortunately I have a lot of "real" work to do atm (end of semester coming up).
Robin
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 4/5/07, Charilaos Skiadas skiadas@hanover.edu wrote:
I think we already have TM_LATEX_COMPILER that should be doing exactly this, I think. Though perhaps I'm wrong, right now there's too many words flying around ;)
It's not the same thing, unfortunately. TM_LATEX_COMPILER is literally the program that's invoked to do the compilation. For example, you can set it to the full path to your latex executable, or you can set it to latexmk, and so on. This currently over-rides *all* other configuration. It isn't great, but that's how it is.
Attached is a patch to the Typeset & View command which makes it use TM_LATEX_PROGRAM as I suggested, and here:
http://www.puffinry.demon.co.uk/LaTeX%20Watch%202.1.dmg
is Watch 2.1, which adds support for PDFView, and uses the variables TM_LATEX_PROGRAM and TM_LATEX_VIEWER to decide how to behave.
Robin
First of all, LaTeX Watch is brilliant! so please keep on working on it. BTW, the trick of precompiling and dumping the format should be made standard in all tex apps, it's simply to good an idea.
Would you mind writing down here a concise list of all the shell variables relevant to L.Watch, and their meaning? I'm a bit confused
Thanks, Piero
On 4/10/07, Piero D'Ancona pierodancona@gmail.com wrote:
First of all, LaTeX Watch is brilliant! so please keep on working on it. BTW, the trick of precompiling and dumping the format should be made standard in all tex apps, it's simply to good an idea.
Thanks for the encouragement!
Would you mind writing down here a concise list
of all the shell variables relevant to L.Watch, and their meaning? I'm a bit confused
I don't blame you. I'm a bit confused as well. :-)
This is still rather in flux, and it would be nice to have it controlled by the same variables that control the 'Typeset & View' command. I've been mulling this over, and I have come up with what seems to me to be a reasonable scheme. I'll post about it tomorrow, and see if I can persuade Haris to accept a patch to Typeset & View that rationalises its configuration.
To answer your question, if you have version 2.1 (http://www.puffinry.demon.co.uk/LaTeX%20Watch%202.1.dmg) then the variables it recognises are:
TM_LATEX_PROGRAM: If this is set to 'latex', then a DVI compilation is used, rather than going directly to PDF. The default is assumed to be 'pdflatex'.
In future, I expect that other options will be supported, such as xelatex.
TM_LATEX_VIEWER: Currently only affects the default, pdflatex, mode. Supported values are 'TeXShop' (the default), 'TeXniscope' and 'PDFView'.
In 'latex' mode, it will currently always try to use gv.
TM_LATEX_WATCH_DEBUG: Set to 'console' to print debugging messages to the console, or to 'dialog' to pop them up in a dialog box.
Quite a short list really! I hope it's useful. Any questions, let me know.
Robin
Le 11 avr. 07 à 00:04, Robin Houston a écrit :
I would like to try Latex Watch but
1) i work only with pdflatex sometimes with TexNiscope, sometimes with Acrobat and sometimes PDFView
actually : TM_LATEX_VIEWER
1) When i use LaTeX Watch with this little code
% utf8 % am \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \begin{document} un essai \end{document}
I have an error :Latex Watch Error : Failed to process preamble
And then i have a error when i want to watch the .log
2) Why Gv and not Acrobat ? ( i suppose because it's impossible to refresh with Acrobat but it's not very important because for me Acrobat it's the "reference" and close a window is not a big problem.
Greetings Alain Matthes
ps : dvi --> ps --> pdf in not the better way to obtain a pdf !
On 4/11/07, Alain Matthes alain.matthes@mac.com wrote:
- i work only with pdflatex sometimes with TexNiscope, sometimes
with Acrobat and sometimes PDFView
That's fine. The current version uses pdflatex by default, and you can use TeXniscope or PDFView as the viewer.
Acrobat is not so useful, because it can neither auto-update nor be signalled to update. Similarly Preview.
actually : TM_LATEX_VIEWER
- When i use LaTeX Watch with this little code
I have an error :Latex Watch Error : Failed to process preamble
That's interesting. I don't get an error when I try it. If you look at the log file directly, what do you see? (The log file is named .essai.log, assuming your file is named essai.tex. Note the dot at the beginning.)
And then i have a error when i want to watch the .log
Ah! I bet that's because you don't have "mate" in your PATH. Thanks for the report: I'll add its default location to the script.
2) Why Gv and not Acrobat ?
There seems to be some confusion here. Gv is only used in PS mode, it's not used in the default pdflatex mode. As to why not Acrobat, I explained that above.
ps : dvi --> ps --> pdf in not the better way to obtain a pdf !
Of course not, not generally. But if you have PostScript specials in the DVI, then it's the only way to produce a correct PDF.
Robin
On 4/11/07, Allan Odgaard throw-away-1@macromates.com wrote:
FYI it can be found (from within TM) as "$TM_SUPPORT_PATH/bin/mate".
Hmm yes, and the script *already* adds "$TM_SUPPORT_PATH/bin" to the PATH. So that can't be Alain's problem after all.
Thanks, Robin
hello:)
(sorry for my poor english language)
I work with Mate in the Terminal because TM is "my application" for all the text and tex files... and i have install it with Terminal Usage.... item
Perhaps it's my fault and i made a mistake with the install of Latex Watch
Can you repeat the installation procedure ? actually i click on the bundle and perhaps it's not enough... ???
argh.................
ok i found my mistake , i work out of a project ..grrrrr...sorry
I don't want to create a troll but i made a lot of works with pgf/tikz because i want to avoid pstricks and "special macro". I think that the dvi files are not useful now with pdftex. If it's really necessary to use pstricks then i use pst-pdf and the script ps4pdf.sh .
If you want to look at my work (without pstricks, dvi etc...)
http://www.altermundus.fr/pages/math/graphtheory.html http://www.altermundus.fr/pages/math/ulam.html http://www.altermundus.fr/pages/pdflatex/tikz.html http://www.altermundus.fr/pages/pdflatex/tab.html http://www.altermundus.fr/pages/pdflatex/plot2d.html
Alain
I'm glad it's working now, and your PGF/TikZ illustrations are beautiful!
Perhaps I should remark that I'm not _advocating_ the use of PostScript specials. It's simply that I have mundane reasons for using them, currently. The first version of Watch was written for my own use, so I made it work with the documents that I'm writing. Since then, I've tried to make it more generally useful, hence PDF being the default mode in the current version.
I look forward to the day when I never need to use another PostScript special, and I can do everything with PDFLaTeX.
Robin
Le 11 avr. 07 à 14:11, Robin Houston a écrit :
I'm glad it's working now, and your PGF/TikZ illustrations are beautiful!
Perhaps I should remark that I'm not _advocating_ the use of PostScript specials. It's simply that I have mundane reasons for using them, currently. The first version of Watch was written for my own use, so I made it work with the documents that I'm writing. Since then, I've tried to make it more generally useful, hence PDF being the default mode in the current version.
I look forward to the day when I never need to use another PostScript special, and I can do everything with PDFLaTeX.
Robin
Thanks for your script!
If you want, you can send to me some files (.tex and .pdf) of your work and I try to see if I can make a package with tikz for you. I know diagrams package and I think with tikz, we can make something more simple with only pdflatex.
I know xy and i work with it the first time but how it's possible to work with the xy syntax ??? ( very strange but I liked this package !)
Alain