3

I like to have in frame with option \allowframebreaks different \framesubtitle. Solution provided by samcarter_is_at_topanswers.xyz in change-frame-subtitle-after-a-framebreak fulfil this my wish, however I like to change a way of numbering of frames. Instead of \Roman numbers i like to have \arabic numbered on the following way

    (<frame number>/<number of slides in frame>)

which in the case when frame has three slides, are numbered as (1/3), (2/3) and (3/3). How to achieve this?

Code in given link is:

\documentclass{beamer}

\makeatletter \newcommand*{\slideinframe}{\number\beamer@slideinframe} \newcounter{bar} \newcommand{\foo}{% \setcounter{bar}{\insertframeendpage}% \addtocounter{bar}{-\insertframestartpage}% \addtocounter{bar}{1}% (\slideinframe/\thebar)% } \makeatother

\usepackage{lipsum}

\begin{document} \begin{frame}%[allowframebreaks] \frametitle{Foo \foo} \only<+>{ \framesubtitle{Bar} } \lipsum[1]

%\framebreak \only<+>{ \framesubtitle{Baz} } \color{red}\lipsum[2] \end{frame} \end{document}

what it do, but consider solution suggested in @samcarter_is_at_topanswers.xyz answer frame is not divided on slides:

enter image description here

But when I uncomment lines in above MWE, slides appear, but numbering not works anymore as expected...

enter image description here

Zarko
  • 296,517

1 Answers1

3

You could calculate the total number of slides within the frame from the start and end pages of the frame:

\documentclass{beamer}

\makeatletter \newcommand*{\slideinframe}{\number\beamer@slideinframe} \newcounter{bar} \newcommand{\foo}{% \setcounter{bar}{\insertframeendpage}% \addtocounter{bar}{-\insertframestartpage}% \addtocounter{bar}{1}% (\slideinframe/\thebar)% } \makeatother

\usepackage{lipsum}

\begin{document} \begin{frame} \frametitle{Foo \foo} \only<+>{ \framesubtitle{Bar} \lipsum[1] } \only<+>{ \framesubtitle{Baz} \color{red}\lipsum[2] } \end{frame} \end{document}

enter image description here

  • Thank you very much for fast response. It almost work as desired ... with you solution I have problem how to insert text in each slide in frame. If I insert for example \lipsum[1] after eacj subtitle ,, text are not in own slide, but it continues and is cut after first frame. Adding allowsframebreaks resulted in correct breaking frame into slides, but numbering is corrupted. SO so far only +1 for your effort. – Zarko Jan 28 '24 at 19:14
  • @Zarko Don't combine this with allowframebreaks, this option is not really compatible with overlays. Instead use \only<...>{...} etc. to split your text across the slides. – samcarter_is_at_topanswers.xyz Jan 28 '24 at 19:17
  • Hm, this not work as I expected. No separated slides are produced. What then I should do, that thew will do so? – Zarko Jan 28 '24 at 19:33
  • @Zarko A starting point would be to show your code. – samcarter_is_at_topanswers.xyz Jan 28 '24 at 19:35
  • Now is added MWE by which I tested your solution. – Zarko Jan 28 '24 at 19:59
  • @Zarko See my updated answer – samcarter_is_at_topanswers.xyz Jan 28 '24 at 20:06
  • Thank you very much! Now I see where I should insert my slide contents. Sorry, that I didn't figured out this myself ... – Zarko Jan 28 '24 at 20:18
  • Unfortunately now I discover very unpleasant side effect of your solution: (i) numbers are not incremented for numbered captions, (ii) referencing of images does not work. Please see my new question https://tex.stackexchange.com/q/708259/. – Zarko Jan 29 '24 at 22:30