Mathematica Stack Exchange is a question and answer site for users of Mathematica. 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'd like to create proper documentation for a package of mine, and Workbench in principle provides the tools to do this. However, I've split my package into multiple sub-packages (because I found it easier to maintain the code that way), structured as follows:


The documentation tools in Workbench are set up in such a way that, out of the box, they only work with one top-layered package. For instance, the Create symbol pages button from the Documentation tab in the PacletInfo.m editor only looks for symbols within the context \$ApplicationName (which you can set in the Overview tab of the PlacletInfo.m editor), and it's not possible for $ApplicationName to have quotes (`).

So my question is: does anyone have a workaround for this? I could merge all my subPackages into myPackage, but unfortunately it won't be possible to remove the top-layer mainPackage.

share|improve this question
up vote 7 down vote accepted

After some tinkering, I found an acceptable solution.

The first step is to simply structure the application project in Workbench such that the top package mainPackage is not there, and merge all the sub-packages into myPackage. After building the package and documentation, which then more or less works out of the box, I can then place the package inside the mainPackage directory, such that the final directory structure will be


However, the problem now is that Mathematica can't find the documentation, because the myPackage directory is not directly in $(User)BaseDirectory but in the subdirectory mainPackage. Thus we need to tell Mathematica to look for subpackages in the directory mainPackage. One way to do this is to include the following in the code of myPackage:

    FileNameJoin[{$UserBaseDirectory, "Applications", "mainPackage"}]

This is sufficient for the documentation to show up in the Documentation Center.

share|improve this answer

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.