I looked into using LaTeX in an online service once but my understanding was that LaTeX is difficult to serve as a service because there are several commands which allow arbitrary code execution. Is this whitelisting some of the syntax? How are they doing that?
It's always possible to sandbox the processes. In that sense, it's not very different from the various http://try.$PROGRAMMINGLANGUAGE.org. For most of the sandboxing techniques, the performance can be however problematic.
What's peculiar about latex is that its compilation model is ridiculously inefficient. There's no separate compilation, so you have to re-run the whole compilation at the tiniest change. Also, there's a lot of I/O involved, and a several passes are needed. For example, to display the table of contents, it is necessary to append to a temporary file a list of commands (emitted by \section{} etc) which will be interpreted, in a following pass (it is necessary to manually re-run the compiler) by \tableofcontents.
Has anyone ever tried to refactor and sort Latex out? As such a widely used and important app, it really surprises me that there would be so many problems left in the code base. It is open source after all.
> [...] since Knuth highly values the reproducibility of the output of all versions of TeX, any changed version must not be called TEX, TeX, or anything confusingly similar.
I have heard that to be the reason that some don't want to "fix" TeX/LaTeX.
I don't think that there is any particular problem in the code base. Its design, however, has been made with 1970s constraints in mind.
A lot of people have thought about rewriting (parts) of TeX, but the amount of legacy is so high and you have to keep compatibility with lots of existing user code.
So you don't think there is a problem in the code base, but you say: " legacy code is so high and you have to keep compatibility with lots of existing user code". That's a contradiction.
I mean that the code works perfectly in the sense that the behaviour conforms to the specification, but it is hard to modify it. So, there's a problem with the code base, just one that is not visible if you don't want to extend the program (one can argue that it's the worst kind of problem).
I have tried all extensively (except ConTeXt), what I can tell you is that I now use LuaLateX, because it's the natural successor to the other implementations, which have all a really hard time with unicode, ie. with "→" and many other unicode characters. I know about different hacks like embedding a pdf document with the required symbols etc. but that's just reflecting how ignorant the LaTeX architecture is. The algorithms built-in may be clever, but the actual code-base and annual release-cycle is archaic and unmaintainable. The cross-dependencies are so deep, that updating one small package could break anything anytime. Spaghetti-Code Deluxe. Guess why no distribution ships "tlmgr" - the TeX package-manager.
I'm thankful for anything that helps to free us from the *TeX compilers. It's surely hyped too much. Do you believe me when I say that just because you wrote a document with LaTeX, it isn't auto-magically typographically perfect? Look for PDF Documents compiled with LaTeX, many of them have really ugly Typography, because people love to customize things to their own likings and many LaTeX templates even force ugly Typography on their users.
> What's peculiar about latex is that its compilation model is ridiculously inefficient. There's no separate compilation, so you have to re-run the whole compilation at the tiniest change.
Is there a scope for LaTex to have "delta compilation"? This is particularly required if you make presentations using LaTex (Beamer). The whole recompilation process is pretty painful once the number of slides (which includes transitions) go past ~20. Currently, there are some "workarounds" for it, but it would be nice if such a feature exists.
I use https://www.writelatex.com/ where I have a 17 pages (pdf) of math exercices, and I don't know how they deal with it, but apparently they manage to make incremental "recompilation process", because when I make an online modification on the Latex code, the modification appears almost anstantaneously on the preview pdf aside the code !
I'm astonished by that time number. I have a 400 page book, with a 150 page answers to exercises that is emmitted as part of the book compilation and then compiled on its own. I use a simple shell script that compiles each twice (for the cross-referencing). It takes perhaps 10 secs on my five year old middle of the road laptop. Are you remaking complex drawings each time? What is the performance sink, I wonder?
Sorry, it seems like there was a misunderstanding. It takes this on writelatex.com, not my local machine. There it's a normal 7-8 seconds. Just text and about 50 png/jpg images.
I have tried a similar work around but it turns a bit messy if you are in the paper publication business (which I am). Camera ready copies (final publication) sucks the remaining "work around motivation" out of you.
I am not sure if they are doing an "incremental" process. From what I understand, they have a real time preview which compiles the document in the background.
The only concern is to disable \write18 which is the TeX primitive command for access to the OS. This is easily disabled in a make up file or by recompiling the .exe pdflatex or similar. Really this is not a concern. The major issue with online editors is slow compilation.
> This is easily disabled in a make up file or by recompiling the .exe pdflatex or similar.
The executable just takes a command line flag. On a Linux system, man tex will give you information; see the shell-escape option (TeX Live and MacTeX disable it by default, I don't know what MiKTeX does).
Have you looked at Fidus Writer? It's an open source collaborative WYSIWYG LaTeX editor. With the documents that I used to test it, I didn't notice any slowdowns.
ScribTeX helped me a lot a few years back when I had a conference paper due in a couple of days and only an old PowerPC machine at my disposal at home that had trouble running MacTeX (for reasons I had no time to fix). I ended up writing most of it in the browser. Then the killer feature of ScribTeX for me was that it didn't require registration; you could use it from anywhere right away if you had your TeX files with you on a flash drive. It wasn't that registering or logging in was hard, mind you, but not having to do it completely bypassed the mental barrier of entering your password in a potentially unsafe environment like a malware-infested university computer lab. Later you would be at a safer computer (e.g., your own), log in to ScribTeX and upload your document to it as an off-site backup.
People in this thread might also be interested in the following. GmailTeX allows you to see LaTeX in your Gmail and GChat. Works in real-time, but browser plug-in required.
My experience is that LaTex is too hard/strange for most people (even electrical engineers, so its not about IQ...), and there isn't a better alternative to MS Word for writing big product manuals.
(Also, while having some experience with the system, I do notice that I have a hard time achieving flow while writing LaTex. There are hundreds of WTFs).
I've started doing my academic writing in MultiMarkdown (MMD) using Scrivener. It generates LaTex (or PDFs via LaTex) and for me is even easier than Lyx. When needed, you just embed raw LaTex in the doc as <!--xxx-> comments or just do the final polishing in your usual LaTex editor.
I almost forced the team to choose Markdown, and then had to change my advice and say "Let's go with LaTex" because there are so many features MS Word users want to use... I don't remember exactly the one that prompted the switch - maybe footnotes, tables or referencing.
Have a look at ConTeX (www.contextgarden.net). It is a TeX macro package, just like LaTeX. But it is a MUCH more consistent syntax, heavily relies on LuaTeX, and can generate XML output (for webpage and epub) as well.
Seriously, you will regret not using TexStudio, I guided a friend who installed it on Windows (works on Mac,Linux too) and damnit, it can transform drawings of formulas or anything to LaTeX-Code. That's awesome!
I'm surely getting old, but I believe online editing of text documents is insane. I would forget about writing anything slightly more important than a pie recipe with this.
Why insane? I mean, you're welcome to your opinion, but you haven't presented any arguments for your position.
I find it incredibly useful. The alternative is normally using Microsoft Word, and emailing each other versions of the document, that need to be merged by hand.
I'm worried about privacy. Even scientific papers need to have reasonable privacy before publication, that you do not have by using somebody else's hosting.
More useful would be using latex and some form of source-control like git or svn hosted by you or your organization.
The odds that you or your organization will do a better job of Dev Ops than Google are effectively zero. You'll leave some port open that you shouldn't, have an easily guessed password on a router, forget to update a kernel, you won't set up two-factor authentication...
I'm not sure about "insane".
Over the years I personally moved from a dedicated TeX workstation towards using a Wheezy stable qemu virtual machine with TeX Live and Texmaker.
From there, a server-side online compiler isn't really too far off.
Used sharelatex for my third year project report at university. ~60 pages rendered quickly and flawlessly. Such a great experience using it compared to various desktop software and command line
Going the other way, if you want to enter the LaTeX variant called MathJax locally (PC and Mac), which is used on math.stackexchange.com (among other other places), try http://www.inkcode.net/qute. I find this very handy for short to moderate length math.
In my weirdness, I like to use qute in split-screen mode, and work out the math as I enter it, never writing anything down. I then make corrections, modify things, move lines around, all in qute. I have developed some techniques for having correct MathJax syntax at almost all times, which I find necessary since qute does not show the result of an incorrect expression.
I find qute very useful for formatting math. Since it is all offline, no connection is needed. After the formatting is correct, I can then push it to the clipboard and paste it into whatever I want (usually math.stackexchange.com).
I recommend qute highly. Again, it is for Windows and Mac OS, not Linux (unfortunately).
@mjcohen weird, I use qute on Linux (Gentoo), there's even an ebuild for it. However it's not hard to built it yourself on linux, actually dead easy. I also use pandoc writing Markdown and compiling to latex → pdf
There's something vaguely "scammy" to be about the university logos being featured so prominently on the front page. My first thought was that it was being developed by a consortium of schools, but apparently it is considered good enough if one or more students at the institution use the product...
co-founder here. We do require that the university is paying for a licence before we show their logo. Also most of the time we get asked to add their logos there.
I used Scribtex (a previous product developed by at least some of the people behind sharelatex) for 2 years during university with a lot of success. Compared to setting up a latex environment on every PC I used it was a dream. I found the developer quick to respond to bug reports and issues. Recommended!
It looks like a purely javascript* solution that only renders math-mode anyway, so it would be extremely surprising if there was even the possibility to enable them.
*With the possibility of "shelling out" to 2 external services.
(btw, if it turns out they aren't please don't comment here about it but instead report it to them at https://www.sharelatex.com/security )