Graphics, Figures & Tables ⇒ Trim margin of an EPS image
Trim margin of an EPS image
It seems like it works because the figure has been "magnified" comparing to the untrimmed version. However the margins still exist. i've tried some really big numbers for the trim option, just to make sure that it was not because i did not crop enough white space. The result shows the picture has been really crippled, but still the margins were there. So i know it was not the problem with the trim numbers.
Is it because i got to set width and length separately, and latex tried to maintain the picture ratio so
that some extra space was added?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Trim margin of an EPS image
Code: Select all
\includegraphics[bb=<llx> <lly> <urx> <ury>]{file}
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 351
- Joined: Sat Aug 02, 2008 8:47 am
Trim margin of an EPS image
sycats wrote:i've been trying to use the trim option of \includegraphics to get rid of the white margin around some eps figures. The figures were generated using the generic postscript printer. i've opened them using gsview and found no problems.
It seems like it works because the figure has been "magnified" comparing to the untrimmed version. However the margins still exist. i've tried some really big numbers for the trim option, just to make sure that it was not because i did not crop enough white space. The result shows the picture has been really crippled, but still the margins were there. So i know it was not the problem with the trim numbers.
Is it because i got to set width and length separately, and latex tried to maintain the picture ratio so
that some extra space was added?
Code: Select all
\includegraphics[trim=x0 y0 x1 y1,clip]{image}
Re: Trim margin of an EPS image
Now i realized it might be the problem with beamer. I tried the same includegraphics in regular report style, it works perfectly. However in beamer when i wanted to include the figure within a slide, that's when the problem occurs. i've increased the dlx dly parameters to the point that the content i wanted to keep had been crippled, and yet the margin remained. It looks like part of the figure is covered by a white sheet.
Somehow i feel maybe it's because beamer and graphicx don't cooperate very well?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Trim margin of an EPS image
What makes assume that? Perhaps it's better to show the difficulties by means of a minimal example [1]. In the past I had no problems.sycats wrote:[…] Somehow i feel maybe it's because beamer and graphicx don't cooperate very well?
[1] View topic: Avoidable mistakes
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Trim margin of an EPS image
Once again thank you localghost. Here is part of the code:localghost wrote:What makes assume that? Perhaps it's better to show the difficulties by means of a minimal example [1]. In the past I had no problems.sycats wrote:[…] Somehow i feel maybe it's because beamer and graphicx don't cooperate very well?
\documentclass[pdf, colorBG, slideColor, frames]{prosper}
\usepackage{graphicx}
...
\begin{slide}{Example}
\tiny
\begin{center}
\includegraphics[height = 0.7\textheight, trim = 30 100 30 280, clip, angle = 270]{timer}
\end{center}
\end{slide}
It's a simple straightforward code which shouldn't have any problem. Again I tried the \includegraphics line in a regular report template, and it works fine, no extra white margin. It is just when I deployed the same line to the prosper environment that I was experiencing this problem. Like I said, it's like covering the figure with a white sheet: i got the part cut out, however it leaves a big white space. And I noticed the bigger the crop, the bigger the white space, which extends to cover the header portion of the slide.
Trim margin of an EPS image
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Trim margin of an EPS image
Regarding the problem let me mention that the prosper class is obsolete [1]. It's obvious to replace it with powerdot. The next step then will be that you provide enough useful information that enables us to comprehend the problem clearly.
[1] View topic: Obsolete packages and document classes — Avoid usage!
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10