I hope you are well. I am using Quartro & RStudio to develop a document. My question is, how would I be able to create a referenceable Hypothesis similar to the native functionality of theorems (see here).
I tried using a .lua file but it didn't work.
local hypothesis_counter = 1
local hypothesis_label = "Hypothesis"
function Div(div)
if div.classes[1] == "hypothesis" then
local title = div.content[1].text
local description = div.content[2].text -- Extract description text
-- Construct the single-line content
local content = pandoc.Strong(hypothesis_label .. " " .. hypothesis_counter .. ": ")
content:insert(pandoc.Space())
content:insert(pandoc.Span(title))
content:insert(pandoc.Space())
content:insert(pandoc.Span(description))
-- Replace the div content with the single-line version
div.content = {content}
hypothesis_counter = hypothesis_counter + 1
end
return div
end