Graphics, Figures & Tables2 issues about figures and page layout

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
F!o
Posts: 4
Joined: Sat Apr 25, 2009 2:19 pm

2 issues about figures and page layout

Post by F!o »

Hi everyone,

1) Here is my first issue : click me!

Why is there so much space above the figure?

I simply use :

Code: Select all

%TEXT

\begin{figure}[htbp]
   \begin{center}
      \includegraphics[width=12cm]{Pics/Stress.jpg}
   \end{center}
   \caption{\footnotesize Organigramme du stress}
\end{figure}

%TEXT
I made another document a couple years ago in which the figures I inserted were right where I wanted them to be, without this useless space. And that's what I want again. Here! (I used \includegraphics too).

Where does the problem come from? The main file?

2) I want to create a document with chapters with X text pages followed by Y image pages (I want to insert only figures on several pages at the end of each chapter). How can I do that?

Thanks for your answers. :)

NB : Sorry if I made some mistakes, I'm French.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Lucia
Posts: 36
Joined: Wed Dec 31, 2008 9:03 pm

2 issues about figures and page layout

Post by Lucia »

Hi F!o.

For your first issue, try this:

Code: Select all

%TEXT

\begin{figure}[htbp]
   \centering
      \includegraphics[width=12cm]{Pics/Stress.jpg}
   \caption{\footnotesize Organigramme du stress}
\end{figure}

%TEXT
Here's the explanation: Center and centering

For the second issue, perhaps the endfloat package might be useful.

Hope this helps.
Lucia
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

2 issues about figures and page layout

Post by localghost »

Though the suggestion of Lucia is very good, the center environment is not the cause for the big white spaces. The more likely reason is that the size of your image is bigger than you think. You can check that size very easy.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage[font=footnotesize,labelfont={bf,sc}]{caption}

\begin{document}
\begin{figure}[!ht]
  \centering
  \fbox{%
  \includegraphics[width=12cm]{Pics/Stress.jpg}
  }
  \caption{Organigramme du stress}\label{fig:orgstress}
\end{figure}
The framed box will show you the real size of your image. I guess you will have to cut it.


Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
F!o
Posts: 4
Joined: Sat Apr 25, 2009 2:19 pm

2 issues about figures and page layout

Post by F!o »

Thanks to both of you.

I think you made me understand the real issue.

The space you see is not part of the picture I use, but thanks to your tip, I could see the borders of the figure which actually was a perfect square. As the original file is 377x233, a free square space is saved to paste the picture, therefore there is a space above the picture. (I think it's not clear at all so click here to see a screenshot :mrgreen: . I selected the picture to see its real dimensions).

All the pictures in the document I told you about were not square and were perfectly included so I'm gonna try to find out the difference in the code which causes that.

Thanks if you have the answer before me. :D
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

2 issues about figures and page layout

Post by localghost »

F!o wrote:[...] All the pictures in the document I told you about were not square and were perfectly included so I'm gonna try to find out the difference in the code which causes that. [...]
The space is definitely part of the picture. Hence it is not the source which has to be modified. You have to cut the image file to size. But as an alternative you can search the graphicx manual for the clip or viewport option.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
F!o
Posts: 4
Joined: Sat Apr 25, 2009 2:19 pm

2 issues about figures and page layout

Post by F!o »

I don't understand why you think this?

The picture I use is here. As you can see, there is no space. :/

I checked each files there is no difference between the lines where I use \includegraphics but there is a few more lines in the main file of the new document :

Code: Select all

\usepackage{amssymb}
\usepackage[usenames]{color}
\usepackage{lscape}
\usepackage[hypertex, colorlinks, linkcolor=black, pagebackref, dvipdfm]{hyperref}
but they don't have anything to do with this issue.

I deleted this lines and compiled. Nothing different.

Why does one document display all the pictures correctly and the other not, whereas the code is the same!?
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

2 issues about figures and page layout

Post by phi »

Please post an MWE. As you can see from the following code, the space is not caused by a plain \includegraphics:

Code: Select all

\documentclass{minimal}
\usepackage{graphicx}
\begin{document}
\fbox{\includegraphics[width=12cm]{stress.jpg}}
\end{document}
You might also consider using a vector graphics program or package to improve the quality of the picture.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

2 issues about figures and page layout

Post by localghost »

F!o wrote:I don't understand why you think this? [...]
The reason is very simple. The framed box was only put around the included image and the output has shown that the box also contains a lot of white space. The only logical conclusion was that the image has to be cut. With the JPG file you provided it work fines for me. So, build a minimal working example (MWE) as phi already requested. This MWE must exactly reproduce the behaviour you described.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply