I've searched the net and stackoverflow and found a number of great LaTeX sources, but I couldn't find any decent manual about writing your own class and style files. Some issues I have is which part of the code should be in a class file and which in a style file, how to finetune macros, how to define and use variables,...
I figured some things out by looking at other peoples code, but I'd like to have some comprehensive overview. Any ideas where I should look?
PS : I have already the not so short introduction to latex, introduction to beamer and latex tutorial - a primer. None of these answers my questions.