emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* footnotes export verbatim
@ 2013-02-19 20:47 Samuel Wales
  2013-02-20 15:18 ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Wales @ 2013-02-19 20:47 UTC (permalink / raw)
  To: emacs-orgmode

***** footnotes fail
asdfasdf.[fn::one

two.]

Thanks.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: footnotes export verbatim
  2013-02-19 20:47 footnotes export verbatim Samuel Wales
@ 2013-02-20 15:18 ` Nicolas Goaziou
  2013-02-20 17:21   ` Samuel Wales
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-20 15:18 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hello,

Samuel Wales <samologist@gmail.com> writes:

> ***** footnotes fail
> asdfasdf.[fn::one
>
> two.]

Inline footnotes, like any inline object, cannot contain blank lines.


Regards,

-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-20 15:18 ` Nicolas Goaziou
@ 2013-02-20 17:21   ` Samuel Wales
  2013-02-20 17:32     ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Wales @ 2013-02-20 17:21 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Inline footnotes, like any inline object, cannot contain blank lines.

I found that they worked fine in the old exporters for HTML and ASCII.

In my view, this is a regression.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: footnotes export verbatim
  2013-02-20 17:21   ` Samuel Wales
@ 2013-02-20 17:32     ` Nicolas Goaziou
  2013-02-20 20:13       ` Samuel Wales
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-20 17:32 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel Wales <samologist@gmail.com> writes:

> On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>> Inline footnotes, like any inline object, cannot contain blank lines.
>
> I found that they worked fine in the old exporters for HTML and ASCII.
>
> In my view, this is a regression.

But it is not.

If you look at Org documentation, you will see that:

  Paragraphs are separated by at least one empty line.

In other words: "Paragraphs cannot contain an empty line". As inline
footnote references may belong to a paragraph, they cannot either.

It was merely a side-effect of the previous exporter, not an intended
feature.


Regards,

-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-20 17:32     ` Nicolas Goaziou
@ 2013-02-20 20:13       ` Samuel Wales
  2013-02-20 20:43         ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Wales @ 2013-02-20 20:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Is there some filter I can use to get the old behavior back?

It is important to me that inline footnotes be able to do what other
footnotes do.

I will have to go back to the old version of Org.

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

* Re: footnotes export verbatim
  2013-02-20 20:13       ` Samuel Wales
@ 2013-02-20 20:43         ` Nicolas Goaziou
  2013-02-20 20:59           ` Samuel Wales
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-20 20:43 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel Wales <samologist@gmail.com> writes:

> Is there some filter I can use to get the old behavior back?

No, that's impossible. You see an inline footnote where there are in
fact two paragraphs.

> It is important to me that inline footnotes be able to do what other
> footnotes do.

Note that blank lines are also impossible in other footnotes.  According
to the manual, which was effective for the previous exporter:

  The basic syntax is similar to the one used by `footnote.el', i.e.
  a footnote is defined in a paragraph that is started by a footnote
  marker in square brackets in column 0, no indentation allowed. If you
  need a paragraph break inside a footnote, use the LaTeX idiom `\par'.

Since a paragraph break is a blank line, blank lines were not allowed in
regular footnotes either.


Regards,

-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-20 20:43         ` Nicolas Goaziou
@ 2013-02-20 20:59           ` Samuel Wales
  2013-02-21 14:27             ` Eric S Fraga
  2013-02-24 13:50             ` Nicolas Goaziou
  0 siblings, 2 replies; 17+ messages in thread
From: Samuel Wales @ 2013-02-20 20:59 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>   The basic syntax is similar to the one used by `footnote.el', i.e.
>   a footnote is defined in a paragraph that is started by a footnote
>   marker in square brackets in column 0, no indentation allowed. If you
>   need a paragraph break inside a footnote, use the LaTeX idiom `\par'.

I am aware of that, but blank lines were allowed after a while.  One
issue was filling.

