From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29099 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: William Lupton Newsgroups: gmane.text.pandoc Subject: Re: Help with a filter converting citations to sidenotes Date: Fri, 20 Aug 2021 19:37:42 +0100 Message-ID: References: <0f2d14e3-a86e-4fa1-b98c-52f540fe82b9n@googlegroups.com> <93663960-bbfe-40a1-b3ba-25fefe58e7e0n@googlegroups.com> <3106cf1d-5ae3-411f-b92a-c14153d58e49n@googlegroups.com> <0fd903f3-e52d-44bd-a1b2-50bccfc9b66cn@googlegroups.com> <206b26c5-32b2-408d-80f6-cf851c9c8cb9n@googlegroups.com> <7df79e6f-cb35-4ca5-8bc3-f089e3bc9199n@googlegroups.com> <8d4c4320-4a85-4363-8789-8bebcd21d329n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000029e05b05ca01f785" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8758"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBA7N76EAMGQE2Q2AMOA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Aug 20 20:37:58 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f57.google.com ([209.85.221.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mH9Ov-00021a-Ae for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Aug 2021 20:37:57 +0200 Original-Received: by mail-wr1-f57.google.com with SMTP id v18-20020adfe2920000b029013bbfb19640sf3109118wri.17 for ; Fri, 20 Aug 2021 11:37:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629484677; cv=pass; d=google.com; s=arc-20160816; b=MU9mhO3MAjePUD+lcwIBcYDOz48mf2ts8MHGmW3W3fov9w8LwIW5mRD+mA4QGrJybv h9yapIN61qxvmqwNeYs6Jg9PnrQTWiu1Qv79fkQR0ZUNI0xUkKAoIXQjEoMXdMe/R/Fo ZY2N1prqVTatiGzq3I939Ch9qsQqzIfQzhD/PFdwCcerJrB9oQp85/+8VyuMWN9lh/T/ CQifqFdrtNSjOiaKpewfjIBeto1P/K2QVEf0JRqDx0j9JVrVeFTPnQZ3xIs+XFdSP0I2 dQJczrTVaGVXU43bLPiP2fIJvP6NorMkbAhpXtwDuHJ1ed6DdFCi2OdGEn0huikjMaYM +uVg== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature; bh=VaWM+GeMB7UnEI25j6Ne/lhUIsEGXUieyGmWeFLiUhA=; b=i1AYhdBJ/8GsJEru7XslwDK9xaf6Q+MxKuNMMpdAZbAr7j+gi9N9fJ9SWboYLqiSgo XUyiI7bYX7bzKelQZBEy5i69qAkVD7MvHA3Vx5ybWUl4T/KLWNXOoVSpe3D6J0NPXjuY M4hHtEAwROFhLvj2fAPAKtNCEt6zy5v47eJIA/k8wXKvNCKfgzSdu5aFN0F4kuCbHCXI hPllIgP9lIevM/+J1dMOQeou5nCRzsTbxeRaFh0bEZQ/cPtM86zV5Ca2dgp+zFV7JMm/ 5ANL7yATC64Ydnda8oFDKqFL2P6gLEaAFQu2LERpwWLTh83w4NK2z3KnLsQpA2JvPw5k FsSw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=ypRYN6eE; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to: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=VaWM+GeMB7UnEI25j6Ne/lhUIsEGXUieyGmWeFLiUhA=; b=WxqkAeUy5wAayGmqhheEQNZH1Xjubp7YIjkQ5kiuwlRutPZaZV8GEf1AChS1eBL3Z5 sIh2d6LkBd6CVL2luH71EwMZ+dW/Ybw7nKo8AhVg9VpsLT2PHcvgMz7gEVf1uXyWQylu Y1+UXqlkNHcdmpy6wa61fG/rQ+6SNe+25311x89/FL9LcXSJj6M02xcN7JlhgcqvLNUc iBeM89x2ZlEbRSQm+jHFPGBWPjKPpLjEndBAv8v2DIAl4D3JRkn2Jg0Q4Xuu7WUx+7GD a3btvDTDlKWMF3IAUTK0wAOtSGDIT6U7vsxPJibsmDYC6n92aT/2+mV1+Ni+KVvnk9au LKPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to: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=VaWM+GeMB7UnEI25j6Ne/lhUIsEGXUieyGmWeFLiUhA=; b=j7OEYXPa5Ux3jhnccknnIuUcJta2sAGTsFyaxZRk+HFYzntydqldGQrc5M7OLYMjUT x0YaRfAPQYQoE6hRijuisKz9XmzkojBdgaW9hkmmJSsfI05/AML5cOAFKIhwzQgeaUhq VGfK0kD/Q4if+PbeMOLtBMq4NVjH9n7FVb7O5SKo6uZ6jnkH/nNkk/CuICp13qUYLOWr mGtymLvsP1fLYxjNlzJpnss7dDROMRs3fYyHKo39KD177Q2wgFLeiyUw8nQ4pmYGurNd 4PaZlKzRB8AE88+uAc7iaLCOT1Gmp0HgtgDD+8kI9eMY6oAD++SI2q4SVLtphG6EjoTA zMCA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532JOJo/DehPIQynhtXD8Q6jBFjKaISSTGochA8FDltieO59iRx8 6/GVebY/vkpMK0yzOOTH3tI= X-Google-Smtp-Source: ABdhPJxmKP32d6TYHjMR5avFXWW9G3TyLID16TgXnHIfzHd+mqEKnXeDLZNXHK0i6jbjK31oqVXTxw== X-Received: by 2002:a7b:c38f:: with SMTP id s15mr5140572wmj.179.1629484676964; Fri, 20 Aug 2021 11:37:56 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a7b:c2b2:: with SMTP id c18ls4304960wmk.2.gmail; Fri, 20 Aug 2021 11:37:54 -0700 (PDT) X-Received: by 2002:a05:600c:19c7:: with SMTP id u7mr5364324wmq.61.1629484674660; Fri, 20 Aug 2021 11:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629484674; cv=none; d=google.com; s=arc-20160816; b=LF1Dv+/3EdXAoUf+4So+O9G8Uo4ExVnlLEphsk4U4Syt8GiEyjdNyPwyx1rkJpRcFB 8tlVnrOqaI6/8Hb2aumMH/Yt1qncaXelFhKA1vtIMht0nDr+wrdjAfkZgUdCRTdyPG8i CtN8XosTWYCWkWp78NmAA+4ruQT78HSV8O0Xyd0YgGuhD8hmmdxJoNJUtvRb1ZZOWxx7 TUsV1scRHa67SqE86rvzU4q87sDR1/LW83B7ysFFjzrbMoDHuQ+p7RvaWMfnVAFG9odg hO1iVqEGeZB6c02cpgMPZD1cftrw9GOMcg5h+JD9WCOC2SoXidOd0mO4WRGsYfqUf8qn csMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Q5JzGgxrvNw23D28Z7+bi7bPqKtlhPuyQGT3xVQbORI=; b=tq5yiBuSWWp3/+9+lCVWrOl9+8YXB2wLM/hpFKKNNGyjqhl+tiD9D+c35lUgbcT6hy Kiev2x+eWd0mn/p/fUC567CUl7J/zff8j+GH9JqxUhk/Yr0RtK1OZK2iUAmTGwjH1RAx tzCVWi+sJLBpomM3ztGuNJ+Y8pDGYL5oF/QmQuh3MCbRdX27YNA2sc1L/brf8H76ByKL 4VVkkgS0tcAunkn5ypMKx6UtlQ4aajqh7eqW4loQ7yZbOHVrl5cboYX1Sn3LF0Jfi9Q5 hxQlinCPAL53f8KrZROMnr79H5JQ+hZ5Tcp/aUYZzixlkonM/Of+JaAg0KMlfy9mqKp4 CZLg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=ypRYN6eE; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org Original-Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com. [2a00:1450:4864:20::52b]) by gmr-mx.google.com with ESMTPS id h7si500029wro.2.2021.08.20.11.37.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Aug 2021 11:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) client-ip=2a00:1450:4864:20::52b; Original-Received: by mail-ed1-x52b.google.com with SMTP id s3so3021732edd.11 for ; Fri, 20 Aug 2021 11:37:54 -0700 (PDT) X-Received: by 2002:aa7:db13:: with SMTP id t19mr23801108eds.72.1629484674042; Fri, 20 Aug 2021 11:37:54 -0700 (PDT) In-Reply-To: <8d4c4320-4a85-4363-8789-8bebcd21d329n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum-org.20150623.gappssmtp.com header.s=20150623 header.b=ypRYN6eE; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::52b as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@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:29099 Archived-At: --00000000000029e05b05ca01f785 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Just filter divs and look for this id. Check the docs though, because there are some caveats. Not sure about the "last element" bit. On Fri, 20 Aug 2021, 19:06 Leena Murgai, wrote: > Interesting, so does this mean that what I want is the last element of a > pandoc.Div with the identifier refs? How do I access that? > > On Friday, 20 August 2021 at 10:49:36 UTC-7 William Lupton wrote: > >> Oh this triggered a thought. The _rendered_ references are associated >> with a div with id 'refs'. See >> https://pandoc.org/MANUAL.html#placement-of-the-bibliography. Is that's >> what going on here? >> >> If so, I feel pretty silly, because I have a filter that processes this >> output! >> >> On Fri, 20 Aug 2021 at 18:41, Leena Murgai wrote: >> >>> No problem William, >>> >>> in the example screenshots, the text I'm referring to is specifically >>> >>> D. Ingold and S. Soper, =E2=80=9CAmazon doesn=E2=80=99t consider the ra= ce of its >>> customers. Should it?=E2=80=9D *Bloomberg*, 2016. >>> >>> I assume it's a list of inlines in the AST, possibly a block, as I said >>> I don't know where it's stored. I assumed in citations, as did you, but= I >>> don't know how to access it. Anyway, I want that text to be in my >>> marginnote along side the (lonely looking) [1]. >>> >>> Actually, I'm not interested in having the references at the end at all= , >>> I'd rather just have the linked reference in marginnote. >>> On Friday, 20 August 2021 at 10:31:57 UTC-7 William Lupton wrote: >>> >>>> Sorry, you've probably already answered this along the way, but I'm >>>> confused about the "text" that you refer to. Perhaps you could attach = a >>>> JSON AST that includes a citation with all the desired information fro= m a >>>> run that DOESN'T use your filter? I'm unclear where in the AST to find= the >>>> information that you want (and is missing). I had assumed that it must= be >>>> in cite.citations but apparently not. >>>> >>>> On Fri, 20 Aug 2021 at 18:25, Leena Murgai wrote: >>>> >>>>> So I've attached some screenshots in case it helps. You can see that >>>>> the marginnote contains only the [linked_item_number] of the >>>>> citation, the rest is missing. Here's the filter I used: >>>>> >>>>> function Cite(el) >>>>> marginnote =3D pandoc.Span(el.content) >>>>> marginnote.classes[1] =3D 'marginnote' >>>>> return {pandoc.Span(el.content), marginnote} >>>>> end >>>>> >>>>> >>>>> >>>>> On Friday, 20 August 2021 at 10:06:30 UTC-7 Leena Murgai wrote: >>>>> >>>>>> Hello again Bastien, >>>>>> >>>>>> I just tried your code, it does something similar to mine (but >>>>>> clearly you code is nicer :). It's missing the text that makes up th= e >>>>>> citation block in the bibligraphy. To be clear I want the whole bloc= k (or >>>>>> inline?) that appears in the bibliography in my marginnote. >>>>>> >>>>>> Cheers! >>>>>> >>>>>> On Friday, 20 August 2021 at 10:00:56 UTC-7 Leena Murgai wrote: >>>>>> >>>>>>> Thanks William. >>>>>>> >>>>>>> These are the filters I'm using: >>>>>>> >>>>>>> 1. tex2html/filters/date.lua # Replace date with today's >>>>>>> date if it's empty above # >>>>>>> 2. tex2html/filters/texref.lua # Cleanup pandoc and >>>>>>> pandoc-crossref conflicts # >>>>>>> 3. pandoc-crossref # >>>>>>> https://github.com/lierdakil/pandoc-crossref # >>>>>>> 4. citeproc # If you need control over >>>>>>> when the citeproc processing # >>>>>>> 5. pandoc-sidenote # >>>>>>> https://github.com/jez/pandoc-sidenote # >>>>>>> 6. tex2html/filters/margincitations.lua # put citations in >>>>>>> marginnotes # >>>>>>> >>>>>>> Thanks Pedro. >>>>>>> >>>>>>> I'm already using pandoc-sidenote :). What I actually want is a >>>>>>> marginnote. If I turn them into footnotes before running pandoc-sid= enote, I >>>>>>> end up with a sidenote rather than a marginnote which gets a supers= cript >>>>>>> label. This isn't what I want. I want to keep the >>>>>>> [linked_item_number] (provided by citeproc) and put that in the >>>>>>> (unnumbered) marginnote (with the rest of the ). RawInline let's me= do >>>>>>> that. I just can't access the text. >>>>>>> On Friday, 20 August 2021 at 09:44:46 UTC-7 pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >>>>>>> wrote: >>>>>>> >>>>>>>> Jake Zimmerman=E2=80=99s pandoc-sidenote filter just takes every f= ootnote >>>>>>>> as a whole and converts it to a sidenote . Unless you want s= eparate >>>>>>>> streams for regular footnotes and citation sidenotes, it might be = useful: >>>>>>>> https://github.com/jez/pandoc-sidenote/blob/master/src/Text/Pandoc= /SideNote.hs >>>>>>>> >>>>>>>> Em sexta-feira, 20 de agosto de 2021 =C3=A0s 17:37:55 UTC+1, Willi= am >>>>>>>> Lupton escreveu: >>>>>>>> >>>>>>>>> Not sure if this helps, but here's a simple example showing a >>>>>>>>> somewhat readable dump of the AST before and after citeproc. I th= ink only >>>>>>>>> cite.content has changed. I suspect that your problem is somethin= g else. >>>>>>>>> >>>>>>>>> *% *cat cite.md >>>>>>>>> >>>>>>>>> @RFC1149 >>>>>>>>> >>>>>>>>> >>>>>>>>> *% *LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L rep.lua >>>>>>>>> cite.md >>>>>>>>> >>>>>>>>> (#) meta {} >>>>>>>>> >>>>>>>>> (#) blocks { >>>>>>>>> >>>>>>>>> [1] content: Para { >>>>>>>>> >>>>>>>>> [1] Cite { >>>>>>>>> >>>>>>>>> citations: { >>>>>>>>> >>>>>>>>> [1] { >>>>>>>>> >>>>>>>>> hash: 0 >>>>>>>>> >>>>>>>>> id: "RFC1149" >>>>>>>>> >>>>>>>>> mode: "AuthorInText" >>>>>>>>> >>>>>>>>> note_num: 1 >>>>>>>>> >>>>>>>>> prefix: {} >>>>>>>>> >>>>>>>>> suffix: {} >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> content: { >>>>>>>>> >>>>>>>>> [1] Str text: "@RFC1149" >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> [WARNING] Citeproc: citation RFC1149 not found >>>>>>>>> >>>>>>>>> (#) meta {} >>>>>>>>> >>>>>>>>> (#) blocks { >>>>>>>>> >>>>>>>>> [1] content: Para { >>>>>>>>> >>>>>>>>> [1] Cite { >>>>>>>>> >>>>>>>>> citations: { >>>>>>>>> >>>>>>>>> [1] { >>>>>>>>> >>>>>>>>> hash: 0 >>>>>>>>> >>>>>>>>> id: "RFC1149" >>>>>>>>> >>>>>>>>> mode: "AuthorInText" >>>>>>>>> >>>>>>>>> note_num: 1 >>>>>>>>> >>>>>>>>> prefix: {} >>>>>>>>> >>>>>>>>> suffix: {} >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> content: { >>>>>>>>> >>>>>>>>> [1] Str text: "(" >>>>>>>>> >>>>>>>>> [2] content: Strong { >>>>>>>>> >>>>>>>>> [1] Str text: "RFC1149?" >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> [3] Str text: ")" >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>> } >>>>>>>>> >>>>>>>>>

