TransWikia.com

Error with URL in bibliography, TeX capacity exceeded

TeX - LaTeX Asked by major.hph on August 1, 2021

When I try to add the following Website to my bibliography I get an error, that TeX capacity is exceeded. I would be very thankful for your help. I integrated it into a file with JabRef. After this, you will find my main file. If you need anything else, feel free to ask.

@Misc{uni.utah.mm,
author = {Peter Alfeld},
note   = {[Online; Stand 10.08.2020]},
title  = {The Mandelbrot Set.},
url    = "url{https://www.math.utah.edu/~alfeld/math/mandelbrot/mandelbrot.html}",
}
documentclass[12pt, a4paper, bibliography=totocnumbered]{scrartcl}

usepackage{ucs}
usepackage[utf8x]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage[headsepline, automark]{scrlayer-scrpage}
usepackage{tabularx}
usepackage[bottom, perpage]{footmisc}
usepackage{amsmath, amssymb}
usepackage{amsfonts}
usepackage{color}
usepackage{transparent}
usepackage{graphicx}
usepackage{caption}
usepackage[onehalfspacing]{setspace}
captionsetup[figure]{font=small,labelfont=small}
newcommand*{captionsource}[2]{%
  caption[{#1}]{%
    #1%
    hspace{linewidth}%
    textbf{Quelle:} #2%
  }%
}
usepackage{float}
usepackage[printonlyused]{acronym}
usepackage[
    pdftitle={Maturitätsarbeit - Die Darstellung Mandelbrot-artiger Mengen im dreidimensionalen Raum},
    colorlinks=true,
    urlcolor=blue,
    linkcolor=black,
    citecolor=black
]{hyperref}
usepackage[scaled]{helvet}
renewcommandfamilydefault{sfdefault} 
makeatletter
defthickhline{%
  noalign{ifnum0=`}fihrule @height thickarrayrulewidth futurelet
   reserved@a@xthickhline}
def@xthickhline{ifxreserved@athickhline
               vskipdoublerulesep
               vskip-thickarrayrulewidth
             fi
      ifnum0=`{fi}}
makeatother
renewcommand{arraystretch}{1.3}
bibliographystyle{unsrtdin}
setcounter{secnumdepth}{8}
newlength{thickarrayrulewidth}
setlength{thickarrayrulewidth}{2arrayrulewidth}
setlength{parindent}{0pt}

makeindex

urlstyle{same}
usepackage[a4paper,left=2cm,right=2cm,top=3cm,bottom=3cm]{geometry}
pagestyle{scrheadings}
clearpairofpagestyles
ihead{small rightmark}
ofoot{small pagemark} 
renewcommand*{sectionmark}[1]{%
    markright{MakeMarkcase{ifnumbered{section}{sectionmarkformat}{}#1}}%
}

begin{document}
fontmyfont=cmr16
newcolumntype{L}[1]{>{raggedrightarraybackslash}p{#1}}
newcolumntype{C}[1]{>{centeringarraybackslash}p{#1}}
newcolumntype{R}[1]{>{raggedleftarraybackslash}p{#1}}

begin{singlespace}
subject{large Maturitätsarbeit}
title{Large Die Darstellung Mandelbrot-artiger Mengen im dreidimensionalen Raum}
end{singlespace}
maketitle
hrule
newpage

tableofcontents
newpage

addcontentsline{toc}{section}{Abbildungsverzeichnis}
listoffigures
newpage

addsec{Abkürzungsverzeichnis}
begin{acronym}
acro{mm}[MM]{Mandelbrot-Menge}
end{acronym}
pagebreak

input{vorwort.tex}
pagebreak
input{einleitung.tex}
newpage
bibliography{literatur}
end{document}

The exact error message is

! TeX capacity exceeded, sorry [input stack size=5000].@makeother #1->catcode `#112relax .../~alfeld/math/mandelbrot/mandelbrot.html}}

One Answer

The first BibTeX styles predate the standardisation of the URL protocol by a few years. This means that the base BibTeX styles do not have a dedicated url field. Newer styles may support a url field, but the exact implementation and handling of that field is not uniform across styles.

With most styles that support a url field, however, the rule is to give the URL without change and without additional markup, since they interface with url/hyperref (or can more or less easily be made to interface with these packages). You don't need to wrap the URL in url{...} when it is given in the url field and you do not need to escape otherwise special characters like % or _.

This is true for your style unsrtdin, which interfaces with url and hyperref and accepts URLs as-is. Just give the URL as

url = {https://www.math.utah.edu/~alfeld/math/mandelbrot/mandelbrot.html},

You may have to delete the temporary .bbl file after you fixed the .bib file, because the old code from the unfixed .bib file may live on in the .bbl file. (The procedure of generating a bibliography and the role of the .bbl file is explained wonderfully in Question mark or bold citation key instead of citation number if you want to know more.)

In full (note that the MWE crates the .bib file via filecontents, that is just to make the example self-contained, in a real-world document the .bib file would live outside the .tex file)

documentclass[ngerman]{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage{babel}
usepackage{hyperref}

bibliographystyle{unsrtdin}

begin{filecontents}{jobname.bib}
@misc{uni.utah.mm,
  author = {Peter Alfeld},
  note   = {[Online; Stand 10.08.2020]},
  title  = {The Mandelbrot Set},
  url    = {https://www.math.utah.edu/~alfeld/math/mandelbrot/mandelbrot.html},
}
end{filecontents}

begin{document}
cite{uni.utah.mm}
bibliography{jobname}
end{document}

Alfeld, Peter: The Mandelbrot Set. https://www.math.utah.edu/~alfeld/math/mandelbrot/mandelbrot.html. – [Online; Stand 10.08.2020]

It should be noted that unsrtdin (as part of the din1505 style bundle) implements a DIN 1505-2-compliant citation style. The German standard DIN 1505-2 (from 1984) was replaced by DIN ISO 690 in 2013 and makes some (in my eyes at least) questionable typographic decisions. If you are not forced to use that style, you may want to look for something else.

Correct answer by moewe on August 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP