0

Consider the code

\documentclass{article}
\usepackage{color,soul}

\begin{document} \Huge \setulcolor{red} \setul{}{2.5pt} \textcolor{blue}{\ul{\textbf{some text}}} \end{document}

with output

enter image description here

This seems to be a simple, efficient way to underline in color with the flexibility of specifying the depth and thickness of the underlining.

Unfortunately, recall having encountered some undesirable conflicting effect within a document when using the soul package in the past; although I do not remember exactly what it was.

QUESTION: Is there a simple, alternative approach to the above code that does not make use of the soul package, whereby I can underline in color, as well as specify the depth and thickness of the underlining, and able to be compiled with pdflatex?

DDS
  • 8,816
  • 4
  • 9
  • 36
  • No. Either live with the soul restrictions or switch to lualatex and use lua-ul. – Ulrike Fischer Dec 02 '21 at 07:24
  • your question isn;'t so clear, for basic underlining you don't need a package at all you can use \underline the tricky parts of soul, ulem, lua-ul etc are allowing linebreaking, but it's not clear if you need that. – David Carlisle Dec 02 '21 at 08:02
  • @Ulrike Fischer Thank you for your comment; but could you specify what those soul restrictions might be; i.e., the problems that one should expect to encounter when using that package? Many thanks. – DDS Dec 02 '21 at 13:47
  • 1
    well read the documentation. Most importantly section "2.2 . . . others don’t". Or search the site here for questions about soul. – Ulrike Fischer Dec 02 '21 at 13:50
  • @David Carlisle One can use \underline, while at the same time change the color of that line, adjust the thickness, and alter its depth?? It is for these three reasons that I used soul in the MWE but requested an alternative approach because of complications with the package. – DDS Dec 02 '21 at 14:05
  • @SamuelBowditch yes or simpler just use \rule it really isn't complicated to put a rule under an unbroken text \fbox has \fboxsep and \fboxrule which does exactly what you want except on all 4 sides so doing the same but just on one side really has no issues at all, but you can not have \fbox mid-paragraph in text that breaks over th eline.... – David Carlisle Dec 02 '21 at 14:43

0 Answers0