\marginfigure and \margintable overlapping with other elements
The fixes in #25 are great! How about \marginfigure and \margintable? Are those not defined as floats? For example, my \sidenotes and \marginnotes are appearing on top of \marginfigures and \margintables that they are defined close enough to.
In principle, setting \marginskip to a higher value, like 1cm, should work, but I found that it has no effect. I'll dig into the template and see what I can find out.
So, apparently I misunderstood what \marginskip is supposed to do. It turns out, as everybody knows, that it does not set globally the space between \marginpars, but rather it should be called whenever it is needed, at any point of the document.
Given this, I modified the \marginfigure, \margintable, and \marginlisting commands so that thy call \marginskip as the first and last things they do. This adds a space between the figure/table/list and any other floating element. The spaces above and below are controlled by two lengths and can be modified with, e.g.:
\setlength{\kaomarginskipabove}{1cm}
\setlength{\kaomarginskipbelow}{1cm}
in the main.tex. By default, both lengths are 3mm.
Nice! It looks like it works as long as I don't include the offset argument. However, when I include an offset (e.g. of 0pt), they still overlap.
Yes, this is indeed the expected behaviour, since the offset prevents the elements to float freely, and the \marginskip only works with floating elements. However, now that the automatic placement prevents the overlaps, setting an offset should be needed only occasionally, and for that occasions, it may be manually set so as to prevent the overlaps, and indeed so as to improve the design of the page. As you know I am always open to new ideas, so if you have one to further improve on this issue I'll try and implement it :)
Sounds good 👍. I'm not sure how it would be implemented, but I suppose the expected behavior in my head is that latex would still shift margin thing 2 after margin thing 1 so that they don't overlap, even when margin thing 1 is positioned with an offset. However, I see how that could be difficult, given that offsetting prevents using the magic of floating.
I agree that it would be difficult, in fact right now I wouldn't know how to do it. I have made some attempts, but still to no avail. Hopefully I'll find a way in the future... in the meantime I have set the help-wanted flag.