Advertisement
Advertisement


How to write URLs in Latex?


Question

How do you write a URL in Latex?

The subscripts and everything else make the font look very strange when it compiles.

2019/05/03
1
182
5/3/2019 6:31:16 PM


You just need to escape characters that have special meaning: # $ % & ~ _ ^ \ { }

So

http://stack_overflow.com/~foo%20bar#link

would be

http://stack\_overflow.com/\~foo\%20bar\#link

2010/05/24

Here is all the information you need in order to format clickable hyperlinks in LaTeX:

http://en.wikibooks.org/wiki/LaTeX/Hyperlinks

Essentially, you use the hyperref package and use the \url or \href tag depending on what you're trying to achieve.

2015/02/23

A minimalist implementation of the \url macro that uses only Tex primitives:

\def\url#1{\expandafter\string\csname #1\endcsname}

This url absolutely won't break over lines, though; the hypperef package is better for that.

2015/03/06

Source: https://stackoverflow.com/questions/2894710
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]