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

Inconsistent styling with bibliography.full: true #3986

Open
1 task done
tingerrr opened this issue Apr 23, 2024 · 4 comments
Open
1 task done

Inconsistent styling with bibliography.full: true #3986

tingerrr opened this issue Apr 23, 2024 · 4 comments
Labels
bibliography Anything about citations and bibliographies. bug Something isn't working

Comments

@tingerrr
Copy link
Contributor

tingerrr commented Apr 23, 2024

Description

When using bilbiography(full: true, ...) to show all references, the styling seems to be inconsistent when a cite style like alphanumeric is used. The markers fall back to the biliography style (ieee in my case).

full: true without explicit cite full: true with explicit cite
image image

I assume this is because alphanumeric is a style on cite only, so the lack of cite elements means the styling isn't applied.

At face value, I can see that this "works as intended", but I never understood (or asked) why alphanumeric is only a style on cite in the first place. I suppose that's related to CSL.

I did not attempt minimizing this, but this should suffice:

#set cite(style: "alphanumeric")
#bilbiography(full: true, "bib.yaml")

// cite some key always to enforce the style
#cite("some-key")

// comment this out to observe the difference
#for key in yaml("bib.yaml") {
  cite(label(key))
}

Tested using typst 0.11.0 (1e645b39).

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst
@tingerrr tingerrr added the bug Something isn't working label Apr 23, 2024
@JakobSachs
Copy link
Contributor

Able to replicate this in the webapp (url: https://typst.app/project/rNnLsTjkhkCnV5I0HqrvQb)
But had to unpack the iteration to key-value since the provided example-code doesn't compile:

#set cite(style: "alphanumeric")
#bibliography(full: true, "bib.yaml")

// cite some key always to enforce the style
#cite(<harry>)

// comment this out to observe the difference
#for (key,value) in yaml("bib.yaml") {
  cite(label(key))
}

bib.yaml (example taken from https://github.com/typst/hayagriva/blob/main/docs/file-format.md)

harry:
    type: Book
    title: Harry Potter and the Order of the Phoenix
    author: Rowling, J. K.
    volume: 5
    page-total: 768
    date: 2003-06-21

electronic:
    type: Web
    title: Ishkur's Guide to Electronic Music
    serial-number: v2.5
    author: Ishkur
    url: http://www.techno.org/electronic-music-guide/

Before commenting out iteration over keys:
Screenshot 2024-04-24 at 11 09 27

After commenting out the iteration:
Screenshot 2024-04-24 at 11 09 40


Looks like un-intended/buggy behaviour to me.

@tingerrr
Copy link
Contributor Author

But had to unpack the iteration to key-value since the provided example-code doesn't compile:

My bad, I wrote it from memory and forgot about that.

@JakobSachs
Copy link
Contributor

Okay you can actually reduce this by alot more to demonstrate the issue/behavior.

#set cite(style: "alphanumeric")
#bibliography(full: true, "bib.yaml")
#cite(<harry>)

This renders the actually cited entry <harry> with the specified "alphanumeric" style but the rest of the entries with the auto style (which defaults to "ieee"):

Screenshot 2024-04-24 at 13 43 22

This changes though once you specify the bibliographies style:

#set cite(style: "alphanumeric")
#bibliography(full: true, "bib.yaml", style: "apa")
#cite(<harry>)
Screenshot 2024-04-24 at 13 47 06

Where the rendered bibliography gets styled according to the specified "apa" style , but the symbol generated by #cite is still in the "alphanumeric" style.


After some reconsideration im not sure if this would actually be a bug/unwanted behaviour 🤔.
But should definitely be documented in my eyes

@tingerrr
Copy link
Contributor Author

It seems to come down to the fact that we cannot specify the reference back link style on the bibliography, if the CLS style is unsuitable for it. It is inferred from the cite element that's used, if there is no cite element it isn't inferred correctly.

But I think the reference back link style could fall back to the cite style chain where applicable.

Using more than style also causes interesting results depending on whether a cite group can be created or not:

#set cite(style: "alphanumeric")
#bibliography("assets/bib.yaml", full: true)

@electronic
// <-- remove this blank line to create a cite group
#cite(<harry>, style: "chicago-author-date")

With cite group:
image

Without cite group:
image

@laurmaedje laurmaedje added the bibliography Anything about citations and bibliographies. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bibliography Anything about citations and bibliographies. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants