Hot answers tagged

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)...
CarLaTeX's user avatar
  • 61.3k
75 votes

Missing $ inserted issue

\usepackage[strings]{underscore}
Roly's user avatar
  • 4,181
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....
Francesco Boi's user avatar
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) ...
stefanbschneider's user avatar
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!) ...
schmi's user avatar
  • 523
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=...
Andreas's user avatar
  • 361
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 ...
samthecodingman's user avatar
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 ...
STUDY's user avatar
  • 161
16 votes

Missing $ inserted issue

Try using in the preamble \usepackage{url}. This should clear the problem.
Sundeep's user avatar
  • 169
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 ...
Geir's user avatar
  • 331
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{...
moewe's user avatar
  • 173k
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/...
barbara beeton's user avatar
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-...
Ulrike Fischer's user avatar
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 ...
Zebra Propulsion Lab's user avatar
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 ...
AlexG's user avatar
  • 54.2k
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$ { "" } ...
Sonia's user avatar
  • 261
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 ...
Mico's user avatar
  • 495k
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 ...
Ulrike Fischer's user avatar
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 ...
Heiko Oberdiek's user avatar
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 ...
Werner's user avatar
  • 598k
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 \...
Mico's user avatar
  • 495k
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}
Zarko's user avatar
  • 293k
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 @...
moewe's user avatar
  • 173k
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 ...
moewe's user avatar
  • 173k
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
Cheque's user avatar
  • 91
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 ...
egreg's user avatar
  • 1.1m
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 ...
David Carlisle's user avatar
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{\...
Ulrike Fischer's user avatar
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 ...
nettrino's user avatar
  • 181
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 ...
Mico's user avatar
  • 495k

Only top scored, non community-wiki answers of a minimum length are eligible