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

Bib: Failed to parse file, where month equals Sep--Oct #2849

Closed
1 task done
LasseRosenow opened this issue Dec 4, 2023 · 12 comments
Closed
1 task done

Bib: Failed to parse file, where month equals Sep--Oct #2849

LasseRosenow opened this issue Dec 4, 2023 · 12 comments
Labels
bibliography Anything about citations and bibliographies. bug Something isn't working

Comments

@LasseRosenow
Copy link
Sponsor

Description

I have the following bibtex file:

@article{asdf,
  author = {Meg},
  title = {{Test}},
  journal   = {Computer Communications},
  volume    = {36},
  year      = {2013},
  month     = {Sep--Oct},
}

But it results in the following error:

Failed to parse BibLaTeX file (test.bib:1: invalid number)

This is caused by the month field:

@article{asdf,
  month     = {Sep--Oct},
}

I am using a large bibtex library, that is maintained by a research group of my university.
The problem is, that this library has many entries that write the month like above.
Which causes me not to be able to use typst, except I find all the affected bib entries.

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst
@LasseRosenow LasseRosenow added the bug Something isn't working label Dec 4, 2023
@laurmaedje laurmaedje added the bibliography Anything about citations and bibliographies. label Dec 4, 2023
@DerDrodt
Copy link

DerDrodt commented Dec 6, 2023

BibLaTeX does not support month ranges like you have used here, and for bibtex, I cannot find anything about it neither.

What is your expected behavior? What should the output be?

@LasseRosenow
Copy link
Sponsor Author

To be honest those bibtex entries are not created by me, nor used by me. If it comes to it I would be fine if typst would just ignore their incorrect month field.

For me personally it is just a problem, because the research group I am working for, is providing a huge bibtex library that I am obligated to use and there are a few entries like this.
These entries are not used by me and probably incorrect, but finding them all and fixing them is to much effort for me personally.

I could have a check later how latex handles these. But I can say that at least it would ignore them since my projects in latex work just fine even when including the bib library.

@LasseRosenow
Copy link
Sponsor Author

LasseRosenow commented Dec 6, 2023

Apart form this I also want to add that the error message reported by typst is totally useless.

To find what was actually wrong I needed to go through my massive bib file and keep deleting entries until it compiled.

I generally find this to be a problem with typst. Are there any plans to improve the typst error to actually report at the places where the error originate from and by also giving more useful information than this cryptic "line 1 and invalid number" I don't see why there is an invalid number and I also don't think that is line 1.

@laurmaedje
Copy link
Member

@LasseRosenow There is no need to become offensive. The error messages for biblatex files aren't great yet because (a) the biblatex crate doesn't produce ideal error messages yet, and (b) there is no infrastructure to annotate errors in non-Typst files. All of these things take time to implement.

@LasseRosenow
Copy link
Sponsor Author

Actually when writing my last post I didn't intend to be offensive at all. I am very sorry that this was received differently than intended.

Maybe the terms totally useless sound a bit hard, but I think it is exactly what I felt this error message is after I was searching for the problem for a very long time. In the end for me these words felt like they would fit the most.

But that doesn't mean, that I expect typst to give me super perfect error messages etc. especially considering how young this project is.

I only intended to share this information without any further implications.

But I think it is worth mentioning issues if I discover them. Especially since I had this problem on other areas of typst as well. So I am just hoping this is something to be improved in the future.

@LasseRosenow
Copy link
Sponsor Author

The error messages for biblatex files aren't great yet because (a) the biblatex crate doesn't produce ideal error messages yet

Ah I see that is reasonable I better open an issue in their repository then if not already.

Thanks for clarifying :)

@laurmaedje
Copy link
Member

Closing in favor of typst/biblatex#47

@laurmaedje laurmaedje closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
@RonaldAJ
Copy link

RonaldAJ commented May 29, 2024

Just reproduced with the following bibtex:

`@Article{Pineda1997,
Title = {Bang, click, thud, or whack?},
Author = {Pineda, FJ and Cauwenberghs, G and Edwards, RT and Ryals, KT and Steigerwald, DG},
Journal = {JOHNS HOPKINS APL TECHNICAL DIGEST},
Year = {1997},

Month = {APR-JUN},
Number = {2},
Pages = {244-253},
Volume = {18},

ISSN = {0270-5214},
Owner = {elburg},
Times-cited = {1},
Unique-id = {ISI:A1997WU25900011}
}
`

The use of two months separated by a '-' is important, without that it works as expected.

@RonaldAJ
Copy link

Using "4-6" instead of "APR-JUN" is not problematic.

@RonaldAJ
Copy link

@laurmaedje Is this minimal enough to reinvestigate? I found the problem using https://typst.app.

@laurmaedje
Copy link
Member

As @DerDrodt mentioned, month ranges are fundamentally not supported by the format, so I don't think there's anything we can do.

@RonaldAJ
Copy link

Thanks! I also see now that JabRef calls these fields deprecated. So I guess the best option is to remove them.

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

4 participants