For example, the overlay of the exercises found in Exo7's pdfs are situated in front of a jagged line usually, I would like to know how to get the text to be exactly in front of the line I'm creating.

I did a TikzPicture already of the line I want to put, but I can't seem to get the text in front of my line.

tcolorbox. In the first case, please note that there is now thetikzmarklibrary which comes with its own, better version of\tikzmark. – Mar 19 '20 at 12:47