TeX - LaTeX Asked by Robert Speck on January 19, 2021
For a presentation with Beamer, I would like to have a slide where a long list of formulas (maybe mixed with text) scrolls automatically within a certain part of the slide. This should look like e.g. closing credits in movies.
I have tried the idea from here
based on animateinline
from the animate package, but whenever I use environments like begin{equation} ... end{equation}
or commands like textcolor{red}{...}
I get an error:
TeX capacity exceeded, sorry [main memory size=3000000]. end{frame}
Ideally, the formulas/the text should be given within the document itself, but if a solution with an external PDF works fine, I’ll take it!
Any ideas how that might work?
Synposis:
%put a longer paragraph of text in a box
newsaveboxlipsumbox
begin{lrbox}{lipsumbox}%
begin{minipage}{textwidth}%
strut
lipsum
strut
end{minipage}
end{lrbox}
%scroll the box content within a viewport of limited height
smoothscroll[autoplay]{lipsumbox}{0.93textheight}{400}{25}
Usage:
smoothscroll[autoplay]
{<box number>} %filled box
{<viewport height>}
{<steps>} %increase to enhance smoothness
{<steps per sec>} %adjust scrolling speed (not more than 25)
Complete example:
documentclass[a5paper]{scrartcl}
usepackage{lipsum}
usepackage{animate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage{xsavebox}
newcommandsmoothscroll[5][]{%
% [#1] autoplay
% #2 <boxnum>
% #3 <viewport height>
% #4 <steps>
% #5 <steps per sec>
edefmywd{thewd#2}%
edefmyht{theht#2}%
edefmytht{thedimexprht#2+dp#2relax}%
xsavebox{scrollbox}{usebox{#2}}% make re-usable PDF XObject
edefportht{thedimexpr#3relax}%
begin{animateinline}[#1,width=mywd,height=portht,loop]{#5}
multiframe{#4}{dRaiseLen=-myht+dimexpr(mytht+portht)/#4relax}{%
begin{minipage}[b][#3][b]{mywd}%
raisebox{dRaiseLen}[0pt][0pt]{thescrollbox}%
end{minipage}%
}%
end{animateinline}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
begin{document}huge
newsaveboxlipsumbox
begin{lrbox}{lipsumbox}%
begin{minipage}{textwidth}
strut Lipsum:
lipsum[1]
begin{equation}
E=mc^2
end{equation}
centerline{* * *}strut
end{minipage}
end{lrbox}
noindent Read this if you can:[1ex]
smoothscroll[autoplay]{lipsumbox}{0.93textheight}{400}{25}
end{document}
Correct answer by AlexG on January 19, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP