From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eBj+DJaxkmCBmQAAgWs5BA (envelope-from ) for ; Wed, 05 May 2021 16:54:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UH+CCJaxkmBfPwAAbx9fmQ (envelope-from ) for ; Wed, 05 May 2021 14:54:14 +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 90F12A4D8 for ; Wed, 5 May 2021 16:54:13 +0200 (CEST) Received: from localhost ([::1]:53394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leIuh-0004d7-8y for larch@yhetil.org; Wed, 05 May 2021 10:54:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leIu2-0004ag-GM for emacs-orgmode@gnu.org; Wed, 05 May 2021 10:53:30 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:7101) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leIu0-00050V-1h for emacs-orgmode@gnu.org; Wed, 05 May 2021 10:53:30 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6A534240004 for ; Wed, 5 May 2021 14:53:24 +0000 (UTC) From: Nicolas Goaziou To: Org Mode List Subject: [wip-cite-new] New natbib processor Mail-Followup-To: Org Mode List Date: Wed, 05 May 2021 16:53:22 +0200 Message-ID: <87eeel44gt.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.193; envelope-from=mail@nicolasgoaziou.fr; helo=relay1-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=1620226453; 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=6kSsHBARVsYjBmOCCocBxbtbppNkCH2ETgcztCIs3MI=; b=edtberv2zEW5/LwuFJH88x2g5IZMAjQOZ5jmxc+zFHZAoG2PE19wUOLYqg+A3KnnulJsYG 46LYnFyYrmaoSf5i3AIdE8MTpVdo0W1Icn+aBXvVaVNCwU+TcxbEjN9BxfC5TMJFfzowmd mu49PYqi4p6F1InU9EuJ9jLLzvFVV1sxsk7WILSOqQ8dfME+sTusRPVMqRJU8PUrVtagt0 r7SciQahk6HHVW+8kxitgQB0xfRuaY3lLHnqx/CiJ9djd0pXRfhnpKw5/IcycH+ekdJ70b aVKWG+Xf3kTtg3OUXULgt7Bizl7G1RoCl0XA4jcKMF3P1dx8im+q7NPEWpdq7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620226453; a=rsa-sha256; cv=none; b=l5jlhTV4KfdAXr0vs6g4psdoHl7Geq5KyFRa+QXWKSJS78nqOnxpkZluKEirBWYWJClKji 5yBdk8lLP/M9wIXTMvNOhUU2E6SmT9czW9fJwpbUqfbuGWgPEvTo5vWG0Q+wErRtOwfgOF Yq0S5JdG/3s76C9uUJ+bWLFGAFvj7M3GtYFl4glOZNHSQQMj4b/SAkCpRRCeWqX4tdt/VX DW0hnhpXzRvULG18FiCp7/u8Xlue2O0bnd2/64/JmiCOMqiacn+BIr42Op5c5gLJ8dumqY Mubms/M8UmXpx/gHJlzHnEidky4SiqLZVmETn8b4HRBMFtBqCsW9lTEwoKzP1Q== 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.47 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: 90F12A4D8 X-Spam-Score: -2.47 X-Migadu-Scanner: scn0.migadu.com X-TUID: /FrhCqkbgrKd Hello, Another thread! Yay! I just added a new `natbib' processor in "wip-cite-new" branch, in the file "oc-natbib.el" --8<---------------cut here---------------start------------->8--- This library registers the `natbib' citation processor, which provides the "export" capability for citations. The processor relies on "natbib" LaTeX package. As such it ensures that the package is properly required in the generated document. More precisely, it will use any "\\usepackage{natbib}" command already present in the document (e.g., through `org-latex-packages-alist'), or insert one using options defined in `org-cite-natbib-options'. It supports the following citation styles, in addition to the default author-year format: "text" or "t", "author" or "a", "year" or "y". It also supports the following sub-styles: "caps", "alt", and "full". Bibliography accepts any style supported by natbib package. --8<---------------cut here---------------end--------------->8--- As noted, this processor implements "sub-styles", i.e. additional styles separated with forward slash character. E.g., [cite/text/alt/full:...] => \citealt*{...} [cite//alt/caps:...] => \Citealp{...} (// means default style) However, I'm not convinced by them. On the bright side, sub-styles can be put in any order, so we're avoiding combinatorial explosion of commands. However, they do not play well with shortcuts. For example, if shortcut for "caps" is "C" and "full" is "F", [cite/text/caps/full:...] is equivalent to [cite/t/C/f:...] which is not great. Also it introduces ambiguities in style inheritance. For example, if I add #+cite_export: natbib plainnat text would [cite//alt/caps:...] mean [cite/text/alt/caps:...] (i.e., \Citealt{...}) or really [cite//alt/caps:] (i.e., \Citealp{...}) ? I'd favor keeping only one level for styles is more reasonable. It means implementing one style for each variant, e.g., "text-alt-caps" where the order matters ("text-caps-alt" may not be supported), but it permits more compact shortcuts, e.g., "Alt" for "text-alt-caps"). It also eschews the inheritance pitfall above. Also, completion front-ends can alleviate the burden of memorizing all those styles. Anyway, for now it's sub-styles. Please let me know what you think about them, and about the processor, in general. I couldn't test it much because the test bibliography I have is apparently "not compatible with author-year citations". As a reminder, to test it, you (require 'oc-natbib) to register the processor, and add "#+cite_export: natbib" in your document (or set `org-cite-export-processor' to (natbib)). Regards, -- Nicolas Goaziou