Open leowill01 opened 12 months ago
workaround found here: https://github.com/jgm/pandoc/issues/7915#issuecomment-1427113349
EDIT: this workaround was not able to render markdown or latex expression syntax in the short captions in the LOF, so here is modified script from that workaround with that added functionality (originally posted here) :
PANDOC_VERSION:must_be_at_least '3.1'
if FORMAT:match 'latex' then
function Figure(f)
local short = f.content[1].content[1].attributes['short-caption']
if short and not f.caption.short then
-- Parse the short caption as Markdown to handle formatting and then convert to LaTeX
local short_caption = pandoc.read(short, 'markdown').blocks[1].content
f.caption.short = pandoc.Inlines(short_caption)
end
return f
end
end
im trying to render an R Markdown document using the
short-captions.lua
Lua filter. the render is usingbookdown
references and is using thepandoc
version that comes with RStudio. THE PROBLEM = the figure caption in the list of figures (as inserted with\listoffigures
) is the long caption, not the short caption specified in the{}
attributes after the image link.here's a minimal reprex of the
.rmd
doc:here is the rendering command used by RStudio:
ive uploaded my PDF output: _TEST-lua-short-captions-minreprex.pdf
i am running:
/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc
]