From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fred Subject: Solution for changing background images with Beamer export Date: Tue, 19 May 2015 11:05:09 -0700 Message-ID: <201505191805.t4JI59E6009969@sunbot.homedns.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YultN-00023q-Fl for emacs-orgmode@gnu.org; Tue, 19 May 2015 14:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YultI-0000Fg-Ad for emacs-orgmode@gnu.org; Tue, 19 May 2015 14:05:25 -0400 Received: from resqmta-po-05v.sys.comcast.net ([96.114.154.164]:55381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YultI-0000EV-3p for emacs-orgmode@gnu.org; Tue, 19 May 2015 14:05:20 -0400 Received: from nova.sunbot.homedns.org (fred@nova [192.168.0.16]) (authenticated bits=0) by sunbot.homedns.org (8.15.1/8.14.9) with ESMTPSA id t4JI59E6009969 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 19 May 2015 11:05:10 -0700 (PDT) (envelope-from fred@sunbot.homedns.org) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello, I make a lot of presentations using Org Mode exporting to Beamer. One issue that came up is using transparent background images, or rather, changing background images during the presentation. That is, you want to do something like this: (background image image1.jpg) slide1 slide2 (background image image2.jpg) slide3 slide4 etc. The obvious way to do this was as follows: #+LaTeX_CLASS: beamer #+LaTeX_CLASS_OPTIONS: [presentation,14pt] #+BEAMER_THEME: Pittsburgh #+BEAMER_COLOR_THEME: orchid #+BEAMER_FONT_THEME: serif [stillsansserifsmall,stillsansseriflarge,structure] #+BEAMER_HEADER: \setbeamercolor{background canvas}{bg=} #+BEAMER_HEADER: \setbeamertemplate{navigation symbols}{} #+BEAMER_HEADER: \logo{\includegraphics{gng-logo.png}} #+BEAMER_HEADER: \usebackgroundtemplate{\includegraphics[width=\paperwidth]{images/image1.jpg}}% #+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra) #+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC #+OPTIONS: toc:nil h:1 <<<<<------Note frames at level 1 * Song1 %%%% stuff %%%% %%%% Trying to change background here %%%% #+BEAMER: \usebackgroundtemplate{\includegraphics[width=\paperwidth]{images/image2.jpg}}% * Song2 %%% etc. %%% With this approach the export won't work correctly (and it's completely understandable why not --- you only know where the old frame ends when you see the beginning of the new frame). Looking at the generated Latex, I see \usebackgroundtemplate{\includegraphics[width=\paperwidth]{images/image2.jpg}}% \end{frame} \begin{frame}[label=sec-5]{Song2} which basically does nothing as far as the background goes. I was hoping for: \end{frame} \usebackgroundtemplate{\includegraphics[width=\paperwidth]{images/image2.jpg}}% \begin{frame}[label=sec-5]{Song2} In my research on this I saw that a number of people had this problem and nobody seemed to know what to do. Turns out there's a simple workaround. Just put the frames one level deeper and do something like the following: %%%% set background in prologue using beamer command as above %%%% %%%% set frames at level 2 %%%% #+OPTIONS: ... :h 2 * Song1 (This is a dummy heading at least for my purposes) ** Song 1 slide 1 %%% stuff %%% ** Song 1 slide 2 %%% etc. %%% * Song2 (Dummy heading) #+BEAMER: \usebackgroundtemplate{\includegraphics[width=\paperwidth]{images/image2.jpg}}% ** Song 2 slide 1 %%% stuff %%% ** Song 2 slide 2 %%% etc. %%% * Song3 (Dummy heading) #+BEAMER: \usebackgroundtemplate{\includegraphics[width=\paperwidth]{images/image3.jpg}}% ** Song 3 slide 1 %%% stuff %%% ** Song 3 slide 2 %%% etc. %%% While this will affect the outlining and so on, it may nevertheless be useful in many cases. I hope this is useful to someone. -- Fred Gilham fred@sunbot.homedns.org just make me lighter make me lighter still 'til the yellow of the sun takes me [oh what Lazarus saw! I cannnot bear this anymore!] -- Linshuang Lu