Document ClassesBeamer: Included Figure Randomly Rotates Page to Portrait

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
krinkov
Posts: 2
Joined: Wed May 18, 2011 6:09 pm

Beamer: Included Figure Randomly Rotates Page to Portrait

Post by krinkov »

I am creating a presentation in Beamer on a Mac using Mactex and Texshop. Both are up to date.

I am attempting to include a figure generated in another program. Sometimes, beamer randomly rotates an entire page to portrait when I attempt to do so. Evidently, whether it does so (or not) is determined by the attributes of the .eps file I am including. The really strange thing is that the size of the y-axis in the figure matters. As such, it may be a problem with the figure itself... I'm not sure. I have constructed a minimal example here below. I have also attached the files since they seem relevant.

Code: Select all

\documentclass{beamer}
\mode<presentation>

% Packages stuff:
\usepackage{graphics}

\begin{document}

\begin{frame}
    \frametitle{Landscape?}
    
    \begin{figure}
\begin{center}
\includegraphics{age_earnings_prof2.eps}
\end{center}
\end{figure}

\end{frame}

\begin{frame}
    \frametitle{Why in Portrait?}
    
    \begin{figure}
\begin{center}
\includegraphics{age_earnings_prof.eps}
\end{center}
\end{figure}

\end{frame}


\end{document}
Attachments
age_earnings_prof2.eps
(8.46 KiB) Downloaded 441 times
age_earnings_prof.eps
(8.48 KiB) Downloaded 425 times
Last edited by Stefan Kottwitz on Thu May 19, 2011 9:29 pm, edited 1 time in total.

Recommended reading 2024:

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

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

man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

Re: Beamer: Included Figure Randomly Rotates Page to Portrai

Post by man2011 »

why do not you convert the picture to be .jpg? it is better if you do so, then you can control of the appearance of the picture...

you can take a screen shot to get the picture if you do not find a program to convert the extension

on imac you can click on fn+cmd+4 and then you can select the the picture and the boundary of it...
man2011
Posts: 43
Joined: Tue Jan 11, 2011 4:19 am

Re: Beamer: Included Figure Randomly Rotates Page to Portrai

Post by man2011 »

I converted the two pictures for you... the quality of the picture I think is the same and they seem to be okay to me... so deal with them as jpg pictures


see the attached

good luck
Attachments
picture2.png
picture2.png (40.85 KiB) Viewed 8865 times
picture1.jpg
picture1.jpg (25.55 KiB) Viewed 8865 times
krinkov
Posts: 2
Joined: Wed May 18, 2011 6:09 pm

Re: Beamer: Included Figure Randomly Rotates Page to Portrai

Post by krinkov »

Thanks for the suggestion, but I was hoping for something more automated. I frequently change these graphs, so it would be difficult to convert them manually to .jpg each time.

I guess I don't even understand the problem.. are the eps files "wrong" somehow? Or is this an anomalous Beamer behavior?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Beamer: Included Figure Randomly Rotates Page to Portrait

Post by Stefan Kottwitz »

Hi krinkow,

welcome to the board!
EPS is not wrong. However, pdfLaTeX, which supports JPEG, PNG and PDF, is more modern and has some advantages. You could use pdfLaTeX and insert EPS figures on the fly using the epstopdf package.

Btw. our forum provides a code environment. When posting or editing, you can click the Code button above the edit field to format LaTeX code, I just did that for you above.

Stefan
LaTeX.org admin
alan_ajac
Posts: 1
Joined: Mon Oct 17, 2011 1:08 pm

Re: Beamer: Included Figure Randomly Rotates Page to Portrai

Post by alan_ajac »

Hi, there. I had the same problem, and tried to use the pgf package to solve it. Found a way to do it, but it don't work due to a ghostscript error.
I tried the following:

\usepackage{pgf,pgfarrows,pgfnodes,pgfautomata,pgfheaps,pgfshade}

\begin{frame}
\pgfdeclareimage[height=7.5cm]{figure}{location/figure}
\begin{pgfrotateby}{\pgfdegree{90}}\pgfbox[left,left]{\pgfuseimage{figure}}
\end{pgfrotateby}}}
\end{frame}

The ghostscript error was the following:
GPL Ghostscript 9.01: Unrecoverable error, exit code 1

Hope, we find a true solution without the need to convert the file format every time.
Thanks,
Alan
salehin
Posts: 34
Joined: Wed Jun 10, 2009 1:29 am

Beamer: Included Figure Randomly Rotates Page to Portrait

Post by salehin »

Hello,

You could try using epstopdf package to convert your EPS to PDF. It will then be inserted in your final PDF automatically during final compilation. See the attached pdf.

Code: Select all

\usepackage{epstopdf}
PS: Complied using MiKTeX 2.9 and Windows 7 (Ultimate, 32 bit)
Attachments
Beamer_thingy.pdf
(26.17 KiB) Downloaded 525 times
Post Reply