Generalgraphics trouble

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
newlou
Posts: 7
Joined: Tue Feb 19, 2008 10:49 pm

graphics trouble

Post by newlou »

Hi,
I'm struggling along with my 1st LaTex document. I'm trying to insert two figures on one page. The following seems to work quite nicely:

\begin{figure}[h]
\centering
\includegraphics[scale=0.75]{c:/ma50176/graph1.jpg}
\includegraphics[scale=0.75]{c:/ma50176/graph2.jpg}
\label{fig3}
\end{figure}

However, as soon as I try to insert a caption, it sends the figures (with caption) to the back of my document (instead of where they should be). There is plenty of room after the figures as they are the only things on the page in question. I have tried using the subfigure environment, but that has the same effect.
Any ideas on why this happens and what I can do?

Many thanks,

Lisa

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

graphics trouble

Post by localghost »

Modify the list of parameters for placing the floating object.

Code: Select all

Code, edit and compile here:
\begin{figure}[!ht]
\centering
\includegraphics[scale=0.75]{c:/ma50176/graph1.jpg}
\includegraphics[scale=0.75]{c:/ma50176/graph2.jpg}
\caption{Two pictures\label{fig:two-pics}
\end{figure}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
One parameter alone makes no sense because the compiler will overwrite it (mostly with [ht]). The exclamation mark sets internal LaTeX parameters for float placement to minimal values. If that doesn't help, insert a \clearpage (or \cleardoublepage) command right after the float environment.

Typesetting two figures side by side (with own caption) is well supported by the subfig (and the floatrow) package . Your code then looks a little bit different.

Code: Select all

Code, edit and compile here:
\begin{figure}[!ht]
\centering
\subfloat[First Picture\label{subfig-1:two-pics}]{
\includegraphics[scale=0.75]{c:/ma50176/graph1}
}
\hspace{5mm}
\subfloat[Second Picture\label{subfig-1:two-pics}]{
\includegraphics[scale=0.75]{c:/ma50176/graph2}
}
\caption{Two Pictures\label{fig:two-pics}
\end{figure}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The documentations describe everything in detail.


Best regards
Thorsten¹
Last edited by localghost on Mon Mar 03, 2008 12:42 am, edited 1 time in total.
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
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

graphics trouble

Post by gmedina »

If the above suggestion by localghost still does not place the figures where you want them to be, you can use the \floatplacement command provided by the float package.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply