1

At the moment I am transforming a large .tex file into .docx. However, many of the equations are broken, also the figures. Since I need only the fulltext in the docx file: Is there a way to tell pandoc to neglect all the equation and figure environments and only to transform the text? This question is related to another question, which has not been answered yet.

Thanks in advance!

varantir
  • 6,624
  • 6
  • 36
  • 57

1 Answers1

2

The document can be modified using filters or Lua filters. Below Lua filter would remove all equations and images:

-- file: remove-math-and-images.lua
function Math(_) return {} end
function Image(_) return {} end

Run with pandoc --lua-filter remove-math-and-images.lua <other options>. More sophisticated modifications are possible; e.g., this replaces all equations with a note hinting at the missing equation:

function Math(_)
  return pandoc.Str('<Equation removed>')
end
tarleb
  • 19,863
  • 4
  • 51
  • 80