1

I've already tried to use the code published in this question to write 'n. d.' to reference entries without date. But, I don't manage to get the desired result. I've read several similar questions but haven't succeed.

I use biblatex, ieee reference style and have different types of references: web sites, books, articles, etc in a bib document. Somebody could explain how to do what I want in easy words?

For example, the next code writes "n. d." where there's no date field. But every date in other references turns "n. d." too.

\newcommand{\mkbibnodate}{n\adddot d\adddot}
\AtEveryCitekey{\iffieldundef{labelyear}{\restorefield{labelyear}{\mkbibnodate}}{}}
\AtEveryBibitem{\iffieldundef{labelyear}{\restorefield{year}{\mkbibnodate}}{}}

And here I show a minimal compilable example of mi code where dates are preserved (thanks to moewe for the idea). You can add the first snipped of code to the preamble and you'll see how the field date turns to "n. d.".

\documentclass{article} 
\usepackage[utf8]{inputenc}
\usepackage[
style=ieee,
sorting=none
]{biblatex}
\begin{filecontents}{bibliography.bib}
@online{Foundation,
author = {Foundation, Python Software},
title = {{re — Operaciones con expresiones regulares}},
url = {https://docs.python.org/es/3/library/re.html},
urldate = {2021-07-26}
}
@book{Hai-Jew2017,
address = {Cham},
editor = {Hai-Jew, Shalin},
pages = {XXII, 295},
publisher = {Springer International Publishing},
title = {{Data Analytics in Digital Humanities}},
year = {2017}
}
\end{filecontents}
\addbibresource{bibliography.bib}

\begin{document}
\nocite{*}
\printbibliography[]
\end{document}

Thank you very much for your help! = )

1
  • It would be much easier to help you if you could post a compilable example document showing what you have so far (your biblatex setup and a few example .bib entries). With the snippets shown so far it is not too clear what is going on: tex.meta.stackexchange.com/q/228/35864.
    – moewe
    Aug 31, 2021 at 14:26

1 Answer 1

0

These solutions are very style dependent, but here is one that should work for biblatex-ieee. It will print "n.d." in all places where the bibliography style would attempt to print a date if the date is not given in the .bib file. It works via a simple redefinition of the date bibmacro.

\documentclass{article} 
\usepackage[
  style=ieee,
  sorting=none
]{biblatex}

\renewbibmacro*{date}{%
  \iffieldundef{year}
    {\bibstring{nodate}}
    {\printdate}}

\begin{filecontents}{\jobname.bib}
@online{Foundation,
  author  = {{Python Software Foundation}},
  title   = {{re} -- Operaciones con expresiones regulares},
  url     = {https://docs.python.org/es/3/library/re.html},
  urldate = {2021-07-26},
  langid  = {spanish},
}
@book{Hai-Jew2017,
  address   = {Cham},
  editor    = {Hai-Jew, Shalin},
  pagetotal = {XXII, 295},
  publisher = {Springer International Publishing},
  title     = {Data Analytics in Digital Humanities},
  year      = {2017},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

Python Software Foundation. “re – Operaciones con expresiones regulares.” (n.d.), [Online]. Available: https://docs.python.org/es/3/library/re.html (visited on 07/26/2021).

2

You must log in to answer this question.

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