TransWikia.com

How to convert a Google docs document to LaTeX?

TeX - LaTeX Asked by Evpok on June 15, 2021

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.

6 Answers

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

Correct answer by Evpok on June 15, 2021

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

Answered by aaryan on June 15, 2021

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

Answered by Docx2Latex on June 15, 2021

Auto-Latex Equations add-on for Google Docs

Perfect for beginners on your team, Auto-Latex Equations add-on for Google Docs is also free. It simply replaces all your equations with high-quality images of the equation. It won't take all the LaTeX section commands, but it'll still look professional.

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.

You can get it for free at the Google Docs add-ons store.

Answered by John Targaryen on June 15, 2021

I find the best and most agile pipeline in my case is to upload first your G docs or Word document to DocXtoLatex, download the resulted zip file and upload it to Overleaf. There you can easily make big or small changes like replacing bullets with dashes (eg. item[--])

Answered by Ariel Klein on June 15, 2021

I wrote the Google Docs add-on Articul8. It allows you to use either Docs' built-in equations, add full-fledged TeX equations, and export everything to TeX or Markdown.

Insert TeX equation Export TeX and import to Overleaf

The Zip file that was export can be import into an online tool such as Overleaf or rendered on your PC.

It also has some other features essential for writing manuscripts, such as numbered equations, tables and figures, cross-reference links for all of those, as well as header numbering. Hope it helps, and I would love to hear how it's working out for readers of this answer.

Answered by Yuval on June 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP