Replies: 2 comments 2 replies
-
That should not be too hard. |
Beta Was this translation helpful? Give feedback.
-
This is "easy" in 1.4. You'll need:
This separation clarifies the three major phases in our Lua filters: (This separation is at least somewhat aspirational, and there's still a bit of format-specific output in the SpecificsYour filter will look more or less like this: local captures = pandoc.Blocks({})
return {
FloatRefTarget = function(float)
-- float.order is a data structure that stores where the float is found
-- use quarto.log.output() to inspect its contents, or follow the code in `refNumberOption`
-- from src/resources/filters/crossref/format.lua
-- then, use that to create a pandoc.Para
captures:insert(pandoc.Para(...))
end,
Pandoc = function(doc)
return pandoc.Pandoc(captures) -- replaces the result with a completely new document
end,
} Then, in your .qmd you'll use:
Of course, you probably want to consider putting this metadata in a separate .yml file that you conditionally invoke, so that you get your regular content unless you specifically enable the filter. This is the kind of thing we would love to support better in the future, and why we did the crossref overhaul. One of the things that's pretty janky right now is that we don't expose refNumberOption, etc, or document the EDIT: "Oh, a book"This is significantly more complicated :( The fundamental problem is that book rendering is multi-file, and so the crossref information is computed differently. For books, we have an additional Pandoc pass that runs in formats that produce a single file (.epub, .pdf, .docx, etc) We'll still need to run the filter above, but only in the final pass that produces the single output. If this weren't a user filter, you'd use Let me talk to the other quarto folks and get back to you. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm writing a book with CRC using Quarto + knitr + Latex, and the publishers are asking that the ALT text for each figure be copied into a single Word document. Has anyone written a Lua filter doing something like this?
fig-alt
field of each figure chunkMany thanks
Beta Was this translation helpful? Give feedback.
All reactions