7

I want to make a text animation movie for my wife for Valentines. My first thought was to use the beamer package and have a different word in bold on each slide. I would then convert the pdf to jpegs and use each slide as a frame. As I am reading the slides in the audio, the words will go to bold in sequence. The problem is that the bold letters are wider than the non-bold letters, so the words slide around a little between frames depending on which word is bold. I would like this to go away, but I don't know the best way to fix it.

My first thought was to try and set the letter spacing for non-bold text to match that of bold text. I don't know exactly how to do that, but I suspect it won't look that great. Trying to set the word spacing to what it would be if all the text were bold seems like it might look better, but I am not sure it is feasible.

How do I do this well?

ryanGT
  • 125
  • What if you changed the color of the text rather than changing the font size? I believe that this is the way it is done for displaying lyrics of karaoke songs, which is a different context, but has some similarities. – I Like to Code Feb 04 '14 at 23:37

1 Answers1

7

Here is a first step:

enter image description here

\documentclass{beamer}% http://ctan.org/pkg/beamer
\makeatletter
\newcommand{\widthofbold}[1]{%
  \settowidth{\dimen0}{\textbf{#1}}%
  \makebox[\dimen0]{#1}}
\newcommand<>{\myword}[1]{%
  \alt#2{\textbf{#1}}{\widthofbold{#1}}}
\makeatother
\begin{document}

\begin{frame}
  \Large
  \myword<1>{This}
  \myword<2>{is}
  \myword<3>{how}
  \myword<4>{much}
  \myword<5>{I}
  \myword<6>{love}
  \myword<7>{you}
\end{frame}

\end{document}

The idea is to set the word using \alt<slide>{<stuffA>}{<stuffB>} where <stuffA> is set in \textbf on slide <slide> and <stuffB> is set in a box of width \textbf{<stuffA>} on any other slide.

Werner
  • 603,163
  • Thanks Werner. You say this is a first step, but I think it does everything I need. This will get me the still images I need. From there it is all movie making stuff not related to latex (I think). – ryanGT Feb 05 '14 at 01:19
  • I am accepting your answer as doing everything I need to do in latex. From here I think it is just python to help me make copies of the images to determine how long each slide will hold at a certain fps rate and then I will use apple movie tools to do the rest. Thanks again. – ryanGT Feb 05 '14 at 15:03
  • @ryanGT: I used convert to create the animated GIF. See Converting beamer slides to animated images. You can adjust the frame rate using -delay <num>. – Werner Feb 05 '14 at 15:08
  • 1
    We also love you. ♥ :) – Paulo Cereda Feb 06 '14 at 06:41