>>>>>>>> data-cites=3D"RFC1149">(RFC1149?)

>>>>>>>>> >>>>>>>>> On Fri, 20 Aug 2021 at 17:14, Leena Murgai >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> I'm running it after citeproc since I need the citation values. >>>>>>>>>> >>>>>>>>>> On Friday, 20 August 2021 at 09:12:06 UTC-7 Leena Murgai wrote: >>>>>>>>>> >>>>>>>>>>> Maybe the order I run the filters in matters? >>>>>>>>>>> >>>>>>>>>>> On Friday, 20 August 2021 at 09:07:24 UTC-7 Leena Murgai wrote: >>>>>>>>>>> >>>>>>>>>>>> Yeah, I tried looking there, I couldn't find what I wanted. I'= m >>>>>>>>>>>> sure I'm missing something. >>>>>>>>>>>> >>>>>>>>>>>> The question is how to access it? As in what's the code? For >>>>>>>>>>>> example, each citation ( >>>>>>>>>>>> https://pandoc.org/lua-filters.html#type-citation) has the >>>>>>>>>>>> fields id, mode, prefix, suffix, note_num, hash. Which one >>>>>>>>>>>> contains the text I want? What's the code to get the list of i= nlines I want >>>>>>>>>>>> (corresponding to the text in the citation)? >>>>>>>>>>>> On Friday, 20 August 2021 at 08:59:52 UTC-7 William Lupton >>>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Do you mean the citations themselves? These are in >>>>>>>>>>>>> el.citations. See >>>>>>>>>>>>> https://pandoc.org/lua-filters.html#type-cite and >>>>>>>>>>>>> https://pandoc.org/lua-filters.html#type-citation. >>>>>>>>>>>>> >>>>>>>>>>>>> On Fri, 20 Aug 2021 at 16:36, Leena Murgai >>>>>>>>>>>>> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> So far I have the following, which puts the >>>>>>>>>>>>>> [linked_item_number] in the passage and in the marginnote >>>>>>>>>>>>>> but I'm missing the rest of the >>>>>>>>>>>>>> text_that_goes_in_the_bibliography. >>>>>>>>>>>>>> >>>>>>>>>>>>>> function Cite(el) >>>>>>>>>>>>>> return { >>>>>>>>>>>>>> pandoc.Span(el.content), >>>>>>>>>>>>>> pandoc.RawInline('html5', ' >>>>>>>>>>>>> "marginnote">'), >>>>>>>>>>>>>> pandoc.Span(el.content), >>>>>>>>>>>>>> pandoc.RawInline('html5', ' ') >>>>>>>>>>>>>> } >>>>>>>>>>>>>> end >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Thursday, 19 August 2021 at 20:32:11 UTC-7 Leena Murgai >>>>>>>>>>>>>> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Hi there, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I'm converting from LaTeX to HTML5. I'd like to put my >>>>>>>>>>>>>>> citations in 'sidenote's rather than at the end of the doc.= In practice, >>>>>>>>>>>>>>> this just means I want the output html: to look like >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> [linked_item_number] >>>>>>>>>>>>>>> text_that_goes_in_the_bibliography >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> How do I access the element that goes into the citation, >>>>>>>>>>>>>>> i.e. text_that_goes_in_the_bibliography? >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Any advice appreciated. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> -- >>>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>>> Google Groups "pandoc-discuss" group. >>>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails fro= m >>>>>>>>>>>>>> it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>>>>>>> To view this discussion on the web visit >>>>>>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/eda3d7b4-be= fd-4f42-9455-8a37373d33a6n%40googlegroups.com >>>>>>>>>>>>>> >>>>>>>>>>>>>> . >>>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>>> >>>>>>>>> To view this discussion on the web visit >>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/3106cf1d-5ae3-4= 11f-b92a-c14153d58e49n%40googlegroups.com >>>>>>>>>> >>>>>>>>>> . >>>>>>>>>> >>>>>>>>> -- >>>>> 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, sen= d >>>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> >>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/pandoc-discuss/eb59834b-d3e8-4dc4-9= a66-0eb8c0f3e225n%40googlegroups.com >>>>> >>>>> . >>>>> >>>> -- >>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/pandoc-discuss/b548772c-269e-45c7-9ff= 6-9aec6014f024n%40googlegroups.com >>> >>> . >>> >> -- > 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/msgid/pandoc-discuss/8d4c4320-4a85-4363-8789-= 8bebcd21d329n%40googlegroups.com > > . > --=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/CAEe_xxhvRuUNtQNGP0ozaUAN3OoJvz1z6ijTBKyXd3M5Yv4Z1w%40mail.g= mail.com. --00000000000029e05b05ca01f785 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Just filter divs and look for this id. Check the doc= s though, because there are some caveats.=C2=A0 Not sure about the "la= st element" bit.=C2=A0

