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 IB8WDxl8yGP4SgEAbAwnHQ (envelope-from ) for ; Thu, 19 Jan 2023 00:09:13 +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 sNIJDxl8yGMSQQAA9RJhRA (envelope-from ) for ; Thu, 19 Jan 2023 00:09:13 +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 575851BD1C for ; Thu, 19 Jan 2023 00:09:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIHXY-0006gk-A3; Wed, 18 Jan 2023 18:08:20 -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 1pIHXW-0006gW-LG for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 18:08:18 -0500 Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIHXU-0006Pa-RX for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 18:08:18 -0500 Received: by mail-vk1-xa35.google.com with SMTP id i82so106865vki.8 for ; Wed, 18 Jan 2023 15:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ECAgiMwts/4yOHYmlGM05z4HpM9BDnjGGCuj+V+gtw8=; b=H9zgJUflEHPiNZnEbrwICd6WUUxpFV2tFXPIpYj0aFjjZxqUJi0PAdxwZI4RKfITEM Z/vFyPtM30DcPwXrl8HZBFtKqvexW2mU4tBPuOflAjmyAyjjqtYP2eL1cnrcaAqSDelo GDjzGnwOQijvWLTy0naxSXLY4bwU2jPFZsemBq72bQIagUmm0p+FCDQqk6te0JtGjnGz F/TisAVM7flN59RfaBqjltSvIWrP6wnEjZWyYe0Xk1LDZWe559OKR5QjnvY3WURQLQFq VzmfRDF7OF9hwLE7B7GYeOy5kPfAOpePobpu03jPcTyVbCFYf5+EhEYen+ORGjmGRRiO NXIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ECAgiMwts/4yOHYmlGM05z4HpM9BDnjGGCuj+V+gtw8=; b=2h0DcGAaRiyDEKvf68cejCA0ZwnhaGZ95kvgLM5YgU935xIjaKx44AIZPfR/3vHzHE hDeQ/CK2j8oMGavjxHHFJB5GXkNlNN/ByfeODdz32UsrvpeTxcAvhd/wJt7TDwZMXdm1 8ik8RgA+Vw/irWHo/kC8HdcNmelkUNl8NLzsAQjU9KhlDRSWceN7Two1CXD4DTl41eeK WdEU+cz8YNr8Irwr9E06LKAwYD5tYZ79QOu6SCTX8Me5VvAktlRawZ1vrRKz0iRJHyKb fmUgAigFiM9w61zOzptrayg/cOV6wsL6VE2kp6z3aPAAbuitxi65RriueFlzsSLFx/N9 yzqg== X-Gm-Message-State: AFqh2krdaIHyuW+O9iTfC40Hb5vopHPpFYuZ1pEJsccdrlyETxBHvIYF Vhs09mLAHaWkrat8PewSUQTC+7x/IMioUld/ZNnLElo5Vo8uQQ== X-Google-Smtp-Source: AMrXdXs8F7RoCR5cQEXWkuPUtjl0Yrm8YbRUaEhbXw9Dg0h1qVUYxW3cYdn1TuZ5XytmrlPQICm2PMCRD4LhpcjEYFs= X-Received: by 2002:a1f:5887:0:b0:3da:f196:79a6 with SMTP id m129-20020a1f5887000000b003daf19679a6mr1131263vkb.38.1674083295032; Wed, 18 Jan 2023 15:08:15 -0800 (PST) MIME-Version: 1.0 References: <87r0ytoqi6.fsf@localhost> <87k04dlvie.fsf@localhost> <87zgd87di9.fsf@localhost> <87zgauqzb8.fsf@guelker.eu> <87ilh889bz.fsf@localhost> In-Reply-To: <87ilh889bz.fsf@localhost> From: =?UTF-8?Q?Andr=C3=A1s_Simonyi?= Date: Thu, 19 Jan 2023 00:08:03 +0100 Message-ID: Subject: Re: [PATCH][oc-csl] Improve reference parsing To: Ihor Radchenko Cc: =?UTF-8?B?TS4g4oCYcXVpbnR1c+KAmSBHw7xsa2Vy?= , emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::a35; envelope-from=andras.simonyi@gmail.com; helo=mail-vk1-xa35.google.com 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, FREEMAIL_FROM=0.001, 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: , 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=1674083353; 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=ECAgiMwts/4yOHYmlGM05z4HpM9BDnjGGCuj+V+gtw8=; b=BIsRFvBOmoX67pWDDD0OOJPV300/slXDKAq99v2RB+EtzCLugXxxXtbMrbVjcBsTGPiZIN s2XNBy8/TJ5wzIVebPPT9izFHQ/l7sl8y5oBIQ/nSWF7E9tKbQ61Sr3iLwkiAS6LDlEmFh 4s78tdRd723mSaJ3ucEU+XhjLN4u/0AUVhJvHwc0jCsNMvjtFxPKooUIr9q63FjtAp/Ubr M1iJC+7CHpd96NRaeyyFSFfbrcVxm4q32h2Hz/zJoQa6magRKvtBRCx9Rq8WcZQcoBCl7v JSV/+PsltVNZUwMOF+tPWFPwZCYhMypysmMM0yRJawhKBVeF9XnyMEEpb6ncaA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=H9zgJUfl; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674083353; a=rsa-sha256; cv=none; b=SBeee7iP5ohPG2+mrxJ9pCjg28JVTCGYC+iwyT5bBQzKJH4pQt2tpzy6ERfhZaR9e1z7e2 hcK/LDzpUjmfraVcsGrFqUrvUtk0lFjohgdPaIbnjj182jV3zpipBGJhxiAY+kBPPY1zia 7F97XlKCiYKeXj68E/U3D/b/2AswtxBkxSBOqh+NjhWmSLOr0a+WSrgah8s3fKqOxpcNO1 O5Z3qUa3R3ZYOAyheJ6fsQcIqWR0TwaZ9acvebjofer6tb/sByu1EIqsIoySZCyg6sP4d6 W0gp9XkAEJcsJw3jIEa9z5DEAE3WvmoHPC0DEeVfZUTWSlGXSJfsszUMxKH2TQ== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.78 X-Spam-Score: -4.78 X-Migadu-Queue-Id: 575851BD1C Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=H9zgJUfl; dmarc=pass (policy=none) header.from=gmail.com; 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-TUID: /Q4JiI9YJpTm Dear All, apologies for replying that late. If I understand the situation correctly, we could handle the question of allowing macros in citations independently of the handling of other constructs, because macros are resolved before processing citations, so they have no effect on the input of Citeproc-el. In light of this, maybe there could be a separate patch for just allowing macros? As for the question of other elements, I proposed the custom backend-based approach because CSL has its own rich-text markup (which is actually not simply a subset of Org's, for example, it contains small-caps, which is not in Org), and, consequently, Citeproc-el has its own internal rich-text representations (ASTs), on which it performs the operations that are prescribed by the various CSL styles. When the rich text citation/bibliography is finalized, it can be "serialized" or "formatted" (analogously to Org's exporting a parse tree) using one of the Citeproc formatters, e.g. into LaTeX, HTML or Org. As the prefix, suffix and the locator also need to be operated on by the processor (concatenated to other rich text elements etc.,), they also have to be parsed into CIteproc el's internal rich-text representations. Since this is a given, the only question is in what format should they be passed, and the simple HTML-like standard which is already supported by Citeproc-el (see https://www.zotero.org/support/kb/rich_text_bibliography) seems to be the simplest solution. Ihor Radchenko wrote: > 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? Since Citeproc-el assumes that all formatting in the prefix/suffix is in the HTML-like markup mentioned above, any Org markup would be treated as plain text which should be preserved as is, and not interpreted as formatting, so, for example, when an Org document with underlined text in a citation prefix were exported to LaTeX then the Citeproc LaTeX formatter would escape the underscore characters ("\_") to preserve them in the output and the citation would be inserted in this form into the resulting LaTeX document. > 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. See above, unfortunately, this wouldn't work, at least not in a general and safe way. best wishes, Andr=C3=A1s On Sun, 15 Jan 2023 at 09:56, Ihor Radchenko wrote: > > M. =E2=80=98quintus=E2=80=99 G=C3=BClker writ= es: > > > I probably have not much to contribute to this rather technical thread, > > but Ihor has redirected me here two times for my citation formatting > > questions[1][2]. So I would like to ask if there is something I can do = to > > accelerate its inclusion into org so that I can start using macros in > > citations? > > Andr=C3=A1s is the author of citeproc.el. I am not sure who else would be= in > position to help us to move this forward. > > My understanding of CSL is non-existing. I can only tell that > citeproc.el has its own implementation of citation export > (`citeproc-render-citations'), which expects some limited kind of html > as input. I am hoping that we can somehow work around limited markup > support of citeproc's implementation and instead leverage ox.el to do > the job. Otherwise, we will keep stumbling upon citeproc.el limitations > when exporting bibliography items. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at