0

Hi there I'm working on a document report. I'm pretty much satisfied with the overall appearance, but for the sake of me I cannot figure out the issues I'm having with the bibliography.

At a first glance, there are no specific errors but I get prompted with the message: "overfull \hbox ..." which I cannot get rid of and neither I can pinpoint to the exact reference that causes it...

Also, looking more into the section it appears there are some references containing way too many commas (,). It didn't seem I have them in the .bib file, so form where are they originating? Below my code and attached the .bib file, as I'm new maybe someone is able to spot some wrong patterns I've been missing. Any help is greatly appreciated!

\documentclass[12pt]{report}

\usepackage{float} \usepackage{graphicx} % for inserting images \usepackage[inkscapearea=page]{svg} %for SVG import

\usepackage[letterpaper,margin=1in]{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{titlesec} \usepackage{textcomp} \usepackage{setspace} \usepackage{csquotes} \usepackage{authblk} \usepackage{xurl}

\usepackage{hyperref} \hypersetup{ colorlinks, citecolor=blue, filecolor=., linkcolor=maroon, urlcolor=teal, linktoc=all } \usepackage{cleveref}

\usepackage{caption} \usepackage{orcidlink} \usepackage{subcaption}

%\captionsetup[table]{font=small} \captionsetup[figure]{font=small} \renewcommand{\thefigure}{\arabic{figure}}

\definecolor{teal}{rgb}{0.0, 0.5, 0.5} \definecolor{maroon}{rgb}{0.69, 0.19, 0.38} \definecolor{coolblack}{rgb}{0.0, 0.18, 0.39} \definecolor{MSBlue}{rgb}{0.204, 0.353, 0.541} \definecolor{darkcerulean}{rgb}{0.03, 0.27, 0.49}

\usepackage{tocloft} \renewcommand{\cftdot}{} \renewcommand{\baselinestretch}{1.5} \renewcommand{\cfttoctitlefont}{\Large\bfseries\color{black}} %\usepackage{tocbibind} % use this package to automatically insert list of tables and list of figures into the TOC \renewcommand{\cftchapfont}{\Large\bfseries\color{MSBlue}} \renewcommand{\cftsecfont}{\large\bfseries\color{darkcerulean}} \renewcommand{\cftsubsecfont}{\normalsize\bfseries\color{coolblack}}

\title{\Huge\bfseries{Pangenome-based Demographic Inference}} \author{\LARGE{Matteo Tommaso Ungaro}} \date{}

\usepackage[main=english, ngerman]{babel} \usepackage[sorting=ynt]{biblatex} \usepackage{microtype} %could cause some line spacing issues \addbibresource{references.bib} \DeclareNameAlias{author}{family-given}

\titleformat{\chapter}[hang]{\Large\bfseries\color{MSBlue}}{\thechapter}{1em}{} \titleformat{\section}{\large\bfseries\color{darkcerulean}} \titleformat{\subsection}{\normalsize\bfseries\color{coolblack}}

\begin{document}

...

\begin{refcontext}[sorting=nyt] %\emergencystretch=1em %only way to get rid of the warning message \printbibliography[title=References] \addcontentsline{toc}{chapter}{References} \end{refcontext}

\end{document}

Link to .bib: bibliography file

EDIT

Thanks to all, the only things still bothering me is the excessive amount of unwanted and misplaced commas for which I really have no clues...

imnothere
  • 14,215
Matteo
  • 121
  • 6
  • 2
    please add your bib to the question, Your commented out line \emergencystretch=1em %only way to get rid of the warning message is quite likely the correct solution, why did you comment it out? – David Carlisle Feb 17 '24 at 15:01
  • Related and with some possible solutions: https://tex.stackexchange.com/q/442308/35864 – moewe Feb 17 '24 at 15:33
  • I haven't downloaded the .bib file yet, but the output shown in David's answer does not appear to feature too many commas. Can you explain in more detail what you mean by your comment about that? – moewe Feb 17 '24 at 15:34
  • @DavidCarlisle thanks a lot I just wanted to know whether there was an option which did not include the used of \emergencystretch since this could/should indicate something is going wrong with my bibliography. – Matteo Feb 17 '24 at 17:34
  • @moewe If you happen to print that bibliography you will realize there are instances such as this one Albrechtsen, Anders, Nielsen, Finn Cilius, and Nielsen, Rasmus. “Ascertainment biases in SNP chips affect measures of population divergence”. In: Molecular biology and evolution 27.11 (2010), pp. 2534–2547. doi: 10.1093/molbev/msq148. – the very first – where commas are added after both name and surname of all authors... – Matteo Feb 17 '24 at 17:37
  • isn't that \DeclareNameAlias{author}{family-given} so you have a list of authors separated by command but using the Carlisle, David form for each author, but that's a biblatex setp question not for this post (and I don''mt use biblatex much) – David Carlisle Feb 17 '24 at 17:52
  • @David Carlisle Ah I see, apologies I though the two things could be related or somehow... I will accept your answer as a solution and open a more specific issue for that! The idea was, however, to have the references ordered by family name. – Matteo Feb 17 '24 at 17:59
  • references ordered by family name would be the default ordering if you sort at all. (unsorted produces ordering by reference order in the document which is the other common style) – David Carlisle Feb 17 '24 at 18:01
  • @DavidCarlisle you're correct again. In fact, that \DeclareNameAlias{author}{family-given} was the problem for all those extra commas... but what it does is that put the surname before the name which is something I like and don't know how to achieve otherwise... – Matteo Feb 17 '24 at 19:08
  • 1
    @Matteo if you put the surname first you have to have a comma. "Carlisle, David" is OK (although I'd not write it that way). "Carlisle David" is not me. My name is "David Carlisle" – David Carlisle Feb 17 '24 at 19:23
  • @DavidCarlisle Of course, that was clear to me. What confused me is the fact that LaTex put a comma after the name of the first author and the surname of the second one (and the whole rest) only in a handful of instances, however. This is what left me a bit disoriented, as I was asking myself why only for those since the format in the .bib file didn't seem to be different. – Matteo Feb 17 '24 at 19:28
  • @DavidCarlisle Apologies for the confusionI was thrown off by not having a dot (.) for the name. I simply add this – backend=biber, giveninits – to my \usepackage [sorting=ynt]{biblatex} to get the desired effect. This effectively used my .bib to grub surnames and names for authors and put them in the reference in this form: Surname, N. Thanks a lot for being so helpful and pointing out to many useful references! – Matteo Feb 17 '24 at 19:45

1 Answers1

5

In 12 pages of bibliography you have just one entry that is less than 1pt over full

Overfull \hbox (0.99489pt too wide) in paragraph at lines 71--71
[]\T1/cmr/m/n/12 (-20) Garg, Shilpa et al. ^^P  Chromosome-scale, haplotype-res
olved as-sem-bly of hu-man genomes^^Q.

enter image description here

unless the fact that that . is slightly in the margin bothers you I would add

\hfuzz=1pt just before \printbibliography so it does not warn (this makes no change to the output) The default value is .1pt in \fussy mode and .5pt for \sloppy so allowing .995pt in this case isn't too bad.

David Carlisle
  • 757,742
  • very interesting thanks for the insight! I wonder what is the difference between using \hfuzz=1pt and \emergencystretch? I guess at this point is simply a matter of how much space we forgive in the document settings? – Matteo Feb 17 '24 at 17:40
  • @Matteo \emergencystretch changes the typesetting allowing white space to stretch more. \hfuzz does not change the output it is just the level at which tex starts warning. see https://tex.stackexchange.com/questions/50830/do-i-have-to-care-about-bad-boxes/50850#50850 – David Carlisle Feb 17 '24 at 17:42
  • indeed that makes more sense, and I think it is the appropriate fix here. However, as you might have guessed since I'm kind of greenhand with LaTex, could you spot the reason for the many commas present in several references e.g. the first one – I posted it in an answer to a topic above. Thanks in advance! – Matteo Feb 17 '24 at 17:46