[OS X TeX] including a graphics file

Murray Eisenberg murrayeisenberg at gmail.com
Sat Jun 19 15:12:42 EDT 2021


> On 19 Jun2021, at 12:30 PM, Nitecki, Zbigniew H. <Zbigniew.Nitecki at tufts.edu> wrote:
> 
>  Again the TeXShop editor menu has two macros for figures: regular or eps.  The settings I mentioned in my previous email were the eps settings (including all the 
> weird stuff like \bf inside the caption) which I had used because when I used the regular setting (which I usually do) the typesetting crashed.  With the eps settings, the 
> system simply says it doesn’t recognize the \epsfile command, and skips the whole picture.
> The changes suggested by both of you take me back to the “regular” settings.

Instead of the TeXShop macros for figures, you may wish to use the Templates button on the source window and select Graphics Template, which will immediately paste the following into your source window at the current cursor position:

    \begin{figure}[htbp] %  figure placement: here, top, bottom, or page
       \centering
       \includegraphics[width=2in]{example.jpg} 
       \caption{example caption}
       \label{fig:example}
    \end{figure}

For at least .png, .jpg, .pdf, and .eps, the type of graphics file will be detected automatically without including the corresponding file extension.

However, .ps will not work at all like that, with or without the extension, assuming you’re using the default TeXShop typesetting engine pdflatex (TeXShop > Preferences > Typesetting > Default Script : Pdftex). 

If you insist on using .ps files rather than .eps or .pdf, etc., then you’d want the Deafult Script to be Tex +DVI instead. But — catch! — if you then try to use a .pdf with \includegraphics, then you will get a "LaTeX Error: Cannot determine size of graphic in xxx.pdf (no BoundingBox).”

Since Mathematica can export to .eps (but _not_ to .ps), my advice is to stick with .eps or, even better yet, .pdf graphics files for figures. One advantage is that just about any previewer will open a .pdf (and on Mac, in fact, a .eps or .ps will automatically be converted to a corresponding .pdf if you use Preview.app to open it).

---
Murray Eisenberg			murrayeisenberg at gmail.com
503 King Farm Blvd #101	
Rockville, MD 20850-6667	Mobile (413)-427-5334


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20210619/b95ac57a/attachment.htm>


More information about the MacOSX-TeX mailing list