7

I am trying to get rid of the (n.d) that appears in the citations.

Below is my MWP.

\documentclass[sigconf]{acmart}
\usepackage{filecontents}
\begin{filecontents}{ref.bib}
@misc{google,
  title={Google},
  howpublished={\url{https://google.com}},
  author={Google}
}
\end{filecontents}
\begin{document}

Something to cite~\cite{google}.

\bibliographystyle{ACM-Reference-Format}
\bibliography{ref.bib}

\end{document}

I tried to include the following code, for example, from this answer just before \begin{document}. However, I get Undefined control sequence error for \DeclareLabeldate and \field.

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

This discussion hints that it may require something more to be tweaked?

1 Answer 1

2

The easiest solution is to use biblatex. The file ACM-Reference-Format.bbx defines the following macro:

\newbibmacro*{year}{%
  \iffieldundef{year}%
    {\printtext{[n.\ d.]}}%
    {\printfield{year}}%
}

Fortunately, we can redefine this macro using renewbibmacro in the following way:

\renewbibmacro*{year}{%
  \iffieldundef{year}%
    {}% We omitted the default value "[n. d.]" of ACM here!
    {\printfield{year}}%
}

As a result, the following biblatex record:

@online{speedtest1,
  title = {{SQLite}, speedtest1},
  url   = {https://sqlite.org/cpu.html}
}

Renders without the date:

biblatex reference without the default value when the date is omitted

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .