Feature request : animated images

11 views
Skip to first unread message

Juan Carlos Bustamante

unread,
Jun 20, 2022, 9:37:11 AMJun 20
to PreTeXt development

Hello all,
I woud like to be able to include animated plots, produced for instance with sagemath. I tried the code below, (and some mild variations, like a.apng() at the end) in a very naive attempt. Of course it did not work, from the error message it looks like an  .svg image was expected.

This is not the only way to produce animated plots with sage, though. Also, let me point out that I do not want an interact. In a .pdf I guess it would be included either as an animated gif, or even a movie, for viewing on a computer / phone / tables, or one would have to provide a preview, in the same manner as for sageplot variant 3D, for instance. 

     <image xml:id="sageplot-example-animate" width="80%">
      <description>Une animation</description>
      <sageplot aspect="1.0">
        x = SR.var("x")
        sines = [plot(c*sin(x), (-2*pi,2*pi), color=Color(c,0,0), ymin=-1, ymax=1) for c in sxrange(0,1,.2)]
        a = animate(sines)
        a.apng()
      </sageplot>
    </image>

Rob Beezer

unread,
Jun 20, 2022, 12:27:48 PMJun 20
to prete...@googlegroups.com
At first blush, maybe this should be supported as an "interactive", (a) since it is, and, (b) so that all the infrastructure for static versions can be recycled. Then maybe the image itself could come from a variety of sources, sage being one.

Not dissimilar to videos, as another close example.

Rib

Juan Carlos Bustamante

unread,
Jul 9, 2022, 3:13:10 PMJul 9
to prete...@googlegroups.com
Hello,
Well... strictly speaking gifs are not interactive, since no action from the reader is required. In that, they are more like videos as you point out. However, since they can be "described", with sage or even tikz, they could also fall into those categories. Would it be reasonable to think about a "variant" for a sageplot? What about tikz?
JC


--
You received this message because you are subscribed to the Google Groups "PreTeXt development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-dev/MTAwMDAxMC5iZWV6ZXI.1655742466%40quikprotect.
Reply all
Reply to author
Forward
0 new messages