emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: dates in heading break beamer export
@ 2013-09-29 10:33 Daniele Pizzolli
  2013-09-29 14:53 ` Nicolas Goaziou
  0 siblings, 1 reply; 19+ messages in thread
From: Daniele Pizzolli @ 2013-09-29 10:33 UTC (permalink / raw)
  To: emacs-orgmode

Hello @all,

Dates in org-format in heading break the beamer export:

Minimal case:

#+OPTIONS: H:3
* title [2013-09-29 Sun]
** section
*** frame
text

Result for beamer export:

org-latex-compile: PDF file ./beamer-bug-date.pdf wasn't produced: [undefined control sequence] Runaway argument

The same error for:

#+OPTIONS: H:3
* title <2013-09-29 Sun>
** section
*** frame
text

This works:

#+OPTIONS: H:3
* title (2013-09-29 Sun)
** section
*** frame
text

The export in latex for the same snippets works in all cases in version:
Org-mode version 8.2 (release_8.2-6-gd08917 ...)

Regards,
Daniele

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

* Re: Bug: dates in heading break beamer export
  2013-09-29 10:33 Bug: dates in heading break beamer export Daniele Pizzolli
@ 2013-09-29 14:53 ` Nicolas Goaziou
  2013-09-29 15:27   ` Marcin Borkowski
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2013-09-29 14:53 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

Hello,

Daniele Pizzolli <dan@toel.it> writes:

> Dates in org-format in heading break the beamer export:
>
> Minimal case:
>
> #+OPTIONS: H:3
> * title [2013-09-29 Sun]
> ** section
> *** frame
> text
>
> Result for beamer export:
>
> org-latex-compile: PDF file ./beamer-bug-date.pdf wasn't produced:
> [undefined control sequence] Runaway argument

It's a LaTeX Beamer problem: it doesn't like

  \section{title \textit{[2013-09-29 Sun]}}

produced by Org, although regular LaTeX accepts it.

Do you know about a workaround for this?


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: dates in heading break beamer export
  2013-09-29 14:53 ` Nicolas Goaziou
@ 2013-09-29 15:27   ` Marcin Borkowski
  2013-09-30 16:02     ` Daniele Pizzolli
  0 siblings, 1 reply; 19+ messages in thread
From: Marcin Borkowski @ 2013-09-29 15:27 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-09-29, o godz. 16:53:14
Nicolas Goaziou <n.goaziou@gmail.com> napisał(a):

> Hello,
> 
> Daniele Pizzolli <dan@toel.it> writes:
> 
> > Dates in org-format in heading break the beamer export:
> >
> > Minimal case:
> >
> > #+OPTIONS: H:3
> > * title [2013-09-29 Sun]
> > ** section
> > *** frame
> > text
> >
> > Result for beamer export:
> >
> > org-latex-compile: PDF file ./beamer-bug-date.pdf wasn't produced:
> > [undefined control sequence] Runaway argument
> 
> It's a LaTeX Beamer problem: it doesn't like
> 
>   \section{title \textit{[2013-09-29 Sun]}}
> 
> produced by Org, although regular LaTeX accepts it.
> 
> Do you know about a workaround for this?

This is really a workaround: put a \protect before \textit.

In general, putting formatting commands in \section title etc., even if
not erroneous, is considered a bad practice.

Hth,

> 
> 
> Regards,
> 



