Graphics, Figures & TablesTwo Sub-floats on top of each other

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
breanainneire
Posts: 1
Joined: Thu Aug 18, 2011 6:40 am

Two Sub-floats on top of each other

Post by breanainneire »

Hello. I'm quite new to LaTeX, and having been using the LyX 2.0 interface (on Windows). I've encountered a problem using subfloats for pictures that I have not been able to find and answer to on the internet. I am not sure if my problem is something to do with LaTeX in general, or LyX itself, though I'm leaning to the former.

My problem is: when I try to put two figures into one subfloat, they go automatically side-by-side, no matter what I do, but I want one to be on top of the other. If I do the same thing in just a float, I can easily put the two figures on top of each other. I really need to do the figure-stacking in a subfloat.

See the attached pdf to see what I mean.

I have tried exporting the .lyx file to a .tex file and reading it with TeXworks, but the same thing happens.

Any help about what to do, or how to work around the problem will be greatly appreciated.
Attachments
subfloat_problem.pdf
(89.1 KiB) Downloaded 829 times

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

rojo_ornithopter
Posts: 1
Joined: Mon Oct 24, 2011 2:57 am

Re: Two Sub-floats on top of each other

Post by rojo_ornithopter »

Hello,

Maybe you've figured this out by now. But I believe this will do what you need it to based on the .pdf file attached.

\begin{figure}
\begin{minipage}{\columnwidth}
\includegraphics[width=3.0in]{name1.png}
\end{minipage}
\begin{minipage}{\columnwidth}
\includegraphics[width=3.0in]{name2.png}
\end{minipage}
\caption{...}
\label{two figures stacked}
\end{figure}


I think the key is: \begin{minipage}{\columnwidth}

the columnwidth command is what does the stacking, I believe.
Of course you can change the widths of leave them out.

Good luck!
Post Reply