Recently I've come across a question that asks about "TeX daemon" for Windows.
I always thought that nature of TeX is compilation of document sources. Why would anyone use a daemon for that?
So, what is a "TeX daemon", and why is it used?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityRecently I've come across a question that asks about "TeX daemon" for Windows.
I always thought that nature of TeX is compilation of document sources. Why would anyone use a daemon for that?
So, what is a "TeX daemon", and why is it used?
It can have all kind of uses.
One of the answers to the question you refer to shows an example: for one particular document, you can precompile the preamble and have the daemon run in the background, waiting for the document body to be modified, thus accelerating the usual edit-compile-preview cycle.
A variant of this is the ability to preview the result of your TeX source as you type it, such as is provided by the preview-latex
package for Emacs; but I don't think it uses a daemon.
Another example is given by this other answer to the same question: you use TeX as a web service. Of course you could run a new instance of TeX for each request and send the result back to the user, but a daemon is much more appropriate for that. It's not different in nature from a hypertext preprocessor.
The ConTeXt distribution contains a script that is a variant of the latter example: it uses LuaTeX to typeset font samples and to show the effect of the different OpenType features for each font you have installed. In fact, the script runs the web server itself, as it is written in Lua, while the actual typesetting of the font samples is of course done in TeX. Now, there is no actual daemon here (apart from the web server), we need a new process for each new sample, but this is exactly the kind of use a TeX daemon could have.
I can't think of other uses right now, but I'm sure there are.
There's also the "original" TeX-Daemon: It uses a program dvichop
to create a new dvi document every time the document is recompiled, which can then be displayed. That approach works only with dvi, though.