You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to render rmd as docx using the latest version of pandoc and pandoc-crossref, I encountered the following bugs:
Error running filter .../papaja/lua/docx_fixes.lua:
.../papaja/lua/docx_fixes.lua:24: attempt to index a nil value (field 'integer index')
stack traceback:
error: pandoc document conversion failed with error 83
I tried to fix this bug by modifying lua, mainly to recognize that the Table function is skipped when adding pandoc-crossref causes the tbl.caption.long to be empty.
function Table(tbl)
-- Check if tbl.caption.long is not empty
if #tbl.caption.long > 0 then
local caption = tbl.caption.long[1].content
-- Modify the caption if it's not nil
if caption[1] ~= nil then
-- Your existing code to modify the caption
caption[3] = pandoc.Str(string.gsub(pandoc.utils.stringify(caption[3]), ":", ""))
caption[4] = pandoc.LineBreak()
-- ... (rest of the caption modification code)
end
-- Assign the modified caption back to the table
tbl.caption.long[1].content = caption
end
-- Return the modified table
return tbl
end
After testing, this method is feasible.
The text was updated successfully, but these errors were encountered:
Hi, thanks for reporting this and suggesting a fix! Would you happen to have a reproducible example, so I can verify and test this before I make the modification in the package? Cheers!
Hi, thanks for reporting this and suggesting a fix! Would you happen to have a reproducible example, so I can verify and test this before I make the modification in the package? Cheers!
Thank you for your prompt response!
You can indeed replicate the error with the basic template from papaja. The modifications required are in the YAML output section, as follows:
To ensure this works, please make sure that the latest version of pandoc-crossref.exe is placed in the same directory as your RMD file.
Looking forward to your verification and testing.
Best regards!
When I tried to render rmd as docx using the latest version of pandoc and pandoc-crossref, I encountered the following bugs:
I tried to fix this bug by modifying lua, mainly to recognize that the Table function is skipped when adding pandoc-crossref causes the tbl.caption.long to be empty.
After testing, this method is feasible.
The text was updated successfully, but these errors were encountered: