TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on an experiment running LaTeX on server to compile some documents on the fly. Assuming I want to have several workers waiting for documents to be compiled, are there any access issues in running several latex / lualatex processes in parallel? Should I for example duplicate the texmf-var directory for each process to avoid issues when generating ls-R or font files in parallel?

share|improve this question
No, you are free to parallelise as much as you like for regular compiles. Fonts and ls could pose problems. Do you really need to create fonts in parallel? – zeroth Apr 22 '12 at 21:04
@zeroth Your statement seem quite contradictory: can I parallelize as much as I like, or will fonts and ls-R files pose problems? It's not about me "needing" to create fonts in parallel, but my worry is about 2 documents being compiled in parallel and each of the processes calling mktexpk for instance. Has anyone experience trying this? – Xavier Apr 22 '12 at 21:31
I am talking about regular compiles, as in document processing, sorry if that was unclear. About the others I have no real experience, however I wonder why you can't have the fonts and packages already installed? It seems like the server would have much work to do, if it should be computed each time? (I am guessing you are cleaning up afterwards to limit footprint of installation, or something similar?) – zeroth Apr 23 '12 at 6:45
@zeroth FYI, regular compiles call mktexpk whenever a MetaFont or Type1 font is used for the first time; it's part of the standard latex routine for document processing... Your TeX distribution most probably contains a folder called texmf-var where TeX engines store their run-time caches. Conflicts in that folder with several processes running in parallel is what I worry about. – Xavier Apr 24 '12 at 6:15
How much do you know about the documents you're processing? Duplicating texmf-var could also mean duplicating the computational effort spent on generating fonts and such, eating up some of the gain from parallelizing. If you know what fonts etc. will be needed, these should be pre-generated before the parallel processing begins. Furthermore, there will be a "closure" for all stuff which can be auto-generated in a given TeX installation. Maybe you should just generate everything on the system you'd like to parallelize on. – Stephan Lehmke Apr 24 '12 at 20:40

before I send a manuscript of a book to my publisher for printing I create the example files in a last run all new to be sure that everything is ok. I always use paralell LateX processing for this. I work under Linux and can run up to 10 runs parallel 0...9. This saves a lot of time because I have sometimes more than 1000 examples. Every example is created from within LaTeX as an external file. The file extension defines the type of the example, eg .tex, .ltx, pltx, and so on. Depending to the used processor type (number of kernels) a shell script starts all processes.

share|improve this answer
Thanks for the info! I am just worried that in your case, you are reprocessing documents, hence all the fonts should already have been generated. In my case, I want to build a sort of online compiler, and can't presume what will be generated... – Xavier Aug 30 '12 at 4:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.