We use LaTeX for our all of our documentation, which includes multiple product lines with multiple manuals. These manuals are built right along with our installers using our automated build server.

We have developed a pretty sophisticated LaTeX "core", which is a TDS tree of various packages (some home built), classes, fonts, boilerplate text, etc. It is used in all of our documents and is often improved and revised in various ways, some of which are not compatible with "the old way that we did it." (although I try to behave as much as I can. :)

As we go along, new products (or new versions of products) use the newest core, while older builds should use the older one. To do this, we've made our core a submodule of all of the GIT repositories. It is branched and revised, just as the products that we make are revised.

The issue:

I need a way to dynamically add a TDS tree, just before compiling the manual. That is, on any given developer's computer (which might be Mac or PC), they might have multiple branches/versions of projects open, each with (perhaps) a different core. When they hit "compile" in WinEDT or TextMate, I want the system to get the core for that project, automatically.

Ideally, I'd like to be able to say something like:

lualatex --tdstree "../core" mymainfile.tex

Which I understand is completely made up. :) Failing that, is there some sort of relatively cross platform way to do the same? My issue is:

  • A relative path to the current project is very tricky because no developer puts their local source files in the same spot and "home" is not the same on PC and Mac. I don't think it's really possible to say "relative to the file that is being processed, the TEXMFHOME directory is one back and called core."
  • I can never seem to figure out what each platform needs once the TDS tree is set. I think I can figure this out, but it might just be sudo texhash and luatools --generate. The problem with that is I do not want to have them have to remember this for each time they switch and it would take too long if I ran each command before every compile (not to mention the password issue). I believe that I can skip the texhash command by using "//" at the end of the TDS entry, but I don't believe that I can skip luatools --generate. At least luatools doesn't seem to require sudo on the Mac.

Has anyone else found a way to easily add a TDS tree as part of a compile command? I'm probably missing something very simple. :P

1 Answer 1


I suppose you are using TeXlive on both platforms.

Adding a TDS tree dynamically either means fiddling with the environment or using a patched texmf.cnf (which can be in the current working dir). Patching the texmf.cnf on the fly is probably more portable.

  • We are using a mix, but are going to go to TeX Live. MikTeX is actually pretty terrible for this application, given that their method for changing TDS trees is only really available through their GUI. The use of TEXINPUTS kind of helps (command line option) but not really. What do you do about fonts? With TeX Live, I can set the TEXMFHOME search path (not used in MikTeX) and it all works fine. Your close enough for the gold star. :) May 27, 2011 at 5:03

You must log in to answer this question.

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