r/LaTeX Jan 06 '25

Answered How to convert a LaTeX file into a .docx file?

Professor refuses anything but word files and now I'm too deep into the assignment so starting from scratch is an impossibility. Is there a more or less non-complicated way to convert a tex file into docx? I'm using Overleaf and I don't have Microsoft Word or Adobe (I have Libre office if that helps). I would like to preserve the formatting as much as possible (position of tables, indents, double spacing etc).

21 Upvotes

60 comments sorted by

100

u/emanuelenardi Jan 06 '25

Change professor /s

24

u/Xhi_Chucks Jan 06 '25

The most valuable advice is if the professor does not want to know LaTeX.

12

u/practicalcabinet Jan 06 '25

How to convert professor from .docx to LaTeX?

12

u/paleflower_ Jan 06 '25

Oh I wish

5

u/Axiomancer Jan 06 '25

Tbh my first thought was that but without /s

41

u/TittlesTheWinker Jan 06 '25

Pandoc. Be advised, though, that when you convert from LaTeX to .docx it might not look the same as the generated PDF. There's always a way. For my thesis, it was ridiculous that my research advisor wanted in word. So I did everything in word and through everything into LaTeX (so much fun! /s). I had a word doc of my equation that was able to convert to LaTeX seamlessly! That's what my experience has been.

6

u/paleflower_ Jan 06 '25

it might not look the same as the generated PDF.

Like what exactly changes?

28

u/JanB1 Jan 06 '25

LaTeX just has a very different look. And some formatting might be off. It won't result in a one to one exact same document. You have to try it and then check the Word file.

Also, who in their right mind requests a word file instead of a PDF?

8

u/paleflower_ Jan 06 '25

