Re: [BUG] beamer export

2024-02-21 Thread Ihor Radchenko
Leo Butler  writes:

> Thanks for your comments.
>
> I think the attached patch addresses each of your points. It's not clear
> to me what you mean by "link(ing) this org-lint warning to the
> `org-beamer-frame-environment' docstring", but I have expanded the
> warning include mention of this variable.

Thanks!
Applied, onto main; with amendments:
- adjusted the commit message, removing the mention of
  `org-beamer--frame-environments'.
- fixed typos using incorrect variable name
  `org-beamer--frame-environment'.
- added etc/ORG-NEWS entry
- fixed compiler warnings
- re-worded org-lint warning, suggesting customizing
  `org-beamer-frame-environment'
- added :package-description and :safe keywords to defcustom

Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2024-02-20 Thread Leo Butler
On Mon, Feb 19 2024, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>>> What about not adding BEAMER_FRAME, but instead adding org-lint checker
>>> that will detect when frame text contains the problematic \end{orgframe}?
>>
>> Ok, thanks for your feedback. I have modified the patch along the lines
>> you suggested. It is attached.
>
> Thanks!
> It looks like you left over some parts from the previous patch version.
>
>> (org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME.
>
> ... like this.
>
>> (org-beamer--frame-environments): New variable and function.  The
>> variable holds a list of names of frame environments found while
>> formatting frames.  The function generates the LaTeX code to define
>> each new frame environment.
>> (org-beamer-template): Add a call to `org-beamer--frame-environments'
>> to insert the environment definitions into the beamer document.
>
> And since we only have a single alternative environment in this version
> of the patch, `org-beamer--frame-environments' does not appear to be
> necessary.
>
>> +(defcustom org-beamer-frame-environment "orgframe"
>> +  "Name of the beamer frame environment."
>> +  :group 'org-export-beamer
>> +  :type '(string :tag "Beamer frame"))
>
> It would be nice to provide a mode detailed explanation about the
> purpose of this custom option.
>
>> +(defun org-lint-beamer-frame (ast)
>> +  "Check for occurrences of begin or end frame."
>> +  (org-with-point-at ast
>> +(goto-char (point-min))
>> +(let (result)
>> +  (while (re-search-forward
>> +  (concat "\\(begin\\|end\\){" org-beamer-frame-environment 
>> "}") nil t)
>> +(push (list (match-beginning 0) "Beamer frame name may cause error 
>> when exporting.") result))
>> +  result)))
>
> ... and to link this org-lint warning to the
> `org-beamer-frame-environment' docstring.

Thanks for your comments.

I think the attached patch addresses each of your points. It's not clear
to me what you mean by "link(ing) this org-lint warning to the
`org-beamer-frame-environment' docstring", but I have expanded the
warning include mention of this variable.

Leo

From 70262bc2469536eeb3aaec926ec71530cfaeca79 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  customize the beamer frame environment
 name

* lisp/ox-beamer.el (org-beamer-frame-environment): A new customize
variable.  It contains the name of an environment that serves as an
alias for the beamer frame environment.

(org-beamer-template): Add a call to `org-beamer--frame-environments'
to insert the environment definitions into the beamer document.

* lisp/org-lint.el (org-lint-beamer-frame): Check the body of each
frame for an occurrence of \begin{orgframe} or \end{orgframe}, or
whatever environment name is in `org-beamer-frame-environment' [4].
The warning includes advice to see `org-beamer-frame-environment'.

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].

This solution also works with instances of \againframe.

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
[4] https://list.orgmode.org/orgmode/87il38i5tb.fsf@localhost/T/
---
 lisp/org-lint.el  | 15 +++
 lisp/ox-beamer.el | 28 
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index 4d2a55d15..91ee2eb2a 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -1507,6 +1507,17 @@ AST is the buffer parse tree."
  ((memq (org-element-property :type deadline) '(inactive inactive-range))
   (list (org-element-begin planning) "Inactive timestamp in DEADLINE will not appear in agenda."))
  (t nil))
+
+(defun org-lint-beamer-frame (ast)
+  "Check for occurrences of begin or end frame."
+  (org-with-point-at ast
+(goto-char (point-min))
+(let (result)
+  (while (re-search-forward
+  (concat "\\(begin\\|end\\){" org-beamer-frame-environment "}") nil t)
+(push (list (match-beginning 0) "Beamer frame name may cause error when exporting.  See `org-beamer--frame-environment'.") result))
+  result)))
+
 
 ;;; Checkers declaration
 
@@ -1787,6 +1798,10 @@ AST is the buffer parse tree."
   "Report $ that might be treated as LaTeX fragment boundary."
   #'org-lint-LaTeX-$-ambiguous
   :categories '(markup) :trust 'low)
+(org-lint-add-checker 'beamer-frame
+  "Report that frame text contains beamer frame environment."
+  #'org-lint-beamer-frame
+  :categories '(export) :trust 'low)
 (org-lint-add-checker 'timestamp-syntax
 

Re: [BUG] beamer export

2024-02-19 Thread Ihor Radchenko
Leo Butler  writes:

>> What about not adding BEAMER_FRAME, but instead adding org-lint checker
>> that will detect when frame text contains the problematic \end{orgframe}?
>
> Ok, thanks for your feedback. I have modified the patch along the lines
> you suggested. It is attached.

Thanks!
It looks like you left over some parts from the previous patch version.

> (org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME.

... like this.

> (org-beamer--frame-environments): New variable and function.  The
> variable holds a list of names of frame environments found while
> formatting frames.  The function generates the LaTeX code to define
> each new frame environment.
> (org-beamer-template): Add a call to `org-beamer--frame-environments'
> to insert the environment definitions into the beamer document.

And since we only have a single alternative environment in this version
of the patch, `org-beamer--frame-environments' does not appear to be
necessary.

> +(defcustom org-beamer-frame-environment "orgframe"
> +  "Name of the beamer frame environment."
> +  :group 'org-export-beamer
> +  :type '(string :tag "Beamer frame"))

It would be nice to provide a mode detailed explanation about the
purpose of this custom option.

> +(defun org-lint-beamer-frame (ast)
> +  "Check for occurrences of begin or end frame."
> +  (org-with-point-at ast
> +(goto-char (point-min))
> +(let (result)
> +  (while (re-search-forward
> +  (concat "\\(begin\\|end\\){" org-beamer-frame-environment 
> "}") nil t)
> +(push (list (match-beginning 0) "Beamer frame name may cause error 
> when exporting.") result))
> +  result)))

... and to link this org-lint warning to the
`org-beamer-frame-environment' docstring.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2024-02-14 Thread Leo Butler
On Thu, Feb 01 2024, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>> Replying to self: Attached is a patch that adds a property,
>> BEAMER_FRAME, that lets the frame environment name be set on a
>> frame-by-frame basis. In addition, it typesets any fragile frame in the
>> `orgframe' environment. I am not sure if the latter is really needed,
>> given the former.
>
> Thanks!
>
>> Comments?
>
> I am not a big fan of introducing a new BEAMER_FRAME option.
> We already have BEAMER_ENV.
>
> However, BEAMER_ENV is somewhat tricky for frame headings - ox-beamer
> allows special values of frame and fullframe (the latter is not fully
> documented) to allow frames nesting different from
> `org-beamer-frame-level'.

I experimented with BEAMER_ENV, but my impression is that that the code
for extracting a label is quite brittle. I may re-visit this option, but
not at this time.

>
> What about not adding BEAMER_FRAME, but instead adding org-lint checker
> that will detect when frame text contains the problematic \end{orgframe}?

Ok, thanks for your feedback. I have modified the patch along the lines
you suggested. It is attached.

Best,
Leo

From cc3e1572e354d18ce57c6a7b89b7fdd96b7fe1a8 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  customize the beamer frame environment
 name

* lisp/ox-beamer.el (org-beamer-frame-environment): A new customize
variable.  It contains the name of an environment that serves as an
alias for the beamer frame environment.

(org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME.
If set in the headline, use that as name of the frame environment.
Otherwise, in frames marked as fragile, the name of the frame
environment is taken from `org-beamer--frame-environment'.  In all
other frames, the default name is frame.  Unless the frame name is
"frame", the name is added to the list
`org-beamer--frame-environments'.

(org-beamer--frame-environments): New variable and function.  The
variable holds a list of names of frame environments found while
formatting frames.  The function generates the LaTeX code to define
each new frame environment.

(org-beamer-template): Add a call to `org-beamer--frame-environments'
to insert the environment definitions into the beamer document.

* lisp/org-lint.el (org-lint-beamer-frame): Check the body of each
frame for an occurrence of \begin{orgframe} or \end{orgframe}, or
whatever environment name is in `org-beamer-frame-environment' [4].

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].

This solution also works with instances of \againframe.

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
[4] https://list.orgmode.org/orgmode/87il38i5tb.fsf@localhost/T/
---
 lisp/org-lint.el  | 15 +++
 lisp/ox-beamer.el | 43 ---
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index f68aeab01..7248f687d 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -1446,6 +1446,17 @@ AST is the buffer parse tree."
  ((memq (org-element-property :type deadline) '(inactive inactive-range))
   (list (org-element-begin planning) "Inactive timestamp in DEADLINE will not appear in agenda."))
  (t nil))
+
+(defun org-lint-beamer-frame (ast)
+  "Check for occurrences of begin or end frame."
+  (org-with-point-at ast
+(goto-char (point-min))
+(let (result)
+  (while (re-search-forward
+  (concat "\\(begin\\|end\\){" org-beamer-frame-environment "}") nil t)
+(push (list (match-beginning 0) "Beamer frame name may cause error when exporting.") result))
+  result)))
+
 
 ;;; Checkers declaration
 
@@ -1711,6 +1722,10 @@ AST is the buffer parse tree."
   "Report $ that might be treated as LaTeX fragment boundary."
   #'org-lint-LaTeX-$-ambiguous
   :categories '(markup) :trust 'low)
+(org-lint-add-checker 'beamer-frame
+  "Report that frame text contains beamer frame environment."
+  #'org-lint-beamer-frame
+  :categories '(export) :trust 'low)
 (org-lint-add-checker 'timestamp-syntax
   "Report malformed timestamps."
   #'org-lint-timestamp-syntax
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 82c8841aa..65d8b06ef 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -149,9 +149,17 @@ which is replaced with the subtitle."
   :package-version '(Org . "8.3")
   :type '(string :tag "Format string"))
 
+(defcustom org-beamer-frame-environment "orgframe"
+  "Name of the beamer frame environment."
+  :group 

Re: [BUG] beamer export

2024-02-01 Thread Ihor Radchenko
Leo Butler  writes:

>   The docstring of `org-latex-classes' says:
>
>  The HEADER-STRING is the header that will be inserted into the
>  LaTeX file.  It should contain the \documentclass macro, and
>  anything else that is needed for this setup.
>
>   From that, I figured that would be the correct place to put that
>   \newenvironment command. I have moved it, as requested.

Yes, but org-latex-classes is a custom option. If user accidentally
deletes the \newenvironment command, things will not compile.

We generally prefer to keep things that we expect to remain constant out
of customizations.

> Replying to self: Attached is a patch that adds a property,
> BEAMER_FRAME, that lets the frame environment name be set on a
> frame-by-frame basis. In addition, it typesets any fragile frame in the
> `orgframe' environment. I am not sure if the latter is really needed,
> given the former.

Thanks!

> Comments?

I am not a big fan of introducing a new BEAMER_FRAME option.
We already have BEAMER_ENV.

However, BEAMER_ENV is somewhat tricky for frame headings - ox-beamer
allows special values of frame and fullframe (the latter is not fully
documented) to allow frames nesting different from
`org-beamer-frame-level'.

What about not adding BEAMER_FRAME, but instead adding org-lint checker
that will detect when frame text contains the problematic \end{orgframe}?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2024-01-29 Thread Leo Butler
On Fri, Jan 26 2024, Leo Butler  wrote:

> On Fri, Jan 26 2024, Ihor Radchenko  wrote:
>
>> Leo Butler  writes:
>>
 Apparently, LaTeX has really hard time processing verbatim code inside
 beamer frames.
>>>
>>> I looked again at the solution here:
>>> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>>>
>>> and it errors out with a recent version of pdflatex:
>>>
>>>This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
>>> (preloaded format=pdflatex)
>>>
>>> This is, apparently, a known problem:
>>>
>>> https://github.com/josephwright/beamer/issues/360
>>>
>>> The end of that issue report includes a work-around that we might apply
>>> in org. I have attached a patch for your feedback. The example that
>>> stimulated this discussion compiles with the patch and the testsuite
>>> shows no errors related to it.
>>
>> Thanks!
>> I have concerns about your approach though.
>>
>> You are replacing all the frame environments with custom environment
>> unconditionally. However, custom environment has downsides. For example,
>> \againframe will stop working, as pointed earlier in the linked beamer
>> thread
>> https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
>
> The comment that you are citing shows how to define the custom
> environment so that \againframe works correctly. See the attachment
> `beamer-example-againframe.tex' and pdf. You can see that \againframe
> works with the custom environment.
>
>>
>> Since the problem appears only when the frame contents contains
>> \end{frame}, it may be sufficient to replace the standard frame
>> environment with the workaround only in such scenario.
>
> Yes, that might be true. But my feeling is that it would be simpler and
> more robust to use the custom frame environment in most cases.

Replying to self: Attached is a patch that adds a property,
BEAMER_FRAME, that lets the frame environment name be set on a
frame-by-frame basis. In addition, it typesets any fragile frame in the
`orgframe' environment. I am not sure if the latter is really needed,
given the former.

Comments?

Leo

From d0117ca35405654c6adc003252eff5a1f629b67a Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  customize the beamer frame environment
 name

* lisp/ox-beamer.el (org-beamer-frame-environment): A new customize
variable that contains the name of an environment that serves as an
alias for the beamer frame environment.

(org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME.
If set in the headline, use that as name of the frame environment.
Otherwise, in frames marked as fragile, the name of the frame
environment is taken from `org-beamer--frame-environment'.  In all
other frames, the default name is frame.  Unless the frame name is
"frame", the name is added to the list
`org-beamer--frame-environments'.

(org-beamer--frame-environments): New variable and function.  The
variable holds a list of names of frame environments found while
formatting frames.  The function generates the LaTeX code to define
each new frame environment.

(org-beamer-template): Add a call to `org-beamer--frame-environments'
to insert the environment definitions into the beamer document.

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].  Since the frame
environment name is customize-able, beamer code generated by ox-beamer
can be included inside the verbatim environment, simply by changing
the frame environment name via the :BEAMER_FRAME property.

This solution also works with instances of \againframe.

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
---
 lisp/ox-beamer.el | 44 +---
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 82c8841aa..4a1e09b85 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -149,9 +149,17 @@ which is replaced with the subtitle."
   :package-version '(Org . "8.3")
   :type '(string :tag "Format string"))
 
+(defcustom org-beamer-frame-environment "orgframe"
+  "Name of the beamer frame environment."
+  :group 'org-export-beamer
+  :type '(string :tag "Beamer frame"))
+
 
 ;;; Internal Variables
 
+(defvar org-beamer--frame-environments '()
+  "List of beamer frame environments.")
+
 (defconst org-beamer-column-widths
   "0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.0 :ETC"
   "The column widths that should be installed as allowed property values.")
@@ -409,12 +417,17 @@ used 

Re: Re: [BUG] beamer export

2024-01-27 Thread Pedro Andres Aranda Gutierrez
Hi

CAVEAT EMPTOR: Although it’s some years that I have been using org to create my 
slides, I never needed this… Interesting to learn new things ;-) 

I personally would not oppose to have a customizable org-frame-environment 
variable, with its default value being “frame”. 
Then, when actually emitting the code, add something like:

(unless (string= org-frame-environment “frame”
 …)

Which would create the code most of us would expect (i.e. 
\begin{frame}…\end{frame}) in almost any case except when you really need the 
`newenvironment’ construct.

My .02 cents, /PA

> El 27 ene 2024, a las 18:00, emacs-orgmode-requ...@gnu.org escribió:
> 
> Message: 2
> Date: Fri, 26 Jan 2024 20:54:17 +
> From: Leo Butler mailto:leo.but...@umanitoba.ca>>
> To: Ihor Radchenko mailto:yanta...@posteo.net>>
> Cc: Ihor Radchenko mailto:yanta...@gmail.com>>, Daniel 
> Fleischer
>   mailto:danfl...@gmail.com>>, Org Mode Mailing List 
> mailto:emacs-orgmode@gnu.org>>
> Subject: Re: [BUG] beamer export
> Message-ID: <87wmrvlsso@t14.reltub.ca 
> <mailto:87wmrvlsso@t14.reltub.ca>>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> On Fri, Jan 26 2024, Ihor Radchenko  <mailto:yanta...@posteo.net>> wrote:
> 
>> Leo Butler mailto:leo.but...@umanitoba.ca>> writes:
>> 
>>>> Apparently, LaTeX has really hard time processing verbatim code inside
>>>> beamer frames.
>>> 
>>> I looked again at the solution here:
>>> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>>>  
>>> <https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim>
>>> 
>>> and it errors out with a recent version of pdflatex:
>>> 
>>>   This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
>>> (preloaded format=pdflatex)
>>> 
>>> This is, apparently, a known problem:
>>> 
>>> https://github.com/josephwright/beamer/issues/360 
>>> <https://github.com/josephwright/beamer/issues/360>
>>> 
>>> The end of that issue report includes a work-around that we might apply
>>> in org. I have attached a patch for your feedback. The example that
>>> stimulated this discussion compiles with the patch and the testsuite
>>> shows no errors related to it.
>> 
>> Thanks!
>> I have concerns about your approach though.
>> 
>> You are replacing all the frame environments with custom environment
>> unconditionally. However, custom environment has downsides. For example,
>> \againframe will stop working, as pointed earlier in the linked beamer
>> thread
>> https://github.com/josephwright/beamer/issues/360#issuecomment-708705250 
>> <https://github.com/josephwright/beamer/issues/360#issuecomment-708705250>
> 
> The comment that you are citing shows how to define the custom
> environment so that \againframe works correctly. See the attachment
> `beamer-example-againframe.tex' and pdf. You can see that \againframe
> works with the custom environment.
> 
>> 
>> Since the problem appears only when the frame contents contains
>> \end{frame}, it may be sufficient to replace the standard frame
>> environment with the workaround only in such scenario.
> 
> Yes, that might be true. But my feeling is that it would be simpler and
> more robust to use the custom frame environment in most cases.
> 
>> 
>>> +;; Needed to set-up Beamer export.
>>> +(defconst org-beamer--frame-environment
>>> +  (concat "orgframe" (org-id-uuid))
>>> +  "Name of the beamer frame environment.
>>> +This is randomized to prevent collisions.")
>> 
>> Please use constant name. (org-id-uuid) makes export randomized for no
>> good reason.
> 
> There is a good reason to randomize (or at least make customize-able)
> the environment name: so that beamer code generated by ox-beamer can be
> safely inserted into org files and exported by ox-beamer. With a fixed
> name for the environment, we will have just recreated the original
> source of the bug report. As a compromise, in the attached patch, I have
> made the environment name customize-able.
> 
>> 
>>> ;; Install a default set-up for Beamer export.
>>> (unless (assoc "beamer" org-latex-classes)
>>>   (add-to-list 'org-latex-classes
>>> -  '("beamer"
>>> -"\\documentclass[presentation]{beamer}"
>>> +  `("beamer&qu

Re: [BUG] beamer export

2024-01-26 Thread Leo Butler
On Fri, Jan 26 2024, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>>> Apparently, LaTeX has really hard time processing verbatim code inside
>>> beamer frames.
>>
>> I looked again at the solution here:
>> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>>
>> and it errors out with a recent version of pdflatex:
>>
>>This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
>> (preloaded format=pdflatex)
>>
>> This is, apparently, a known problem:
>>
>> https://github.com/josephwright/beamer/issues/360
>>
>> The end of that issue report includes a work-around that we might apply
>> in org. I have attached a patch for your feedback. The example that
>> stimulated this discussion compiles with the patch and the testsuite
>> shows no errors related to it.
>
> Thanks!
> I have concerns about your approach though.
>
> You are replacing all the frame environments with custom environment
> unconditionally. However, custom environment has downsides. For example,
> \againframe will stop working, as pointed earlier in the linked beamer
> thread
> https://github.com/josephwright/beamer/issues/360#issuecomment-708705250

The comment that you are citing shows how to define the custom
environment so that \againframe works correctly. See the attachment
`beamer-example-againframe.tex' and pdf. You can see that \againframe
works with the custom environment.

>
> Since the problem appears only when the frame contents contains
> \end{frame}, it may be sufficient to replace the standard frame
> environment with the workaround only in such scenario.

Yes, that might be true. But my feeling is that it would be simpler and
more robust to use the custom frame environment in most cases.

>
>> +;; Needed to set-up Beamer export.
>> +(defconst org-beamer--frame-environment
>> +  (concat "orgframe" (org-id-uuid))
>> +  "Name of the beamer frame environment.
>> +This is randomized to prevent collisions.")
>
> Please use constant name. (org-id-uuid) makes export randomized for no
> good reason.

There is a good reason to randomize (or at least make customize-able)
the environment name: so that beamer code generated by ox-beamer can be
safely inserted into org files and exported by ox-beamer. With a fixed
name for the environment, we will have just recreated the original
source of the bug report. As a compromise, in the attached patch, I have
made the environment name customize-able.

>
>>  ;; Install a default set-up for Beamer export.
>>  (unless (assoc "beamer" org-latex-classes)
>>(add-to-list 'org-latex-classes
>> -   '("beamer"
>> - "\\documentclass[presentation]{beamer}"
>> +   `("beamer"
>> + ,(concat "\\documentclass[presentation]{beamer}\n"
>> +  ;; Define an alias for the beamer frame 
>> environment
>> + "\\newenvironment<>{"
>> + org-beamer--frame-environment
>> + "}[1][]{\\begin{frame}[environment="
>> + org-beamer--frame-environment
>> + ",#1]}{\\end{frame}}")
>
> Please use `org-beamer-template' rather than modifying the class.
> Modifying the class may confuse users.

Ok, I have done so.

The docstring of `org-latex-classes' says:

The HEADER-STRING is the header that will be inserted into the
LaTeX file.  It should contain the \documentclass macro, and
anything else that is needed for this setup.

>From that, I figured that would be the correct place to put that
\newenvironment command. I have moved it, as requested.

Please see the revised patch. I believe that I have taken into account
your suggestions.

Leo

% Created 2024-01-26 Fri 11:42
% Intended LaTeX compiler: lualatex
\documentclass[bigger]{beamer}
\newenvironment<>{OrgFrame}[1][]{\begin{frame}[environment=OrgFrame,#1]}{\end{frame}}
\usetheme{default}

\begin{document}
\begin{OrgFrame}[label=repeatit,fragile]{Verbatim inside a Special Frame Environment}
\tiny
\begin{verbatim}
\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}
\end{verbatim}
\end{OrgFrame}

\againframe<2>{repeatit}
\end{document}


beamer-example-againframe.pdf
Description: beamer-example-againframe.pdf
From bfd182b9ca86c2db5cd514cad0a11fd3f5bd8934 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  customize the beamer frame environment
 name

* lisp/ox-beamer.el (org-beamer-frame-environment): new customize
variable that contains the name of an environment that serves as an
alias for the beamer frame environment.  The environment's definition
is appended 

Re: [BUG] beamer export

2024-01-26 Thread Ihor Radchenko
Leo Butler  writes:

> Attached is a second patch to de-lint the ox-beamer tutorial.

Thanks!
Applied, onto master.
https://git.sr.ht/~bzg/worg/commit/23c54e97

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2024-01-26 Thread Ihor Radchenko
Leo Butler  writes:

>> Apparently, LaTeX has really hard time processing verbatim code inside
>> beamer frames.
>
> I looked again at the solution here:
> https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim
>
> and it errors out with a recent version of pdflatex:
>
>This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
> (preloaded format=pdflatex)
>
> This is, apparently, a known problem:
>
> https://github.com/josephwright/beamer/issues/360
>
> The end of that issue report includes a work-around that we might apply
> in org. I have attached a patch for your feedback. The example that
> stimulated this discussion compiles with the patch and the testsuite
> shows no errors related to it.

Thanks!
I have concerns about your approach though.

You are replacing all the frame environments with custom environment
unconditionally. However, custom environment has downsides. For example,
\againframe will stop working, as pointed earlier in the linked beamer
thread
https://github.com/josephwright/beamer/issues/360#issuecomment-708705250

Since the problem appears only when the frame contents contains
\end{frame}, it may be sufficient to replace the standard frame
environment with the workaround only in such scenario.

> +;; Needed to set-up Beamer export.
> +(defconst org-beamer--frame-environment
> +  (concat "orgframe" (org-id-uuid))
> +  "Name of the beamer frame environment.
> +This is randomized to prevent collisions.")

Please use constant name. (org-id-uuid) makes export randomized for no
good reason.

>  ;; Install a default set-up for Beamer export.
>  (unless (assoc "beamer" org-latex-classes)
>(add-to-list 'org-latex-classes
> -'("beamer"
> -  "\\documentclass[presentation]{beamer}"
> +`("beamer"
> +  ,(concat "\\documentclass[presentation]{beamer}\n"
> +  ;; Define an alias for the beamer frame environment
> + "\\newenvironment<>{"
> + org-beamer--frame-environment
> + "}[1][]{\\begin{frame}[environment="
> + org-beamer--frame-environment
> + ",#1]}{\\end{frame}}")

Please use `org-beamer-template' rather than modifying the class.
Modifying the class may confuse users.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2024-01-25 Thread Leo Butler
On Wed, Jan 24 2024, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>> I think the documentation and example needs to be corrected. I have
>> attached a patch.
>
> Thanks! Applied.
> https://git.sr.ht/~bzg/worg/commit/aedea59f

Attached is a second patch to de-lint the ox-beamer tutorial.

Leo

From 7a52949ce25c7576896785ba185f9bd6afc7f12b Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Tue, 23 Jan 2024 11:23:18 -0600
Subject: [PATCH] exporters/beamer/tutorial.org: clean lint warnings

* exporters/beamer/tutorial.org:  convert the informal footnote
markers to Org footnotes.
---
 exporters/beamer/tutorial.org | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/exporters/beamer/tutorial.org b/exporters/beamer/tutorial.org
index f40425ed..ae1ec751 100644
--- a/exporters/beamer/tutorial.org
+++ b/exporters/beamer/tutorial.org
@@ -33,7 +33,7 @@ keybindings]].
 
 * First steps
 ** The export template
-Starting with an empty file called =presentation.org= [1], say, the
+Starting with an empty file called =presentation.org= [fn:1], say, the
 first step is to insert the default org export template (=C-c C-e #=
 with the default keybindings). This will generate something that looks
 like this (some specific entries will vary):
@@ -74,7 +74,7 @@ Beamer specific options.  The following options are what I use:
 
 The first line enables the Beamer specific commands for org-mode (more
 on this below); the next two tell the LaTeX exporter to use the
-Beamer class and to use the larger font settings[2].  
+Beamer class and to use the larger font settings[fn:2].
 
 ** Outline levels for frames (slides)
 
@@ -178,7 +178,7 @@ org-mode has a special beamer sub-mode which provides an easy to use
 method for specifying block types (and columns as well, as we shall
 [[*Column view for slide and block customisation][see in the next section]]).
 
-To specify the type of block, you can type =C-c C-b= [3].  This brings up
+To specify the type of block, you can type =C-c C-b= [fn:3].  This brings up
 a keyboard driven menu in which you type a single letter to select the
 option you wish to apply to this headline.  For the above example, I
 typed =C-c C-b t=.  The options selected in this manner are also shown
@@ -348,10 +348,10 @@ changed easily.  Please read [[https://orgmode.org/manual/Beamer-Export.html#Bea
 
 * Footnotes
 
-[1] [[https://orgmode.org/worg/sources/org-tutorials/org-beamer/presentation.org][A previously created example presentation]] is available.
+[fn:1] [[https://orgmode.org/worg/sources/org-tutorials/org-beamer/presentation.org][A previously created example presentation]] is available.
 
-[2] I am a firm believer in using the largest font possible to
+[fn:2] I am a firm believer in using the largest font possible to
 encourage less text on slides. This is obviously a personal view.
 
-[3] org-beamer-mode must be turned on for this keybinding to be available.
+[fn:3] org-beamer-mode must be turned on for this keybinding to be available.
 
-- 
2.43.0



Re: [BUG] beamer export

2024-01-25 Thread Leo Butler
On Wed, Jan 24 2024, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
 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?
>
> Hmm. Actually, that frame is already marked fragile.
> Yet, it is not enough...



> Apparently, LaTeX has really hard time processing verbatim code inside
> beamer frames.

I looked again at the solution here:

https://tex.stackexchange.com/questions/140719/verbatim-in-beamer-showing-error-file-ended-while-scanning-use-of-xverbatim

and it errors out with a recent version of pdflatex:

   This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) 
(preloaded format=pdflatex)

This is, apparently, a known problem:

https://github.com/josephwright/beamer/issues/360

The end of that issue report includes a work-around that we might apply
in org. I have attached a patch for your feedback. The example that
stimulated this discussion compiles with the patch and the testsuite
shows no errors related to it.

>
 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.
>
> Thanks! Applied.
> https://git.sr.ht/~bzg/worg/commit/aedea59f

Thanks. I can see the commit on master in git, but the webpage seems to
be unchanged.

https://orgmode.org/worg/exporters/beamer/tutorial.html

Leo

From 9cb3489e3fe80fb2e3996b737f528aa4db9ba62d Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  randomize the beamer frame environment

* lisp/ox-beamer.el (org-beamer--frame-environment): new variable that
contains the name of an environment that serves as an alias for the
beamer frame environment.  The environment's definition is appended to
the set-up for beamer export.

(org-beamer--format-frame):  Replace the occurrence of \begin{frame}
and \end{frame} with the new environment's name.

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
---
 lisp/ox-beamer.el | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 82c8841aa..be3003835 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -36,11 +36,23 @@
 (require 'cl-lib)
 (require 'ox-latex)
 
+;; Needed to set-up Beamer export.
+(defconst org-beamer--frame-environment
+  (concat "orgframe" (org-id-uuid))
+  "Name of the beamer frame environment.
+This is randomized to prevent collisions.")
+
 ;; Install a default set-up for Beamer export.
 (unless (assoc "beamer" org-latex-classes)
   (add-to-list 'org-latex-classes
-	   '("beamer"
-		 "\\documentclass[presentation]{beamer}"
+	   `("beamer"
+		 ,(concat "\\documentclass[presentation]{beamer}\n"
+  ;; Define an alias for the beamer frame environment
+ "\\newenvironment<>{"
+ org-beamer--frame-environment
+ "}[1][]{\\begin{frame}[environment="
+ org-beamer--frame-environment
+ ",#1]}{\\end{frame}}")
 		 ("\\section{%s}" . "\\section*{%s}")
 		 ("\\subsection{%s}" . "\\subsection*{%s}")
 		 

Re: [BUG] beamer export

2024-01-24 Thread Ihor Radchenko
Leo Butler  writes:

>>> 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?

Hmm. Actually, that frame is already marked fragile.
Yet, it is not enough...
Apparently, LaTeX has really hard time processing verbatim code inside
beamer frames.

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

Thanks! Applied.
https://git.sr.ht/~bzg/worg/commit/aedea59f

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2024-01-20 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Leo Butler  writes:
>
>> The following Org document shows a bug in the beamer exporter.
>
> Confirmed on main.

I investigated further.

> 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

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

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2022-12-10 Thread Ihor Radchenko
Daniel Fleischer  writes:

> Hi, I'm on vacation for the next month. I can look at it when I'm back.

There is no activity in this thread for over one month.
Bumping.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Beamer export fails with async export [9.5.3 (9.5.3-g4197fc @ /home/thomas/.emacs.d/straight/build/org/)]

2022-10-21 Thread Ihor Radchenko
Thomas Freeman  writes:

> When exporting a LaTeX beamer presentation as an asynchronous process
> (by using C-a prior to selecting the export option), the export fails with 
> the following error:
>
> (error "Unknown \"nil\" back-end: Aborting export")

Could you please provide detailed steps how to reproduce the problem
together with a sample beamer presentation file?
See https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] beamer export

2022-09-29 Thread Daniel Fleischer
Hi, I'm on vacation for the next month. I can look at it when I'm back.

On Thu, Sep 29, 2022, 03:44 Ihor Radchenko  wrote:

> Leo Butler  writes:
>
> > The following Org document shows a bug in the beamer exporter.
>
> Confirmed on main.
>
> 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
> 2. ox-beamer export bug as described in the attached org file
>
> Daniel, can you please take a look at the first bug?
> I suspect that \commands should be additionally escaped in verbatim
> environment, similar to
>
> https://stackoverflow.com/questions/3019774/how-write-this-in-verbatim-latex
>
> --
> Ihor Radchenko,
> Org mode contributor,
> Learn more about Org mode at https://orgmode.org/.
> Support Org development at https://liberapay.com/org-mode,
> or support my work at https://liberapay.com/yantar92
>


Re: [BUG] beamer export

2022-09-28 Thread Ihor Radchenko
Leo Butler  writes:

> The following Org document shows a bug in the beamer exporter.

Confirmed on main.

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
2. ox-beamer export bug as described in the attached org file

Daniel, can you please take a look at the first bug?
I suspect that \commands should be additionally escaped in verbatim
environment, similar to
https://stackoverflow.com/questions/3019774/how-write-this-in-verbatim-latex

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



[BUG] beamer export

2022-09-28 Thread Leo Butler
The following Org document shows a bug in the beamer exporter.

#+TITLE: Writing Beamer presentations in org-mode
#+AUTHOR:Eric S Fraga
#+AUTHOR:(bug report by Leo Butler)
#+EMAIL: e.fr...@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

** 
#+begin_src elisp :exports both
(org-version)
#+end_src

#+RESULTS:
: 9.5.2

** The bug
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
first column is not identified, though.

** The Org code
Here is the org code.
\tiny
#+begin_src org :exports code
  ,** Two columns
  ,*** A block   :B_ignoreheading: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

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

** The \LaTeX{} code
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_src latex :exports code
  % \begin{frame}[label={sec:orgcc0ebff}]{Two columns}
  % \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
  % @example@ block
  % \end{itemize}

  % \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_src
\pause\normalsize
The first =itemize= environment should have been wrapped by a =column= 
environment inside the =columns= environment.


[BUG] Beamer export fails with async export [9.5.3 (9.5.3-g4197fc @ /home/thomas/.emacs.d/straight/build/org/)]

2022-06-08 Thread Thomas Freeman


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


When exporting a LaTeX beamer presentation as an asynchronous process
(by using C-a prior to selecting the export option), the export fails with the 
following error:

(error "Unknown \"nil\" back-end: Aborting export")

This does not occur when exporting the same buffer to HTML or to
standard LaTeX. What should happen is that the export occurs in the
background just as it would when run in the foreground. This is
especially frustrating if org-export-in-background is set to t by
default.

Details of my setup are below:

Emacs  : GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, 
cairo version 1.16.0)
Package: Org mode version 9.5.3 (9.5.3-g4197fc @ 
/home/thomas/.emacs.d/straight/build/org/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/Dropbox/gtd"
 org-cite-insert-processor 'citar
 org-hide-emphasis-markers t
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-log-into-drawer t
 org-agenda-files '("~/Dropbox/gtd")
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-refile-targets '((org-agenda-files :maxlevel . 3))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-default-notes-file "~/Dropbox/gtd/inbox.org"
 org-refile-use-outline-path 'file
 org-publish-timestamp-directory "/home/thomas/.emacs.d/var/org/timestamps/"
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cite-follow-processor 'citar
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-cycle-optimize-window-after-visibility-change)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-font-lock-set-keywords-hook '(doom-themes-enable-org-fontification)
 org-modules '(ol-bbdb ol-bibtex ol-docview ol-doi org-habit)
 org-mode-hook '(#[0 "\301\211\207"
   [imenu-create-index-function org-imenu-get-tree] 2]
 org-superstar-mode visual-line-mode turn-on-flyspell
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-fold-show-all append
local]
   5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all
append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
 olivetti-mode mixed-pitch-mode org-eldoc-load)
 org-babel-load-languages '((awk . t) (calc . t) (css . t) (emacs-lisp . t)
(eshell . t) (gnuplot . t) (dot . t) (latex . t)
(ledger . t) (octave . t) (plantuml . t) (R . t)
(sed . t) (shell . t))
 org-id-locations-file "/home/thomas/.emacs.d/var/org/id-locations.el"
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-stuck-projects '("+project/-MAYBE-DONE" ("NEXT" "TODO") nil "\\")
 org-startup-indented t
 org-latex-classes '(("beamer" "\\documentclass[presentation]{beamer}"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
 ("article" "\\documentclass[11pt]{article}"
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  ("\\paragraph{%s}" . "\\paragraph*{%s}")
  ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
 ("report" "\\documentclass[11pt]{report}"
  ("\\part{%s}" . "\\part*{%s}")
  ("\\chapter{%s}" . "\\chapter*{%s}")
  ("\\section{%s}" . "\\section*{%s}")
  ("\\subsection{%s}" . "\\subsection*{%s}")
  ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
 ("book" 

Re: [BUG] beamer export -- text inside section, before next headline, has no frame [9.5.2 (9.5.2-ge7ea95 @ /home/hugo/.config/emacs/straight/build/org/)]

2022-02-04 Thread Eric S Fraga
Dear Hugo,

On Thursday,  3 Feb 2022 at 17:26, Hugo Heagren wrote:
> I have org-beamer-frame-level set to 2, so when exporting to beamer,
> top-level headlines become sections, and second-level headlines become
> frames. I often want to include a short explanation/intro of the
> section, before moving onto the more specific slide (I have found this
> is good for complex lectures).

But if you want that short explanation to be on a slide, simply use a
second level heading, e.g. "** Introduction to the section"?  Beamer
does not have a distinction in "levels" of slides/frames and it would
not make sense to have top level (section) text be a slide.

-- 
: Eric S Fraga, with org release_9.5.2-364-ge7ea95 in Emacs 29.0.50



[BUG] beamer export -- text inside section, before next headline, has no frame [9.5.2 (9.5.2-ge7ea95 @ /home/hugo/.config/emacs/straight/build/org/)]

2022-02-03 Thread Hugo Heagren
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good
report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
-
---

I have org-beamer-frame-level set to 2, so when exporting to beamer,
top-level headlines become sections, and second-level headlines become
frames. I often want to include a short explanation/intro of the
section, before moving onto the more specific slide (I have found this
is good for complex lectures).

So I have something like:

```org
* A section
This is in the section, but not in the subsection (and is therefore
not in a frame, and shows up at the top of the slide).

** A subsection
Some text in the subsection. This /is/ in a frame, and so behaves
correctly.
```

As the MWE says, the text inside the top-level (section) headline, but
before the next (frame) headline, is not wrapped in a frame environment
when exported, so it renders strangely (at the top of the slide).

I feel like this is an easy fix for someone who understands the
exporter
code well. I've had a look and it's very complex, but I would be
grateful if someone else could try.

emacs  : GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.5, cairo version 1.16.0)
 of 2022-01-15
Package: Org mode version 9.5.2 (9.5.2-ge7ea95 @
/home/hugo/.config/emacs/straight/build/org/)

Blue skies, Hugo

Appendix.
-

I tested the above MWE with the following minimal init.el and
reproduced the bug (well, it's minimal for me, since I'm used to using
straight and use-package, and didn't want to learn any other way of
installing all this stuff just to check a bug):

```elisp
(defvar bootstrap-version)
(let ((bootstrap-file
   (expand-file-name "straight/repos/straight.el/bootstrap.el"
user-emacs-directory))
  (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
 "
https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el
"
 'silent 'inhibit-cookies)
  (goto-char (point-max))
  (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; Always integrate straight.el with use-package
(setq straight-use-package-by-default t)

;; Actually INSTALL use-package
(straight-use-package 'use-package)

(use-package org
  :straight (:includes ox-beamer))

(use-package ox-beamer
  :after org
  :config
  (add-to-list 'org-latex-classes
   `("beamer"
 ,(concat "\\documentclass[presentation]{beamer}\n"
  "[DEFAULT-PACKAGES]"
  "[PACKAGES]"
  "[EXTRA]\n")
 ("\\section{%s}" . "\\section*{%s}")
 ("\\subsection{%s}" . "\\subsection*{%s}")
 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
  :custom
  (org-beamer-frame-level 2))
```




Re: [O] Bug: Beamer export error

2017-08-13 Thread Jarmo Hurri
Rasmus  writes:

> It should be fixed by commit 323fc95b4.

Thank you very much, seems to be in order again.

Jarmo




Re: [O] Bug: Beamer export error

2017-08-10 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> It should be fixed by commit 323fc95b4.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Beamer export error

2017-08-10 Thread Rasmus
Nicolas Goaziou  writes:

> Hello,
>
> Rasmus  writes:
>
>> This is caused by this commit, which changes how org-split-string works.
>>
>> f776e65373fa135fffb51e201698823fbfb3865b
>>
>> Before (org-split-string "" ",") would return ‘nil’.  Now it returns "".
>>
>> Depending on whether the new behavior is desired or not, the fix should
>> either be in ‘org-split-string’ or in ‘org-beamer--format-frame’.  I’ll
>> wait for Nicolas’ verdict.
>
> I think the new behaviour is correct, because it is equivalent to
>
>   (split-string "" ",")
>
> Do you want to fix it?

It should be fixed by commit 323fc95b4.

Thanks,
Rasmus

-- 
Tack, ni svenska vakttorn. Med plutonium tvingar vi dansken på knä!




Re: [O] Bug: Beamer export error

2017-08-10 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> This is caused by this commit, which changes how org-split-string works.
>
> f776e65373fa135fffb51e201698823fbfb3865b
>
> Before (org-split-string "" ",") would return ‘nil’.  Now it returns "".
>
> Depending on whether the new behavior is desired or not, the fix should
> either be in ‘org-split-string’ or in ‘org-beamer--format-frame’.  I’ll
> wait for Nicolas’ verdict.

I think the new behaviour is correct, because it is equivalent to

  (split-string "" ",")

Do you want to fix it?

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Beamer export error

2017-08-09 Thread Rasmus
Hi Jarmo,

Thanks for your report.

Jarmo Hurri  writes:

> I get an error (pdflatex hangs up) when trying to Beamer export the
> following simple Org file (key command C-c C-e l O).
>
> # -
>
> #+STARTUP: beamer
>
> * This is a simple test
>   - let us see what happens
> # -
>
> I have traced the issue to the extra comma in the following line in the
> exported TeX file:
>
> \begin{frame}[,label={sec:org03f80c8}]{This is a simple test}
>
> If you remove the extra comma, then the file compiles just fine.

This is caused by this commit, which changes how org-split-string works.

f776e65373fa135fffb51e201698823fbfb3865b

Before (org-split-string "" ",") would return ‘nil’.  Now it returns "".

Depending on whether the new behavior is desired or not, the fix should
either be in ‘org-split-string’ or in ‘org-beamer--format-frame’.  I’ll
wait for Nicolas’ verdict.

For now, if necessary, you can hot-patch the function in ox-beamer.el to
something like,

(options (cl-remove-if-not 'org-string-nw-p (append ...)))

Rasmus

-- 
Vote for proprietary math!




Re: [O] Bug: Beamer export error

2017-08-09 Thread Jarmo Hurri

While the bug is being fixed, here is a quick band-aid for anyone else
struggling with this problem.

1. When the export hangs up, press C-g to interrupt.
2. Run the following on the intermediate tex file, here exported.tex :
   sed -i 's/\[,/\[/g' exported.tex
3. Run pdflatex by hand:
   pdflatex exported.tex

Jarmo





[O] Bug: Beamer export error

2017-08-09 Thread Jarmo Hurri

Greetings.

I get an error (pdflatex hangs up) when trying to Beamer export the
following simple Org file (key command C-c C-e l O).

# -
#+STARTUP: beamer

* This is a simple test
  - let us see what happens
# -

I have traced the issue to the extra comma in the following line in the
exported TeX file:

\begin{frame}[,label={sec:org03f80c8}]{This is a simple test}

If you remove the extra comma, then the file compiles just fine.

Thanks in advance!

Jarmo




Re: [O] BUG: beamer export and overlay specifications for nested list

2014-02-25 Thread Nicolas Goaziou
Hello,

Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 there seems to be a bug that becomes apparent when overlay
 specifications are given to items in sublists.

This should be fixed. Thank you for reporting it.


Regards,

-- 
Nicolas Goaziou



Re: [O] BUG: beamer export and overlay specifications for nested list

2014-02-25 Thread Andreas Leha
Hi Nicolas,

Nicolas Goaziou n.goaz...@gmail.com writes:

 Hello,

 Andreas Leha andreas.l...@med.uni-goettingen.de writes:

 there seems to be a bug that becomes apparent when overlay
 specifications are given to items in sublists.

 This should be fixed. Thank you for reporting it.

Thank you very much for the quick fix.  I can confirm that it working.

Regards,
Andreas




[O] BUG: beamer export and overlay specifications for nested list

2014-02-24 Thread Andreas Leha
Hi all,

there seems to be a bug that becomes apparent when overlay
specifications are given to items in sublists.

Here is an example:

--8---cut here---start-8---
#+TITLE: Example Presentation
#+AUTHOR: Carsten Dominik
#+OPTIONS: H:2
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Madrid
#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) 
%8BEAMER_OPT(Opt)

* This is the first structural section

** Frame 1

- @@beamer:1-@@ First Item
  - @@beamer:only@1@@ First Subitem
  - @@beamer:only@2@@ Second Subitem
- @@beamer:3-@@ Second Item
--8---cut here---end---8---


And the relevant part of the exported tex file:

--8---cut here---start-8---
\begin{itemize}
\item1- First Item
\begin{itemize}
\item1-only@1 First Subitem
\item1-only@2 Second Subitem
\end{itemize}
\item3- Second Item
\end{itemize}
--8---cut here---end---8---


This should be:

--8---cut here---start-8---
\begin{itemize}
\item1- First Item
\begin{itemize}
\itemonly@1 First Subitem
\itemonly@2 Second Subitem
\end{itemize}
\item3- Second Item
\end{itemize}
--8---cut here---end---8---


Regards,
Andreas




Re: [O] Fwd: [bug] Beamer export fails in current master

2014-01-18 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 Quite strange. I just moved up to current master -- Org-mode version
 8.2.5f (release_8.2.5f-518-gd74205 @
 /home/dlm/share/org-mode.git/lisp/) -- HEAD is:

 ~~
 commit d74205b0f9e0707642c7b81e1c33a4a059323bea
 Author: Nicolas Goaziou n.goaz...@gmail.com
 Date:   Fri Jan 17 23:05:20 2014 +0100

ox-koma-letter: Improve defcustom docstrings
 ~~

 Now, with a simple org file, just a few frames, C-c C-e l B finishes
 successfully. With my full presentation, I get a different error [1].

 Moreover, I wanted to see if the :noexport: tags had something to do
 with it, so I hit shift-tab twice to show all and then
 M-S-5 :noexport: RET RET, then ! to replace all. It completed the
 second replacement (third top-level heading) and threw another error
 related to org-element--cache [2].

I cannot reproduce the problems. Something seems to go wrong with your
`avl-tree' library. Is it loaded properly? Do you use an old Emacs?


Regards,

-- 
Nicolas Goaziou



Re: [O] Fwd: [bug] Beamer export fails in current master

2014-01-18 Thread James Harkins
On Jan 19, 2014 12:32 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 I cannot reproduce the problems. Something seems to go wrong with your
 `avl-tree' library. Is it loaded properly? Do you use an old Emacs?

I see -- so, when I said it's broken in my environment, the operative words
are in my environment.

I'm on emacs 23.something (whatever apt-get serves up for Ubuntu 12.04).
That could be the problem.

I'm in the middle of a big presentation/publishing project, so I think for
now I should heed the usual advice not to muck about with a working
configuration while in production. Emacs 23 + org 8.2.4 is working fine for
me, so I'll stay with that until this project is finished. *Probably* the
upgrade would be fine, but if it's not, I couldn't afford the downtime to
fix it.

I'll add a TODO to test an emacs upgrade later.

Thanks for testing!
hjh


Re: [O] Fwd: [bug] Beamer export fails in current master

2014-01-17 Thread James Harkins

On Thursday, January 16, 2014 5:29:32 AM HKT, Nicolas Goaziou wrote:

I see nothing wrong in that process. Can you still reproduce the error
with latest Org?


Quite strange. I just moved up to current master -- Org-mode version 
8.2.5f (release_8.2.5f-518-gd74205 @ /home/dlm/share/org-mode.git/lisp/) 
-- HEAD is:


~~
commit d74205b0f9e0707642c7b81e1c33a4a059323bea
Author: Nicolas Goaziou n.goaz...@gmail.com
Date:   Fri Jan 17 23:05:20 2014 +0100

   ox-koma-letter: Improve defcustom docstrings
~~

Now, with a simple org file, just a few frames, C-c C-e l B finishes 
successfully. With my full presentation, I get a different error [1].


Moreover, I wanted to see if the :noexport: tags had something to do with 
it, so I hit shift-tab twice to show all and then M-S-5 :noexport: RET RET, 
then ! to replace all. It completed the second replacement (third 
top-level heading) and threw another error related to org-element--cache 
[2].


You can get my files at:

https://github.com/jamshark70/scweek2014

The one I was trying to export is ./shows/01-intro/01-contents.org. To 
produce the .tex file, you'll also need ./shows/slidehead.org and 
./shows/glossary.org.


It's not especially pressing -- I can keep using org 8.2.4. But, for 
whatever reason, org element cache seems to be broken in my environment.


hjh

[1]
Debugger entered--Lisp error: (wrong-number-of-arguments #[(tree data) 
\303\304H	\204
[tree cl-struct-avl-tree--tags data avl-tree--do-delete 0 error 
avl-tree--cmpfun accessing a non-avl-tree- 2 avl-tree--dummyroot 
accessing a non-avl-tree- 1] 5 
(/usr/share/emacs/23.3/lisp/emacs-lisp/avl-tree.elc . 14229)] 4)
 avl-tree-delete([cl-struct-avl-tree- nil nil ... 0] [nil nil ... 0] 
... 0] [nil [nil nil ... 0] ... 1] ... 0] nil nil 0] 
org-element--cache-compare] (keyword (:key EMAIL :value  :begin 130 
:end 141 :post-blank 1 :post-affiliated 130 :parent nil)) nil t)
 (cond ((not data) (throw ... t)) (( ... end) nil) (t (setq end ...) 
(avl-tree-delete org-element--cache data nil t)))
 (let ((node ...) data) (while node (let* ... ...)) (cond (... ...) (... 
nil) (t ... ...)))

 (while (let (... data) (while node ...) (cond ... ... ...)))
 (let ((beg ...)) (while (let ... ... ...)))
 (let ((inhibit-quit t) (offset ...) (end ...)) (let (...) (while ...)) 
(unless (zerop offset) (catch ... ...)))

 (catch (quote escape) (let (... ... ...) (let ... ...) (unless ... ...)))
 (progn (catch (quote escape) (let ... ... ...)) 
(org-element--cache-cancel-changes))
 (if (org-element--cache-pending-changes-p) (progn (catch ... ...) 
(org-element--cache-cancel-changes)))
 (when (org-element--cache-pending-changes-p) (catch (quote escape) (let 
... ... ...)) (org-element--cache-cancel-changes))
 (save-current-buffer (set-buffer buffer) (when 
(org-element--cache-pending-changes-p) (catch ... ...) 
(org-element--cache-cancel-changes)))
 (with-current-buffer buffer (when (org-element--cache-pending-changes-p) 
(catch ... ...) (org-element--cache-cancel-changes)))

 (progn (with-current-buffer buffer (when ... ... ...)))
 (if (buffer-live-p buffer) (progn (with-current-buffer buffer ...)))
 (when (buffer-live-p buffer) (with-current-buffer buffer (when ... ... 
...)))

 org-element--cache-sync(#buffer 01-contents.org2)
 (progn (org-element--cache-sync (current-buffer)))
 (if (and (not ignore-changes) (org-element--cache-pending-changes-p)) 
(progn (org-element--cache-sync ...)))
 (when (and (not ignore-changes) (org-element--cache-pending-changes-p)) 
(org-element--cache-sync (current-buffer)))
 (progn (when (and ... ...) (org-element--cache-sync ...)) (if (not ...) 
(gethash key org-element--cache-objects) (let ... ...)))
 (if (and org-element-use-cache org-element--cache) (progn (when ... ...) 
(if ... ... ...)))
 (when (and org-element-use-cache org-element--cache) (when (and ... ...) 
(org-element--cache-sync ...)) (if (not ...) (gethash key 
org-element--cache-objects) (let ... ...)))

 org-element-cache-get(3203)
 (let* ((cached ...) (begin ...)) (cond (... ... ... ...) (... ...) (... 
... ... ...) (t ...)))
 (let ((origin ...) element next) (end-of-line) (skip-chars-backward  
	\n) (cond (... ...) (... ... ...)) (goto-char origin) (let* (... ...) 
(cond ... ... ... ...)) (let (... parent special-flag) (while t ... ... 
...)))
 (save-restriction (widen) (let (... element next) (end-of-line) 
(skip-chars-backward  
	\n) (cond ... ...) (goto-char origin) (let* ... ...) (let ... ...)))
 (save-excursion (save-restriction (widen) (let ... ... ... ... ... ... 
...)))
 (org-with-wide-buffer (let (... element next) (end-of-line) 
(skip-chars-backward  
	\n) (cond ... ...) (goto-char origin) (let* ... ...) (let ... ...)))
 (catch (quote exit) (org-with-wide-buffer (let ... ... ... ... ... ... 
...)))

 org-element-at-point()
 (progn (org-element-at-point))
 (unwind-protect (progn (org-element-at-point)) (set-match-data 
save-match-data-internal (quote evaporate)))
 (let ((save-match-data-internal ...)) 

Re: [O] Fwd: [bug] Beamer export fails in current master

2014-01-15 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 Fine thought, but my bisect regimen went something like this:

 1. Delete all elc files from the location from which I'm loading org.

 2. Quit emacs.

 3. At every bisect step, launch Emacs fresh with emacs
 /path/to/test-file.org and then do nothing except C-c C-e l B. Then
 quit Emacs.

 4. If I got the error, git bisect bad. If I got an export buffer of
 LaTeX code, git bisect good.

 When I got the error, it was always consistently reproducible for that
 revision, and it was always enough to launch Emacs, open the file and
 try the export, no fancy other things to mess up the cache.

I see nothing wrong in that process. Can you still reproduce the error
with latest Org?


Regards,

-- 
Nicolas Goaziou



Re: [O] [bug] Beamer export fails in current master

2014-01-11 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 I just started to work on the issue of wrapping the title command in beamer 
 export within a frame, but found that I can't export to Beamer at all in 
 the master branch (after pulling just today).

You need to restart Emacs.


Regards,

-- 
Nicolas Goaziou



[O] Fwd: [bug] Beamer export fails in current master

2014-01-11 Thread James Harkins
Sorry, gmail's reply by default includes only the sender, not the list...
hjh


-- Forwarded message --
From: James Harkins jamshar...@gmail.com
Date: Sat, Jan 11, 2014 at 5:42 PM
Subject: Re: [bug] Beamer export fails in current master
To: Nicolas Goaziou n.goaz...@gmail.com


On Sat, Jan 11, 2014 at 4:25 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Hello,

 James Harkins jamshar...@gmail.com writes:

 I just started to work on the issue of wrapping the title command in beamer
 export within a frame, but found that I can't export to Beamer at all in
 the master branch (after pulling just today).

 You need to restart Emacs.

Fine thought, but my bisect regimen went something like this:

1. Delete all elc files from the location from which I'm loading org.

2. Quit emacs.

3. At every bisect step, launch Emacs fresh with emacs
/path/to/test-file.org and then do nothing except C-c C-e l B. Then
quit Emacs.

4. If I got the error, git bisect bad. If I got an export buffer of
LaTeX code, git bisect good.

When I got the error, it was always consistently reproducible for that
revision, and it was always enough to launch Emacs, open the file and
try the export, no fancy other things to mess up the cache.

To cite John Cleese, I may be an idiot, but I'm no fool. [1] :-p

hjh

[1] http://www.ibras.dk/montypython/episode20.htm#13



[O] [bug] Beamer export fails in current master

2014-01-10 Thread James Harkins
I just started to work on the issue of wrapping the title command in beamer 
export within a frame, but found that I can't export to Beamer at all in 
the master branch (after pulling just today).


I can export this minimal example successfully if I check out 
release_8.2.4, but it fails in current master.


~~
#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: default

* Section header
** Slide header
*** Block header
   Free text, which could be long.
   - List item
~~

Bisecting revealed:

~~
e32ebb6c1ad1455cc34d29cc0881cff84ebde12f is the first bad commit
commit e32ebb6c1ad1455cc34d29cc0881cff84ebde12f
Author: Nicolas Goaziou n.goaz...@gmail.com
Date:   Sun Jan 5 00:37:37 2014 +0100

   org-element: Change data structure for cache
   
   * lisp/org-element.el (org-element-at-point, org-element-cache-get,

 org-element-cache-put, org-element--cache-sync): Complete rewrite to
 use new data structure.
   (org-element-context, org-element-cache-reset): Slight change in order
   to use new tools to access cached data.
   (org-element-cache-merge-changes-threshold): Renamed from
   `org-element--cache-merge-changes-threshold'.
   (org-element-cache-sync-idle-time): Renamed from
   `org-element--cache-sync-idle-time'.
   (org-element--cache-objects): New variable.
   
   Now elements are stored in AVL tree and objects in a hash table.  Also

   moved functions relative to cache into a specific section of the file.

:04 04 b8c02c245efd135d4e52bb84bf4df59a7baa81ea 
98c018db02b5336e44e8f7ad1f54870e724fd79d M	lisp

~~

Backtrace:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
 avl-tree--dummyroot(nil)
 (avl-tree--node-left (avl-tree--dummyroot tree))
 (avl-tree--root org-element--cache)
 (let ((node ...) last) (catch (quote found) (while node ...) last))
 (if (not (wholenump key)) (gethash key org-element--cache-objects) (let 
(... last) (catch ... ... last)))
 (progn (when (and ... ...) (org-element--cache-sync ...)) (if (not ...) 
(gethash key org-element--cache-objects) (let ... ...)))
 (if (and org-element-use-cache org-element--cache) (progn (when ... ...) 
(if ... ... ...)))
 (when (and org-element-use-cache org-element--cache) (when (and ... ...) 
(org-element--cache-sync ...)) (if (not ...) (gethash key 
org-element--cache-objects) (let ... ...)))

 org-element-cache-get(33)
 (let* ((cached ...) (begin ...)) (cond (... ... ... ...) (... ...) (... 
... ... ...) (t ...)))
 (let ((origin ...) element next) (end-of-line) (skip-chars-backward  
	\n) (cond (... ...) (... ... ...)) (goto-char origin) (let* (... ...) 
(cond ... ... ... ...)) (let (... parent special-flag) (while t ... ... 
...)))
 (save-restriction (widen) (let (... element next) (end-of-line) 
(skip-chars-backward  
	\n) (cond ... ...) (goto-char origin) (let* ... ...) (let ... ...)))
 (save-excursion (save-restriction (widen) (let ... ... ... ... ... ... 
...)))
 (org-with-wide-buffer (let (... element next) (end-of-line) 
(skip-chars-backward  
	\n) (cond ... ...) (goto-char origin) (let* ... ...) (let ... ...)))
 (catch (quote exit) (org-with-wide-buffer (let ... ... ... ... ... ... 
...)))

 org-element-at-point()
 (let ((element ...)) (when (eq ... ...) (let ... ...)))
 (while (re-search-forward regexp nil t) (let (...) (when ... ...)))
 (save-restriction (widen) (goto-char (point-min)) (while 
(re-search-forward regexp nil t) (let ... ...)) plist)
 (save-excursion (save-restriction (widen) (goto-char ...) (while ... ...) 
plist))
 (org-with-wide-buffer (goto-char (point-min)) (while (re-search-forward 
regexp nil t) (let ... ...)) plist)
 (lambda (optional files plist) (org-with-wide-buffer (goto-char ...) 
(while ... ...) 
plist))((/home/dlm/Documents/conferences/scweek2013/shows/test-all.org) 
nil)
 funcall((lambda (optional files plist) (org-with-wide-buffer (goto-char 
...) (while ... ...) plist)) 
(/home/dlm/Documents/conferences/scweek2013/shows/test-all.org) nil)

 (setq plist (funcall get-options (and buffer-file-name ...) nil))
 (let* (plist get-options (case-fold-search t) (options ...) (regexp ...) 
(find-properties ...) (get-options ...)) (setq plist (funcall get-options 
... nil)) (dolist (keyword org-element-document-properties plist) (dolist 
... ...)))
 org-export--get-inbuffer-options([cl-struct-org-export-backend beamer 
latex ((bold . org-beamer-bold) (export-block . org-beamer-export-block) 
(export-snippet . org-beamer-export-snippet) (headline . 
org-beamer-headline) (item . org-beamer-item) (keyword . 
org-beamer-keyword) (link . org-beamer-link) (plain-list . 
org-beamer-plain-list) (radio-target . org-beamer-radio-target) (target . 
org-beamer-target) (template . org-beamer-template)) ((:beamer-theme 
BEAMER_THEME nil org-beamer-theme) (:beamer-color-theme 
BEAMER_COLOR_THEME nil nil t) (:beamer-font-theme BEAMER_FONT_THEME nil 
nil t) (:beamer-inner-theme BEAMER_INNER_THEME nil nil t) 
(:beamer-outer-theme BEAMER_OUTER_THEME nil nil t) 

Re: [Orgmode] [bug] beamer export envargs for column not working properly

2010-11-26 Thread Eric S Fraga
Carsten Dominik carsten.domi...@gmail.com writes:

[...]

 Hi Eric,

 thank you for the more detailed example.  I think this should
 be fixed now.  The documentation was not really wrong, because
 it only mentioned c[...] and not c  But I agree that
 there is not reason to no allow this.

Very true!  But thanks for extending this.  I'll try it out later when I
get back to my slides.

 Thanks, Eric, for your continuous effort to help improving Org!
 We would not have BEAMER export without you, I think - a fact
 that is now mentioned in the manual, in the acknowledgement
 section.  

You're very welcome but my contributions are minimal in comparison!  And
it's easy to contribute from such a good starting point.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.99.g9db0.dirty)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [bug] beamer export envargs for column not working properly

2010-11-21 Thread Carsten Dominik

Hi Eric,

could you make me a slightly more complete example, with your beamer  
setup?

So a full test file that will show this behavior?

Thanks.

- Carsten

On Nov 21, 2010, at 1:28 AM, Eric S Fraga wrote:


Hi,

I am trying to create a beamer slide which has two columns.  The  
second
column should only appear after a while (the 6th uncovering  
operation).

In latex, I would do:

: \begin{column}6-{0.4\textwidth}

say.  In org, I would expect to be able to get this latex code  
generated

by the following:

--8---cut here---start-8---
* column heading  :BMCOL:B_block:
 :PROPERTIES:
 :BEAMER_col: 0.4
 :BEAMER_envargs: c6-
 :BEAMER_extra:
 :BEAMER_env: block
 :END:
--8---cut here---end---8---

according to the info documentation (Beamer class export).

However, this does not work: the c6- is placed verbatim in
the \begin{block} that comes after the \begin{column}.  Furthermore,  
if

I ask for the heading to be ignored (instead of defining a block), the
envargs are lost completely!

Thanks,
eric

--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.104.gf692)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [bug] beamer export envargs for column not working properly

2010-11-21 Thread Eric S Fraga
Carsten Dominik carsten.domi...@gmail.com writes:

 Hi Eric,

 could you make me a slightly more complete example, with your beamer
 setup?  So a full test file that will show this behavior?

 Thanks.

 - Carsten

Sure.  The attached example has a single slide.  With the file as it is,
i.e. with an ignored heading for the second column of the slide, the
slide overlay directive is thrown away upon export.  

If you change the headline of the second column to be a block heading
(C-c C-b b), on export the overlay directive is not thrown away but it
is attached to the block and not the column.  This is okay in that
accomplishes the same purpose (in this case but not others); however, it
does not match the documentation in any case.

Thanks,
eric

#+TITLE: Presentation with Org-Mode and Beamer 
#+AUTHOR:Eric S Fraga
#+EMAIL: e.fr...@ucl.ac.uk
#+DATE:  2010.09.05 00:42:34
#+DESCRIPTION: 
#+KEYWORDS: 
#+LANGUAGE:  en
#+OPTIONS:   H:5 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:nil
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 

#+startup: oddonly
#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation]

#+BEAMER_FRAME_LEVEL: 2

#+startup: fninline

#+COLUMNS: %40ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %10BEAMER_extra(Extra)

* Introduction
*** A slide with two columns
* Some notes	  :BMCOL:B_block:
  :PROPERTIES:
  :BEAMER_col: 0.5
  :BEAMER_env: block
  :END:
  - some text
  - and some more
  - and yet more
* More notes  :BMCOL:B_ignoreheading:
  :PROPERTIES:
  :BEAMER_col: 0.5
  :BEAMER_env: ignoreheading
  :BEAMER_envargs: c2-
  :END:
  - some important notes
  - and even more important ones
  - and some maths: $\sin^{2}(x)$

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.104.gf692)
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [bug] beamer export envargs for column not working properly

2010-11-20 Thread Eric S Fraga
Hi,

I am trying to create a beamer slide which has two columns.  The second
column should only appear after a while (the 6th uncovering operation).
In latex, I would do:

: \begin{column}6-{0.4\textwidth}

say.  In org, I would expect to be able to get this latex code generated
by the following:

--8---cut here---start-8---
* column heading  :BMCOL:B_block:
  :PROPERTIES:
  :BEAMER_col: 0.4
  :BEAMER_envargs: c6-
  :BEAMER_extra: 
  :BEAMER_env: block
  :END:
--8---cut here---end---8---

according to the info documentation (Beamer class export).

However, this does not work: the c6- is placed verbatim in
the \begin{block} that comes after the \begin{column}.  Furthermore, if
I ask for the heading to be ignored (instead of defining a block), the
envargs are lost completely!

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.3 (release_7.3.104.gf692)

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode