Questions regarding beamer

Greetings folks!

I am using TeXmacs to create slides for a presentation for the first time. The overall experience has been quite pleasant and I must thank this community, especially the contributors, for creating this great tool! I have a few questions though:

  1. Let’s say there are 10 overlays. Is it possible to make an object visible on overlays 3 through 6 but not on those before or after? Maybe it will require something like nested tags?
  2. If I want to unroll some text in a textbox in graphics it doesn’t work properly. It seems that there are actually two types of overlays, one for text and the other for graphical objects. Is it possible to mix them together?
  3. How to adjust the positions of objects in z-order?

Thanks you!

Hi @corank and welcome to the forum.

I have an answer for your point 1 only. It is possible to nest tags, and I verified that inserting a “visible until here” tag inside a “visible from here” works.

You can as well use directly the overlay-cond tag I think, which makes it possible to write any condition.

The help for this topic is under “Help->Manual->Laptop presentations”.
There is a discussion on a related topic at Does TeXmacs beamer have a way to make images "appear" and "disappear"?, maybe there you find other hints.

I have a vague memory of seeing the answer to your question 3 in a video but I need to figure out which video (assuming the memory corresponds to reality :slight_smile: )

2 Likes

Thank you so much for the help!

For 1, yup it is indeed possible. It looks like the visibility of an object is controlled by its proviso, which expands to a boolean. A bunch of macros such as show-from and show-until are already there, each of them receiving the overlay number as the argument and expanding to a boolean through some arithmetic macros (greatereq for show-from, for example). So I just reused show-from and show-until to create another macro show-interval which receives two arguments. This works! For overlay-cond, it seems that it is used for text but not for graphics. I believe it can be used to achieve the same effect on text as well.

May I know how you usually work with the source code directly when using TeXmacs? What I have been doing is having a separate text editor open on the side and after editing the source code reloading it in TeXmacs. A bit painful to locate the point to edit this way. I checked “edit source tree” but was a bit confused.

1 Like

Re 3. With the cursor on one of the nodes of the object you wish to move, press Ctrl-PgUp or Ctrl-PgDown (see Help->Manual->Creating techical pictures).

1 Like

I use the “edit source tree” view. It takes a bit to get used to how the editor works in source view and I think I know the elementary actions and reasons only. I do not know of any place where the way the source code editor works is described. A useful point is that once you introduce variables in a macro, you write them in the macro body with “slash name”, the editor picks that up.

When I program more complex things for TeXmacs I do it in Scheme, where I organized Emacs to work well for me.

1 Like

Additional to the “source tree” view, you can also inspect the “source” of specific elements by selecting them and making them inactive (keyboard shortcut: Super together with the minus sign key).

1 Like

In case other people want to do the same thing with overlays, here is a script that adds a “Proviso” button which allows you to set an interval as proviso for the selected object:

(define (set-interval-overlay-proviso start end)
  (cond ((and (equal? start "-") (equal? end "-")) (graphics-set-proviso "default"))
        ((equal? start "-") (graphics-set-proviso `(show-until ,end)))
        ((equal? end "-") (graphics-set-proviso `(show-from ,start)))
        ((equal? start end) (graphics-set-proviso `(show-this ,start)))
        (else (graphics-set-proviso 
              (list 'and 
                    `(show-from ,start)
                    `(show-until ,end))))))

(tm-define (prompt-set-interval-overlay-proviso)
    (user-ask "Start:"
              (lambda (start)
                (user-ask "End:" (lambda (end)
                    (set-interval-overlay-proviso start end))))))

(tm-menu (graphics-focus-overlays-icons)
    (former)
    (with t (tree-innermost overlays-context?)
          (assuming (nnot t))
      //
    (minibar ((balloon "Proviso" "Set interval overlay proviso") (prompt-set-interval-overlay-proviso)))))
2 Likes

Looks nice.

I did not understand the logic of the menu item. Why do you need the tree?
Also, is the (nnot t) a Guile form or a mistype for (not t)?

To be honest, I’m new to both TeXmacs and Guile/Scheme, and don’t fully understand the menu item logic either. I almost directly copied that part from dynamic/fold-menu.scm which set up menu items in the same context as where I want to add the button.
(nnot t) is defined as (not (not t)) somewhere. It seems that it can convert t to a boolean.

1 Like

Sometimes there is a bit of wizardry in those programs :wink: