Graphics, Figures & TablestikZ | Inclusion of animated GIF Image

Information and discussion about graphics, figures & tables in LaTeX documents.
Tyrion
Posts: 7
Joined: Tue Jul 31, 2012 5:27 pm

tikZ | Inclusion of animated GIF Image

Post by Tyrion »

Hello,
first post!

I'm trying to put an animated GIF into a bounding box generated by tikZ but the image is always positioned outside the box. If I use the \includegraphics command the image has the right positioning.
Here's a my code.
Can anybody help me solve this problem?

Code: Select all

\documentclass[t]{beamer}
\usepackage{animate}
\usepackage{tikz}
\usetikzlibrary{shapes}
\tikzstyle{mybox} = [draw=blue, fill=white!20, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt]
\begin{document}
\frame{
\begin{tikzpicture}[remember picture, overlay]
\node at (current page.center) [mybox,below right,xshift=-6cm,yshift=0cm] (box_1){
\begin{minipage}{\textwidth}
\animategraphics[autoplay,loop,width=0.4\textwidth]{3}{img_}{0}{7}
\end{minipage}
};
\end{tikzpicture}
}
 
\end{document}

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Stefan Kottwitz »

Hi Tyrion,

welcome to the board!

Perhaps post test images if the correct size here, as attachment to a post, since without images we cannot test the animation to verify the problem. If we take just any other images, it's probably not the same situation.

Stefan
LaTeX.org admin
Tyrion
Posts: 7
Joined: Tue Jul 31, 2012 5:27 pm

tikZ | Inclusion of animated GIF Image

Post by Tyrion »

Hi Stefan_K,
and thank you for the quick reply. I can't post the original images I am using for confidentiality reason, but it should work with any image named img_0.eps, and then change the following line to include only one frame

Code: Select all

\animategraphics[autoplay,loop,width=0.4\textwidth]{3}{img_}{0}{0}
I forgot to mention that I'm under Kile and using XeLaTeX but I don't know if this is relevant.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Stefan Kottwitz »

That's why I said test images ;-) I meant dummy images of the same size which may cause such a problem. I just don't have an .eps image here, I usually work with pdfLaTeX.

Stefan
LaTeX.org admin
Tyrion
Posts: 7
Joined: Tue Jul 31, 2012 5:27 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Tyrion »

ok,
here's a test image. I hope it helps
Attachments
img_0.eps
test image
(16.02 KiB) Downloaded 347 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

tikZ | Inclusion of animated GIF Image

Post by Stefan Kottwitz »

When I tested this image, and this code, it's in the box. I just made it smaller (factor 0.2) to not exceed the frame height. Did you make the same test, with this dummy image?

Code: Select all

\documentclass[t]{beamer}
\usepackage{animate}
\usepackage{tikz}
\usetikzlibrary{shapes}
\tikzstyle{mybox} = [draw=blue, fill=white!20, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt]
\begin{document}
\frame{
\begin{tikzpicture}[remember picture, overlay]
\node at (current page.center) [mybox,below right,xshift=-6cm,yshift=0cm] (box_1){
\begin{minipage}{\textwidth}
\animategraphics[autoplay,loop,width=0.2\textwidth]{3}{img_}{0}{0}
\end{minipage}
};
\end{tikzpicture}
}
\end{document}
frame.png
frame.png (2.6 KiB) Viewed 6842 times
Stefan
LaTeX.org admin
Tyrion
Posts: 7
Joined: Tue Jul 31, 2012 5:27 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Tyrion »

I'm using the exact same code and getting this instead
Attachments
frame.png
frame.png (14.2 KiB) Viewed 6842 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Stefan Kottwitz »

Which engine did you use? I tested with XeLaTeX.

Stefan
LaTeX.org admin
Tyrion
Posts: 7
Joined: Tue Jul 31, 2012 5:27 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Tyrion »

I'm using XeLaTeX too, under Kile with default configuration meaning:
Tool : xelatex
Configuration : -interaction=nonstopmode '%source'

Should I add anything else?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10350
Joined: Mon Mar 10, 2008 9:44 pm

Re: tikZ | Inclusion of animated GIF Image

Post by Stefan Kottwitz »

Does your .log file print any warning? Perhaps add the .log file as attachment.

Stefan
LaTeX.org admin
Post Reply