Even \par fails to work now.  :(

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

* Re: footnotes export verbatim
  2013-02-20 20:59           ` Samuel Wales
@ 2013-02-21 14:27             ` Eric S Fraga
  2013-02-23  3:08               ` Samuel Wales
  2013-02-24 13:50             ` Nicolas Goaziou
  1 sibling, 1 reply; 17+ messages in thread
From: Eric S Fraga @ 2013-02-21 14:27 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode, Nicolas Goaziou

Samuel Wales <samologist@gmail.com> writes:

> On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>>   The basic syntax is similar to the one used by `footnote.el', i.e.
>>   a footnote is defined in a paragraph that is started by a footnote
>>   marker in square brackets in column 0, no indentation allowed. If you
>>   need a paragraph break inside a footnote, use the LaTeX idiom `\par'.
>
> I am aware of that, but blank lines were allowed after a while.  One
> issue was filling.
>
> Even \par fails to work now.  :(

This last bit would be disturbing if true.  However, on my system at
least, \par in the middle of an inline footnote *does* lead to the start
of a new paragraph within the footnote when exported to latex/pdf.

Mind you, my org is not quite up to date (day or so old).  YMMV.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org 7.9.3e-1140-g272ca4

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

* Re: footnotes export verbatim
  2013-02-21 14:27             ` Eric S Fraga
@ 2013-02-23  3:08               ` Samuel Wales
  0 siblings, 0 replies; 17+ messages in thread
From: Samuel Wales @ 2013-02-23  3:08 UTC (permalink / raw)
  To: Samuel Wales, Nicolas Goaziou, emacs-orgmode

On 2/21/13, Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>> Even \par fails to work now.  :(
>
> This last bit would be disturbing if true.  However, on my system at
> least, \par in the middle of an inline footnote *does* lead to the start
> of a new paragraph within the footnote when exported to latex/pdf.

Did you try HTML?

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

* Re: footnotes export verbatim
  2013-02-20 20:59           ` Samuel Wales
  2013-02-21 14:27             ` Eric S Fraga
@ 2013-02-24 13:50             ` Nicolas Goaziou
  2013-02-24 20:12               ` Samuel Wales
  1 sibling, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-24 13:50 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hello,

Samuel Wales <samologist@gmail.com> writes:

> On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>>   The basic syntax is similar to the one used by `footnote.el', i.e.
>>   a footnote is defined in a paragraph that is started by a footnote
>>   marker in square brackets in column 0, no indentation allowed. If you
>>   need a paragraph break inside a footnote, use the LaTeX idiom `\par'.
>
> I am aware of that, but blank lines were allowed after a while.  One
> issue was filling.
>
> Even \par fails to work now.  :(

It should now be fixed.  Just replace \par with an empty line.


Regards,

-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-24 13:50             ` Nicolas Goaziou
@ 2013-02-24 20:12               ` Samuel Wales
  2013-02-25  8:09                 ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Wales @ 2013-02-24 20:12 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 2/24/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Samuel Wales <samologist@gmail.com> writes:
>> On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>>>   The basic syntax is similar to the one used by `footnote.el', i.e.
>>>   a footnote is defined in a paragraph that is started by a footnote
>>>   marker in square brackets in column 0, no indentation allowed. If you
>>>   need a paragraph break inside a footnote, use the LaTeX idiom `\par'.
>>
>> I am aware of that, but blank lines were allowed after a while.  One
>> issue was filling.
>>
>> Even \par fails to work now.  :(
>
> It should now be fixed.  Just replace \par with an empty line.

The fix does not work.

I tried blank line and it still exported verbatim.

I then tried \par, and it still filled the footnote and inserted "\par" into it.

If this cannot be fixed, then I need some way of filtering to achieve it.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: footnotes export verbatim
  2013-02-24 20:12               ` Samuel Wales
@ 2013-02-25  8:09                 ` Nicolas Goaziou
  2013-02-26 22:35                   ` Samuel Wales
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-25  8:09 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel Wales <samologist@gmail.com> writes:

> On 2/24/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>> Samuel Wales <samologist@gmail.com> writes:
>>> On 2/20/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>>>>   The basic syntax is similar to the one used by `footnote.el', i.e.
>>>>   a footnote is defined in a paragraph that is started by a footnote
>>>>   marker in square brackets in column 0, no indentation allowed. If you
>>>>   need a paragraph break inside a footnote, use the LaTeX idiom `\par'.
>>>
>>> I am aware of that, but blank lines were allowed after a while.  One
>>> issue was filling.
>>>
>>> Even \par fails to work now.  :(
>>
>> It should now be fixed.  Just replace \par with an empty line.
>
> The fix does not work.
>
> I tried blank line and it still exported verbatim.
>
> I then tried \par, and it still filled the footnote and inserted
> "\par" into it.

I think we're not talking about the same thing. The fix allows empty
lines in regular footnote definitions, not inline ones.

> If this cannot be fixed, then I need some way of filtering to achieve
> it.

Filtering cannot help you here, since you need to, at least, agree with
the structure of the document being parsed.

If you want lists, tables, paragraphs... in a footnote, regular
definitions are the way to go.

If, for some reason, you refuse to use regular definitions, you could
write a hook which would call `org-footnote-normalize', in order to
transform your inline definitions in regular definitions, and then
replace "\par" with an empty line.

That hook function can be added in `org-export-before-parsing-hook'.


Regards,

-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-25  8:09                 ` Nicolas Goaziou
@ 2013-02-26 22:35                   ` Samuel Wales
  2013-02-26 23:24                     ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Samuel Wales @ 2013-02-26 22:35 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 2/25/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> I think we're not talking about the same thing. The fix allows empty
> lines in regular footnote definitions, not inline ones.

This thread's subject is inline footnotes, in which
paragraphs worked well for me in the old exporter and do not
work for me now.  So your reply made it seem like you had
fixed them.


> That hook function can be added in `org-export-before-parsing-hook'.

That doesn't seem to work for me.  After a great deal of
effort I came up with this:

      (add-hook 'org-export-before-parsing-hook
       'alpha-org-export-fix-inline-footnotes)
      (defun alpha-org-export-fix-inline-footnotes (_back-end)
        "Try to get paragraphs to work in inline footnotes
        again."
        ;; this is both slow and buggy
        ;;
        ;; replace every set of blank lines in the buffer with
        ;; \par.  what i really want is to do so only in
        ;; footnotes and to not squeeze multiple blank lines.
        ;;
        ;; this merely does on whole buffer:
        ;; (while (re-search-forward from nil t)
        ;;   (replace-match to t))
        (alpha-replace-re-in-buffer "\\(\n[[:blank:]]*\\)*\n" "\n\\\\par\n")
        (org-footnote-normalize)
        (alpha-replace-re-in-buffer "\\\\par" "\n"))

I am past my limit.  It produces incorrect output:

      this should work without any problems.  this should work

       without any problems.[1] this should work without any
      problems.
       this should work without any problems.



      Footnotes
      _________

      [1] this should work.

      ******* test case
      this should work without any problems.  this should work
      without any problems.[2] this should work without any problems.
      this should work without any problems.

Samuel

-- 
The Kafka Pandemic: [http://thekafkapandemic.blogspot.com]

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.



Footnotes
_________

[1] DEFINITION NOT FOUND.

[2] this should work.

  this should work.

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

* Re: footnotes export verbatim
  2013-02-26 22:35                   ` Samuel Wales
@ 2013-02-26 23:24                     ` Nicolas Goaziou
  2013-02-26 23:28                       ` Nicolas Goaziou
                                         ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-26 23:24 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Hello,

Samuel Wales <samologist@gmail.com> writes:

> That doesn't seem to work for me.  After a great deal of
> effort I came up with this:
>
>       (add-hook 'org-export-before-parsing-hook
>        'alpha-org-export-fix-inline-footnotes)
>       (defun alpha-org-export-fix-inline-footnotes (_back-end)
>         "Try to get paragraphs to work in inline footnotes
>         again."
>         ;; this is both slow and buggy
>         ;;
>         ;; replace every set of blank lines in the buffer with
>         ;; \par.  what i really want is to do so only in
>         ;; footnotes and to not squeeze multiple blank lines.
>         ;;
>         ;; this merely does on whole buffer:
>         ;; (while (re-search-forward from nil t)
>         ;;   (replace-match to t))
>         (alpha-replace-re-in-buffer "\\(\n[[:blank:]]*\\)*\n" "\n\\\\par\n")
>         (org-footnote-normalize)
>         (alpha-replace-re-in-buffer "\\\\par" "\n"))

Try the following:

#+begin_src emacs-lisp
(defun my-par-in-inline-fn (backend)
  (unless (org-export-derived-backend-p backend 'latex)
    (let ((org-footnote-section "My section"))
      (org-footnote-normalize)
      (while (re-search-forward "\\par\\s-*" nil t)
        (replace-match "\n\n")))))

(add-hook 'org-export-before-parsing-hook 'my-par-in-inline-fn)
#+end_src


Regards,

-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-26 23:24                     ` Nicolas Goaziou
@ 2013-02-26 23:28                       ` Nicolas Goaziou
  2013-02-26 23:40                       ` Samuel Wales
  2013-03-19  4:13                       ` Samuel Wales
  2 siblings, 0 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2013-02-26 23:28 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Correcting myself:

> Try the following:
>
> #+begin_src emacs-lisp
> (defun my-par-in-inline-fn (backend)
>   (unless (org-export-derived-backend-p backend 'latex)
>     (let ((org-footnote-section "My section"))
>       (org-footnote-normalize)
>       (while (re-search-forward "\\par\\s-*" nil t)
>         (replace-match "\n\n")))))
>
> (add-hook 'org-export-before-parsing-hook 'my-par-in-inline-fn)
> #+end_src

This should be:

#+begin_src emacs-lisp
(defun my-par-in-inline-fn (backend)
  (unless (org-export-derived-backend-p backend 'latex)
    (org-footnote-normalize)
    (while (re-search-forward "\\par\\s-*" nil t)
      (replace-match "\n\n"))))

(add-hook 'org-export-before-parsing-hook 'my-par-in-inline-fn)
#+end_src


-- 
Nicolas Goaziou

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

* Re: footnotes export verbatim
  2013-02-26 23:24                     ` Nicolas Goaziou
  2013-02-26 23:28                       ` Nicolas Goaziou
@ 2013-02-26 23:40                       ` Samuel Wales
  2013-03-19  4:13                       ` Samuel Wales
  2 siblings, 0 replies; 17+ messages in thread
From: Samuel Wales @ 2013-02-26 23:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

That is better and almost usable now.

It exports "My section" in addition to  "Footnotes".

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is no hope without action.

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

* Re: footnotes export verbatim
  2013-02-26 23:24                     ` Nicolas Goaziou
  2013-02-26 23:28                       ` Nicolas Goaziou
  2013-02-26 23:40                       ` Samuel Wales
@ 2013-03-19  4:13                       ` Samuel Wales
  2 siblings, 0 replies; 17+ messages in thread
From: Samuel Wales @ 2013-03-19  4:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

On 2/26/13, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
> Try the following:

I got it to work.  Thank you.

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is NO hope without action.  This means YOU.

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

end of thread, other threads:[~2013-03-19  4:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-19 20:47 footnotes export verbatim Samuel Wales
2013-02-20 15:18 ` Nicolas Goaziou
2013-02-20 17:21   ` Samuel Wales
2013-02-20 17:32     ` Nicolas Goaziou
2013-02-20 20:13       ` Samuel Wales
2013-02-20 20:43         ` Nicolas Goaziou
2013-02-20 20:59           ` Samuel Wales
2013-02-21 14:27             ` Eric S Fraga
2013-02-23  3:08               ` Samuel Wales
2013-02-24 13:50             ` Nicolas Goaziou
2013-02-24 20:12               ` Samuel Wales
2013-02-25  8:09                 ` Nicolas Goaziou
2013-02-26 22:35                   ` Samuel Wales
2013-02-26 23:24                     ` Nicolas Goaziou
2013-02-26 23:28                       ` Nicolas Goaziou
2013-02-26 23:40                       ` Samuel Wales
2013-03-19  4:13                       ` Samuel Wales

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