-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: Bug: dates in heading break beamer export
  2013-09-29 15:27   ` Marcin Borkowski
@ 2013-09-30 16:02     ` Daniele Pizzolli
  2013-09-30 17:05       ` Marcin Borkowski
                         ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Daniele Pizzolli @ 2013-09-30 16:02 UTC (permalink / raw)
  To: emacs-orgmode

On 09/29/2013 05:27 PM, Marcin Borkowski wrote:
> Dnia 2013-09-29, o godz. 16:53:14
> Nicolas Goaziou:

[]

>> It's a LaTeX Beamer problem: it doesn't like
>>
>>    \section{title \textit{[2013-09-29 Sun]}}
>>
>> produced by Org, although regular LaTeX accepts it.
>>
>> Do you know about a workaround for this?

Not really.

> This is really a workaround: put a \protect before \textit.

Or why not drop \textit?

> In general, putting formatting commands in \section title etc., even if
> not erroneous, is considered a bad practice.

But org-mode allow this!

I think that if something is allowed in org-mode syntax but not by the
underlining tools used for export, the exporter should take care to find
a suitable workaround.

I just found that the same problem (work in latex, does not work in
beamer) exists for footnotes in header!

A feature request would be to have some checks on org files a la
flymake, at least for common potential sources of problems that
usually break the export like:

- missing two empty lines after footnotes
- missing empty line after RESULTS:
- =string=[footnote]

Maybe something already exists and I am simply not aware.

Regards,
Daniele

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

* Re: Bug: dates in heading break beamer export
  2013-09-30 16:02     ` Daniele Pizzolli
@ 2013-09-30 17:05       ` Marcin Borkowski
  2013-10-01 16:01         ` Nicolas Goaziou
  2013-10-02  6:50         ` Bug: code and footnotes (was Bug: dates in heading break beamer export) Daniele Pizzolli
  2013-10-01  8:09       ` Bug: dates in heading break beamer export Eric S Fraga
  2013-10-02  6:47       ` Daniele Pizzolli
  2 siblings, 2 replies; 19+ messages in thread
From: Marcin Borkowski @ 2013-09-30 17:05 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-09-30, o godz. 18:02:51
Daniele Pizzolli <dan@toel.it> napisał(a):

> >> It's a LaTeX Beamer problem: it doesn't like
> >>
> >>    \section{title \textit{[2013-09-29 Sun]}}
> >>
> >> produced by Org, although regular LaTeX accepts it.
> >>
> >> Do you know about a workaround for this?
> 
> Not really.
> 
> > This is really a workaround: put a \protect before \textit.
> 
> Or why not drop \textit?

Sounds good for me.  (NB: there's a similar problems with tags, AFAIR.
And (AFAIR!) it's even worse, since the exporter uses a low-level TeX
command \hfill.)

> > In general, putting formatting commands in \section title etc.,
> > even if not erroneous, is considered a bad practice.
> 
> But org-mode allow this!
> 
> I think that if something is allowed in org-mode syntax but not by the
> underlining tools used for export, the exporter should take care to
> find a suitable workaround.

Definitely agreed.  The point is, what is a "suitable workaround"?

One idea is to define a command \orgsection, with syntax like this:
\orgsection[timestamp=...,tags={...,...}]{title proper}
This could be even defined in a specialized package, call it org.sty,
which is then turned on by means of \usepackage in exported files.
This is probably the cleanest solution I can think of, but has one
disadvantage: it diverges from LaTeX syntax, so if I edit manually (or
worse, transform automatically) such a file, I can encounter problems:
the (non-TeX) parser (e.g. an editor's one) may not know that
\orgsection is in fact a flavor of \section.  For pdf export this is a
non-issue, but AFAIK people use Org LaTeX export to create a file for
further work on it.

Another idea is to redefine \section so that it either accepts optional
arguments (therefore breaking its default interface!), or allow
something like this:

\timestamp{...}
\tags{...,...}
\section{title proper}

This is easy to do, but far from elegant.  Also, it does not help
further maintenance of such a LaTeX file.

Yet another solution would be to forget about LaTeX and use ConTeXt,
where defining custom sections etc. is much easier.  Of course, this is
fine only assuming that (1) I do not want to e.g. submit my file to a
LaTeX-accepting journal and (2) I'm fine with learning ConTeXt, which -
even though much better than LaTeX in terms of UI (and also
featurewise, btw) - has its own learning curve.

> I just found that the same problem (work in latex, does not work in
> beamer) exists for footnotes in header!

Quite possible.  You can always use \footnotemark and \footnotetext.
(Beamer hacks deeply into LaTeX innards, so things like this are no
surprise.)

> A feature request would be to have some checks on org files a la
> flymake, at least for common potential sources of problems that
> usually break the export like:
> 
> - missing two empty lines after footnotes
> - missing empty line after RESULTS:
> - =string=[footnote]

Just curious: what's the problem with =string=[footnote]?

> Maybe something already exists and I am simply not aware.
> 
> Regards,
> Daniele

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: Bug: dates in heading break beamer export
  2013-09-30 16:02     ` Daniele Pizzolli
  2013-09-30 17:05       ` Marcin Borkowski
@ 2013-10-01  8:09       ` Eric S Fraga
  2013-10-02  6:47       ` Daniele Pizzolli
  2 siblings, 0 replies; 19+ messages in thread
From: Eric S Fraga @ 2013-10-01  8:09 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

Daniele Pizzolli <dan@toel.it> writes:

[...]

> I think that if something is allowed in org-mode syntax but not by the
> underlining tools used for export, the exporter should take care to find
> a suitable workaround.

I think this is rather ambitious and would make life very difficult for
exporter maintainers.  LaTeX, for instance, is a very complex system.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.50.1, Org release_8.1.1-7-gaecdf5

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

* Re: Bug: dates in heading break beamer export
  2013-09-30 17:05       ` Marcin Borkowski
