Yes, you can bundle an additional file into your package (it isn’t possible to embed
.bst code in a
.sty file in any meaningful manner because it’s written a different language).
You have to write it as a
.dtx file in the standard way for distributable packages, so that when the user installs it, it will unwrap your
.sty file and the
.bst file you included (and more files, if needed). The user then has to put those files in “the right place”, which is explained here, exactly as for every other package installed manually.
BUT...(very big BUT), if the BiBTeX style file is already a standard package on CTAN (I can’t find it there), then bundling a private copy in your package is A Very Bad Idea indeed. The user should install it from CTAN in the normal way (if they’re using a TeX distribution with on-the-fly installation, this may just get done for them automatically).
sp.bst the one from Semantics & Pragmatics? If so, you should encourage them to have it properly bundled and made available through CTAN if they can, which would make life easier for everyone. In any case you can certainly add it to your
.dtx file, but you would need permission from the author or copyright holder to do so, and you’d need a formal agreement to handle updating and overwriting.
Paul Stanley makes some good points, but
- IMHO it is a good idea to make a formal package (
.sty) file, but
only when written as a
.dtx file with proper documentation so it
can be installed, maintained, and referred to;
- I’m not sure I understand why 2 is useful at all;
- apart from Emacs, I don’t know any LaTeX editors that support
snippets, and it’s not a good idea to force authors to use an editor
different from the one they normally use.
Consider moving away from BiBTeX to biblatex (but if this
sp.bst file is S&P’s then you’d need to persuade them to do this).