1

I am experiencing a weird issue in my bibliography.

I have a bibtex entry like:

@online{psqldocs,
    author = {PostgreSQL Development Team},
    title = "{PostgreSQL Documentation}",
    url = {https://www.postgresql.org/docs/}
}

That results in:

[42] PostgreSQL Development Team. PostgreSQL Documentation, . Retrieved
from: https://www.postgresql.org/docs/.

As you can see, there is an extra comma after the title, as bibtex is waiting for the year field. In fact, if I add a year entry for psqldocs, the formatting is ok, having title, year.

How can I fix this? This is a MWE:

\documentclass[13pt, a4paper, titlepage, oneside]{book}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm]{geometry}
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.2}
\usepackage[fontsize=13pt]{scrextend}
\usepackage{xcolor}
\definecolor{wine}{rgb}{0.5,0,0}
\usepackage{hyperref}
\hypersetup{
    colorlinks = true,
    linkcolor = .,
    citecolor = .,
    filecolor = .,
    menucolor = .,
    runcolor = .,
    urlcolor = wine
}
\renewcommand{\UrlFont}{\small}
\usepackage{breakurl}
\usepackage[square,comma,numbers]{natbib}
\bibliographystyle{unsrtnat}
\begin{document}
    \cite{psqldocs}
    \bibliography{ref}
\end{document}

With ref.bib containing the above bibliography entry.

Please note that, for previous similar entries, I do not see this behavior. For example:

@online{ piezoelectr,
    author = "ScienceDirect",
    title = "{Piezoelectricity}",
    url = "https://www.sciencedirect.com/topics/materials- science/piezoelectricity"
}

results in:

[1] ScienceDirect. Piezoelectricity. Retrieved from: 
https://www.sciencedirect.com/topics/materials-science/piezoelectricity.

as expected.

Note that using "s instead of braces had no effect.

EDIT:

This is the version of the TeX distro I am using (simply obtained inputting pdflatex into my terminal):

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux) (preloaded format=pdflatex)

In addition, I have fixed my MWE. I confirm that I cannot reproduce the described issue. Any clue?

  • While the braces and quotes (or double braces) in the title field are debatable (at least in their current WYSIWYG form, I would use title = {{PostgreSQL} Documentation},), you need double braces for the author: author = {{PostgreSQL Development Team}},. See tex.stackexchange.com/q/10808/35864. (Note that I'm not commenting on the issue whether or not your outer field delimiters should be "..." or {...}. I prefer braces, but "..." should work just as well in this example, and with care also in general: tex.stackexchange.com/q/109064/35864) – moewe Feb 26 at 11:16
  • If "online" does the job ... why not just use "online". It doesn't seem inappropriate! – Paul Stanley Feb 26 at 11:19
  • Mhhh, I stand by my earlier comment, but I just conducted more extensive tests with your MWE and could not reproduce the issue you describe. The entry shows fine as "PostgreSQL Development Team. PostgreSQL Documentation. URL postgresql.org/docs." If you get something different, please double check the MWE and include a picture of the output. – moewe Feb 26 at 11:22
0

Some comments and suggestions:

  • Load the hyperref package last.

  • Since you're loading the setspace package, you have no possible valid excuse for inputting \renewcommand{\baselinestretch}{1.2}. Instead, please input \setstretch{1.2}.

  • Instead of [left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm], please just write [margin=3cm].

  • Do encase {PostgreSQL Development Team} in an extra pair of curly braces. That way, you signal to BibTeX that it's dealing with a so-called "corporate" author rather than with a person with surname Team, first name PostgreSQL, and middle name Development.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{ref.bib}
@online{psqldocs,
    author = {{PostgreSQL Development Team}},
    title = "{PostgreSQL Documentation}",
    url = {https://www.postgresql.org/docs/}
}
@online{ piezoelectr,
    author = "ScienceDirect",
    title = "{Piezoelectricity}",
    url = "https://www.sciencedirect.com/topics/materials- science/piezoelectricity"
}
\end{filecontents}

\documentclass[13pt, a4paper, titlepage, oneside]{book}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[margin=3cm]{geometry}
\usepackage{setspace}
\setstretch{1.2}
%\renewcommand{\baselinestretch}{1.2}
\usepackage[fontsize=13pt]{scrextend}
\usepackage{xcolor}
\definecolor{wine}{rgb}{0.5,0,0}

\usepackage[square,comma,numbers]{natbib}
\bibliographystyle{unsrtnat}

\usepackage{url}
\renewcommand{\UrlFont}{\small}

\usepackage{hyperref}
\hypersetup{
    colorlinks = true,
    linkcolor = .,
    citecolor = .,
    filecolor = .,
    menucolor = .,
    runcolor = .,
    urlcolor = wine
}
\begin{document}
    \cite{psqldocs}, \cite{piezoelectr}
    \bibliography{ref}
\end{document} 
  • Thank you sir for you reply and your correct suggestions. Of course, I wasn't careful while adding new features and packages to my document. Anyway, the extra comma bug is still present. – LucaF Feb 26 at 13:01
  • My bad: adding double braces for author value, the bug does not show up anymore. That's still strange: if I format my PostgreSQL bib entry as the piezoelectr one, I still get the error, while with piezoelectr(and other entries) this issue is completely absent – LucaF Feb 26 at 13:06
  • @LucaF - Did you (a) reorganize the preamble of your document along the lines suggested above, (b) edit the bib entry, and (c) after making the changes, re-run LaTeX, BibTeX, and LaTeX twice more? – Mico Feb 26 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.