Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resumable enumerate #847

Open
jspitz opened this issue Mar 29, 2023 · 0 comments
Open

Resumable enumerate #847

jspitz opened this issue Mar 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jspitz
Copy link
Contributor

jspitz commented Mar 29, 2023

A frequent request we get with LyX is that people want a way to resume an enumeration on a later slide. As beamer does not work with enumitem, we provide a "module" (addon) that patches beamer's and beamerarticle's enumerate and adds a new resenumerate environment, like so:

    \newif\ifenumresume\enumresumefalse
    \newcounter{saveenumi}
    \newcommand*\saveenumvalue{\ifnum\@listdepth<2\setcounter{saveenumi}{\value{enumi}}\fi}
    \newcommand*\restoreenumvalue{\ifnum\@listdepth<2\setcounter{enumi}{\value{saveenumi}}\fi}
    \only<presentation>{\resetcounteronoverlays{saveenumi}}
    \usepackage{etoolbox}
    \AtEndEnvironment{enumerate}{\saveenumvalue}
    \let\resenumerate\enumerate
    \let\endresenumerate\endenumerate
    \AtBeginEnvironment{resenumerate}{\enumresumetrue}
    \AtEndEnvironment{resenumerate}{\enumresumefalse\saveenumvalue}
    \apptocmd{\beamer@enum@}{\ifenumresume\restoreenumvalue\fi}{}{}
    \AtBeginDocument{%
      \only<article>{%
      \makeatletter
      \apptocmd{\@enum@}{\ifenumresume\restoreenumvalue\fi}{}{}
      \makeatother
      }
    }

Of course, this is rather kludgy, so I was wondering whether it would make sense to implement a resume option of some sort in beamer(article) directly. I am not sure about the best syntax (new/starred environment? special mini-template syntax? environment option?), but the implementation itself strikes me pretty straightforward.

@samcarter samcarter added the enhancement New feature or request label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants