I have a LaTeX file, including a BibTeX file with items using the \url
command. But when compiling, for every \url
command this error rises:
Undefined control sequence. \newblock{\urlhttp
.
For instance:
% tex file
\usepackage{hyperref}
\usepackage{url}
\usepackage{some,more}
. . .
\bibliographystyle{plain}
\bibliography{my.bib}
% my.bib file
@misc{maxmind,
howpublished = {{\url{https://www.maxmind.com/en/geoip2-services-and-databases}}},
author = {{MaxMind, Inc.}},
title = {{MaxMind GeoIP2}},
}
% bbl file
...
\bibitem{maxmind}
{MaxMind, Inc.}
\newblock {MaxMind GeoIP2}.
\newblock {\urlhttps://www.maxmind.com/en/geoip2-services-and-databases}.
...
As you can see, in the .bbl
-file there are no "curly parentheses" (sorry if this is not the right wording) around the \url
command.
This also happens when in the bib file there are less parentheses like:
howpublished = {\url{https://www.maxmind.com/en/geoip2-services-and-databases}},
Does anybody know, how this happens?
Maybe there is a conflict with any other package? Just in case, here are all packages that are used:
\usepackage[printonlyused,withpage]{acronym}
\usepackage[]{algorithm2e}
\usepackage{algorithmic}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage{booktabs}
\usepackage{cite}
\usepackage{color}
\usepackage{comment}
\usepackage{enumitem}
\usepackage{epsfig}
\usepackage{eurosym}
\usepackage[Bjarne]{fncychap}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage[weather]{ifsym}
\usepackage[utf8x]{inputenc}
\usepackage{listings}
\usepackage{lscape}
\usepackage[tracking=true]{microtype}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{paralist}
\usepackage{pdfpages}
\usepackage{rotating}
\usepackage[digitsep=comma]{siunitx}
\usepackage{subfigure}
\usepackage{tabularx}
\usepackage{tikz}
\usepackage{url}
\usepackage{wrapfig}
\usepackage{xspace}
I do not know why the curly braces are dropped in the .bbl
-file but this causes the compiling to crash.
Can you please give me a hint on how to solve this?
Best Answer
I don't know if I understood completely the question. But here it goes: if you want to URL's to be typeset with curly braces in the bibliography like this
{tex.stackexchange.com}
you have to use in the.bib
file\{
instead of just{
. Like in the following MWE:Also, by loading the
hyperref
package you already have the command\url{<some URL>}
. Furthermore, you can use thenatbib
styles which provide theurl
field that can be used directly likeurl = "<some-URL>"
. I would also like to recomend the use of"
instead of curly braces as boundaries of the bibitems fields as curly braces are used to preserve letter cases. Check the wiki