It is quite straight-forward to split the code for a single .sty
over multiple sources: after all, the .dtx
format was created to support the work of the LaTeX team where there is a significant need for this type of thing. The \generate
macro takes two arguments where the second can have multiple source files
\input docstrip
\generate{mypackage.sty}{%
\from{mysource1.dtx}{package}%
\from{mysource2.dtx}{package}%
\from{mysource3.dtx}{package}%
...
}
In terms of making a single PDF, that comes down to having a source file that will generate the documentation and then typesetting it. Depending on exactly how you want to set things up, you might have a simple .tex
file for the user documentation, might use a .dtx
or might arrange that the user documentation is inside the code .dtx
files and only the user part of each one is read by a master .tex
file. However, that does not depend at all on where your code sources are.
memoir
is handled. The documented source might not be that relevant for the casual user. So having two PDFs might be better (might even leave out the PDF of the documented source code)