BibTeX, biblatex and biberBreak long URLs in bibliography

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
marek_step
Posts: 27
Joined: Sun Aug 19, 2012 8:48 am

Break long URLs in bibliography

Post by marek_step »

Hello all!


Thesis is nearly finished. I only have two problems, one on topic one off topic.

I have a bibliography with over 350 entries. The long URLs do not break. Perhaps somebody could help? I made up a little example, as it is use here, to illustrate my problem. All books have a problem in the original bibliography. Here in this minimal example only five have an "Overfull \hbox" problem.

The file "bibtex_test.tex":

Code: Select all


\documentclass[twoside,BCOR=12mm,DIV=13,headsepline=yes,draft=true]{scrreprt}

\pagestyle{headings}
\usepackage[ngerman,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{CJKutf8}
\usepackage[T1]{fontenc}
\usepackage{csquotes} % Package biblatex Warning: 'babel/polyglossia' detected but 'csquotes' missing.

\DeclareUnicodeCharacter{014D}{{\=o}}
\DeclareUnicodeCharacter{016B}{{\=u}}
\DeclareUnicodeCharacter{014C}{{\=O}}
\DeclareUnicodeCharacter{016A}{{\=U}}

\usepackage{scale}
\usepackage[colorlinks=false,breaklinks=true]{hyperref} 
\usepackage[backend=biber, hyperref=true, url=true, isbn=true, backref=true, citereset=chapter, maxcitenames=3, maxbibnames=100, block=none]{biblatex}
\addbibresource{bibtex_test.bib}

\usepackage{url}
%\usepackage[anythingbreaks]{breakurl}
% \PassOptionsToPackage{hyphens}{url}
% \expandafter\def\expandafter\UrlBreaks\expandafter{\UrlBreaks% save the current one
%   \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j%
%   \do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
%   \do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D%
%   \do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
%   \do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X%
%   \do\Y\do\Z\do\*\do\-\do\~\do\'\do\"\do\-}
% \def\UrlBreaks{\do\/\do-\do_}

\begin{document}

\part{Chapter with some too long Bibliography Entries}

Herewith I show you[\footcite{ikegami2005bonds}] some bibliography[\footcite{tsubaki1971zeami}] entries.[\footcite{tierney2014bonsai}]

\section{Here a Chapter}

And here an other chapter,[\footcite{haikasoru2013liu}] please read:[\footcite{imari2014wiki}]


\section{An other Chapter}

And here some other entries,[\footcite{bowman2013columbia}] which does not fit into[\footcite{arbuckle2014reduction}] the bibliography,[\footcite{artisticnippon2014banko}] because the URLs are too long ... [\footcite{glendale2014tamba}] [\footcite{rachel2014curating}] Some of the entries are fitting now into the biblography, because they have only an one number entry. In the original the books go up to 350.[\footcite{types2014wiki}] 

\printbibliography[heading=bibintoc,title=Bibliography]

\end{document}

And the file "bibtex_test.bib":

Code: Select all


@book{ikegami2005bonds,
	Author = {Ikegami, Eiko},
	Publisher = {Cambridge University Press},
	Title = {Bonds of civility: aesthetic networks and the political origins of Japanese culture},
	Year = {2005}}

@article{tsubaki1971zeami,
  title={Zeami and the Transition of the Concept of Y{\=u}gen: A Note on Japanese Aesthetics},
  author={Tsubaki, Andrew T},
  journal={Journal of Aesthetics and Art Criticism},
  pages={55--67},
  year={1971},
  publisher={JSTOR}
}

@online{tierney2014bonsai,
	Author = {Prof. Lennox Tierney},
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	Keywords = {Japanese Aesthetic, garden art},
	Title = {The Nature of Japanese Garden Art},
	Url = {http://bonsaibeautiful.com/nature_of_garden_art/japanese/index.html},
	Bdsk-Url-1 = {http://bonsaibeautiful.com/nature_of_garden_art/japanese/index.html}}

@online{haikasoru2013liu,
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	Title = {Q/A With Ken Liu (and the return of Intern Kathleen)},
	Url = {http://www.haikasoru.com/the-future-is-japanese/qa-with-ken-liu-and-the-return-of-intern-kathleen/},
	Bdsk-Url-1 = {http://www.haikasoru.com/the-future-is-japanese/qa-with-ken-liu-and-the-return-of-intern-kathleen/}}

@online{imari2014wiki,
	Author = {Wikipedia},
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	Keywords = {Imari Porcelain},
	Title = {Imari porcelain},
	Url = {http://en.wikipedia.org/wiki/Imari_porcelain},
	Bdsk-Url-1 = {http://en.wikipedia.org/wiki/Imari_porcelain}}

@book{bowman2013columbia,
	Author = {Bowman, John Stewart},
	Publisher = {Columbia University Press},
	Title = {Columbia Chronologies of Asian History and Culture},
	Year = {2013}}

@online{arbuckle2014reduction,
	Author = {Arbuckle},
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	Keywords = {Reduction firing},
	Title = {Reduction firing},
	Url = {http://lindaarbuckle.com/handouts/reduction_fire.pdf},
	Bdsk-Url-1 = {http://lindaarbuckle.com/handouts/reduction_fire.pdf}}

@online{artisticnippon2014banko,
	Comment = {Shop with Banko ware},
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	Keywords = {Banko ware, Banko Shop},
	Title = {Banko teapots and cups (Japanese teapots/kyusu},
	Url = {http://www.artisticnippon.com/product/Banko/bankoyaki_index.html},
	Bdsk-Url-1 = {http://www.artisticnippon.com/product/Banko/bankoyaki_index.html}}

@misc{glendale2014tamba,
	Publisher = {seco.glendale.edu},
	Title = {Tamba Storage Vessel, Japan},
	Url = {http://seco.glendale.edu/~rkibler/tambastoragevessel.html},
	Bdsk-Url-1 = {http://seco.glendale.edu/~rkibler/tambastoragevessel.html}}

@online{rachel2014curating,
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	author= {Rachel},
	Title = {Curating the Oceans: The Future of Singapore’s Past},
	Url = {http://idlethink.wordpress.com/2009/07/14/curating-the-oceans-the-future-of-singapores-past/},
	Bdsk-Url-1 = {http://idlethink.wordpress.com/2009/07/14/curating-the-oceans-the-future-of-singapores-past/}}

@online{types2014wiki,
	Author = {Wikipedia},
	Date-Added = {2014-05-22 10:37:17 +0000},
	Date-Modified = {2014-05-22 10:39:49 +0000},
	Keywords = {kilns in China},
	Title = {Liste traditioneller chinesischer Keramikbrennofentypen},
	Url = {http://de.wikipedia.org/wiki/Liste_traditioneller_chinesischer_Keramikbrennofentypen},
	Bdsk-Url-1 = {http://de.wikipedia.org/wiki/Liste_traditioneller_chinesischer_Keramikbrennofentypen}}

To "compile" this example enter into the shell:

Code: Select all

pdflatex bibtex_test
biber bibtex_test.bib
pdflatex bibtex_test
pdflatex bibtex_test
Now my off-topic question: I would like to insert a little geographical locator to the right of my text for some cities: a little square in the country (China or Japan) and the city in the bigger surrounding square. (You see such kind of locators in newspapers). How to produce these little locators? I looked into the Openstreetmap pages but have no clue ... Perhaps somebody could give a tip or a link.

Sorry for this long posting and best greetings from Munich

marek

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Break long URLs in bibliography

Post by Johannes_B »

Hi marek,

add

Code: Select all

\setcounter{biburllcpenalty}{9000}% Kleinbuchstaben
\setcounter{biburlucpenalty}{9000}% Großbuchstaben
to your preamble after loading biblatex. Hyphenation of url-fields works a bit different with biblatex.
Zeilenbrüche in Bibliografielinks (german)


Concerning the other thing, i can't imagine the output right now or in other words i don't understand the problem right now. Can you add a screenshot (or something similar) to show what you are trying to achieve and more important: where? Best done in a new thread to keep the place clean.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
marek_step
Posts: 27
Joined: Sun Aug 19, 2012 8:48 am

Break long URLs in bibliography

Post by marek_step »

Thank you Johannes :-)

This was a fast answer! And thank you for the link. I was unable to find this solution in the net.

What concerns the "locator": this is not a latex related question. I have no idea, where to insert this question on this forum in a new thread. Perhaps you could give me a hint to produce many of this kind of maps:

http://es.wikipedia.org/wiki/Archivo:Me ... or_map.png


Best greetings!

marek
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Break long URLs in bibliography

Post by Johannes_B »

Well, that is really an off-topic question. I have no expertise in this field.
The picture you linked to is free to use (at least the spanish reads like that, tough i don't speak spanish) so you could actually use that in your document.
If you have a blind map without any markings, you could use tikz to print the image and set marks on top of that.
I just read up on Keyhole Markup Language, this might be worth a look.

btw: you write from germany (or north dakota), but du you actually speak german? IF not, i can stop linking to helpful german content.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply