5

I am the owner of the gurps package and recently I've been thinking of including a new sty file (called gurps-npccard.sty) which isn't full enough to be it's own package but seems too niche to be included in the main dtx/sty by default. The only examples of this I know are TikZ which has \usetikzlibrary or possibly beamer with styles, but nothing 'standard' in LaTeX packaging.

What's the best practice for including more than one sty in a package for CTAN?


(Apologies if this is off-topic, feel free to close if it is)

  • 2
    It's a very individual choice. You may have a look at hyperref as an example for using one big dtx file for multiple packages. – TeXnician Jul 02 '18 at 11:55
  • another example of a .dtx file used to produce multiple .cls and .sty files is amsclass.dtx. – barbara beeton Jul 02 '18 at 16:02
  • And if you don't use .dtx there's no problem to have more than one .sty file in a package. E.g. gb4e contains also cgloss4e separately. – Alan Munn Jul 02 '18 at 22:08

1 Answers1

2

I think this is an opinion-based question, so here's my opinion.

After all it's up to you whether you want to use multiple files (like TikZ, tcolorbox etc.) or one large file (like hyperref or amsclass).

Basically the decision should be made considering your file's size. If you have very large independent files you may want to individually design and test them and just have them under the hood of your package. That is when multiple files are very handy.

On the other hand, considering you might want to share some code between the file or your files are very simple and maybe even small you may use a single tagged dtx file with a ins file describing which parts to extract. This eases uniform development and maintenance as you will only have to work on one file.

In your case you already manage multiple files in your installation: the dtx file and some lua files, so both options would not hurt your current design, but I personally would go for integration into the dtx file (and extension of the ins file of course) to keep TeX sources at one spot.

TeXnician
  • 33,589
  • Do you know any good places to learn how to make an ins file? – Nathanael Farley Jul 02 '18 at 22:29
  • 1
    @NathanaelFarley Yes, look at one (e.g. https://github.com/ho-tex/hyperref/blob/master/hyperref.ins). But you really only need the part with \generate and the \file instructions. Unfortunately I can't recall where the documentation for ins files is located. – TeXnician Jul 03 '18 at 06:05