Google Docs is a good place to draft and collect comments; LaTeX is better for the final typesetting. One download and one Pandoc command bridge the two.
What you’ll learn
- Convert via Word (.docx) and Pandoc (recommended)
- Convert via Markdown and Pandoc for text-only documents
- Use the HTML export as a fallback
- Clean up the result in Overleaf
Note: Going the other way? See how to render LaTeX in Google Docs.
Convert Google Docs to LaTeX via Word (.docx)
Use this when your Doc has equations, images or tables. It keeps the most structure.
In Google Docs, select File > Download > Microsoft Word (.docx). For tips on this step, see how to download Google Docs as Word without losing formatting.

Install Pandoc if you don’t have it.
Open a terminal in the folder that holds the .docx and run:
Terminal window pandoc mydoc.docx -s -o mydoc.tex --extract-media=.Open
mydoc.texand check it, or upload it to Overleaf with themediafolder.
Result: a complete .tex file with sections, lists, tables, \includegraphics lines for every image and equations as LaTeX maths.
What the options do:
-swrites a standalone document with a preamble, so it compiles on its own.-o mydoc.texsets the output file and tells Pandoc to write LaTeX.--extract-media=.saves the images into amediafolder next to the .tex and points\includegraphicsat them. Without it, the image paths point to files that don’t exist.
Pandoc converts Word equations in the .docx into LaTeX maths. Check that equations from the Google Docs equation editor came through, and compare complex ones with the original.
Convert Google Docs to LaTeX via Markdown
Use this when the Doc is mostly headings, paragraphs, lists and links.
Google Docs has had a native Markdown export since July 2024, as announced on the Google Workspace Updates blog.
Select File > Download > Markdown (.md). If your content is spread over several files, merge the Markdown files into one first.
Run:
Terminal window pandoc mydoc.md -s -o mydoc.texCheck that images, tables and any equations came through. If they didn’t, use the .docx route instead.
Result: a clean, lightweight .tex file, ideal for text-heavy chapters.
You can also select text, right-click and choose Copy as Markdown to convert just one section.
If you start from a .md file instead, Google Docs can now open and edit Markdown files directly. Google’s help page on using Markdown in Google Docs covers both options.
Convert Google Docs to LaTeX via HTML
Use this only as a fallback, for example on an older workflow that already uses HTML.
Select File > Download > Web Page (.html, zipped).
Unzip the file. The HTML file is named after your document, and images sit in an
imagesfolder.In that folder, run:
Terminal window pandoc MyDocument.html -s -o mydoc.tex
Result: a .tex file, but often with extra spacing and styling noise, because Google’s HTML carries many inline styles. Equations usually come through as plain text or images, not LaTeX maths.
Tip: If you regularly need clean HTML or Markdown, the Docs to Markdown Pro add-on exports tidier files and converts several Docs at once.
Which route should you use?
| Route | Best for | Equations | Images | Effort |
|---|---|---|---|---|
| .docx + Pandoc | Papers with maths, figures and tables | Converted to LaTeX maths (check complex ones) | Extracted to media/ | Low |
| Markdown + Pandoc | Text-heavy chapters | Check after converting | Check after converting | Lowest |
| HTML + Pandoc | Fallback only | Usually lost | From the zip’s images/ | Medium |
All three need Pandoc, which runs on Windows, macOS and Linux. The downloads work the same in any desktop browser.
Clean up the LaTeX in Overleaf
Pandoc’s output compiles, but you’ll want it to match your template.
- In Overleaf, create a project and upload
mydoc.texand themediafolder, keeping the folder name. - Compile. If you get Unicode errors (curly quotes, emoji, non-Latin text), switch the compiler to XeLaTeX or LuaLaTeX through the gear icon or the File menu, then Compiler.
- Move the body (between
\begin{document}and\end{document}) into your journal or university template. - Replace Pandoc’s tables with
tabularxorbooktabsversions if they need fixed widths. - Replace any hard-coded figure numbers with
\labeland\ref.
For image sizing and placement, see how to insert images in LaTeX.
Converting a multi-chapter thesis
Use this when each chapter is a separate Google Doc.
- Merge first, convert once: merge chapters into one Google Doc first, then download one .docx. Merge Docs Pro combines many Docs in one merge and can flatten or preserve document tabs.
- Convert each, combine the .tex: convert chapters one by one, then combine several .tex files into one document.
Batch-convert a folder of .docx files
Download each Doc as .docx into one folder. On macOS or Linux (or Git Bash and WSL on Windows), run:
for f in *.docx; do pandoc "$f" -s -o "${f%.docx}.tex" --extract-media="${f%.docx}"; doneEach file gets its own .tex and its own image folder, so images with the same name don’t overwrite each other.
Troubleshooting
- Images missing in Overleaf: you didn’t use
--extract-media, or themediafolder wasn’t uploaded next to the .tex. ! LaTeX Error: Unicode character … not set up for use with LaTeX: compile with XeLaTeX or LuaLaTeX.- Equations appear as plain text: you used the HTML route, or the “equation” was typed as normal text. Use .docx and the Docs equation editor; see how to insert equations in Google Docs.
- Headings became bold paragraphs: the Doc used bold text instead of Heading 1–3 styles. Apply heading styles in Docs and download again.
Ready to go the other way later? You can convert LaTeX to Word with the same tool. More guides are in the LaTeX guides.