Graphics, Figures & Tablespdflatex, lscape, and pdflscape

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Samonios
Posts: 5
Joined: Fri Feb 18, 2011 10:15 am

pdflatex, lscape, and pdflscape

Post by Samonios »

Hi,
TexLive 2009, when compiling with pdflatex, is supposed to search automatically for .png extensions without the need of providing them in the tex file. I read that somewhere, is it right? Well, when I do, it tries to open the .eps ones...So I need to provide all extensions for it to work.

lscape (compiling with latex) turns the whole document in landscape when using the \landscape environment (even if it is within a figure). pdflscape (compiling with pdflatex), doesn't do anything.
document.tex:

Code: Select all

\begin{figure}
 \centering
 \input{figure1}
 \caption{this is the figure}
 \label{fig:the_figure}
\end{figure}
figure1.tex:

Code: Select all

\begin{landscape}
...
\end{landscape}
Any clue?

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

pdflatex, lscape, and pdflscape

Post by frabjous »

To use .png files directly you need to compile with pdflatex. However, the right syntax is not \include{filename} but \includegraphics{filename} (and you will need to have the graphics or graphicx package loaded). See its manual. (\include is for inserting other .tex files, e.g., for chapters or suchlike).

You shouldn't need to include the file extension explicitly, though it also shouldn't hurt to do so.

If you continue to have problems, please post a complete minimal working example as suggested in the Board Rules, and the Post on Avoidable Mistakes.
Samonios
Posts: 5
Joined: Fri Feb 18, 2011 10:15 am

pdflatex, lscape, and pdflscape

Post by Samonios »

Sorry for the obvious noob error in posting ^^

The pdflatex not finding png files is fixed (probably some updates in the meantime...).

I still have the landscape environment problem.
Using pdflatex, using the following image:
http://en.wikibooks.org/wiki/File:Chick1.png
here is the mwe:

Code: Select all

\documentclass{report}
\usepackage[a4paper]{geometry}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{changepage,setspace}
\usepackage{pdflscape,graphicx,booktabs,float,caption, subfigure}
\captionsetup{font=footnotesize,labelfont=bf,singlelinecheck=false}
\captionsetup[table]{position=above,skip=0pt}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{figure}
\begin{landscape}
Some text in landscape.
\includegraphics[scale=0.5]{Chick1}
\end{landscape}
\end{figure}
Some text not in landscape.
\end{document}
Using latex, and the following image:
http://www.bittbox.com/wp-content/uploa ... ht.eps.zip
Here is the mwe:

Code: Select all

documentclass{report}
\usepackage[a4paper]{geometry}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{changepage,setspace}
\usepackage{lscape,graphicx,booktabs,float,caption, subfigure}
\captionsetup{font=footnotesize,labelfont=bf,singlelinecheck=false}
\captionsetup[table]{position=above,skip=0pt}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{figure}
\begin{landscape}
Some text in landscape.
\includegraphics[scale=0.5]{logo}
\end{landscape}
\end{figure}
Some text not in landscape.
\end{document}
There is two cases:
either I don't specify the use of lscape (should be automatic since included in graphicx, but I noticed it is not loaded) and the landscape environement is not loaded
either I specify it (as in the mwe), and the whole page is in landscape, which is not what I want.

Thanks
Post Reply