emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [RFC PATCH] oc-csl: Add support for title, locators and bibentry styles
@ 2022-08-02 11:14 András Simonyi
  2022-08-02 12:08 ` Bruce D'Arcus
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: András Simonyi @ 2022-08-02 11:14 UTC (permalink / raw)
  To: emacs-orgmode list

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

Dear All,

the attached patch adds support for three new citation styles which
recently got supported by citeproc-el:

- cite/title or cite/ti to cite only the title of an item,
- cite/locators or cite/l to cite only the locators, and
- cite/bibentry or cite/b to cite the full bibliography entry.

I put "RFC" in the subject because I'm not entirely sure about naming
the "bibentry" style, since "bibentry" is natbib terminology, I think,
and biblatex's corresponding command is \fullcite, but I find
"bibentry" slightly more adequate. Also, do we need the "ti"
abbreviation for the "title" style?

thanks and best wishes,
András

[-- Attachment #2: 0001-oc-csl-Add-support-for-title-locators-and-bibentry-c.patch --]
[-- Type: text/x-patch, Size: 2297 bytes --]

From 09b3619693cf4979212d828a0452741e00fca8a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A1s=20Simonyi?= <andras.simonyi@gmail.com>
Date: Tue, 2 Aug 2022 11:32:17 +0200
Subject: [PATCH] oc-csl: Add support for title, locators and bibentry citation
 styles

---
 lisp/oc-csl.el | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 0b2fe5c41..d84c97e69 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -61,7 +61,10 @@
 ;; - noauthor (na), including bare (b), caps (c) and bare-caps (bc) variants,
 ;; - nocite (n),
 ;; - year (y), including a bare (b) variant,
-;; - text (t). including caps (c), full (f), and caps-full (cf) variants,
+;; - text (t), including caps (c), full (f), and caps-full (cf) variants,
+;; - title (ti), including a bare (b) variant,
+;; - locators (l), including a bare (b) variant,
+;; - bibentry (b), including a bare (b) variant,
 ;; - default style, including bare (b), caps (c) and bare-caps (bc) variants.
 ;;
 ;; Using "*" as a key in a nocite citation includes all available items in
@@ -349,6 +352,21 @@ a property list."
        (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
@@ -730,7 +748,10 @@ property list."
     (("year" "y") ("bare" "b"))
     (("text" "t") ("caps" "c") ("full" "f") ("caps-full" "cf"))
     (("nil") ("bare" "b") ("caps" "c") ("bare-caps" "bc"))
-    (("nocite" "n"))))
+    (("nocite" "n"))
+    (("title" "ti") ("bare" "b"))
+    (("bibentry" "b") ("bare" "b"))
+    (("locators" "l") ("bare" "b"))))
 
 (provide 'oc-csl)
 ;;; oc-csl.el ends here
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-08-13 14:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-02 11:14 [RFC PATCH] oc-csl: Add support for title, locators and bibentry styles András Simonyi
2022-08-02 12:08 ` Bruce D'Arcus
2022-08-07  9:46 ` Ihor Radchenko
2022-08-08 17:01   ` András Simonyi
2022-08-09 12:03     ` Ihor Radchenko
2022-08-09 15:38 ` Rudolf Adamkovič
2022-08-13 12:30   ` András Simonyi
2022-08-13 14:01     ` Bruce D'Arcus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).