Thanks Albert,
'Krisztián Hofstädter' via pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> writes:
> Brilliant! Thanks Albert :-)
You're welcome, happy it works 😊
> Now that I'm on it, .... how could I also convert the Contents, List of
> Figures and Tables when making the docx file?
> (When converting to PDF they are all there.)
The Lua filter is a bit too eager and also parses LaTeX blocks that
should be consumed by pandoc-crossref. Try to modify it like this:
```
if raw.format:match 'tex' and not raw.text:match '\\listof' then
return pandoc.read(raw.text, 'latex').blocks
end
```
or, more conservatively
```
if raw.format:match 'tex' and raw.text:match '\\begin%{figure%}' then
return pandoc.read(raw.text, 'latex').blocks
end
```
--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124