At the moment I am starting to organize my documents a little bit better. For this reason I want to externalize some of my code into packages. Some of these are rather stable but some have to be updated constantly. For example I come to use very often so called categories (a mathematical concept) all of which have individual names. I like to have abbreviations for them, writing \Top for the category of topological spaces, \Grp for the category of groups and so on. Whenever I need a new name for a category I want to add it to the mycategories package.

To keep the package backwards compatible I should perhaps not just add a new command but also update the date in the line

\ProvidePackage{mycategories}[2018/28/02 Package for the categories I need]

so that it can be loaded as


The question is: How do I save the new version of the package? Do I save it as mycategories2018/28/02.sty? Where do I keep the old versions?

  • 3
    What you are really talking about here is employing a revision control system. There exist such software or else you can do it manually, using a consistent convention. In this case, the current style will always be named mycategories.sty, but one home-brew approach is to keep duplicates of the name, for example, mycategories2018/28/02.sty, etc., for each particular revision. An alternative would be to create a different unique but identifiable subdirectory for each version. – Steven B. Segletes Feb 28 '18 at 12:58
  • 6
    note that \usepackage{mycategories}[2018/28/02] does not change the package code that is loaded, it just generates an error if the package that is found is older than that. If you change the package it is good practice to update the ProvidePackage date in any case. – David Carlisle Feb 28 '18 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.