@ 2013-10-01 16:01         ` Nicolas Goaziou
  2013-10-01 16:33           ` Marcin Borkowski
  2013-10-02  6:50         ` Bug: code and footnotes (was Bug: dates in heading break beamer export) Daniele Pizzolli
  1 sibling, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2013-10-01 16:01 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: emacs-orgmode

Hello,

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Daniele Pizzolli <dan@toel.it> napisał(a):
>> Or why not drop \textit?
>
> Sounds good for me.  (NB: there's a similar problems with tags, AFAIR.
> And (AFAIR!) it's even worse, since the exporter uses a low-level TeX
> command \hfill.)

Well, there is `org-latex-active-timestamp-format',
`org-latex-inactive-timestamp-format' and even filters can do it.

It is also technically possible to write in ox-latex a section-local
specific export back-end that would translate differently some objects
in a \section{...} command. But that would make the export a bit more
unpredictable.

Of course, in a few cases, `latex' back-end does its best to circumvent
possible problems (i.e. nested footnotes), but this is nowhere near
a general rule. It's usually a lot of work for a tiny corner case.

>> > In general, putting formatting commands in \section title etc.,
>> > even if not erroneous, is considered a bad practice.
>> 
>> But org-mode allow this!
>> 
>> I think that if something is allowed in org-mode syntax but not by the
>> underlining tools used for export, the exporter should take care to
>> find a suitable workaround.
>
> Definitely agreed.  The point is, what is a "suitable workaround"?

I disagree. This is just unrealistic. There are many packages involving
many quirks. We cannot afford to provide a workaround to all (or even
most) of them, assuming one exists.

Also, the OP is making a false assumption. The underlining tool allows
\texit in the section \command, i.e., you can type it in a "tex" file.
You will get a compilation error, exactly as if you do the same mistake
in Org. Why Org should be smarter in this case?


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: dates in heading break beamer export
  2013-10-01 16:01         ` Nicolas Goaziou
@ 2013-10-01 16:33           ` Marcin Borkowski
  0 siblings, 0 replies; 19+ messages in thread
From: Marcin Borkowski @ 2013-10-01 16:33 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-10-01, o godz. 18:01:51
Nicolas Goaziou <n.goaziou@gmail.com> napisał(a):

> > Sounds good for me.  (NB: there's a similar problems with tags,
> > AFAIR. And (AFAIR!) it's even worse, since the exporter uses a
> > low-level TeX command \hfill.)
> 
> Well, there is `org-latex-active-timestamp-format',
> `org-latex-inactive-timestamp-format' and even filters can do it.

