Beamer with overlays

Dear TeXmacs users and developers!

I’ve been using TeXmacs for some time. I see it is much more stable now than it used to be several years ago, especially on Windows. Many thanks to the developers for that! I think it has great potential as a presentation tool due to its interactive WYSIWYG nature. More importantly, while for papers you have to use LaTeX to be published, for presentations, you are usually allowed to use whatever tool you want if it can produce nice pdfs.

I already tried to use TeXmacs for presentations. I think that even in its current state it is quite good for that. I saw many good examples on Joris’ webpage. However, currently, I do not see any good way to combine graphics and overlays. In the LaTeX beamer style, you can do it by using tikz, which supports beamer overlays. See, for example, this.

I see that the TeXmacs graphics editor also has some support for this. But in my view, the graphics editor in its current form is quite limited and can’t fully replace tikz. Moreover, it crashes very often (at least on Windows). I know that TeXmacs has quite a nice tikz plugin that can be used for that, but it doesn’t support overlays. One possible way I see to support them is to produce multi-page documents using tikz (like in this example) and then somehow use different pages with different overlays in TeXmacs.

Do you have any ideas or suggestions on how this process can be automated?

I also think that it could be handy to have a global parameter in the tikz plugin, defined in the preamble of the TeXmacs document, that can be used to store all information (in text form) about your tikz settings (things like tikzset, usetikzlibrary, …). Otherwise, you need to copy all this stuff at the beginning of each tikz plugin instance in the document.

Best,
Pavel

2 Likes

Dear Pavel,
I’m not an expert on the graphics editor but indeed it seems that right now it does not directly support overlaying of graphics. I’m not sure if this is a limitation of the markup or of the editor, I will have to check. Anyway this is indeed a possible direction of improvement, thanks for pointing this out!

It would be useful to know when the graphics editor crashes. I use it often and I should say I do not remember any recent problem with it, but there could be and we can fix them. Are they reproducible? Do you see them appearing in specific workflows?

As for the TikZ related questions: TikZ is supported via a plugin, which means that there is no specific internal support for it and most of the activity happens at the “boundary” of TeXmacs. What I see could be maybe implemented is a Scheme macro which calls the plugin to produce each of the pages and then insert them properly in an overlay in an automated way, this should not be difficult. Also for the standard preamble a similar approach would work: one define in the document preamble a macro containing the initialisation code for the library and then via scheme code retrieves it and add it to the code which will be send to the plugin. There is a scheme function eval-plugin (or something like this) which can be used to programmatically run plugins, this is the good starting point. We could think to have a more useful TikZ dialog box (or markup) to set up such things.

A small correction: it is indeed possible to have overlays in graphics. In graphics mode choose Insert -> Overlays. There is an overlay icon that you may use to insert new overlays.

After that, the overlay on which an object is visible becomes part of the properties of that object (just like color, etc.).

Do you mean the “Overlays” which are briefly documented in the manual at man.beamer.overlays.tm? I have seen a demonstration once by JvdH, but I have forgotten how to use them, and have experimented just a little bit. I have been able to get a line to appear up to an overlay only by inserting the tag overlay-until in the source code (highlight the line in the code, then type slash then overlay-unitl on top of the highlighted code)—this is the code:

<overlay-until|2|<line|<point|-0.260615|1.04103>|<point|-1.00767487330136|-1.33711078470473>>>

This works in the exported pdf as well. In the Insert menu—in the form that it takes when editing graphics—I have found also an entry for overlays (edit: this is the one @mgubi said, I saw the message after writing mine), which in the one test I did seemed to me to act on the same “overlay” tags as the ones inserted from the default Insert->Fold->Overlays menus.

By the way in the demonstration by JvdH I remember I saw that one can manipulate the appearance of document parts in the overlays using arbitrary macros, but I cannot immediately recall/reconstruct how one does that.

I recall crashes as well, but I do not have fresh experience to compare with yours.

Giovanni

There is an overlay-cond macro, I think it is that.

Thank you Massimiliano and Giovanni for your very interesting points regarding the graphics with overlays and the tikz plugin customization. I should definitely invest more time into the TeXmacs graphics editor and its overlay facilities. As I mentioned before, I already saw some interesting examples of overlays in Joiris’ slides. I think that for simple pictures that’s more than enough. For more complex ones I believe you still need something like tikz.

Regarding the bugs in the graphics editor. There are many ways how I can cause TeXmacs to freeze or even crash in the graphics mode. It either gives you “Error: Exception, marker not found” message or just completely freezes. For me this most often happens when you try to select and copy/past some objects.

The simplest example that I can reproduce:

  1. open fresh TeXmacs, draw image (using the toolbar);
  2. add two different points, select them (choose “Set properties” in the tool bar and use the mouse with left button to select);
  3. press Ctrl-X or Ctrl-Del (cut in Windows);
  4. click by mouse (using the left button) in any place.

After that I see the message: “Error: Exception, marker not found”.

2 Likes

I can confirm this. It seems to happen with any object (text, line, also a single point).

@jeroen can you file a bug report on Savannah, so that we keep track. I think is important to remove any “easy” crash for the upcoming 2.1 if easily fixable (which I’m not sure this is). @vdhoeven any clue?

For reference:
https://savannah.gnu.org/bugs/index.php?60743