From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KJY1L2VL0mPCggEAbAwnHQ (envelope-from ) for ; Thu, 26 Jan 2023 10:44:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id Hj5VLmVL0mNxiwAAG6o9tA (envelope-from ) for ; Thu, 26 Jan 2023 10:44:05 +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 848AA37825 for ; Thu, 26 Jan 2023 10:44:05 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKymj-00083d-PC; Thu, 26 Jan 2023 04:43:09 -0500 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 1pKymi-00083U-IT for emacs-orgmode@gnu.org; Thu, 26 Jan 2023 04:43:08 -0500 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 1pKymf-0001jn-UR for emacs-orgmode@gnu.org; Thu, 26 Jan 2023 04:43:08 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9520924051D for ; Thu, 26 Jan 2023 10:43:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674726183; bh=rKa4ImPC3p7udokVDfmf9besd+AP2QzJogHXwbF2JtI=; h=From:To:Cc:Subject:Date:From; b=ElYPXR37w+4MsIOZzKE3Ja9KYzyeKnZV0RlENTJcNisHgY5BbJxJDYDyZJqJ/CY0n qhjW/tDpUnFeXt/FB+ab8iElp6uv+JcqAgs+baoJO54tDjts6tA1fMJgncDCUT03jf g5cx8DH9TvSY9XiIuxqJsgKB1Wc5l5IJyFZA0m4beWAwHeDyWoBEzFA4LlO5tb+wqZ 6kwt3qh9eizqZUB9dlKODOXCZ6Cjy1vPZ/UXux4lkdZlkI9bOwoFsGSvJ8fuhNuCnG k0e5VOQ3UZO4AuyuRg0c8IsNHSYt92SRL9WzZUVDFVpnX+onU+3MZKldrHdelfGSYt 4tlq1EzO1q8JQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P2bNh4Vh7z9rxG; Thu, 26 Jan 2023 10:43:00 +0100 (CET) From: Ihor Radchenko To: =?utf-8?Q?Andr=C3=A1s?= Simonyi Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH][oc-csl] Improve reference parsing In-Reply-To: References: <87r0ytoqi6.fsf@localhost> <87k04dlvie.fsf@localhost> <87zgd87di9.fsf@localhost> <87zgauqzb8.fsf@guelker.eu> <87ilh889bz.fsf@localhost> <87h6wm6e59.fsf@localhost> Date: Thu, 26 Jan 2023 09:43:31 +0000 Message-ID: <87ilgtwrzw.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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: 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=1674726245; 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=FImhyaN3r0SYlfcPUmumO/2n0yHwP2xPVwhgYiVw2Yo=; b=EFAnemKRxIWQe5YW3U+IWMrZIxMEAWxmy6e9xieT25ofHPfq6qJQWr1CuS7oYrwhoq9c8j qiKNh8QsxuB2f7VOl67VHTMOl6jc1DqsubCfZBkqGaeO+89o1EJPEPYGQjhjVbqsYiw7vh ItdriFWxqHeNDghCgZUI36+MGYN83u7qKaPCy+9Ufd7szJe2lWMlXK8jFALQLpVe0WE09c ZHs2s6i+VAMvo28nrkn0CyzwCb1ImaAZ+N9iy2lEDWcfrsbD9NB5QFbHsyp7aoAvbkaB05 /DP70+XUGhIKMG+1T6K39Ou5YkY1rq5amCgD0AKRfAG0KAL1tiePZtnTfwiYsw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ElYPXR37; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674726245; a=rsa-sha256; cv=none; b=AcXGxw6vK3vlaSOQ4p0gs51FX7AvzTYOfODo5hwG2cS8QPnfdwSMLfQj8iQBTxvKt07nUm DG5HT2WY4P6xlX3g/7aX3aFEOy5mCEo3h8kPWrVFqrM6vll+d2zG6to6TmMIIkJ0x3CKyY ZtW71eXh+acFb3A69ujst3xJMNXLBlMEIUoZ3u1SFTdmlBVDgXXvE3arYb/E0ViDilGx/+ Mr+yWzMysuw0tNiZTw/SjhIZ36U2koIprI5HQ8uGmMlb9MT+cYDkNgXWZ+lhAbV52QB4vQ XPzOkmM2zYhfpb0ha8Bxyx+QJcjLGkZ2gRUFqLgTHnZEZ9cw0z8bos5qJ1cooA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=ElYPXR37; 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"; dmarc=pass (policy=none) header.from=posteo.net X-Migadu-Spam-Score: -4.54 X-Spam-Score: -4.54 X-Migadu-Queue-Id: 848AA37825 X-TUID: X/ZVPaU2ua9e [ Adding Org ML back to CC ] Andr=C3=A1s Simonyi writes: > On Thu, 19 Jan 2023 at 10:56, Ihor Radchenko wrote: >> So, do I understand correctly that italics, bold, subscript, >> superscript, small-caps, and nocase must be passed to the CSL processor >> in a format understood by CSL? Everything else could just be left in Org >> and later exported according to actual export settings? > > Unfortunately, the situation is a bit different -- the solution I see > the most viable is to export the affixes and the locator to a form in > which > the markup elements you listed (plus links, which I haven't mentioned > but are also supported) are in the required CSL > input form, but the rest is in plain text. What do you mean by plain text? Plain text as in Org or plain text as in ASCII export? > Anything else would be way > more complicated to handle in Citeproc and I don't > really see the benefits/use-case either (we are talking about elements > within a citation). This would "only" require a custom backend > exporting CSL-supported elements in the html-like CSL format and > everything else which is allowed by the Org syntax > in plain text. I am not much concerned about CSL format itself. I am concerned about the formatted citation returned back to Org by CSL. Consider the following: [cite:Prefix *bold* +strike-through+ @key] It will be interpreted by Org export as (citation (:style nil ...) (citation-reference (:key "key"... :prefix ("Prefix " (bold (... :post-blank 1 ...) "bold") (strike-through (... :post-blank 1 ...) "strike-through"))))) Now, consider that the user has a custom export filter that decorates "+strike-through+" like "!!strike-through!!" upon export. If we pass the original citation to the CSL, will the export filter be applied? Also, what if user decorates a CSL locator with Org markup like strike-through? =20=20=20=20=20=20=20=20=20=20=20=20=20 >> May we: >> 1. Convert the Org markup supported by CSL into CSL-understood HTML >> format >> 2. Convert all other Org markup into verbatim > > I'm not sure what you mean by verbatim -- leaving it as Org markup? Whatever prevents CSL from altering the text. (Like escaping "_" you mentioned earlier) >> 3. Convert back non-verbatim markup altered by CSL into Org >> 4. Perform exporting Org->current export backend as usual. > > If verbatim is Org then step 3 could be rather complicated, we'd need > to identify > the Org fragments in citeproc's HTML and LaTeX output when those > backends are used. But can't CSL output in Org format? Isn't the whole CSL thing supposed to work for arbitrary export backend, not just HTML and LaTeX? > Also I'd worry that the result would not pass through Citeproc's > post-processing steps -- > there is now a user-customizable hook variable for citation post-processi= ng > which acts on the internal representations. I envision the conversion back to Org to happen after _all_ the Citeproc's processing, be it user-customized or not. > All in all I'd first concentrate on the use-case: is there anything > important left out > if we go with simply using a custom backend to export the CSL-supported m= arkup > in CSL input format and everything else as plain text, then do what we > do know, namely > either simply insert the Citeproc-formatted output into the exported docu= ment > without any post-processing (currently this is for LaTeX and HTML), or > parse and export > with Org when the Org Citeproc formatter is used (currently for all > other formats), What I imagine is doing "parse and export with Org" all the time, including HTML and LaTeX export. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at