Issue with CSL for DOI accessed date [solved]
Dear all,
I have tried to customize the APA csl file to fit my institute's style sheet.
However, I am having a hard time to understand why my macro for accessed date is not working properly for DOI (but it does work for URL). The DOI itself will be printed, but not with access date.
The full file can be found here: https://github.com/yin-ori/open-research/blob/main/ioa-template.csl
I have tried to customize the APA csl file to fit my institute's style sheet.
However, I am having a hard time to understand why my macro for accessed date is not working properly for DOI (but it does work for URL). The DOI itself will be printed, but not with access date.
The full file can be found here: https://github.com/yin-ori/open-research/blob/main/ioa-template.csl
You also want to make sure to change the style ID, otherwise your style will get overwritten by the standard APA style regularly https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step#change_the_style_title_and_id.
Edit: actually, as written, you're explicitly not including the access date when there is a URL -- as the original APA style does, you're first testing for the DOI, if that's present print it with the https://doi.org/ prefix, and only when you don't have a DOI you're printing. You'll want something like:
<macro name="access">
<choose>
<if variable="DOI" match="any">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
<else-if variable="URL">
<text variable="URL"/>
</else-if>
</choose>
<group delimiter=" " prefix=" (" suffix=")">
<text term="retrieved" suffix=":"/>
<date variable="accessed" form="numeric"/>
</group>
</macro>
thank you for your reply
I have changed it to your macro, however it will still show the doi , but not the accessed date for some reason. Do you have any idea why that could still be the case?