Since the Image element is affected here, you need something like:

Image = function(img) img.attributes.width="100%"; img.attributes.height="100%"; return img end

(NOTE: if the height has already been set, eg by another filter, then only setting width to 100% might not be enough, which is why I also put height to 100% above; the LaTeX default template will adjust to it by keeping aspect ratio and prevent overflow, but I haven't tested what the ODT writer will do if height 100% is omitted...)

If this is the only element to change in this filter, then the filter is:

local filterImageWidth = { Image = function(img) img.attributes.width="100%"; img.attributes.height="100%"; return img end }

If this is the only filter in your lua file, than the file will simply consist of:

return { filterImageWidth }

or

return { { Image = function(img) img.attributes.width="100%"; img.attributes.height="100%"; return img end } }

You'll see this often written as:

return {
 
{ Image = function(img)
      img
.attributes.width="100%"
      img
.attributes.height="100%"
     
return img
   
end,
 
}
}

(which is more manageable if there's instructions)

or, alternatively, you could just write in this lua file:

function Image(img)
  img
.attributes.width="100%"
  img
.attributes.height="100%"
 
return img
end

and Pandoc will construct the return list of filters by itself.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1f473739-d7bf-453a-ab3d-1f69eae7803d%40googlegroups.com.