Skip to content

Commit

Permalink
Don't use non-default citation modes for numeric styles
Browse files Browse the repository at this point in the history
  • Loading branch information
andras-simonyi committed Mar 2, 2024
1 parent eed63af commit 259d434
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions citeproc-cite.el
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,17 @@ For the optional INTERNAL-LINKS argument see

(defun citeproc-proc-apply-citation-modes (proc)
"Apply mode to the first cite in each citation in PROC."
(dolist (citation (queue-head (citeproc-proc-citations proc)))
(let ((mode (citeproc-citation-mode citation))
(cites (citeproc-citation-cites citation))
(ignore-et-al (citeproc-citation-ignore-et-al citation)))
(-when-let (mode-rep
(alist-get mode citeproc-cite--from-mode-alist))
(setf (car cites) (nconc (car cites) mode-rep)))
(when ignore-et-al
(push '(ignore-et-al . t) (car cites))))))
(let ((category (citeproc-style-category (citeproc-proc-style proc))))
(when (not (member category '("numeric" "label")))
(dolist (citation (queue-head (citeproc-proc-citations proc)))
(let ((mode (citeproc-citation-mode citation))
(cites (citeproc-citation-cites citation))
(ignore-et-al (citeproc-citation-ignore-et-al citation)))
(-when-let (mode-rep
(alist-get mode citeproc-cite--from-mode-alist))
(setf (car cites) (nconc (car cites) mode-rep)))
(when ignore-et-al
(push '(ignore-et-al . t) (car cites))))))))

(defun citeproc-proc-group-and-collapse-cites (proc)
"Group and collapse cites in all citations of PROC."
Expand Down

0 comments on commit 259d434

Please sign in to comment.