0

I have the request to use underline text. I am aware this could be done with \ul (from soul package) which works in most of the scenarios. Somehow this command has a problem to handle properly \href{} commands.

Despite the question if this makes sense or not I need a solution for this case. I found that \uline (from ulem package) could handle this situation much better without any problems. But now the next problem is arising, namely

\uline{This is a bold text 

with an empty line inbetween} 

is not properly handled due to the empty linebreak. I have somehow in my memory this is because how the arguments of the commands are handled. I remember vague that the command needs to be redefined to hold an empty linebreak but I coudln't find a hint how to do so. Could somebody please point me toward a solution?

Note: I am using lualatex with the purpose to generate a PDF file. Math mode is not really a subject, meaning I don't care much about Math mode.

  • 2
    you are underlining whole paragraphs??? possibly using \endgraf instead of the blank line will work (it will allow the argument, whether \uline can cope with end of paragraph I do not know and you didn't provide a test file – David Carlisle Jun 1 at 13:14
  • 1
    @LeO If you use luatex anyway you could e.g. use the code from my answer here. That defines an underline command using LuaTeX attributes which doesn't have any problems with paragraphs. – Marcel Krüger Jun 1 at 13:25
  • @DavidCarlisle \ulhandles this properly. So therefore I don't understand why the problem arises with \uline... – LeO Jun 1 at 20:27
  • 2
    No idea but I would try to avoid underlining, but if you really have to, go with @MarcelKrüger's suggestion – David Carlisle Jun 1 at 20:30
  • @MarcelKrüger I'll try it. Especially I need to evaluate how \href is handled and empty lines. No idea about page breaks but might be an issue as well. Anyway I'll test it. Thx – LeO Jun 1 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.