Re: [O] footnotes export verbatim

2013-03-18 Thread Samuel Wales
On 2/26/13, Nicolas Goaziou  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.



Re: [O] footnotes export verbatim

2013-02-26 Thread Samuel Wales
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.



Re: [O] footnotes export verbatim

2013-02-26 Thread Nicolas Goaziou
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



Re: [O] footnotes export verbatim

2013-02-26 Thread Nicolas Goaziou
Hello,

Samuel Wales  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" "\npar\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



Re: [O] footnotes export verbatim

2013-02-26 Thread Samuel Wales
On 2/25/13, Nicolas Goaziou  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" "\npar\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.



Re: [O] footnotes export verbatim

2013-02-25 Thread Nicolas Goaziou
Samuel Wales  writes:

> On 2/24/13, Nicolas Goaziou  wrote:
>> Samuel Wales  writes:
>>> On 2/20/13, Nicolas Goaziou  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



Re: [O] footnotes export verbatim

2013-02-24 Thread Samuel Wales
On 2/24/13, Nicolas Goaziou  wrote:
> Samuel Wales  writes:
>> On 2/20/13, Nicolas Goaziou  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.



Re: [O] footnotes export verbatim

2013-02-24 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> On 2/20/13, Nicolas Goaziou  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



Re: [O] footnotes export verbatim

2013-02-22 Thread Samuel Wales
On 2/21/13, Eric S Fraga  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?



Re: [O] footnotes export verbatim

2013-02-21 Thread Eric S Fraga
Samuel Wales  writes:

> On 2/20/13, Nicolas Goaziou  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




Re: [O] footnotes export verbatim

2013-02-20 Thread Samuel Wales
On 2/20/13, Nicolas Goaziou  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.  :(



Re: [O] footnotes export verbatim

2013-02-20 Thread Nicolas Goaziou
Samuel Wales  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



Re: [O] footnotes export verbatim

2013-02-20 Thread Samuel Wales
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.



Re: [O] footnotes export verbatim

2013-02-20 Thread Nicolas Goaziou
Samuel Wales  writes:

> On 2/20/13, Nicolas Goaziou  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



Re: [O] footnotes export verbatim

2013-02-20 Thread Samuel Wales
On 2/20/13, Nicolas Goaziou  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.



Re: [O] footnotes export verbatim

2013-02-20 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

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

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


Regards,

-- 
Nicolas Goaziou