emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Fred <fred@SUNBOT.Homedns.ORG>
To: emacs-orgmode@gnu.org
Subject: Solution for changing background images with Beamer export
Date: Tue, 19 May 2015 11:05:09 -0700	[thread overview]
Message-ID: <201505191805.t4JI59E6009969@sunbot.homedns.org> (raw)


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

                 reply	other threads:[~2015-05-19 18:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201505191805.t4JI59E6009969@sunbot.homedns.org \
    --to=fred@sunbot.homedns.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).