From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4K0iHSCyrmC3SwEAgWs5BA (envelope-from ) for ; Wed, 26 May 2021 22:40:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EDnkGCCyrmAmLgAA1q6Kng (envelope-from ) for ; Wed, 26 May 2021 20:40:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C3D0C11DDB for ; Wed, 26 May 2021 22:39:59 +0200 (CEST) Received: from localhost ([::1]:40356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm0Jo-0006IC-Uu for larch@yhetil.org; Wed, 26 May 2021 16:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm0DM-0001Pa-N9 for emacs-orgmode@gnu.org; Wed, 26 May 2021 16:33:22 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:50063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm0DD-00070L-GK for emacs-orgmode@gnu.org; Wed, 26 May 2021 16:33:14 -0400 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 053ED100002; Wed, 26 May 2021 20:33:03 +0000 (UTC) From: Nicolas Goaziou To: Org Mode List Subject: [wip-cite-new] Initial implementation of `csl' citation processor Mail-Followup-To: Org Mode List , =?utf-8?Q?Andr?= =?utf-8?Q?=C3=A1s?= Simonyi Date: Wed, 26 May 2021 22:33:02 +0200 Message-ID: <87y2c1dym9.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=217.70.178.231; envelope-from=mail@nicolasgoaziou.fr; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?Q?Andr=C3=A1s?= Simonyi Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622061599; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=C6EANK3+JslXxRLg6ZJmgTsU5jOxGQhAlOW6zZEJTm0=; b=nFSvCSbilntdSwyYSj4xGiD45rpVMnueqOSSmi/kAd/E/TAoy5Tkt3yZkupJI9uXbyvt7e 7/m+pEmwvPY5XOfZLxD0+M2tbz9rCWsNQRy//J0Ryk13+S1Qpe+36yuts93IxEqFgnaDYZ J5/n0Oq67nVO/3x7885pSRUQRVttccyt6ltSj/I9c42bRz7HpPhvw8LqLm/nwZqV1osTP5 +bZXWo/H0D6wQL3aG0BVWNjH34ehDrCQQzRS/anLmfcXCqPFdQofSdOvMgPFqldrruOJt+ Mlh/bswDO2lFs8ZwQcoXZbZwt/yjuGsLPPnwQUPfh3yL5P9arcX2Tta+27FKSw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622061599; a=rsa-sha256; cv=none; b=uq7XtlwnfntZ2jdincxj7eKBey2V+6WONfdr/S4B5GYHsOdnX8eNxyF1mmyfmlHvaBV/wX g66aW/ABhEClDaTernEaw7oRJmOcDUdIEW0REQb35O9f54IIAticDNsAU4QcjhTUm+mkRm j6lsBqln6d0tUaVHE8GMZZwIXseuumY4jLssIqlwZH8iGyMdfxazsKRLeVsb9MpebMhPnN aMXE5Wr8CMIFydZuezRbBY45Ub1AjWQuPKulbp6ofyc1HMZiq4VFgDa/5pgV7E4wcitDAr h+WNf9vfYe8QAr68nUnThRQN4/vmAesRQcoXfu33ohr0HCv3hxlckquQJWcaxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C3D0C11DDB X-Spam-Score: -2.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: EhsWigcxTMQp Hello, I just pushed a Citeproc-based citation processor. As such, Citeproc library must be available in the load path. For a better experience, your also need to download styles, and possibly locales definitions, as pointed in the commentary section pasted below. I called it `csl' instead of `citeproc'. It is a bit ambiguous, but it is shorter, and "org-cite-csl" prefix sounds less redudant than "org-cite-citeproc...". Also, I don't expect a different CSL-based citation processor any time soon, so it should be fine. But I know this is a weak argument, so if you think "citeproc" is still more appropriate, I can revisit this. As pointed out in the commentary section, this is, for a large part, a port of Andr=C3=A1s Simonyi's Citeproc Org library. Thanks! There are some differences between the two libraries, however. For example, Org Cite CSL does not support Org Ref links. It also provides less customization options. OTOH, it supports ".bib", ".bibtex" and ".json" bibliography files. It also handles author suppression and global affixes in citations. This patch adds two files in a new "etc/csl/" directory. They are both licensed under CC BY-SA 3.0 terms. So I assume this is fine to distribute them with Org. Here is the full commentary. Feedback welcome! --8<---------------cut here---------------start------------->8--- This library registers the `csl' citation processor, which provides the "export" capability for citations. You may activate it globally with (setq org-cite-export-processor '(csl)) or at the document level, with #+cite_export: csl The processor relies on the external Citeproc Emacs library, which must be available prior to loading this library. By default, citations are rendered in Chicago author-date CSL style. You c= an use another style file by specifying it in `org-cite-export-processor' (setq org-cite-export-processor '(csl "/path/to/style-file.csl") or from within the document by adding the file name to "cite_export" keyword #+cite_export: csl /path/to/style-file.csl #+cite_export: csl "/path/to/style-file.csl" Styles can be downloaded, for instance, from the Zotero Style Repository (). Dependent styles (which are not "unique" in the Zotero Style Repository terminology) are not supported. The processor uses the "en-US" CSL locale file shipped with Org for renderi= ng localized dates and terms in the references, independently of the language settings of the Org document. Additional CSL locales can be made available by setting `org-cite-csl-locales-dir' to a directory containing the locale files in question (see for such files). The directory must contain at least the "en-US" CSL local= e. Bibliography is defined with the "bibliography" keyword. It supports files with ".bib", ".bibtex", and ".json" extensions. References are exported us= ing the "print_bibliography" keyword. The library supports the following citation styles: - noauthor (na), including bare (b) variant, - default style, including bare (b) variant. CSL styles recognize "locator" in citation references' suffix. For example, in the citation [cite:see @Tarski-1965 chapter 1, for an example] "chapter 1" is the locator. The whole citation is rendered as (see Tarski 1965, chap. 1 for an example) in the default CSL style. The locator starts with a locator term, among "bk.", "bks.", "book", "chap.= ", "chaps.", "chapter", "col.", "cols.", "column", "figure", "fig.", "figs.", "folio", "fol.", "fols.", "number", "no.", "nos.", "line", "l.", "ll.", "note", "n.", "nn.", "opus", "op.", "opp.", "page", "p.", "pp.", "paragraph= ", "para.", "paras.", "=C2=B6", "=C2=B6=C2=B6", "=C2=A7", "=C2=A7=C2=A7", "par= t", "pt.", "pts.", "section", "sec.", "secs.", "sub verbo", "s.v.", "s.vv.", "verse", "v.", "vv.", "volume", "vol.", and "vols.". It ends with the last comma or digit in the suffix, whichever comes last, or runs till the end of the suffix. The part of the suffix before the locator is appended to reference's prefix. If no locator term is used, but a number is present, then "page" is assumed. This library was heavily inspired by and borrows from Andr=C3=A1s Simonyi's Citeproc Org () library. Many thanks to him! --8<---------------cut here---------------end--------------->8--- Regards, --=20 Nicolas Goaziou