From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YMqfFxJhY2NPEgEAbAwnHQ (envelope-from ) for ; Thu, 03 Nov 2022 07:34:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mLWaFxJhY2O8AAAA9RJhRA (envelope-from ) for ; Thu, 03 Nov 2022 07:34:58 +0100 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 0723F29010 for ; Thu, 3 Nov 2022 07:34:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqTnI-0007AW-Mh; Thu, 03 Nov 2022 02:33:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqTnG-0007A5-CW for emacs-orgmode@gnu.org; Thu, 03 Nov 2022 02:33:38 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqTnD-0001Ry-U3 for emacs-orgmode@gnu.org; Thu, 03 Nov 2022 02:33:38 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 04BF7240027 for ; Thu, 3 Nov 2022 07:33:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1667457214; bh=Fudf30Z3nkWsatYFiyHW9BIddVBTsDF/xeOlqaBedEE=; h=From:To:Cc:Subject:Date:From; b=Orm3nKXsZgm9RohVWQq88Qjw7Dq97iAJAvngRIpoW/mApN+tir7FxUj22YEgGNDSx xNQaGH2oJ0Ov++17JtL9ywptus/miPTTx16HX57luubY8cgTOReAE5O44cO68/TRWH SCsi4NLDMSxP7seyA+LDRlqY5w/ne4dR8OK6yyv5ZyiTIqCyz5xUqnhgWymhNd4ADl ZjOYv2hRPtEUYsrf7YLT0OpyZFIv5Ob1NEE5+d2g6klqIYXSH/f2nCcSXNl1wbpzfY YJjWidjqzBnNlOE7/Pt0nlFKMiZCjvkkNpBbfUaG3d9G7MX0m45Fsv7VNJMr74+eId 1S3Ie1EUzhBTQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N2v8r59XBz6tqC; Thu, 3 Nov 2022 07:33:32 +0100 (CET) From: Ihor Radchenko To: =?utf-8?Q?Andr=C3=A1s?= Simonyi Cc: emacs-orgmode list Subject: Re: [PATCH][oc-csl] Improve reference parsing In-Reply-To: References: <87r0ytoqi6.fsf@localhost> <87k04dlvie.fsf@localhost> Date: Thu, 03 Nov 2022 06:34:06 +0000 Message-ID: <87zgd87di9.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667457298; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3ks5gZbN0h+wPCcyjiIl904GmU67B8V9N0LV2g/4cp0=; b=JnE5jHV+Q0eMOceG/C7a6h1ZJh96rG2Ij+6LDvMb7LUd7Z4Ws4Sk1/OE4ZosUy3ZdRFJV9 oa6U/tGPxQtPQ+MtdZd0nJ1zWa2NHH/0Y6ZXhA9eo5OdFhtmJyE+IquW3JtmE9vFKfJr4h pHxQsPPprptQIjUdKpeKlqFUPCYYpsjHFPq8C4z2xRZvlULOf8c3XIo0yqjVipXGtOvS3E j8i8DjL8oW5ifhQWz9bWUB+GHIgVLAcMqFEXEdUUEiPqCXf85Z/cen2b/dhHSVwfFWSGFb itHnIRQKy6vdQSDAC/qM3SxG9TkovAYQSKSV8va1dKw+t6qch5o9NEN9k1NPmg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667457298; a=rsa-sha256; cv=none; b=mIcuGO+J7ATARUf0E1FGTAz0h1dq/sXlbtFyQZoTQLQmQ1hAuSsdWMGC8mbBZ11mFZISH+ YyMJ8difUNiZmFO/GEpPhgmtm8F8nUQ5qmLjAfJ0X8dJ/gzNXe8BtytuDyxBUGWdNty6+F 7/mRerrMgxWeGCPyTA3tfbugzmxVr35I5yfSjvP6tHjN7MtKsjaRUyRRYYvLyqxIw2M5gj /EXo/l2ULbzgoypmzywCvZ+O/xCWcUZF/aIXZTjBo/MwbLdWcB/xP2sVddSv7E6O1lRLyW BbQptCDPt6oze6uVtQVZcab+lmUyptk/iMvDk33B4sWoLxofuv+bcyD6bQt2hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Orm3nKXs; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=Orm3nKXs; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0723F29010 X-Spam-Score: -5.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: p6ySLobcezg4 Andr=C3=A1s Simonyi writes: > On Wed, 2 Nov 2022 at 07:28, Ihor Radchenko wrote: > >> I do not think that CSL limitations are really limiting us. > ... > I'm not really familiar with the internals of the Org exporter but, > looking at the ox.el code, macros and babel calls are processed and > resolved before processing citations, so they seemingly have no > bearing on the org-cite-csl--parse-reference function my patch is > concerned with. > Other than macros and babel calls, e.g., timestamps, LaTeX fragments > etc. the problem is that citeproc-el expects and needs the affixes and > locator to be passed in the very limited html-like markup supported by > CSL (see https://www.zotero.org/support/kb/rich_text_bibliography for > a rudimentary description), and, crucially, the assumption is that > everything else is plain text, which, if necessary, will be escaped > according to the target format, i.e., '$' signs are escaped by > citeproc-el's own LaTeX formatter. The reason for this limitation is > that the affixes and especially the locator have to be parsed into > citeproc-el's internal rich-text representation for further processing > according to the used CSL style. (Affixes are only concatenated to > other elements but locators can be the subject of any type of > formatting.) As a consequence, I think the only real alternatives are > using a custom backend as I do in the current patch or a backend > derived from the plain text Org exporter -- I don't have a strong > preference as to which solution we choose, just went with the > seemingly more minimalist option. (The proper way of dealing with > LaTeX fragments in this context, in particular with LaTeX math > fragments, would be to support those in citeproc-el's internal > representation and markup, which is planned but not implemented yet.) Could you please explain in more details why CSL require special export of the prefix/suffix? What will happen if we simply pass the Org markup verbatim? I am asking because org-cite-csl-render-citation uses org-cite-parse-objects so, unless citeproc does something terrible with the original Org syntax, we can re-parse the output string and export appropriately according to the current export backend. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at