emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Beamer export: Executing LaTeX between two frames
@ 2022-06-21  8:01 M. ‘quintus’ Gülker
  2022-06-22  9:35 ` Fraga, Eric
  0 siblings, 1 reply; 5+ messages in thread
From: M. ‘quintus’ Gülker @ 2022-06-21  8:01 UTC (permalink / raw)
  To: Org-mode

Dear list,

I am working on a presentation for a conference (using org-mode and its
beamer export) and want to exchange the entire background for a specific
frame with an image. This is possible with Beamer, see
<https://tex.stackexchange.com/a/7919>. It works by issueing
\usebackgroundtemplate /between/ the frame environments. The frame
environment needs to be placed inside an extra group of {}, resulting in
a LaTeX construct like this (example taken from the StackExchange link):

    % Local background must be enclosed by curly braces for grouping.
    {
    \usebackgroundtemplate{\includegraphics[width=\paperwidth]{kitten.jpg}}%
    \begin{frame}{Kitten}
    \begin{itemize}
    \item 1
    \item 2
    \item 3
    \end{itemize}
    \end{frame}
    }

I tried to use a #+begin_export beamer construct to achieve this from
within org:

    * Normal Frame

    #+begin_export beamer
    {\usebackgroundtemplate{%
        \includegraphics[width=\paperwidth,height=\paperheight]{test.jpg}}
        \begin{frame}[t]\frametitle{This frame should have another background}
        % ...frame content...
        \end{frame}
    }
    #+end_export

    * Normal frame again

But that results in a LaTeX compilation error, because the command is
not issued between to frames, but within the frame created for the
"Normal Frame" heading. Breaking the construct up in two #+begin_export
beamer constructs like this therefore also does not work, because the
second heading causes an \end{frame} to be inserted after the
\usebackgroundtemplate group has been opened:

    * Normal Frame

    #+begin_export beamer
    {\usebackgroundtemplate{%
        \includegraphics[width=\paperwidth,height=\paperheight]{test.jpg}}
    #+end_export

    * This frame should have another background

    #+begin_export beamer
    }
    #+end_export

    * Normal frame again

So, how do I wrap the \begin{frame}...\end{frame} construct within the
\usebackgroundtemplate group?

  -quintus

--
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@guelker.eu    | O<


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Beamer export: Executing LaTeX between two frames
  2022-06-21  8:01 Beamer export: Executing LaTeX between two frames M. ‘quintus’ Gülker
@ 2022-06-22  9:35 ` Fraga, Eric
  2022-06-26  4:17   ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Fraga, Eric @ 2022-06-22  9:35 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

On Tuesday, 21 Jun 2022 at 10:01, M. ‘quintus’ Gülker wrote:
> I am working on a presentation for a conference (using org-mode and its
> beamer export) and want to exchange the entire background for a specific
> frame with an image. This is possible with Beamer, see

This is a bit hacky but see attached file.  The trick is to end the
previous frame explicitly, create the frame with the desired background,
and then start explicitly a new frame but which is not shown in
presentation mode.

The ending of the previous frame is fragile as there may be other
environments that should be closed so you will have to be careful.

Hope this helps.

-- 
: Eric S Fraga, with org release_9.5.3-507-g4f0f24 in Emacs 29.0.50

[-- Attachment #2: b.org --]
[-- Type: application/vnd.lotus-organizer, Size: 445 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Beamer export: Executing LaTeX between two frames
  2022-06-22  9:35 ` Fraga, Eric
@ 2022-06-26  4:17   ` Ihor Radchenko
  2022-06-26 19:26     ` Fraga, Eric
  2023-01-07 17:43     ` M. ‘quintus’ Gülker
  0 siblings, 2 replies; 5+ messages in thread
From: Ihor Radchenko @ 2022-06-26  4:17 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Org-mode

"Fraga, Eric" <e.fraga@ucl.ac.uk> writes:

> On Tuesday, 21 Jun 2022 at 10:01, M. ‘quintus’ Gülker wrote:
>> I am working on a presentation for a conference (using org-mode and its
>> beamer export) and want to exchange the entire background for a specific
>> frame with an image. This is possible with Beamer, see
>
> This is a bit hacky but see attached file.  The trick is to end the
> previous frame explicitly, create the frame with the desired background,
> and then start explicitly a new frame but which is not shown in
> presentation mode.

This is too hacky as for my taste.

I'd rather use :ignore: tag from ox-extra:

* This is frame 1
* This is background wrapper, heading title ignored :ignore:
#+begin_export beamer
{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{kitten.jpg}}%
#+end_export
* This is frame 2
* This is background ending :ignore:
#+begin_export beamer
}
#+end_export

The above exports to

\begin{document}

\begin{frame}{Outline}
\tableofcontents
\end{frame}

\begin{frame}[label={sec:orgea52eac}]{This is frame 1}
\end{frame}
{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{kitten.jpg}}%
\begin{frame}[label={sec:org39b6485}]{This is frame 2}
\end{frame}
}
\end{document}

Best,
Ihor


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Beamer export: Executing LaTeX between two frames
  2022-06-26  4:17   ` Ihor Radchenko
@ 2022-06-26 19:26     ` Fraga, Eric
  2023-01-07 17:43     ` M. ‘quintus’ Gülker
  1 sibling, 0 replies; 5+ messages in thread
From: Fraga, Eric @ 2022-06-26 19:26 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode

On Sunday, 26 Jun 2022 at 12:17, Ihor Radchenko wrote:
> This is too hacky as for my taste.
>
> I'd rather use :ignore: tag from ox-extra:

Excellent.  I did not know that the ignore tag processing closed the
previous headline body as it seems to do given your example.  This
definitely makes things less hacky!

-- 
: Eric S Fraga, with org release_9.5.3-507-g4f0f24 in Emacs 29.0.50

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Beamer export: Executing LaTeX between two frames
  2022-06-26  4:17   ` Ihor Radchenko
  2022-06-26 19:26     ` Fraga, Eric
@ 2023-01-07 17:43     ` M. ‘quintus’ Gülker
  1 sibling, 0 replies; 5+ messages in thread
From: M. ‘quintus’ Gülker @ 2023-01-07 17:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Fraga, Eric, emacs-orgmode

Dear Ihor,

please apologise the slow reply.

Am Sonntag, dem 26. Juni 2022 schrieb Ihor Radchenko:
> This is too hacky as for my taste.
>
> I'd rather use :ignore: tag from ox-extra:

This works decently. I did not know about “ox-extra” before. For
reference, it is here: <https://git.sr.ht/~bzg/org-contrib/blob/master/lisp/ox-extra.el>

What I then did was:

    (require 'ox-extra)
    (ox-extras-activate '(ignore-headlines))

And then export to latex-beamer as usual. Just like Ihor described, the
two headings tagged “:ignore:” are suppressed from the output and the
“\usebackgroundtemplate” macro is properly wrapped around the
non-ignored heading.

Thank you Ihor.

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@guelker.eu    | O<


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-07 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21  8:01 Beamer export: Executing LaTeX between two frames M. ‘quintus’ Gülker
2022-06-22  9:35 ` Fraga, Eric
2022-06-26  4:17   ` Ihor Radchenko
2022-06-26 19:26     ` Fraga, Eric
2023-01-07 17:43     ` M. ‘quintus’ Gülker

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).