Auto label generation?

Hi,

May I know if there is a way to automatically generate labels for every proposition, theorem, title etc.?

Also is there a way to reference to another file’s label?

I thought about how to do it with Scheme; I see a way to add labels to all environments that do not have one, and I do not see a way to add the label while the environment is being written (that is, add the automatic label generation inside the macro that defines the environment).

For adding labels a posteriori I would find out all subtrees of the environment types that I select, for each environment check whether it has a label, add it to all environments that do not have one, generating label names that are different from all other labels names in the document. It takes a bit to write it :-), and maybe you were looking for something that you could use :wink: but I do not have that.

I do not know how to generate it within the macro that defines the environment: the label would have to stay the same once that the environment has been written, and I do not know how to check that in the macro code.

I do not know how to do that, sorry, perhaps it takes more Scheme skills and an understanding of the label-reference mechanism of TeXmacs, which I do not have.