How to convert a Google docs document to LaTeX?
I have found a way through html export
- Download the document as html
- Use Pandoc to convert the html to LaTeX
It is not perfect but better than my old Markdown solution (see below) and preserves most of the original document. It even keeps images!
An inferior solution that I'll leave here because the export from/to Markdown could still be useful for future readers:
- Use Renato Mangini's gdoc2md script to get a Markdown export of your doc. The install instructions are a bit outdated, but it's nothing to be afraid of.
- Use Lunamark or Pandoc to get a LaTeX document from the resulting Markdown. You can even make it standalone (or even export to something else than LaTeX)
Now obviously it is not a very polished process and the resulting LaTeX will need some tweaking to get things right, but at least it keeps the \section structure, most of the basic formatting (not fancy things like colours, though), the lists and all the Markdown I did originally use in the Google doc to mark the places where I wanted to put fancy formatting later (e.g. > for quotes).
Try Docx2Latex. They have support for importing Google Docs directly from Google Drive.
Disclaimer: This is official account of Docx2Latex
Although @aaryan has already mentioned our website in previous answer we would like to add few things.
We have just launched Google Docs-add on which combines power of Latex and ease of word processors and cross Referencing too.
Here are features provided by Docx2Latex add-On
- Write LaTeX code snippets inside Google Docs with syntax highlighting.
- Add captions to figures and tables.
- Cross-refer figures and tables.
- Auto update captions and references too, when a new figure or a table is inserted.
- View LaTeX compiled PDF in real-time.
- Automatic LaTeX source code generation and downloading.
Add-On Link: Docx2Latex Google Docs Add-on
Watch Demo: Short Demo