Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

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}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top