Can I have different kinds of lines actually drawn using LaTeX boxes? I was curious to know about the definition of \underline{}. I am sure it uses boxes, because If I type something like this -
\documentclass{standalone}
\begin{document}
\underline{\underline{\underline{\underline{\underline{content}}}}}
\end{document}
I get five underlines, but with some significant space in between. Which means underline is defined as a box which doesn't intersect into another. I want exactly same function, but for curly underlines (like we get when we misspell a word.) but one important thing is if I use it twice, it should not clash with the first (as it happens in underline) I also wish to do this using plain TeX/LaTeX (without the help of packages like Tikz). I've read about package ulem, but I want to try it out on my own. Can somebody explain how the underline is defined?
\sqrtand\underlineand\overlineoperations are able to place lines above or below subformulas of any size or shape; the bar lines change their size and position, so that they are long enough to cover the subformula, and high enough or low enough not to bump into it." – Phelype Oleinik Sep 11 '19 at 11:10texdoc tex, section 735) for it's definition. But you can't change this primitive (perhaps with LuaTeX you can, I'm not sure) to print a squiggly line. I think you need to start from the code insoulorulemand modify them to behave like\underline. – Phelype Oleinik Sep 11 '19 at 11:51tikzwith a similar approach described in this listings highlighting solution. – siracusa Sep 11 '19 at 12:52tikz, has alredy been tested by many, many users. – siracusa Sep 12 '19 at 09:15