On Fri, 20 Aug 2021, 19:06 Leena Murgai, <leenamurgai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Interesting, so does this mean that w= hat I want is the last element of a pandoc.Div with the identifier refs? Ho= w do I access that?

On Friday, 20 August 2021 at 10:49:36 UTC-7 William Lupto= n wrote:
No problem William,

in the example screenshots, the t= ext I'm referring to is specifically

D. Ingold= and S. Soper,=C2=A0=E2=80=9CAmazon doesn=E2=80=99t consider the race of it= s customers. Should it?=E2=80=9D=C2=A0Bloomberg, 2016.

I assume it's a list of inlines in the AST, possibly a block, as= I said I don't know where it's stored. I assumed in citations, as = did you, but I don't know how to access it. Anyway, I want that text to= be in my marginnote along side the (lonely looking) [1].

Actually, I'm not interested in having the references at the en= d at all, I'd rather just have the linked reference in marginnote.
On Frida= y, 20 August 2021 at 10:31:57 UTC-7 William Lupton wrote:
Sorry, you'v= e probably already answered this along the way, but I'm confused about = the "text" that you refer to. Perhaps you could attach a JSON AST= that includes a citation with all the desired information from a run that = DOESN'T use your filter? I'm unclear where in the AST to find the i= nformation that you want (and is missing). I had assumed that it must be in= cite.citations but apparently not.

On Fri,= 20 Aug 2021 at 18:25, Leena Murgai <leen= a...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
So I've attached some sc= reenshots in case it helps. You can see that the marginnote contains only the [linked_ite= m_number] of the citation, the rest is missing. Here's the filte= r I used:

function = Cite(el)
=C2=A0 marginnote =3D = pandoc.Span(el.content)
=C2=A0 = marginnote.classes[1] =3D 'marginnote'
=C2=A0 return {pandoc.Span(el.content), marginnote}
end


On Friday, 20 August 2021 at 10:06:30 UTC-7 Leena Mu= rgai wrote:
Hell= o again Bastien,

I just tried your code, it does somethi= ng similar to mine (but clearly you code is nicer :). It's missing the = text that makes up the citation block in the bibligraphy. To be clear I wan= t the whole block (or inline?) that appears in the bibliography in my margi= nnote.

Cheers!

On Friday, 20 August 2021 at 10= :00:56 UTC-7 Leena Murgai wrote:
Thanks=C2=A0 William.

These are the fil= ters I'm using:

1. tex2ht= ml/filters/date.lua=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Replace date= with today's date if it's empty above #
=
2. tex2html/filters/texref.lua=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Cleanup pandoc and pandoc-crossref conflicts = #
3. pandoc-cros= sref=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 # https://github.com/lierdakil/pandoc-cr= ossref #
4. = citeproc=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 # If you need cont= rol over when the citeproc processing #
5. pandoc-sidenote=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # = https://github.com/jez/pandoc-sidenote #
6. tex2html/filters/margincitations.lua = # put citations in marginnotes #
Thanks Pedro.

