From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iLBZE0nho2DwZgAAgWs5BA (envelope-from ) for ; Tue, 18 May 2021 17:46:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6M4WD0nho2D9ZgAAB5/wlQ (envelope-from ) for ; Tue, 18 May 2021 15:46:17 +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 A3EC5157C2 for ; Tue, 18 May 2021 17:46:16 +0200 (CEST) Received: from localhost ([::1]:51098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj1vD-0005Vt-Gp for larch@yhetil.org; Tue, 18 May 2021 11:46:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj1Pa-0006dM-Rb for emacs-orgmode@gnu.org; Tue, 18 May 2021 11:13:34 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57051) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj1PX-0002wK-2I for emacs-orgmode@gnu.org; Tue, 18 May 2021 11:13:34 -0400 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 9A09C60015 for ; Tue, 18 May 2021 15:13:23 +0000 (UTC) From: Nicolas Goaziou To: Org Mode List Subject: [wip-cite-new] Initial implementation of `biblatex' citation processor Mail-Followup-To: Org Mode List Date: Tue, 18 May 2021 17:13:22 +0200 Message-ID: <87bl985b3h.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.195; envelope-from=mail@nicolasgoaziou.fr; helo=relay3-d.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_H3=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: , 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=1621352776; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=iOs61A+sMEFmCZKZBdgZI3lVKynUJ0CMLjn8QJQ3LRU=; b=kyXgFXJcBgrek9sp02v4T3TclpdN92qTk7edY17Pb781qg376NyglBtItobgYMzx9djIXs LRloBYsLD1lxis435YnPc2IrEKKXXYgj4PC8JgRE5sqGi1d4A+Hwd9q2/Q0Lo6ghLvJUET fmaBD5+y9esjn9gXqfOZ5DWL+wNJ5C4fMGniAJ0FyEUuyfUW8TBFRA5xP6zbKyEfomsOlj SxVsOoQonbO90UM/3dcfeLv0nYZy0wg7C5aSiEaFgbbR3Bz46QN/rfcU5yNWwIruKujhkB StQ3Nps2bVuSYvAhE5X1HbfWfd4yYMyq+YBxzcZ3v+7Vv5aMcFyu3B6ZBQMvuA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621352776; a=rsa-sha256; cv=none; b=pLgN2VkQRdQVk3mlJHNvNGZivbbmGx8mAkJN8kF/rEkl1vRO1qnVZlHuymbGtQI97x9eX5 jdmgTnco9aWAX4RPdOdsHWrsn9n01J8idGjZlT+xBjaT/Ev65a5P3uu997Nx7CcykWYgh/ Vq4FoygpIShY+PJ6JKpFGQfVZF5wgMByaTNQeZO4HYg400iIpighczKF7tSbKbW9i6u3Tr b2lVCcI+LX4eMHVD12WW61UIg41+7lTdLNmddue2zrRJb5tl77pmE93XAXJveBLTPeDuJV QmhZaxLXY6bqmJq0wKpS+0rMZ8yI51fHQlUFAiC5xqEwErUH0ZwKcOSP5Mbw0g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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.44 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: A3EC5157C2 X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: d3yaYvCBSHmq Hello, In a rebased "wip-cite-new" branch, I made an modest attempt to write a `biblatex' citation processor, in the file "oc-biblatex.el". Here is what is in there. Remarks follow. --8<---------------cut here---------------start------------->8--- This library registers the `biblatex' citation processor, which provides the "export" capability for citations. You may activate it globally with (setq org-cite-export-processor '(biblatex)) or at the document level, with #+cite_export: biblatex The processor relies on "biblatex" LaTeX package. As such it ensures that the package is properly required in the document's preamble. More accurately, it will re-use any "\usepackage{biblatex}" already present in the document (e.g., through `org-latex-packages-alist'), or insert one using options defined in `org-cite-biblatex-options'. In any case, the library will override style-related options with those specified with the citation processor, in `org-cite-export-processor' or "cite_export" keyword. If you need to use different styles for bibliography and citations, you can separate them with "bibstyle/citestyle" syntax. E.g., #+cite_export: natbib authortitle/authortitle-ibid The library supports the following citation styles: - author(a), including caps(c), full(f) and caps-full(f) variants, - locators(l), including bare(b), caps(c) bare-caps(bc) variants, - nocite(n), - note(fn), including bare(b) variant, - smart(sm), including caps(c) variant, - super(s), - text(t), including caps(c) variant, - title(ti), including full(f) variant, - year(y), including full(f) variant, - default style, including caps(c) variant. The default style creates "autocite" commands. When citation and style permit, the library automatically generates "multicite" versions of the commands above. Bibliography is printed using "\printbibliography" command. Additional options may be passed to it through a property list attached to the "print_bibliography" keyword. E.g., #+print_bibliography: :section 2 :heading subbibliography Values including spaces must be surrounded with double quotes. If you need to use a key multiple times, you can separate its values with commas, but without any space in-between: #+print_bibliography: :keyword abc,xyz :title "Primary Sources" --8<---------------cut here---------------end--------------->8--- The first thing worth noticing is that I changed syntax for "print_bibliography" keyword. Previously, it was #+print_bibliography: style but specifying a local style was not so useful. So, now, it accepts a property list instead, as it was suggested in a related message about filtering bibliography. The library distinguishes two citation styles: one for the package itself (e.g., when using "bibstyle/citestyle" syntax), and one for generating the commands (when using #+cite_export: biblatex ... style). Using "style" for both may be misleading. We may use "citation type" to designate constructs like [cite/something:...] instead. I don't use biblatex, but I'm not convinced by the default autocite command. Wouldn't parencite be more predictable? Also, adding #+cite_export biblatex ... auto to trigger autocite by default seems easy enough. In any case, feel free to suggest more styles/types to the list. Is there any crucial feature missing? I didn't test it much so it probably contains silly bugs. Sorry about that. Feedback is highly appreciated. Regards, -- Nicolas Goaziou