1

I would like to underline all occurrences of a factor that appears in a text, e. g. all occurrences of aba in text=abaababa

If I use underline, I won't see clearly the three occurrences so what I need is a package which allows me to use overlapping \underline{}.

I did it in the past and it worked well (it's therefore feasible) but I'm getting old now and I don't remember how I did it.

Willie Wong
  • 24,733
  • 8
  • 74
  • 106

1 Answers1

1

I don't know about a package for overlapping underline, but I once solved this by using regular underline and \vphantom{} for lowering parts of the line. With \vphantom{} you can make sure the lines don't overlap, but are spaced underneath each other.

\documentclass[a5paper]{article}
\usepackage{ulem}
\begin{document}

\underline{aba}\underline{ab\underline{\vphantom{\_}a}}\underline{ba}

\end{document}

This should give you the right underlining. If necessary you can use \vphantom{p} for more vertical space. Note that you would be 'sticking' two underlines together for the last aba, rather then making one. You will notice that if you replace the underscore with a p.

azetina
  • 28,884
DeLacey
  • 11