I'm alre= ady using pandoc-sidenote :). What I actually want is a marginnote. If I tu= rn them into footnotes before running pandoc-sidenote, I end up with a side= note rather than a marginnote which gets a superscript label. This isn'= t what I want. I want to keep the [linked_item_n= umber]=C2=A0(provided by citeproc) and put that in the (unnumbered) = marginnote (with the rest of the ). RawInline let's me do that. I just = can't access the text.
On Friday, 20 August 2021 at 09:44:46 UTC-7 = pedro....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
Jake Zimmerman=E2=80=99s pand= oc-sidenote filter just takes every footnote as a whole and converts it to = a sidenote <span>. Unless you want separate streams for regular footn= otes and citation sidenotes, it might be useful: https://github.com/jez/pandoc-sidenote/= blob/master/src/Text/Pandoc/SideNote.hs

Em sexta-feira, 20 de agosto de 2= 021 =C3=A0s 17:37:55 UTC+1, William Lupton escreveu:
Not sure if this= helps, but here's a simple example showing a somewhat readable dump of= the AST before and after citeproc. I think only cite.content has changed. = I suspect that your problem is something else.

% = cat cite.= md=C2=A0

@RFC1149


% LUA_PATH=3D../?.lua pandoc -L rep.lua --citeproc -L rep.lua cite= .md=C2=A0

