Graphics, Figures & Tablestoo much white space

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Rob_K
Posts: 4
Joined: Tue Jan 21, 2014 6:17 pm

too much white space

Post by Rob_K »

Hi guys,

Having a problem I have not seen before, I have converted my image to .eps file, but for some unknown reason, it is adding the image size amount of white space above it. This as you can imagine is never welcome. Any ideas what has happened, I've been using latex for some 2 years now and never had this problem before.

I have just tried to take a screen shot of the image and try again in case of strange embedded data, and I only get half of the image, so I reduced it to half the size and now I get all the white space above, is there a way to solve this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Rob_K
Posts: 4
Joined: Tue Jan 21, 2014 6:17 pm

Re: too much white space

Post by Rob_K »

Just realized, I should have mentioned that I am using TeXshop for mac, and I am now using OSX Mavericks.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

too much white space

Post by cgnieder »

Hi Rob_K,

As far as I know LaTeX uses the bounding box information that the EPS includes for determining the size if the picture. I can imagine two cases: either the bounding box information in the EPS is corrupted/wrong or the picture actually has the white space and LaTeX simply displays it. Without having the actual file this is hard to say.

(Another possibility I can think of would be a completely different matter: you're putting the picture in the {figure} environment and LaTeX places it on a float page... but your description doesn't sound like that's what you're doing...)

Regards
site moderator & package author
Rob_K
Posts: 4
Joined: Tue Jan 21, 2014 6:17 pm

too much white space

Post by Rob_K »

Ah, yes, I think I am using figure, I am using the following code:

Code: Select all

\begin{figure}[htb]
	\centering
	\includegraphics[width=0.8\textwidth]{test_circuit2.eps}
	\caption{Op amp circuit}
	\label{fig:Amigobot}
\end{figure}
It is the only way I know to put in images, as they have always worked in the past. But today not so lucky.

at worst case scenario, I will put this on a page of it's own, but it has to be at the top, I can't have it like this, this is for a job application.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

too much white space

Post by cgnieder »

The picture is included and set with \includegraphics. The {figure} environment is for a) letting it float around to be placed where the algorithm thinks it's best and b) providing a caption.

You can check if it is the picture itself that has the whitespace with something like this:

Code: Select all

\fbox{\includegraphics{<filename>}}
This will show you the actual picture dimensions.

Regards
site moderator & package author
Rob_K
Posts: 4
Joined: Tue Jan 21, 2014 6:17 pm

Re: too much white space

Post by Rob_K »

Interesting, my intuition tells me that there is something going on with the eps file handling in OSX Mavericks that they haven't spotted yet, as I never had this before I upgraded. my first attempt at this image left me with only the left hand side of it, so I reduced the size in photoshop and saved it again and that gave me the whole picture but all the while space above it, I am guessing that it is all based around aligning the bottom left corner of the image with a frame of sorts, but it's a little off.

I did solve this issue to an extent, I didn't realize you could use a png file, I just changed it to that and picture went where I wanted it. I still had to use word on this occasion, though as I didn't have time to learn a new document type, and having chapter 1 in big letters in a thing of just one page doesn't look good. Thank you though, I am going to look into this further, I don't want to be caught out like this again.
Suzie
Posts: 1
Joined: Mon Mar 03, 2014 12:10 pm

Re: too much white space

Post by Suzie »

I am having the same issue.

I noticed that when using the prompt to directly convert images, it was okay converting from .eps to .pdf but when converting from .eps to .ps this white space above the image would show up. Also a mac user and using Mavericks. I have not had this issue before.

Any ideas how to solve this issue?
Post Reply