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

Bibliography handles "$" weirdly #2669

Closed
1 task done
genericusername3 opened this issue Nov 13, 2023 · 3 comments
Closed
1 task done

Bibliography handles "$" weirdly #2669

genericusername3 opened this issue Nov 13, 2023 · 3 comments
Labels
bibliography Anything about citations and bibliographies. bug Something isn't working urgent Should be fixed before the next release.

Comments

@genericusername3
Copy link

Description

I'm using the bibliography function to display the following bibliography item:

amazon-outage-costs:
  type: article
  title: Amazon ‘missed out on $34m in sales during internet outage’
  author:
  - Chapman, Ben
  date: 2021-06-08
  url:
    value: "https://www.independent.co.uk/news/business/amazon-down-internet-outage-sales-b1861737.html"
    date: 2023-11
  parent:
    type: periodical
    title: Independent.co.uk
    publisher: Independent

The output looks like this:
grafik

The Unicode quotes are handled correctly, but the dollar sign seems to be interpreted as the beginning of math mode. Replacing with \$ or \\$ to escape the dollar sign results in the title being truncated:
grafik
grafik

What does work, however, is using math mode to display a dollar sign:

  title: `Amazon ‘missed out on $dollar$34m in sales during internet outage’

I think text in bibliographies should not be parsed for math instructions, because titles don't usually include math formatting.

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst
@genericusername3 genericusername3 added the bug Something isn't working label Nov 13, 2023
@T0mstone
Copy link
Contributor

From a quick check of arXiv catchup for mathematical physics, about 20% of the 91 papers contain math formatting in their title...

@laurmaedje
Copy link
Member

This is indeed a feature, but the fact that escaping it is broken is a bug.

@Enivex Enivex added the bibliography Anything about citations and bibliographies. label Nov 13, 2023
@genericusername3
Copy link
Author

In that case, maybe Typst (or Hayagriva) should emit a warning if there's incomplete math, because I would expect plain dollar signs aren't that uncommon in titles either.

But, in fairness, the first thing I tried was escaping the dollar sign so I'd agree it's not that big an issue if escaping works

@laurmaedje laurmaedje added the urgent Should be fixed before the next release. label Nov 14, 2023
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 urgent Should be fixed before the next release.
Projects
None yet
Development

No branches or pull requests

4 participants