diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2014-06-25 07:13:11 -0400 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2014-06-25 07:14:45 -0400 |
commit | 076726fbb647c5c934274ec239c6dbdf2de9d043 (patch) | |
tree | 3a9a57e1f3db36dc0a3fe1c522ec7f87622c3ce7 | |
parent | c9eaea360afc4d0eca9888baa8d44c8a9f4ad46b (diff) | |
download | org-mode-076726fbb647c5c934274ec239c6dbdf2de9d043.tar.gz |
drop cite options for non-latex backends
These options break citation handling for these other backends, so we
should just drop them.
* contrib/lisp/ox-bibtex.el (org-bibtex-merge-contiguous-citations):
Drop citation options for HTML and ASCII export.
-rw-r--r-- | contrib/lisp/ox-bibtex.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index 2274875..fd90071 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -250,8 +250,10 @@ Return new parse tree." (defun org-bibtex-merge-contiguous-citations (tree backend info) "Merge all contiguous citation in parse tree. As a side effect, this filter will also turn all \"cite\" links -into \"\\cite{...}\" LaTeX fragments and will extract options -into square brackets at the beginning of the \"\\cite\" command." +into \"\\cite{...}\" LaTeX fragments and will extract options. +Cite options are placed into square brackets at the beginning of +the \"\\cite\" command for the LaTeX backend, and are removed for +the HTML and ASCII backends." (when (org-export-derived-backend-p backend 'html 'latex 'ascii) (org-element-map tree '(link latex-fragment) (lambda (object) @@ -282,7 +284,8 @@ into square brackets at the beginning of the \"\\cite\" command." (lambda (k) (if (string-match "^(\\([^)]\+\\))\\(.*\\)" k) (progn - (setq option (format "[%s]" (match-string 1 k))) + (when (org-export-derived-backend-p backend 'latex) + (setq option (format "[%s]" (match-string 1 k)))) (match-string 2 k)) k)) keys)) |