如何從 Sigconf、ACM-Reference-Format 中沒有日期的雜項條目中刪除 (nd)?

如何從 Sigconf、ACM-Reference-Format 中沒有日期的雜項條目中刪除 (nd)?

我試圖擺脫(n.d)引文中出現的內容。

以下是我的 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}

我嘗試包含以下程式碼,例如來自就在之前回答\begin{document}。但是,我得到未定義的控制序列\DeclareLabeldate和 的錯誤\field

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

討論暗示它可能需要更多的調整?

答案1

最簡單的解決方案是使用 biblatex。文件ACM-Reference-Format.bbx定義了以下巨集:

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

幸運的是,我們可以使用renewbibmacro以下方式重新定義該巨集:

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

結果,biblatex 記錄如下:

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

沒有日期的渲染:

當省略日期時沒有預設值的 biblatex 參考

相關內容