3

I had this exact question:

Problem with \only and alignment of graphics (pdf) in beamer

And found the third answer the nicest (in that it worked on the first try):

https://tex.stackexchange.com/a/184533/73454

Doing something like:

\includegraphics<1>[scale=0.7]{pics/List-0.pdf}

Now my problem is that the above although gives a nicely formatted pdf it does however give out erros on compilation (I'm a bit fuzzy on this I'm running latex through the gedit plugin):

graphics `<' not found

So even though it works as I'd like, is there a reason / way to get rid of the error message?

PS. I'm a complete newbie in beamer so please excuse my ignorance.

EDIT:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{subfig}
\usepackage{braket}
\usepackage{geometry}
\usepackage{empheq}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[backend=biber,url=false,doi=false,isbn=false,firstinits=true]{biblatex}
\title{Angels and Daemons}
\author{Friendly Monster}
\date{10 March 2015}

\AtBeginSection[]{
\begin{frame}{Outline}
    \tableofcontents[currentsection,hideallsubsections]
\end{frame}}

\begin{document}

    \begin{frame}
        \frametitle{Test Slide}
        \begin{columns}
        \begin{column}{0.5\textwidth}
            Test
            \begin{enumerate}
                \item <1-> Item 1
                \item <2-> Item 2
            \end{enumerate}
        \end{column}
        \begin{column}{0.5\textwidth}
                \includegraphics<1>[width=\textwidth]{fig1.png}
                \includegraphics<2>[width=\textwidth]{fig2.png}
        \end{column}
        \end{columns}
    \end{frame}

\end{document}

EDIT2:

GEdit output

evan54
  • 313
  • 3
  • 9
  • Please add to your question a little complete document allowing us to reproduce the problem. – Gonzalo Medina Mar 03 '15 at 17:34
  • @GonzaloMedina done, I've kept a relatively large number of usepackage mainly because one of those may be the cause, though not sure how that kind of stuff really works... let me know if the edited question is ok or if you want more info. Thank you! – evan54 Mar 03 '15 at 17:41

1 Answers1

3

Do not load the subcaption nor the caption package with beamer; beamer has its own ways to handle captions and if you need subfloats, use subfig.

In your case, the problem is even bigger since loading subcaption and subfig will trigger an error message:

! Package subcaption Error: This package can't be used in cooperation
(subcaption)                with the subfig package.

As soon as you remove those packages, your code works as expected:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{braket}
\usepackage{geometry}
\usepackage{empheq}
\usepackage[backend=biber,url=false,doi=false,isbn=false,firstinits=true]{biblatex}
\title{Angels and Daemons}
\author{Friendly Monster}
\date{10 March 2015}

\AtBeginSection[]{
\begin{frame}{Outline}
    \tableofcontents[currentsection,hideallsubsections]
\end{frame}}

\begin{document}

    \begin{frame}
        \frametitle{Test Slide}
        \begin{columns}
        \begin{column}{0.5\textwidth}
            Test
            \begin{enumerate}
                \item <1-> Item 1
                \item <2-> Item 2
            \end{enumerate}
        \end{column}
        \begin{column}{0.5\textwidth}
                \includegraphics<1>[width=\textwidth]{example-image-a}
                \includegraphics<2>[width=\textwidth]{example-image-b}
        \end{column}
        \end{columns}
    \end{frame}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • hm... that actually didn't change anything for me :( I still get that error – evan54 Mar 03 '15 at 17:54
  • I removed, subfig, caption, and subcaption – evan54 Mar 03 '15 at 17:55
  • I added a screen shot of how the error shows up on my machine... I don't know if that is of help – evan54 Mar 03 '15 at 17:57
  • @evan54 Do you get that error message using the simple file in your question? What beamer version are you using? – Gonzalo Medina Mar 03 '15 at 18:01
  • yes with the simple version I've posted. Is there an easy way to check the version of beamer? – evan54 Mar 03 '15 at 18:03
  • I think I'm on 3.24-1, from here: http://packages.ubuntu.com/trusty/latex-beamer – evan54 Mar 03 '15 at 18:04
  • from my .log file: Document Class: beamer 2012/10/15 development version 3.24 A class for typesett – evan54 Mar 03 '15 at 18:05
  • @evan54 Your beamer package is outdated (probably also PGF/TikZ); my system reports: beamer.cls 2013/12/02 3.33 A class for typesetting presentations (rcs-revi sion 332bfd3ce558). Can you try updating your packages or, better yet, your LaTeX system? – Gonzalo Medina Mar 03 '15 at 18:21
  • what is the best way to do it. I'm on ubuntu 14.04 and it seems that I'm running the latest version available to my system through the repositories. Should I open a separate question? – evan54 Mar 03 '15 at 22:21
  • @evan54 You should install "vainilla" TeX Live: see this question http://tex.stackexchange.com/q/1092/3954 and its answers. Before doing a complete installation, a last test: do you also get the error message when using the example code in my answer exactly as is? If so, I'm afraid you'll need to update. – Gonzalo Medina Mar 03 '15 at 22:24
  • yes getting the same error with your code. I'll mark accepted and proceed at some point with updating. thank you – evan54 Mar 03 '15 at 22:28