Hello, I'd like to follow a question:
The desired caption style required by most of journals is:
Figure 1. Text of figure caption
There is a very close solution proposed by @crsh, which is to apply a custom Lua filter:
function Image (img)
img.caption[1] = pandoc.Strong(img.caption[1])
img.caption[3] = pandoc.Strong(img.caption[3])
img.caption[4] = pandoc.Strong(". ")
return img
end
(Assuming that
img.caption[2]
is the white space betweenFigure
and the number andimg.caption[4]
is the white space between the number and the caption)
Place this filter in a file called
figure_caption_patch.lua
in the directory of thermarkdown
document so that you can apply it by adding apandoc
argument in the YAML front matter:
output:
bookdown::word_document2:
pandoc_args: ["--lua-filter", "figure_caption_patch.lua"]
However, this solution couldn't get the desired style anymore. Instead, it returns:
Figure 1:. Text of figure caption
I was wondering, is it possible to modify the Lua filter to achieve the desired style?
Your kind guidance is much appreciated!