Embed a style package in the document

I wonder whether it is possible to embed a style package in the tm document so that my customization packages are standalone?

I would just copy the code in the style package in the preamble. Does this fit your purpose?

I wonder whether there are already automatic solutions.

Not that I know of. There is an automatic way to extract style packages but not to embed it. Do you want to embed a package you wrote or one of the standard packages? Can you illustrate your use-case more in detail? It should be possible to create some support for it, but it seems to me not a very common need and not very difficult to achieve manually in few keystrokes, so I’m wondering if it really makes sense to have some more code for it.

It is not a current necessity (and in fact, not necessarily embedded). I was imagining the following two cases:

  1. Distribution of the tm files. When there are more users to use TeXmacs and sharing the code become more common, it might be useful. There is a point for an automatic including the user style packages - users can do them by hand, but it might be error-prone: one might forget to do so, or if there is some updates in the style package, one forgets to update the embedded style package.

  2. Chat / remote tools. I don’t know how TeXmacs treat it at the moment. For example, what if one uses in the chat some macros which is defined in a customized style package while another user does not have / load that package?