Table of contents in beamer

When I try to insert TOC in beamer, I get question marks on the right-hand side where it should be page numbers with hyperlinks. See the screenshot.

Screen Shot 2021-12-18 at 5.16.32 PM.png
The problem persists even after page number is added through Document-Page and document is updated. Moreover, clicking on the question marks will not link the labeled section. On the other hand, the hyperlink works in the exported PDF, although the question marks remain.

BTW, maybe a better format for TOC is to make the section title rather than page numbers as the hyperlinks. Are there style files for this?

Hi @Jade ,
could you please share a document that displays the issue? The way to share is copying the content of the file and pasting it in a code box inside the message.

Somehow I can’t select all the source code and copy it. I made a minimal example for you to download here: https://www.jianguoyun.com/p/DRiUHGQQjOioBhi64qEE

Thanks for the document, which I downloaded. The way to copy the source is opening the file in a text editor :slight_smile:

I played with the document and I cannot make any progress. I have the impression that the generation of the table of contents is done through the C++ code, so it cannot be changed with a style file, but I may be wrong, perhaps @jeroen or @mgubi or @darcy can say something.

My suggestion, if noone posts other messages in this thread, is to report this as a bug (https://savannah.gnu.org/bugs/?group=texmacs).

I don’t know if this will work, but I would start looking at the toc-entry macro. This is where pageref is called to get the page number. pageref doesn’t seem to work for beamer slides, as their structure is quite different from a “normal” document.

toc-entry could be overridden to use, instead of pageref, an extern to some Scheme code that finds the screen on which a locus is found. You could have a look at the code for screens-bar (the bar below the title bar that shows a list of pages) for some inspiration on how to work with beamer documents in Scheme.

1 Like

I found the toc-entry macro and the source code for screens-bar. Will learn some TeXmacs tree format and the Scheme language in order to work out a solution. BTW, to override the macro, do I write my own macro with the same name and put it into my-init-texmacs.scm or in my own style file?

The TeXmacs macro can go either in a style file or in the preamble of the document. The Scheme code can go in my-init-texmacs.scm. Eventually you could put it all into a plugin. Let us know if you have any questions while you work on it!

1 Like

In my opinion, ToC of slide shows should be different from this — the page numbers do not make sense (especially if there are animations). It should only contain links to slides, like an automatically generated nested list.

That’s also my point. Ultimately it would be nice to have a ToC in the LaTeX beamer style, that is, a nested list with hyperlinks and an overlayed ToC slide automatically inserted before each section/subsection, or one ToC slide at the beginning and a hyperlink to it at each slide.

This seems to be correct: https://github.com/texmacs/texmacs/blob/a312c218d4be1aef38555592eb54c5aee96c0acf/src/Edit/Process/edit_process.cpp#L226