From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29218 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: How to resolve citations inside attributes Date: Thu, 09 Sep 2021 10:22:04 -0700 Message-ID: References: <0bc0abba-e2ba-4473-b768-fe3fbbbcc0ebn@googlegroups.com> <782eda7c-31e7-45ac-928d-3fdea56e5412n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39300"; mail-complaints-to="usenet@ciao.gmane.io" To: Carsten Gips , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBSMF5GEQMGQERS25MAQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 09 19:22:20 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f57.google.com ([209.85.216.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mONkh-000A3Z-Tu for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 09 Sep 2021 19:22:19 +0200 Original-Received: by mail-pj1-f57.google.com with SMTP id ne16-20020a17090b375000b0018f4f0ba3fbsf1734532pjb.9 for ; Thu, 09 Sep 2021 10:22:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631208138; cv=pass; d=google.com; s=arc-20160816; b=0Fi0BJuzkFI2JtxsBcxlViYoyA9mswmcHye6O2rKwbOB8kQdsHdUPNbHU8gbFYvdJS kPmR7cEs3qouFRdwxR4hnH6fNpknGLCWenHmVV3ngqrSeJJqiIJ2CfrMgKCFkPq8q1ss MmeO9/7kfvT+fSleCMb6CyNwnQarRPjsk7jykD+Qe2tHWBX20fZFSOdhdb+nOLbobXk7 zlWPOWcJj23arPBb26nbWpXxVo12n4A7OgubG6hU+ZDN9cDwVB5vwOMo/D6ROauRXSUS WRFK15atqbwOKU/zBQyt4/R36ax12RRsyOhulF2PGnRtlwQIUzcFMtezPlkpqkVHYQ/Z SLrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:content-transfer-encoding :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=lmUbUDaZSZxKlhEsjczyYqImk/AgQSjJSyJviicLKJ4=; b=ZcD7qJGXJri24VYl71sPxyj3afumXtQNT2qlnusf6SVjpKBpM5Kxurrx8TFeh5yRis 3QQYF21sv0JoOjIbbEVgYcIsHQtNf7u4UPllDQ1+0s8ETh8nR9XWBSfVyZ/2yVa08uAm vzFeKV7s3+NFD/rs+TnzQY4DWmMzXfJ1Bj3Czt+gwExPmi0gbtlq5aIjWM9cST9PfF+S M4SV0+mmkKb8lOQ2MvgmEygtMfDYrCU3KAd+SWyRQq1EHDwJHf7bwalkzA6AzlNtCmbU 5eiIO18AJkyTWOZFk7IkGsuDy9RQKwe7FKJLQNEoNjMQnk89OiTctBWSNoszQMJZ790g WGCA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=WK99e1fb; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=lmUbUDaZSZxKlhEsjczyYqImk/AgQSjJSyJviicLKJ4=; b=Sw1QE01no15Qo4FMnNPW/frX9nnz/bsg6SWjxLoZyTWZaDgHAUj73W7gqk4980pEQO 3GGJWa1xxQR06QOt3b9B72KvrasA4taUgvjP0STOyL/y/WqOTlZVxa7TkeL/ZQgI2f14 FGJKYWbm/sMO+WycV3mjaJJsVUEHo5uj8aDnUZItLYFk8Ubv+ZN454z9ig/FhlpMi+j3 /X4yPYzHtEsYXdtXVcKqJITx7hpu6eMY71iOKGTmIrRGeqBqFnXGDYYlUcLgtVrMg1hE 1FDuFCpAKoX2Ij4BuS8ForQV1LPvtMWLzb5ybFLorxDY3dqSLQA3Z6tYEvgzTu5CJSzV 3j0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=lmUbUDaZSZxKlhEsjczyYqImk/AgQSjJSyJviicLKJ4=; b=lsuo9E5fZUn4w+4SoEX8TaStWzOax774LCQS2usQeE5syAySBcLkHmzuQS9MhC8Gr+ dbWDhv40ayRTun+EAmqcf6v7tZsyBYUhaXATiBfZSt9n5tYRKeQD4/Hd2lDHtu2BIAYU BPs81EBXR1gAfPx9NItTVoci+q7eacXS1ekiyScoZ0TI/p6CShJwGa+Dkd98s45T6D0Y SH9AtsjWmVUnDH1es2diBrB04KHeDgj2WLLcng1D0Fu9Q0Wkw/qy9IaoxbmI0k9/gLC1 81MkICPq0VmngSPWyv0Djnzgf/IOxyoMN/uYLpw+sXnBDWYXQWboOwHhQmM8LYmjJYkE Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531L4vbnwEUhT2sgXDkihLkbGMQ30bcyE5bvdxhCas2jBn7x79QA G1DZUqMntVWr2wpHi+v0b5Y= X-Google-Smtp-Source: ABdhPJwlK6Uq9934aCClO4O7MYu5RwgrcR/1XTjxcOQSzFaUSvrE+Kiu/lTRsFTvdTI2zNEzaX8OMA== X-Received: by 2002:a63:4f43:: with SMTP id p3mr3560754pgl.435.1631208138684; Thu, 09 Sep 2021 10:22:18 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:902:b492:: with SMTP id y18ls1587074plr.11.gmail; Thu, 09 Sep 2021 10:22:16 -0700 (PDT) X-Received: by 2002:a17:90a:29a4:: with SMTP id h33mr4716336pjd.88.1631208136511; Thu, 09 Sep 2021 10:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631208136; cv=none; d=google.com; s=arc-20160816; b=MhqqT1HChxgQFrjSZYlB8ECBNjaAYnGjpLZXXUkkVF2lZ/YQ+nqh5jlccSRKLbTh/7 x0Qu6MXSlxr8dVaQTUkaJgEsonIc/V5B4QVjBeBY/mhDUJGvLz/1r499k6h98t+mbRle 7X6vlk+/Y//gg+qiQxdAomP9Xmf4+Q7Mu/4prdVTrhxo9l0QacdNCEgdpyRQK3tCXNqp E2N28FfFRSef01BTRCk3ASMrgrw39ODX+5Gnhk3aFaiHtO1+CxsXc1vulaH3E7n5PnTf YLxcQVkLHBtn4/NCRVRNB6XIcMZj3QxlWDpXHelTAXIiigwxt7ps2TokEDsax6c2hJyY 9lTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=zRvlg21WDcY+IH47G4o8qa+IvfQ7A8E4arWOn9PTDek=; b=lSce2QHvf7ktwkLCfyfv/XqNnQjTjeIZYqItkMs8tB+mZLNpjCxNZ44GbYYPUxl8wp Pg/wUJvKjd2j+Szp3Fpy6bAq0TUoYDBBavG6Uyl4kdIE3Vuvw03mYc+WCRinqOeRYKp5 JzI1vI11lJtztjqk6s0K4Fu8g5BHHMvwpqaKBnYbJBkUli7XqChYxHJxV8m5fo2dK0kT /fyupJbllp1hTOfOLCpytO0e8kWeyY7yqAwn1kPus4g3v1iXhlqFkQ+ss78WEW9wJcZ4 sNtUlBtHmstHiyXpXEGJzlcDIPRaS1iO4YsjSOCmSfATKIT3soKtTlHAykkV6nfbdSfW 5GmQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=WK99e1fb; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com. [2607:f8b0:4864:20::532]) by gmr-mx.google.com with ESMTPS id c6si207080pjs.3.2021.09.09.10.22.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 10:22:16 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) client-ip=2607:f8b0:4864:20::532; Original-Received: by mail-pg1-x532.google.com with SMTP id e7so2475773pgk.2 for ; Thu, 09 Sep 2021 10:22:16 -0700 (PDT) X-Received: by 2002:a65:47cd:: with SMTP id f13mr3614942pgs.439.1631208135868; Thu, 09 Sep 2021 10:22:15 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id d63sm2966658pjk.17.2021.09.09.10.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 10:22:15 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 4610DA1A8; Thu, 9 Sep 2021 13:22:04 -0400 (EDT) In-Reply-To: <782eda7c-31e7-45ac-928d-3fdea56e5412n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=WK99e1fb; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:29218 Archived-At: Citations are only recognized when they're parsed as markdown. @key in a code block or attribute won't be parsed. You could use the pandoc Lua 'read' function to parse the contents of your attribute as Markdown and then do something with that. Carsten Gips writes: > I've tried to resolve this manually by extracting this piece with a Lua= =20 > filter, converting it into a new document and running Pandoc plus Citepro= c=20 > on this temporary document with `pandoc.utils.run_json_filter`, retrievin= g=20 > the processed citation and putting it back as codeblock caption in the=20 > original document. However, this approach seems not to be working. > > To narrow this down further, I wrote a short document (`test.md`, see=20 > attachment) and a Lua filter (`codecite.lua`, see attachment). (To make i= t=20 > even shorter, in the Lua filter I simply replace the text block of the=20 > document with a similar new block). > > But this does not seem to work. The call `pandoc -L codecite.lua test.md = -t=20 > json` returns only=20 > > ```json > {"pandoc-api-version":[1,22],"meta":{"references":{"t":"MetaList","c":[{"= t":"MetaMap","c":{"author":{"t":"MetaList","c":[{"t":"MetaMap","c":{"family= ":{"t":"MetaInlines","c":[{"t":"Str","c":"Wuppie"}]}}}]},"id":{"t":"MetaInl= ines","c":[{"t":"Str","c":"FOO"}]},"title":{"t":"MetaInlines","c":[{"t":"St= r","c":"Lorem"},{"t":"Space"},{"t":"Str","c":"Ipsum"}]}}}]}},"blocks":[{"t"= :"Para","c":[{"t":"Str","c":"see=20 > [@FOO]"}]}]} > ``` > i.e. the citation is not resolved. > > However, if I run Pandoc directly on this document, i.e `pandoc -t json= =20 > --citeproc test.md`, the result is as expected: > > ```json > {"pandoc-api-version":[1,22],"meta":{"references":{"t":"MetaList","c":[{"= t":"MetaMap","c":{"author":{"t":"MetaList","c":[{"t":"MetaMap","c":{"family= ":{"t":"MetaInlines","c":[{"t":"Str","c":"Wuppie"}]}}}]},"id":{"t":"MetaInl= ines","c":[{"t":"Str","c":"FOO"}]},"title":{"t":"MetaInlines","c":[{"t":"St= r","c":"Lorem"},{"t":"Space"},{"t":"Str","c":"Ipsum"}]}}}]}},"blocks":[{"t"= :"Para","c":[{"t":"Str","c":"see"},{"t":"Space"},{"t":"Cite","c":[[{"citati= onId":"FOO","citationPrefix":[],"citationSuffix":[],"citationMode":{"t":"No= rmalCitation"},"citationNoteNum":1,"citationHash":0}],[{"t":"Str","c":"(Wup= pie,"},{"t":"Space"},{"t":"Str","c":"n.d.)"}]]}]},{"t":"Div","c":[["refs",[= "references","csl-bib-body","hanging-indent"],[]],[{"t":"Div","c":[["ref-FO= O",["csl-entry"],[]],[{"t":"Para","c":[{"t":"Str","c":"Wuppie."},{"t":"Spac= e"},{"t":"Str","c":"n.d."},{"t":"Space"},{"t":"Span","c":[["",[],[]],[{"t":= "Str","c":"=E2=80=9C"},{"t":"Str","c":"Lorem"},{"t":"Space"},{"t":"Str","c"= :"Ipsum"},{"t":"Str","c":"."},{"t":"Str","c":"=E2=80=9D"}]]}]}]]}]]}]} > ``` > > Clearly I'm missing something here. But what is it? Can you please advise= ? > > > PS: `pandoc --version`: pandoc 2.14.2 > > Carsten Gips schrieb am Donnerstag, 9. September 2021 um 10:27:36 UTC+2: > >> Dear all, >> >> I'm trying to resolve citations inside attributes, i.e.=20 >> >> ```{.c caption=3D"nice, see [@KEY]"} >> ... >> ``` >> >> Pandoc and Citeproc are currently not handling citations inside am=20 >> attribute like in the example. How can I resolve these citations anyway? >> >> Thanks, >> Carsten >> > > --=20 > You received this message because you are subscribed to the Google Groups= "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/782eda7c-31e7-45ac-928d-3fdea56e5412n%40googlegroups.com. > --- > references: > - author: > - family: Wuppie > id: FOO > title: Lorem Ipsum > --- > see [@FOO] --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/m21r5x3br7.fsf%40MacBook-Pro-2.hsd1.ca.comcast.net.