(#) meta {}

(#) blocks= {

=C2=A0 [1] content: Para {

=C2=A0 =C2=A0 [1] Cite {

=C2=A0 =C2=A0 =C2= =A0 citations: {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 h= ash: 0

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 id: &= quot;RFC1149"

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = mode: "AuthorInText"

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 note_num: 1

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 prefix: {}

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 suffix: {}

=C2=A0 =C2=A0 = =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 content: {

<= span>=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] Str text: "@RFC1149"<= /span>

=C2=A0 =C2=A0 =C2=A0 }

=C2= =A0 =C2=A0 }

=C2=A0 }

}

[WARNING] Citeproc: citation RFC1149 not found

(#) meta {}

(#) blocks {

=C2=A0 [1] content: Para {

=C2=A0 =C2=A0 [1] Cite {

=C2=A0 =C2=A0 =C2=A0 citations: {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [1] {

=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 hash: 0

= =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 id: "RFC1149"

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 mode: "AuthorInText"=

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 note_num: 1=

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 prefix: {}<= /span>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 suffix: {}

=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 = content: {

=C2=A0 =C2=A0 =C2=A0 =C2=A0 [= 1] Str text: "("

=C2=A0 =C2=A0 =C2=A0 =C2=A0= [2] content: Strong {

=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 [1] Str text: "RFC1149?"

= =C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 [3] Str text: ")"

=C2=A0 = =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 }

=C2=A0 }

}

<p><span class=3D= "citation" data-cites=3D"RFC1149">(<strong>RFC= 1149?</strong>)</span></p>


On Fri, 20 Aug 2021 at 17:14, Leena Murgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I&= #39;m running it after citeproc since I need the citation values.

On Friday, = 20 August 2021 at 09:12:06 UTC-7 Leena Murgai wrote:
Maybe the order I run the filters in m= atters?

On Friday, 20 August 2021 at 09:07:24 UTC-7 Leena Murgai wrote:
Yeah, I tried looking= there, I couldn't find what I wanted. I'm sure I'm missing som= ething.

The question is how to access it? As in what'= ;s the code? For example, each citation (h= ttps://pandoc.org/lua-filters.html#type-citation) has the fields=C2=A0id,=C2=A0mode,=C2=A0prefix,=C2= =A0suffix,=C2=A0note_num,=C2=A0hash. = Which one contains the text I want? What's the code to get the l= ist of inlines I want (corresponding to the text in the citation)?
On Friday, 2= 0 August 2021 at 08:59:52 UTC-7 William Lupton wrote:
Do you mean the cita= tions themselves? These are in el.citations. See=C2=A0https://pandoc.org/lua-filters.html#type-cite and=C2=A0https://pandoc.org/lua-filters.html#type-citation= .

=
On Fri, 20 Aug 2021 at 16:36, Leena M= urgai <leena...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:<= br>
So far I have the following, which puts the [linked_item_number] in the passage and in the marginno= te but I'm missing the rest of the text_that= _goes_in_the_bibliography.

function Cite(el)
=C2=A0 return {=C2=A0
= =C2=A0 =C2=A0=C2=A0pandoc.Span(el.content),
=C2=A0 =C2=A0 pandoc.RawInline('html5', ' <span clas= s =3D "marginnote">'),
=C2=A0 =C2=A0 pandoc.Span(el.content),
=C2=A0 =C2=A0 pandoc.RawInline('html5', ' <= ;/span>')
=C2=A0 =C2=A0 = }
end

On Thu= rsday, 19 August 2021 at 20:32:11 UTC-7 Leena Murgai wrote:
Hi there,

I'm converting from LaTeX to HTML5. I'd like to put my cit= ations in 'sidenote's rather than at the end of the doc. In practic= e, this just means I want the output html: to look like

[linked_item_number] <span class=3Dmarg= innote>
text_that_goes_in_th= e_bibliography</span>

How do I access= the element that goes into the citation, i.e. t= ext_that_goes_in_the_bibliography?

Any = advice appreciated.


--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/eda= 3d7b4-befd-4f42-9455-8a37373d33a6n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8d4c4320-4= a85-4363-8789-8bebcd21d329n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.= google.com/d/msgid/pandoc-discuss/CAEe_xxhvRuUNtQNGP0ozaUAN3OoJvz1z6ijTBKyX= d3M5Yv4Z1w%40mail.gmail.com.
--00000000000029e05b05ca01f785--