Message Boards Message Boards


Create and deploy your own paclets in the Workbench

Posted 5 years ago
10 Replies
12 Total Likes


enter image description here

Eclipse work flow

If necessary, install the Wolfram WorkBench Plugin for Eclipse.

In Windows - Preferences - Wolfram - Special make the following changes

enter image description here

Apply and press OK. Then re-open preferences and go to Paclet Development. Enable function paclet support.

enter image description here

Create a new application project

enter image description here

enter image description here

Open the PacletInfo.m file and useful buttons now appear.

enter image description here

Also edit your project properties or the nice buttons may vanish after a build or when you close the project.

enter image description here


Build your project and documentation as usual and then create your Paclet file and deploy.


You can install from a local file path, http or ftp as print definitions reveals.


There is no current support for https but this can be patched or you can easily call PacletInstall after downloading and creating a new file name for the download. This could be handy if you wanted to install from GitHub.

10 Replies

Thank you for this tutorial.

.paclet files can also be created without using the Workbench. While GUI tools can be convenient, it is often useful to understand what they do exactly. Scripts and configuration files provide a level of reproducibility that GUIs cannot. All the following information is from inspecting GitLink, and I am going to demonstrate it using MaTeX (which I'm using to experiment with these things). This is far from the complete story, but it's sufficient to package up application as a paclet.

Also posted on Mathematica.SE.


.paclet files appear to be simply zip files that can contain a Mathematica package or other extensions to Mathematica, along with some metadata in a PacletInfo.m. The metadata makes it possible to manage installation, uninstallation and update automatically.

How to add the required metadata?

First make sure that your package is following the standard directory structure.

Then create a PacletInfo.m file in the package root with a minimum amount of metadata. Make sure the Name and Version are present. For MaTeX I could start e.g. with this:

    Name -> "MaTeX",
    Version -> "1.6.2",
    MathematicaVersion -> "10.0+",
    Description -> "Create LaTeX-typeset labels within Mathematica.",
    Creator -> "Szabolcs Horvát"

This is sufficient to make it possible to pack and install a paclet. But it is not sufficient for making it loadable with Needs. For that we need to add the "Kernel" extension:

    Name -> "MaTeX",
    Version -> "1.6.2",
    MathematicaVersion -> "10.0+",
    Description -> "Create LaTeX-typeset labels within Mathematica.",
    Creator -> "Szabolcs Horvát",
    Extensions -> 
            {"Kernel", Root -> ".", Context -> "MaTeX`"}

The two critical arguments to the `"Kernel"`` extension are:

  • Context sets the context of the package. Whatever you put here will be recognized by Needs and FindFile, but ideally it should also be compatible with the package name and the standard file name resolution.

  • Root sets the application root. FindFile seems to resolve the context to a path through this, but also following the standard rules.

Of course you can also add the "Documentation" extension to integrate with the Documentation Centre, but that is not required for the functionality I describe here.

How to bundle a package into a .paclet file?

Simple use the PackPaclet function on the application directory. It will use the information from PacletInfo.m. It is a good idea to remove any junk files and hidden files to avoid them from getting packed up.

Warning: Before doing this, make a copy of the application directory. Don't accidentally delete any files used by your version control system.

After making a copy of the package directory, in my case called MaTeX I did this:

Make sure we're in the parent directory of the application directory:

In[2]:= FileNames[]
Out[2]= {".DS_Store", "MaTeX"}

Delete any junk files like `.DS_Store (which macOS likes to create):

In[4]:= DeleteFile /@ FileNames["*.", "MaTeX", Infinity]

Create .paclet file:

In[5]:= PackPaclet["MaTeX"]
Out[5]= "/Users/szhorvat/Desktop/pacletbuild/MaTeX-1.6.2.paclet"

Install it permanently:

In[6]:= PacletInstall[%]
Out[6]= PacletManager`Paclet[
"Name" -> "MaTeX", "Version" -> "1.6.2", 
 "MathematicaVersion" -> "10.0+", 
 "Description" -> "Create LaTeX-typeset labels within Mathematica.", 
 "Creator" -> "Szabolcs Horvát", 
 "Extensions" -> {{"Kernel", "Root" -> ".", "Context" -> "MaTeX`"}}, 
 "Location" -> "/Users/szhorvat/Library/Mathematica/Paclets/Repository/MaTeX-1.6.2"]

Multiple versions may be installed at the same time. Finds all installed versions using:

In[7]:= PacletFind["MaTeX"]
Out[7]= {
 "Name" -> "MaTeX", "Version" -> "1.6.2", 
  "MathematicaVersion" -> "10.0+", 
  "Description" -> "Create LaTeX-typeset labels within Mathematica.", 
  "Creator" -> "Szabolcs Horvát", 
  "Extensions" -> {{"Kernel", "Root" -> ".", "Context" -> "MaTeX`"}}, 
  "Location" -> "/Users/szhorvat/Library/Mathematica/Paclets/Repository/MaTeX-1.6.2"]}

FindFile (and therefore also Needs) will always resolve to the latest version:

In[8]:= FindFile["MaTeX`"]
Out[8]= "/Users/szhorvat/Library/Mathematica/Paclets/Repository/MaTeX-1.6.2/Kernel/init.m"

Uninstall all versions:

In[9]:= PacletUninstall /@ PacletFind["MaTeX"]
Out[9]= {Null}

How to work with paclets during development

During development we don't want to pack the paclet and install it after every change. It is much more convenient to be able to load it directly from the development directory.

I can do this by adding the parent directory of the application directory (i.e. MaTeX in the above example) as a paclet directory. Since I keep the development version of MaTeX in ~/Repos/MaTeX-wb/MaTeX, I can simply use


After this Needs["MaTeX`"] will load the dev version.

I started a community project at StackExchange to document what can go into PacletInfo.m. I see that you are also interested in the same topic. All contributions will be most welcome! Please feel free to edit the community wiki answer there.


@Emerson Willard Thanks for this tutorial. I followed your steps, and the documentation installs properly... but MMA isn't finding my package:

enter image description here

I'd rather not have to do this manually:

enter image description here

So is there some missing step?

Here's what the project looks like (it's just the template application project) setup:

enter image description here

You'd need to show your PacletInfo.m file for people to be able to comment.

@Szabolcs Horvát Thanks, just updated it.

Make sure your Kernel extension look like this:

{"Kernel", Root -> ".", Context -> "pacman`"}

I added that and updated my screenshot (above), and clicked "create paclet"... @Szabolcs Horvát

enter image description here

but still same behavior (can't find it) when I load:

enter image description here

The documentation does work though, although a restart of Mathematica is necessary.

I'm not sure why, but I can see that you changed several things compared to what I described on StackExchange. Why don't you try to follow the instructions there exactly for now, and without using the Workbench for the moment, and try a minimal package?

I don't know what kind of package structure the Workbench created for you. There's a link in that post to the standard package structure.

@Szabolcs Horvát Thanks for your response, I got it working by studying your Matex package and duplicating the structure there.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract