How can I see a (n.d) if no date is available in a APA 7 reference?

Hi all,

I’m still strugling with the bibliography in typst. Style is APA 7 …
If we don’t have any date we should see at least (n.d.), but we can’t see any brackets with “n.d.” inside.

We still working with zotero and the sync interface.

Any hints to solve this problem?

thanks in advance
Mike

Hello,
could you export one of your references as a bibfile? If there is no date field, or it is an incorrect format, then I can see “n.d.”.
See below, taken from bibliography does not deal with date entry · Issue #1553 · typst/typst · GitHub

% This file was created with Citavi 6.14.0.0

@misc{Michaud.26.09.2020,
	author = {Michaud, Eric J. and Siemion, Andrew P. V. and Drew, Jamie and
	          Worden, S. Pete},
	date = {20-20-20},
	title = {Lunar Opportunities for SETI},
	url = {https://arxiv.org/pdf/2009.12689},
	pagetotal = {7},
	file = {Michaud, Siemion et al. 26.09.2020 - Lunar Opportunities for
	        SETI:Attachments/Michaud, Siemion et al. 26.09.2020 - Lunar
	        Opportunities for SETI.pdf:application/pdf},
	note = {7 pages, submitted as a white paper for the National Academy of
	        Sciences Planetary Science and Astrobiology Decadal Survey 2023-2032},
}
#cite(<Michaud.26.09.2020>)
#bibliography("test.bib", style: "american-psychological-association")

If I have an bib-file entry without any date, I see it correctly in the text, but not in the bibliography

@misc{educa_digitalisierung_nodate,
title = {Digitalisierung in der Bildung},
publisher = {Educa},
author = {{Educa}},
}

My entry in the bibliography looks like:
grafik

That’s it… but as I have found about the apa style, n.d. should also be written in the bibliography …

I found a workaround. I enter the 0000 date in zotero. typst intreprets this as “1AD” and with

show “(1AD, )”:“(o.D.)”

I change it to what I need …

From what I can tell, this seems to be an issue in the APA CSL file, as the date-bib macro (used to display the date in the bibliography list) is basically defined like this:

<macro name="date-bib">
  <!-- ignoring some stuff here -->
  <group>
    <choose>
      <!-- ignoring some other cases which display a date -->
      <else>
        <text term="no date" form="short" />
        <text variable="year-suffix" prefix="-" />
      </else>
    </choose>
  </group>
</macro>

The problem is that according to the CSL spec, a <group> is ignored if all of its variable text children are empty. This is the case for the year-suffix text (which is used as a suffix to distinguish between different entries, e.g. the ‘a’ in “Einstein, 1916a”), thus the full group that also contains the “no date” term is not shown.

To fix this, you can download the CSL file from the repository and edit the date-bib macro so that the <else> group shown above looks like this instead:

<else>
  <text term="no date" form="short" />
  <choose>
    <if variable="year-suffix">
      <text variable="year-suffix" prefix="-" />
    </if>
  </choose>
</else>
2 Likes