How do you keep the styling when you convert docx to pdf in Pandoc?

Viewed 1373

I m using pandoc to convert docx file to pdf. Command I'm using for converting:

pandoc -o document.pdf document.docx

The problem is that after the convert, the styling disappears.

enter image description here

As you can see, The colors are missing and my table's position is moved to right

1 Answers

Pandoc does not convert styles/layout/formatting.

From https://pandoc.org/MANUAL.html:

Because pandoc’s intermediate representation of a document is less expressive than many of the formats it converts between, one should not expect perfect conversions between every format and every other. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size.

Related