Today, a cooperation between LaTeX-community.org and writeLaTeX.com has been announced in TeXblog. According to it:

By a single click on a link above a code box, the reader will land in the editor which shows the code on the left side, and the output preview on the right side. Compilation is done in realtime.

I think it could be a also applied to TeX.SX. What do you think?

(I'm not sure if this is the right place to suggest or ask this question. If not, please let me know.)

  • Note that this does not add a preview/demo to the questions: you have to be editing the demo on the writeLaTeX site to see the compiled version. – Joseph Wright Jan 10 '13 at 15:20
  • 3
    @JosephWright: Yes I know it. But then we could easily test and answer questions from machines which doesn't have LaTeX installed. Now I can do it if I remember the web page of an online LaTeX compiler, which I never do because I almost don't use them. With this option I don't have to remember nothing and just click over the link. – Ignasi Jan 10 '13 at 15:55
  • 1
    Online LaTeX compilers should activate -shell-escape by default to be more useful. – kiss my armpit Jan 10 '13 at 18:04
  • 4
    @AdorableCreature: -shell-escape is a security nightmare. A better option is to whitelist specific programs using texmf.cnf. – Aditya Jan 10 '13 at 23:10
  • 3
    This feature will be an added advantage so that we don't need to remember a web address and no need of local tex distribution. – user11232 Jan 11 '13 at 0:45

I think we could get a useful addition, requiring only few work and without a security risk to our site, which is always to consider for online compilers.

What we would get:

  • One-click preview
  • Fast testing and solving problems without a local TeX installation
  • Actually working with site's TeX code on mobile devices, such as tablets and phones
  • Additionally, if a link is shared such as in a comment, we can collaboratively work on a solution, etherpad-ish, such as with community wiki posts,
  • A managed service for an up-to-date TeX installation, we don't need to maintain it

What we need to do:

  • Add a JavaScript function (extracting and unformatting the code)
  • Add an invisible form for making a POST request
  • Add a link with "onclick" to call the function

The writeLaTeX team would help with customizing. They prepared a demo page, and when I had contact they were always helpful and suggesting implementation details, so I think this whole part is pretty easy.

Considering risks:

  • The compiler runs externally, so no risk for TeX Stack Exchange to get hacked by harmful code.
  • If writeLaTeX would not fit any more to the site, such a link could easily be removed and it we don't loose much invested work.
  • 3
    Thanks for the positive comments Stefan, I just wanted to add a note (from the team at writeLaTeX) to say we'd be happy to work on integrating this option into TeX.SE - as you say, we can help with customizing so that the link works as preferred by the community. – John Hammersley Jan 12 '13 at 9:55
  • @JohnHammersley: Hi. That will be very nice of you. – user11232 Jan 13 '13 at 1:20
  • 1
    @HarishKumar - not a problem, the first thing I always do with questions on TeX.SX is open them up in writeLaTeX, so it would make life easier! If it would be useful, we could set up an initial trial / test of this with the moderators' support? – John Hammersley Jan 15 '13 at 22:07
  • 1
    @JohnHammersley I think this is beyond the powers of our site moderators, we’d probably need a Stack Exchange developer to get involved. – doncherry Jan 17 '13 at 6:11
  • @doncherry Then I feel that we should lobby with them. – user11232 Jan 19 '13 at 13:21
  • 2
    Perhaps show your consent by upvoting, so SE can see that it's really desired. – Stefan Kottwitz Jan 19 '13 at 17:36
  • There's another precedent for this announced today - CircuitLab is now integrated into the Electronics SX site. Can we use this as a model for integrating an online LaTeX compiler such as writeLaTeX into TeX SX? – John Hammersley Mar 6 '13 at 23:43

co-founder of http://SpanDeX.io here, an online LaTeX platform. We have a similar integration with http://LaTeXTemplates.com (Here's an example of our setup there). If there's interest in this kind of integration with TeX.SE, we'd be more than happy to offer our platform up. We have shell escape enabled within secure LaTeX sandboxes, so all TeX live packages are supported.

  • That would be nice. Thank you for extending support. – user11232 Jan 19 '13 at 13:21

I'm a little late to the conversation here, sorry, but I think it's worth pointing out the Common LaTeX Service Interface (CLSI). This is an open source API that I developed with Bobby Soares and it powers the online editors ScribTeX, ShareLaTeX and LaTeXLab (in a slightly different implementation). I've been pushing for a wider adoption of this at every opportunity since I think the benefits of an open standard are significant.

The idea is that anyone can access a LaTeX compiler online without worrying about setting it up and maintaining it themselves. On the other side, anyone is free to host the CLSI themselves and provide access to a LaTeX compiler. My implementation serves as a default standard at the moment, but I'd like to see the standard grow and mature with input from the rest of the community, and hopefully for other implementations to pop up. As more and more services are making use of LaTeX online, it would be nice not to end up with a fractured set of half solutions.

I haven't done so yet, but it would be reasonably straightforward to code up a Javascript API that talked to the CLSI directly, and could return a PDF to be displayed on TeX.SX. I see the main advantage of this approach being that TeX.SX wouldn't be bound to any specific provider since the CLSI could be hosted anywhere by anyone, and swapped out at anytime with another host.

I'm part of ShareLaTeX at the moment, and we could provide access to our CLSI farm if needed.


There are already many online LaTeX compilers when you need them. Introducing our own one would necessarily introduce its own bugs and errors, which only drive the site away from its real purpose.

  • 3
    I suspect the OP means 'Could we too link to an existing online service?' rather than 'Could we sort out our own on?'. – Joseph Wright Jan 11 '13 at 7:07
  • 1
    Well, then everybody has browser bookmarks. However, giving it a nice community ad might be a good idea. – yo' Jan 11 '13 at 7:44
  • @JosephWright: Yes, what I was suggesting is 'Could we too link to an existing service?'. Why? Harish proposes two good reasons in his comment. – Ignasi Jan 11 '13 at 11:01
  • 3
    Yes, I have bookmarks to several online LaTeX compilers in my computer, but sometimes I read TX.SX from other computers where I don't have neither bookmarks nor any tex distribution installed. – Ignasi Jan 11 '13 at 11:04
  • @tohecz Thanks for the suggestion - I've created a community ad for writeLaTeX which I've just posted here. – John Hammersley Jan 17 '13 at 0:05

You must log in to answer this question.

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