I was wondering whether or not it was possible, with any package, to create sidenotes that adapt to the margin. It would look kind of like this: 
Asked
Active
Viewed 172 times
0
wrapfig– David Carlisle Jan 17 '22 at 19:09memoirclass provides a variety of sidenotes but not like what you are after. It seems that you want the first side note to change the page layout by decreasing the\textwidthand increasing the margin, put any other sidenotes in the expanded margin and after the last sidenote on the page revert the page layout to its original state. I have no idea about how to do this autimatically via LaTeX code. – Peter Wilson Jan 17 '22 at 19:22