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

1 Answer 1

3

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

\documentclass{beamer}

\newcounter{bar}
\newcommand{\foo}{%
  \setcounter{bar}{\insertframeendpage}%
  \addtocounter{bar}{-\insertframestartpage}%
  \addtocounter{bar}{1}%
  (\insertoverlaynumber/\thebar)%
}

\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

9
  • 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 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. Jan 28 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 at 19:33
  • @Zarko A starting point would be to show your code. Jan 28 at 19:35
  • Now is added MWE by which I tested your solution.
    – Zarko
    Jan 28 at 19:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .