latexcitationsbiblatex

Biblatex: website citation is italicized and uses title instead of author when removing "n.d."


I'm trying to cite a website using the authoryear style with BibLaTeX.

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{filecontents}{ref.bib}
@online{nanopore,
    author    = "{Oxford Nanopore Technologies}",
    title     = "Oxford Nanopore Technologies Github",
    url       = "https://github.com/nanoporetech"
}
\end{filecontents}


\usepackage[
backend=biber,
style=authoryear,
sorting=nyt,
citestyle=authoryear,
maxbibnames=99
]{biblatex}

\addbibresource{ref.bib}

\begin{document}

\parencite{nanopore}

\end{document}

This gives me

This citation

which is fine except I want to remove the "n.d.", so then I do this to remove it:

\DeclareLabeldate[online]{%
  \field{date}
  \field{year}
  \field{eventdate}
  \field{origdate}
  \field{urldate}
}

And then my citation changes, so 1) it prints the title instead of the author, and 2) the citation is italicizes (which is probably because it's printing the title instead of author).

Italicized citation using title instead of author

Any idea why this is happening and how I can prevent it?

Thanks in advance!

EDIT: Link to picture with space added for @samcarter_is_at_topanswers.xyz


Solution

  • You could change the translation for "n.d." for the online type:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    
    \begin{filecontents}{ref.bib}
    @online{nanopore,
        author    = "{Oxford Nanopore Technologies}",
        title     = "Oxford Nanopore Technologies Github",
        url       = "https://github.com/nanoporetech"
    }
    \end{filecontents}
    
    
    \usepackage[
    backend=biber,
    style=authoryear,
    sorting=nyt,
    citestyle=authoryear,
    maxbibnames=99,
    ]{biblatex}
    
    \DefineBibliographyStrings{english}{%
    nodate = {\ifboolexpr{test{\ifentrytype{online}}}{\unspace}{n\adddot d\adddot}},
    }
    
    \addbibresource{ref.bib}
    
    \begin{document}
    
    \parencite{nanopore}
    
    \end{document}
    

    enter image description here