[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Bug: Impossible to have right bracket in footnotes [7.01tr
From: |
Giovanni Ridolfi |
Subject: |
Re: [Orgmode] Bug: Impossible to have right bracket in footnotes [7.01trans] |
Date: |
Tue, 31 Aug 2010 16:13:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) |
Carsten Dominik <address@hidden> writes:
> unfortunately this is difficult to fix in a good way.
> I do want to go back to footnotes, because I think there are many
> things that do not yet work satisfactorily. And then I also hope to
> address the issue you raised. For the time being, unfortunately, I do
> not have a solution for you.
I have a workaround.
If the author uses the a special code for [ and ], e.g.
#91; and #93; then the note is exported correctly.
--------------------------------------------------------
** example
This is not anymore a broken footnote.[fn:: Some book at #91; 42-24 #93;.]
Exports to:
This is not anymore broken footnote.[1]
[1] Some book at #91; 42-24 #93;.
----------------------------------------------------------
But then the file have to be post-processed to substitute #91; and #93;
Place these lines in .emacs, or evaluate them (goto the last ") " and hit C-x
C-e)
for the current session :
----------------------------------------------------------------------
(add-hook 'org-export-html-final-hook 'gio/replace-square-brackets)
(add-hook 'org-export-ascii-final-hook 'gio/replace-square-brackets)
(defun gio/replace-square-brackets ()
"Replace #91; with [ and #93; with ] "
(interactive)
(setq a "#91;") ; use "\[" for LaTeX export
(setq a1 "[")
(setq b "#93;") ; use "\]" for LaTeX export
(setq b1 "]")
(ignore-errors (goto-char 1) (setq p (point))
(while (< p (point-max))
(re-search-forward a nil nil) (replace-match a1) (setq p (point)) ) )
;;
(ignore-errors (goto-char 1) (setq p (point))
(while (< p (point-max))
(re-search-forward b nil nil) (replace-match b1) (setq p (point)) ) )
(save-buffer) )
----------------------------------------------------------
Tested for HTML, ASCII.
For the LaTeX export the line:
This is not anymore a broken footnote.[fn:: Some book at #91;
42-24#93;.]
exports to:
This is not anymore a broken footnote.\footnote{Some book at \[
42-24 \]. }
So the LaTeX seems to convert directly the #9?; character.
Not tested for docbook.
HTH
Giovanni