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

The scenario is that I'm writing a book and it looks like I'm going to need to do some munging as the document class Memoir has some wonderful features but Octavio has the presentation.

Now, one of the things that really bugs me with LaTeX is that they use a global namespace, which means they interact with each other in unpredictable ways. I can't predict easily what a hack-and-splice job will do. As for finding and fixing problems... well..

LaTeX 2e has dozens of variants these days and there are an endless number of preprocessors to support them. If just one supports namespaces then I can munge with safety. I don't know of any, but that doesn't mean they're not there. Anyone know of anything that might help?

share|improve this question
I'm not sure what you mean by 'variants' or 'preprocessors' here. There is only one LaTeX2e format, and in any case the flat namespace is a consequence of TeX, not LaTeX. – Joseph Wright Nov 23 '11 at 10:43
AFAIK exTeX supports namespaces. But I've never used it. AFAIK it's a TeX engine written in Java. – Schweinebacke Nov 23 '11 at 11:09
I don't really get the idea what you want to achieve. But wouldn't it be enough to prefix your macros with a something like MyPackage:Index:DirtyHack? – Marco Nov 23 '11 at 11:15
@Schweinebacke: exTeX is the project of writing a TeX engine in Java. I doubt that anything usable exists today. – Martin Schröder Nov 23 '11 at 17:58
@Martin: But the development state shows a system, that is already able to make DVI, PS and SVG and maybe PDF. Neverless you are right, that it is not TeX-complete, because some primitives like \outer are currently not implemented. – Schweinebacke Nov 24 '11 at 7:29

The answer is no. Apart from the experimental ExTeX program, none of the engines support namespaces on the TeX side (LuaTeX supports them on the Lua side, but this is not what you're looking for).

Many packages have been written without the need of namespaces and the system is pretty stable; in some occasions a clash can show up, but usually this happens with badly written packages (I found one where the author uses \value as an internal command: ouch!).

Of course, packages that try to redefine the same structure in different ways will be incompatible with each other, but namespaces would not solve such an issue.

Just stick to a consistent naming scheme: prefix all of your personal macros with jonathan@ (or whatever you prefer). The chance that a package uses the same prefix is small; in such a case just change your prefix in your macros.

share|improve this answer
One of the LaTeX3 things I want to sort out is a proper database for package prefixes, both within LaTeX3 and somewhere on the internet. – Joseph Wright Dec 4 '11 at 17:42
@JosephWright This is commendable. – egreg Dec 4 '11 at 18:38

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.