Thank you Bennett, Stephen, Maria, and Tomoharu. I've made TeXShop my default pdf previewer in the finder. A step up from Preview.

Bruce

On Jun 2, 2006, at 9:56 PM, Bennett Helm wrote:

On Jun 2, 2006, at 5:44 PM, Stephen Buonopane wrote:

Does TeXShop make a better previewer than the default (Preview) for LyX/Mac? To change the viewer to TeXShop in LyX/Mac 1.4.1, I put -a texshop in the viewer space after doing Preferences > File formats > PDF (pdflatex). But viewing a LyX file then gave an error. Does texshop have to be by itself in the Applications folder? downloading mactex left TeXShop in a folder called TeX in the Applications folder, and not having sufficient authority I can't move it.

I use TexShop as my pdf viewer for LyX. It is the only OS X viewer that I know of that will update automatically when the pdf file changes. This way you can leave the pdf open in TexShop and use View->Update in LyX.

I installed TexXhop directly, so it is in the top level of my Applications folder. But you can put the full path name in the LyX preferences. Not sure where it looks by default. I have open -a 'TeXShop' Maybe you need the single quotes? Did you try a Reconfigure...Quit...Relaunch?

As others have noted, open -a TeXShop.app is what's needed. Another option, though, is to define TeXShop as the default pdf viewer in the Finder. (Select a .pdf file, select File > Get Info, select TeXShop in the "Open With" drop down menu, and click on the "Change all..." button.) Then you can leave LyX's viewer for .pdf files simply as "open", and everything will work.

Again, as others have noted, the major benefit of using TeXShop is that it will automatically update the screen when the .pdf file changes. That's true whether you choose View > Update > PDF (pdflatex) or simply View > PDF (pdflatex). (Reconfigure, relaunch are not necessary here.)

In fact, it's possible to trick LyX into running LaTeX in the background, so that you can continue working on your document while it is typesetting. (That's useful on long documents like the book I'm currently working on, which is > 100,000 words and which takes a minute or so for each pdflatex run.) How do you do this?

1. In LyX > Preferences > File formats, define a new file format as follows: Format = latex2, GUI name = PDFLaTeX (update), Extension = tex, Viewer = pdflatex.

2. In LyX > Preferences > Converters, define a new converter from LaTeX to PDFLaTeX (update), with Converter = touch $$i and Extra flag = latex.

Now when you select View > PDFLaTeX (Update), LyX will generate a new .tex file and run pdflatex once on it. Once the .pdf file is generated, TeXShop will update its screen.

Two things to note about this (which may make it confusing to those not familiar with LaTeX). First, if you are not currently viewing the .pdf file in TeXShop, that file will not be opened and so nothing will appear to happen (though in fact the .pdf file will be generated in your tmp directory). Second, pdflatex is only run once here, and bibtex and makeindex are not run at all. So if you add a new cross reference, it may take 2 pdflatex runs to generate the proper reference, and if you add a new citation, this trick will fail to generate the output properly. (For that, run the standard View > PDF (pdflatex).)

Bennett

Reply via email to