Maybe, I was talking about the default.  (And I even don't know now how
to correct it, since LaTeX does not have a notion of a "section tag" -
so there's no obvious way to represent such an entity in it!)

> It is also technically possible to write in ox-latex a section-local
> specific export back-end that would translate differently some objects
> in a \section{...} command. But that would make the export a bit more
> unpredictable.

Sorry, I did not get that idea.  We are not talking about
converting /different/ objects into /sections/, are we?

> Of course, in a few cases, `latex' back-end does its best to
> circumvent possible problems (i.e. nested footnotes), but this is
> nowhere near a general rule. It's usually a lot of work for a tiny
> corner case.

Agreed.

> >> > In general, putting formatting commands in \section title etc.,
> >> > even if not erroneous, is considered a bad practice.
> >> 
> >> But org-mode allow this!
> >> 
> >> I think that if something is allowed in org-mode syntax but not by
> >> the underlining tools used for export, the exporter should take
> >> care to find a suitable workaround.
> >
> > Definitely agreed.  The point is, what is a "suitable workaround"?
> 
> I disagree. This is just unrealistic. There are many packages
> involving many quirks. We cannot afford to provide a workaround to
> all (or even most) of them, assuming one exists.

Well, in this particular case I can definitely live with what Org
gives.  (The fact that I don't use the exporter too often helps;).)
In other words: the status quo *is* (more or less) a "suitable
workaround", at least for me.

> Also, the OP is making a false assumption. The underlining tool allows
> \texit in the section \command, i.e., you can type it in a "tex" file.
> You will get a compilation error, exactly as if you do the same
> mistake in Org. Why Org should be smarter in this case?

Hm, I did not understand this point:(.

My opinion (as a LaTeX user and hacker, if I may say so) is that LaTeX
exporter may be not optimal, but it is decent enough.  I agree that
it is a lot of work to make it better, and even then it's not enough,
since there is no "canonical" way to transform some Org-specific things
(like tags) to LaTeX syntax - so someone will be unhappy anyway...

What is important here (as I hinted previously) is the point of having
a LaTeX exporter: do we aim at pdf, not caring about the readability
and elegance of the (then intermediate) LaTeX file, or do we aim at a
good quality LaTeX file to do further (manual!) work on it, including
(but not limited to) "visual tuning".  I'm sure there are some people in
both camps, and satisfying all of them may be tricky.

Now that I think of it, writing a completely new LaTeX exporter might
actually be a lot of fun - I'm afraid, though, that I don't have enough
time for it now...

> Regards,

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: Bug: dates in heading break beamer export
  2013-09-30 16:02     ` Daniele Pizzolli
  2013-09-30 17:05       ` Marcin Borkowski
  2013-10-01  8:09       ` Bug: dates in heading break beamer export Eric S Fraga
@ 2013-10-02  6:47       ` Daniele Pizzolli
  2013-10-02 13:45         ` Nicolas Goaziou
  2 siblings, 1 reply; 19+ messages in thread
From: Daniele Pizzolli @ 2013-10-02  6:47 UTC (permalink / raw)
  To: emacs-orgmode

On 09/30/2013 06:02 PM, Daniele Pizzolli wrote:

> But org-mode allow this!
>
> I think that if something is allowed in org-mode syntax but not by the
> underlining tools used for export, the exporter should take care to find
> a suitable workaround.

Hello all,

I see all your interesting points on the discussion... I just want to
explain that my statement is my naïve interpretation of:

You can use intuitive markup then have it converted to HTML, LATEX,
ODT – and much more[fn:1].

I can understand that the markup can end in very complex cases, but I
hope that you agree with me that with this advertised feature an extra
care should be put in ensuring that every markup can be exported
without crashing some tool in the chain.

The latex and html exporters (the one I use most) do already a
wonderful job, but some important case are missing.

Since I found a healthy and friendly community I was thinking that was
worth reporting them.

In fact I use org-mode primarily to stay away from *tex
nuisances... and I think that I am not the only one.  I know enough
latex to find a workaround myself (not enough to offer a general
reliable solution) but I do not think that this will be a pleasant
experience for a newcomer or to somebody that choose org-mode for the
latex export capability.

Regards,
Daniele


[fn:1] http://orgmode.org/features.html#sec-7

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

* Re: Bug: code and footnotes (was Bug: dates in heading break beamer export)
  2013-09-30 17:05       ` Marcin Borkowski
  2013-10-01 16:01         ` Nicolas Goaziou
@ 2013-10-02  6:50         ` Daniele Pizzolli
  1 sibling, 0 replies; 19+ messages in thread
From: Daniele Pizzolli @ 2013-10-02  6:50 UTC (permalink / raw)
  To: emacs-orgmode

On 09/30/2013 07:05 PM, Marcin Borkowski wrote:

[]
>> - =string=[footnote]
>
> Just curious: what's the problem with =string=[footnote]?

Hello Marcin,

This line do no really cause errors on latex but do no export the code
and/or the footnote and leaves the equals in the output.  Here are
some cases:

#+OPTIONS: H:3
* title
** section
*** subsection
test[fn:1] good: text, footnote, no equals

=test=[fn:2] bad: no code(bad), footnote, equals(bad)

=test[fn:3]= bad: code, no footnote(bad), equals(bad)

=test=\[fn:4] bad: code, footnote, no equals, slash(bad?)

=test=​​[fn:5] bad: no code(bad), footnote, equals (bad) (please note
that there is a zero with whitespace before “[”)


[fn:1] t1


[fn:2] t2


[fn:3] t3


[fn:4] t4


[fn:5] t5


* title 2


Best,
Daniele

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

* Re: Bug: dates in heading break beamer export
  2013-10-02  6:47       ` Daniele Pizzolli
@ 2013-10-02 13:45         ` Nicolas Goaziou
  2013-10-02 15:36           ` Daniele Pizzolli
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2013-10-02 13:45 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

Hello,

Daniele Pizzolli <dan@toel.it> writes:

> In fact I use org-mode primarily to stay away from *tex
> nuisances... and I think that I am not the only one.  I know enough
> latex to find a workaround myself (not enough to offer a general
> reliable solution) but I do not think that this will be a pleasant
> experience for a newcomer or to somebody that choose org-mode for the
> latex export capability.

Fair enough. What, exactly, do you suggest as generated LaTeX code?

IIUC, you want to drop any markup for timestamps when located in
a headline, ignoring `org-latex-active-timestamp-format' and al. Am
I missing something else?

BTW, the =verbatim=[fn:1] case is unrelated to export. See
`org-emphasis-regexp-components'.


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: dates in heading break beamer export
  2013-10-02 13:45         ` Nicolas Goaziou
@ 2013-10-02 15:36           ` Daniele Pizzolli
  2013-10-02 15:55             ` Nicolas Goaziou
  0 siblings, 1 reply; 19+ messages in thread
From: Daniele Pizzolli @ 2013-10-02 15:36 UTC (permalink / raw)
  To: emacs-orgmode

On 10/02/2013 03:45 PM, Nicolas Goaziou wrote:
> Hello,
>
> Daniele Pizzolli writes:
>
>> In fact I use org-mode primarily to stay away from *tex
>> nuisances... and I think that I am not the only one.  I know enough
>> latex to find a workaround myself (not enough to offer a general
>> reliable solution) but I do not think that this will be a pleasant
>> experience for a newcomer or to somebody that choose org-mode for the
>> latex export capability.
>
> Fair enough. What, exactly, do you suggest as generated LaTeX code?

Thanks Nicolas for following my arguments.

> IIUC, you want to drop any markup for timestamps when located in
> a headline, ignoring `org-latex-active-timestamp-format' and al. Am
> I missing something else?

Yes, I think is fair to drop the markup.  I would also think that this
is safe default when nested markup is bad.
Maybe the exporter can emit a notice/warning.

> BTW, the =verbatim=[fn:1] case is unrelated to export. See
> `org-emphasis-regexp-components'.

Yes, sorry, I mixed two not-so-related problem.  The beamer exporter do not
work with this code:

#+OPTIONS: H:3
* title test[fn:1]
** section
*** subsection

[fn:1] text


The output is:
org-latex-compile: PDF file ./beamer-bug-footnote.pdf wasn't produced: [undefined control sequence] Runaway argument

The =verbatim=[fn:1] problem was discovered trying to find a
workaround for the footnotes in the headers...

Oh, in fact searching emphasis + footnote lead to some results.
The question hit this list periodically... so maybe it’s worth
documenting it better.  I will try found a general answer and
propose a patch for the docs.

It seems that I am going to drop latex nuisances to go into elisp
ones ;-)

Thanks again,
Daniele

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

* Re: Bug: dates in heading break beamer export
  2013-10-02 15:36           ` Daniele Pizzolli
@ 2013-10-02 15:55             ` Nicolas Goaziou
  2013-10-02 16:10               ` Daniele Pizzolli
  2013-10-02 22:12               ` Suvayu Ali
  0 siblings, 2 replies; 19+ messages in thread
From: Nicolas Goaziou @ 2013-10-02 15:55 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

Daniele Pizzolli <dan@toel.it> writes:

> Yes, I think is fair to drop the markup.

OK.

> I would also think that this is safe default when nested markup is
> bad.

Do you have an exhaustive list of such cases?

> Maybe the exporter can emit a notice/warning.

That it dropped the markup?

> Yes, sorry, I mixed two not-so-related problem. The beamer exporter do
> not work with this code:
>
> #+OPTIONS: H:3
> * title test[fn:1]
> ** section
> *** subsection
>
> [fn:1] text

Of course, that's a similar problem: footnotes are not allowed in
headlines. Though, in this case, it isn't possible to drop the markup.
What LaTeX code do you suggest?


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: dates in heading break beamer export
  2013-10-02 15:55             ` Nicolas Goaziou
@ 2013-10-02 16:10               ` Daniele Pizzolli
  2013-10-02 20:47                 ` Marcin Borkowski
  2013-10-03 13:30                 ` Nicolas Goaziou
  2013-10-02 22:12               ` Suvayu Ali
  1 sibling, 2 replies; 19+ messages in thread
From: Daniele Pizzolli @ 2013-10-02 16:10 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 10/02/2013 05:55 PM, Nicolas Goaziou wrote:
> Daniele Pizzolli writes:
>
>> Yes, I think is fair to drop the markup.
>
> OK.
>
>> I would also think that this is safe default when nested markup is
>> bad.
>
> Do you have an exhaustive list of such cases?

No, not really but I try to report them as soon I found them.  I do
want to replace latex entirely with org, so I will use it extensively
in the near future.

>> Maybe the exporter can emit a notice/warning.
>
> That it dropped the markup?

Yes, I do not know if there is already a standard in reporting back
but I would go for something like "Latex-exporter: Warning: dropped
code markup at line XX of originalorgfile.org because it is not
supported by this exporter. More info at ..." or even a shorter one
can be fine to me.

>> Yes, sorry, I mixed two not-so-related problem. The beamer exporter do
>> not work with this code:
>>
>> #+OPTIONS: H:3
>> * title test[fn:1]
>> ** section
>> *** subsection
>>
>> [fn:1] text
>
> Of course, that's a similar problem: footnotes are not allowed in
> headlines. Though, in this case, it isn't possible to drop the markup.
> What LaTeX code do you suggest?

Mmm, I think you are asking to the wrong person.  I do not know enough
about latex and its error reporting capabilities...

I would appreciate if the exporter does not break and/or a
notification to the user of the problem in and understandable
language, even for newcomers.

I know when latex do not know how to resolve some references put some
question marks... but I do not really know if this is the case to
follow this convention.

Regards,
Daniele

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

* Re: Bug: dates in heading break beamer export
  2013-10-02 16:10               ` Daniele Pizzolli
@ 2013-10-02 20:47                 ` Marcin Borkowski
  2013-10-03 13:30                 ` Nicolas Goaziou
  1 sibling, 0 replies; 19+ messages in thread
From: Marcin Borkowski @ 2013-10-02 20:47 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-10-02, o godz. 18:10:57
Daniele Pizzolli <dan@toel.it> napisał(a):

> > Of course, that's a similar problem: footnotes are not allowed in
> > headlines. Though, in this case, it isn't possible to drop the
> > markup. What LaTeX code do you suggest?
> 
> Mmm, I think you are asking to the wrong person.  I do not know enough
> about latex and its error reporting capabilities...

Well, LaTeX's error reporting capabilities are not very impressive...

> I would appreciate if the exporter does not break and/or a
> notification to the user of the problem in and understandable
> language, even for newcomers.
> 
> I know when latex do not know how to resolve some references put some
> question marks... but I do not really know if this is the case to
> follow this convention.

Well, this is something different: it basically means that either (a)
you need another run or (b) you messed up with the references.

> Regards,
> Daniele

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

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

* Re: Bug: dates in heading break beamer export
  2013-10-02 15:55             ` Nicolas Goaziou
  2013-10-02 16:10               ` Daniele Pizzolli
@ 2013-10-02 22:12               ` Suvayu Ali
  1 sibling, 0 replies; 19+ messages in thread
From: Suvayu Ali @ 2013-10-02 22:12 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Oct 02, 2013 at 05:55:44PM +0200, Nicolas Goaziou wrote:
> Daniele Pizzolli <dan@toel.it> writes:
> 
> > Yes, I think is fair to drop the markup.
> 
> OK.
> 
> > I would also think that this is safe default when nested markup is
> > bad.
> 
> Do you have an exhaustive list of such cases?
> 
> > Maybe the exporter can emit a notice/warning.
> 
> That it dropped the markup?
> 
> > Yes, sorry, I mixed two not-so-related problem. The beamer exporter do
> > not work with this code:
> >
> > #+OPTIONS: H:3
> > * title test[fn:1]
> > ** section
> > *** subsection
> >
> > [fn:1] text
> 
> Of course, that's a similar problem: footnotes are not allowed in
> headlines. Though, in this case, it isn't possible to drop the markup.
> What LaTeX code do you suggest?

Strange, it seems to work for me.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Bug: dates in heading break beamer export
  2013-10-02 16:10               ` Daniele Pizzolli
  2013-10-02 20:47                 ` Marcin Borkowski
@ 2013-10-03 13:30                 ` Nicolas Goaziou
  2013-10-03 15:59                   ` Daniele Pizzolli
  1 sibling, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2013-10-03 13:30 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

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

Hello,

Daniele Pizzolli <dan@toel.it> writes:

> On 10/02/2013 05:55 PM, Nicolas Goaziou wrote:
>> Daniele Pizzolli writes:
>>
>>> Yes, I think is fair to drop the markup.
>>
>> OK.
>>
>>> I would also think that this is safe default when nested markup is
>>> bad.

The following patch should protect some fragile commands in
a section-like structure. It is Beamer-only since general LaTeX back-end
doesn't seem to encounter these problems.

Does it fix the problem?


Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-beamer-Protect-fragile-commands-in-sections.patch --]
[-- Type: text/x-diff, Size: 1743 bytes --]

