178
votes
Forcing linebreaks in \url
Herbert Voß created (December 2017) the package xurl.
This package allows urls to break everywhere, can be compiled simply with pdflatex, and has the same options as url (indeed, it loads url package)...
75
votes
34
votes
Underscore in bibtex url
In case of IEEE templates, when using the file bib, replacing the underscore with {\_} should solve the problem. In the case of the question:
@misc{code,
title = {Code},
url = {https://1drv....
33
votes
Accepted
Underscore in bibtex url
Just to formally answer and close this question:
As Ulrike Fischer answered in the comments, the solution was to use \usepackage{hyperref} (or \usepackage[hidelinks]{hyperref} to avoid the ugly boxes) ...
27
votes
Line breaks of long URLs in biblatex bibliography?
There is another way (SHORTER) of doing that: just put the entry below before the \begin{document}:
\usepackage{url}
\def\UrlBreaks{\do\/\do-}
This allows to have your customized (or required!) ...
26
votes
URLs in bibliography: LaTeX not breaking line as expected
When using biblatex, this can also be achieved with the block=ragged option, see §3.1.2.1 in http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/biblatex/doc/biblatex.pdf
i.e. \usepackage[block=...
19
votes
Accepted
Parsing Underscores in URLs from Mendeley
After further investigation and head scratching I have reached a working solution.
Updated MWE
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@misc{enc2015,
author = {{Example ...
16
votes
Forcing linebreaks in \url
\usepackage[hyphens]{url} should be ok. If it does not work, then go to (2).
\RequirePackage[hyphens]{url} before \documentclass.
\expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks% save ...
16
votes
Missing $ inserted issue
Try using in the preamble \usepackage{url}.
This should clear the problem.
14
votes
How to break a long URL
The problem with breakurl package is that it seems incompatible with PDFLaTeX, and XeLaTeX. My colleague Dag Langmyhr pointed out that the url package is compatible with hyperref if it is loaded ...
14
votes
Accepted
Remove "n.d." (no date) from online entries without dates in biblatex
The answer was updated with a much better solution. See the edit history for the earlier, less elegant approach.
The "nodate" marker is inserted by the labeldate format as fall-back with \literal{...
13
votes
URL causes Missing $ inserted error
the problem is the underscore in the url. it's being interpreted as an
indicator for a subscript, which requires math. wrap the url with \url thus:
\url{http://www.grc.nasa.gov/WWW/wind/valid/...
13
votes
How to disable percent-encoding in URLs?
A current biber knows the option --nouri-encode and then you get this
which isn't a sensible output either.
With a unicode engine like lualatex or xelatex and such a document (and again with --nouri-...
12
votes
Disabling URLs in bibliography
The IEEEtran.bst v1.14 introduces a new option to disable URLs. Now you can create a bib file containing the following:
@IEEEtranBSTCTL{MyBSTcontrol,
CTLuse_url = "no",
}
Include this bib file ...
12
votes
Breaking links and escaping characters in bibliographies with backlinks and ocgcolorlinks set
B. Lerner's method suggested here served as the basis for re-implementing hyperrefs's ocgcolorlinks option in the ocgx2 package, v0.24 [2017/03/30]. Also, issues 1 (empty link texts) and 2 (page ...
12
votes
Problems with Natbib: strange URL format and urldate not shown
If you have in your code \bibliographystyle{plainnat} then the "URL" text comes from the style.
In the plainnat.bst file you can find the following code:
FUNCTION {format.url}
{ url empty$
{ "" }
...
12
votes
Accepted
BibTex: URL:s gets weird whitespace
(Too long for a comment, hence posted as an answer.)
I recommend you load the URL package with the options hyphens, spaces, and obeyspaces:
\usepackage[hyphens,spaces,obeyspaces]{url}
If you load ...
12
votes
Accepted
# and other characters in a url
You are using the \href in the argument of some other command. This will break as \href no longer can change the catcode of the #. The exact error message depends on the outer command, but will ...
11
votes
Accepted
Inserting URLs without the hyperlink
The question is tagged with hyperref, then \nolinkurl is the counterpart of \url without link.
If hyperref is not used, then the link is probably created by the PDF viewer, which uses a heuristics to ...
11
votes
Accepted
How to I use a command in a href
Just remove the trailing {} that forms part of the URL:
\href{https://example.com/\version}{version}
Appending {} to a macro is only needed if you which to set a regular space between a macro and a ...
11
votes
Accepted
How to break a long URL in bibliography, keeping the URL in plain text font?
URL strings can contain lots of characters that are "special" to TeX. Among them are _ (underscore), # (hash), % (percent), $ (dollar), & (ampersand), etc. The point of encasing URL strings in \...
11
votes
How I can type an underscore character (_) that's part of an email address?
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\href{mailto: [email protected]}{ufukkaya\[email protected]}
\end{document}
11
votes
Get Biblatex to show URL for Webpage references
The standard behaviour of biblatex is to always display URLs for @online regardless of the url option. So even with url=false you should see the URL of @online entries.
Mendeley exports websites as @...
10
votes
Accepted
How to define a custom url entry in Biber?
There are several ways you can go about doing this.
In newer versions of biblatex and Biber you could use the data annotation feature. For restricted URLs you can add url+an = {restricted}, that ...
9
votes
URL with tilde character?
This did it for me (plus: the link works!)
\string~
From: https://latex.org/forum/viewtopic.php?t=3663
9
votes
Accepted
How to insert a percent symbol in url in beamer?
In order to do its work, beamer has to absorb a frame environment's contents at once. This has the consequence that \href cannot perform its duty of changing the nature of %, because when the contents ...
9
votes
Accepted
How to "really" solve the problem of "underfull \hbox" when typesetting url in footnote
Rather than breaking mid-word, you can re-introduce some stretch space around the break characters (. and / here) I use
\Urlmuskip=0mu plus 10mu
which allows more than enough flexibility in this ...
9
votes
Accepted
url with # as footnote
Define the url before the footnote with \urldef:
\documentclass[12pt,twoside]{report}
\usepackage{hyperref}
\begin{document}
\urldef\urlchem\url{https://chemicalize.com/#/calculation}
\footnote{\...
8
votes
Tool for generating a website's BibTex using the URL?
This chrome extension I wrote sometime ago tries to address this.
It creates a BibTeX entry from the active URL and copies it to clipboard automatically.There are three options to create a BibTeX ...
8
votes
URL linebreak in footnote
The url package does linebreaks automatically [in long URL strings], but in the footnote it won't do it.
The main issue -- not touched on by the previously-posted answers -- is that the \url macro ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
urls × 945hyperref × 226
biblatex × 148
bibliographies × 139
bibtex × 139
line-breaking × 97
footnotes × 56
doi × 40
natbib × 36
links × 34
citing × 32
biber × 30
href × 27
macros × 24
hyphenation × 22
beamer × 19
errors × 19
fonts × 17
pdf × 17
xetex × 16
pdftex × 15
apa-style × 15
ieeetran × 14
hyperlink × 14
spacing × 13