views:

903

answers:

3

My LaTeX puts each picture in my document to an empty page, no matter what is the size of the picture such that only the caption is in the page where is the picture.

Example of code

\begin{table}[h!]
    \begin{landscape}
        \begin{figure}
            \caption{ERD}
            \includegraphics[width=25cm]{/Users/cs/hy/usecases.png}                      

        \end{figure}                                      
    \end{landscape}
    --- text ---
\end{table}

The table commands make the content disppear completely although I use graphicx package.

The code requires two pages without the table command.

I would like to have the small picture and the text to be in the same A4.

How can you a picture and some text in the same A4?

+2  A: 

I'm not sure it's possible to place a figure environment inside a table environment - that'd explain your first issue. They're both constructs that LaTeX attempts to move around a bit so that they fit nicely onto the page, so it doesn't make a lot of sense to put one inside the other. Hopefully you can work around the need for that.

As for the page-splitting, you're using the landscape environment, which means "all pages within this section should be created landscape-orientation." This forces it to start on a new page, to switch orientations, and start a new page after it ends, to switch back.

If your intent is just to rotate the picture, you should use

\includegraphics[rotate=90,<other-options>]{<file>}

If you really want a landscape orientation page (or several), place the landscape environment around the entire section you want in landscape orientation.

Jefromi
+2  A: 
some text
\begin{figure}[h]
  \centering
  \includegraphics{images/something.png}
  \caption{Explanation of something}
\end{figure}
some text

Works nicely for me, though I don't use 'landscape' as page format (but then, you didn't say you needed it). But if you do and you want the text to appear on the same page as the image, you need to have the text inside the landscape environment as well.

Gerald Senarclens de Grancy
Thank you for your answer! - My problem was that I did not know that you can have text in figure and landscape environment. I had the thought that you can only have caption and such there. - Thank you for your answer!
Masi
Please, note that you cannot have many includegraphics -commands. Otherwise, you will be in trouble like I was at http://stackoverflow.com/questions/1209840/to-have-wildcard-for-latex
Masi
Interesting, thanks for the info. I've had a look at 'To have wildcard * for LaTeX' and didn't exactly understand the connection. Anyway, so far it worked fine for me (though I just checked and never used more than 21 pictures w/ includegraphics in a single document).
Gerald Senarclens de Grancy
A: 

Why would you want to put a figure environment within a table environment? It's not clear to me if you're trying to make a floating body contain a figure and some extensive text, or if you're just trying to keep a figure near its text. Here's something that might be what you want:

\documentclass{article}
\usepackage{pdflscape,lipsum,geometry}
\begin{document}
\begin{landscape}
\begin{figure}
\caption{ERD}
\rule{6cm}{6cm}\par
\lipsum[1]
\end{figure}                                      
\end{landscape}
\end{document}
Will Robertson