From d8c37c9265fd6a3d45dce4ce86a12b634c9be0fd Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Thu, 3 Oct 2013 15:11:03 +0200
Subject: [PATCH] ox-beamer: Protect fragile commands in sections

* lisp/ox-beamer.el (org-beamer--format-section): Protect fragile
  commands in sections.
---
 lisp/ox-beamer.el | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index a975d24..b812a75 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -444,9 +444,25 @@ INFO is a plist used as a communication channel."
   "Format HEADLINE as a sectioning part.
 CONTENTS holds the contents of the headline.  INFO is a plist
 used as a communication channel."
-  ;; Use `latex' back-end output, inserting overlay specifications
-  ;; if possible.
-  (let ((latex-headline (org-export-with-backend 'latex headline contents info))
+  ;; Use `latex' back-end output, inserting overlay specifications if
+  ;; possible.  Also protect fragile commands.
+  (let ((latex-headline
+	 (org-export-data-with-backend
+	  headline
+	  (org-export-create-backend
+	   :parent 'latex
+	   :transcoders
+	   (let ((protected-output
+		  (function
+		   (lambda (object contents info)
+		     (let ((code (org-export-with-backend
+				  'beamer object contents info)))
+		       (if (org-string-nw-p code) (concat "\\protect" code)
+			 code))))))
+	     (mapcar #'(lambda (type) (cons type protected-output))
+		     '(bold footnote-reference italic strike-through
+			    timestamp underline))))
+	  info))
 	(mode-specs (org-element-property :BEAMER_ACT headline)))
     (if (and mode-specs
 	     (string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{"
-- 
1.8.4


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

* Re: Bug: dates in heading break beamer export
  2013-10-03 13:30                 ` Nicolas Goaziou
@ 2013-10-03 15:59                   ` Daniele Pizzolli
  2013-10-04 19:17                     ` Nicolas Goaziou
  0 siblings, 1 reply; 19+ messages in thread
From: Daniele Pizzolli @ 2013-10-03 15:59 UTC (permalink / raw)
  To: emacs-orgmode

On 10/03/2013 03:30 PM, Nicolas Goaziou wrote:

> The following patch should protect some fragile commands in
> a section-like structure. It is Beamer-only since general LaTeX back-end
> doesn't seem to encounter these problems.
>
> Does it fix the problem?

Hello Nicolas,
yes, the problem is fixed both for dates and footnotes in sections, and
should be fixed for any of: bold footnote-reference italic strike-through
timestamp underline if I understand it correctly. Nice! I hope you plan
to merge it.

Thanks you,
Daniele

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

* Re: Bug: dates in heading break beamer export
  2013-10-03 15:59                   ` Daniele Pizzolli
@ 2013-10-04 19:17                     ` Nicolas Goaziou
  0 siblings, 0 replies; 19+ messages in thread
From: Nicolas Goaziou @ 2013-10-04 19:17 UTC (permalink / raw)
  To: Daniele Pizzolli; +Cc: emacs-orgmode

Hello,

Daniele Pizzolli <dan@toel.it> writes:

> yes, the problem is fixed both for dates and footnotes in sections, and
> should be fixed for any of: bold footnote-reference italic strike-through
> timestamp underline if I understand it correctly. Nice! I hope you plan
> to merge it.

Done.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2013-10-04 19:17 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-29 10:33 Bug: dates in heading break beamer export Daniele Pizzolli
2013-09-29 14:53 ` Nicolas Goaziou
2013-09-29 15:27   ` Marcin Borkowski
2013-09-30 16:02     ` Daniele Pizzolli
2013-09-30 17:05       ` Marcin Borkowski
2013-10-01 16:01         ` Nicolas Goaziou
2013-10-01 16:33           ` Marcin Borkowski
2013-10-02  6:50         ` Bug: code and footnotes (was Bug: dates in heading break beamer export) Daniele Pizzolli
2013-10-01  8:09       ` Bug: dates in heading break beamer export Eric S Fraga
2013-10-02  6:47       ` Daniele Pizzolli
2013-10-02 13:45         ` Nicolas Goaziou
2013-10-02 15:36           ` Daniele Pizzolli
2013-10-02 15:55             ` Nicolas Goaziou
2013-10-02 16:10               ` Daniele Pizzolli
2013-10-02 20:47                 ` Marcin Borkowski
2013-10-03 13:30                 ` Nicolas Goaziou
2013-10-03 15:59                   ` Daniele Pizzolli
2013-10-04 19:17                     ` Nicolas Goaziou
2013-10-02 22:12               ` Suvayu Ali

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