From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30648 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jcr Newsgroups: gmane.text.pandoc Subject: Re: Separating multiple citations in generated footnote Date: Wed, 1 Jun 2022 10:36:44 -0700 (PDT) Message-ID: References: <87wne3cfem.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_190_389197583.1654105004048" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21500"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDQLFNXWVILBBLOH32KAMGQEKIPU6PI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 01 19:36:49 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f64.google.com ([209.85.161.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nwSH2-0005Pb-Do for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 01 Jun 2022 19:36:48 +0200 Original-Received: by mail-oo1-f64.google.com with SMTP id a2-20020a4a8dc2000000b0040e6caf521csf1328091ool.3 for ; Wed, 01 Jun 2022 10:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=9XnlI4FaQYsK8F2x5CKEREy639AvU+Q63l13DHygiSQ=; b=fcq8rE1BCBalSqhAKf03ictYxY2I97CBmqo4fVeqF7A+Xah9mEI/wkGJ7591NaVjN2 bco8dcFvcwRynM7zJwbMC0PrzLSySb1YWkng+O3FeZv54t26AJqCJ8aPx8a4u9QI7v3p 8YG0twGjET+46qKfnfR0GLSWaHzFkiCJz6HX7ljXy9VvgcI3jkWMO3sMcZXgmmBms4Ih N08YhAeP5uFLzri598j3REpbuFXl4c025wYLY2UlBOQMwwOmOQkWIjaY90PvAKLmUhGe vuXlOOTZWwBOXoRK+cDfGadWtIoW7zs4p/gHxwFu0sQz0PnLZwV6ZeSGRNWzJ9Hrwhb2 Xong== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=9XnlI4FaQYsK8F2x5CKEREy639AvU+Q63l13DHygiSQ=; b=eoypzOFnP4ITdixf5EfaBx/Isg4IkZ6iZKJ45Z3oBd25ZcFIbPQ8aziGbvMcO3R9MZ fdovujwqBjqC7Sl/bZWQC5mz3lOHuG3rTVJdoRfCoYBbyjS+PRF4hToZUidYL4ds7/tG WzzUQk6xB+H2gfbM9K0bAppVnWQmBcXpXJmTp6BIex6JAUtid6MYOy0R7Ee6f8VT4ewF xZpEsuqG1YUqb1Jjxa4m1nCrhWhZiVJ/uK6gardUCAciWWuq5jURmiwiCl2ZCU56TDeJ Y/3cfPA+5NLsv1SRfDTUqnpfxmdb6/6ie6R5Lz3r5yIUgEqoGvyErLwuIbQAp7mznqIn y1sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=9XnlI4FaQYsK8F2x5CKEREy639AvU+Q63l13DHygiSQ=; b=6wd2KO9GrxLT9B5w6pd0R0iJWucUbkEQiTz2QfwGaelrjqOeZb5TuBtf35ie03ax35 aGJ8zaQCCuTfw/R2AVyDo5kgvNCtel8ogh2MumWBN0i8LaS3JIJuxBBiV9R5tD/7xfI2 qqVQwVKjUF03TSZgIayuhBiH0pyf5c+fzTfsRT4LDxO+zNQzlffCAa7TQVDzh+br6nWW BDbwt2g8FNYDewQ4/0Vpvj5FOonMZJ+dsIClrZ3XUdoX2LQWAoSjogGBXXOJELQQvDiI CLGkv53e87Zt4nISNt/jGo0ZdRCy/8/ZzyRRGEzEKusM0jur690Q70bp+b1CaZ8y6BLK f3GA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533yJ7RkxSimh5SvBniZbPtw62ZwDTF/3UMOFByleL7d+0hprhoT Qvciaqe581mqy61XeyJ4V7M= X-Google-Smtp-Source: ABdhPJwrVwUXUj5sHuIV7eB6k/FHn8GSTrxOb6e7GD2Fj51VdLcfafiybWFp5WO08No32G/SHOeNuA== X-Received: by 2002:a05:6870:15cc:b0:ee:456f:c1e5 with SMTP id k12-20020a05687015cc00b000ee456fc1e5mr363801oad.46.1654105007128; Wed, 01 Jun 2022 10:36:47 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:3b83:0:b0:32b:17fa:a7d6 with SMTP id i125-20020aca3b83000000b0032b17faa7d6ls1605736oia.1.gmail; Wed, 01 Jun 2022 10:36:44 -0700 (PDT) X-Received: by 2002:a05:6808:2006:b0:32b:9f02:ada with SMTP id q6-20020a056808200600b0032b9f020adamr313396oiw.289.1654105004599; Wed, 01 Jun 2022 10:36:44 -0700 (PDT) In-Reply-To: <87wne3cfem.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: ffi.appdev-Re5JQEeQqe8AvxtiuMwx3w@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:30648 Archived-At: ------=_Part_190_389197583.1654105004048 Content-Type: multipart/alternative; boundary="----=_Part_191_1895765332.1654105004048" ------=_Part_191_1895765332.1654105004048 Content-Type: text/plain; charset="UTF-8" Thanks for pointing out the addition of `pandoc.utils.references`. It's definitely useful. I'll have to look into it the next time I want to do something special with citations. I have twice wanted to be able to distinguish individual citations in `Cite`'s inlines. Once was for the purpose of spell checking. When I cite sources in multiple languages, I need multi-lingual spell checking. So, in addition to the document that I will submit, I make ODT with the languages tagged so that I can spell check in LibreOffice. To spell check the citations, they need to be appropriately tagged. Because each bibliography entry has an ID derived from its bibliography key, I can identify them and give them an appropriate `lang` attribute. But in footnotes, it's not clear where one citation ends and the next begins, so I can't add a lang attribute in general. Even if there's just one citation, it could have a prefix or suffix in the document language. For this, perhaps I could use `pandoc.utils.references`, tag the principal parts of the citation with the reference's language, and save the resulting references in the `Pandoc` element for citeproc. The second application was for a journal that uses idem instead of repeating author names. When I decided that an automatic solution was not practical, I solved the problem manually for the few citations that needed idem. For this, I would need too be able to identify not only individual citations, but also the author part of the citation. However, knowing my CSL style, I could assume that the author is the first element in the citation proper (after the prefix), or the series of elements that ends with `SmallCaps`. On Monday, May 30, 2022 at 3:35:06 PM UTC+2 Albert Krewinkel wrote: > > Shane Liesegang writes: > > > What would be truly ideal would be the ability to filter the > > citation process itself, but I'm assuming since that's from a > > different library that it is not exposed to Lua? Like I said, I > > have something mostly working now, but any thoughts/advice would > > be appreciated. > > The closest thing is probably the `pandoc.utils.references` > function (added in pandoc 2.17). It gives you access to the > structured reference entries. Theoretically one could write a > custom citation handler by using that function and filtering > `Cite` elements; it might or might not be worth the effort in your > case. > > HTH, > > Albert > > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > -- 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/d07b4bcd-8431-4fff-8b61-4d482ae382bcn%40googlegroups.com. ------=_Part_191_1895765332.1654105004048 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for pointing out the addition of `pandoc.utils.references`. It'= s definitely useful. I'll have to look into it the next time I want to do s= omething special with citations.

I have twice = wanted to be able to distinguish individual citations in `Cite`'s inlines. = Once was for the purpose of spell checking. When I cite sources in multiple= languages, I need multi-lingual spell checking. So, in addition to the doc= ument that I will submit, I make ODT with the languages tagged so that I ca= n spell check in LibreOffice. To spell check the citations, they need to be= appropriately tagged. Because each bibliography entry has an ID derived fr= om its bibliography key, I can identify them and give them an appropriate `= lang` attribute. But in footnotes, it's not clear where one citation ends a= nd the next begins, so I can't add a lang attribute in general. Even if the= re's just one citation, it could have a prefix or suffix in the document la= nguage. For this, perhaps I could use `pandoc.utils.references`, tag the pr= incipal parts of the citation with the reference's language, and save the r= esulting references in the `Pandoc` element for citeproc.
The second application was for a journal that uses idem instead of r= epeating author names. When I decided that an automatic solution was not pr= actical, I solved the problem manually for the few citations that needed id= em. For this, I would need too be able to identify not only individual cita= tions, but also the author part of the citation. However, knowing my CSL st= yle, I could assume that the author is the first element in the citation pr= oper (after the prefix), or the series of elements that ends with `SmallCap= s`.
On= Monday, May 30, 2022 at 3:35:06 PM UTC+2 Albert Krewinkel wrote:

Shane Liesegang <lies...@= gmail.com> writes:

> What would be truly ideal would be the ability to filter the
> citation process itself, but I'm assuming since that's fro= m a
> different library that it is not exposed to Lua? Like I said, I
> have something mostly working now, but any thoughts/advice would
> be appreciated.

The closest thing is probably the `pandoc.utils.references`
function (added in pandoc 2.17). It gives you access to the
structured reference entries. Theoretically one could write a
custom citation handler by using that function and filtering
`Cite` elements; it might or might not be worth the effort in your
case.

HTH,

Albert


--=20
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
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/d07b4bcd-8431-4fff-8b61-4d482ae382bcn%40googlegroups.= com.
------=_Part_191_1895765332.1654105004048-- ------=_Part_190_389197583.1654105004048--