Re: [Orgmode] Footnote export

2010-07-31 Thread Typhoon
On Sat, 31 Jul 2010 07:27:50 +0200
Jan Böcker jan.boec...@jboecker.de wrote:

 On 07/31/2010 05:17 AM, Typhoon wrote:
  I write legal texts and often need to reference case law like this:
  
  /Pyke v The Hibernian Bank Limited/ [1950] IR 195
  
  Obviously, I don't want the [1950] to be a footnote. What do I do?
  
  Thanks,
  Alan
  
 
 Hi Alan,
 
 you can add the following line:
 #+OPTIONS: f:nil
 
 at the start of your Org file to disable footnotes entirely. For more
 information, see 12.3 Export Options in the manual.
 
 You could also insert the unicode character zero width space after
 the opening bracket like this:
 
 M-x ucs-insert 200B RET
 
 That is a handy trick I got from reading this very list some time ago
 (sorry, I don't remember who had posted that), although I imagine that
 gets tedious after a while.
 
 I do not know if it is possible to disable plain footnotes while still
 using the [fn:1] syntax.

Yes, thanks. I was using f:nil but what I would really like is to
disable [1] type footnotes while retaining the [fn:1] style.

Nice trick on the zero-space - That would be OK, I suppose, but like
you say, a bit tedious after a while.

Cheers,
Alan

 
 HTH, Jan
 


-- 
Alan L Tyreehttp://www2.austlii.edu.au/~alan
Tel:  04 2748 6206


___
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] Footnote export

2010-07-31 Thread Jan Böcker
On 07/31/2010 08:32 AM, Typhoon wrote:
 
 Yes, thanks. I was using f:nil but what I would really like is to
 disable [1] type footnotes while retaining the [fn:1] style.
 
 Nice trick on the zero-space - That would be OK, I suppose, but like
 you say, a bit tedious after a while.
 

Alright, so we know a way to do what we want (although it is possibly
not the most elegant method), but it is a tedious, repetitive task. No
worries, that's what computers are for!

Add the following to your .emacs:

