Menu

Xfig slides

2017-09-10
2018-04-12
  • Vasileios Porpodas

    Hi there!

    I have developed a prototype plugin to xfig-3.2.6a for making it easier to animate xfig figures, for use in presentations (usually latex).
    The code is hosted here: https://github.com/vporpo/xfig-slides
    You have to configure with --enable-slides

    The way slides work is by annotating the objects with slide numbers.
    When the "export slides" button is clicked, multiple .fig files are automatically generated and exported to the exported format.
    I have put together a brief tutorial here: http://vporpo.me/xfig_slides/index.html

    I have made no modifications to the .fig file format for time being.
    Currently the slide numbers are kept in a commented-out line right on top of the object's data.
    For example the following object is enabled in all slides 1 through 7:

    #$1,2,3,4,5,6,7,
    1 3 0 1 0 2 50 -1 20 0.000 1 0.0000 7050 3675 97 97 7050 3675 7147 3675
    

    Do you think we could enable slides in mainline xfig some day ?
    I think it would require updating the .fig file format though (in order to propery support the slide numbers within the object descriptions).

    Cheers
    Vasilis

     
  • tkl

    tkl - 2017-10-05

    Dear Vasileios,

    sorry for the long delay in answering to your note. This is quite an impressive and complete work. You did not only create a big patch and augmented the user interface, but also wrote a comprehensive manual.

    Regarding inclusion of the code into xfig, let us first look at current possibilities to create slides. In all cases, the objects should or must be grouped by their depth.

    1. In connection with latex/beamer, one can export to pict2e or tikz and write \pause-commands (and friends) into text objects. The "Special" text flag must be set on the text object. The resulting tikz- or pict2e-file can be \input into the tex-presentation.

    2. In the Export menu, check the box " Export only active". One would have to manually check or uncheck the active depths in the right side panel, and manually set the proper export file name, e.g., f1.eps, f2.eps, etc. The same can be achieved from the command-line, e.g.,
      fig2dev -L eps -D 50-53 f.fig f1.eps; fig2dev -L eps -D 55-60 f.fig f2.eps, etc.

    3. On debian and debian-derived distributions, fig2dev is patched and bundled with fig2mpdf. The fig2mpdf-script creates slides, either from a manually given range of depths, or it separates a figure into slides by gaps in the depths.

    Previously, I did not include the fig2mpdf-patch into mainline, with the argument that the additional functionality is small compared to the possibilities existing in xfig/fig2dev.

    Where you aware of possibility 2 above?

    I believe, there are several points that should be discussed.

    1. Does the patch add an sufficient amount of functionality?

    2. Does it make a functionality that is probably hidden deep in the software much better accessible? (In this respect, the text "Special" flag comes to my mind, whose importance in connection with TeX/LaTeX is probably missed by a lot of users.)

    3. With respect to the placement of the "Slides"-button: In my opinion, the separation of a figure into slides should be an export option, not a property imminent to the drawing. Also, it is probably possible to create all the slides from one figure, instead of creating a number of intermediate fig-files.

    4. One of the points on my wishlist is to put the command with which a graphics file is generated as a comment into that graphics file. Your comment regarding the file format can be expanded to store the last export command into the .fig-file. That would be a convenient addition.

    Yours,
    Thomas

     
  • Vasileios Porpodas

    Hi Thomas,

    Thank you for your detailed reply.

    Regarding the options you mentioned for creating slides:

    1. I am not very familiar with the tikz language and how you could animate it with the pause 'special' text commands you mention.

    2. I knew that you could export specific layers; this is how I was generating the slides before writing the patch. What I did not like with this approach is that it is a hack. The layers are supposed to represent the depth of each object in the drawing. Using them as markers for what each slide should include is not what they were designed for.
      This also leads to issues like when you need an object to appear on more than one slide/layer (e.g. 50 and 55) you need two copies of the object: one with depth 50 and another with depth 55.

    I believe that generating slides should not require you to edit the original image in any way, and by editing the layers you are actually making changes in the object depths of the image.

    1. I have not used this tool. I guess it makes step 2 more convenient.

    2. Regarding the new functionality introduced by the patch:
      The slides are conceptually different from layers: Layers are meant to show the depth layers of an image, while the slides allow you to create an animation of individual slide/frames.
      Implementation-wise the slides apply an additional mask on top, showing or hiding objects depending on its slide number and the slide number(s) selected in the slide bar.

    I think the term "slide" is rather confusing. A better term would be "frame" as in the frame of an animation.

    The patch adds this masking functionality with some gui support to make it easy to visualize each frame/slide (e.g. keys to move from slide to slide) and to work edit it (e.g. move object from one slide to another).

    The main design point is that it the slides allow you to split a figure into frames (and visualize them), without having to hack/modify the original image by. I think that modifying the object depths is an intrusive method of achieving a similar goal.

    1. I am not sure how the "special" flag works, I have to look into it.

    2. I think the slides are attributes of each object. They describe the frames on which each object should be visible during the animation. This is not only used for exporting it to a file but also for showing it on the screen.
      I have not put too much thought on the placement of the "slides" button, but I agree it should not be in the File menu.

    3. My point is that if slides are to become part of xfig, they need a placeholder in the object fields (just like the field for the object layer). The current implementation is just a quick hack as it lists the slide numbers in a commented-out line.

    Cheers,
    Vasileios

     
  • Joel Reardon

    Joel Reardon - 2018-04-12

    Hey Vasileios, I wanted to say I used the slides xfig for a couple talks I prepared and it made my life so much easier! I used to have separate figures for all the slide animations, or revealing components, and it make it so much easier to align everything when it's all in the same place, and if I want to change something I only have to change it in one place.

    The only two things I want to change on it is when specifying the list of slides to show an item on, being able to say something like "4-8" or "4-" or "-6" to smoothly handle ranges, and maybe some way to select with a box to update the properties of everything in it (this is more a general xfig feature for the update)

    Anyhow bravo, this saved me so much time in preparing talks.

     
  • Vasileios Porpodas

    Hi Joel,

    Thanks for the feedback!
    The latest version from github https://github.com/vporpo/xfig-slides does support ranges (e.g. "4-8") in the edit box, but it does not support ranges with no lower or higher limit. This is indeed a feature that is missing. I will definitely try to implement it.

    Regarding updating the slide numbers for many objects, the way you can do it is by grouping them, setting the slide numbers for the group and then ungrouping them.
    Personally, I am mostly using the "New slide" button on the right hand side panel to clone the slide, and then I am using the "K (KICK)" button with the middle click to remove an object from the current slide (or the left/right clicks to enable the object on the previous/next slide).

    I also recently added the "Shift-K (KUT)" button which allows you to change an attribute of an object. For example let's say you want to change the color of some text from black to red on slide 4. Up until now you had to manually create a black text ovbject for slides 1-3, then create a copy of it, set the color to red and set the slide number of the new object to 4. Now this can be done automatically with Shift-K.

    I will keep you updated witn new features.

     

Log in to post a comment.