117

I collaboratively edit documents in Google Docs. Unfortunately, there are no LaTeX macros/wrappers I know of for Google Docs. So, editing a TeX file on Google Docs is like going back to the old days when you had to edit LaTeX in plain text.

Does anybody know of a LaTeX wrapper for Google Docs?

9

12 Answers 12

71

Auto-Latex Equations add-on for Google Docs

For all math equations typeset in MathJax/LaTeX, the Auto-Latex Equations add-on for Google Docs is free and works brilliantly. It simply replaces all your math with high-quality images of the equation.

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.

5
  • 2
    @cfr Yup. I'm just hoping this will help someone who needs LaTeX for math equations in particular. Indeed, this is better than nothing from OPs perspective. Oct 11, 2015 at 21:37
  • 1
    @Joe this is exactly what I was looking for. +1
    – zeboidlund
    Jun 24, 2017 at 2:42
  • 1
    @NeilTraft you have to use shift+enter instead of enter for multiline equations. Jan 8, 2019 at 21:06
  • The permissions are answered on the website at autolatex.com under the permissions explained tab. Dec 10, 2019 at 1:09
  • I get an error when I follow those links. I was able to find the add-on here workspace.google.com/marketplace/app/autolatex_equations/… Jul 7, 2021 at 13:56
27

LaTeX Lab

Unfortunately, LaTeX Lab has been declared deprecated by its developers. This seems to be a results of Google's massive API changes in recent versions of Google Docs. There is a vast number of LaTeX-Lab-like wrappers for Google Docs whose developments has ceased due to that fact.

If you want to have integration with Google Docs you may want to use LaTeX Lab (offline). From the Google Code project site:

LaTeX Lab is deprecated

LaTeX Lab is an open source implementation of a web based LaTeX editor for Google Docs.

Other online editors

Some other popular online editors are:

  • Overleaf (formerly known as WriteLaTeX; didn't require signup before the merger with ShareLaTeX but does now)
8
  • changed the link and description due to the rebranding. Feel free to roll back.
    – Johannes_B
    Jan 26, 2015 at 20:33
  • 1
    It seems LaTeX Lab doesn't work anymore...
    – Royi
    Jul 20, 2015 at 19:33
  • 3
    @jvriesem Google substantially changed its Google Docs API recently. Therefore most other wrappers also stalled their development due to not being able to keep up with Google's rapid sequence of changes. Aug 23, 2015 at 13:56
  • 8
    Dear downvoter, it is common practice on this site to leave a comment stating the reason for downvoting. I would really appreciate if you can point out the things where my answer is lacking. Feb 2, 2016 at 8:07
  • 1
    Overleaf and ShareLaTeX are now part of the same company (can't remember which one bought the other) so it seems they will be gradually merging into one product.
    – daknowles
    Aug 31, 2017 at 6:55
8

As of September 2019 the site is not reachable anymore (the name does not exist: https://downforeveryoneorjustme.com/weavr.co.uk)

Following from the @aaron terse answer, I have been using http://weavr.co.uk/...

Pros

  • It's free
  • As far as I can ascertain at the moment it's the only Latex compilation that works with Google Drive/Docs. You therefore get all the collaborative environment tools.
  • Certainly for the basic editing I've done it works fine. There is some weavr specific code which needs to be included to reference other files (e.g. bib, images, etc.), but it's not too invasive.

Cons

  • The documentation is very minimal (one page and a half) and there is no obvious user support (e.g. forum, wiki).
  • I can find little information about weavr and the code seems to be developed/supported by one person (http://weavr.co.uk/contact.html). So it's not clear the extent to which the code will be maintained/developed in the future.
3
  • The website has now been in existence for more than three years. The developer is very responsive to any problems that are brought to his attention. There appears to be active development over the years. Seems to be a great solution.
    – A Feldman
    Dec 27, 2015 at 2:40
  • Do you have further experience with weavr two years later? How does it compare to sharelatex/overleaf?
    – daknowles
    Aug 31, 2017 at 6:55
  • Weavr is still very useful even two years later. I did use it recently and it works well. I think that it compares very well to sharelatex/overleaf, and Weavr has always been completely free to use. The storage space is practically unlimited as gdoc format is not counted against your storage quota in google docs. Google docs has extremely good collaboration features, that cannot be beat at present. However, I more often use my own solution as it uses my own latex installation, which I like.
    – A Feldman
    Sep 18, 2017 at 4:23
7

Also check out Authorea. From what I understand it is similar to Overleaf and ShareLatex mentioned by @HenriMenke above.

2
  • This is more a comment than a new answer. Maybe you could suggest adding it the Henri Menke's existing answer?
    – cfr
    Dec 27, 2015 at 2:57
  • 3
    @cfr Thanks for the suggestion. I purposefully choose this format because people can sometimes miss out on comments when there is a large number of them.
    – champost
    Jan 4, 2016 at 19:58
6

I wrote a Google Docs add-on called Articul8. It allows you to incorporate LaTeX equations into your Google Doc, as well as to export the document to TeX (images included, cross-references intact). You can render the document locally or upload to an online service (e.g. Overleaf).

I'd be very happy to hear how this works out for people, and for any suggestions!

Add TeX equation

Export to TeX, import to Overleaf

5

Disclaimer: This is official account of Docx2LaTeX

We have just launched a Google Docs-add on which combines power of LaTeX and ease of a 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, when a new figure or a table is inserted.
  5. View LaTeX compiled to PDF in real-time.
  6. Automatic LaTeX source code generation and downloading.

Add-On Link: Docx2Latex Google Docs Add-on

Watch Demo: Short Demo

6
  • Looks like a nice product, but it has problems with the sizing: despite the document being 12pt, the equation is rendered on the whole width of the page with enormous fonts (as big as needed to fill the width of the page)
    – WoJ
    Sep 19, 2019 at 19:15
  • This thread can help you forum.docx2latex.com/t/the-pdf-file-is-not-being-generated/102/…
    – Docx2LaTeX
    Sep 21, 2019 at 11:23
  • The url no longer works.
    – Adam_G
    May 25, 2021 at 16:37
  • @Adam_G It does work for us. Can you try again?
    – Docx2LaTeX
    May 26, 2021 at 17:34
  • I'm referring to the link in the answer for Add-on Link. It still doesn't work.
    – Adam_G
    May 26, 2021 at 22:49
4

I love Weavr, and use it extensively. However, in Ubuntu 14.04, if you have fully working texlive installation, you can also "roll your own" so to speak by using a script. Mine, which I called "glatex.sh", looks like this:

#!/bin/bash

wget -O $2.tex "https://docs.google.com/document/export?format=txt&id=$1"; 
bom-remove.sh $2.tex; 
latexmk -pdf -f -interaction=nonstopmode $2.tex;
xdg-open $2.pdf

The bom-romove script is set out in this post bom_remover It is necessary because gdocs downloads with a "bom" included, which LaTeX will choke on.

Make both bom-remove script and glatex script executable (chmod +), and then either put them both in /usr/local/bin or put an alias to each there.

To use: a) Make a google doc, share it as a link and copy the link id b)on the command line, type your script's name, the link id, and a name for your local file, then Enter

This will then download the google doc, name it and compile it as tex file, produce a like named pdf file and then pop up evince with the pdf loaded. To refresh when the google doc is changed run the script again.

Credit for the idea goes to Using GoogleDocs as Team editor for Latex-files

For those who might want to use a "beeline reader" effect, I adapted @phg's solution which is in LuaLaTeX. To do this I made 4 bash script files, two for black/red/blue beeline, and 2 for just black.

The reason for the black script files is that the header cannot be in the LuaLaTeX file containing the text, your header has to be set out in a separate document that calls "beegradients.tex" which I wrote into the bash script files texscript.sh (black) and color-texscript.sh (red/black/blue). These have to be used with glatex-beeline.sh and color-glatex-beeline.sh in order to work. If I didn't make a black color version of the files, I would have to cut and paste the header from color-texscript.sh to my document in order to allow it to compile. It seemed easier to just make a "beelines" version in black instead.

Please note that for some reason I had to make links to beegradients.lua and beegradients.tex and those links had to be present in my compilation directory.

To create "beelines" pdf's make sure all the *.sh files are in a system wide directory, (eg, /usr/local/bin), fire up your terminal type

 color-glatex-beeline.sh <google doc id> <any-filename-you-want> (for red/black/blue text) 

and it will produce a *.tex and a *.pdf and then pop up the pdf in evince pdf viewer.

For the black version of the same document do the same thing using glatex-beeline.sh

I have only tested this on Linux.

The scripts are set up expecting a file named "abbrev.tex" containing "abbrevs" package abbreviations. The

\let\maybe@space@\xspace

corrects for a bug that mis-spaces commas after abbreviations. LuaLaTeX complains about this, but I don't know what to do about that.

1
  • 1
    If you use xdg-open rather than evince then it will use the default PDF viewer, whatever that happens to be.
    – cfr
    Jan 4, 2016 at 20:38
4

As of Oct 2019, Google's new equation editor (Insert -> Equation) supports rudimentary LaTeX commands, for e.g., _ (underscore) will get you to subscript mode, \sum gets converted to summation sign etc. This was good enough for me.

2
  • 1
    There's a Google doc with a list of lots of the commands that are available. You can access it via: mobile.twitter.com/ohsmaths/status/1117564238220939264 (I'm linking to the tweet where it was announced because then if anyone has suggestions for improvements, they can reply to the author) Oct 14, 2019 at 6:09
  • @AndrewStacey What is the original URL please (not twitter)?
    – jtlz2
    Dec 1, 2020 at 17:03
1

The g(math) plug-in works really well for me.

It has a simple interface where you can enter some LaTeX code and then insert it as an image into your Google Doc. This with suggestive formatting makes adding LaTeX to your Google Doc a breeze.

2
  • 1
    Could you elaborate a little more on this, since (external) link-only answers are not all that helpful. Include some screen shots of your own work and explain how one can set things up to work on your machine.
    – Werner
    Mar 22, 2017 at 22:15
  • @Werner hope that helps a little. It's just a plug in. So you just add it, give it the permissions it asks for and you're done. Mar 24, 2017 at 7:09
0

There is an Android app called 'math2slides' which converts LaTeX code to Google Slides shapes, so you can insert and manipulate equations (resizing, changing colors, splitting, etc) in your presentation without losing quality. Once it is in Google Slides, can be easily copied and pasted into a new drawing in Google Docs. The advantage of pasting a drawing (shapes) with respect to simply pasting an image is that you don't lose quality when resizing, and you can also edit the equation (changing the color of some symbols, etc).

0

Late to the party here, but I don't see these in the existing answers. As of February 2023, there are at least two browser extensions that can do this: "Auto-LaTeX Equations" and "Equation Editor++". I like both but I prefer Equation Editor++. I use them with Chrome, and haven't tried with other browsers. I know nothing about the developers, or whether the extensions will be working in 10 years (so I can edit my equations).

-1

I also like the idea to work collaboratively using LaTeX using web resource. I do not think you can do much with GoogleDoc - you need to redo a lot in Google doc to create an article.

However, you can also use HandWiki (https://handwiki.org). It's a wiki, similar to Wikipedia, but you can export your wiki to a Latex documents (including equations, figures, tables and even BibTeX citations)

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .