emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Ihor Radchenko <yantar92@gmail.com>,
	Daniel Fleischer <danflscr@gmail.com>,
	Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: [BUG] beamer export
Date: Tue, 23 Jan 2024 16:58:24 +0000	[thread overview]
Message-ID: <87zfwwrnpt.fsf@t14.reltub.ca> (raw)
In-Reply-To: <87il3o5a0q.fsf@localhost> (Ihor Radchenko's message of "Sat, 20 Jan 2024 14:56:05 +0000")

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

On Sat, Jan 20 2024, Ihor Radchenko <yantar92@posteo.net> wrote:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> Leo Butler <Leo.Butler@umanitoba.ca> writes:
>>
>>> The following Org document shows a bug in the beamer exporter.
>>
>> Confirmed on main.
>
> I investigated further.

Thanks.

>
>> There are two bugs reported here:
>> 1. ox-latex export bug for src blocks containing direct LaTeX when
>>    org-latex-src-block-backend is set to its default 'verbatim value
>
> This appears to be Beamer-specific problem with verbatim environments:
> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>
> The solution might be to use [fragile] frame parameter, but that might
> have its own drawbacks:
> https://tex.stackexchange.com/questions/136240/drawbacks-of-using-fragile-frames-in-beamer

Yes, an *automatic* solution may create more problems than it solves.
Although, I do note that ox-beamer does mark some frames as fragile already.
I wonder how difficult it would be to add a property drawer to frames,
so (amongst other things), they could be marked fragile?

>
>> 2. ox-beamer export bug as described in the attached org file
>
> This is not a bug. When you specify ignoreheading environment, you imply
> that the contents of the heading is to be included as is.
> If you want the contents to become a column, you should specify column
> environment.

I see. That is not now the ignoreheading property is described. It says
[1]:

    ... As the text in the slide says, the left column is a list and the
    right one is an image. The left column's headline text is ignored,
    specified by =C-c C-b i= which tells org to *ignore* the headline
    text completely.

I think the documentation and example needs to be corrected. I have
attached a patch. I have also attached a revision of the original org
file with the bug report, and its export to pdf to demonstrate that the
revised example works as intended.

Best,
Leo

[1] worg/exporters/beamer/tutorial.org


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: beamer-bug.org --]
[-- Type: text/x-org; name="beamer-bug.org", Size: 3893 bytes --]

#+TITLE:     Writing Beamer presentations in org-mode
#+AUTHOR:    Eric S Fraga
#+AUTHOR:    (bug report by Leo Butler)
#+EMAIL:     e.fraga@ucl.ac.uk
#+DATE:      2010-03-30 Tue
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:2 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:https://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+HTML_LINK_UP:
#+HTML_LINK_HOME:
#+LATEX_COMPILER: lualatex
#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [bigger]
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %9BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)


* A Bug Report about the Beamer Tutorial

** 
:PROPERTIES:
:BEAMER_env: frame
:END:
#+begin_src elisp :exports both :results list
(list (emacs-version) (org-version))
#+end_src

#+RESULTS:
- GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0)
  of 2023-08-30, modified by Debian
- 9.6.10