(defun jb/disable-plain-footnotes-hack ()
  (if (plist-get opt-plist :no-plain-footnotes)
  (save-excursion
(goto-char 1)
(replace-regexp \\[\\([0-9]+\\)\\] [\u200B\\1]

(add-to-list 'org-export-inbuffer-options-extra
'(DISABLE_PLAIN_FOOTNOTES :no-plain-footnotes))

(add-hook 'org-export-preprocess-hook 'jb/disable-plain-footnotes-hack)


To disable plain footnotes, you can now add a line like this to your Org
file:
#+DISABLE_PLAIN_FOOTNOTES: some arbitrary text

Hope this works and solves your problem for now.

Jan

___
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] Footnote export

2010-07-30 Thread Jan Böcker
On 07/31/2010 05:17 AM, Typhoon wrote:
 I write legal texts and often need to reference case law like this:
 
 /Pyke v The Hibernian Bank Limited/ [1950] IR 195
 
 Obviously, I don't want the [1950] to be a footnote. What do I do?
 
 Thanks,
 Alan
 

Hi Alan,

you can add the following line:
#+OPTIONS: f:nil

at the start of your Org file to disable footnotes entirely. For more
information, see 12.3 Export Options in the manual.

You could also insert the unicode character zero width space after the
opening bracket like this:

M-x ucs-insert 200B RET

That is a handy trick I got from reading this very list some time ago
(sorry, I don't remember who had posted that), although I imagine that
gets tedious after a while.

I do not know if it is possible to disable plain footnotes while still
using the [fn:1] syntax.

HTH, Jan

___
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] footnote export fails if footnote indented

2010-04-16 Thread Dan Davison
Carsten Dominik domi...@uva.nl writes:

 Hi Dan,

 have you given this patch any serious testing, and do you have
 any remarks about it?

Hi Carsten,

I hadn't forgotten about this but I have been conscious that I wasn't
giving it the testing it deserved. I don't export with footnotes that
much, and when I do it tends to be to HTML. So I haven't noticed any
problems, but perhaps some others who use footnotes more seriously than
me could test out this patch for a bit? Sorry, I know I should have sent
this email ages ago!

Dan


--8---cut here---start-8---
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 84cd7b3..e9a2822 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -62,7 +62,7 @@
   Regular expression for matching footnotes.)
 
 (defconst org-footnote-definition-re
-  (org-re ^\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\))
+  (org-re ^[ \t]*\\(\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\]\\))
   Regular expression matching the definition of a footnote.)
 
 (defcustom org-footnote-section Footnotes
@@ -143,7 +143,12 @@ extracted will be filled again.
 (defun org-footnote-at-reference-p ()
   Is the cursor at a footnote reference?
 If yes, return the beginning position, the label, and the definition, if 
local.
-  (when (org-in-regexp org-footnote-re 15)
+  (when (and (org-in-regexp org-footnote-re 15)
+(save-excursion
+  (goto-char (match-beginning 0))
+  (progn (if (equal (char-after) ?\n) (forward-char 1)) t)
+  (save-match-data
+(string-match \\S- (buffer-substring (point-at-bol) 
(point))
 (list (match-beginning 0)
  (or (match-string 1)
  (if (equal (match-string 2) fn:) nil (match-string 2)))
@@ -167,7 +172,7 @@ with start and label of the footnote if there is a 
definition at point.
   (interactive sLabel: )
   (org-mark-ring-push)
   (setq label (org-footnote-normalize-label label))
-  (let ((re (format ^\\[%s\\]\\|.\\[%s: label label))
+  (let ((re (format ^[ \t]*\\[%s\\]\\|.\\[%s: label label))
pos)
 (save-excursion
   (setq pos (or (re-search-forward re nil t)
@@ -385,13 +390,13 @@ referenced sequence.
 (setq def (org-trim def))
   (save-excursion
 (goto-char (point-min))
-(if (not (re-search-forward (concat ^\\[ (regexp-quote ref)
+(if (not (re-search-forward (concat ^[ \t]*\\[ (regexp-quote 
ref)
 \\]) nil t))
 (setq def nil)
   (setq beg (match-beginning 0))
   (setq beg1 (match-end 0))
   (re-search-forward
-   (org-re ^[ \t]*$\\|^\\*+ 
\\|^\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\])
+   (org-re ^[ \t]*$\\|^\\*+ \\|^[ 
\t]*\\[\\([0-9]+\\|fn:[-_[:word:]]+\\)\\])
nil 'move)
   (setq def (buffer-substring beg1 (or (match-beginning 0)
(point-max
@@ -524,14 +529,14 @@ and all references of a footnote label.
  (goto-char (point-min))
  (while (re-search-forward org-footnote-re nil t)
(setq l (or (match-string 1) (match-string 2)))
-   (when (equal l label)
+   (when (and (equal l label) (org-footnote-at-reference-p))
  (delete-region (1+ (match-beginning 0)) (match-end 0))
  (incf nref)))
  (goto-char (point-min))
- (setq def-re (concat ^\\[ (regexp-quote label) \\]))
+ (setq def-re (concat ^[ \t]*\\[ (regexp-quote label) \\]))
  (while (re-search-forward def-re nil t)
(setq beg (match-beginning 0))
-   (if (re-search-forward ^\\[\\|^[ \t]*$\\|^\\*+  nil t)
+   (if (re-search-forward ^[ \t]*\\[\\|^[ \t]*$\\|^\\*+  nil t)
(goto-char (match-beginning 0))
  (goto-char (point-max)))
(delete-region beg (point))
@@ -567,7 +572,7 @@ and all references of a footnote label.
   (org-footnote-normalize 'sort)
   (when label
(goto-char (point-min))
-   (and (re-search-forward (concat ^\\[ (regexp-quote label) \\])
+   (and (re-search-forward (concat ^[ \t]*\\[ (regexp-quote label) \\])
nil t)
 (progn (insert  )
(just-one-space)))
--8---cut here---end---8---




 Thanks.

 - Carsten

 On Jan 13, 2010, at 11:51 AM, Carsten Dominik wrote:


 On Jan 12, 2010, at 10:37 PM, Dan Davison wrote:

 If you hit TAB on a footnote definition, it indents it away from
 column 1, to align with its heading. However, the footnote definition
 needs to start in column 1 in order for the footnote to be correctly
 exported. It would be nice if the footnote exported correctly even
 when
 indented (or if that's problematic, then a less preferable solution
 would be 

Re: [Orgmode] footnote export fails if footnote indented

2010-04-16 Thread Samuel Wales
Here are 2 test cases for footnotes.  Perhaps they can be put in a
test directory somewhere if they are useful.

My old relatively thorough test case with 11 specific documented
points to test for:

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg10877.html

And my recent one, sloppily put together and reproduced here:

* top
*** an article
sadfkaj sdnfklaj nsfklandsf
asd flkajnd sfa
*** an article.  exporting this to ascii does not export anonymous footnotes
I sometimes[fn:3] mix regular[fn:1] footnotes and inline
[fn:: There are issues here.  For example, I have to type
them in manually.  You cannot leave empty; it won't accept
it.  Maybe it has to do with my ido setup.  Exporting this
to ASCII seems to silent fail.  I tried fn:: text and
fn::text.] ones[fn:2].

===

[fn:1] ordinary.  note that if you put point here and do c-c
c-c, you will get sent to the next article, which is
disconcerting.  i expected it to go up to the thing that
points to it.  this situation, where you have duplicate
footnote numbers in the same file, but different org
entries, is very common when you refile an article.
\par
don't know how to separate paragraphs in a footnote in
a way that fill-paragraph with filladapt will understand.
would be nice if a way were possible, imo.

[fn:2] another

[fn:3] a third
# a comment
*** another article
ordinary [fn:1], inline[fn:This is a test.], and
regular[fn:2] footnotes.

===

[fn:1] regular

[fn:2] usual
*** another article
asdfj alkdfn akljdn fklajdf
askdfn al;ksjnf lajdnf klajdnf
skjdhflakjdnf klajnf [fn:1]

[fn:1] test
*** another article
asdknf lakjdnf ak
asdkjfn aldjf


On 2010-04-16, Dan Davison davi...@stats.ox.ac.uk wrote:
 I hadn't forgotten about this but I have been conscious that I wasn't
 giving it the testing it deserved. I don't export with footnotes that
 much, and when I do it tends to be to HTML. So I haven't noticed any
 problems, but perhaps some others who use footnotes more seriously than
 me could test out this patch for a bit? Sorry, I know I should have sent
 this email ages ago!

-- 
Q: How many CDC scientists does it take to change a lightbulb?
A: You only think it's dark. [CDC has denied a deadly disease for 25 years]
==
Retrovirus: http://www.wpinstitute.org/xmrv/index.html


___
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] footnote export fails if footnote indented

2010-04-16 Thread Dan Davison
Samuel Wales samolog...@gmail.com writes:

 Here are 2 test cases for footnotes.  Perhaps they can be put in a
 test directory somewhere if they are useful.

Hi Samuel,

Thanks. You have obviously thought about this a lot more carefully than
me. Is there any chance you could run your test files with Carsten's
patch, with the footnote definitions tab indented away from the left
margin, and report on whether the patch introduces any new problems? I
did quickly try exporting your file but I wasn't sure how to interpret
the output.

Dan


 My old relatively thorough test case with 11 specific documented
 points to test for:

 http://www.mail-archive.com/emacs-orgmode@gnu.org/msg10877.html

 And my recent one, sloppily put together and reproduced here:

 * top
 *** an article
 sadfkaj sdnfklaj nsfklandsf
 asd flkajnd sfa
 *** an article.  exporting this to ascii does not export anonymous footnotes
 I sometimes[fn:3] mix regular[fn:1] footnotes and inline
 [fn:: There are issues here.  For example, I have to type
 them in manually.  You cannot leave empty; it won't accept
 it.  Maybe it has to do with my ido setup.  Exporting this
 to ASCII seems to silent fail.  I tried fn:: text and
 fn::text.] ones[fn:2].

 ===

 [fn:1] ordinary.  note that if you put point here and do c-c
 c-c, you will get sent to the next article, which is
 disconcerting.  i expected it to go up to the thing that
 points to it.  this situation, where you have duplicate
 footnote numbers in the same file, but different org
 entries, is very common when you refile an article.
 \par
 don't know how to separate paragraphs in a footnote in
 a way that fill-paragraph with filladapt will understand.
 would be nice if a way were possible, imo.

 [fn:2] another

 [fn:3] a third
 # a comment
 *** another article
 ordinary [fn:1], inline[fn:This is a test.], and
 regular[fn:2] footnotes.

 ===

 [fn:1] regular

 [fn:2] usual
 *** another article
 asdfj alkdfn akljdn fklajdf
 askdfn al;ksjnf lajdnf klajdnf
 skjdhflakjdnf klajnf [fn:1]

 [fn:1] test
 *** another article
 asdknf lakjdnf ak
 asdkjfn aldjf


 On 2010-04-16, Dan Davison davi...@stats.ox.ac.uk wrote:
 I hadn't forgotten about this but I have been conscious that I wasn't
 giving it the testing it deserved. I don't export with footnotes that
 much, and when I do it tends to be to HTML. So I haven't noticed any
 problems, but perhaps some others who use footnotes more seriously than
 me could test out this patch for a bit? Sorry, I know I should have sent
 this email ages ago!


___
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] footnote export fails if footnote indented

2010-04-16 Thread Samuel Wales
On 2010-04-16, Dan Davison davi...@stats.ox.ac.uk wrote:
 Samuel Wales samolog...@gmail.com writes:

 Here are 2 test cases for footnotes.  Perhaps they can be put in a
 test directory somewhere if they are useful.

 Hi Samuel,

 Thanks. You have obviously thought about this a lot more carefully than
 me. Is there any chance you could run your test files with Carsten's
 patch, with the footnote definitions tab indented away from the left
 margin, and report on whether the patch introduces any new problems? I
 did quickly try exporting your file but I wasn't sure how to interpret
 the output.

For health reasons, I cannot at this time.


 Dan


 My old relatively thorough test case with 11 specific documented
 points to test for:

 http://www.mail-archive.com/emacs-orgmode@gnu.org/msg10877.html

 And my recent one, sloppily put together and reproduced here:

 * top
 *** an article
 sadfkaj sdnfklaj nsfklandsf
 asd flkajnd sfa
 *** an article.  exporting this to ascii does not export anonymous
 footnotes
 I sometimes[fn:3] mix regular[fn:1] footnotes and inline
 [fn:: There are issues here.  For example, I have to type
 them in manually.  You cannot leave empty; it won't accept
 it.  Maybe it has to do with my ido setup.  Exporting this
 to ASCII seems to silent fail.  I tried fn:: text and
 fn::text.] ones[fn:2].

 ===

 [fn:1] ordinary.  note that if you put point here and do c-c
 c-c, you will get sent to the next article, which is
 disconcerting.  i expected it to go up to the thing that
 points to it.  this situation, where you have duplicate
 footnote numbers in the same file, but different org
 entries, is very common when you refile an article.
 \par
 don't know how to separate paragraphs in a footnote in
 a way that fill-paragraph with filladapt will understand.
 would be nice if a way were possible, imo.

 [fn:2] another

 [fn:3] a third
 # a comment
 *** another article
 ordinary [fn:1], inline[fn:This is a test.], and
 regular[fn:2] footnotes.

 ===

 [fn:1] regular

 [fn:2] usual
 *** another article
 asdfj alkdfn akljdn fklajdf
 askdfn al;ksjnf lajdnf klajdnf
 skjdhflakjdnf klajnf [fn:1]

 [fn:1] test
 *** another article
 asdknf lakjdnf ak
 asdkjfn aldjf


 On 2010-04-16, Dan Davison davi...@stats.ox.ac.uk wrote:
 I hadn't forgotten about this but I have been conscious that I wasn't
 giving it the testing it deserved. I don't export with footnotes that
 much, and when I do it tends to be to HTML. So I haven't noticed any
 problems, but perhaps some others who use footnotes more seriously than
 me could test out this patch for a bit? Sorry, I know I should have sent
 this email ages ago!



-- 
Q: How many CDC scientists does it take to change a lightbulb?
A: You only think it's dark. [CDC has denied a deadly disease for 25 years]
==
Retrovirus: http://www.wpinstitute.org/xmrv/index.html


___
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] footnote export fails if footnote indented

2010-01-13 Thread Carsten Dominik


On Jan 12, 2010, at 10:37 PM, Dan Davison wrote:


If you hit TAB on a footnote definition, it indents it away from
column 1, to align with its heading. However, the footnote definition
needs to start in column 1 in order for the footnote to be correctly
exported. It would be nice if the footnote exported correctly even  
when

indented (or if that's problematic, then a less preferable solution
would be having TAB not indent it).


Hi Dan,

here is a patch that allows footnote definitions to be detached from  
the left margin.  However, I am not sure if it breaks anything else -  
so extensive testing would be necessary...


Also, renumbering footnotes etc will put them back at the margin  
currently.  I am not sure how that should be handled otherwise


- Carsten



footnote-detach.patch
Description: Binary data


___
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