First off, I'm using a workaround for the problem with closing brackets
terminating a footnote, even if they're supposed to be *within* the
footnote.  Here is the relevant part of my init file...

;; Workaround for the bracket-in-footnote bug.
(add-hook 'org-export-html-final-hook  'gio/replace-square-brackets)
(add-hook 'org-export-ascii-final-hook 'gio/replace-square-brackets)
(add-hook 'org-export-latex-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 b "#93;")  ; use "\]" for LaTeX export
        (setq a1 "[")
        (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))

Now here is my problem, illustrated by an example Org file...

* A heading
This footnote will export to LaTeX improperly.[fn:: Some book at #91;42-24#93;.]
A second footnote to make the visual problem more obvious in a PDF export.[fn::
Another book at #91;13-37#93;.]

It will export to...
#+BEGIN_SRC latex
This footnote will export to \LaTeX{} improperly.\footnote{Some book at 
\[42-24\]. }
#+END_SRC
...but should be...
#+BEGIN_SRC latex
This footnote will export to \LaTeX{} improperly.\footnote{Some book at 
[42-24]. }
#+END_SRC
You will see why this is if you look at a PDF export.

If I don't set the function gio/replace-square-brackets as a
org-export-latex-final-hook, then #91; and #93; are exported literally.
I can't explain the comments...
; use "\[" for LaTeX export
; use "\]" for LaTeX export
are in that function, as I did not write it.

Can anyone with more experience with Org and LaTeX help me out here?
It is very annoying having to manually correct each set of brackets manually for
every LaTeX export.

Thanks,
Aidan

Attachment: signature.asc
Description: Digital signature

_______________________________________________
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

Reply via email to