# How to convert a Google docs document to LaTeX?

I am working in a team with people who didn't know LaTeX, and while I would have loved to get them into it through shareLaTeX or a similar service, we don't have the time for this. As a result, we are working on Google Docs. But while the WYSIWYG is really helpful for them, I am very frustrated with the limitations of the interface and the tediousness of making it look good¹ and I would like to get it as a LaTeX document, essentially keeping the structure (Keeping paragraphs, turning headings into \sections and so on, maybe even page breaks!) and the basic style (bold, italics…)

So: is there a way to convert a Google docs document to a LaTeX file while retaining as much of its structure as possible?

1. And don't get me started on the bibliography. Ugh.

• If you like preserving nice clean source code and equations, with a gui to help edit it, and sharing via google docs, check out LaTeXLab and see other answers at tex.stackexchange.com/a/199979/21341 – nealmcb Sep 30 '14 at 4:10
• I did this recently, by downloading from Google Docs as a Word document, opening it in LibreOffice Writer, and using Writer2LaTeX. It worked better than going via HTML, in my case. – ShreevatsaR Oct 25 '17 at 19:04

I have found a way through html export

• 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).

• What about Pandoc? – Werner Jun 5 '14 at 17:30
• A nice practical method. However, google export equations as images :-( – Juh_ Jul 31 '14 at 16:12
• "so I am writing an Add-on for Google docs that would do it directly" – any news on that front? Would love to have something like that :-) – Daniel Aug 7 '16 at 6:55
• @Daniel Sadly no, that never went far for lack of real need and inconvenience of working with the platform. – Evpok Aug 7 '16 at 7:06

Try Docx2Latex. They have support for importing Google Docs directly from Google Drive.

• Welcome. Does it work? Have you tested it? – Bobyandbob Nov 23 '17 at 9:14
• Yep, it works ! – aaryan Nov 25 '17 at 6:31

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.
All you have to do is type an equation within delimiters, like $$55 + \sqrt{5}$$ and it can be rendered in super high quality at whatever time you like by rendering all the equations in your document. If you mess up, you can always undo one or all the equations.