Skip to content

Code block caption disappears #9654

Discussion options

You must be logged in to vote

i will try write one by myself.

local pandoc=require('pandoc')
function Meta(meta)
    if PANDOC_WRITER_OPTIONS.listings and not FORMAT:match 'latex' then return nil end
  includes = [[
\usepackage{newfloat}
\DeclareFloatingEnvironment[
    fileext=los,
    name=Verbatim,
    placement=tbhp,
    within=section,
]{coding}
]]

  if meta['header-includes'] then
    table.insert(meta['header-includes'], pandoc.RawBlock('tex', includes))
  else
    meta['header-includes'] = List:new{pandoc.RawBlock('tex', includes)}
  end

  return meta
end

function CodeBlock(elem)
    if PANDOC_WRITER_OPTIONS.listings and not FORMAT:match 'latex' then return nil end
    if not elem.attributes['caption'] then…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@blaplafla13th
Comment options

@jgm
Comment options

@blaplafla13th
Comment options

Answer selected by blaplafla13th
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants