How to convert a Google docs document to LaTeX?

I have found a way through html export

  1. Download the document as html
  2. 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:

  1. 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.
  2. 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

  1. Write LaTeX code snippets inside Google Docs with syntax highlighting.
  2. Add captions to figures and tables.
  3. Cross-refer figures and tables.
  4. Auto update captions and references too, when a new figure or a table is inserted.
  5. View LaTeX compiled PDF in real-time.
  6. Automatic LaTeX source code generation and downloading.

Add-On Link: Docx2Latex Google Docs Add-on

Watch Demo: Short Demo

Tags:

Conversion