oc-biblatex: Spell out multicite commands instead of guessing them

* lisp/oc-biblatex.el (org-cite-biblatex-export-citation): Provide
full multicite command name.
(org-cite-biblatex--command): Use name instead of guessing it from
base name.
This commit is contained in:
Nicolas Goaziou 2021-12-12 10:39:52 +01:00
parent 7e2d9091d0
commit 82bb04be22

View file

@ -170,18 +170,18 @@ INFO is the export state, as a property list."
;; a \relax unconditionally. ;; a \relax unconditionally.
"\\relax"))) "\\relax")))
(defun org-cite-biblatex--command (citation info base &optional multi no-opt) (defun org-cite-biblatex--command (citation info name &optional multi no-opt)
"Return biblatex command using BASE name for CITATION object. "Return BibLaTeX command NAME for CITATION object.
INFO is the export state, as a property list. INFO is the export state, as a property list.
When optional argument MULTI is non-nil, generate a \"multicite\" command when When optional argument MULTI is non-nil, use it as a multicite
appropriate. When optional argument NO-OPT is non-nil, do not add optional command name when appropriate. When optional argument NO-OPT is
arguments to the command." non-nil, do not add optional arguments to the command."
(format "\\%s%s" (if (and multi (org-cite-biblatex--multicite-p citation))
base (format "\\%s%s" multi (org-cite-biblatex--multi-arguments citation info))
(if (and multi (org-cite-biblatex--multicite-p citation)) (format "\\%s%s"
(concat "s" (org-cite-biblatex--multi-arguments citation info)) name
(org-cite-biblatex--atomic-arguments (org-cite-biblatex--atomic-arguments
(org-cite-get-references citation) info no-opt)))) (org-cite-get-references citation) info no-opt))))
@ -241,15 +241,15 @@ INFO is the export state, as a property list."
;; "text" style. ;; "text" style.
(`(,(or "text" "t") . ,variant) (`(,(or "text" "t") . ,variant)
(pcase variant (pcase variant
((or "caps" "c") '("Textcite" t)) ((or "caps" "c") '("Textcite" "Textcites"))
(_ '("textcite" t)))) (_ '("textcite" "textcites"))))
;; Default "nil" style. ;; Default "nil" style.
(`(,_ . ,variant) (`(,_ . ,variant)
(pcase variant (pcase variant
((or "bare" "b") '("cite" t)) ((or "bare" "b") '("cite" "cites"))
((or "caps" "c") '("Autocite" t)) ((or "caps" "c") '("Autocite" "Autocites"))
((or "bare-caps" "bc") '("Cite" t)) ((or "bare-caps" "bc") '("Cite" "Cites"))
(_ '("autocite" t)))) (_ '("autocite" "autocites"))))
;; This should not happen. ;; This should not happen.
(_ (error "Invalid style: %S" style))))) (_ (error "Invalid style: %S" style)))))