The problem I have is that when I convert a document using Pandoc from .docx to .tex, the tables get messed up. Is there a way to use pandoc that will retain the proper table formatting in .tex?

.docx table formatting .docx table formatting

.tex table formatting after conversion .tex table formatting

  • 1
    Welcome to TeX.SE! Depends at last on your table. Complicated tables need handwork for an proper looking in LaTeX... I just saw your edit: the tex table is better, believe me. Search here for tables and there typographie ... – Kurt May 26 '15 at 13:16
  • Pandoc will convert the table but uses the longtable environment instead of the tabular environment. I need to use the tablular :/ Hi thanks for the welcome! :) – David May 26 '15 at 13:17
  • 4
    The TeX table is poor, nut it's much less poor than the original. The manual for the booktabs package gives some excellent advice on well-formatted tables. If you really need identical (rather than superior) formatting for some reason, you may need to resort to hand-tweaking. TeX is a powerful system; few conversions will be perfect. – dgoodmaniii May 26 '15 at 14:18
  • I think the structure of the format is well preserved. Did you mean the formatting of the table? Do you miss the vertical line separators between columns and the left and right border lines? – Kurt Pfeifle May 27 '15 at 13:20
  • @KurtPfeifle Yes it was the vertical line separators I was looking for. – David May 27 '15 at 23:06

Currently Pandoc doesn't support the tabular table environment.

Someone announced in the Pandoc discussion forum about a year ago a separate Pandoc filter to achieve this:

  • 1
    I was thinking about using the filter mechanism but found an alternative. Writer2latex writer2latex.sourceforge.net seems to work better and uses xml config files to add or remove packages or formatting options. I'm still working out the kinks :) – David May 27 '15 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.