Function: org-cite-csl--create-structure-params

org-cite-csl--create-structure-params is a byte-compiled function defined in oc-csl.el.gz.

Signature

(org-cite-csl--create-structure-params CITATION INFO)

Documentation

Return citeproc structure creation params for CITATION object.

STYLE is the citation style, as a string or nil. INFO is the export state, as a property list.

Source Code

;; Defined in /usr/src/emacs/lisp/org/oc-csl.el.gz
(defun org-cite-csl--create-structure-params (citation info)
  "Return citeproc structure creation params for CITATION object.
STYLE is the citation style, as a string or nil.  INFO is the export
state, as a property list."
  (let ((style (org-cite-citation-style citation info)))
    (pcase style
      ;; "author" style.
      (`(,(or "author" "a") . ,variant)
       (pcase variant
	 ((or "bare" "b") '(:mode author-only :suppress-affixes t))
	 ((or "caps" "c") '(:mode author-only :capitalize-first t))
	 ((or "full" "f") '(:mode author-only :ignore-et-al t))
	 ((or "bare-caps" "bc") '(:mode author-only :suppress-affixes t :capitalize-first t))
	 ((or "bare-full" "bf") '(:mode author-only :suppress-affixes t :ignore-et-al t))
	 ((or "caps-full" "cf") '(:mode author-only :capitalize-first t :ignore-et-al t))
	 ((or "bare-caps-full" "bcf") '(:mode author-only :suppress-affixes t :capitalize-first t :ignore-et-al t))
	 (_ '(:mode author-only))))
      ;; "noauthor" style.
      (`(,(or "noauthor" "na") . ,variant)
       (pcase variant
	 ((or "bare" "b") '(:mode suppress-author :suppress-affixes t))
	 ((or "caps" "c") '(:mode suppress-author :capitalize-first t))
	 ((or "bare-caps" "bc")
          '(:mode suppress-author :suppress-affixes t :capitalize-first t))
	 (_ '(:mode suppress-author))))
      ;; "year" style.
      (`(,(or "year" "y") . ,variant)
       (pcase variant
	 ((or "bare" "b") '(:mode year-only :suppress-affixes t))
	 (_ '(:mode year-only))))
      ;; "bibentry" style.
      (`(,(or "bibentry" "b") . ,variant)
       (pcase variant
	 ((or "bare" "b") '(:mode bib-entry :suppress-affixes t))
	 (_ '(:mode bib-entry))))
      ;; "locators" style.
      (`(,(or "locators" "l") . ,variant)
       (pcase variant
	 ((or "bare" "b") '(:mode locator-only :suppress-affixes t))
	 (_ '(:mode locator-only))))
      ;; "title" style.
      (`(,(or "title" "ti") . ,variant)
       (pcase variant
	 ((or "bare" "b") '(:mode title-only :suppress-affixes t))
	 (_ '(:mode title-only))))
      ;; "text" style.
      (`(,(or "text" "t") . ,variant)
       (pcase variant
         ((or "caps" "c") '(:mode textual :capitalize-first t))
         ((or "full" "f") '(:mode textual :ignore-et-al t))
         ((or "caps-full" "cf") '(:mode textual :ignore-et-al t :capitalize-first t))
         (_ '(:mode textual))))
      ;; Default "nil" style.
      (`(,_ . ,variant)
       (pcase variant
         ((or "caps" "c") '(:capitalize-first t))
         ((or "bare" "b") '(:suppress-affixes t))
         ((or "bare-caps" "bc") '(:suppress-affixes t :capitalize-first t))
         (_  nil)))
      ;; This should not happen.
      (_ (error "Invalid style: %S" style)))))