[OS X TeX] Include pdf figure in latex
Gray, Gary L.
euler at psu.edu
Thu Jan 9 15:26:50 EST 2025
Hi David,
I have written three editions of two different textbooks using LaTeX on the Mac with Adobe Illustrator. There are hundreds of figures in each book, all created with Illustrtor, so I have some experience.
To easily crop PDF figures created in Illustrator, do the following.
(1) Open the file in Illustrator and select everything. I do a Select All using command-A.
(2) Go to Object > Artboards and select Fit to Artwork Bounds. This will crop the page to perfectly contain your figure. Save and you are good to go.
You can add keyboard shortcuts to Illustator under Edit > Keyboard Shortcuts... -- I have mapped shift-command-C to the Fit to Artwork Bounds menu command.
I hope this helps.
Gary
On Jan 9, 2025, at 00:11, Salomon, David <david.salomon at csun.edu> wrote:
I am trying to include a figure in pdf in a LaTeX document compiled by pdftex. The figure file "GRspiral.pdf" was generated in adobe Illustrator on the Mac.
The attachment to this email includes the following:
1. Texshop settings, which shows that I am using pdftex to compile.
2. Texshop input, with the bare LaTeX code.
3. Texshop console, which indicates no errors.
4. The resulting pdf view, which shows the output, including the figure which is small and non-centered.
The figure, file "GRSpiral.pdf", is 4in wide (see the thick rule above the caption) by 3in high, and should be centered. The square, circle, hexagon, etc. inside are perfect geometric figures, but the result (see attached pdf output) is small. It should fill up the 3-inch vertical space between the thick rules.
When I recompile this code, adding '', height=3in'' to '' includegraphics'', the figure is still small, still not centered, and in addition it is squashed vertically.
Notice that \begin{figure} has the options [!htpb], but other combinations of these options produce the same wrong figure.
I have an iMac 2020 running OS 15.2 Sequoia. I use TeXlive 2024 and Texshop to compile in pdftex. The figure "GRSpiral.pdf" was prepared in Adobe Illustrator and saved by it in pdf.
My LaTeX code works fine on a jpg file of a photograph, but when I open this jpg photo in Illustrator, save it as pdf, and run it in Texshop, I get the same problem. When I generate a new figure in Illustrator and save it in jpg or png, Texshop generates it at the right size, but any text inside it is blurred.
I have recently added usepackage{pdfpages}, but this made no difference. I tried the terminal command "pdflatex testLatex.tex" which produced the same wrong results.
I have hundreds of those pdf files to be included in a book, so I'd rather not convert them to eps.
Any help is greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20250109/0235a425/attachment.htm>
More information about the MacOSX-TeX
mailing list