1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

oc-csl: Remove spaces before citations in superscript

* lisp/oc-csl.el (org-cite-csl--create-structure): Remove spaces before citation
if it is in superscript.
(org-cite-csl--style-cite-superscript-p): New function to check whether the used
CSL style produces citations in superscript.
This commit is contained in:
Andras Simonyi 2024-05-05 15:58:01 +02:00
parent 43ba00b2b1
commit 288e0a11c2

View File

@ -134,6 +134,7 @@
(declare-function citeproc-render-bib "ext:citeproc") (declare-function citeproc-render-bib "ext:citeproc")
(declare-function citeproc-hash-itemgetter-from-any "ext:citeproc") (declare-function citeproc-hash-itemgetter-from-any "ext:citeproc")
(declare-function citeproc-add-subbib-filters "ext:citeproc") (declare-function citeproc-add-subbib-filters "ext:citeproc")
(declare-function citeproc-style-cite-superscript-p "ext:citeproc")
(declare-function org-element-interpret-data "org-element" (data)) (declare-function org-element-interpret-data "org-element" (data))
(declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated)) (declare-function org-element-map "org-element" (data types fun &optional info first-match no-recursion with-affiliated))
@ -435,6 +436,13 @@ INFO is the export state, as a property list."
(citeproc-proc-style (citeproc-proc-style
(org-cite-csl--processor info)))) (org-cite-csl--processor info))))
(defun org-cite-csl--style-cite-superscript-p (info)
"Non-nil when bibliography style produces citations in superscript.
INFO is the export state, as a property list."
(citeproc-style-cite-superscript-p
(citeproc-proc-style
(org-cite-csl--processor info))))
(defun org-cite-csl--nocite-p (citation info) (defun org-cite-csl--nocite-p (citation info)
"Non-nil when CITATION object's style is nocite. "Non-nil when CITATION object's style is nocite.
INFO is the export state, as a property list." INFO is the export state, as a property list."
@ -681,6 +689,9 @@ INFO is the export state, as a property list."
(when (and (not footnote) (org-cite-csl--note-style-p info)) (when (and (not footnote) (org-cite-csl--note-style-p info))
(org-cite-adjust-note citation info) (org-cite-adjust-note citation info)
(setq footnote (org-cite-wrap-citation citation info))) (setq footnote (org-cite-wrap-citation citation info)))
;; Remove white space before CITATION when it is in superscript.
(when (org-cite-csl--style-cite-superscript-p info)
(org-cite--set-previous-post-blank citation 0 info))
;; Return structure. ;; Return structure.
(apply #'citeproc-citation-create (apply #'citeproc-citation-create
`(:note-index `(:note-index