Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APA date not working properly with bibtex and YAML #246

Open
gkourgkoutas opened this issue Oct 29, 2024 · 0 comments
Open

APA date not working properly with bibtex and YAML #246

gkourgkoutas opened this issue Oct 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gkourgkoutas
Copy link

gkourgkoutas commented Oct 29, 2024

Description

When I'm using my bibliography and I choose APA7 as cite style, it doesn't matter if I use a biblatex file or YAML (typst hayagriva). In both cases, if the date (year) is added, there are some formatting issues.

Bibtex file:

@online{nistCVE,
	author = {NIST},
	title = {CVE-2021-44228},
	url = {https://nvd.nist.gov/vuln/detail/CVE-2021-44228},
        date = {2021},
	urldate = {2024-10-18},
}

YAML:

nistCVE:
 author: "NIST"
 type: "Web"
 title: "CVE-2021-44228"
 date: "2021"
 url: 
    value: "https://nvd.nist.gov/vuln/detail/CVE-2021-44228"
    date: 2024-10-28

These produce the following output:

grafik

While the output seems fine, there is no "Retrieved + Date", which is the case in latex when \urldate is used.

Note that there is also a comma after the year (2021,) which should not be there if only the year of publication is given. typst expects a full date like 2021-01-01.

If the date (publication year or year in bibtex) is removed...

@online{nistCVE,
	author = {NIST},
	title = {CVE-2021-44228},
	url = {https://nvd.nist.gov/vuln/detail/CVE-2021-44228},
	urldate = {2024-10-18},
}
nistCVE:
 author: "NIST"
 type: "Web"
 title: "CVE-2021-44228"
 url: 
    value: "https://nvd.nist.gov/vuln/detail/CVE-2021-44228"
    date: 2024-10-28

... it shows "Retrieved + Date" what I want to achieve.

grafik

However, as you can see in the screenshot above, after the author, the year is missing!.
The desired output should look like this:

grafik

Steps to reproduce

  • Create a project in typst, the output can be replicated in the web application as well as locally (I use mac + homebrew).
  • Create a .bib or .yml file for the bibliography.
  • Use the date (year of publication) for the reference + URL DATE (the date the site was accessed).

This can be done as follows
bibtex:

urldate = {2024-10-18},

yaml

 url: 
    value: "https://nvd.nist.gov/vuln/detail/CVE-2021-44228"
    date: 2024-10-28

//OR

 url: {value: "https://nvd.nist.gov/vuln/detail/CVE-2021-44228", date: 2024-10-28}

Import the bibliography with APA style:

#bibliography("references.bib", title: "References", style: "apa")

Versions used

Newest version of typst (Webapp)
Newest version of typst (macOS)

Note: I encountered this issue when I use APA style (required by the institution). When using IEEE, everyting works!

Reproduction URL

No response

Browsers

Firefox, Chrome

OS

macOS

@gkourgkoutas gkourgkoutas added the bug Something isn't working label Oct 29, 2024
@laurmaedje laurmaedje transferred this issue from typst/webapp-issues Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant