6

I hope it's not a duplicate but I was not able to find a solution. I generate my *.bib file using Citavi. The problem is, that if the ISBN number is near the end of the line it generates overfull hboxes, because there is no automatic linebreak within the number (even not at the hyphens).

I use this header:

\usepackage[
    backend=biber, 
    style=alphabetic,
    backref=true]
{biblatex}
\DeclareNameAlias{sortname}{last-first} % Change order of names in bibliography
\DeclareNameAlias{default}{last-first}  % Change order of names in bibliography
\makeatletter   
\@ifpackageloaded{biblatex}{\addbibresource{Chapters/Bibliography.bib}}{\bibliography{Chapters/Bibliography}}
\makeatother

The entry in the *.bib file is:

@book{Hahn.2002,
 author = {Hahn, Hubert},
 year = {2002},
 title = {{Rigid Body Dynamics of Mechanisms}},
 publisher = {Springer-Verlag},
 isbn = {978-3-642-07617-6},
 volumes = {2},
 subtitle = {{1 Theoretical Basis}},
 location = {Berlin and Heidelberg and New York},
 pagetotal = {336},
 file = {http://gso.gbv.de/DB=2.1/PPNSET?PPN=77292189X}
}

which generates WithError

If I add a manual space in the number, I get the desired result

 isbn = {978-3-642- 07617-6},

WithoputError

But it would be much nicer with an automatic solution which does not produce overfull boxes.

MWE (LuaLaTex):

\documentclass[a4paper]{scrbook}
\usepackage{polyglossia}    % instead of babel
\setdefaultlanguage[]{english}
\usepackage[english]{hyperref}
\usepackage{csquotes}% Recommended: http://tex.stackexchange.com/questions/5091/what-to-do-to-switch-to-biblatex
\usepackage{fontspec}
\setromanfont{Cambria}
\setsansfont{Calibri}

\usepackage[%style=numeric-comp, backend=biber]{biblatex} 
    backend=biber, %    natbib=true,
    style=alphabetic,%trad-alpha,   
    sorting=ynt,  % year, name, title
    backref=true]
{biblatex}
\DeclareNameAlias{sortname}{last-first} % Change order of names in bibliography
\DeclareNameAlias{default}{last-first}  % Change order of names in bibliography

\begin{filecontents}{\jobname.bib}
@book{Hahn.2002,
 author = {Hahn, Hubert},
 year = {2002},
 title = {{Rigid Body Dynamics of Mechanisms}},
 publisher = {Springer-Verlag},
 isbn = {978-3-642- 07617-6},
 volumes = {2},
 subtitle = {{1 Theoretical Basis}},
 location = {Berlin and Heidelberg and New York},
 pagetotal = {336},
 file = {http://gso.gbv.de/DB=2.1/PPNSET?PPN=77292189X}
}
@book{Hahn.2012,
 author = {Hahn, Hubert},
 year = {2012},
 title = {{Rigid Body Dynamics of Mechanisms}},
 publisher = {Springer-Verlag},
 isbn = {978-3-642-07617-6},
 volumes = {2},
 subtitle = {{1 Theoretical Basis}},
 location = {Berlin and Heidelberg and New York},
 pagetotal = {336},
 file = {http://gso.gbv.de/DB=2.1/PPNSET?PPN=77292189X}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
ABC
\nocite{*}
\printbibliography
\end{document}

Thanks a lot for help!

Konne
  • 624
  • 3
    It is a lualatex problem. It doesn't insert hyphenation points at the hyphen when numbers are involved. (I don't know why). – Ulrike Fischer Feb 24 '15 at 15:01
  • 3
    @UlrikeFischer Interesting. It works if you make digits letters according to the hyphenation system (ie make them lowercase to themselves) luatex breaks 978-3-642-07617-6 if you add \lccode\0=`0 \lccode`1=`1 \lccode`2=`2 \lccode`3=`3 \lccode`4=`4 \lccode`5=`5 \lccode`6=`6 \lccode`7=`7 \lccode`8=`8 \lccode`9=`9` – David Carlisle Feb 24 '15 at 20:08
  • 2
    Issue reported to the LuaTeX team: http://tug.org/pipermail/luatex/2015-February/005074.html – Joseph Wright Feb 24 '15 at 21:34
  • 1
    The bug report http://tracker.luatex.org/view.php?id=925 suggests that this issue was resolved and should have disappeared in LuaTeX 0.80.0. So I'm inclined to vote to close. – moewe Apr 05 '15 at 16:15
  • I have updated the LuaTeX package now (miktex-luatex-bin-2.9; 3/25/2015), but the error is still the same (in my case). – Konne Apr 07 '15 at 14:45
  • @Konne This version of LuaLaTeX identifies itself as 0.79.1, though, so chances are the fix hasn't arrived in MikTeX yet. (Especially since the bug was marked fixed on 2015-03-21.) We can wait a bit longer until we close this question, if you are more comfortable with that. – moewe Apr 07 '15 at 15:32
  • @moewe: Thank you for this information. I wasn't sure which LuaTeX version is used in miktex-luatex-bin-2.9. This site is not available: http://miktex.org/packages/miktex-luatex-bin-2.9. Otherwise I can live with David Carlisle's answer. – Konne Apr 07 '15 at 15:56
  • Even with that version information, I'm not quite sure whether the fix is supposed to have arrived in 0.79.1. I couldn't find anything more concrete on the change logs of these versions. – moewe Apr 07 '15 at 16:05
  • Seems like this issue still not resolved in TL2015 and LuaTeX 0.80.0. – Leonid Mar 06 '16 at 08:44
  • I had a look with LuaLaTeX 1.0 (on MikTeX) and in the MWE I get both ISBNs broken after 978-3-. Can you confirm that? – moewe Feb 17 '17 at 13:49
  • Unfortunately I can not check this right now. I'm using texlive 2016 and AFAIK it uses LuaLaTeX 0.95 (and second one of the MWE is still too long). – Konne Feb 23 '17 at 12:34

1 Answers1

0

Now in TeXLive 2017 (LuaLaTeX 1.0) it is working :). Thank you all.

Konne
  • 624