1

I am mostly using latex with text editor for writing articles, however there are some journals that require manuscript to be written in .docx format. A good conversion from .pdf to .docx is possible but many rendering are getting the lost in the process and the layout is often really messed up. The best solution was with adobe for which you need a subscription and the result is still not perfect. Therefore I was wondering if it is possible to write/prepare a document in a text editor for libreoffice or any other open source similar solution (in a .dot format or any other similar format), and then convert it from there in .docx.

Many thanks in advance

Edit

Ok so thank to the answer of @ArrayBolt3 I installed rstdoc and could convert an .rtf file into a .doc file with the command:

rstdoc ex1.rst > ex2.doc

However a similar command with .docx did not work

rstdoc ex1.rst > ex2.docx
ecjb
  • 111
  • 4
  • The correctness of this answer is going to depend greatly on the formatting options of the document. Having things like watermarked images, special types of tables with merged cells, and the like may result in outputs that are suboptimal. However, LibreOffice *will* save as `.docx`, so it's really a matter of testing it with your documents to see if there are issues – matigo May 25 '22 at 06:42
  • Many thanks for your answer @matigo. Indeed there are tables, cells and images. 1. What is the most robust solution that you know of? Otherwise: 2. what is a solution for text with headings WITHOUT tables, cells and images (in the worst case scenario I could handle them seperately). – ecjb May 25 '22 at 06:53
  • Untested: http://www.vdb1.de/latex_doc.html – Bruni May 25 '22 at 11:38
  • I usually write in LibreOffice Writer and save the document as Word 365 (.docx) format. If you use equations or diagrams in your manuscript, you may not get everything as you expected after the conversion to MSWord. My solution is to use the free version of MSWord at office.com (you will need a free Microsoft account) for the final checks and edits. – user68186 Jun 09 '22 at 20:57

1 Answers1

1

While I've not attempted to use it before, there's an open-source project called "rstdoc" that allows you to create .docx files from reStructuredText source code. reStructuredText is somewhat similar to Markdown, but more powerful. https://github.com/rstdoc/rstdoc

ArrayBolt3
  • 2,797
  • 8
  • 30
  • Thanky for your answer @ArrayBolt3. But I don't see how it adresses the question: can OnlyOffice compile a document from a text file? – ecjb May 25 '22 at 07:30
  • @ecjb Ah, I misunderstood. I read "write/prepare a document in a text editor for libreoffice or any other open source similar solution, and then convert it from there in .docx." as "write something in an office suite and save it as .docx". I'll edit my answer so that it answers your actual question. I think I've got a good solution. – ArrayBolt3 May 25 '22 at 10:14
  • Thanks for your comment @ArrayBolt3. Looks promising indeed. I looked at the documentation but I could not get a workable simple example from it (for example convert a small .txt file into a doc, docx or dot file. Did you? – ecjb Jun 09 '22 at 11:38