I really don’t know what is going off the rails here, but this is my output: C:\Users\denis\Desktop\pandoc-subtitle>pandoc text.md --citeproc

test (Doe 2022)

Doe, Jane. 2022. A Book: With a Subtitle and a Reference to Gen 1:1, but That Is Not a Problem. Whatever press.
C:\Users\denis\Desktop\pandoc-subtitle>pandoc text.md -L title.lua --citeproc

test (Doe 2022)

Doe, Jane. 2022. A Book. With a Subtitle and a Reference to Gen 1:1, but That Is Not a Problem. Whatever press.
Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im Auftrag von John Carter Wood Gesendet: Dienstag, 5. Juli 2022 13:45 An: pandoc-discuss Betreff: Re: Changing colons to full-stops in titles Changing the order with the original filter didn't have an effect. Trying the revised filter (which I renamed, as it is very different from the first one) resulted in the following error message: [cid:image001.png-/v79opaF+3RFSh627tqNLzRmByFHzeGd@public.gmane.org] Albert Krewinkel schrieb am Dienstag, 5. Juli 2022 um 12:27:43 UTC+2: John Carter Wood writes: > I have finally had a chance to try out Denis's lua filter but I don't > seem to be able to get it to work. > 1. I saved the filter in my .pandoc/filters folder (as > colon-to-dot.lua, attached) > 2. I used the test .md file Denis provided (as dot-test.md, attached) > 3. I used the pandoc command: pandoc dot-test.md --citeproc > --lua-filter colon-to-dot.lua -o dot-test.docx > But what comes out looks like this: the colon is unchanged. > Screenshot from 2022-07-05 12-00-17.png > What am I doing wrong? I didn't test them, but these changes could help: 1. Change the order of `--citeproc` and `--lua-filter=...` on the command line. The order in which these are given is also the order in which they are applied. We want the Lua filter to be applied first. 2. Make sure that the `references` field is populated by filtering the Pandoc element and adding `doc.meta.references = pandoc.utils.references(doc)` Here's the updated filter: ``` lua function Pandoc (doc) local meta = doc.meta meta.references = pandoc.utils.references(doc) meta.bibliography = nil -- prevent citeproc from parsing this again for _, ref in ipairs (meta.references or {}) do ref.title = ref.title:walk { Str = function (str) return str:gsub(':$', ',') end } end return pandoc.Pandoc(doc.blocks, meta) end ``` HTH -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1ebf2a90-159e-4445-bf3a-b068526877cbn%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/2bb67f22fc3044088f798c777f3684d2%40unibe.ch.