** The bug
:PROPERTIES:
:BEAMER_env: frame
:END:
The [[https://orgmode.org/worg/exporters/beamer/tutorial.html][Beamer tutorial by Eric Fraga]]
([[https://orgmode.org/worg/exporters/beamer/tutorial.html]]) has an
example that shows how to create a two column frame using org. The example is incorrect, though, because it sets the =ignoreheading= property on the first column.

The following example removes that property and corrects a minor typo in the example.

** The Org code
:PROPERTIES:
:BEAMER_env: frame
:END:
Here is the org code.
\tiny
#+name: beamer-ex
#+begin_src org :exports both :results replace
  ,** Two columns
  ,*** A block                                          :BMCOL:
      :PROPERTIES:
      :BEAMER_col: 0.4
      :END:
      - this slide consists of two columns
      - the first (left) column has no heading and consists of text
      - the second (right) column has an image and is enclosed in an
	*example* block

  ,*** A screenshot                                            :BMCOL:B_example:
      :PROPERTIES:
      :BEAMER_col: 0.6
      :BEAMER_env: example
      :END:
      ,#+ATTR_LaTeX: :width \textwidth
      [[./a-simple-slide.png]]
#+end_src

#+RESULTS: beamer-ex
** Two columns
*** A block                                          :BMCOL:
    :PROPERTIES:
    :BEAMER_col: 0.4
    :END:
    - this slide consists of two columns
    - the first (left) column has no heading and consists of text
    - the second (right) column has an image and is enclosed in an
      *example* block

*** A screenshot                                            :BMCOL:B_example:
    :PROPERTIES:
    :BEAMER_col: 0.6
    :BEAMER_env: example
    :END:
    #+ATTR_LaTeX: :width \textwidth
    [[./a-simple-slide.png]]

** The \LaTeX{} code                                               :noexport:
Here is the generated \LaTeX{} code. I needed to add comment characters (%) to each line due to a bug in the =verbatim= environment.\pause
\tiny
#+begin_example
%\begin{frame}[label={sec:org8bc49cc}]{Two columns}
\begin{columns}
\begin{column}{0.4\columnwidth}
\begin{itemize}
\item this slide consists of two columns
\item the first (left) column has no heading and consists of text
\item the second (right) column has an image and is enclosed in an
\alert{example} block
\end{itemize}
\end{column}

\begin{column}{0.6\columnwidth}
\begin{example}[A screenshot]
\begin{center}
\includegraphics[width=\textwidth]{./a-simple-slide.png}
\end{center}
\end{example}
\end{column}
\end{columns}
%\end{frame}
#+end_example

\pause\normalsize
The first =itemize= environment should have been wrapped by a =column= environment inside the =columns= environment.

[-- Attachment #3: beamer-bug.pdf --]
[-- Type: application/pdf, Size: 100158 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0001-exporters-beamer-tutorial.org-fix-two-column-example.patch --]
[-- Type: text/x-diff; name="0001-exporters-beamer-tutorial.org-fix-two-column-example.patch", Size: 2456 bytes --]

From 77e2766f5fc5dda2118458f73a0b93ff1f1e6a38 Mon Sep 17 00:00:00 2001
From: Leo Butler <leo.butler@umanitoba.ca>
Date: Tue, 23 Jan 2024 10:49:21 -0600
Subject: [PATCH] exporters/beamer/tutorial.org: fix two column example

* exporters/beamer/tutorial.org: The ignoreheading environment causes
the column property to be ignored, which is opposite to the intent of
the Two columns example.  Remove that environment and the pertinent
comment in the paragraph following, so the example exports as
intended.  Fix a couple typos in the Org example itself.
---
 exporters/beamer/tutorial.org | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/exporters/beamer/tutorial.org b/exporters/beamer/tutorial.org
index fc32395f..f40425ed 100644
--- a/exporters/beamer/tutorial.org
+++ b/exporters/beamer/tutorial.org
@@ -198,31 +198,29 @@ column.  The following
 #+BEGIN_Example
 ,** Two columns
 
-,*** A block                                           :B_ignoreheading:BMCOL:
+,*** A block                                           :BMCOL:
     :PROPERTIES:
-    :BEAMER_env: ignoreheading
     :BEAMER_col: 0.4
     :END:
     - this slide consists of two columns
     - the first (left) column has no heading and consists of text
     - the second (right) column has an image and is enclosed in an
-      @example@ block
+      *example* block
 
 ,*** A screenshot                                            :BMCOL:B_example:
     :PROPERTIES:
     :BEAMER_col: 0.6
     :BEAMER_env: example
     :END:
-,    #+ATTR_LaTeX: :width \textwidth
-    [[file://../../images/org-beamer/a-simple-slide.png]]
+,#+ATTR_LaTeX: :width \textwidth
+[[file://../../images/org-beamer/a-simple-slide.png]]
 #+END_Example
 
 defines a two column slide.  As the text in the slide says, the left
 column is a list and the right one is an image.  The left column's
-headline text is ignored, specified by =C-c C-b i= which tells org to
-*ignore* the headline text completely.  The column on the right
-however is placed with an /example/ block (whose appearance will
-depend on the Beamer theme).
+headline text is ignored.  The column on the right however is placed
+with an /example/ block (whose appearance will depend on the Beamer
+theme).
 
 The columns also have widths.  By default, these widths are the
 proportion of the page width to use so I have specified 40% for the
-- 
2.43.0


  reply	other threads:[~2024-01-23 17:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28 19:46 [BUG] beamer export Leo Butler
2022-09-29  2:45 ` Ihor Radchenko
2022-09-29 18:43   ` Daniel Fleischer
2022-12-10 12:49     ` Ihor Radchenko
2024-01-20 14:56   ` Ihor Radchenko
2024-01-23 16:58     ` Leo Butler [this message]
2024-01-24 16:06       ` Ihor Radchenko
2024-01-25 16:13         ` Leo Butler
2024-01-26 11:45           ` Ihor Radchenko
2024-01-26 20:54             ` Leo Butler
2024-01-29 21:36               ` Leo Butler
2024-02-01 15:04                 ` Ihor Radchenko
2024-02-14 16:13                   ` Leo Butler
2024-02-19  9:42                     ` Ihor Radchenko
2024-02-20 20:41                       ` Leo Butler
2024-02-21 10:51                         ` Ihor Radchenko
2024-01-25 22:29         ` Leo Butler
2024-01-26 13:30           ` Ihor Radchenko

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=87zfwwrnpt.fsf@t14.reltub.ca \
    --to=leo.butler@umanitoba.ca \
    --cc=danflscr@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    --cc=yantar92@posteo.net \
    /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).