4
$\begingroup$

Recently,I got WebMathematica. Initially I searched WebMathematica documentation in Mathematica documentation, but it doesn't return any results. For this I read tutorials; finally I placed the webMathematicaDocumentation folder in the following link.

FileNameJoin[{$InstallationDirectory, "AddOns", "Applications"}]

After that, I reopen Mathematica and search for webMathematica functions in the Mathematica documentation center. It shows all the results.

Out of all functions, I read HTMLTableForm description, if you want to call this function, first you should evaluate the MSP HTML package. This package corresponds to webMathematica layout.

So I copied all the packages, which are under webMathematica\WEB-INF\Applications and placed them in FileNameJoin[{$UserBaseDirectory, "Applications"}].

Again, I reopen Mathematica, directly searched for HTMLTableForm and evaluated MSP HTML package. It's working fine. But my doubt was, is this a good way for placing all the packages in Application folder. Or is there an efficient way?

$\endgroup$

1 Answer 1

6
$\begingroup$

You probably shouldn't put that package into the $InstallationDirectory, there are $BaseDirectory for system wide installations of packages and $UserBaseDirectory for user specific installations (As Alexey Popkov has indicated these did supersed $AddOnsDirectory and $UserAddOnsDirectory of earlier versions. These still exist for compatibility, but probably should not be used anymore).

But for that very case and if the webmathematica installation is on the same machine you could also consider to add the path to the webmathematica installation to the lists of directories where Mathematica searches for documentation and packages:

For the documentation to be found by the frontend I think that would be in the option inspector, then choose Global Options -> File Locations -> AddOnHelpPath. To let the kernel now where it can find the package you'd need to append the corresponding path to $Path, which you could do in the startup file Kernel/init.m, which again is looked for in $BaseDirectory and $UserBaseDirectory (which usually are the same as the addons directory).

Depending on use case and OS you could also create corresponding symbolic links or tweak the environment variables MATHEMATICA_BASE and/or MATHEMATICA_USERBASE before starting Mathematica to make it find the "MSP`" package wherever it lives.

You can find some general information about the file organization of Mathematica here. That information can of course also be found in the documentation center with this adress "tutorial/MathematicaFileOrganization":

$\endgroup$
4
  • $\begingroup$ +1. Did not know about $AddOnsDirectory. Where is it documented? BTW, since Version 5 $UserAddOnsDirectory has been superseded by $UserBaseDirectory. $\endgroup$ May 28, 2013 at 15:37
  • $\begingroup$ @AlexeyPopkov: very good finding, I did guess that some of these might be only there for legacy code, but didn't know where that was documented. I'll update my answer. As for $AddOnsDirectory, being superseded it seems to not be documented in newer versions anymore. I think this is the relevant link if one is looking for information about path names etc... $\endgroup$ May 28, 2013 at 17:38
  • $\begingroup$ @AlbertRetey can you tell me,where will get inspector option in frontend ? $\endgroup$
    – subbu
    May 28, 2013 at 18:37
  • $\begingroup$ @subbu: the "Option Inspector" entry is in the "Format" Menu, 6th entry. On windows and Linux (?) you also can use Ctrl-Shift-O (I think that's Command-Shift-O on a Mac). If you want to edit the AddOnHelpPath-entry you have to select "Global Preferences" in the first popup menu. $\endgroup$ May 28, 2013 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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