Skip to content

url, xurl and breakurl in Scissor LaTeX

Mostly. \url{...} prints a clickable address that breaks at the end of a line, after / and similar characters or, when there is no such place, between letters, which is what xurl adds; \path{...} prints a monospaced path. \urlstyle is ignored, and \url|...|, \urldef, \nolinkurl and breakurl's \burl are not supported.

What the packages do

  • url provides \url{...}, which prints a web address exactly as typed, including _, %, # and ~, and lets it break at the end of a line after / and .. \path{...} does the same for file names. \urlstyle{same} or \urlstyle{tt} picks the font.
  • xurl loads url and allows a break after any character, so a long address never runs into the margin.
  • breakurl gives \burl, which breaks long links in documents compiled with the old latex and dvips route.

With hyperref loaded, \url also becomes a clickable link; see hyperref.

What works here

CommandIn Scissor LaTeXNotes
\url{...}WorksClickable in the PDF, with or without hyperref. Set in the text font. _, %, #, & and ~ need no escaping.
Line breaks in long addressesWorksAfter /, . and similar characters first; an address with no such place is broken between letters, so it stays inside the margin. This is the same with url and xurl.
\usepackage{xurl}WorksAccepted; long addresses already break as described above.
\path{...}WorksMonospaced, as typed; not a link. Backslashes are kept.
\urlstyle{tt}, \urlstyle{same}Left outAddresses stay in the text font.
\url|...| with another delimiterNot supportedOnly the braces form is read: write \url{...}.
\nolinkurl{...}Not supportedSkipped with a Problems note; the address is kept as plain text.
\urldef{\cmd}\url{...}Not supportedSkipped with a Problems note; write \url{...} where the address is needed.
\burl{...} (breakurl)Not supportedSkipped with a note; the address is kept as plain text, without a link. Use \url.
\doi{...} (doi)Not supportedSkipped with a note; the number is kept as plain text. Write \url{https://doi.org/...}.

Examples

A long address breaks at the end of the line, and \path prints a file name:

Long addresses break at the end of a line

LaTeXPreamble: \usepackage{url}Open in editor (opens in a new tab)
The measurements of all 44 samples are archived at
\url{https://example.com/archive/2026/measurements/series-44/final/index.html}.
Erika Mustermann keeps a copy in \path{C:\Users\erika\data_44.csv}.
Rendered by Scissor LaTeX: Long addresses break at the end of a line

An address without slashes is broken between letters, as xurl does:

xurl: breaks anywhere when needed

LaTeXPreamble: \usepackage{xurl}Open in editor (opens in a new tab)
See \url{https://example.com/ThisIsAVeryLongAddressWithoutAnySlashesThatStillHasToFitOnTheLine_v44}
for the details.
Rendered by Scissor LaTeX: xurl: breaks anywhere when needed

Compatibility

  • From a TeX installation to here: \url and \path look the same, except that addresses are in the text font rather than a monospaced one. Replace \burl and \url|...| with \url{...}.
  • From here to a TeX installation: documents compile there unchanged. Load xurl if long addresses must break anywhere there too; with plain url, an address without break points can run into the margin.

The full manuals are on CTAN: url, xurl and breakurl. See also Links and URLs and hyperref.

Questions and answers

How do I stop a long URL from running into the margin?

Here it never does: long addresses break at the end of the line. In a TeX installation, load \usepackage{xurl} for the same result.

Do I need to escape underscores in \url?

No. Inside \url{...} and \path{...}, characters such as _, %, # and ~ are written as they are.

Every example on this page is typeset by Scissor LaTeX when the site is built. Last updated 2026-11-07.