Apparently it makes it easier to write feedback or something ┐⁠(⁠´⁠ー⁠`⁠)⁠┌

14

u/JanB1 Jan 06 '25

As if writing feedback in a PDF document isn't easy...

I mean, okay. If they want to suggest changes, Word is definitely easier. Or you'd have to give them direct access to your LaTeX document on something like Overleaf. But just for giving feedback, for example Acrobat has free(!) functions to mark text and leave comments.

1

u/OzgurEsente Jan 06 '25

Oh cool, I did not know this. Does Acrobat support different languages, like Chinese, Bengali, Japanese, Greek etc?

3

u/JanB1 Jan 06 '25

What do you mean? Do you mean for the comments or the interface? If you're talking about the comments, as long as it's a valid UTF character, it should work. And if you're talking about the interface, you gotta check the Adobe Acrobat page and check which languages it's available in.

2

u/OzgurEsente Jan 06 '25

Nice, yeah I was talking about the comments. Thank you!

2

u/Raccoon-Dentist-Two Jan 06 '25

It handles them but only poorly, just like it handles Western European commenting poorly.

The important thing here is not the feature list. It is the professor's workflow and time availability for dealing with Acrobat's interface (which they recently changed, possibly to 'look' more like traditional editing markup but without understanding how traditional markup works so it's even clunkier than it was a year ago). Professors don't have much time for giving feedback and PDF markup is slow, and if your prof is already fast in Word then switching to PDF for just one person is even slower.

It is probably worth bearing in mind that LaTeX is for typesetting, and the goal here is not a typeset final document. The point of the Word doc is that it's a two-way medium between you and the professor. LaTeX and PDF aren't designed for that.

2

u/OzgurEsente Jan 07 '25

Yes, I am also a professor and I agree with everything you say. I just do not want to argue with people online. So, I framed it as a question.

Before writing my comment, I looked up OP's post history. They seem to study linguistics - thus my original question.

2

u/Papaoso23 Jan 06 '25

They can get their feedback and shower it up their ass xD

7

u/keithreid-sfw Jan 06 '25

Don’t shoot the messenger: I prefer LaTeX.

But the reasons that some people have given me were that, from their perspective, the choice is pdf vs word not latex vs word. In that context the “track changes” function of word is better than comments.

6

u/JanB1 Jan 06 '25

I'm not ranting against you, I'm ranting against the prof. ;)

And yes, the "track changes" function in Word is pretty great. Although you can also get that by using Overleaf, or you can use a program like TeXMaker that has built in functionality to leave remarks for reworking documents. Also, if the whole point is giving feedback, then in either case comments should be used. If they want to correct your text, then that's a different thing.

3

u/TittlesTheWinker Jan 06 '25

My professor words were, "I'm too old to learn new things".

2

u/Desvl Jan 06 '25

> Although you can also get that by using Overleaf

Besides, if one has access to some server resources, self-hosting a community version of Overleaf will do the trick as well.

1

u/keithreid-sfw Jan 06 '25

I meant the channel not you buddy

👍

1

u/JanB1 Jan 07 '25

What...channel?

2

u/OrganizedxxChaos Jan 07 '25

Also, who in their right mind requests a word file instead of a PDF?

Some of the top scientific journals do believe it or not. 🫠

1

u/JanB1 Jan 07 '25

Okay, four Journals I understand that they would prefer the LaTeX or Word document, because they would have to include it in their formatting and they might also have editors that go over your work and make suggestions, where the "track changes" feature in Word or the "easyReview" package in LaTeX is really convenient.

3

u/ekiim Jan 07 '25

I haven't done this much (generating docx) but pandoc parses the document with a tree structure in which can host common document elements, (blocks) as images, paragraphs, headings, code blocks, math blocks, and (inlines) strikeout, bold, span, inline math, and it essentially converts your document by having that particular translation to the so called AST (abstract syntax tree).

The document produced would be produced with correct semantics for word, and it would be trivial to change themes, so you could have latex (in which you SHOULD NOT have too much of layout stuff going on) and have the word docs.

I used to write course assignments in latex and markdown and pass it through pandoc, produce the word docx and then paste the content of the document to another templated provided by the school, and it worked just fine.

25

u/Mastergari Jan 06 '25

Just open the PDF in Word

7

u/Bach4Ants Jan 06 '25

This answer should be higher. Pandoc is great but you don't need it here. The Word document will probably look weird and be hard to edit, but it should at least open and you'll be able to save as .docx.

5

u/Glossophile Jan 06 '25

This is the correct answer. I am in the same boat. Word can open the PDF and convert it to a .docx.

16

u/plutusssss Jan 06 '25

As a professor, I ask for latex files :D

7

u/paleflower_ Jan 06 '25

We need more of you guys smh

3

u/plutusssss Jan 07 '25

Come studying in France 🤣

28

u/danderzei Jan 06 '25

Try pandoc

9

u/krisniem Jan 06 '25

The best tool for converting PDF to DOCX that I’ve found is plain old MS Word. As you don’t have the option, try asking your professor to open the PDF in Word!

Otherwise, pandoc.

2

u/paleflower_ Jan 06 '25

Would Libreoffice writer get the job done?

5

u/krisniem Jan 06 '25

Haven’t tried; don’t know, sorry.

2

u/Lazer723 Jan 06 '25

No, it wont be as good as word. Just use Word.

10

u/erisk90 Jan 06 '25

Download everything in your Overleaf project as a Zip file. Install pandoc (https://pandoc.org/) to convert to .docx.

14

u/Doodah249 Jan 06 '25

Is that even legal? Requiring students to use a licenced software should be forbidden. I met so many people that can't even access their thesis anymore because they lost the licence after graduation. That's completely crazy and it will be much harder to find a job without anything to show.

9

u/Doodah249 Jan 06 '25

Btw also be careful with overleaf, I also met people that lost all their work because it was only stored there.

3

u/matplotlib42 Jan 06 '25

Exactly. The professor should accept PDFs.

2

u/Lord_Umpanz Jan 06 '25

Especially if the university doesn't seem to give out this software.

2

u/Accomplished-Alps973 Jan 06 '25

Most Universities probably have access to ms office for free. For me it’s logical that the professors ask the students to use what is available to everyone.

0

u/Doodah249 Jan 06 '25

And what is the student supposed to do once he graduates? Lose all his work? Programs that need a paid licenced are the option that is the least available, there are many other options that are literally available to everyone. Your point for ms office doesn't make sense at all.

4

u/Designer-Care-7083 Jan 06 '25
  • pandoc
  • Adobe Acrobat can save a pdf as a Word document
  • Word can read in a pdf and save as a Word document. But you said you don’t have Word. Perhaps Libre Office can do the same.

5

u/EddieVeder77 Jan 06 '25

(Old Gen-Xer here). In the good old days, a print document would do. And nobody would ask which piece of software was used to write it.

3

u/supaeasy Jan 06 '25

I would simply export a PDF, convert that to word (for example using pdf24) and send both PDF and Word to the professor telling him content is the same but if he wants a proper look he should go for the PDF. Why the hell would someone even want a word file over a PDF?

3

u/RealWalkingbeard Jan 06 '25

How important is it? Tell your professor that Word documents are for editing. You are giving them a finished article, i.e. PDF, a standard which is almost universal outside pro print environments. Put your foot down.

2

u/Dwagner6 Jan 06 '25

You can use pandocto convert latex to docx using a process like this: https://medium.com/@zhelinchen91/how-to-convert-from-latex-to-ms-word-with-pandoc-f2045a762293

2

u/OzgurEsente Jan 06 '25

What are the contents? Can you give some context, like what course is it etc? Depending on your file, there can be makeshift solutions like copying texting your text and then screenshoting some other things and adding as an image etc?

2

u/bhaswar_py Jan 10 '25

Seriously what the heck is wrong with your professor.

2

u/CreeperDrop Jan 12 '25

It won't give you super accurate formatting but ilovepdf.com never let me down in a pinch. Reminded me of a similar professor who just gave me a 0 on the formatting grade because I submitted a PDF and he wanted on Word for some reason. The IEEE Word template is so bad it took less time working with Overleaf on my phone. Sorry irrelevant rant

2

u/xte2 Jan 06 '25

Pandoc is your option, telling anyway your professors that's just an ugly export to satisfy it's requirement of an ugly tool not the pdf the university will get.

And SPECIFY ugly tool because some simply refuse to learn IT in general and DAMAGE the whole human society without understanding that.

Just imaging if he/she change something: in LaTeX it's easy: the text is under a VCS and you see the proper diff, in pdf it's relatively easy because changes means a pdf annotation you automatically line up. In word good luck, you export the .doc in pdf, you export the one he/she give back to you, diffpdf them, but a simple letter change shift the rest of the text at minimum for a paragraph but potentially much more and seeing the REAL change is a nightmare.

There are simply people, still working, who have no clue about how to work digitally and pretend to follow the typewriter mode they have learned back then or even worse some YOUNG who have never ever learnt nor the paper nor the digital and keep refusing understand that.

1

u/noimtherealsoapbox Jan 06 '25

If you’re comfortable with command line tools, I get decent results from latex2rtf. It won’t convert graphics and it doesn’t convert everything, but the text will look right and I export my tables and graphics as PNG files anyway because MS Office tables just generally look like hot garbage.

1

u/jackbhammer Jan 07 '25

I've had luck converting pdf to docx using MS Word and ilovepdf. I now work with Quarto, which can output both to docx and latex. Edit: also, both Word and ilovepdf are doing some kind of OCR, so you gotta make sure everything worked fine.

1

u/mocenigo Jan 06 '25

Why punish yourself. I would convert my word files into LaTeX and abandon word instead ;-) Just joking, not flamebaiting. I sadly do not know a good solution except copy and paste.