Text FormattingHow to make double underline in an url

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
rob20
Posts: 4
Joined: Sun Dec 27, 2009 1:37 pm

How to make double underline in an url

Post by rob20 »

Hi,
I have the problem that in my bibtex I have an url like this:

howpublished = {{http://www.foo.com/double__underlines}}

This throws an error if directly compiled.
double\{__}underlines does not work, \_\_ works but gives a space in between like this _ _.

How can I do this?

Thanks a bunch.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: How to make double underline in an url

Post by frabjous »

Frankly I think it's a good thing if there is a small space between the underscores, or else it might be hard to read the URL. Personally, I'd load the url (or hyperref) package and put in:

howpublished = {\url{http://www.foo.com/double__underlines}},

but frankly, I think \_\_ looks fine too. (No space in the middle, but still a small visible gap in the output.)

If you really want to get rid of the gap, I suppose you could use either \_\negthinspace\_ or \underline{~~}, but again, I think the gap is a good thing.
User avatar
rob20
Posts: 4
Joined: Sun Dec 27, 2009 1:37 pm

Re: How to make double underline in an url

Post by rob20 »

Thanks a lot. That's what I needed.
Post Reply