Here they are in a gist. 

https://gist.github.com/sjml/30b1f0093e48f37408871cc142d3dc12

My program deals a lot with ancient and theological sources and has very specific requirements for how certain citations look. I’m sure at least *some* of this could be done by modifying a CSL (like using “§” instead of “sec.” in the locators), but others are around specific works (like the Summa Theologica) or types of documents (papal encyclicals), and as far as I can tell, CSL doesn’t have that level of conditional processing. (I also speak Lua far better than I do CSL. :) )

What really inspired this question was the institutional abbreviation filters — on a second citation of certain institutional sources, they should be referred to by their abbreviation. But until CSL 1.1, there’s no support for short author names… so I track subsequent mentions, suppress the author, and add in the abbreviation after citeproc has done its work. But when I’m trying to do that insertion into a citation with multiple sources, you see the kind of weirdness I do in that post-filter. Would be great if I could just look for a Span with an attribute that maps to a citation key or something like that. 



On May 31, 2022, at 10:24 AM, <denis.maier@unibe.ch> <denis.maier-NSENcxR/0n0@public.gmane.org> wrote:

No, I’m not interested in anything in particular. Just general interest.
 
Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss@googlegroups.com> Im Auftrag von Shane Liesegang
Gesendet: Montag, 30. Mai 2022 15:43
An: pandoc-discuss@googlegroups.com
Betreff: Re: Separating multiple citations in generated footnote
 
I haven't made the repository public yet, but would be happy to share a subset -- is there anything in particular you're interested in, or just general interest in citation filtering?
 
On Mon, May 30, 2022 at 11:14 AM <denis.maier-NSENcxR/0n0@public.gmane.org> wrote:
I don’t have a particular suggestion for what you need, but I might be interested in what you already do. could you perhaps share your filters ?
 
Best,
Denis
 
Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Shane Liesegang
Gesendet: Montag, 30. Mai 2022 09:07
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Separating multiple citations in generated footnote
 
My institution has a few specific citation style requirements that stray from the standard Chicago Style. The changes are mostly around specific works, so it's difficult-to-impossible to meet the requirements by making a new CSL. 

For the most part I'm able to handle it with Lua filters. I intercept the citation reference both before and after --citeproc runs and make whatever changes I need to; this might entail changing the style to SuppressAuthor, making some capitalization/punctuation changes, etc. In general this works well, but where it gets difficult is if a single Cite element contains multiple citations. In that case, looking at the generated footnote, there's no hard indicator of which portion came from which citation. I've got something working based on scanning for semicolons, but I worry that's a little bit fragile and will probably break on certain sets of reference data. 

Is there any good way of mapping portions of the footnote to citation keys? I was thinking to wrap them in a span with some custom metadata, but I can only see the citations either before --citeproc (when the footnote doesn't exist yet) or after (when the multiple citations have already combined). 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.
-- 
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/baf8fe27-c662-4825-981d-b49fb7b38d71n%40googlegroups.com.
-- 
You received this message because you are subscribed to a topic in the Google Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pandoc-discuss/uIe_wOxcGUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8ed092b504f248fa984c4284113f68ff%40unibe.ch.
-- 
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAD7-qeusumC9zcpbCGbjevJ6J9Vdi4W8YJyTjiTmbR_yk5%2Bmrg%40mail.gmail.com.

-- 
You received this message because you are subscribed to a topic in the Google Groups "pandoc-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pandoc-discuss/uIe_wOxcGUs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/873d53586f8b4f968ac667b38da1796c%40unibe.ch.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/25193173-1E8E-4A2B-81C2-9AB3BBE6DC12%40gmail.com.