2

enter image description here

I have some problems with the bibliography of my thesis and Jabref. I don't understand why some URL or DOI go out the borders... Can you help me?

\documentclass{article}
\usepackage[backend=bibtex,style=phys,biblabel=brackets,natbib=true,sorting=none,url=true,hyperref=auto]{biblatex}

\addbibresource{tesi.bib}

\usepackage[autostyle=true]{csquotes}

\begin{document}

\setcounter{biburlnumpenalty}{8000}

\printbibliography[heading=bibintoc]

\end{document}
moewe
  • 175,683

1 Answers1

3

Because we have no bib entrys you use I simply used the example bib file biblatex-examples.bib. The bib entrys kastenholz,sigfridsson,ctan,markey have dois and urls included to test the code.

To get a better layout add the three following lines to your code:

\setcounter{biburlnumpenalty}{8000} % <=================================
\setcounter{biburlucpenalty}{8000}  % <=================================
\setcounter{biburllcpenalty}{8000}  % <=================================

You can change the number 8000 as you need (1 to 10000).

With the following MWE I have no problems with the margins and dois or urls:

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{Hsi_JACS_1975, 
  author = {Edward Hsi and Robert G. Bryant}, 
  title = {Nuclear magnetic resonance relaxation in frozen lysozyme solutions}, 
  journal = {J. Am. Chem. Soc.}, 
  year = {1975}, 
  volume = {97}, 
  number = {11}, 
  pages = {3220--3221}, 
  doi = {10.1021/ja00844a051}, 
  eprint = {dx.doi.org/10.1021/ja00844a051}, 
  url = {dx.doi.org/10.1021/ja00844a051}, 
}
@Article{Brovchenko_ChemPhysChem_2008, 
  author = {Ivan Brovchenko and Alla Oleinikova}, 
  title = {Multiple Phases of Liquid Water}, 
  journal = {Chem\-PhysChem}, 
  year = {2008}, 
  volume = {9}, 
  number = {18}, 
  pages = {2660--2675}, 
  issn = {1439-7641}, 
  doi = {10.1002/cphc.200800639}, 
  keywords = {percolation, phase diagrams, phase transitions, 
      supercritical fluids, thermodynamics}, 
  publisher = {WILEY-VCH Verlag}, 
  url = {dx.doi.org/10.1002/cphc.200800639}, 
}
\end{filecontents}


\documentclass{article}
\usepackage[%
  backend=bibtex,
  style=phys,
  biblabel=brackets,
  natbib=true,
  sorting=none,
  url=true,
  hyperref=auto
]{biblatex}
\usepackage[autostyle=true]{csquotes}

\addbibresource{biblatex-examples.bib}
\addbibresource{\jobname.bib}

\setcounter{biburlnumpenalty}{8000} % <=================================
\setcounter{biburlucpenalty}{8000}  % <=================================
\setcounter{biburllcpenalty}{8000}  % <=================================


\begin{document}

Test \cite{kastenholz,sigfridsson,ctan,markey} 
test \cite{Hsi_JACS_1975,Brovchenko_ChemPhysChem_2008} test

\printbibliography[heading=bibintoc]

\end{document}

with the resulting page:

bibliography

Please try this MWE with your own bib entrys. If you still have problems please add theese bib entrys to your question. Then we can test them on our computers ...

Mensch
  • 65,388
  • Here the word "lysozyme" goes out the margins! – Sebastiano Aug 14 '17 at 07:41
  • @Article{Brovchenko_ChemPhysChem_2008, author = {Ivan Brovchenko and Alla Oleinikova}, title = {Multiple Phases of Liquid Water}, journal = {ChemPhysChem}, year = {2008}, volume = {9}, number = {18}, pages = {2660--2675}, issn = {1439-7641}, doi = {10.1002/cphc.200800639}, keywords = {percolation, phase diagrams, phase transitions, supercritical fluids, thermodynamics}, publisher = {WILEY-VCH Verlag}, url = {http://dx.doi.org/10.1002/cphc.200800639}, } – Sebastiano Aug 14 '17 at 07:48