# Simultaneous collaborative editing of a LaTeX file

Are there any tools for simultaneous collaborative editing of a .tex file?

The practices I know (and practice) in writing scientific papers are:

• e-mailing each new version to the collaborators,
• working in a same Dropbox folder.

However, both are not meant for simultaneous editing, and are somewhat annoying.

EDIT:

A list is also here:
http://en.wikibooks.org/wiki/LaTeX/Collaborative_Writing_of_LaTeX_Documents

-
You could use version control to track changes. –  N.N. Sep 5 '11 at 13:59
Welcome to TeX.sx! I was going to suggest this as a duplicate of tex.stackexchange.com/q/4489 or tex.stackexchange.com/q/232. Then I noticed that you're asking about simultaneous editing, which brings up an aspect that hasn't been discussed before. I edited your question a bit to get this part to stand out more. –  doncherry Sep 5 '11 at 14:02
@N.N. (The tag would've been revision-control [tag:revision-control]) –  doncherry Sep 5 '11 at 14:04
Probably the Google Docs based solution here Compiling documents online is the best you can get. –  Alan Munn Sep 5 '11 at 14:11
–  Faheem Mitha Sep 5 '11 at 17:14

I tend to use a version control system. My current setup is a (private) repository at Bitbucket, which uses Mercurial for version control. Access to the repository is then provided to other members of the team. This is as close as you can get to simultaneous editing, IMO.

It helps to divide the project into several separate files using e.g. \input or the subfiles package, as this minimizes the number of merge conflicts one encounters.

For actual simultaneous editing, you should use an editor created for this purpose, such as SubEthaEdit.

-

## writeLaTeX - writelatex.com

Features:

• no need to register
• collaboration possible, by means of sharing the URL
• documents can be saved, actually everything is saved automatically
• instant compilation on-the-fly
• possibility to upload files (pdf, png, sty, tex, bib, etc.) up to 10 MiB
• syntax highlighting in the included editor

Screenshot:

-
There is a new option that allows to send a watchonly link maybe this could be added to the answer –  Dominic Michaelis Sep 17 '13 at 20:31
The downside of this is method is the lack of a revision history. –  Gabriel Nov 15 '13 at 21:12

I don't have much experience with these, but they look like they might do the trick:

Gobby collaborative editor (has built-in chat features)

Or maybe:

-
I had a look at Gobby and thought it looked good. I haven't had the opportunity to try it out, though, but if I ever had to do this then Gobby would be the first I'd try. I believe that it has LaTeX syntax highlighting as well. –  Loop Space Sep 5 '11 at 16:30

I would suggest https://www.sharelatex.com/.

The part which you would find interesting part is below:

[...ShareLaTeX..]

A LaTeX Editor for smooth collaboration

Keep your LaTeX collaborators up to date by letting everyone access and edit the same LaTeX document.

The days of making sure everyone has access to the latest version are over; the latest version is always available online. You can even work on the document at the same time as your collaborators with our real-time editor, and our built in chat will help you communicate while you're editing.

-

Sagemath Cloud allows you to do all kind of stuff -- one of them is to have a two pane view of the source and a rendered view of the latex document. All edits can be done collaboratively in real-time; it uses the differential sync algorithm.

Bonus on top of similar solutions: You have a Linux environment, which allows you to not only store and process files, but also to write your own scripts to generate content and whatnot ...

It also have inverse and forward search, scales well to large documents (100+ pages), and takes frequent snapshots of all files.

-
Welcome to TeX.SX! –  Heiko Oberdiek Nov 4 '13 at 20:57
@Harald Schilly is that a book that you are writing ? seems interesting !!! –  Arkapravo Feb 18 at 5:22

I'd say Authorea (full disclosure, I am a co-founder). Authorea is an online social word processor for the collaborative writing of research articles. It solves the problem that many scholars have when they tell their co-authors: "please do not touch the article, I am working on it". In Authorea, articles are modular (e.g. one module = one section). Only one article collaborator can check out and work on a module at any time, so that the entire article stays open for editing but individual elements are checked out and then checked back in with edits.

More information: Authorea's versioning control system is entirely based on Git (every article is a Git repository). But Git functions in the backend, so that users who are not familiar with (or do not care about) Git can just use it as an editor and still have all changes logged as commits. In other words, Authorea allows power users (who know Git) to easily write papers in collaboration with regular users (who don't know Git). Authorea's frontend allows you to enter text in LaTeX or Markdown, as well as figures, and equations (in LaTeX or MathML). Authorea renders and compiles everything to the web (HTML5), in addition to PDF (export to numerous journal formats is provided).

-
Nice to have co-founder in this thread. :) Anyway, this Git integration does not work - I set it but in "settings" it still asks me to set it up, and the only way to enter push/pull is to type link by hand. –  Piotr Migdal Mar 30 at 15:52
Hi Piotr, mmm Github integration should work just fine. We have a lot of users using it successfully. If you click on settings it will ask you first to indicate your Github repo (and you will need the deploy key from Github) and then set up a webhook. It should take a few minutes at the most. If you have other problems, please contact us at hi@authorea.com –  Alberto Pepe Mar 31 at 16:29
The issue is here: authorea.com/issues/143 (I am not sure whether it is intended behaviour or not). –  Piotr Migdal Mar 31 at 17:14

Collaborative editing has been implemented in various text editors. I believe I've seen it done with gedit, vim and emacs, but for a large LaTeX document, your best bet is probably to put everything in some kind of version control and split it into multiple files with a single master document that does \input or \include on the individual files.

-
floobits.com are a promising service with interoperating plugins for several editors (Vim, Sublime, upcoming emacs) AND web editor AND simply sync with a directory. –  Beni Cherniavsky-Paskin May 26 '13 at 9:03

You could all ssh to the same server and use screen or tmux in order for simultaneous access to the entire development environment, allowing you to switch among editors, control versions and run scripts to edit files.

This is different from the other answers (at the time of this writing) because it provides simultaneous access to the whole environment, whereas the other options are just editors (like Gobby) or distributed version control systems (like Mercurial).

If you do this, you'll want some way of viewing the output. One option is just using scp, since you'd be using ssh anyway. If the server is running a web server, you could also just move the files there. When I'm working like this, I tend to run this line a lot.

\$ pdflatex foo; bibtex foo; pdflatex foo; pdflatex foo; sudo cp foo.pdf /var/www

-
cloud.sagemath.com now provides full shell access combined with a LaTeX editor, which is a powerful combination. –  William Stein Nov 7 '13 at 19:12

Another browser based solution can be found at Online LaTeX Editor which also provides a native Android application called VerbTeX. Both support collaboration and code merging in case of conflicts while working simultaneously on the same document.

-

For real simultaneous work, you might consider any of the etherpad clones (e.g. titanpad). It even has history replay so you can go back and see what you had before. You can even have your own installation. The downside is that it can only do text, and to see the TeX output you would have to compile it somewhere else.

I would definitely recommend some sort of version control. (Even if you were the only author.)

-

ShareLaTeX is what you are looking for.

-

If you have any concern about confidentiality, you may try to host an installation of https://github.com/geier/ethertex yourself (suggested by FSMaxB in his question Selfhosted collaborative webbased LaTeX editor).

-