Based on a code by Alex Chan and help from Jinwen here, I made a custom underlining command with nice results: as you can see on the pictures (here and in Jinwen's post edited by me), the underline never overlaps the characters. This is because the letters have a contour around them, acting as a shell.

The problem is that the command just disallows line breaks, which is quite an issue.

Any idea how we could add support for line breaks?


        author = {Lakoff, George},
        title = {Counterparts or the Problem of Reference in Transformational Grammar},
        year = {1968},
        url = {https://georgelakoff.files.wordpress.com/2011/01/counterparts-or-the-problem-of-reference-in-transformational-grammar-lakoff-1968.pdf}



    \FPmul\cleverul@temp{\f@size}{0.#1}% This is \f@size * 0.15
    \setlength{\ULdepth}{\cleverul@temp pt}%
    \FPdiv\cleverul@temp{\f@size}{#2}% This is \f@size / 15
    \renewcommand{\ULthickness}{\cleverul@temp pt}%

\cs_set_eq:NN \coolclevul:nnnnn \clevulaux

\cs_generate_variant:Nn \coolclevul:nnnnn { VVVV }


\keys_define:nn {coolclev}
    space.tl_set:N = \coolclevul_space,
    thinness.tl_set:N = \coolclevul_thinness,
    boldness.tl_set:N = \coolclevul_boldness,
    color.tl_set:N = \coolclevul_color,
    space.initial:n = 15,
    thinness.initial:n = 12,
    boldness.initial:n = 0.8,
    color.initial:n = white,


\DeclareFieldFormat{url}{\coolclevul[space=18,thinness=14]{\url{#1}}} % The command \coolclevul prevents hyphenation.


enter image description here

  • 1
    Just out of idle curiosity: What purpose is served by underlining a URL string?
    – Mico
    Apr 25, 2023 at 22:00
  • It's a convention like another one, I'd say. One day someone must have asked: "What purpose is served by italicizing work titles?" and now everyone is doing it. The fact is, URL is something relatively new, and underlining isn't officially reserved for anything. So I can reverse the question: why wouldn't you want to underline a URL? Maybe it looks better that way? naked URLs are as ugly as a string can be. Apr 25, 2023 at 22:14
  • 1
    URLs are an example, but the problem is that the command disallows line breaks. Which is sad, considering it's aesthetically very satisfying. Apr 25, 2023 at 22:26
  • 4
    url's are no longer new. And they are certainly not so important that you should emphasize them in the bibliography. I would simply write them in a normal font. Apr 25, 2023 at 22:27
  • 4
    if you want underlining with good line breaks, use lualatex and the lua-ul package. Apr 25, 2023 at 22:27


You must log in to answer this question.

Browse other questions tagged .