Adding .cls to portable MiKTeX

You should never manipulate the standard texmf tree of portable MiKTeX. Create and use instead a local TeXMF tree.

Let drive f: be the drive with your portable MiKTeX. Now create a new directory like f:\local-texmf. Now you can create inside it new folders depending on what you want to use. Let's say you want to use a class miracle. Then create the folder f:\local-texmf\tex\latex\miracle and include there the sty or cls file.

Now open the settings of portable MiKTeX and add your local-texmf tree with a right-click in the taskbar on the MiKTeX symbol, choose "MiKTeX-Options", click on "Roots" and add there your local-texfm tree. Don't forget to update your FNDB ... .


I kept getting an error stating a non-TDS compliant root when trying to add my local texmf tree. These are the steps that I had to work through to get it working:

  1. Create the root directory: Say f: is the drive with portable MiKTeX. Create f:\Local TeX Files

  2. Create the subdirectory: f:\Local Tex Files\tex\latex\misc and copy your *.sty and *.cls files here.

  3. Register the root directory: Go to MiKTeX options, click on Roots, and add the root directory containing the subdirectory.

  4. Update FNDB: Go to MiKTeX options and click Refresh FNDB.

This should have you up and running.